v0.15.0
Loading...
Searching...
No Matches
Public Types | List of all members
MoFEM::EntitiesFieldData::EntData Struct Reference

Data on single entity (This is passed as argument to DataOperator::doWork) More...

#include "src/finite_elements/EntitiesFieldData.hpp"

Inheritance diagram for MoFEM::EntitiesFieldData::EntData:
[legend]
Collaboration diagram for MoFEM::EntitiesFieldData::EntData:
[legend]

Public Types

enum  BaseDerivatives {
  ZeroDerivative = 0 , FirstDerivative , SecondDerivative , ThirdDerivative ,
  ForthDerivative , LastDerivative
}
 

Bernstein-Bezier base only functions

static constexpr size_t MaxBernsteinBezierOrder = BITFEID_SIZE
 
VectorIntgetBBNodeOrder ()
 Get orders at the nodes.
 
MatrixIntgetBBAlphaIndices ()
 Get file BB indices.
 
virtual boost::shared_ptr< MatrixInt > & getBBAlphaIndicesSharedPtr (const std::string &field_name)
 
virtual boost::shared_ptr< MatrixDouble > & getBBNSharedPtr (const std::string &field_name)
 
virtual const boost::shared_ptr< MatrixDouble > & getBBNSharedPtr (const std::string &field_name) const
 
virtual boost::shared_ptr< MatrixDouble > & getBBDiffNSharedPtr (const std::string &field_name)
 
virtual const boost::shared_ptr< MatrixDouble > & getBBDiffNSharedPtr (const std::string &field_name) const
 
virtual std::map< std::string, boost::shared_ptr< MatrixInt > > & getBBAlphaIndicesMap ()
 
virtual std::map< std::string, boost::shared_ptr< MatrixDouble > > & getBBNMap ()
 get hash map of base function for BB base, key is a field name
 
virtual std::map< std::string, boost::shared_ptr< MatrixDouble > > & getBBDiffNMap ()
 get hash map of derivatives base function for BB base, key is a field name
 
virtual boost::shared_ptr< MatrixInt > & getBBAlphaIndicesByOrderSharedPtr (const size_t o)
 get ALpha indices for BB base by order
 
virtual boost::shared_ptr< MatrixDouble > & getBBNByOrderSharedPtr (const size_t o)
 get BB base by order
 
virtual boost::shared_ptr< MatrixDouble > & getBBDiffNByOrderSharedPtr (const size_t o)
 get BB base derivative by order
 
virtual std::array< boost::shared_ptr< MatrixInt >, MaxBernsteinBezierOrder > & getBBAlphaIndicesByOrderArray ()
 
virtual std::array< boost::shared_ptr< MatrixDouble >, MaxBernsteinBezierOrder > & getBBNByOrderArray ()
 
virtual std::array< boost::shared_ptr< MatrixDouble >, MaxBernsteinBezierOrder > & getBBDiffNByOrderArray ()
 
virtual MoFEMErrorCode baseSwap (const std::string &field_name, const FieldApproximationBase base)
 Swap bases functions.
 

Broken spaces functions

int sEnse
 Entity sense (orientation)
 
ApproximationOrder oRder
 Entity order.
 
FieldSpace sPace
 Entity space.
 
FieldApproximationBase bAse
 Field approximation base.
 
VectorInt iNdices
 Global indices on entity.
 
VectorInt localIndices
 Local indices on entity.
 
VectorDofs dOfs
 DoFs on entity.
 
VectorFieldEntities fieldEntities
 Field entities.
 
VectorDouble fieldData
 Field data on entity.
 
std::vector< BitRefLevelentDataBitRefLevel
 Bit ref level in entity.
 
std::vector< int > dofBrokenSideVec
 Map side to dofs number.
 
std::vector< EntityType > dofBrokenTypeVec
 Map type of entity to dof number.
 
std::array< std::array< boost::shared_ptr< MatrixDouble >, LASTBASE >, LastDerivativebaseFunctionsAndBaseDerivatives
 
std::array< boost::shared_ptr< MatrixDouble >, LASTBASE > & N
 Base functions.
 
std::array< boost::shared_ptr< MatrixDouble >, LASTBASE > & diffN
 Derivatives of base functions.
 
std::string bbFieldName
 field name
 
VectorInt bbNodeOrder
 order of nodes
 
std::map< std::string, boost::shared_ptr< MatrixDouble > > bbN
 
std::map< std::string, boost::shared_ptr< MatrixDouble > > bbDiffN
 
std::map< std::string, boost::shared_ptr< MatrixInt > > bbAlphaIndices
 Indices for Bernstein-Bezier (BB) base.
 
std::array< boost::shared_ptr< MatrixDouble >, MaxBernsteinBezierOrderbbNByOrder
 BB base functions by order.
 
std::array< boost::shared_ptr< MatrixDouble >, MaxBernsteinBezierOrderbbDiffNByOrder
 BB base functions derivatives by order.
 
std::array< boost::shared_ptr< MatrixInt >, MaxBernsteinBezierOrderbbAlphaIndicesByOrder
 BB alpha indices by order.
 
boost::shared_ptr< MatrixDoubleswapBaseNPtr
 Used by Bernstein base to keep temporary pointer.
 
boost::shared_ptr< MatrixDoubleswapBaseDiffNPtr
 Used by Bernstein base to keep temporary pointer.
 
struct OpAddParentEntData
 
template<typename OpBase >
struct OpGetBrokenBaseSideData
 

Auxiliary functions

std::ostream & operator<< (std::ostream &os, const EntitiesFieldData::EntData &e)
 
MoFEMErrorCode resetFieldDependentData ()
 

Constructor and destructor

 EntData (const bool allocate_base_matrices=true)
 Construct EntData object.
 
virtual ~EntData ()=default
 

Sense, order and indices

virtual int getSense () const
 Get entity sense for conforming approximation fields.
 
ApproximationOrder getOrder () const
 Get approximation order.
 
const VectorIntgetIndices () const
 Get global indices of degrees of freedom on entity.
 
const VectorIntAdaptor getIndicesUpToOrder (int order)
 Get global indices of DOFs on entity up to given order.
 
const VectorIntgetLocalIndices () const
 Get local indices of degrees of freedom on entity.
 
const VectorIntAdaptor getLocalIndicesUpToOrder (int order)
 Get local indices of DOFs on entity up to given order.
 
int & getSense ()
 Get reference to entity sense for modification.
 
ApproximationOrdergetOrder ()
 Get reference to approximation order for modification.
 
VectorIntgetIndices ()
 Get reference to global indices for modification.
 
VectorIntgetLocalIndices ()
 Get reference to local indices for modification.
 

Data on entity

const VectorDoublegetFieldData () const
 Get DOF values on entity.
 
const VectorAdaptor getFieldDataUpToOrder (int order)
 Get DOF values on entity up to given order.
 
const VectorDofsgetFieldDofs () const
 Get DOF data structures (const version)
 
VectorDoublegetFieldData ()
 Get DOF values on entity for modification.
 
const VectorFieldEntitiesgetFieldEntities () const
 Get field entities (const version)
 
VectorFieldEntitiesgetFieldEntities ()
 Get field entities for modification.
 
virtual std::vector< BitRefLevel > & getEntDataBitRefLevel ()
 Get entity bit reference level.
 
template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1FieldData ()
 Return FTensor of rank 1, i.e. vector from field data coefficients.
 
template<int Tensor_Dim0, int Tensor_Dim1>
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > getFTensor2FieldData ()
 Return FTensor rank 2, i.e. matrix from field data coefficients.
 
template<int Tensor_Dim>
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *,(Tensor_Dim *(Tensor_Dim+1))/2 >, Tensor_Dim > getFTensor2SymmetricFieldData ()
 Return symmetric FTensor rank 2, i.e. matrix from field data coefficients.
 
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0FieldData ()
 Return scalar files as a FTensor of rank 0.
 
VectorDofsgetFieldDofs ()
 

Base and space

FieldApproximationBasegetBase ()
 Get approximation base.
 
FieldSpacegetSpace ()
 Get field space.
 
virtual boost::shared_ptr< MatrixDouble > & getNSharedPtr (const FieldApproximationBase base, const BaseDerivatives derivative)
 Get shared pointer to base functions with derivatives.
 
virtual boost::shared_ptr< MatrixDouble > & getNSharedPtr (const FieldApproximationBase base)
 Get shared pointer to base functions (zero derivative)
 
virtual boost::shared_ptr< MatrixDouble > & getDiffNSharedPtr (const FieldApproximationBase base)
 Get shared pointer to derivatives of base functions.
 

Get base functions for H1/L2

MatrixDoublegetN (const FieldApproximationBase base)
 get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb. of columns is equal to number of base functions on this entity.
 
MatrixDoublegetN (const std::string &field_name)
 Get base functions for specific field (Bernstein-Bezier)
 
MatrixDoublegetN ()
 Get base functions using default base.
 
MatrixDoublegetDiffN (const FieldApproximationBase base)
 get derivatives of base functions
 
MatrixDoublegetN (const FieldApproximationBase base, const BaseDerivatives derivative)
 Get base function derivatives with specific derivative order.
 
MatrixDoublegetDiffN (const std::string &field_name)
 Get derivatives of base functions for specific field.
 
MatrixDoublegetDiffN ()
 Get derivatives of base functions using default base.
 
MatrixDoublegetN (const BaseDerivatives derivative)
 Get base function derivatives using default base.
 
const VectorAdaptor getN (const FieldApproximationBase base, const int gg)
 Get base functions at specific Gauss point.
 
const VectorAdaptor getN (const int gg)
 Get base functions at specific Gauss point using default base.
 
const MatrixAdaptor getDiffN (const FieldApproximationBase base, const int gg)
 Get derivative of base functions at specific Gauss point.
 
const MatrixAdaptor getDiffN (const int gg)
 Get derivative of base functions at specific Gauss point using default base.
 
const VectorAdaptor getN (const FieldApproximationBase base, const int gg, const int nb_base_functions)
 Get base functions at Gauss point with limited number of functions.
 
const VectorAdaptor getN (const int gg, const int nb_base_functions)
 Get base functions at Gauss point with limited number (default base)
 
const MatrixAdaptor getDiffN (const FieldApproximationBase base, const int gg, const int nb_base_functions)
 Get derivatives of base functions at Gauss point with limited number.
 
const MatrixAdaptor getDiffN (const int gg, const int nb_base_functions)
 Get derivatives of base functions at Gauss point with limited number (default base)
 

Get base functions for vectorial approximation bases, i.e.

Hdiv/Hcurl

template<int DIM>
const MatrixAdaptor getVectorN (const FieldApproximationBase base, const int gg)
 get Hdiv of base functions at Gauss pts
 
template<int DIM>
const MatrixAdaptor getVectorN (const int gg)
 get Hdiv of base functions at Gauss pts
 
template<int DIM0, int DIM1>
const MatrixAdaptor getVectorDiffN (FieldApproximationBase base, const int gg)
 get DiffHdiv of base functions at Gauss pts
 
template<int DIM0, int DIM1>
const MatrixAdaptor getVectorDiffN (const int gg)
 get DiffHdiv of base functions at Gauss pts
 
template<int DIM0, int DIM1>
const MatrixAdaptor getVectorDiffN (const FieldApproximationBase base, const int dof, const int gg)
 get DiffHdiv of base functions at Gauss pts
 
template<int DIM0, int DIM1>
const MatrixAdaptor getVectorDiffN (const int dof, const int gg)
 get DiffHdiv of base functions at Gauss pts
 

Get base functions with FTensor

FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N (const FieldApproximationBase base)
 Get base function as Tensor0.
 
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N ()
 Get base function as Tensor0.
 
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N (const FieldApproximationBase base, const int gg, const int bb)
 Get base function as Tensor0 (Loop by integration points)
 
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N (const int gg, const int bb)
 Get base function as Tensor0 (Loop by integration points)
 
template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN (const FieldApproximationBase base)
 Get derivatives of base functions.
 
template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN ()
 Get derivatives of base functions.
 
template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN (const FieldApproximationBase base, const int gg, const int bb)
 Get derivatives of base functions (Loop by integration points)
 
template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN (const int gg, const int bb)
 Get derivatives of base functions (Loop by integration points)
 
template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1N (FieldApproximationBase base)
 Get base functions for Hdiv/Hcurl spaces.
 
template<int Tensor_Dim>
auto getFTensor1N ()
 Get base functions for Hdiv space.
 
template<int Tensor_Dim0, int Tensor_Dim1>
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > getFTensor2DiffN (FieldApproximationBase base)
 Get derivatives of base functions for Hdiv space.
 
template<int Tensor_Dim0, int Tensor_Dim1>
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > getFTensor2DiffN (FieldApproximationBase base, const int gg, const int bb)
 Get derivatives of base functions for Hdiv space at integration pts.
 
