piola.h
Go to the documentation of this file.
#ifndef _RHEOLEF_PIOLA_H
#define _RHEOLEF_PIOLA_H
//
// piola transformation:
//
// F : hat_K ---> K
// hat_x +--> x = F(hat_x)
//
// i.e. map any geo_element K from a reference_element hat_K
//
#include "rheolef/tensor.h"
#include "rheolef/space_constant.h"
namespace rheolef {
// ----------------------------------------------------------------------------
// options for gradient computations
// ----------------------------------------------------------------------------
namespace details {
struct differentiate_option {
typedef enum {
none = 0,
gradient = 1,
divergence = 2,
curl = 3
} type;
bool symmetrized; // compute D(u): symmetrize grad(u) when u is a vector
bool surfacic; // compute grad_s(u): applies also the P=I-nxn projector on the surface
bool broken; // compute grad_h(u): applies also for discontinuous Galerkin
bool batchelor_curl; // for computing the stream function: Batchelor trick in axisymmetric geometries
differentiate_option()
: symmetrized(false),
surfacic(false),
broken(false),
batchelor_curl(false)
{}
};
} // namespace details
// ----------------------------------------------------------------------------
// the piola class
// ----------------------------------------------------------------------------
template<class T>
struct piola {
typedef typename tensor_basic<T>::size_type size_type;
typedef space_constant::coordinate_type coordinate_type;
piola();
void clear();
// data:
size_type d, map_d;
coordinate_type sys_coord;
bool ignore_sys_coord;
point_basic<T> F;
tensor_basic<T> DF, invDF, P;
T detDF;
bool has_nt_basis; // for vector-valued space with block_n boundary condition
point_basic<T> normal; // idem
};
template<class T>
inline
piola<T>::piola()
: d(0),
map_d(0),
sys_coord(space_constant::cartesian),
ignore_sys_coord(false),
F(),
DF(),
invDF(),
P(),
detDF(0),
has_nt_basis(false),
normal()
{
}
template<class T>
inline
void
piola<T>::clear()
{
d = 0;
map_d = 0;
sys_coord = space_constant::cartesian;
ignore_sys_coord = false;
F = point_basic<T>(0,0,0);
DF.fill(0);
invDF.fill(0);
P.fill(0);
detDF = 0;
has_nt_basis = false;
normal = point_basic<T>(0,0,0);
}
}// namespace rheolef
#endif // _RHEOLEF_PIOLA_H
rheolef::point_basic
Definition: point.h:87
rheolef::tensor_basic
Definition: tensor.h:90
rheolef::tensor_basic::size_type
size_t size_type
Definition: tensor.h:93
rheolef::point_basic< T >
point_basic< T >
Definition: piola_fem.h:135
T
Expr1::float_type T
Definition: field_expr.h:261
mkgeo_ball.d
int d
Definition: mkgeo_ball.sh:154
mkgeo_grid.sys_coord
string sys_coord
Definition: mkgeo_grid.sh:171
rheolef::space_constant::coordinate_type
coordinate_type
Definition: space_constant.h:121
rheolef::space_constant::cartesian
@ cartesian
Definition: space_constant.h:122
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
rheolef::normal
details::field_expr_v2_nonlinear_terminal_function< details::normal_pseudo_function< Float > > normal()
normal: see the expression page for the full documentation
Definition: field_expr_terminal.h:439
rheolef::details::differentiate_option
Definition: piola.h:41
rheolef::details::differentiate_option::symmetrized
bool symmetrized
Definition: piola.h:49
rheolef::details::differentiate_option::differentiate_option
differentiate_option()
Definition: piola.h:54
rheolef::details::differentiate_option::type
type
Definition: piola.h:42
rheolef::details::differentiate_option::divergence
@ divergence
Definition: piola.h:45
rheolef::details::differentiate_option::gradient
@ gradient
Definition: piola.h:44
rheolef::details::differentiate_option::none
@ none
Definition: piola.h:43
rheolef::details::differentiate_option::curl
@ curl
Definition: piola.h:46
rheolef::details::differentiate_option::broken
bool broken
Definition: piola.h:51
rheolef::details::differentiate_option::batchelor_curl
bool batchelor_curl
Definition: piola.h:52
rheolef::details::differentiate_option::surfacic
bool surfacic
Definition: piola.h:50
rheolef::piola
Definition: piola.h:67
rheolef::piola::coordinate_type
space_constant::coordinate_type coordinate_type
Definition: piola.h:70
rheolef::piola::P
tensor_basic< T > P
Definition: piola.h:80
rheolef::piola::d
size_type d
Definition: piola.h:76
rheolef::piola::DF
tensor_basic< T > DF
Definition: piola.h:80
rheolef::piola::sys_coord
coordinate_type sys_coord
Definition: piola.h:77
rheolef::piola::has_nt_basis
bool has_nt_basis
Definition: piola.h:82
rheolef::piola::map_d
size_type map_d
Definition: piola.h:76
rheolef::piola::size_type
tensor_basic< T >::size_type size_type
Definition: piola.h:69
rheolef::piola::detDF
T detDF
Definition: piola.h:81
rheolef::piola::invDF
tensor_basic< T > invDF
Definition: piola.h:80
rheolef::piola::ignore_sys_coord
bool ignore_sys_coord
Definition: piola.h:78
rheolef::piola::clear
void clear()
Definition: piola.h:104
rheolef::piola::F
point_basic< T > F
Definition: piola.h:79
rheolef::piola::normal
point_basic< T > normal
Definition: piola.h:83
rheolef::piola::piola
piola()
Definition: piola.h:87