CEPS  24.01
Cardiac ElectroPhysiology Simulator
CepsTypes.hpp File Reference
#include <array>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <mpi.h>
#include <ostream>
#include <set>
#include <span>
#include <sstream>
#include <tuple>
#include <typeinfo>
#include <unordered_map>
#include <vector>
#include <concepts>
#include <memory>
#include <vtkPointLocator.h>
#include <Eigen/Dense>
#include <inttypes.h>
#include <type_traits>

Go to the source code of this file.

Data Structures

struct  CepsStandardArgs
 Structure used to pass arguments to SAFunc (see pde directory) The flags of the SAFunc allows extraction of the correct argument from this structured type. More...
 

Namespaces

 ceps
 A namespace for all utility methods.
 

Macros

#define FLOATING_POINT_EPSILON   1E-6
 
#define CEPS_DECL_PARALLEL_TYPE(_type, _mpi_type)
 
#define CEPS_MPI_REAL   MpiType<CepsReal>::getType()
 
#define CEPS_MPI_INT   MpiType<CepsInt>::getType ()
 
#define CEPS_MPI_UINT   MpiType<CepsUInt>::getType ()
 
#define CEPS_MPI_SHORT   MpiType<CepsShort>::getType ()
 
#define CEPS_MPI_INDEX   MpiType<CepsIndex>::getType ()
 
#define CEPS_MPI_GEOM_INDEX   MpiType<CepsIndex>::getType ()
 
#define CEPS_MPI_GLOBAL_INDEX   MpiType<CepsGlobalIndex>::getType ()
 
#define CEPS_MPI_LOCAL_INDEX   MpiType<CepsLocalIndex>::getType ()
 
#define CEPS_MPI_ELEMENT_INDEX   MpiType<CepsIndex>::getType ()
 
#define CEPS_MPI_HASH   MpiType<CepsHash>::getType ()
 
#define CEPS_MPI_SHASH   MpiType<CepsSHash>::getType()
 
#define CEPS_MAKE_ALIGNED_OP_NEW   EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 

Typedefs

using CepsReal = float
 Need single precision floating point. More...
 
using CepsInt = int32_t
 Need 32 bit integer. More...
 
using CepsUInt = std::make_unsigned_t< CepsInt >
 Unsigned version on CepsInt. More...
 
using CepsShort = short
 Short type for custom purposes. More...
 
using CepsIndex = CepsInt
 Index rowid etc. More...
 
using CepsProcId = CepsUInt
 For CPU indices. More...
 
using CepsBool = bool
 Booleans. More...
 
using CepsChar = char
 Char. More...
 
using CepsSize = size_t
 Size unsigned. More...
 
using CepsCString = const CepsChar *
 C format string. More...
 
using CepsString = std::basic_string< CepsChar >
 C++ format string. More...
 
using CepsScalar = CepsReal
 Real numbers. More...
 
using CepsMathScalar = CepsScalar
 Real numbers. More...
 
using CepsMathScalars = Eigen::Matrix< CepsScalar, 1, Eigen::Dynamic >
 Array of reals, eigen format. More...
 
using CepsMathVertex = Eigen::Matrix< CepsScalar, 3, 1 >
 Vertex, eigen format. More...
 
using CepsMathVertices = Eigen::Matrix< CepsScalar, 3, Eigen::Dynamic >
 Array of vertices, eigen format. More...
 
using CepsMathTensor = Eigen::Matrix< CepsScalar, 3, 3 >
 Tensor, eigen format. More...
 
using CepsMathTensors = Eigen::Matrix< CepsScalar, 3, Eigen::Dynamic >
 Array of tensors, eigen format. More...
 
using CepsMathDynamic1D = Eigen::Matrix< CepsScalar, Eigen::Dynamic, 1 >
 Dynamic 1D array, eigen format. More...
 
using CepsMathDynamic2D = Eigen::Matrix< CepsScalar, Eigen::Dynamic, Eigen::Dynamic >
 Dynamic 2D array, eigen format. More...
 
