Cabana 0.8.0-dev
 
Loading...
Searching...
No Matches
Cabana::Grid::Array< Scalar, EntityType, MeshType, Params > Class Template Reference

Array of field data on the local mesh. More...

#include <Cabana_Grid_Array.hpp>

Public Types

using value_type = Scalar
 Value type.
 
using entity_type = EntityType
 Entity type.
 
using mesh_type = MeshType
 Mesh type.
 
using array_layout = ArrayLayout<entity_type, mesh_type>
 Array layout type.
 
using view_type
 View type.
 
using memory_space = typename view_type::memory_space
 Memory space.
 
using execution_space = typename memory_space::execution_space
 Default execution space.
 
using subview_type
 Subview type.
 
using subview_layout = typename subview_type::array_layout
 Subview array layout type.
 
using subview_memory_traits = typename subview_type::memory_traits
 Subview memory traits.
 
using subarray_type
 Subarray type.
 

Public Member Functions

 Array (const std::string &label, const std::shared_ptr< array_layout > &layout)
 Create an array with the given layout. Arrays are constructed over the ghosted index space of the layout.
 
 Array (const std::shared_ptr< array_layout > &layout, const view_type &view)
 Create an array with the given layout and view. This view should match the array index spaces in size.
 
std::shared_ptr< array_layoutlayout () const
 Get the layout of the array.
 
view_type view () const
 Get a view of the array data.
 
std::string label () const
 Get the array label.
 

Static Public Attributes

static constexpr std::size_t num_space_dim = mesh_type::num_space_dim
 Spatial dimension.
 

Detailed Description

template<class Scalar, class EntityType, class MeshType, class... Params>
class Cabana::Grid::Array< Scalar, EntityType, MeshType, Params >

Array of field data on the local mesh.

Template Parameters
ScalarScalar type.
EntityTypeArray entity type (node, cell, face, edge).
MeshTypeMesh type (uniform, non-uniform).
ParamsKokkos View parameters.

Member Typedef Documentation

◆ subarray_type

template<class Scalar, class EntityType, class MeshType, class... Params>
using Cabana::Grid::Array< Scalar, EntityType, MeshType, Params >::subarray_type
Initial value:
Array<Scalar, EntityType, MeshType, subview_layout,
typename subview_type::array_layout subview_layout
Subview array layout type.
Definition Cabana_Grid_Array.hpp:308
Array(const std::string &label, const std::shared_ptr< array_layout > &layout)
Create an array with the given layout. Arrays are constructed over the ghosted index space of the lay...
Definition Cabana_Grid_Array.hpp:265
typename subview_type::memory_traits subview_memory_traits
Subview memory traits.
Definition Cabana_Grid_Array.hpp:310
typename view_type::memory_space memory_space
Memory space.
Definition Cabana_Grid_Array.hpp:253

Subarray type.

◆ subview_type

template<class Scalar, class EntityType, class MeshType, class... Params>
using Cabana::Grid::Array< Scalar, EntityType, MeshType, Params >::subview_type
Initial value:
decltype( createSubview(
_data, _layout->indexSpace( Ghost(), Local() ) ) )
KOKKOS_INLINE_FUNCTION auto createSubview(const ViewType &view, const IndexSpace< 1 > &index_space) -> decltype(Kokkos::subview(view, index_space.range(0)))
Given a view create a subview over the given index space.
Definition Cabana_Grid_IndexSpace.hpp:369
Ghosted decomposition tag.
Definition Cabana_Grid_Types.hpp:197
Local index tag.
Definition Cabana_Grid_Types.hpp:208

Subview type.

◆ view_type

template<class Scalar, class EntityType, class MeshType, class... Params>
using Cabana::Grid::Array< Scalar, EntityType, MeshType, Params >::view_type
Initial value:
std::conditional_t<
3 == num_space_dim, Kokkos::View<value_type****, Params...>,
std::conditional_t<2 == num_space_dim,
Kokkos::View<value_type***, Params...>, void>>
Scalar value_type
Value type.
Definition Cabana_Grid_Array.hpp:232
static constexpr std::size_t num_space_dim
Spatial dimension.
Definition Cabana_Grid_Array.hpp:241

View type.

Constructor & Destructor Documentation

◆ Array() [1/2]

template<class Scalar, class EntityType, class MeshType, class... Params>
Cabana::Grid::Array< Scalar, EntityType, MeshType, Params >::Array ( const std::string & label,
const std::shared_ptr< array_layout > & layout )
inline

Create an array with the given layout. Arrays are constructed over the ghosted index space of the layout.

Parameters
labelA label for the array.
layoutThe array layout over which to construct the view.

◆ Array() [2/2]

template<class Scalar, class EntityType, class MeshType, class... Params>
Cabana::Grid::Array< Scalar, EntityType, MeshType, Params >::Array ( const std::shared_ptr< array_layout > & layout,
const view_type & view )
inline

Create an array with the given layout and view. This view should match the array index spaces in size.

Parameters
layoutThe layout of the array.
viewThe array data.

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