MFEM v4.10.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::OversetFindPointsGSLIB Class Reference

OversetFindPointsGSLIB enables use of findpts for arbitrary number of overlapping grids. More...

#include <gslib.hpp>

Inheritance diagram for mfem::OversetFindPointsGSLIB:
[legend]
Collaboration diagram for mfem::OversetFindPointsGSLIB:
[legend]

Public Member Functions

 OversetFindPointsGSLIB ()
 
 OversetFindPointsGSLIB (MPI_Comm comm_)
 
void Setup (Mesh &m, const int meshid, GridFunction *gfmax=nullptr, const double bbox_rel_size_inc=0.1, const double newt_tol=1.0e-12, const int npt_max=256)
 
void FindPoints (const Vector &point_pos, const Array< unsigned int > &point_id, const int point_pos_ordering=Ordering::byNODES)
 
void Interpolate (const Vector &point_pos, const Array< unsigned int > &point_id, const GridFunction &field_in, Vector &field_out, const int point_pos_ordering=Ordering::byNODES)
 
virtual void Interpolate (const GridFunction &field_in, Vector &field_out)
 Interpolation of field values at prescribed reference space positions.
 
virtual void Interpolate (const GridFunction &field_in, Vector &field_out, const int field_out_ordering)
 Interpolation of field values, with output ordering specification.
 
void Interpolate (const Vector &point_pos, const GridFunction &field_in, Vector &field_out, int point_pos_ordering=Ordering::byNODES)
 Search positions and interpolate.
 
void Interpolate (const Vector &point_pos, const GridFunction &field_in, Vector &field_out, const int point_pos_ordering, const int field_out_ordering)
 Search positions and interpolate with given point and output ordering.
 
void Interpolate (Mesh &m, const Vector &point_pos, const GridFunction &field_in, Vector &field_out, const int point_pos_ordering=Ordering::byNODES)
 
- Public Member Functions inherited from mfem::FindPointsGSLIB
 FindPointsGSLIB ()
 Serial constructor.
 
 FindPointsGSLIB (Mesh &mesh_in, const double bbox_rel_size_inc=0.1, const double newt_tol=1.0e-12, const int npt_max=256)
 Serial constructor + setup with given Mesh (see Setup)
 
 FindPointsGSLIB (MPI_Comm comm_)
 Constructor for ParMesh.
 
 FindPointsGSLIB (ParMesh &mesh_in, const double bbox_rel_size_inc=0.1, const double newt_tol=1.0e-12, const int npt_max=256)
 Constructor + setup with given ParMesh (see Setup)
 
virtual ~FindPointsGSLIB ()
 
 FindPointsGSLIB (const FindPointsGSLIB &)=delete
 
FindPointsGSLIBoperator= (const FindPointsGSLIB &)=delete
 
void Setup (Mesh &m, const double bbox_rel_size_inc=0.1, const double newt_tol=1.0e-12, const int npt_max=256)
 Preprocess the internal mesh in gslib.
 
void SetupSurf (Mesh &m, const double bbox_rel_size_inc=0.1, const double newt_tol=1.0e-12)
 Preprocess the surface mesh to compute data for FindPoints.
 
void SetupSurfWithAABBExpansion (Mesh &m, const Vector &aabb_sz_inc, const double newt_tol=1.0e-12)
 Preprocess the surface mesh to compute data for FindPoints using absolute AABB expansion.
 
void FindPoints (const Vector &point_pos, int point_pos_ordering=Ordering::byNODES)
 Searches positions given in physical space by point_pos.
 
void FindPoints (const ParticleVector &point_pos)
 Convenience function when point positions are in a ParticleVector.
 
void FindPointsSurf (const Vector &point_pos, int point_pos_ordering=Ordering::byNODES)
 Searches positions given in physical space by point_pos on surface mesh.
 
void FindPointsSurf (const ParticleVector &point_pos)
 Convenience function when point positions are in a ParticleVector.
 
void FindPoints (Mesh &m, const Vector &point_pos, const int point_pos_ordering=Ordering::byNODES, const double bbox_rel_size_inc=0.1, const double newt_tol=1.0e-12, const int npt_max=256)
 Setup FindPoints and search positions.
 
