![]() |
MFEM v4.10.0
Finite element discretization library
|
Class to map a point in physical space to candidate ranks. More...
#include <gslib.hpp>
Public Member Functions | |
| GlobalBBoxTensorGridMap (ParMesh &pmesh, int nx) | |
| Constructor for a given mesh and number of tensor grid divisions. | |
| GlobalBBoxTensorGridMap (const MPI_Comm &comm, Vector &elmin, Vector &elmax, int nel, int sdim, int n, bool by_max_size) | |
| Constructor for given element bounds and spatial dimension. | |
| GlobalBBoxTensorGridMap (const MPI_Comm &comm, Vector &elmin, Vector &elmax, int nel, int sdim, Array< int > &nx) | |
| Constructor for given element bounds, spatial dimension, and tensor-grid divisions in each direction. | |
| ~GlobalBBoxTensorGridMap () | |
| void | MapPointsToProcs (Vector &xyz, int ordering, std::map< int, std::vector< int > > &pt_to_procs) const |
| Get list of procs corresponding to the list of points. | |
| const Array< int > & | GetGridMap () const |
| const Vector & | GetGridFac () const |
| Return the number of grid cells per unit extent in each direction. | |
| const Vector & | GetGridMin () const |
| Return the minimum extent of the grid in each direction. | |
| const Vector & | GetGridMax () const |
| Return the maximum extent of the grid in each direction. | |
| const Array< int > & | GetGridN () const |
| Return the grid resolution (number of cells) in each direction. | |
Class to map a point in physical space to candidate ranks.
This class builds a Cartesian-aligned tensor grid that covers the entire domain and precomputes which ranks have elements intersecting each grid cell. Given a point in physical space, the grid cell containing the point is determined, and the list of candidate ranks whose elements intersect that cell is returned. This yields a fast, conservative point-to-rank candidate query. This is used internally by FindPointsGSLIB to speed up point searches in parallel.
See Mittal et al., "General Field Evaluation in High-Order Meshes on GPUs". (2025). Computers & Fluids. for technical details.
| mfem::GlobalBBoxTensorGridMap::GlobalBBoxTensorGridMap | ( | ParMesh & | pmesh, |
| int | nx ) |
| mfem::GlobalBBoxTensorGridMap::GlobalBBoxTensorGridMap | ( | const MPI_Comm & | comm, |
| Vector & | elmin, | ||
| Vector & | elmax, | ||
| int | nel, | ||
| int | sdim, | ||
| int | n, | ||
| bool | by_max_size ) |
Constructor for given element bounds and spatial dimension.
This constructor must be called collectively on comm. Supports spatial dimensions 1, 2, and 3, and accepts nel == 0 on a rank.
Assumes elmin, elmax Ordering::byNodes: elmin -> [x_{0,min},x_{1,min},... ,y_{0,min},y_{1,min},..,z_{nel-1,min}] elmax -> [x_{0,max},x_{1,max},... ,y_{0,max},y_{1,max},..,z_{nel-1,max}] Note elmin, elmax can be obtained using GridFunction::GetElementBounds()
When by_max_size=false, n gives the number of tensor-grid divisions in each direction. When by_max_size=true, n is a per-rank size hint used to derive a uniform global resolution. The communicator-wide sum of n is converted to nx = ceil(pow(sum(n), 1./sdim)) in each direction, so n is not a hard cap on ggrid_map.Size().
| mfem::GlobalBBoxTensorGridMap::GlobalBBoxTensorGridMap | ( | const MPI_Comm & | comm, |
| Vector & | elmin, | ||
| Vector & | elmax, | ||
| int | nel, | ||
| int | sdim, | ||
| Array< int > & | nx ) |
Constructor for given element bounds, spatial dimension, and tensor-grid divisions in each direction.
This constructor must be called collectively on comm. Supports spatial dimensions 1, 2, and 3, and accepts nel == 0 on a rank. Requires nx.Size() == sdim and positive entries in nx.
Assumes elmin, elmax Ordering::byNodes: elmin -> [x_{0,min},x_{1,min},... ,y_{0,min},y_{1,min},..,z_{nel-1,min}] elmax -> [x_{0,max},x_{1,max},... ,y_{0,max},y_{1,max},..,z_{nel-1,max}] Note elmin, elmax can be obtained using GridFunction::GetElementBounds()
| mfem::GlobalBBoxTensorGridMap::~GlobalBBoxTensorGridMap | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void mfem::GlobalBBoxTensorGridMap::MapPointsToProcs | ( | Vector & | xyz, |
| int | ordering, | ||
| std::map< int, std::vector< int > > & | pt_to_procs ) const |
Get list of procs corresponding to the list of points.
This method must be called collectively on the communicator used to construct the map. The input points can be ordered byNodes: (XXX...,YYY...,ZZZ) or byVDIM: (XYZ,XYZ,...), as specified by ordering.
The output map contains one entry for each input point, keyed by the point's local index in xyz. Points with no candidate ranks, including points outside the global bounding box, have an empty list of candidate ranks.