template<int Tensor_Dim0, int Tensor_Dim1>
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > getFTensor2DiffN ()
 Get derivatives of base functions for Hdiv space.
 
template<int Tensor_Dim0, int Tensor_Dim1>
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > getFTensor2DiffN (const int gg, const int bb)
 Get derivatives of base functions for Hdiv space at integration pts.
 
template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 *Tensor_Dim2 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > getFTensor3Diff2N (FieldApproximationBase base)
 Get second derivatives of base functions for Hvec space.
 
template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 *Tensor_Dim2 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > getFTensor3Diff2N ()
 Get second derivatives of base functions for Hvec space.
 
template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 *Tensor_Dim2 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > getFTensor3DiffN (FieldApproximationBase base)
 Get derivatives of base functions for tonsorial Hdiv space.
 
template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 *Tensor_Dim2 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > getFTensor3DiffN (FieldApproximationBase base, const int gg, const int bb)
 Get derivatives of base functions for tonsorial Hdiv space at integration pts.
 
template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 *Tensor_Dim2 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > getFTensor3DiffN ()
 Get derivatives of base functions for tonsorial Hdiv space.
 
template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 *Tensor_Dim2 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > getFTensor3DiffN (const int gg, const int bb)
 Get derivatives of base functions for tonsorial Hdiv space at integration pts.
 
template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1N (FieldApproximationBase base, const int gg, const int bb)
 Get Hdiv base functions at integration point.
 
template<int Tensor_Dim>
auto getFTensor1N (const int gg, const int bb)
 Get Hdiv base functions at integration point.
 
template<int Tensor_Dim0, int Tensor_Dim1>
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > getFTensor2N (FieldApproximationBase base)
 Get base functions for Hdiv/Hcurl spaces.
 
template<int Tensor_Dim0, int Tensor_Dim1>
auto getFTensor2N ()
 Get base functions for Hdiv space.
 
template<int Tensor_Dim0, int Tensor_Dim1>
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > getFTensor2N (FieldApproximationBase base, const int gg, const int bb)
 Get base functions for tensor Hdiv/Hcurl spaces.
 
template<int Tensor_Dim0, int Tensor_Dim1>
auto getFTensor2N (const int gg, const int bb)
 Get base functions for Hdiv space.
 

Specializations for tensor base function

template<>
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > getFTensor1N (FieldApproximationBase base)
 
template<>
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > getFTensor1N (FieldApproximationBase base, const int gg, const int bb)
 
template<>
FTensor::Tensor2< FTensor::PackPtr< double *, 9 >, 3, 3 > getFTensor2N (FieldApproximationBase base)
 

Specializations for derivatives of base functions

template<>
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > getFTensor1DiffN (const FieldApproximationBase base)
 Get spatial derivative of base function tensor for dimension 3d.
 
template<>
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > getFTensor1DiffN ()
 Get spatial derivative of base function tensor for dimension 3d.
 
template<>
FTensor::Tensor2< FTensor::PackPtr< double *, 9 >, 3, 3 > getFTensor2DiffN (FieldApproximationBase base)
 
template<>
FTensor::Tensor2< FTensor::PackPtr< double *, 9 >, 3, 3 > getFTensor2DiffN (FieldApproximationBase base, const int gg, const int bb)
 
template<>
FTensor::Tensor3< FTensor::PackPtr< double *, 12 >, 3, 2, 2 > getFTensor3Diff2N (FieldApproximationBase base)
 
template<>
FTensor::Tensor3< FTensor::PackPtr< double *, 27 >, 3, 3, 3 > getFTensor3DiffN (FieldApproximationBase base)
 
template<>
FTensor::Tensor3< FTensor::PackPtr< double *, 27 >, 3, 3, 3 > getFTensor3DiffN (FieldApproximationBase base, const int gg, const int bb)
 

Specializations for field data

template<>
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > getFTensor1FieldData ()
 
template<>
FTensor::Tensor2< FTensor::PackPtr< double *, 1 >, 1, 1 > getFTensor2FieldData ()
 
template<>
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *, 6 >, 3 > getFTensor2SymmetricFieldData ()
 

Specializations for H1/L2

template<>
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > getFTensor1DiffN (const FieldApproximationBase base, const int gg, const int bb)
 Get spatial derivative of base function tensor for dimension 3d.
 
template<>
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > getFTensor1DiffN (const int gg, const int bb)
 Get spatial derivative of base function tensor for dimension 3d.
 

Specializations for HDiv/HCrul

template<>
FTensor::Tensor2< FTensor::PackPtr< double *, 9 >, 3, 3 > getFTensor2N (FieldApproximationBase base, const int gg, const int bb)
 

Detailed Description

Data on single entity (This is passed as argument to DataOperator::doWork)

Todo:
Hdiv and Hcurl functions should be accessed through common interface.
Examples
mofem/atom_tests/boundary_marker.cpp, mofem/atom_tests/build_large_problem.cpp, mofem/atom_tests/child_and_parent.cpp, mofem/atom_tests/continuity_check_on_contact_prism_side_ele.cpp, mofem/atom_tests/continuity_check_on_skeleton_3d.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, mofem/atom_tests/dg_projection.cpp, mofem/atom_tests/field_evaluator.cpp, mofem/atom_tests/forces_and_sources_testing_edge_element.cpp, mofem/atom_tests/forces_and_sources_testing_flat_prism_element.cpp, mofem/atom_tests/forces_and_sources_testing_users_base.cpp, mofem/atom_tests/hanging_node_approx.cpp, mofem/atom_tests/hcurl_check_approx_in_2d.cpp, mofem/atom_tests/hcurl_curl_operator.cpp, mofem/atom_tests/hcurl_divergence_operator_2d.cpp, mofem/atom_tests/hdiv_check_approx_in_3d.cpp, mofem/atom_tests/hdiv_divergence_operator.cpp, mofem/atom_tests/higher_derivatives.cpp, mofem/atom_tests/operators_tests.cpp, mofem/atom_tests/prism_elements_from_surface.cpp, mofem/atom_tests/prism_polynomial_approximation.cpp, mofem/atom_tests/quad_polynomial_approximation.cpp, mofem/atom_tests/scalar_check_approximation.cpp, mofem/atom_tests/schur_test_diag_mat.cpp, mofem/atom_tests/simple_interface.cpp, mofem/atom_tests/simple_l2_only.cpp, mofem/atom_tests/tensor_divergence_operator.cpp, mofem/atom_tests/test_broken_space.cpp, mofem/atom_tests/test_cache_on_entities.cpp, mofem/tools/mesh_smoothing.cpp, mofem/tutorials/adv-0/plastic.cpp, mofem/tutorials/adv-0/src/PlasticOpsGeneric.hpp, mofem/tutorials/adv-1/src/ContactOps.hpp, mofem/tutorials/adv-2/src/ThermoElasticOps.hpp, mofem/tutorials/adv-2/thermo_elastic.cpp, mofem/tutorials/adv-3/level_set.cpp, mofem/tutorials/adv-4/dynamic_first_order_con_law.cpp, mofem/tutorials/adv-5/seepage.cpp, mofem/tutorials/cor-2to5/src/PoissonOperators.hpp, mofem/tutorials/cor-6/simple_elasticity.cpp, mofem/tutorials/cor-9/reaction_diffusion.cpp, mofem/tutorials/fun-0/hello_world.cpp, mofem/tutorials/fun-1/integration.cpp, mofem/tutorials/fun-2/plot_base.cpp, mofem/tutorials/max-1/lorentz_force.cpp, mofem/tutorials/mix-0/mixed_poisson.cpp, mofem/tutorials/mix-1/phase.cpp, mofem/tutorials/scl-0/approximaton.cpp, mofem/tutorials/scl-1/src/poisson_2d_homogeneous.hpp, mofem/tutorials/scl-10/photon_diffusion.cpp, mofem/tutorials/scl-11/poisson_2d_dis_galerkin.cpp, mofem/tutorials/scl-11/src/PoissonDiscontinousGalerkin.hpp, mofem/tutorials/scl-6/heat_equation.cpp, mofem/tutorials/scl-7/wave_equation.cpp, mofem/tutorials/scl-8/radiation.cpp, mofem/tutorials/scl-9/heat_method.cpp, mofem/tutorials/vec-0/elastic.cpp, mofem/tutorials/vec-1/eigen_elastic.cpp, mofem/tutorials/vec-10/schur_elastic.cpp, mofem/tutorials/vec-2/nonlinear_elastic.cpp, mofem/tutorials/vec-2/src/HenckyOps.hpp, mofem/tutorials/vec-3/nonlinear_dynamic_elastic.cpp, mofem/tutorials/vec-4/approx_sphere.cpp, mofem/tutorials/vec-4/shallow_wave.cpp, mofem/tutorials/vec-5/free_surface.cpp, mofem/tutorials/vec-6/plate.cpp, mofem/tutorials/vec-7/adjoint.cpp, mofem/tutorials/vec-9/arc_length.cpp, mofem/users_modules/adolc-plasticity/adolc_plasticity.cpp, mofem/users_modules/basic_finite_elements/src/HookeElement.hpp, mofem/users_modules/basic_finite_elements/src/NavierStokesElement.hpp, mofem/users_modules/basic_finite_elements/src/impl/HookeElement.cpp, mofem/users_modules/basic_finite_elements/src/impl/NavierStokesElement.cpp, mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianOperators.cpp, and mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianPlasticity.cpp.

Definition at line 152 of file EntitiesFieldData.hpp.

Member Enumeration Documentation

◆ BaseDerivatives

Constructor & Destructor Documentation

◆ EntData()

MoFEM::EntitiesFieldData::EntData::EntData ( const bool  allocate_base_matrices = true)

Construct EntData object.

Parameters
allocate_base_matricesIf true, allocate base function matrices (default: true)

Definition at line 10 of file EntitiesFieldData.cpp.

14 if (allocate_base_matrices) {
15
16 for (auto d = 0; d != LastDerivative; ++d) {
17 for (int b = 0; b != LASTBASE; ++b) {
19 }
20 }
21 }
22}
@ LASTBASE
Definition definitions.h:69
@ NOBASE
Definition definitions.h:59
UBlasMatrix< double > MatrixDouble
Definition Types.hpp:77
int sEnse
Entity sense (orientation)
std::vector< BitRefLevel > entDataBitRefLevel
Bit ref level in entity.
ApproximationOrder oRder
Entity order.
std::array< boost::shared_ptr< MatrixDouble >, LASTBASE > & diffN
Derivatives of base functions.
std::array< std::array< boost::shared_ptr< MatrixDouble >, LASTBASE >, LastDerivative > baseFunctionsAndBaseDerivatives
FieldApproximationBase bAse
Field approximation base.
std::array< boost::shared_ptr< MatrixDouble >, LASTBASE > & N
Base functions.

◆ ~EntData()

virtual MoFEM::EntitiesFieldData::EntData::~EntData ( )
virtualdefault

Member Function Documentation

◆ baseSwap()

MoFEMErrorCode MoFEM::EntitiesFieldData::EntData::baseSwap ( const std::string &  field_name,
const FieldApproximationBase  base 
)
virtual

Swap bases functions.

Some base are not hierarchical and depend on approximation order. Such case demand special handling, that appropriate base order is set depending on field, such that is accessible in operator.

Note
Base is not swap on meshsets
Parameters
field_name
base
Returns
MoFEMErrorCode

Reimplemented in MoFEM::DerivedEntitiesFieldData::DerivedEntData.

Definition at line 136 of file EntitiesFieldData.cpp.

137 {
139 auto make_swap = [](boost::shared_ptr<MatrixDouble> &ptr,
140 boost::shared_ptr<MatrixDouble> &ptrBB,
141 boost::shared_ptr<MatrixDouble> &swap_ptr) {
142 if (swap_ptr) {
143 ptr = swap_ptr;
144 swap_ptr.reset();
145 } else {
146 swap_ptr = ptr;
147 ptr = ptrBB;
148 }
149 };
154}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
constexpr auto field_name
boost::shared_ptr< MatrixDouble > swapBaseDiffNPtr
Used by Bernstein base to keep temporary pointer.
boost::shared_ptr< MatrixDouble > swapBaseNPtr
Used by Bernstein base to keep temporary pointer.
virtual boost::shared_ptr< MatrixDouble > & getNSharedPtr(const FieldApproximationBase base, const BaseDerivatives derivative)
Get shared pointer to base functions with derivatives.
virtual boost::shared_ptr< MatrixDouble > & getBBNSharedPtr(const std::string &field_name)
virtual boost::shared_ptr< MatrixDouble > & getDiffNSharedPtr(const FieldApproximationBase base)
Get shared pointer to derivatives of base functions.
virtual boost::shared_ptr< MatrixDouble > & getBBDiffNSharedPtr(const std::string &field_name)

