Block

namespace Cubism::Block

Namespace for block data types.

Typedefs

using CellField = Field<T, EntityType::Cell, DIM, State, Alloc>

Basic cell-centered data field.

Template Parameters
  • T: Data type (must be POD)

  • DIM: Field dimension

  • State: State type

  • Alloc: Allocator type

using NodeField = Field<T, EntityType::Node, DIM, State, Alloc>

Basic node-centered data field.

Template Parameters
  • T: Data type (must be POD)

  • DIM: Field dimension

  • State: State type

  • Alloc: Allocator type

using FaceField = Field<T, EntityType::Face, DIM, State, Alloc>

Basic face-centered data field.

Faces are stored individually for the dimensionality specified by CUBISM_DIMENSION at compile time. See the FaceContainer type for a container of size CUBISM_DIMENSION.

Template Parameters
  • T: Data type (must be POD)

  • DIM: Field dimension

  • State: State type

  • Alloc: Allocator type

using VectorField = TensorField<T, 1, Entity, DIM, State, Alloc>

Convenience type for vector fields.

Template Parameters
  • T: Field data type

  • Entity: Entity type

  • DIM: Field dimension

  • State: Field state type

  • Alloc: Memory allocator

template<typename T, Cubism::EntityType Entity, size_t DIM, typename BlockAlloc = AlignedBlockAllocator<T>>
class Data : public Cubism::Block::DataBase
#include <Data.h>

Generic block data.

Data type that manages memory allocation and data access for the specified index range spanned by the data.

Note

The memory allocation for a block may be larger than the minimum required data specified by the index range.

Template Parameters
  • T: Data type

  • Entity: Entity type

  • DIM: Data dimensionality

  • BlockAlloc: Allocator type

class DataBase
#include <Data.h>

Type-less base class for a data block.

For byte-level operations on the data only.

Subclassed by Cubism::Block::Data< T, Entity, DIM, BlockAlloc >, Cubism::Block::Data< T, Entity, DIM, Alloc< T > >, Cubism::Block::Data< TField::DataType, TField::EntityType, TField::IndexRangeType::Dim, Cubism::AlignedBlockAllocator< TField::DataType > >

template<typename TField>
class FaceContainer : public Cubism::Block::FieldContainer<TField>
#include <Field.h>

Container class for all faces in a CUBISM_DIMENSION-ional problem.

For CUBISM_DIMENSION in {1,2,3}, the face field for faces with normal in the X direction can be obtained with ff[0] or ff[Cubism::Dir::X] for example, where ff is of type FaceContainer.

Template Parameters
  • TField: Face field type (scalar or tensor)

template<typename T, Cubism::EntityType Entity, size_t DIM = CUBISM_DIMENSION, typename State = FieldState, template<typename> class Alloc = AlignedBlockAllocator>
class Field : public Cubism::Block::Data<T, Entity, DIM, Alloc<T>>
#include <Field.h>

Block scalar field base class.

Generic block scalar field type used by Grid classes to compose a certain topology of block fields.

Template Parameters
  • T: Field data type

  • Entity: Entity type

  • DIM: Field dimension

  • State: Field state type

  • Alloc: Memory allocator

template<typename TField>
class FieldContainer
#include <Field.h>

Field container type.

This is an actively managed field container. Unlike std::vector, the destructors of the container elements are called upon destruction of the container. An incomplete container contains nullptr for some of its components.

Template Parameters
  • TField: Type of field

Subclassed by Cubism::Block::FaceContainer< TField >

template<typename TField>
class FieldLab : public Cubism::Block::Data<TField::DataType, TField::EntityType, TField::IndexRangeType::Dim, Cubism::AlignedBlockAllocator<TField::DataType>>
#include <FieldLab.h>

Field laboratory.

A FieldLab is an extended data structure to include ghost cells for a given stencil. Loading a lab takes care of loading the ghost cells from neighboring block fields and applies boundary conditions if present. The default is periodic if no boundary conditions are specified otherwise.

Template Parameters
  • TField: Field type to map to the lab

template<typename FieldType, size_t DIM>
struct FieldLabLoader
template<typename FieldType>
struct FieldLabLoader<FieldType, 3>
struct FieldState
#include <Field.h>

Default meta data (state) of a block field.

Minimal (default) state of a field is empty. Custom field state types my add additional state to describe meta data of a field. A field state type must define copy semantics. Components in TensorField types and FaceContainer types share one instance of a state.

template<typename T, size_t RANK, Cubism::EntityType Entity, size_t DIM = CUBISM_DIMENSION, typename State = FieldState, template<typename> class Alloc = AlignedBlockAllocator>
struct FieldTypeFactory
#include <Field.h>

Field type factory for tensor fields.

Template Parameters
  • T: Field data type

  • RANK: Tensor rank

  • Entity: Entity type

  • DIM: Field dimension

  • State: Field state type

  • Alloc: Memory allocator

template<typename T, size_t DIM, typename State, template< typename > class Alloc> Face, DIM, State, Alloc >
#include <Field.h>

Field type factory for face scalar fields.

Template Parameters
  • T: Field data type

  • DIM: Field dimension

  • State: Field state type

  • Alloc: Memory allocator

template<typename T, Cubism::EntityType Entity, size_t DIM, typename State, template<typename> class Alloc>
struct FieldTypeFactory<T, 0, Entity, DIM, State, Alloc>
#include <Field.h>

Field type factory for scalar fields.

Template Parameters
  • T: Field data type

  • Entity: Entity type

  • DIM: Field dimension

  • State: Field state type

  • Alloc: Memory allocator

template<typename T, size_t RANK, size_t DIM, typename State, template< typename > class Alloc> Face, DIM, State, Alloc >
#include <Field.h>

Field type factory for face tensor fields.

Template Parameters
  • T: Field data type

  • RANK: Tensor rank

  • DIM: Field dimension

  • State: Field state type

  • Alloc: Memory allocator

template<typename TField>
class FieldView : public TField
#include <Field.h>

Field view type.

Provides a view (shallow copy) for scalar fields, tensor fields or face field containers. The corresponding field interface is inherited.

Note

A view type never owns memory.

Template Parameters
  • TField: Field type

template<typename FContainer, Cubism::FieldClass Class, size_t RANK>
class PeriodicIndexFunctor
template<typename FContainer, Cubism::FieldClass Class, size_t RANK>
struct ScalarFieldMap
template<typename FContainer, Cubism::FieldClass Class>
struct ScalarFieldMap<FContainer, Class, 0>
template<typename FContainer> FaceContainer, 0 >
template<typename FContainer, size_t RANK> FaceContainer, RANK >
template<typename T, size_t RANK, Cubism::EntityType Entity, size_t DIM = CUBISM_DIMENSION, typename State = FieldState, template<typename> class Alloc = AlignedBlockAllocator>
class TensorField : public Cubism::Block::FieldContainer<Field<T, Entity, DIM, State, Alloc>>
#include <Field.h>

Generic tensor field.

Template Parameters
  • T: Field data type

  • RANK: Tensor rank

  • Entity: Entity type

  • DIM: Field dimension

  • State: Field state type

  • Alloc: Memory allocator