template<class _Type , class _Alloc = std::allocator<_Type>>
using CepsVector = std::vector< _Type, _Alloc >
 C++ vector. More...
 
template<class _Type , CepsSize _N>
using CepsArray = std::array< _Type, _N >
 C++ arrays. More...
 
template<class _Type >
using CepsArray2 = CepsArray< _Type, 2U >
 C++ array, 2 elements. More...
 
template<class _Type >
using CepsArray3 = CepsArray< _Type, 3U >
 C++ array, 3 elements. More...
 
template<class _Type >
using CepsArray4 = CepsArray< _Type, 4U >
 C++ array, 4 elements. More...
 
template<class _Type >
using CepsArray9 = CepsArray< _Type, 9U >
 C++ array, 9 elements. More...
 
using CepsReal1D = CepsArray< CepsReal, 1u >
 A real scalar, used like this for compatibility in polynomials. More...
 
using CepsReal2D = CepsArray2< CepsReal >
 Two real scalars, used like this for compatibility in polynomials. More...
 
using CepsReal3D = CepsArray3< CepsReal >
 Three real scalars, used like this for compatibility in polynomials. More...
 
template<class... _Args>
using CepsTuple = std::tuple< _Args... >
 C++ tuple. More...
 
template<typename _Key , typename _Tp , typename _Compare = std::less<_Key>, typename _Alloc = std::allocator<std::pair<const _Key, _Tp>>>
using CepsMap = std::map< _Key, _Tp, _Compare, _Alloc >
 C++ map. More...
 
template<typename _Key , typename _Tp , typename _Hash = std::hash<_Key>, typename _KeyEqual = std::equal_to<_Key>, typename _Alloc = std::allocator<std::pair<const _Key, _Tp>>>
using CepsMultiMap = std::unordered_multimap< _Key, _Tp, _Hash, _KeyEqual, _Alloc >
 C++ multimap. More...
 
template<class _Type , class _Compare = std::less<_Type>, class _Alloc = std::allocator<_Type>>
using CepsSet = std::set< _Type, _Compare, _Alloc >
 C++ set. More...
 
using CepsAttribute = CepsInt
 Used to define regions. More...
 
using CepsEnum = int
 Enum type. More...
 
using CepsUnknownIndex = CepsIndex
 For unknowns. More...
 
using CepsGlobalIndex = CepsIndex
 Many uses. Has to be signed for PETSc. More...
 
using CepsLocalIndex = CepsIndex
 To use when the indexing is only on one process. More...
 
using CepsHash = CepsSize
 Hashes for distributed data. More...
 
using CepsSHash = int64_t
 Hashes for coordinates. More...
 
using CepsCellGlobalIndex = CepsGlobalIndex
 Indices of cells. More...
 
using CepsCellLocalIndex = CepsLocalIndex
 Indices of cells. More...
 
using CepsNodeGlobalIndex = CepsGlobalIndex
 Indices of nodes. More...
 
using CepsNodeLocalIndex = CepsLocalIndex
 Indices of nodes. More...
 
using CepsDofGlobalIndex = CepsGlobalIndex
 Indices of degrees of freedom. More...
 
using CepsDofLocalIndex = CepsLocalIndex
 Indices of degrees of freedom. More...
 

Functions

template<typename _Result >
_Result ceps::convertReal (CepsReal *data)
 A small utility to convert a vector of reals into the appropriate (scalar,vector,tensor) More...
 
 CEPS_DECL_PARALLEL_TYPE (void, ompi_mpi_datatype_null)
 void declaration More...
 
 CEPS_DECL_PARALLEL_TYPE (float, ompi_mpi_float)
 float declaration More...
 
 CEPS_DECL_PARALLEL_TYPE (double, ompi_mpi_double)
 double declaration More...
 
 CEPS_DECL_PARALLEL_TYPE (int8_t, ompi_mpi_int8_t)
 int8_t declaration More...
 
 CEPS_DECL_PARALLEL_TYPE (uint8_t, ompi_mpi_uint8_t)
 uint8_t declaration More...
 
 CEPS_DECL_PARALLEL_TYPE (int16_t, ompi_mpi_int16_t)
 int16_t declaration More...
 
 CEPS_DECL_PARALLEL_TYPE (uint16_t, ompi_mpi_uint16_t)
 uint16_t declaration More...
 
 CEPS_DECL_PARALLEL_TYPE (int32_t, ompi_mpi_int32_t)
 int32_t declaration More...
 
 CEPS_DECL_PARALLEL_TYPE (uint32_t, ompi_mpi_uint32_t)
 uint32_t declaration More...
 
 CEPS_DECL_PARALLEL_TYPE (int64_t, ompi_mpi_int64_t)
 int64_t declaration More...
 
 CEPS_DECL_PARALLEL_TYPE (uint64_t, ompi_mpi_uint64_t)
 uint64_t declaration More...
 