◆ getBase()

FieldApproximationBase & MoFEM::EntitiesFieldData::EntData::getBase ( )
inline

Get approximation base.

Returns
Approximation base
Examples
mofem/atom_tests/hanging_node_approx.cpp.

Definition at line 1481 of file EntitiesFieldData.hpp.

1481{ return bAse; }

◆ getBBAlphaIndices()

MatrixInt & MoFEM::EntitiesFieldData::EntData::getBBAlphaIndices ( )
inline

Get file BB indices.

Returns
MatrixInt&

Definition at line 1739 of file EntitiesFieldData.hpp.

1739 {
1741}
virtual boost::shared_ptr< MatrixInt > & getBBAlphaIndicesSharedPtr(const std::string &field_name)

◆ getBBAlphaIndicesByOrderArray()

std::array< boost::shared_ptr< MatrixInt >, EntitiesFieldData::EntData::MaxBernsteinBezierOrder > & MoFEM::EntitiesFieldData::EntData::getBBAlphaIndicesByOrderArray ( )
virtual

Definition at line 929 of file EntitiesFieldData.cpp.

929 {
931}
std::array< boost::shared_ptr< MatrixInt >, MaxBernsteinBezierOrder > bbAlphaIndicesByOrder
BB alpha indices by order.

◆ getBBAlphaIndicesByOrderSharedPtr()

boost::shared_ptr< MatrixInt > & MoFEM::EntitiesFieldData::EntData::getBBAlphaIndicesByOrderSharedPtr ( const size_t  o)
virtual

get ALpha indices for BB base by order

Parameters
oapproximation order
Returns
boost::shared_ptr<MatrixInt>&

Definition at line 913 of file EntitiesFieldData.cpp.

913 {
914 return bbAlphaIndicesByOrder[o];
915}

◆ getBBAlphaIndicesMap()

std::map< std::string, boost::shared_ptr< MatrixInt > > & MoFEM::EntitiesFieldData::EntData::getBBAlphaIndicesMap ( )
virtual

Definition at line 898 of file EntitiesFieldData.cpp.

898 {
899 return bbAlphaIndices;
900}
std::map< std::string, boost::shared_ptr< MatrixInt > > bbAlphaIndices
Indices for Bernstein-Bezier (BB) base.

◆ getBBAlphaIndicesSharedPtr()

boost::shared_ptr< MatrixInt > & MoFEM::EntitiesFieldData::EntData::getBBAlphaIndicesSharedPtr ( const std::string &  field_name)
virtual

Reimplemented in MoFEM::DerivedEntitiesFieldData::DerivedEntData.

Definition at line 861 of file EntitiesFieldData.cpp.

862 {
864}

◆ getBBDiffNByOrderArray()

std::array< boost::shared_ptr< MatrixDouble >, EntitiesFieldData::EntData::MaxBernsteinBezierOrder > & MoFEM::EntitiesFieldData::EntData::getBBDiffNByOrderArray ( )
virtual

Definition at line 941 of file EntitiesFieldData.cpp.

941 {
942 return bbDiffNByOrder;
943}
std::array< boost::shared_ptr< MatrixDouble >, MaxBernsteinBezierOrder > bbDiffNByOrder
BB base functions derivatives by order.

◆ getBBDiffNByOrderSharedPtr()

boost::shared_ptr< MatrixDouble > & MoFEM::EntitiesFieldData::EntData::getBBDiffNByOrderSharedPtr ( const size_t  o)
virtual

get BB base derivative by order

Parameters
o
Returns
boost::shared_ptr<MatrixDouble>&

Definition at line 923 of file EntitiesFieldData.cpp.

923 {
924 return bbDiffNByOrder[o];
925}

◆ getBBDiffNMap()

std::map< std::string, boost::shared_ptr< MatrixDouble > > & MoFEM::EntitiesFieldData::EntData::getBBDiffNMap ( )
virtual

get hash map of derivatives base function for BB base, key is a field name

Returns
std::map<std::string, boost::shared_ptr<MatrixDouble>>&

Definition at line 908 of file EntitiesFieldData.cpp.

908 {
909 return bbDiffN;
910}
std::map< std::string, boost::shared_ptr< MatrixDouble > > bbDiffN

◆ getBBDiffNSharedPtr() [1/2]

boost::shared_ptr< MatrixDouble > & MoFEM::EntitiesFieldData::EntData::getBBDiffNSharedPtr ( const std::string &  field_name)
virtual

Get shared pointer to BB derivatives of base base functions

Reimplemented in MoFEM::DerivedEntitiesFieldData::DerivedEntData.

Definition at line 884 of file EntitiesFieldData.cpp.

884 {
885 return bbDiffN[field_name];
886}

◆ getBBDiffNSharedPtr() [2/2]

const boost::shared_ptr< MatrixDouble > & MoFEM::EntitiesFieldData::EntData::getBBDiffNSharedPtr ( const std::string &  field_name) const
virtual

Get shared pointer to derivatives of BB base base functions

Reimplemented in MoFEM::DerivedEntitiesFieldData::DerivedEntData.

Definition at line 892 of file EntitiesFieldData.cpp.

893 {
894 return bbDiffN.at(field_name);
895}

◆ getBBNByOrderArray()

std::array< boost::shared_ptr< MatrixDouble >, EntitiesFieldData::EntData::MaxBernsteinBezierOrder > & MoFEM::EntitiesFieldData::EntData::getBBNByOrderArray ( )
virtual

Definition at line 935 of file EntitiesFieldData.cpp.

935 {
936 return bbNByOrder;
937}
std::array< boost::shared_ptr< MatrixDouble >, MaxBernsteinBezierOrder > bbNByOrder
BB base functions by order.

◆ getBBNByOrderSharedPtr()

boost::shared_ptr< MatrixDouble > & MoFEM::EntitiesFieldData::EntData::getBBNByOrderSharedPtr ( const size_t  o)
virtual

get BB base by order

Parameters
o
Returns
boost::shared_ptr<MatrixDouble>&

Definition at line 918 of file EntitiesFieldData.cpp.

918 {
919 return bbNByOrder[o];
920}

◆ getBBNMap()

std::map< std::string, boost::shared_ptr< MatrixDouble > > & MoFEM::EntitiesFieldData::EntData::getBBNMap ( )
virtual

get hash map of base function for BB base, key is a field name

Returns
std::map<std::string, boost::shared_ptr<MatrixDouble>>&

Definition at line 903 of file EntitiesFieldData.cpp.

903 {
904 return bbN;
905}
std::map< std::string, boost::shared_ptr< MatrixDouble > > bbN

◆ getBBNodeOrder()

VectorInt & MoFEM::EntitiesFieldData::EntData::getBBNodeOrder ( )
inline

Get orders at the nodes.

Returns
VectorInt&

Definition at line 1737 of file EntitiesFieldData.hpp.

1737{ return bbNodeOrder; }

◆ getBBNSharedPtr() [1/2]

boost::shared_ptr< MatrixDouble > & MoFEM::EntitiesFieldData::EntData::getBBNSharedPtr ( const std::string &  field_name)
virtual

Get shared pointer to BB base base functions

Reimplemented in MoFEM::DerivedEntitiesFieldData::DerivedEntData.

Definition at line 867 of file EntitiesFieldData.cpp.

867 {
868 return bbN[field_name];
869}

◆ getBBNSharedPtr() [2/2]

const boost::shared_ptr< MatrixDouble > & MoFEM::EntitiesFieldData::EntData::getBBNSharedPtr ( const std::string &  field_name) const
virtual

Get shared pointer to BB base base functions

Reimplemented in MoFEM::DerivedEntitiesFieldData::DerivedEntData.

Definition at line 875 of file EntitiesFieldData.cpp.

876 {
877 return bbN.at(field_name);
878}

◆ getDiffN() [1/7]

MatrixDouble & MoFEM::EntitiesFieldData::EntData::getDiffN ( )
inline

Get derivatives of base functions using default base.

Returns
MatrixDouble& Reference to derivative matrix

Definition at line 1542 of file EntitiesFieldData.hpp.

1542{ return getDiffN(bAse); }
MatrixDouble & getDiffN()
Get derivatives of base functions using default base.

◆ getDiffN() [2/7]

MatrixDouble & MoFEM::EntitiesFieldData::EntData::getDiffN ( const FieldApproximationBase  base)
inline

get derivatives of base functions

Matrix at rows has nb. of Gauss pts, at columns it has derivative of base functions. Columns are structured as follows, [ dN1/dx, dN1/dy, dN1/dz, dN2/dx, dN2/dy, dN2/dz, ... ]

Scalar base functions: Note that base functions are calculated in file H1.c Above description not apply for derivatives of nodal functions, since derivative of nodal functions in case of simplexes, EDGES, TRIANGLES and TETS are constant. So that matrix rows represents nb. of base functions, columns are derivatives. Nb. of columns depend on element dimension, for EDGES is one, for TRIS is 2 and TETS is 3.

Note
Note that for node element this function make no sense.

Tensorial base functions:

Note
Note: In rows are integration pts, columns are formatted that that components of vectors and then derivatives, for example row for given integration points is formatted in array

\[ t_{0,0}, t_{1,0}, t_{1,0}, t_{0,1}, t_{1,1}, t_{1,1}, t_{0,2}, t_{1,2}, t_{1,2} \]

where comma express derivative, i.e. \(t_{2,1} = \frac{\partial t_2}{\partial \xi_1}\)
Examples
mofem/atom_tests/hcurl_curl_operator.cpp, mofem/atom_tests/hdiv_divergence_operator.cpp, mofem/atom_tests/scalar_check_approximation.cpp, and mofem/tutorials/scl-11/src/PoissonDiscontinousGalerkin.hpp.

Definition at line 1513 of file EntitiesFieldData.hpp.

1513 {
1514 return *(getDiffNSharedPtr(base));
1515}

◆ getDiffN() [3/7]

const MatrixAdaptor MoFEM::EntitiesFieldData::EntData::getDiffN ( const FieldApproximationBase  base,
const int  gg 
)
inline

Get derivative of base functions at specific Gauss point.

Returned matrix has base functions in rows and derivatives in columns.

Parameters
baseApproximation base type
ggGauss point number
Returns
const MatrixAdaptor Adaptor to derivative matrix at Gauss point

Definition at line 1562 of file EntitiesFieldData.hpp.

1563 {
1564 // FIXME: That is bug, it will not work if number of integration pts is
1565 // equal to number of nodes on entity. User who not implementing low
1566 // level DataOperator will not experience this.
1567 if (getN(base).size1() == getDiffN(base).size1()) {
1568 int size = getN(base).size2();
1569 int dim = getDiffN(base).size2() / size;
1570 double *data = &getDiffN(base)(gg, 0);
1571 return MatrixAdaptor(
1572 getN(base).size2(), dim,
1573 ublas::shallow_array_adaptor<double>(getDiffN(base).size2(), data));
1574 } else {
1575 // in some cases, f.e. for derivatives of nodal base functions at only
1576 // one gauss point is needed
1577 return MatrixAdaptor(
1578 getN(base).size1(), getN(base).size2(),
1579 ublas::shallow_array_adaptor<double>(getDiffN(base).data().size(),
1580 &getDiffN(base).data()[0]));
1581 }
1582}
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition Types.hpp:132
MatrixDouble & getN()
Get base functions using default base.

◆ getDiffN() [4/7]

const MatrixAdaptor MoFEM::EntitiesFieldData::EntData::getDiffN ( const FieldApproximationBase  base,
const int  gg,
const int  nb_base_functions 
)
inline

Get derivatives of base functions at Gauss point with limited number.

Note that for multi-field elements, different fields can have different approximation orders. Since hierarchical approximation basis is used, base functions are calculated once for element using maximal order.

Parameters
baseApproximation base type
ggGauss point number
nb_base_functionsNumber of base functions
Returns
const MatrixAdaptor Adaptor to limited derivative matrix

Definition at line 1604 of file EntitiesFieldData.hpp.

1606 {
1607 // FIXME: That is bug, it will not work if number of integration pts is
1608 // equal to number of nodes on entity. User who not implementing low
1609 // level DataOperator will not experience this.
1610 if (getN(base).size1() == getDiffN(base).size1()) {
1611 (void)getN(base)(gg,
1612 nb_base_functions -
1613 1); // throw error if nb_base_functions is to big
1614 int dim = getDiffN(base).size2() / getN(base).size2();
1615 double *data = &getDiffN(base)(gg, 0);
1616 return MatrixAdaptor(
1617 nb_base_functions, dim,
1618 ublas::shallow_array_adaptor<double>(dim * nb_base_functions, data));
1619 } else {
1620 // in some cases, f.e. for derivatives of nodal base functions only one
1621 // gauss point is needed
1622 return MatrixAdaptor(
1623 getN(base).size1(), getN(base).size2(),
1624 ublas::shallow_array_adaptor<double>(getDiffN(base).data().size(),
1625 &getDiffN(base).data()[0]));
1626 }
1627}