virtual void InterpolateSurf (const GridFunction &field_in, Vector &field_out)
 Same as Interpolate but for surface meshes.
 
virtual void InterpolateSurf (const GridFunction &field_in, Vector &field_out, const int field_out_ordering)
 Same as Interpolate but for surface meshes with specified output ordering.
 
void Interpolate (const Vector &point_pos, const GridFunction &field_in, Vector &field_out, int point_pos_ordering=Ordering::byNODES)
 Search positions and interpolate.
 
void Interpolate (const Vector &point_pos, const GridFunction &field_in, Vector &field_out, const int point_pos_ordering, const int field_out_ordering)
 Search positions and interpolate with given point and output ordering.
 
void Interpolate (Mesh &m, const Vector &point_pos, const GridFunction &field_in, Vector &field_out, const int point_pos_ordering=Ordering::byNODES)
 
virtual void SetL2AvgType (AvgType avgtype_)
 Average type to be used for L2 functions in-case a point is located at an element boundary where the function might be multi-valued.
 
virtual void SetDefaultInterpolationValue (double interp_value_)
 Set the default interpolation value for points that are not found in the mesh.
 
virtual void SetDistanceToleranceForPointsFoundOnBoundary (double bdr_tol_)
 Tolerance for detecting points outside the 'curvilinear' boundary.
 
virtual void SetGPUtoCPUFallback (bool mode)
 Enable/Disable use of CPU functions for GPU data if the gslib version is older.
 
virtual void FreeData ()
 Cleans up memory allocated internally by gslib.
 
virtual const Array< unsigned int > & GetCode () const
 Return code for each point searched by FindPoints: inside element (0), element boundary (1), or not found (2).
 
virtual const Array< unsigned int > & GetElem () const
 Return element number for each point found by FindPoints.
 
virtual const Array< unsigned int > & GetProc () const
 Return MPI rank on which each point was found by FindPoints.
 
virtual const VectorGetReferencePosition () const
 Return reference coordinates for each point found by FindPoints.
 
virtual const VectorGetDist () const
 Return distance between the sought and the found point in physical space.
 
virtual const Array< unsigned int > & GetGSLIBElem () const
 Return element number for each point found by FindPoints corresponding to GSLIB mesh. gsl_mfem_elem != gsl_elem for mesh with simplices.
 
virtual const VectorGetGSLIBReferencePosition () const
 Return reference coordinates in [-1,1] (internal range in GSLIB) for each point found by FindPoints.
 
Array< unsigned int > GetPointsNotFoundIndices () const
 Get array of indices of not-found points.
 
void GetAxisAlignedBoundingBoxes (Vector &aabb) const
 
void GetOrientedBoundingBoxes (DenseTensor &obbA, Vector &obbC, Vector &obbV) const
 
MeshGetBoundingBoxMesh (int type)
 Return the bounding boxes as a mesh on rank 0.
 
virtual const VectorGetGLLMesh () const
 Return the internal vector of mesh node coordinates at the GLL points.
 
virtual void DistributePointInfoToOwningMPIRanks (Array< unsigned int > &recv_elem, Vector &recv_ref, Array< unsigned int > &recv_code)
 
virtual void DistributeInterpolatedValues (const Vector &int_vals, const int vdim, const int ordering, Vector &field_out) const
 

Protected Attributes

bool overset
 
unsigned int u_meshid
 
Vector distfint
 
- Protected Attributes inherited from mfem::FindPointsGSLIB
Meshmesh
 
Array< Mesh * > mesh_split
 
Array< IntegrationRule * > ir_split
 
Array< IntegrationRule * > ir_split_sol
 
int ir_split_sol_order = -1
 Order at which ir_split_sol was built; -1 means not built.
 
Array< FiniteElementSpace * > fes_rst_map
 
Array< GridFunction * > gf_rst_map
 
FiniteElementCollectionfec_map_lin
 
void * fdataD
 
struct gslib::crystal * cr
 
struct gslib::comm * gsl_comm
 
int dim
 
int spacedim
 
int points_cnt
 
