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

Namespaces

 inlet
 
 internal
 
 lumberjack
 
 mint
 
 numerics
 
 primal
 
 quest
 
 sidre
 
 slam
 
 slic
 
 spin
 
 utilities
 

Classes

class  Array
 Provides a generic multi-component array container. More...
 
class  Path
 Path class for performing basic path operations with a user-selectable delimiter character. More...
 
class  StackArray
 Provides a wrapper for a compile time sized array, similar to std::array. This class is needed because NVCC doesn't caputure standard stack arrays in device lambdas. Furthermore we can't use std::array becuase it is not host-device decorated. More...
 

Typedefs

using int8 = std::int8_t
 
using uint8 = std::uint8_t
 
using int16 = std::int16_t
 
using uint16 = std::uint16_t
 
using int32 = std::int32_t
 
using uint32 = std::uint32_t
 
using int64 = std::int64_t
 
using uint64 = std::uint64_t
 
using float32 = float
 
using float64 = double
 
using IndexType = int32
 

Functions

bool operator== (const Path &lhs, const Path &rhs)
 Equality operator (equals) More...
 
bool operator!= (const Path &lhs, const Path &rhs)
 Equality operator (not equals) More...
 
void about ()
 Prints info about how Axom was configured and built to stdout. More...
 
void about (std::ostream &oss)
 Prints info about how Axom was configured and built to a stream. More...
 
std::string getVersion ()
 Returns a string consisting of the Axom version. More...
 
Memory Management Routines
void setDefaultAllocator (int allocatorID)
 Sets the default memory allocator to use. More...
 
int getDefaultAllocatorID ()
 Returns the ID of the current default allocator. More...
 
template<typename T >
T * allocate (std::size_t n, int allocID=getDefaultAllocatorID()) noexcept
 Allocates a chunk of memory of type T. More...
 
template<typename T >
void deallocate (T *&p) noexcept
 Frees the chunk of memory pointed to by the supplied pointer, p. More...
 
template<typename T >
T * reallocate (T *p, std::size_t n) noexcept
 Reallocates the chunk of memory pointed to by the supplied pointer. More...
 
void copy (void *dst, void *src, std::size_t numbytes) noexcept
 Copies memory from the source to the destination. More...
 

Variables

constexpr int INVALID_ALLOCATOR_ID = -1
 

Typedef Documentation

◆ int8

using axom::int8 = typedef std::int8_t

8-bit signed integer type

◆ uint8

using axom::uint8 = typedef std::uint8_t

8-bit unsigned integer type

◆ int16

using axom::int16 = typedef std::int16_t

16-bit signed integer type

◆ uint16

using axom::uint16 = typedef std::uint16_t

16-bit unsigned integer type

◆ int32

using axom::int32 = typedef std::int32_t

32-bit signed integer type

◆ uint32

using axom::uint32 = typedef std::uint32_t

32-bit unsigned integer type

◆ int64

using axom::int64 = typedef std::int64_t

64-bit signed integer type

◆ uint64

using axom::uint64 = typedef std::uint64_t

64-bit unsigned integer type

◆ float32

using axom::float32 = typedef float

◆ float64

using axom::float64 = typedef double

◆ IndexType

using axom::IndexType = typedef int32

Function Documentation

◆ setDefaultAllocator()

void axom::setDefaultAllocator ( int  allocatorID)
inline

Sets the default memory allocator to use.

Parameters
[in]allocatorIDID of the Umpire allocator to use.
Note
This function has no effect when Axom is not compiled with Umpire.

Referenced by axom::quest::getMeshTriangle(), and axom::sidre::Group::isRoot().

◆ getDefaultAllocatorID()

int axom::getDefaultAllocatorID ( )
inline

Returns the ID of the current default allocator.

Returns
ID the ID of the current default allocator.
Postcondition
ID != INVALID_ALLOCATOR_ID

References allocate(), copy(), deallocate(), and reallocate().