◆ getDiffN() [5/7]

const MatrixAdaptor MoFEM::EntitiesFieldData::EntData::getDiffN ( const int  gg)
inline

Get derivative of base functions at specific Gauss point using default base.

Parameters
ggGauss point number
Returns
const MatrixAdaptor Adaptor to derivative matrix at Gauss point

Definition at line 1584 of file EntitiesFieldData.hpp.

1584 {
1585 return getDiffN(bAse, gg);
1586}

◆ getDiffN() [6/7]

const MatrixAdaptor MoFEM::EntitiesFieldData::EntData::getDiffN ( const int  gg,
const int  nb_base_functions 
)
inline

Get derivatives of base functions at Gauss point with limited number (default base)

Parameters
ggGauss point number
nb_base_functionsNumber of base functions
Returns
const MatrixAdaptor Adaptor to limited derivative matrix

Definition at line 1630 of file EntitiesFieldData.hpp.

1631 {
1632 return getDiffN(bAse, gg, nb_base_functions);
1633}

◆ getDiffN() [7/7]

MatrixDouble & MoFEM::EntitiesFieldData::EntData::getDiffN ( const std::string &  field_name)
inline

Get derivatives of base functions for specific field.

Parameters
field_nameName of the field
Returns
MatrixDouble& Reference to derivative matrix

Definition at line 1532 of file EntitiesFieldData.hpp.

1532 {
1533 #ifndef NDEBUG
1536 "Null pointer to base functions derivative");
1537 }
1538 #endif // NDEBUG
1540}
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31

◆ getDiffNSharedPtr()

boost::shared_ptr< MatrixDouble > & MoFEM::EntitiesFieldData::EntData::getDiffNSharedPtr ( const FieldApproximationBase  base)
virtual

Get shared pointer to derivatives of base functions.

Parameters
baseApproximation base type
Returns
boost::shared_ptr<MatrixDouble>& Shared pointer to derivative matrix

Reimplemented in MoFEM::DerivedEntitiesFieldData::DerivedEntData.

Definition at line 37 of file EntitiesFieldData.cpp.

38 {
39 return diffN[base];
40}

◆ getEntDataBitRefLevel()

std::vector< BitRefLevel > & MoFEM::EntitiesFieldData::EntData::getEntDataBitRefLevel ( )
virtual

Get entity bit reference level.

Returns
std::vector<BitRefLevel>& Reference to bit reference level vector

Reimplemented in MoFEM::DerivedEntitiesFieldData::DerivedEntData.

Definition at line 983 of file EntitiesFieldData.cpp.

983 {
984 return entDataBitRefLevel;
985}

◆ getFieldData() [1/2]

VectorDouble & MoFEM::EntitiesFieldData::EntData::getFieldData ( )
inline

Get DOF values on entity for modification.

Returns
VectorDouble& Reference to vector of DOF values

Definition at line 1443 of file EntitiesFieldData.hpp.

1443{ return fieldData; }
VectorDouble fieldData
Field data on entity.

◆ getFieldData() [2/2]

const VectorDouble & MoFEM::EntitiesFieldData::EntData::getFieldData ( ) const
inline

◆ getFieldDataUpToOrder()

const VectorAdaptor MoFEM::EntitiesFieldData::EntData::getFieldDataUpToOrder ( int  order)
inline

Get DOF values on entity up to given order.

Parameters
orderMaximum approximation order to include
Returns
const VectorAdaptor Adaptor to subset of DOF values

Definition at line 1427 of file EntitiesFieldData.hpp.

1427 {
1428 unsigned int size = 0;
1429 if (auto dof = dOfs[0]) {
1430 size = dof->getOrderNbDofs(order) * dof->getNbOfCoeffs();
1431 size = size < fieldData.size() ? size : fieldData.size();
1432 }
1433 double *data = &*fieldData.data().begin();
1434 return getVectorAdaptor(data, size);
1435}
constexpr int order
auto getVectorAdaptor(T1 ptr, const size_t n)
Get Vector adaptor.
Definition Templates.hpp:31

◆ getFieldDofs() [1/2]

VectorDofs & MoFEM::EntitiesFieldData::EntData::getFieldDofs ( )
inline

Definition at line 1441 of file EntitiesFieldData.hpp.

1441{ return dOfs; }

◆ getFieldDofs() [2/2]

const VectorDofs & MoFEM::EntitiesFieldData::EntData::getFieldDofs ( ) const
inline

Get DOF data structures (const version)

Returns
const VectorDofs& Reference to vector of FEDofEntity pointers
Examples
mofem/atom_tests/prism_elements_from_surface.cpp, mofem/tutorials/cor-2to5/src/PoissonOperators.hpp, and mofem/users_modules/basic_finite_elements/src/impl/HookeElement.cpp.

Definition at line 1437 of file EntitiesFieldData.hpp.

1437 {
1438 return dOfs;
1439}

◆ getFieldEntities() [1/2]

VectorFieldEntities & MoFEM::EntitiesFieldData::EntData::getFieldEntities ( )
inline

Get field entities for modification.

Returns
VectorFieldEntities& Reference to vector of FieldEntity pointers

Definition at line 1445 of file EntitiesFieldData.hpp.

1445 {
1446 return fieldEntities;
1447}
VectorFieldEntities fieldEntities
Field entities.

◆ getFieldEntities() [2/2]

const VectorFieldEntities & MoFEM::EntitiesFieldData::EntData::getFieldEntities ( ) const
inline

Get field entities (const version)

Returns
const VectorFieldEntities& Reference to vector of FieldEntity pointers
Examples
mofem/atom_tests/test_cache_on_entities.cpp, and mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianOperators.cpp.

Definition at line 1450 of file EntitiesFieldData.hpp.

1450 {
1451 return fieldEntities;
1452}

◆ getFTensor0FieldData()

FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > MoFEM::EntitiesFieldData::EntData::getFTensor0FieldData ( )

Return scalar files as a FTensor of rank 0.

Returns
FTensor::Tensor0<FTensor::PackPtr<double *,1> >
Examples
mofem/atom_tests/continuity_check_on_skeleton_3d.cpp, and mofem/atom_tests/scalar_check_approximation.cpp.

Definition at line 506 of file EntitiesFieldData.cpp.

506 {
507#ifndef NDEBUG
508 for (auto &d : dOfs) {
509 if (d) {
510 if (d->getNbOfCoeffs() != 1) {
511 std::stringstream s;
512 s << "Wrong number of coefficients is " << d->getNbOfCoeffs();
513 s << " but expected scalar field, tensor of rank 0";
515 }
516 break;
517 }
518 }
519#endif
521 &*fieldData.data().begin());
522}

◆ getFTensor0N() [1/4]

FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > MoFEM::EntitiesFieldData::EntData::getFTensor0N ( )
inline

Get base function as Tensor0.

Return base functions for field base

Returns
Tensor0

Definition at line 1698 of file EntitiesFieldData.hpp.

1698 {
1699 return getFTensor0N(bAse);
1700};
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N()
Get base function as Tensor0.

◆ getFTensor0N() [2/4]

FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > MoFEM::EntitiesFieldData::EntData::getFTensor0N ( const FieldApproximationBase  base)
inline

◆ getFTensor0N() [3/4]

FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > MoFEM::EntitiesFieldData::EntData::getFTensor0N ( const FieldApproximationBase  base,
const int  gg,
const int  bb 
)
inline

Get base function as Tensor0 (Loop by integration points)

Parameters
base
ggintegration points
bbbase function
Returns
Tensor0

Note that:

t0 = data.getFTensor0N(base,bb);
++t0

Increment in above code will move pointer to base function in next integration point.

Definition at line 1703 of file EntitiesFieldData.hpp.

1704 {
1705 double *ptr = &getN(base)(gg, bb);
1707};

◆ getFTensor0N() [4/4]

FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > MoFEM::EntitiesFieldData::EntData::getFTensor0N ( const int  gg,
const int  bb 
)
inline

Get base function as Tensor0 (Loop by integration points)

Return base functions for field base

Parameters
bbbase function
Returns
Tensor0

Definition at line 1710 of file EntitiesFieldData.hpp.

1710 {
1711 return getFTensor0N(bAse, gg, bb);
1712};

◆ getFTensor1DiffN() [1/8]

template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > MoFEM::EntitiesFieldData::EntData::getFTensor1DiffN ( )

Get derivatives of base functions.

For volume element like tetrahedral or prism,

Tensor1<double*,3> diff_base = data.getFTensor1DiffN<3>();

For face element like triangle or quad

Tensor1<double*,2> diff_base = data.getFTensor1DiffN<2>();
Returns
Tensor rank 1 (vector)

Definition at line 536 of file EntitiesFieldData.cpp.

536 {
537 return getFTensor1DiffN<Tensor_Dim>(bAse);
538}

◆ getFTensor1DiffN() [2/8]

FTensor::Tensor1< FTensor::PackPtr< double *, 2 >, 2 > MoFEM::EntitiesFieldData::EntData::getFTensor1DiffN< 2 > ( )

Get spatial derivative of base function tensor for dimension 3d.

Get spatial derivative of base function tensor for dimension 2d.

Definition at line 536 of file EntitiesFieldData.cpp.

557 {
558 return getFTensor1DiffN<3>(bAse);
559}

◆ getFTensor1DiffN() [3/8]

template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > MoFEM::EntitiesFieldData::EntData::getFTensor1DiffN ( const FieldApproximationBase  base)

◆ getFTensor1DiffN() [4/8]

FTensor::Tensor1< FTensor::PackPtr< double *, 2 >, 2 > MoFEM::EntitiesFieldData::EntData::getFTensor1DiffN< 2 > ( const FieldApproximationBase  base)

Get spatial derivative of base function tensor for dimension 3d.

Get spatial derivative of base function tensor for dimension 2d.

Definition at line 536 of file EntitiesFieldData.cpp.

546 {
547 double *ptr = &*getDiffN(base).data().begin();
549 &ptr[2]);
550}

◆ getFTensor1DiffN() [5/8]

template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > MoFEM::EntitiesFieldData::EntData::getFTensor1DiffN ( const FieldApproximationBase  base,
const int  gg,
const int  bb 
)

Get derivatives of base functions (Loop by integration points)

For volume element like tetrahedral or prism,

Tensor1<double*,3> diff_base = data.getFTensor1DiffN<3>(base,gg,bb);

where bb is base function and gg is integration pt. Operator ++diff_base will move tensor pointer to next integration point.

For face element like triangle or quad

Tensor1<double*,2> diff_base = data.getFTensor1DiffN<2>(base,gg,bb);
Returns
Tensor rank 1 (vector)

Definition at line 583 of file EntitiesFieldData.cpp.

584 {
585 std::stringstream s;
586 s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
587 THROW_MESSAGE(s.str());
589}

◆ getFTensor1DiffN() [6/8]

FTensor::Tensor1< FTensor::PackPtr< double *, 2 >, 2 > MoFEM::EntitiesFieldData::EntData::getFTensor1DiffN< 2 > ( const FieldApproximationBase  base,
const int  gg,
const int  bb 
)

Get spatial derivative of base function tensor for dimension 3d.

Get spatial derivative of base function tensor for dimension 2d.

Definition at line 583 of file EntitiesFieldData.cpp.

597 {
598 double *ptr = &getDiffN(base)(gg, 3 * bb);
600 &ptr[2]);
601}

◆ getFTensor1DiffN() [7/8]

template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > MoFEM::EntitiesFieldData::EntData::getFTensor1DiffN ( const int  gg,
const int  bb 
)

Get derivatives of base functions (Loop by integration points)

For volume element like tetrahedral or prism,

Tensor1<double*,3> diff_base = data.getFTensor1DiffN<3>(gg,bb);

where bb is base function and gg is integration pt. Operator ++diff_base will move tensor pointer to next base function.

For face element like triangle or quad

Tensor1<double*,2> diff_base = data.getFTensor1DiffN<2>(gg,bb);
Returns
Tensor rank 1 (vector)

◆ getFTensor1DiffN() [8/8]

FTensor::Tensor1< FTensor::PackPtr< double *, 2 >, 2 > MoFEM::EntitiesFieldData::EntData::getFTensor1DiffN< 2 > ( const int  gg,
const int  bb 
)

Get spatial derivative of base function tensor for dimension 3d.

Get spatial derivative of base function tensor for dimension 2d.

Definition at line 583 of file EntitiesFieldData.cpp.

608 {
609 return getFTensor1DiffN<3>(bAse, gg, bb);
610}

◆ getFTensor1FieldData() [1/2]

template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > MoFEM::EntitiesFieldData::EntData::getFTensor1FieldData ( )