Array< unsigned int > gsl_code
 
Array< unsigned int > gsl_proc
 
Array< unsigned int > gsl_elem
 
Array< unsigned int > gsl_mfem_elem
 
Vector gsl_mesh
 
Vector gsl_ref
 
Vector gsl_dist
 
Vector gsl_mfem_ref
 
Array< unsigned int > recv_proc
 
Array< unsigned int > recv_index
 
bool setupflag
 
double default_interp_value
 
AvgType avgtype
 
Array< int > split_element_map
 
Array< int > split_element_index
 
Array< int > split_element_geom
 
int NE_split_total
 
int mesh_points_cnt
 
double bdr_tol
 
bool gpu_to_cpu_fallback = false
 
bool obb_check = true
 
struct mfem::FindPointsGSLIB::DevStruct DEV
 

Additional Inherited Members

- Public Types inherited from mfem::FindPointsGSLIB
enum  AvgType { NONE , ARITHMETIC , HARMONIC }
 
- Protected Member Functions inherited from mfem::FindPointsGSLIB
void SetupCrystal ()
 
void FreeCrystal ()
 
virtual void InterpolateH1 (const GridFunction &field_in, Vector &field_out, const int field_out_ordering)
 
virtual void InterpolateGeneral (const GridFunction &field_in, Vector &field_out, const int field_out_ordering)
 
virtual void SetupSplitMeshes ()
 Since GSLIB is designed to work with quads/hexes, we split every triangle/tet/prism/pyramid element into quads/hexes.
 
virtual void SetupIntegrationRuleForSplitMesh (Mesh *mesh, IntegrationRule *irule, int order)
 Setup integration points that will be used to interpolate the nodal location at points expected by GSLIB.
 
virtual void SetupIntegrationRules (const int order, Array< IntegrationRule * > &ir_out)
 Build integration rules at the given order for each split mesh and store them in ir_out. Requires that SetupSplitMeshes has already been called.
 
virtual void SetupSplitMeshesAndIntegrationRules (const int order)
 Helper function that calls SetupSplitMeshes and SetupIntegrationRules.
 
virtual void GetNodalValues (const GridFunction *gf_in, Vector &node_vals, const Array< IntegrationRule * > *ir_in=nullptr, bool by_element=false) const
 Get GridFunction value at the points expected by GSLIB.
 
virtual void MapRefPosAndElemIndices ()
 Map {r,s,t} coordinates from [-1,1] to [0,1] for MFEM. For simplices, find the original element number (that was split into micro quads/hexes) during the setup phase.
 
void FindPointsLocal3 (const Vector &point_pos, int point_pos_ordering, Array< unsigned int > &gsl_code_dev_l, Array< unsigned int > &gsl_elem_dev_l, Vector &gsl_ref_l, Vector &gsl_dist_l, int npt)
 FindPoints locally on device for 3D.
 
void FindPointsLocal2 (const Vector &point_pos, int point_pos_ordering, Array< unsigned int > &gsl_code_dev_l, Array< unsigned int > &gsl_elem_dev_l, Vector &gsl_ref_l, Vector &gsl_dist_l, int npt)
 FindPoints locally on device for 2D.
 
void FindPointsSurfLocal3 (const Vector &point_pos, int point_pos_ordering, Array< unsigned int > &gsl_code_dev_l, Array< unsigned int > &gsl_elem_dev_l, Vector &gsl_ref_l, Vector &gsl_dist_l, int npt)
 FindPoints locally on device for 3D surface elements.
 
void FindPointsEdgeLocal3 (const Vector &point_pos, int point_pos_ordering, Array< unsigned int > &gsl_code_dev_l, Array< unsigned int > &gsl_elem_dev_l, Vector &gsl_ref_l, Vector &gsl_dist_l, int npt)
 FindPoints locally on device for 3D edge elements.
 
void FindPointsEdgeLocal2 (const Vector &point_pos, int point_pos_ordering, Array< unsigned int > &gsl_code_dev_l, Array< unsigned int > &gsl_elem_dev_l, Vector &gsl_ref_l, Vector &gsl_dist_l, int npt)
 FindPoints locally on device for 2D edge elements.
 
