AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::quest::GridFunctionView< ExecSpace > Class Template Reference

Provides a view over an MFEM grid function. MFEM grid functions are assumed to live in host memory. This class performs data movement needed to access the grid function data within a GPU device lambda. This view is limited in scope, though could be expanded in the future. More...

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/quest/IntersectionShaper.hpp>

Public Member Functions

AXOM_HOST GridFunctionView (mfem::GridFunction *gf, bool _needResult=true)
 Host constructor that accepts the grid function. More...
 
AXOM_HOST_DEVICE GridFunctionView (const GridFunctionView &obj)
 Copy constructor, which is called to make a copy of the host object so it is accessible inside a RAJA kernel. Any data movement happened in the host constructor. This version sets hostData to nullptr so we know not to clean up in the destructor. More...
 
AXOM_HOST_DEVICE ~GridFunctionView ()
 Destructor. On the host, this method may move data from the device and deallocate device storage. More...
 
AXOM_HOST_DEVICE double & operator[] (int i)
 Indexing operator for accessing the data. More...
 
AXOM_HOST_DEVICE double & operator[] (int i) const
 

Detailed Description

template<typename ExecSpace>
class axom::quest::GridFunctionView< ExecSpace >

Provides a view over an MFEM grid function. MFEM grid functions are assumed to live in host memory. This class performs data movement needed to access the grid function data within a GPU device lambda. This view is limited in scope, though could be expanded in the future.

Template Parameters
ExecSpaceThe execution space where the grid function data will be accessed.

Constructor & Destructor Documentation

◆ GridFunctionView() [1/2]

template<typename ExecSpace >
AXOM_HOST axom::quest::GridFunctionView< ExecSpace >::GridFunctionView ( mfem::GridFunction *  gf,
bool  _needResult = true 
)
inline

Host constructor that accepts the grid function.

Parameters
gfThe grid function that will be accessed/modified by the view.
_needResultWhether the data needs to be brought back to the host from the device.

◆ GridFunctionView() [2/2]

template<typename ExecSpace >
AXOM_HOST_DEVICE axom::quest::GridFunctionView< ExecSpace >::GridFunctionView ( const GridFunctionView< ExecSpace > &  obj)
inline

Copy constructor, which is called to make a copy of the host object so it is accessible inside a RAJA kernel. Any data movement happened in the host constructor. This version sets hostData to nullptr so we know not to clean up in the destructor.

◆ ~GridFunctionView()

template<typename ExecSpace >
AXOM_HOST_DEVICE axom::quest::GridFunctionView< ExecSpace >::~GridFunctionView ( )
inline

Destructor. On the host, this method may move data from the device and deallocate device storage.

Member Function Documentation

◆ operator[]() [1/2]

template<typename ExecSpace >
AXOM_HOST_DEVICE double& axom::quest::GridFunctionView< ExecSpace >::operator[] ( int  i)
inline

Indexing operator for accessing the data.

Parameters
iThe index at which to access the data.
Returns
A reference to the data at index i.

◆ operator[]() [2/2]

template<typename ExecSpace >
AXOM_HOST_DEVICE double& axom::quest::GridFunctionView< ExecSpace >::operator[] ( int  i) const
inline

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