Return FTensor of rank 1, i.e. vector from field data coefficients.

auto t_vec = data.getFTensor1FieldData<3>();
Template Parameters
Tensor_Dimsize of vector
Returns
FTensor::Tensor1<FTensor::PackPtr<double *, Tensor_Dim>, Tensor_Dim>

Definition at line 1456 of file EntitiesFieldData.hpp.

1456 {
1457 std::stringstream s;
1458 s << "Not implemented for this dimension dim = " << Tensor_Dim;
1459 THROW_MESSAGE(s.str());
1460}

◆ getFTensor1FieldData() [2/2]

FTensor::Tensor1< FTensor::PackPtr< double *, 1 >, 1 > MoFEM::EntitiesFieldData::EntData::getFTensor1FieldData< 1 > ( )

Definition at line 270 of file EntitiesFieldData.cpp.

287 {
288#ifndef NDEBUG
289 for (auto &d : dOfs) {
290 if (d) {
291 if (d->getNbOfCoeffs() != 3) {
292 std::stringstream s;
293 s << "Wrong number of coefficients is " << d->getNbOfCoeffs();
294 s << " but you ask for tensor rank 1 dimension 3";
296 }
297 break;
298 }
299 }
300#endif
301 double *ptr = &*fieldData.data().begin();
303 &ptr[2]);
304}

◆ getFTensor1N() [1/6]

template<int Tensor_Dim>
auto MoFEM::EntitiesFieldData::EntData::getFTensor1N ( )

Get base functions for Hdiv space.

Example:

int nb_dofs = data.getFieldData().size();
auto t_n_hdiv = data.getFTensor1N<3>();
for(int gg = 0;gg!=nb_gauss_pts;gg++) {
int ll = 0;
for(;ll!=nb_dofs;ll++) {
double dot_product = t_n_hdiv(i)*t_n_hdiv(i);
++t_n_hdiv;
}
for(;ll!=data.getVectorN().size2()/3;ll++) {
++t_n_hdiv;
}
}
FTensor::Index< 'i', SPACE_DIM > i

Definition at line 1714 of file EntitiesFieldData.hpp.

1714 {
1715 return getFTensor1N<Tensor_Dim>(bAse);
1716}

◆ getFTensor1N() [2/6]

template<int Tensor_Dim>
auto MoFEM::EntitiesFieldData::EntData::getFTensor1N ( const int  gg,
const int  bb 
)
inline

Get Hdiv base functions at integration point.

for(int gg = 0;gg!=nb_gauss_pts;gg++) {
auto t_base = data.getFTensor1N(gg,0);
for(int bb = 0;bb!=nb_base_functions;bb++) {
double dot = t_base(i)*t_base(i);
}
}

Definition at line 1719 of file EntitiesFieldData.hpp.

1719 {
1720 return getFTensor1N<Tensor_Dim>(bAse, gg, bb);
1721}

◆ getFTensor1N() [3/6]

template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > MoFEM::EntitiesFieldData::EntData::getFTensor1N ( FieldApproximationBase  base)

Get base functions for Hdiv/Hcurl spaces.

Note
You probably like to use getFTensor1N(), in typical use base is set automatically based on base set to field.
Parameters
baseApproximation base

Example:

int nb_dofs = data.getFieldData().size();
auto t_n_hdiv = data.getFTensor1N<3>();
for(int gg = 0;gg!=nb_gauss_pts;gg++) {
int ll = 0;
for(;ll!=nb_dofs;ll++) {
double dot_product = t_n_hdiv(i)*t_n_hdiv(i);
++t_n_hdiv;
}
for(;ll!=data.getVectorN().size2()/3;ll++) {
++t_n_hdiv;
}
}
Examples
mofem/atom_tests/continuity_check_on_skeleton_3d.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, mofem/atom_tests/hcurl_curl_operator.cpp, mofem/atom_tests/hcurl_divergence_operator_2d.cpp, mofem/tutorials/adv-2/thermo_elastic.cpp, and mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianOperators.cpp.

Definition at line 640 of file EntitiesFieldData.cpp.

640 {
641 std::stringstream s;
642 s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
643 THROW_MESSAGE(s.str());
645}

◆ getFTensor1N() [4/6]

FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > MoFEM::EntitiesFieldData::EntData::getFTensor1N< 3 > ( FieldApproximationBase  base)

Definition at line 671 of file EntitiesFieldData.cpp.

682 {
683 double *t_n_ptr = &*getN(base).data().begin();
684 return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(t_n_ptr, // HVEC0
685 &t_n_ptr[HVEC1],
686 &t_n_ptr[HVEC2]);
687}
@ HVEC1
@ HVEC2

◆ getFTensor1N() [5/6]

template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > MoFEM::EntitiesFieldData::EntData::getFTensor1N ( FieldApproximationBase  base,
const int  gg,
const int  bb 
)

Get Hdiv base functions at integration point.

for(int gg = 0;gg!=nb_gauss_pts;gg++) {
auto t_base = data.getFTensor1N(base,gg,bb);
for(int bb = 0;bb!=nb_base_functions;bb++) {
auto dot = t_base(i)*t_base(i);
}
}

Definition at line 649 of file EntitiesFieldData.cpp.

650 {
651 std::stringstream s;
652 s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
653 THROW_MESSAGE(s.str());
655}

◆ getFTensor1N() [6/6]

FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > MoFEM::EntitiesFieldData::EntData::getFTensor1N< 3 > ( FieldApproximationBase  base,
const int  gg,
const int  bb 
)

Definition at line 671 of file EntitiesFieldData.cpp.

692 {
693 double *t_n_ptr = &getN(base)(gg, 3 * bb);
694 return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(t_n_ptr, // HVEC0
695 &t_n_ptr[HVEC1],
696 &t_n_ptr[HVEC2]);
697}

◆ getFTensor2DiffN() [1/6]

template<int Tensor_Dim0, int Tensor_Dim1>
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > MoFEM::EntitiesFieldData::EntData::getFTensor2DiffN ( )
inline

Get derivatives of base functions for Hdiv space.

Definition at line 881 of file EntitiesFieldData.hpp.

881 {
882 return getFTensor2DiffN<Tensor_Dim0, Tensor_Dim1>(bAse);
883 }

◆ getFTensor2DiffN() [2/6]

template<int Tensor_Dim0, int Tensor_Dim1>
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > MoFEM::EntitiesFieldData::EntData::getFTensor2DiffN ( const int  gg,
const int  bb 
)
inline

Get derivatives of base functions for Hdiv space at integration pts.

Definition at line 891 of file EntitiesFieldData.hpp.

891 {
892 return getFTensor2DiffN<Tensor_Dim0, Tensor_Dim1>(bAse, gg, bb);
893 }

◆ getFTensor2DiffN() [3/6]

template<int Tensor_Dim0, int Tensor_Dim1>
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > MoFEM::EntitiesFieldData::EntData::getFTensor2DiffN ( FieldApproximationBase  base)

Get derivatives of base functions for Hdiv space.

Examples
mofem/atom_tests/hcurl_curl_operator.cpp, mofem/atom_tests/hcurl_divergence_operator_2d.cpp, mofem/atom_tests/hdiv_divergence_operator.cpp, and mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianOperators.cpp.

Definition at line 660 of file EntitiesFieldData.cpp.

660 {
661 std::stringstream s;
662 s << "Template for tensor dimension " << Tensor_Dim0 << "x" << Tensor_Dim1
663 << " not implemented";
664 THROW_MESSAGE(s.str());
666}

◆ getFTensor2DiffN() [4/6]

FTensor::Tensor2< FTensor::PackPtr< double *, 6 >, 3, 2 > MoFEM::EntitiesFieldData::EntData::getFTensor2DiffN< 3, 2 > ( FieldApproximationBase  base)

Definition at line 671 of file EntitiesFieldData.cpp.

702 {
703 double *t_diff_n_ptr = &*getDiffN(base).data().begin();
705 t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC0_2],
706 &t_diff_n_ptr[HVEC1_0], &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC1_2],
707 &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1], &t_diff_n_ptr[HVEC2_2]);
708}
@ HVEC1_1
@ HVEC0_1
@ HVEC1_0
@ HVEC2_1
@ HVEC1_2
@ HVEC2_2
@ HVEC2_0
@ HVEC0_2

◆ getFTensor2DiffN() [5/6]

template<int Tensor_Dim0, int Tensor_Dim1>
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > MoFEM::EntitiesFieldData::EntData::getFTensor2DiffN ( FieldApproximationBase  base,
const int  gg,
const int  bb 
)

Get derivatives of base functions for Hdiv space at integration pts.

Definition at line 671 of file EntitiesFieldData.cpp.

672 {
673 std::stringstream s;
674 s << "Template for tensor dimension " << Tensor_Dim0 << "x" << Tensor_Dim1
675 << " not implemented";
676 THROW_MESSAGE(s.str());
678}

◆ getFTensor2DiffN() [6/6]

FTensor::Tensor2< FTensor::PackPtr< double *, 6 >, 3, 2 > MoFEM::EntitiesFieldData::EntData::getFTensor2DiffN< 3, 2 > ( FieldApproximationBase  base,
const int  gg,
const int  bb 
)

Definition at line 671 of file EntitiesFieldData.cpp.

713 {
714 double *t_diff_n_ptr = &getDiffN(base)(gg, 9 * bb);
716 t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC0_2],
717 &t_diff_n_ptr[HVEC1_0], &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC1_2],
718 &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1], &t_diff_n_ptr[HVEC2_2]);
719}

◆ getFTensor2FieldData() [1/2]

template<int Tensor_Dim0, int Tensor_Dim1>
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > MoFEM::EntitiesFieldData::EntData::getFTensor2FieldData ( )

Return FTensor rank 2, i.e. matrix from field data coefficients.

auto t_mat = data.getFTensor2FieldData<3,3>();
Template Parameters
Tensor_Dim0First dimension of tensor
Tensor_Dim1Second dimension of tensor
Returns
FTensor::Tensor2<FTensor::PackPtr<double *, Tensor_Dim0 * Tensor_Dim1>, Tensor_Dim0, Tensor_Dim1> Rank 2 tensor

Definition at line 1465 of file EntitiesFieldData.hpp.

1465 {
1466 std::stringstream s;
1467 s << "Not implemented for this dimension dim0 = " << Tensor_Dim0;
1468 s << " and dim1 " << Tensor_Dim1;
1469 THROW_MESSAGE(s.str());
1470}

◆ getFTensor2FieldData() [2/2]

FTensor::Tensor2< FTensor::PackPtr< double *, 9 >, 3, 3 > MoFEM::EntitiesFieldData::EntData::getFTensor2FieldData< 3, 3 > ( )

Definition at line 270 of file EntitiesFieldData.cpp.

348 {
349#ifndef NDEBUG
350 for (auto &d : dOfs) {
351 if (d) {
352 if (d->getNbOfCoeffs() != 1) {
353 std::stringstream s;
354 s << "Wrong number of coefficients is " << d->getNbOfCoeffs();
355 s << " but you ask for tensor rank 2 dimensions 1 by 1 so 1 "
356 "coefficients "
357 "is expected";
359 }
360 break;
361 }
362 }
363#endif
364 double *ptr = &*fieldData.data().begin();
366}

◆ getFTensor2N() [1/6]

template<int Tensor_Dim0, int Tensor_Dim1>
auto MoFEM::EntitiesFieldData::EntData::getFTensor2N ( )

Get base functions for Hdiv space.

Example:

int nb_dofs = data.getFieldData().size();
auto t_n_hdiv = data.getFTensor2N<3,3>();
for(int gg = 0;gg!=nb_gauss_pts;gg++) {
int ll = 0;
for(;ll!=nb_dofs;ll++) {
double dot_product = t_n_hdiv(i,j)*t_n_hdiv(i,j);
++t_n_hdiv;
}
for(;ll!=data.getVectorN().size2()/3;ll++) {
++t_n_hdiv;
}
}
FTensor::Index< 'j', 3 > j

Definition at line 1724 of file EntitiesFieldData.hpp.

1724 {
1725 return getFTensor2N<Tensor_Dim0, Tensor_Dim1>(bAse);
1726}

◆ getFTensor2N() [2/6]

template<int Tensor_Dim0, int Tensor_Dim1>
auto MoFEM::EntitiesFieldData::EntData::getFTensor2N ( const int  gg,
const int  bb 
)

Get base functions for Hdiv space.

Example:

int nb_dofs = data.getFieldData().size();
for(int gg = 0;gg!=nb_gauss_pts;++gg) {
int ll = 0;
auto t_n_hdiv = data.getFTensor2N<3,3>(gg,0);
for(;ll!=nb_dofs;ll++) {
double dot_product = t_n_hdiv(i)*t_n_hdiv(i);
++t_n_hdiv;
}
for(;ll!=data.getVectorN().size2()/3;ll++) {
++t_n_hdiv;
}
}

Definition at line 1729 of file EntitiesFieldData.hpp.

1729 {
1730 return getFTensor2N<Tensor_Dim0, Tensor_Dim1>(bAse, gg, bb);
1731}

◆ getFTensor2N() [3/6]

template<int Tensor_Dim0, int Tensor_Dim1>
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > MoFEM::EntitiesFieldData::EntData::getFTensor2N ( FieldApproximationBase  base)

Get base functions for Hdiv/Hcurl spaces.

Note
You probably like to use getFTensor1N(), in typical use base is set automatically based on base set to field.
Parameters
baseApproximation base

Example:

int nb_dofs = data.getFieldData().size();
auto t_n_hdiv = data.getFTensor2N<3,3>();
for(int gg = 0;gg!=nb_gauss_pts;gg++) {
int ll = 0;
for(;ll!=nb_dofs;ll++) {
double dot_product = t_n_hdiv(i,j)*t_n_hdiv(i,j);
++t_n_hdiv;
}
for(;ll!=data.getVectorN().size2()/3;ll++) {
++t_n_hdiv;
}
}
Examples
mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianOperators.cpp.

Definition at line 762 of file EntitiesFieldData.cpp.

762 {
763 std::stringstream s;
764 s << "Template for tensor dimension " << Tensor_Dim0 << ", " << Tensor_Dim1
765 << " not implemented";
766 THROW_MESSAGE(s.str());
768 Tensor_Dim0, Tensor_Dim1>();
769}

◆ getFTensor2N() [4/6]

FTensor::Tensor2< FTensor::PackPtr< double *, 9 >, 3, 3 > MoFEM::EntitiesFieldData::EntData::getFTensor2N< 3, 3 > ( FieldApproximationBase  base)

Definition at line 762 of file EntitiesFieldData.cpp.

773 {
774 double *t_n_ptr = &*(getN(base).data().begin());
776
777 &t_n_ptr[HVEC0], &t_n_ptr[HVEC1], &t_n_ptr[HVEC2],
778
779 &t_n_ptr[3 + HVEC0], &t_n_ptr[3 + HVEC1], &t_n_ptr[3 + HVEC2],
780
781 &t_n_ptr[6 + HVEC0], &t_n_ptr[6 + HVEC1], &t_n_ptr[6 + HVEC2]
782
783 );
784}
@ HVEC0

◆ getFTensor2N() [5/6]

template<int Tensor_Dim0, int Tensor_Dim1>
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > MoFEM::EntitiesFieldData::EntData::getFTensor2N ( FieldApproximationBase  base,
const int  gg,
const int  bb 
)

Get base functions for tensor Hdiv/Hcurl spaces.

Note
You probably like to use getFTensor2N(), in typical use base is set automatically based on base set to field.
Parameters
baseApproximation base

Example:

int nb_dofs = data.getFieldData().size();
for(int gg = 0;gg!=nb_gauss_pts;gg++) {
auto t_n_hdiv = data.getFTensor2N<3>(base,gg,bb);
int ll = 0;
for(;ll!=nb_dofs;ll++) {
double dot_product = t_n_hdiv(i,j)*t_n_hdiv(i,j);
++t_n_hdiv;
}
for(;ll!=data.getVectorN().size2()/3;ll++) {
++t_n_hdiv;
}
}

Definition at line 789 of file EntitiesFieldData.cpp.

790 {
791 std::stringstream s;
792 s << "Template for tensor dimension " << Tensor_Dim0 << ", " << Tensor_Dim1
793 << " not implemented";
794 THROW_MESSAGE(s.str());
796 Tensor_Dim0, Tensor_Dim1>();
797}

◆ getFTensor2N() [6/6]

template<>
FTensor::Tensor2< FTensor::PackPtr< double *, 9 >, 3, 3 > MoFEM::EntitiesFieldData::EntData::getFTensor2N ( FieldApproximationBase  base,
const int  gg,
const int  bb 
)

Definition at line 789 of file EntitiesFieldData.cpp.

802 {
803 double *t_n_ptr = &getN(base)(gg, 9 * bb);
805
806 &t_n_ptr[HVEC0], &t_n_ptr[HVEC1], &t_n_ptr[HVEC2],
807
808 &t_n_ptr[3 + HVEC0], &t_n_ptr[3 + HVEC1], &t_n_ptr[3 + HVEC2],
809
810 &t_n_ptr[6 + HVEC0], &t_n_ptr[6 + HVEC1], &t_n_ptr[6 + HVEC2]
811
812 );
813}

◆ getFTensor2SymmetricFieldData() [1/2]

template<int Tensor_Dim>
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *,(Tensor_Dim *(Tensor_Dim+1))/2 >, Tensor_Dim > MoFEM::EntitiesFieldData::EntData::getFTensor2SymmetricFieldData ( )

Return symmetric FTensor rank 2, i.e. matrix from field data coefficients.

auto t_mat = data.getFTensor2SymmetricFieldData<3>();
Template Parameters
Tensor_DimDimension of the symmetric tensor
Returns
FTensor::Tensor2_symmetric<FTensor::PackPtr<double *, (Tensor_Dim
  • (Tensor_Dim + 1)) / 2>, Tensor_Dim> Symmetric rank 2 tensor

Definition at line 1475 of file EntitiesFieldData.hpp.

1475 {
1476 std::stringstream s;
1477 s << "Not implemented for this dimension dim = " << Tensor_Dim;
1478 THROW_MESSAGE(s.str());
1479}

◆ getFTensor2SymmetricFieldData() [2/2]

FTensor::Tensor2_symmetric< FTensor::PackPtr< double *, 3 >, 2 > MoFEM::EntitiesFieldData::EntData::getFTensor2SymmetricFieldData< 2 > ( )

Definition at line 270 of file EntitiesFieldData.cpp.

461 {
462#ifndef NDEBUG
463 for (auto &d : dOfs) {
464 if (d) {
465 if (d->getNbOfCoeffs() != 6) {
466 std::stringstream s;
467 s << "Wrong number of coefficients is " << d->getNbOfCoeffs();
468 s << " but you ask for symmetric tensor rank 2 dimensions 3 by 3 so 6 "
469 "coefficients "
470 "is expected";
472 }
473 break;
474 }
475 }
476#endif
477 double *ptr = &*fieldData.data().begin();
479 ptr, &ptr[1], &ptr[2], &ptr[3], &ptr[4], &ptr[5]);
480}

◆ getFTensor3Diff2N() [1/3]

template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 *Tensor_Dim2 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > MoFEM::EntitiesFieldData::EntData::getFTensor3Diff2N ( )
inline

Get second derivatives of base functions for Hvec space.

Definition at line 909 of file EntitiesFieldData.hpp.

909 {
910 return getFTensor3Diff2N<Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>(bAse);
911 }

◆ getFTensor3Diff2N() [2/3]

template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 *Tensor_Dim2 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > MoFEM::EntitiesFieldData::EntData::getFTensor3Diff2N ( FieldApproximationBase  base)

Get second derivatives of base functions for Hvec space.

◆ getFTensor3Diff2N() [3/3]

FTensor::Tensor3< FTensor::PackPtr< double *, 12 >, 3, 2, 2 > MoFEM::EntitiesFieldData::EntData::getFTensor3Diff2N ( FieldApproximationBase  base)

Definition at line 743 of file EntitiesFieldData.cpp.

743 {
744 double *ptr = &(getN(base, BaseDerivatives::SecondDerivative))(0, 0);
746
747 &ptr[2 * HVEC0_0 + 0], &ptr[2 * HVEC0_0 + 1], &ptr[2 * HVEC0_1 + 0],
748 &ptr[2 * HVEC0_1 + 1],
749
750 &ptr[2 * HVEC1_0 + 0], &ptr[2 * HVEC1_0 + 1], &ptr[2 * HVEC1_1 + 0],
751 &ptr[2 * HVEC1_1 + 1],
752
753 &ptr[2 * HVEC2_0 + 0], &ptr[2 * HVEC2_0 + 1], &ptr[2 * HVEC2_1 + 0],
754 &ptr[2 * HVEC2_1 + 1]
755
756 };
757}
@ HVEC0_0

◆ getFTensor3DiffN() [1/6]

template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 *Tensor_Dim2 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > MoFEM::EntitiesFieldData::EntData::getFTensor3DiffN ( )
inline

Get derivatives of base functions for tonsorial Hdiv space.

Definition at line 936 of file EntitiesFieldData.hpp.

936 {
937 return getFTensor3DiffN<Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>(bAse);
938 }

◆ getFTensor3DiffN() [2/6]

template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 *Tensor_Dim2 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > MoFEM::EntitiesFieldData::EntData::getFTensor3DiffN ( const int  gg,
const int  bb 
)
inline

Get derivatives of base functions for tonsorial Hdiv space at integration pts.

Definition at line 947 of file EntitiesFieldData.hpp.

947 {
948 return getFTensor3DiffN<Tensor_Dim0, Tensor_Dim1, Tensor_Dim2>(bAse, gg,
949 bb);
950 }

◆ getFTensor3DiffN() [3/6]

template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 *Tensor_Dim2 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > MoFEM::EntitiesFieldData::EntData::getFTensor3DiffN ( FieldApproximationBase  base)

Get derivatives of base functions for tonsorial Hdiv space.

Definition at line 819 of file EntitiesFieldData.cpp.

819 {
820 std::stringstream s;
821 s << "Template for tensor dimension " << Tensor_Dim0 << "x" << Tensor_Dim1
822 << "x" << Tensor_Dim2 << " not implemented";
823 THROW_MESSAGE(s.str());
825}

◆ getFTensor3DiffN() [4/6]

FTensor::Tensor3< FTensor::PackPtr< double *, 27 >, 3, 3, 3 > MoFEM::EntitiesFieldData::EntData::getFTensor3DiffN ( FieldApproximationBase  base)

Definition at line 841 of file EntitiesFieldData.cpp.

841 {
842 double *ptr = &*getDiffN(base).data().begin();
843 return getFTensor3FromPtr<3, 3, 3>(ptr);
844};
FTensor::Tensor3< FTensor::PackPtr< double *, 27 >, 3, 3, 3 > getFTensor3FromPtr< 3, 3, 3 >(double *ptr)

◆ getFTensor3DiffN() [5/6]

template<int Tensor_Dim0, int Tensor_Dim1, int Tensor_Dim2>
FTensor::Tensor3< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 *Tensor_Dim2 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2 > MoFEM::EntitiesFieldData::EntData::getFTensor3DiffN ( FieldApproximationBase  base,
const int  gg,
const int  bb 
)

Get derivatives of base functions for tonsorial Hdiv space at integration pts.

Definition at line 830 of file EntitiesFieldData.cpp.

831 {
832 std::stringstream s;
833 s << "Template for tensor dimension " << Tensor_Dim0 << "x" << Tensor_Dim1
834 << " not implemented";
835 THROW_MESSAGE(s.str());
837}

◆ getFTensor3DiffN() [6/6]

FTensor::Tensor3< FTensor::PackPtr< double *, 27 >, 3, 3, 3 > MoFEM::EntitiesFieldData::EntData::getFTensor3DiffN ( FieldApproximationBase  base,
const int  gg,
const int  bb 
)

Definition at line 848 of file EntitiesFieldData.cpp.

849 {
850 double *ptr = &getDiffN(base)(gg, 27 * bb);
851 return getFTensor3FromPtr<3, 3, 3>(ptr);
852};

◆ getIndices() [1/2]

VectorInt & MoFEM::EntitiesFieldData::EntData::getIndices ( )
inline

Get reference to global indices for modification.

Returns
VectorInt& Reference to global indices vector

Definition at line 1416 of file EntitiesFieldData.hpp.

1416{ return iNdices; }
VectorInt iNdices
Global indices on entity.

◆ getIndices() [2/2]

const VectorInt & MoFEM::EntitiesFieldData::EntData::getIndices ( ) const
inline

◆ getIndicesUpToOrder()

const VectorIntAdaptor MoFEM::EntitiesFieldData::EntData::getIndicesUpToOrder ( int  order)
inline

Get global indices of DOFs on entity up to given order.

Parameters
orderMaximum approximation order to include
Returns
const VectorIntAdaptor Adaptor to subset of global indices

Definition at line 1387 of file EntitiesFieldData.hpp.

1387 {
1388 unsigned int size = 0;
1389 if (auto dof = dOfs[0]) {
1390 size = dof->getOrderNbDofs(order) * dof->getNbOfCoeffs();
1391 size = size < iNdices.size() ? size : iNdices.size();
1392 }
1393 int *data = &*iNdices.data().begin();
1394 return VectorIntAdaptor(size, ublas::shallow_array_adaptor<int>(size, data));
1395}
VectorShallowArrayAdaptor< int > VectorIntAdaptor
Definition Types.hpp:116