void InterpolateLocal3 (const Vector &field_in, Array< int > &gsl_elem_dev_l, Vector &gsl_ref_l, Vector &field_out, int npt, int ncomp, int dof1dsol)
 Interpolate on device for 3D.
 
void InterpolateLocal2 (const Vector &field_in, Array< int > &gsl_elem_dev_l, Vector &gsl_ref_l, Vector &field_out, int npt, int ncomp, int dof1dsol)
 Interpolate on device for 2D.
 
void InterpolateLocal1 (const Vector &field_in, Array< int > &gsl_elem_dev_l, Vector &gsl_ref_l, Vector &field_out, int npt, int ncomp, int dof1dsol)
 Interpolate on device for 1D.
 
void SetupDevice ()
 Prepare data for device execution for volume meshes.
 
void FindPointsOnDevice (const Vector &point_pos, const int point_pos_ordering=Ordering::byNODES)
 Searches positions given in physical space by point_pos. These positions can be ordered byNodes: (XXX...,YYY...,ZZZ) or byVDim: (XYZ,XYZ,....XYZ) specified by point_pos_ordering.
 
void InterpolateOnDevice (const Vector &field_in_evec, Vector &field_out, const int nel, const int ncomp, const int dof1dsol, const int ordering)
 Interpolation of field values at prescribed reference space positions.
 
void InterpolateSurfBase (const Vector &field_in, Vector &field_out, const int nel, const int ncomp, const int dof1dsol, const int field_out_ordering)
 Interpolation of field values at prescribed reference space positions for surface meshes.
 
void FindPointsEdgeSetup2 (DevStruct &devs, const double *const elx[2], const unsigned n, const unsigned int nel, const unsigned m, const double bbox_rel_size_inc, const unsigned int local_hash_size, const unsigned int global_hash_size, const Vector *aabb_sz_inc)
 Preprocess 2D surface mesh needed for FindPoints.
 
void FindPointsSurfSetup3 (DevStruct &devs, const double *const elx[3], const unsigned n, const unsigned int nel, const unsigned m, const double bbox_rel_size_inc, const unsigned int local_hash_size, const unsigned int global_hash_size, const int rD, const Vector *aabb_sz_inc)
 Preprocess 3D surface mesh needed for FindPoints.
 
void SetupSurfBase (Mesh &m, const double bbox_rel_size_inc, const Vector *aabb_sz_inc, const double newt_tol)
 Shared implementation for the public surface-setup methods.
 

Detailed Description

OversetFindPointsGSLIB enables use of findpts for arbitrary number of overlapping grids.

The parameters in this class are the same as FindPointsGSLIB with the difference of additional inputs required to account for more than 1 mesh.

Definition at line 698 of file gslib.hpp.

Constructor & Destructor Documentation

◆ OversetFindPointsGSLIB() [1/2]

mfem::OversetFindPointsGSLIB::OversetFindPointsGSLIB ( )
inline

Definition at line 706 of file gslib.hpp.

◆ OversetFindPointsGSLIB() [2/2]

mfem::OversetFindPointsGSLIB::OversetFindPointsGSLIB ( MPI_Comm comm_)
inline

Definition at line 710 of file gslib.hpp.

Member Function Documentation

◆ FindPoints()

void mfem::OversetFindPointsGSLIB::FindPoints ( const Vector & point_pos,
const Array< unsigned int > & point_id,
const int point_pos_ordering = Ordering::byNODES )

Searches positions given in physical space by point_pos. All output Arrays and Vectors are expected to have the correct size.

Parameters
[in]point_posPositions to be found.
[in]point_idIndex of the mesh that the point belongs to (corresponding to meshid in Setup).
[in]point_pos_orderingOrdering of the points: byNodes: (XXX...,YYY...,ZZZ) or byVDim: (XYZ,XYZ,....XYZ)

Definition at line 4818 of file gslib.cpp.

◆ Interpolate() [1/6]

void mfem::FindPointsGSLIB::Interpolate ( const GridFunction & field_in,
Vector & field_out )
virtual

Interpolation of field values at prescribed reference space positions.