Variables

constexpr CepsReal1D CepsZero1D = {0.0}
 Zero of CepsReal1D. More...
 
constexpr CepsReal2D CepsZero2D = {0.0, 0.0}
 Zero of CepsReal2D. More...
 
constexpr CepsReal3D CepsZero3D = {0.0, 0.0, 0.0}
 Zero of CepsReal3D. More...
 
constexpr const CepsChar CepsNoName [] = "no-name"
 Default string for things without defined name. More...
 
constexpr const CepsChar CepsNoUnit [] = "no-unit"
 Default string for things without defined unit. More...
 
constexpr CepsAttribute CepsUniversal = -1
 This attribute means "everywhere". More...
 

Detailed Description

Definition of types to be used within CEPS, with type selection depending on install

Definition in file CepsTypes.hpp.

Macro Definition Documentation

◆ CEPS_DECL_PARALLEL_TYPE

#define CEPS_DECL_PARALLEL_TYPE (   _type,
  _mpi_type 
)
Value:
template <> \
struct MpiType<_type> \
{ \ \
static MPI_Datatype \
getType() \
{ \
return static_cast<MPI_Datatype>(static_cast<void *>(&_mpi_type)); \
} \
}
Used to retrieve the MPI "type" in function of the true type.
Definition: CepsTypes.hpp:262

Definition at line 265 of file CepsTypes.hpp.

◆ CEPS_MAKE_ALIGNED_OP_NEW

#define CEPS_MAKE_ALIGNED_OP_NEW   EIGEN_MAKE_ALIGNED_OPERATOR_NEW

This is a eigen macro used to make sure that 16-bytes-aligned pointers are generated:

Definition at line 374 of file CepsTypes.hpp.

◆ CEPS_MPI_ELEMENT_INDEX

#define CEPS_MPI_ELEMENT_INDEX   MpiType<CepsIndex>::getType ()

the mpi type for CepsIndex

Definition at line 355 of file CepsTypes.hpp.

◆ CEPS_MPI_GEOM_INDEX

#define CEPS_MPI_GEOM_INDEX   MpiType<CepsIndex>::getType ()

the mpi type for CepsGeomIndex

Definition at line 340 of file CepsTypes.hpp.

◆ CEPS_MPI_GLOBAL_INDEX

#define CEPS_MPI_GLOBAL_INDEX   MpiType<CepsGlobalIndex>::getType ()

the mpi type for CepsGlobalIndex

Definition at line 345 of file CepsTypes.hpp.

◆ CEPS_MPI_HASH

#define CEPS_MPI_HASH   MpiType<CepsHash>::getType ()

the mpi type for CepsHash

Definition at line 360 of file CepsTypes.hpp.

◆ CEPS_MPI_INDEX

#define CEPS_MPI_INDEX   MpiType<CepsIndex>::getType ()

the mpi type for CepsIndex

Definition at line 335 of file CepsTypes.hpp.

◆ CEPS_MPI_INT

#define CEPS_MPI_INT   MpiType<CepsInt>::getType ()

the mpi type for CepsInt

Definition at line 320 of file CepsTypes.hpp.

◆ CEPS_MPI_LOCAL_INDEX

#define CEPS_MPI_LOCAL_INDEX   MpiType<CepsLocalIndex>::getType ()

the mpi type for CepsLocalIndex