◆ getLocalIndices() [1/2]

VectorInt & MoFEM::EntitiesFieldData::EntData::getLocalIndices ( )
inline

Get reference to local indices for modification.

Returns
VectorInt& Reference to local indices vector

Definition at line 1418 of file EntitiesFieldData.hpp.

1418 {
1419 return localIndices;
1420}
VectorInt localIndices
Local indices on entity.

◆ getLocalIndices() [2/2]

const VectorInt & MoFEM::EntitiesFieldData::EntData::getLocalIndices ( ) const
inline

Get local indices of degrees of freedom on entity.

Returns
const VectorInt& Reference to vector of local DOF indices
Examples
mofem/atom_tests/boundary_marker.cpp, and mofem/atom_tests/prism_elements_from_surface.cpp.

Definition at line 1397 of file EntitiesFieldData.hpp.

1397 {
1398 return localIndices;
1399}

◆ getLocalIndicesUpToOrder()

const VectorIntAdaptor MoFEM::EntitiesFieldData::EntData::getLocalIndicesUpToOrder ( int  order)
inline

Get local indices of DOFs on entity up to given order.

Parameters
orderMaximum approximation order to include
Returns
const VectorIntAdaptor Adaptor to subset of local indices

Definition at line 1402 of file EntitiesFieldData.hpp.

1402 {
1403 unsigned int size = 0;
1404 if (auto dof = dOfs[0]) {
1405 size = dof->getOrderNbDofs(order) * dof->getNbOfCoeffs();
1406 size = size < localIndices.size() ? size : localIndices.size();
1407 }
1408 int *data = &*localIndices.data().begin();
1409 return VectorIntAdaptor(size, ublas::shallow_array_adaptor<int>(size, data));
1410}

◆ getN() [1/9]

MatrixDouble & MoFEM::EntitiesFieldData::EntData::getN ( )
inline

Get base functions using default base.

Returns
MatrixDouble& Reference to base function matrix

Definition at line 1510 of file EntitiesFieldData.hpp.

1510{ return getN(bAse); }

◆ getN() [2/9]

MatrixDouble & MoFEM::EntitiesFieldData::EntData::getN ( const BaseDerivatives  derivative)
inline

Get base function derivatives using default base.

Parameters
derivativeDerivative order
Returns
MatrixDouble& Reference to derivative matrix

Definition at line 1545 of file EntitiesFieldData.hpp.

1545 {
1546 return getN(bAse, derivative);
1547}

◆ getN() [3/9]

MatrixDouble & MoFEM::EntitiesFieldData::EntData::getN ( const FieldApproximationBase  base)
inline

get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb. of columns is equal to number of base functions on this entity.

Note
Note that for vectorial base, like Hdiv or Hcurl, in columns are vectorial base functions. For tensorial would be tensorial base functions. Interpretation depends on type of base, scalar, vectorial or tensorial and dimension of problem.
Examples
mofem/atom_tests/continuity_check_on_contact_prism_side_ele.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, mofem/atom_tests/continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, mofem/atom_tests/forces_and_sources_testing_edge_element.cpp, mofem/atom_tests/forces_and_sources_testing_users_base.cpp, mofem/atom_tests/hanging_node_approx.cpp, mofem/atom_tests/hcurl_check_approx_in_2d.cpp, mofem/atom_tests/hcurl_curl_operator.cpp, mofem/atom_tests/hcurl_divergence_operator_2d.cpp, mofem/atom_tests/hdiv_divergence_operator.cpp, mofem/atom_tests/prism_elements_from_surface.cpp, mofem/atom_tests/prism_polynomial_approximation.cpp, mofem/atom_tests/quad_polynomial_approximation.cpp, mofem/atom_tests/scalar_check_approximation.cpp, mofem/tutorials/adv-3/level_set.cpp, mofem/tutorials/cor-6/simple_elasticity.cpp, mofem/tutorials/scl-11/src/PoissonDiscontinousGalerkin.hpp, mofem/tutorials/scl-9/heat_method.cpp, mofem/tutorials/vec-6/plate.cpp, mofem/tutorials/vec-7/adjoint.cpp, mofem/users_modules/basic_finite_elements/src/HookeElement.hpp, mofem/users_modules/basic_finite_elements/src/impl/HookeElement.cpp, mofem/users_modules/basic_finite_elements/src/impl/NavierStokesElement.cpp, and mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianOperators.cpp.

Definition at line 1486 of file EntitiesFieldData.hpp.

1486 {
1487#ifndef NDEBUG
1488 if (!getNSharedPtr(base)) {
1489 MOFEM_LOG_C("SELF", Sev::error, "Ptr to base %s functions is null",
1492 "Null pointer to base functions");
1493 }
1494#endif // NDEBUG
1495 return *(getNSharedPtr(base));
1496}
#define MOFEM_LOG_C(channel, severity, format,...)
static const char *const ApproximationBaseNames[]
Definition definitions.h:72

◆ getN() [4/9]

MatrixDouble & MoFEM::EntitiesFieldData::EntData::getN ( const FieldApproximationBase  base,
const BaseDerivatives  derivative 
)
inline

Get base function derivatives with specific derivative order.

Parameters
baseApproximation base type
derivativeDerivative order
Returns
MatrixDouble& Reference to derivative matrix

Definition at line 1518 of file EntitiesFieldData.hpp.

1519 {
1520#ifndef NDEBUG
1521 if (!getNSharedPtr(base, derivative)) {
1522 MOFEM_LOG_C("SELF", Sev::error,
1523 "Ptr to base %s functions derivative %d is null",
1524 ApproximationBaseNames[base], derivative);
1525 THROW_MESSAGE("Null pointer");
1526 }
1527#endif
1528 return *(getNSharedPtr(base, derivative));
1529}

◆ getN() [5/9]

const VectorAdaptor MoFEM::EntitiesFieldData::EntData::getN ( const FieldApproximationBase  base,
const int  gg 
)
inline

Get base functions at specific Gauss point.

Parameters
baseApproximation base type
ggGauss point number
Returns
const VectorAdaptor Adaptor to base functions at Gauss point

Definition at line 1550 of file EntitiesFieldData.hpp.

1551 {
1552 int size = getN(base).size2();
1553 double *data = &getN(base)(gg, 0);
1554 return VectorAdaptor(size, ublas::shallow_array_adaptor<double>(size, data));
1555}
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition Types.hpp:115

◆ getN() [6/9]

const VectorAdaptor MoFEM::EntitiesFieldData::EntData::getN ( const FieldApproximationBase  base,
const int  gg,
const int  nb_base_functions 
)
inline

Get base functions at Gauss point with limited number of functions.

Note that for multi-field elements, different fields can have different approximation orders. Since hierarchical approximation basis is used, base functions are calculated once for element using maximal order.

Parameters
baseApproximation base type
ggGauss point number
nb_base_functionsNumber of base functions to return
Returns
const VectorAdaptor Adaptor to limited base functions

Definition at line 1589 of file EntitiesFieldData.hpp.

1590 {
1591 (void)getN()(gg, nb_base_functions -
1592 1); // throw error if nb_base_functions is to big
1593 double *data = &getN(base)(gg, 0);
1594 return VectorAdaptor(nb_base_functions, ublas::shallow_array_adaptor<double>(
1595 nb_base_functions, data));
1596}

◆ getN() [7/9]

const VectorAdaptor MoFEM::EntitiesFieldData::EntData::getN ( const int  gg)
inline

Get base functions at specific Gauss point using default base.

Parameters
ggGauss point number
Returns
const VectorAdaptor Adaptor to base functions at Gauss point

Definition at line 1557 of file EntitiesFieldData.hpp.

1557 {
1558 return getN(bAse, gg);
1559}

◆ getN() [8/9]

const VectorAdaptor MoFEM::EntitiesFieldData::EntData::getN ( const int  gg,
const int  nb_base_functions 
)
inline

Get base functions at Gauss point with limited number (default base)

Parameters
ggGauss point number
nb_base_functionsNumber of base functions to return
Returns
const VectorAdaptor Adaptor to limited base functions

Definition at line 1599 of file EntitiesFieldData.hpp.

1599 {
1600 return getN(bAse, gg, nb_base_functions);
1601}

◆ getN() [9/9]

MatrixDouble & MoFEM::EntitiesFieldData::EntData::getN ( const std::string &  field_name)
inline

Get base functions for specific field (Bernstein-Bezier)

Parameters
field_nameName of the field
Returns
MatrixDouble& Reference to base function matrix

Definition at line 1498 of file EntitiesFieldData.hpp.

1498 {
1499#ifndef NDEBUG
1501 MOFEM_LOG_C("SELF", Sev::error, "Ptr to field %s base functions is null ",
1502 field_name.c_str());
1504 "Null pointer to base functions");
1505 }
1506#endif // NDEBUG
1507 return *(getBBNSharedPtr(field_name));
1508}

◆ getNSharedPtr() [1/2]

boost::shared_ptr< MatrixDouble > & MoFEM::EntitiesFieldData::EntData::getNSharedPtr ( const FieldApproximationBase  base)
virtual

Get shared pointer to base functions (zero derivative)

Parameters
baseApproximation base type
Returns
boost::shared_ptr<MatrixDouble>& Shared pointer to base function matrix

Reimplemented in MoFEM::DerivedEntitiesFieldData::DerivedEntData.

Definition at line 33 of file EntitiesFieldData.cpp.

33 {
34 return N[base];
35}

◆ getNSharedPtr() [2/2]

boost::shared_ptr< MatrixDouble > & MoFEM::EntitiesFieldData::EntData::getNSharedPtr ( const FieldApproximationBase  base,
const BaseDerivatives  derivative 
)
virtual

Get shared pointer to base functions with derivatives.

Parameters
baseApproximation base type
derivativeDerivative order (ZeroDerivative, FirstDerivative, etc.)
Returns
boost::shared_ptr<MatrixDouble>& Shared pointer to base function matrix

Reimplemented in MoFEM::DerivedEntitiesFieldData::DerivedEntData.

Definition at line 27 of file EntitiesFieldData.cpp.

28 {
29 return baseFunctionsAndBaseDerivatives[direvatie][base];
30}

◆ getOrder() [1/2]

ApproximationOrder & MoFEM::EntitiesFieldData::EntData::getOrder ( )
inline

Get reference to approximation order for modification.

Returns
ApproximationOrder& Reference to approximation order

Definition at line 1414 of file EntitiesFieldData.hpp.

1414{ return oRder; }

◆ getOrder() [2/2]

ApproximationOrder MoFEM::EntitiesFieldData::EntData::getOrder ( ) const
inline

Get approximation order.

Returns
ApproximationOrder Approximation order for this entity

Definition at line 1378 of file EntitiesFieldData.hpp.

1378 {
1379 return oRder;
1380}

◆ getSense() [1/2]

int & MoFEM::EntitiesFieldData::EntData::getSense ( )
inline

Get reference to entity sense for modification.

Returns
int& Reference to entity sense

Definition at line 1412 of file EntitiesFieldData.hpp.

1412{ return sEnse; }

◆ getSense() [2/2]

int MoFEM::EntitiesFieldData::EntData::getSense ( ) const
virtual

Get entity sense for conforming approximation fields.

Entity sense is needed to calculate base functions with conforming approximation fields.

Returns
int Entity sense (orientation)

Reimplemented in MoFEM::DerivedEntitiesFieldData::DerivedEntData.

Definition at line 24 of file EntitiesFieldData.cpp.

24{ return sEnse; }

◆ getSpace()

FieldSpace & MoFEM::EntitiesFieldData::EntData::getSpace ( )
inline

◆ getVectorDiffN() [1/4]

template<int DIM0, int DIM1>
const MatrixAdaptor MoFEM::EntitiesFieldData::EntData::getVectorDiffN ( const FieldApproximationBase  base,
const int  dof,
const int  gg 
)
inline

get DiffHdiv of base functions at Gauss pts

Parameters
baseApproximation base
ggnb. of Gauss point
numberof of base functions

Definition at line 1677 of file EntitiesFieldData.hpp.

1678 {
1679 double *data =
1680 &EntitiesFieldData::EntData::getDiffN(base)(gg, DIM0 * DIM1 * dof);
1681 return MatrixAdaptor(DIM0, DIM1,
1682 ublas::shallow_array_adaptor<double>(DIM0 * DIM1, data));
1683}
constexpr int DIM1
Definition level_set.cpp:21

◆ getVectorDiffN() [2/4]

template<int DIM0, int DIM1>
const MatrixAdaptor MoFEM::EntitiesFieldData::EntData::getVectorDiffN ( const int  dof,
const int  gg 
)
inline

get DiffHdiv of base functions at Gauss pts