Parameters
[in]field_inFunction values that will be interpolated on the reference positions. Note: it is assumed that field_in is in H1 and in the same space as the mesh that was given to Setup().
[out]field_outInterpolated values. For points that are not found the value is set to default_interp_value. The output ordering is determined from field_in.
Note
: field_out is moved to device if field_in is on device. Otherwise, field_out memory allocation is not changed.

Reimplemented from mfem::FindPointsGSLIB.

Definition at line 524 of file gslib.cpp.

◆ Interpolate() [2/6]

void mfem::FindPointsGSLIB::Interpolate ( const GridFunction & field_in,
Vector & field_out,
const int field_out_ordering )
virtual

Interpolation of field values, with output ordering specification.

Reimplemented from mfem::FindPointsGSLIB.

Definition at line 527 of file gslib.cpp.

◆ Interpolate() [3/6]

void mfem::OversetFindPointsGSLIB::Interpolate ( const Vector & point_pos,
const Array< unsigned int > & point_id,
const GridFunction & field_in,
Vector & field_out,
const int point_pos_ordering = Ordering::byNODES )

Search positions and interpolate

Definition at line 4898 of file gslib.cpp.

◆ Interpolate() [4/6]

void mfem::FindPointsGSLIB::Interpolate ( const Vector & point_pos,
const GridFunction & field_in,
Vector & field_out,
const int point_pos_ordering,
const int field_out_ordering )

Search positions and interpolate with given point and output ordering.

Definition at line 551 of file gslib.cpp.

◆ Interpolate() [5/6]

void mfem::FindPointsGSLIB::Interpolate ( const Vector & point_pos,
const GridFunction & field_in,
Vector & field_out,
int point_pos_ordering = Ordering::byNODES )

Search positions and interpolate.

The ordering (byNODES or byVDIM) of the output values in field_out corresponds to the ordering used in the input GridFunction field_in.

Definition at line 546 of file gslib.cpp.

◆ Interpolate() [6/6]

void mfem::FindPointsGSLIB::Interpolate ( Mesh & m,
const Vector & point_pos,
const GridFunction & field_in,
Vector & field_out,
const int point_pos_ordering = Ordering::byNODES )

Setup FindPoints, search positions and interpolate. The ordering (byNODES or byVDIM) of the output values in field_out corresponds to the ordering used in the input GridFunction field_in.

Definition at line 558 of file gslib.cpp.

◆ Setup()

void mfem::OversetFindPointsGSLIB::Setup ( Mesh & m,
const int meshid,
GridFunction * gfmax = nullptr,
const double bbox_rel_size_inc = 0.1,
const double newt_tol = 1.0e-12,
const int npt_max = 256 )

Initializes the internal mesh in gslib, by sending the positions of the Gauss-Lobatto nodes of the input Mesh object m. Note: not tested with periodic meshes (L2). Note: the input mesh m must have Nodes set.

Parameters
[in]mInput mesh.
[in]meshidA unique # for each overlapping mesh. This id is used to make sure that points being searched are not looked for in the mesh that they belong to.
[in]gfmax(Optional) GridFunction in H1 that is used as a discriminator when one point is located in multiple meshes. The mesh that maximizes gfmax is chosen. For example, using the distance field based on the overlapping boundaries is helpful for convergence during Schwarz iterations.
[in]bbox_rel_size_inc(Optional) Relative size increase applied when expanding each element bounding box.
[in]newt_tol(Optional) Newton tolerance for the gslib search methods.
[in]npt_max(Optional) Number of points for simultaneous iteration. This alters performance and memory footprint.

Definition at line 4742 of file gslib.cpp.

Member Data Documentation

◆ distfint

Vector mfem::OversetFindPointsGSLIB::distfint
protected

Definition at line 703 of file gslib.hpp.

◆ overset

bool mfem::OversetFindPointsGSLIB::overset
protected

Definition at line 701 of file gslib.hpp.

◆ u_meshid

unsigned int mfem::OversetFindPointsGSLIB::u_meshid
protected

Definition at line 702 of file gslib.hpp.


The documentation for this class was generated from the following files: