version 0.4.1
feresulttypes.hh File Reference

Definitions of ResultTypes used for finite element results. More...

#include <type_traits>
#include <Eigen/Core>
#include <ikarus/utils/tensorutils.hh>

Go to the source code of this file.

Classes

struct  Ikarus::ResultWrapper< RT, storedResultShape >
 Container that is used for FE Results. It gives access to the stored value, but can also be used to access the result in Matrix and Vector form. More...
 

Namespaces

namespace  Ikarus
 
namespace  Ikarus::ResultTypes
 

Macros

#define REGISTER_RESULTTYPE_IMPL(resultTypeName, rowsExpr, colsExpr, MaxRowsExpr, MaxColsExpr, VectorizeStruct, MatricizeStruct)
 
#define REGISTER_SIMPLE_SYMMETRIC_RESULTTYPE(resultTypeName, rowsExpr, colsExpr, strainlike)
 Used to register a symmetric ResultType with compile-time fixed rows and columns (uses Voigt notation) More...
 
#define REGISTER_RESULTTYPE(resultTypeName, rowsExpr, colsExpr)
 Used to register a general ResultType with potentially dynamic size without reserved memeroy rows and columns. More...
 
#define REGISTER_RESERVED_RESULTTYPE(resultTypeName, rowsExpr, colsExpr, MaxRowsExpr, MaxColsExpr)
 Used to register a general ResultType with potentially dynamic size and defined maximum amount of rows and columns. More...
 
#define REGISTER_SIMPLE_RESULTTYPE(resultTypeName, rowsExpr, colsExpr)    REGISTER_RESERVED_RESULTTYPE(resultTypeName, rowsExpr, colsExpr, rowsExpr, colsExpr)
 Used to register a general ResultType with potentially dynamic size, with reserved memory according to passed in rowsExpr and colsExpr. More...
 

Enumerations

enum class  Ikarus::ResultShape { Ikarus::Vector , Ikarus::Matrix }
 

Functions

 Ikarus::ResultTypes::REGISTER_SIMPLE_SYMMETRIC_RESULTTYPE (linearStress, worldDim, worldDim, false)
 
 Ikarus::ResultTypes::REGISTER_SIMPLE_SYMMETRIC_RESULTTYPE (PK2Stress, worldDim, worldDim, false)
 
 Ikarus::ResultTypes::REGISTER_SIMPLE_SYMMETRIC_RESULTTYPE (cauchyStress, worldDim, worldDim, false)
 
 Ikarus::ResultTypes::REGISTER_SIMPLE_RESULTTYPE (director, worldDim, 1)
 
 Ikarus::ResultTypes::REGISTER_SIMPLE_RESULTTYPE (magnetization, worldDim, 1)
 
 Ikarus::ResultTypes::REGISTER_SIMPLE_RESULTTYPE (gradientNormOfMagnetization, 1, 1)
 
 Ikarus::ResultTypes::REGISTER_SIMPLE_RESULTTYPE (vectorPotential, worldDim, 1)
 
 Ikarus::ResultTypes::REGISTER_SIMPLE_RESULTTYPE (divergenceOfVectorPotential, 1, 1)
 
 Ikarus::ResultTypes::REGISTER_SIMPLE_RESULTTYPE (BField, worldDim, 1)
 
 Ikarus::ResultTypes::REGISTER_SIMPLE_RESULTTYPE (HField, worldDim, 1)
 
 Ikarus::ResultTypes::REGISTER_SIMPLE_RESULTTYPE (customType, Eigen::Dynamic, Eigen::Dynamic)
 
template<template< typename, int, int > class RT>
auto Ikarus::makeRT ()
 Creates a dummy resultType which can be stored in a variable. More...
 
template<template< typename, int, int > class RT>
auto Ikarus::toString ()
 Retrieves a string representation of the ResultType template. More...
 

Variables

template<template< typename, int, int > class RT1, template< typename, int, int > class RT2>
constexpr bool Ikarus::isSameResultType = std::is_same_v<Impl::DummyRT<RT1>, Impl::DummyRT<RT2>>
 Meta variable to test whether two ResultType templates are the same. More...
 