Parameters
ggnb. of Gauss point
numberof of base functions

Definition at line 1686 of file EntitiesFieldData.hpp.

1687 {
1688 return getVectorDiffN<DIM0, DIM1>(bAse, dof, gg);
1689}

◆ getVectorDiffN() [3/4]

template<int DIM0, int DIM1>
const MatrixAdaptor MoFEM::EntitiesFieldData::EntData::getVectorDiffN ( const int  gg)
inline

get DiffHdiv of base functions at Gauss pts

Parameters
ggnb. of Gauss point
numberof of base functions

Definition at line 1671 of file EntitiesFieldData.hpp.

1671 {
1672 return getVectorDiffN<DIM0, DIM1>(bAse, gg);
1673}

◆ getVectorDiffN() [4/4]

template<int DIM0, int DIM1>
const MatrixAdaptor MoFEM::EntitiesFieldData::EntData::getVectorDiffN ( FieldApproximationBase  base,
const int  gg 
)
inline

get DiffHdiv of base functions at Gauss pts

Parameters
baseApproximation base
ggnb. of Gauss point
numberof of base functions

Definition at line 1657 of file EntitiesFieldData.hpp.

1658 {
1659 if (PetscUnlikely(getDiffN(base).size2() % (DIM0 * DIM1))) {
1660 THROW_MESSAGE("Wrong dimension");
1661 }
1662
1663 const int nb_base_functions = getN(base).size2() / (DIM0 * DIM1);
1664 double *data = &getN(base)(gg, 0);
1665 return MatrixAdaptor(nb_base_functions, DIM0 * DIM1,
1666 ublas::shallow_array_adaptor<double>(
1667 DIM0 * DIM1 * nb_base_functions, data));
1668}

◆ getVectorN() [1/2]

template<int DIM>
const MatrixAdaptor MoFEM::EntitiesFieldData::EntData::getVectorN ( const FieldApproximationBase  base,
const int  gg 
)
inline

get Hdiv of base functions at Gauss pts

Parameters
baseApproximation base
ggnb. of Gauss point
Examples
mofem/atom_tests/hdiv_divergence_operator.cpp.

Definition at line 1637 of file EntitiesFieldData.hpp.

1638 {
1639 if (PetscUnlikely(getN(base).size2() % DIM)) {
1640 THROW_MESSAGE("Wrong dimension");
1641 }
1642
1643 const int nb_base_functions = getN(base).size2() / DIM;
1644 double *data = &getN(base)(gg, 0);
1645 return MatrixAdaptor(
1646 nb_base_functions, DIM,
1647 ublas::shallow_array_adaptor<double>(DIM * nb_base_functions, data));
1648}

◆ getVectorN() [2/2]

template<int DIM>
const MatrixAdaptor MoFEM::EntitiesFieldData::EntData::getVectorN ( const int  gg)
inline

get Hdiv of base functions at Gauss pts

Parameters
ggnb. of Gauss point
numberof of base functions

Definition at line 1651 of file EntitiesFieldData.hpp.

1651 {
1652 return getVectorN<DIM>(bAse, gg);
1653}

◆ resetFieldDependentData()

MoFEMErrorCode MoFEM::EntitiesFieldData::EntData::resetFieldDependentData ( )
inline

Reset data associated with particular field name

Returns
error code

Definition at line 115 of file EntitiesFieldData.cpp.

115 {
117 sPace = NOSPACE;
118 bAse = NOBASE;
119 fieldEntities.resize(0, false);
120 iNdices.resize(0, false);
121 localIndices.resize(0, false);
122 dOfs.resize(0, false);
123 fieldData.resize(0, false);
125}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ NOSPACE
Definition definitions.h:83
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...

Friends And Related Symbol Documentation

◆ OpAddParentEntData

friend struct OpAddParentEntData
friend

Definition at line 1289 of file EntitiesFieldData.hpp.

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const EntitiesFieldData::EntData e 
)
friend

Definition at line 240 of file EntitiesFieldData.cpp.

241 {
242 os << "sEnse: " << e.getSense() << std::endl
243 << "oRder: " << e.getOrder() << std::endl
244 << "global indices: " << e.getIndices() << std::endl
245 << "local indices: " << e.getLocalIndices() << std::endl;
246 // FIXME: precision should not be set here
247 os << "fieldData: " << std::fixed << std::setprecision(2) << e.getFieldData()
248 << std::endl;
249 MatrixDouble base = const_cast<EntitiesFieldData::EntData &>(e).getN();
250 MatrixDouble diff_base =
251 const_cast<EntitiesFieldData::EntData &>(e).getDiffN();
252 const double eps = 1e-6;
253 for (unsigned int ii = 0; ii != base.size1(); ii++) {
254 for (unsigned int jj = 0; jj != base.size2(); jj++) {
255 if (fabs(base(ii, jj)) < eps)
256 base(ii, jj) = 0;
257 }
258 }
259 for (unsigned int ii = 0; ii != diff_base.size1(); ii++) {
260 for (unsigned int jj = 0; jj != diff_base.size2(); jj++) {
261 if (fabs(diff_base(ii, jj)) < eps)
262 diff_base(ii, jj) = 0;
263 }
264 }
265 os << "N: " << std::fixed << base << std::endl
266 << "diffN: " << std::fixed << diff_base;
267 return os;
268}
static const double eps

◆ OpGetBrokenBaseSideData

template<typename OpBase >
friend struct OpGetBrokenBaseSideData
friend

Definition at line 1291 of file EntitiesFieldData.hpp.

Member Data Documentation

◆ bAse

FieldApproximationBase MoFEM::EntitiesFieldData::EntData::bAse
protected

Field approximation base.

Definition at line 1240 of file EntitiesFieldData.hpp.

◆ baseFunctionsAndBaseDerivatives

std::array<std::array<boost::shared_ptr<MatrixDouble>, LASTBASE>, LastDerivative> MoFEM::EntitiesFieldData::EntData::baseFunctionsAndBaseDerivatives
protected

Definition at line 1254 of file EntitiesFieldData.hpp.

◆ bbAlphaIndices

std::map<std::string, boost::shared_ptr<MatrixInt> > MoFEM::EntitiesFieldData::EntData::bbAlphaIndices
protected

Indices for Bernstein-Bezier (BB) base.

Definition at line 1265 of file EntitiesFieldData.hpp.

◆ bbAlphaIndicesByOrder

std::array<boost::shared_ptr<MatrixInt>, MaxBernsteinBezierOrder> MoFEM::EntitiesFieldData::EntData::bbAlphaIndicesByOrder
protected

BB alpha indices by order.

Definition at line 1272 of file EntitiesFieldData.hpp.

◆ bbDiffN

std::map<std::string, boost::shared_ptr<MatrixDouble> > MoFEM::EntitiesFieldData::EntData::bbDiffN
protected

Definition at line 1263 of file EntitiesFieldData.hpp.

◆ bbDiffNByOrder

std::array<boost::shared_ptr<MatrixDouble>, MaxBernsteinBezierOrder> MoFEM::EntitiesFieldData::EntData::bbDiffNByOrder
protected

BB base functions derivatives by order.

Definition at line 1270 of file EntitiesFieldData.hpp.

◆ bbFieldName

std::string MoFEM::EntitiesFieldData::EntData::bbFieldName
protected

field name

Definition at line 1260 of file EntitiesFieldData.hpp.

◆ bbN

std::map<std::string, boost::shared_ptr<MatrixDouble> > MoFEM::EntitiesFieldData::EntData::bbN
protected

Definition at line 1262 of file EntitiesFieldData.hpp.

◆ bbNByOrder

std::array<boost::shared_ptr<MatrixDouble>, MaxBernsteinBezierOrder> MoFEM::EntitiesFieldData::EntData::bbNByOrder
protected

BB base functions by order.

Definition at line 1268 of file EntitiesFieldData.hpp.

◆ bbNodeOrder

VectorInt MoFEM::EntitiesFieldData::EntData::bbNodeOrder
protected

order of nodes

Definition at line 1261 of file EntitiesFieldData.hpp.

◆ diffN

std::array<boost::shared_ptr<MatrixDouble>, LASTBASE>& MoFEM::EntitiesFieldData::EntData::diffN
protected

Derivatives of base functions.

Definition at line 1258 of file EntitiesFieldData.hpp.

◆ dofBrokenSideVec

std::vector<int> MoFEM::EntitiesFieldData::EntData::dofBrokenSideVec
protected

Map side to dofs number.

Definition at line 1248 of file EntitiesFieldData.hpp.

◆ dofBrokenTypeVec

std::vector<EntityType> MoFEM::EntitiesFieldData::EntData::dofBrokenTypeVec
protected

Map type of entity to dof number.

Definition at line 1250 of file EntitiesFieldData.hpp.

◆ dOfs

VectorDofs MoFEM::EntitiesFieldData::EntData::dOfs
protected

DoFs on entity.

Definition at line 1243 of file EntitiesFieldData.hpp.

◆ entDataBitRefLevel

std::vector<BitRefLevel> MoFEM::EntitiesFieldData::EntData::entDataBitRefLevel
protected

Bit ref level in entity.

Definition at line 1246 of file EntitiesFieldData.hpp.

◆ fieldData

VectorDouble MoFEM::EntitiesFieldData::EntData::fieldData
protected

Field data on entity.

Definition at line 1245 of file EntitiesFieldData.hpp.

◆ fieldEntities

VectorFieldEntities MoFEM::EntitiesFieldData::EntData::fieldEntities
protected

Field entities.

Definition at line 1244 of file EntitiesFieldData.hpp.

◆ iNdices

VectorInt MoFEM::EntitiesFieldData::EntData::iNdices
protected

Global indices on entity.

Definition at line 1241 of file EntitiesFieldData.hpp.

◆ localIndices

VectorInt MoFEM::EntitiesFieldData::EntData::localIndices
protected

Local indices on entity.

Definition at line 1242 of file EntitiesFieldData.hpp.

◆ MaxBernsteinBezierOrder

constexpr size_t MoFEM::EntitiesFieldData::EntData::MaxBernsteinBezierOrder = BITFEID_SIZE
staticconstexpr

Definition at line 1205 of file EntitiesFieldData.hpp.

◆ N

std::array<boost::shared_ptr<MatrixDouble>, LASTBASE>& MoFEM::EntitiesFieldData::EntData::N
protected

Base functions.

Definition at line 1256 of file EntitiesFieldData.hpp.

◆ oRder

ApproximationOrder MoFEM::EntitiesFieldData::EntData::oRder
protected

Entity order.

Definition at line 1238 of file EntitiesFieldData.hpp.

◆ sEnse

int MoFEM::EntitiesFieldData::EntData::sEnse
protected

Entity sense (orientation)

Definition at line 1237 of file EntitiesFieldData.hpp.

◆ sPace

FieldSpace MoFEM::EntitiesFieldData::EntData::sPace
protected

Entity space.

Definition at line 1239 of file EntitiesFieldData.hpp.

◆ swapBaseDiffNPtr

boost::shared_ptr<MatrixDouble> MoFEM::EntitiesFieldData::EntData::swapBaseDiffNPtr
protected

Used by Bernstein base to keep temporary pointer.

Swap approximation base.

Bernstein-Bezier (BB) base is not hierarchical, and is calculated for particular field, since it all shape functions change with the order. BB base is precalculated for every field, and when user push operator with particular field using BB base, pointers to shape functions and BaseDerivatives of shape functions are set to particular location, once operator is executed, pointers are switch back to its original position.

getNSharedPtr(base) <=== getBBNSharedPtr(field_name); // DO OPERATOR WORK getNSharedPtr(base) ==> getBBNSharedPtr(field_name);

Parameters
field_nameName of the field for which to swap base
baseApproximation base type to swap
Returns
MoFEMErrorCode Error code (0 on success)

Definition at line 1287 of file EntitiesFieldData.hpp.

◆ swapBaseNPtr

boost::shared_ptr<MatrixDouble> MoFEM::EntitiesFieldData::EntData::swapBaseNPtr
protected

Used by Bernstein base to keep temporary pointer.

Swap approximation base.

Bernstein-Bezier (BB) base is not hierarchical, and is calculated for particular field, since it all shape functions change with the order. BB base is precalculated for every field, and when user push operator with particular field using BB base, pointers to shape functions and BaseDerivatives of shape functions are set to particular location, once operator is executed, pointers are switch back to its original position.

getNSharedPtr(base) <=== getBBNSharedPtr(field_name); // DO OPERATOR WORK getNSharedPtr(base) ==> getBBNSharedPtr(field_name);

Parameters
field_nameName of the field for which to swap base
baseApproximation base type to swap
Returns
MoFEMErrorCode Error code (0 on success)

Definition at line 1280 of file EntitiesFieldData.hpp.


The documentation for this struct was generated from the following files: