|
| FindPointsGSLIB () |
|
| FindPointsGSLIB (MPI_Comm comm_) |
|
virtual | ~FindPointsGSLIB () |
|
void | Setup (Mesh &m, const double bb_t=0.1, const double newt_tol=1.0e-12, const int npt_max=256) |
|
void | FindPoints (const Vector &point_pos, int point_pos_ordering=Ordering::byNODES) |
|
void | FindPoints (Mesh &m, const Vector &point_pos, int point_pos_ordering=Ordering::byNODES, const double bb_t=0.1, const double newt_tol=1.0e-12, const int npt_max=256) |
| Setup FindPoints and search positions.
|
|
virtual void | Interpolate (const GridFunction &field_in, Vector &field_out) |
|
void | Interpolate (const Vector &point_pos, const GridFunction &field_in, Vector &field_out, int point_pos_ordering=Ordering::byNODES) |
|
void | Interpolate (Mesh &m, const Vector &point_pos, const GridFunction &field_in, Vector &field_out, int point_pos_ordering=Ordering::byNODES) |
|
virtual void | SetL2AvgType (AvgType avgtype_) |
|
virtual void | SetDefaultInterpolationValue (double interp_value_) |
|
virtual void | SetDistanceToleranceForPointsFoundOnBoundary (double bdr_tol_) |
|
virtual void | SetGPUtoCPUFallback (bool mode) |
|
virtual void | FreeData () |
|
virtual const Array< unsigned int > & | GetCode () const |
|
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 Vector & | GetReferencePosition () const |
| Return reference coordinates for each point found by FindPoints.
|
|
virtual const Vector & | GetDist () const |
|
virtual const Array< unsigned int > & | GetGSLIBElem () const |
|
virtual const Vector & | GetGSLIBReferencePosition () const |
|
void | GetAxisAlignedBoundingBoxes (Vector &aabb) |
|
void | GetOrientedBoundingBoxes (DenseTensor &obbA, Vector &obbC, Vector &obbV) |
|
|
The physical-space point that the user seeks to interpolate at could be located inside an element on another mpi rank. To enable a custom interpolation procedure (e.g., strain tensor computation) we need a mechanism to first send element indices and reference-space coordinates to the mpi-ranks where each point is found. Then the custom interpolation can be done locally by the user before sending the interpolated values back to the mpi-ranks that the query originated from. Example usage looks something like this:
FindPoints() -> DistributePointInfoToOwningMPIRanks() -> Computation by user -> DistributeInterpolatedValues().
|
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 |
|
|
virtual void | InterpolateH1 (const GridFunction &field_in, Vector &field_out) |
| Use GSLIB for communication and interpolation.
|
|
virtual void | InterpolateGeneral (const GridFunction &field_in, Vector &field_out) |
|
virtual void | SetupSplitMeshes () |
|
virtual void | SetupIntegrationRuleForSplitMesh (Mesh *mesh, IntegrationRule *irule, int order) |
|
virtual void | GetNodalValues (const GridFunction *gf_in, Vector &node_vals) |
| Get GridFunction value at the points expected by GSLIB.
|
|
virtual void | MapRefPosAndElemIndices () |
|
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) |
|
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) |
|
void | InterpolateLocal3 (const Vector &field_in, Array< int > &gsl_elem_dev_l, Vector &gsl_ref_l, Vector &field_out, int npt, int ncomp, int nel, int dof1dsol) |
|
void | InterpolateLocal2 (const Vector &field_in, Array< int > &gsl_elem_dev_l, Vector &gsl_ref_l, Vector &field_out, int npt, int ncomp, int nel, int dof1dsol) |
|
void | SetupDevice () |
|
void | FindPointsOnDevice (const Vector &point_pos, int point_pos_ordering=Ordering::byNODES) |
|
void | InterpolateOnDevice (const Vector &field_in_evec, Vector &field_out, const int nel, const int ncomp, const int dof1dsol, const int ordering) |
|
FindPointsGSLIB can robustly evaluate a GridFunction on an arbitrary collection of points.
There are three key functions in FindPointsGSLIB:
- Setup - constructs the internal data structures of gslib. See Setup.
- FindPoints - for any given arbitrary set of points in physical space, gslib finds the element number, MPI rank, and the reference space coordinates inside the element that each point is located in. gslib also returns a code that indicates whether the point was found inside an element, on element border, or not found in the domain. For points returned as found on
element border
, the point is either on an element edge/face or near the domain boundary, and gslib also returns a distance to the border. Points near (but outside) the domain boundary must then be marked as not found using the distance returned by gslib. See FindPoints.
- Interpolate - Interpolates any grid function at the points found using 2. For functions in L2 finite element space, use SetL2AvgType to specify how to interpolate values at points located at element boundaries where the function might be multi-valued. See Interpolate.
FindPointsGSLIB also provides interface to use these functions through a single call.
For custom interpolation (e.g., evaluating strain rate tensor), we provide functions that use gslib to send element index and corresponding reference-space coordinates for each point to the mpi rank that the element is located on. Then, custom interpolation can be defined locally by the user before sending the values back to mpi ranks where the query originated from. See DistributePointInfoToOwningMPIRanks and DistributeInterpolatedValues.
Definition at line 66 of file gslib.hpp.
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
. This function populates the following member variables: gsl_code Return codes for each point: inside element (0), element boundary (1), not found (2). gsl_proc MPI proc ids where the points were found. gsl_elem Element ids where the points were found. Defaults to 0 for points that were not found. gsl_mfem_elem Element ids corresponding to MFEM-mesh where the points were found. gsl_mfem_elem != gsl_elem for simplices Defaults to 0 for points that were not found. gsl_ref Reference coordinates of the found point. Ordered by vdim (XYZ,XYZ,XYZ...). Defaults to -1 for points that were not found. Note: the gslib reference frame is [-1,1]. gsl_mfem_ref Reference coordinates gsl_ref mapped to [0,1]. Defaults to 0 for points that were not found. gsl_dist Distance between the sought and the found point in physical space.
Definition at line 242 of file gslib.cpp.
Return the oriented bounding boxes (OBB) computed during Setup. Each OBB is represented using the inverse transformation (A^{-1}) and its center (x_c), such that a point x is inside the OBB if: -1 <= A^{-1}(x-x_c) <= 1. The inverse transformation is returned in obbA
, a DenseTensor of size (dim x dim x nel), and the OBB centers are returned in obbC
, a vector of size (nel x dim). The vertices of the OBBs are returned in obbV
, a vector of size (nel x nverts x dim) .
Definition at line 2268 of file gslib.cpp.
void mfem::FindPointsGSLIB::MapRefPosAndElemIndices |
( |
| ) |
|
|
protectedvirtual |
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.
Definition at line 1544 of file gslib.cpp.