Definition at line 350 of file CepsTypes.hpp.

◆ CEPS_MPI_REAL

#define CEPS_MPI_REAL   MpiType<CepsReal>::getType()

the mpi type for CepsReal

Definition at line 315 of file CepsTypes.hpp.

◆ CEPS_MPI_SHASH

#define CEPS_MPI_SHASH   MpiType<CepsSHash>::getType()

the mpi type for CepsSHash

Definition at line 365 of file CepsTypes.hpp.

◆ CEPS_MPI_SHORT

#define CEPS_MPI_SHORT   MpiType<CepsShort>::getType ()

the mpi type for CepsShort

Definition at line 330 of file CepsTypes.hpp.

◆ CEPS_MPI_UINT

#define CEPS_MPI_UINT   MpiType<CepsUInt>::getType ()

the mpi type for CepsUInt

Definition at line 325 of file CepsTypes.hpp.

◆ FLOATING_POINT_EPSILON

#define FLOATING_POINT_EPSILON   1E-6

Definition at line 117 of file CepsTypes.hpp.

Typedef Documentation

◆ CepsArray

template<class _Type , CepsSize _N>
using CepsArray = std::array<_Type, _N>

C++ arrays.

Definition at line 159 of file CepsTypes.hpp.

◆ CepsArray2

template<class _Type >
using CepsArray2 = CepsArray<_Type, 2U>

C++ array, 2 elements.

Definition at line 162 of file CepsTypes.hpp.

◆ CepsArray3

template<class _Type >
using CepsArray3 = CepsArray<_Type, 3U>

C++ array, 3 elements.

Definition at line 165 of file CepsTypes.hpp.

◆ CepsArray4

template<class _Type >
using CepsArray4 = CepsArray<_Type, 4U>

C++ array, 4 elements.

Definition at line 168 of file CepsTypes.hpp.

◆ CepsArray9

template<class _Type >
using CepsArray9 = CepsArray<_Type, 9U>

C++ array, 9 elements.

Definition at line 171 of file CepsTypes.hpp.

◆ CepsAttribute

Used to define regions.

Definition at line 215 of file CepsTypes.hpp.

◆ CepsBool

using CepsBool = bool

Booleans.

Definition at line 124 of file CepsTypes.hpp.

◆ CepsCellGlobalIndex

Indices of cells.

Definition at line 222 of file CepsTypes.hpp.

◆ CepsCellLocalIndex

Indices of cells.

Definition at line 223 of file CepsTypes.hpp.

◆ CepsChar

using CepsChar = char

Char.

Definition at line 125 of file CepsTypes.hpp.

◆ CepsCString

using CepsCString = const CepsChar *

C format string.

Definition at line 127 of file CepsTypes.hpp.

◆ CepsDofGlobalIndex

Indices of degrees of freedom.

Definition at line 226 of file CepsTypes.hpp.

◆ CepsDofLocalIndex

Indices of degrees of freedom.

Definition at line 227 of file CepsTypes.hpp.

◆ CepsEnum

using CepsEnum = int

Enum type.

Definition at line 216 of file CepsTypes.hpp.

◆ CepsGlobalIndex

Many uses. Has to be signed for PETSc.

Definition at line 218 of file CepsTypes.hpp.

◆ CepsHash

using CepsHash = CepsSize

Hashes for distributed data.

Definition at line 220 of file CepsTypes.hpp.

◆ CepsIndex

using CepsIndex = CepsInt

Index rowid etc.

Definition at line 111 of file CepsTypes.hpp.

◆ CepsInt

using CepsInt = int32_t

Need 32 bit integer.

Definition at line 106 of file CepsTypes.hpp.

◆ CepsLocalIndex

To use when the indexing is only on one process.

Definition at line 219 of file CepsTypes.hpp.

◆ CepsMap

template<typename _Key , typename _Tp , typename _Compare = std::less<_Key>, typename _Alloc = std::allocator<std::pair<const _Key, _Tp>>>
using CepsMap = std::map<_Key, _Tp, _Compare, _Alloc>

C++ map.

Definition at line 196 of file CepsTypes.hpp.

◆ CepsMathDynamic1D

using CepsMathDynamic1D = Eigen::Matrix<CepsScalar, Eigen::Dynamic, 1>

Dynamic 1D array, eigen format.

Definition at line 139 of file CepsTypes.hpp.

◆ CepsMathDynamic2D

using CepsMathDynamic2D = Eigen::Matrix<CepsScalar, Eigen::Dynamic, Eigen::Dynamic>

Dynamic 2D array, eigen format.

Definition at line 140 of file CepsTypes.hpp.

◆ CepsMathScalar

Real numbers.

Definition at line 133 of file CepsTypes.hpp.

◆ CepsMathScalars

using CepsMathScalars = Eigen::Matrix<CepsScalar, 1, Eigen::Dynamic>

Array of reals, eigen format.

Definition at line 134 of file CepsTypes.hpp.

◆ CepsMathTensor

using CepsMathTensor = Eigen::Matrix<CepsScalar, 3, 3>

Tensor, eigen format.

Definition at line 137 of file CepsTypes.hpp.

◆ CepsMathTensors

using CepsMathTensors = Eigen::Matrix<CepsScalar, 3, Eigen::Dynamic>

Array of tensors, eigen format.

Definition at line 138 of file CepsTypes.hpp.

◆ CepsMathVertex

using CepsMathVertex = Eigen::Matrix<CepsScalar, 3, 1>

Vertex, eigen format.

Definition at line 135 of file CepsTypes.hpp.

◆ CepsMathVertices

using CepsMathVertices = Eigen::Matrix<CepsScalar, 3, Eigen::Dynamic>

Array of vertices, eigen format.

Definition at line 136 of file CepsTypes.hpp.

◆ CepsMultiMap

template<typename _Key , typename _Tp , typename _Hash = std::hash<_Key>, typename _KeyEqual = std::equal_to<_Key>, typename _Alloc = std::allocator<std::pair<const _Key, _Tp>>>
using CepsMultiMap = std::unordered_multimap<_Key, _Tp, _Hash, _KeyEqual, _Alloc>

C++ multimap.

Definition at line 205 of file CepsTypes.hpp.

◆ CepsNodeGlobalIndex

Indices of nodes.

Definition at line 224 of file CepsTypes.hpp.

◆ CepsNodeLocalIndex

Indices of nodes.

Definition at line 225 of file CepsTypes.hpp.

◆ CepsProcId

For CPU indices.

Definition at line 123 of file CepsTypes.hpp.

◆ CepsReal

using CepsReal = float

Need single precision floating point.

Definition at line 100 of file CepsTypes.hpp.

◆ CepsReal1D

A real scalar, used like this for compatibility in polynomials.

Definition at line 174 of file CepsTypes.hpp.

◆ CepsReal2D

Two real scalars, used like this for compatibility in polynomials.

Definition at line 176 of file CepsTypes.hpp.

◆ CepsReal3D

Three real scalars, used like this for compatibility in polynomials.

Definition at line 178 of file CepsTypes.hpp.

◆ CepsScalar

Real numbers.

Definition at line 132 of file CepsTypes.hpp.

◆ CepsSet

template<class _Type , class _Compare = std::less<_Type>, class _Alloc = std::allocator<_Type>>
using CepsSet = std::set<_Type, _Compare, _Alloc>

C++ set.

Definition at line 209 of file CepsTypes.hpp.

◆ CepsSHash

using CepsSHash = int64_t

Hashes for coordinates.

Definition at line 221 of file CepsTypes.hpp.

◆ CepsShort

using CepsShort = short

Short type for custom purposes.

Definition at line 110 of file CepsTypes.hpp.

◆ CepsSize

using CepsSize = size_t

Size unsigned.

Definition at line 126 of file CepsTypes.hpp.

◆ CepsString

using CepsString = std::basic_string<CepsChar>

C++ format string.

Definition at line 128 of file CepsTypes.hpp.

◆ CepsTuple

template<class... _Args>
using CepsTuple = std::tuple<_Args...>

C++ tuple.