Referenced by axom::quest::getMeshTriangle(), and axom::sidre::Group::isRoot().

◆ allocate()

template<typename T >
T * axom::allocate ( std::size_t  n,
int  allocID = getDefaultAllocatorID() 
)
inlinenoexcept

Allocates a chunk of memory of type T.

Parameters
[in]nthe number of elements to allocate.
[in]allocIDthe Umpire allocator to use (optional)
Template Parameters
Tthe type of pointer returned.
Note
By default allocate() will use the current default allocator. The caller may explicitly specify a different allocator to use by supplying the second, optional argument, or change the default allocator by calling axom::setDefaultAllocator().
Returns
p pointer to the new allocation or a nullptr if allocation failed.

Referenced by getDefaultAllocatorID().

◆ deallocate()

template<typename T >
void axom::deallocate ( T *&  p)
inlinenoexcept

Frees the chunk of memory pointed to by the supplied pointer, p.

Parameters
[in/out]p a pointer to memory allocated with allocate/reallocate or a nullptr.
Postcondition
p == nullptr

Referenced by getDefaultAllocatorID(), axom::quest::getMeshTriangle(), axom::numerics::jacobi_eigensolve(), axom::numerics::lu_solve(), axom::numerics::Matrix< T >::ones(), and axom::Array< double >::~Array().

◆ reallocate()

template<typename T >
T * axom::reallocate ( T *  p,
std::size_t  n 
)
inlinenoexcept

Reallocates the chunk of memory pointed to by the supplied pointer.

Parameters
[in]ppointer to memory allocated with allocate/reallocate, or a nullptr.
[in]nthe number of elements to allocate.
Template Parameters
Tthe type pointer p points to.
Returns
p pointer to the new allocation or a nullptr if allocation failed.
Note
When n == 0, this function returns a valid pointer (of size 0) in the current allocator's memory space. This follows the semantics of Umpire's reallocate function.

Referenced by axom::Array< double >::dynamicRealloc(), getDefaultAllocatorID(), and axom::Array< double >::setCapacity().

◆ copy()

void axom::copy ( void *  dst,
void *  src,
std::size_t  numbytes 
)
inlinenoexcept

Copies memory from the source to the destination.

Parameters
[in/out]dst the destination to copy to.
[in]srcthe source to copy from.
[in]numbytesthe number of bytes to copy.
Note
When using Umpire if either src or dst is not registered with the ResourceManager then the default host allocation strategy is assumed for that pointer.

Referenced by axom::quest::InOutOctree< DIM >::generateIndex(), getDefaultAllocatorID(), axom::quest::getMeshTriangle(), axom::sidre::View::getNextValidAttrValueIndex(), axom::slam::DynamicVariableRelation< PosType, ElemType >::isValid(), and axom::quest::DynamicGrayBlockData::operator=().

◆ operator==()

bool axom::operator== ( const Path lhs,
const Path rhs 
)

Equality operator (equals)

Parameters
[in]lhsThe first Path to compare
[in]rhsThe second Path to compare Two paths are equal if they use the same delimiter and contain the same components

Referenced by axom::Path::parts().

◆ operator!=()

bool axom::operator!= ( const Path lhs,
const Path rhs 
)
inline

Equality operator (not equals)

Parameters
[in]lhsThe first Path to compare
[in]rhsThe second Path to compare Two paths are equal if they use the same delimiter and contain the same components

◆ about() [1/2]

void axom::about ( )

Prints info about how Axom was configured and built to stdout.

◆ about() [2/2]

void axom::about ( std::ostream &  oss)

Prints info about how Axom was configured and built to a stream.

Parameters
[in,out]ossthe target stream where to append the Axom info

◆ getVersion()

std::string axom::getVersion ( )

Returns a string consisting of the Axom version.

Returns
str string corresponding to the Axom version
Postcondition
str != ""

Variable Documentation

◆ INVALID_ALLOCATOR_ID

constexpr int axom::INVALID_ALLOCATOR_ID = -1