AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Encapsulated the Distributed closest point query for a collection of query points over an "object mesh". More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/quest/DistributedClosestPoint.hpp>
Public Types | |
using | RuntimePolicy = axom::runtime_policy::Policy |
Public Member Functions | |
DistributedClosestPoint () | |
~DistributedClosestPoint () | |
void | setRuntimePolicy (RuntimePolicy policy) |
Set runtime execution policy for local queries. More... | |
void | setDefaultAllocatorID () |
Sets the allocator ID to the default associated with the execution policy. More... | |
void | setAllocatorID (int allocatorID) |
Sets the allocator ID. More... | |
void | setMpiCommunicator (MPI_Comm mpiComm, bool duplicate=false) |
Set the MPI communicator. More... | |
void | setDistanceThreshold (double threshold) |
Sets the threshold for the query. More... | |
void | setOutput (const std::string &field, bool on) |
Set what fields to output. More... | |
void | setVerbosity (bool isVerbose) |
Sets the logging verbosity of the query. By default the query is not verbose. More... | |
void | setObjectMesh (const conduit::Node &meshNode, const std::string &topologyName) |
Sets the object mesh for the query. More... | |
bool | generateBVHTree () |
Generates a BVH tree over the object mesh using the runtime execution policy. More... | |
void | computeClosestPoints (conduit::Node &query_node, const std::string &topology) |
Computes the closest point on the object mesh for each point on the provided query mesh. More... | |
Encapsulated the Distributed closest point query for a collection of query points over an "object mesh".
The object mesh and the query mesh are provided as conduit nodes using the mesh blueprint schema. Each of these are distributed over the same MPI rank space. Ranks are allowed to have any number of domains, including zero. This class orchestrates passing the query points to all ranks whose object meshes might contain a closest point.
To use this class, first set some parameters, such as the runtime execution policy, then pass in the object mesh and build a spatial index over this mesh. Finally, compute the closest points in the object mesh to each point in a query mesh using the computeClosestPoints() function.
axom::quest::DistributedClosestPoint::DistributedClosestPoint | ( | ) |
axom::quest::DistributedClosestPoint::~DistributedClosestPoint | ( | ) |
|
inline |
Set runtime execution policy for local queries.
See axom::runtime_policy.
void axom::quest::DistributedClosestPoint::setDefaultAllocatorID | ( | ) |
Sets the allocator ID to the default associated with the execution policy.
void axom::quest::DistributedClosestPoint::setAllocatorID | ( | int | allocatorID | ) |
Sets the allocator ID.
If not explitly set, the allocator ID is the default is the id associated with the runtime policy.
void axom::quest::DistributedClosestPoint::setMpiCommunicator | ( | MPI_Comm | mpiComm, |
bool | duplicate = false |
||
) |
Set the MPI communicator.
By default, the communicator is MPI_COMM_WORLD.
[i] | mpiComm The MPI communicator to use. |
[i] | duplicate Whether to duplicate mpiComm for exclusive use |
void axom::quest::DistributedClosestPoint::setDistanceThreshold | ( | double | threshold | ) |
Sets the threshold for the query.
[in] | threshold | Ignore distances greater than this value. |
void axom::quest::DistributedClosestPoint::setOutput | ( | const std::string & | field, |
bool | on | ||
) |
Set what fields to output.
[i] | field Must be one of these: "cp_rank", "cp_index", "cp_distance", "cp_coords", "cp_domain_index". |
[i] | on Whether to enable outputing field . |
By default, all are on.
|
inline |
Sets the logging verbosity of the query. By default the query is not verbose.
void axom::quest::DistributedClosestPoint::setObjectMesh | ( | const conduit::Node & | meshNode, |
const std::string & | topologyName | ||
) |
Sets the object mesh for the query.
[in] | meshNode | Conduit node for the object mesh |
[in] | topologyName | The name of the topology for the object mesh |
bool axom::quest::DistributedClosestPoint::generateBVHTree | ( | ) |
Generates a BVH tree over the object mesh using the runtime execution policy.
void axom::quest::DistributedClosestPoint::computeClosestPoints | ( | conduit::Node & | query_node, |
const std::string & | topology | ||
) |
Computes the closest point on the object mesh for each point on the provided query mesh.
[in] | query_node | The root node of a mesh blueprint for the query points, which can be empty if there are no query points for the calling rank |
[in] | topology | The name of the topology within query_node |
queryMesh
should have data on the host, regardless of the runtime policy setting. Data will be copied to device as needed.
On completion, the query mesh contains the following fields: