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

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 VectorGetGridFac () const
 Return the number of grid cells per unit extent in each direction.
 
const VectorGetGridMin () const
 Return the minimum extent of the grid in each direction.
 
const VectorGetGridMax () 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.
 

Detailed Description

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.

Definition at line 836 of file gslib.hpp.

Constructor & Destructor Documentation

◆ GlobalBBoxTensorGridMap() [1/3]

mfem::GlobalBBoxTensorGridMap::GlobalBBoxTensorGridMap ( ParMesh & pmesh,
int nx )

Constructor for a given mesh and number of tensor grid divisions.

Definition at line 5003 of file gslib.cpp.

◆ GlobalBBoxTensorGridMap() [2/3]

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().

Definition at line 5041 of file gslib.cpp.

◆ GlobalBBoxTensorGridMap() [3/3]

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()

Definition at line 5070 of file gslib.cpp.

◆ ~GlobalBBoxTensorGridMap()

mfem::GlobalBBoxTensorGridMap::~GlobalBBoxTensorGridMap ( )

Definition at line 5429 of file gslib.cpp.

Member Function Documentation

◆ GetGridFac()

const Vector & mfem::GlobalBBoxTensorGridMap::GetGridFac ( ) const
inline

Return the number of grid cells per unit extent in each direction.

Definition at line 908 of file gslib.hpp.

◆ GetGridMap()

const Array< int > & mfem::GlobalBBoxTensorGridMap::GetGridMap ( ) const
inline

Return this rank's portion of the distributed map from grid cells to candidate MPI ranks (CSR data, indexed by rank-local cell index).

Definition at line 906 of file gslib.hpp.

◆ GetGridMax()

const Vector & mfem::GlobalBBoxTensorGridMap::GetGridMax ( ) const
inline

Return the maximum extent of the grid in each direction.

Definition at line 912 of file gslib.hpp.

◆ GetGridMin()

const Vector & mfem::GlobalBBoxTensorGridMap::GetGridMin ( ) const
inline

Return the minimum extent of the grid in each direction.

Definition at line 910 of file gslib.hpp.

◆ GetGridN()

const Array< int > & mfem::GlobalBBoxTensorGridMap::GetGridN ( ) const
inline

Return the grid resolution (number of cells) in each direction.

Definition at line 914 of file gslib.hpp.

◆ MapPointsToProcs()

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.

Definition at line 5312 of file gslib.cpp.


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