AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
interface.hpp File Reference

Defines an execution interface for generic loop traversals and various mesh traversals, e.g., loop over nodes, cells, etc. The traversals may be executed in parallel, on the CPU, GPU, or other accelerator device, or in serial on the CPU according to the execution policy, which is supplied as a template argument to each of the traversal functions. More...

#include "axom/config.hpp"
#include "axom/core/Macros.hpp"
#include "axom/core/execution/execution_space.hpp"
#include "axom/mint/execution/xargs.hpp"
#include "axom/mint/execution/internal/for_all_cells.hpp"
#include "axom/mint/execution/internal/for_all_nodes.hpp"
#include "axom/mint/execution/internal/for_all_faces.hpp"
#include "axom/mint/mesh/Mesh.hpp"
#include "axom/slic/interface/slic.hpp"

Namespaces

 axom
 
 axom::mint
 

Functions

Mesh Node Traversal Functions
template<typename ExecPolicy , typename ArgType = xargs::index, typename MeshType , typename KernelType >
void axom::mint::for_all_nodes (const MeshType *m, KernelType &&kernel)
 Loops over the nodes of the given mesh. More...
 
template<typename ExecPolicy , typename ArgType = xargs::index, typename KernelType >
void axom::mint::for_all_nodes (const Mesh *m, KernelType &&kernel)
 
Mesh Cell Traversal Functions
template<typename ExecPolicy , typename ArgType = xargs::index, typename MeshType , typename KernelType >
void axom::mint::for_all_cells (const MeshType *m, KernelType &&kernel)
 Loops over all the cells of a given mesh. More...
 
template<typename ExecPolicy , typename ArgType = xargs::index, typename KernelType >
void axom::mint::for_all_cells (const Mesh *m, KernelType &&kernel)
 
Mesh Face Traversal Functions
template<typename ExecPolicy , typename ArgType = xargs::index, typename MeshType , typename KernelType >
void axom::mint::for_all_faces (const MeshType *m, KernelType &&kernel)
 Loops over all the faces of a given mesh. More...
 
template<typename ExecPolicy , typename ArgType = xargs::index, typename KernelType >
void axom::mint::for_all_faces (const Mesh *m, KernelType &&kernel)
 

Detailed Description

Defines an execution interface for generic loop traversals and various mesh traversals, e.g., loop over nodes, cells, etc. The traversals may be executed in parallel, on the CPU, GPU, or other accelerator device, or in serial on the CPU according to the execution policy, which is supplied as a template argument to each of the traversal functions.

The general interface for the mesh traversal functions takes in a mint Mesh object and the loop body encapsulated in a lambda expression, conforming to the following template:

for_all_[entity]< [exec_policy], [xargs] >( meshPtr, AXOM_LAMBDA(...) {
// loop body
} );

where:

  • [entity]
    The entity suffix specifies the mesh entity being traversed, e.g., nodes, cells, faces, etc,.
  • [exec_policy]
    The execution policy indicates how and where the data corresponding to the specified mesh entity will be traversed. For example, an execution policy may indicate that the mesh traversal will be executed in parallel on the GPU, or CPU. A list of the currently supported execution policies and a brief description is given in execution_space.hpp
  • [AXOM_LAMBDA()]
    The AXOM_LAMBDA argument encapsulates the loop body, i.e., the kernel that is to be executed at each mesh entity. By default, the lambda expression takes the ID of the corresponding mesh entity as an argument. Additional lambda arguments may be specified by supplying the xargs template argument to the mesh traversal function.
  • [xargs]
    The xargs is an optional template argument to the mesh traversal function that specifies any additional arguments that the supplied lambda expression takes.A list of the available xargs types and a brief description is given in xargs.hpp
Note
For parallel execution, the implementation relies heavily on the RAJA programming model abstraction layer.
See also
execution_space.hpp
xargs.hpp