Definition at line 188 of file CepsTypes.hpp.

◆ CepsUInt

using CepsUInt = std::make_unsigned_t<CepsInt>

Unsigned version on CepsInt.

Definition at line 109 of file CepsTypes.hpp.

◆ CepsUnknownIndex

For unknowns.

Definition at line 217 of file CepsTypes.hpp.

◆ CepsVector

template<class _Type , class _Alloc = std::allocator<_Type>>
using CepsVector = std::vector<_Type, _Alloc>

C++ vector.

Definition at line 155 of file CepsTypes.hpp.

Function Documentation

◆ CEPS_DECL_PARALLEL_TYPE() [1/11]

CEPS_DECL_PARALLEL_TYPE ( double  ,
ompi_mpi_double   
)

double declaration

◆ CEPS_DECL_PARALLEL_TYPE() [2/11]

CEPS_DECL_PARALLEL_TYPE ( float  ,
ompi_mpi_float   
)

float declaration

◆ CEPS_DECL_PARALLEL_TYPE() [3/11]

CEPS_DECL_PARALLEL_TYPE ( int16_t  ,
ompi_mpi_int16_t   
)

int16_t declaration

◆ CEPS_DECL_PARALLEL_TYPE() [4/11]

CEPS_DECL_PARALLEL_TYPE ( int32_t  ,
ompi_mpi_int32_t   
)

int32_t declaration

◆ CEPS_DECL_PARALLEL_TYPE() [5/11]

CEPS_DECL_PARALLEL_TYPE ( int64_t  ,
ompi_mpi_int64_t   
)

int64_t declaration

◆ CEPS_DECL_PARALLEL_TYPE() [6/11]

CEPS_DECL_PARALLEL_TYPE ( int8_t  ,
ompi_mpi_int8_t   
)

int8_t declaration

◆ CEPS_DECL_PARALLEL_TYPE() [7/11]

CEPS_DECL_PARALLEL_TYPE ( uint16_t  ,
ompi_mpi_uint16_t   
)

uint16_t declaration

◆ CEPS_DECL_PARALLEL_TYPE() [8/11]

CEPS_DECL_PARALLEL_TYPE ( uint32_t  ,
ompi_mpi_uint32_t   
)

uint32_t declaration

◆ CEPS_DECL_PARALLEL_TYPE() [9/11]

CEPS_DECL_PARALLEL_TYPE ( uint64_t  ,
ompi_mpi_uint64_t   
)

uint64_t declaration

◆ CEPS_DECL_PARALLEL_TYPE() [10/11]

CEPS_DECL_PARALLEL_TYPE ( uint8_t  ,
ompi_mpi_uint8_t   
)

uint8_t declaration

◆ CEPS_DECL_PARALLEL_TYPE() [11/11]

CEPS_DECL_PARALLEL_TYPE ( void  ,
ompi_mpi_datatype_null   
)

void declaration

Variable Documentation

◆ CepsNoName

constexpr const CepsChar CepsNoName[] = "no-name"
constexpr

Default string for things without defined name.

Definition at line 229 of file CepsTypes.hpp.

◆ CepsNoUnit

constexpr const CepsChar CepsNoUnit[] = "no-unit"
constexpr

Default string for things without defined unit.

Definition at line 230 of file CepsTypes.hpp.

◆ CepsUniversal

constexpr CepsAttribute CepsUniversal = -1
constexpr

This attribute means "everywhere".

Definition at line 232 of file CepsTypes.hpp.

◆ CepsZero1D

constexpr CepsReal1D CepsZero1D = {0.0}
constexpr

Zero of CepsReal1D.

Definition at line 180 of file CepsTypes.hpp.

◆ CepsZero2D

constexpr CepsReal2D CepsZero2D = {0.0, 0.0}
constexpr

Zero of CepsReal2D.

Definition at line 182 of file CepsTypes.hpp.

◆ CepsZero3D

constexpr CepsReal3D CepsZero3D = {0.0, 0.0, 0.0}
constexpr

Zero of CepsReal3D.

Definition at line 184 of file CepsTypes.hpp.