Detailed Description

Additional ResultTypes can be added with one of the following macros

Macro Definition Documentation

◆ REGISTER_RESERVED_RESULTTYPE

#define REGISTER_RESERVED_RESULTTYPE (   resultTypeName,
  rowsExpr,
  colsExpr,
  MaxRowsExpr,
  MaxColsExpr 
)
Value:
REGISTER_RESULTTYPE_IMPL(resultTypeName, rowsExpr, colsExpr, MaxRowsExpr, MaxColsExpr, \
Ikarus::Impl::VectorizeGeneric, Ikarus::Impl::MatricizeGeneric)
#define REGISTER_RESULTTYPE_IMPL(resultTypeName, rowsExpr, colsExpr, MaxRowsExpr, MaxColsExpr, VectorizeStruct, MatricizeStruct)
Definition: feresulttypes.hh:64
Parameters
resultTypeNamename of the ResultType
rowsExprexpression for rows, e.g. Eigen::Dynamic or worldDim
colsExprexpression for columns, e.g. Eigen::Dynamic or worldDim
MaxRowsExprexpression for maximum number of columns
MaxColsExprexpressionfor maximum number of rows

◆ REGISTER_RESULTTYPE

#define REGISTER_RESULTTYPE (   resultTypeName,
  rowsExpr,
  colsExpr 
)
Value:
REGISTER_RESULTTYPE_IMPL(resultTypeName, rowsExpr, colsExpr, Ikarus::Impl::VectorizeGeneric, \
Ikarus::Impl::MatricizeGeneric)
Parameters
resultTypeNamename of the ResultType
rowsExprexpression for rows, e.g. Eigen::Dynamic or worldDim
colsExprexpression for columns, e.g. Eigen::Dynamic or worldDim

◆ REGISTER_RESULTTYPE_IMPL

#define REGISTER_RESULTTYPE_IMPL (   resultTypeName,
  rowsExpr,
  colsExpr,
  MaxRowsExpr,
  MaxColsExpr,
  VectorizeStruct,
  MatricizeStruct 
)
Value:
template <typename ScalarType, int gridDim, int worldDim> \
struct resultTypeName \
{ \
friend std::string toString(resultTypeName) { return #resultTypeName; } \
\
using type = Eigen::Matrix<ScalarType, rowsExpr, colsExpr, 0, MaxRowsExpr, MaxColsExpr>; \
using Vectorizer = VectorizeStruct; \
using Matricizer = MatricizeStruct; \
\
template <typename ScalarType_, int gridDim_, int worldDim_> \
using Rebind = resultTypeName<ScalarType_, gridDim_, worldDim_>; \
}
auto toString()
Retrieves a string representation of the ResultType template.
Definition: feresulttypes.hh:239

◆ REGISTER_SIMPLE_RESULTTYPE

#define REGISTER_SIMPLE_RESULTTYPE (   resultTypeName,
  rowsExpr,
  colsExpr 
)     REGISTER_RESERVED_RESULTTYPE(resultTypeName, rowsExpr, colsExpr, rowsExpr, colsExpr)
Parameters
resultTypeNamename of the ResultType
rowsExprexpression for rows, e.g. Eigen::Dynamic or worldDim
colsExprexpression for columns, e.g. Eigen::Dynamic or worldDim

◆ REGISTER_SIMPLE_SYMMETRIC_RESULTTYPE

#define REGISTER_SIMPLE_SYMMETRIC_RESULTTYPE (   resultTypeName,
  rowsExpr,
  colsExpr,
  strainlike 
)
Value:
REGISTER_RESULTTYPE_IMPL(resultTypeName, rowsExpr, colsExpr, rowsExpr, colsExpr, \
Ikarus::Impl::VectorizeWithVoigt<strainlike>, Ikarus::Impl::MatricizeWithVoigt<strainlike>)
Parameters
resultTypeNamename of the ResultType
rowsExprexpression for rows, e.g. gridDim or worldDim
colsExprexpression for rows, e.g. gridDim or worldDim
strainlikeboolean indicating whether the result should be treated as a strain-like quantity