v0.10.0
Protected Attributes | List of all members
MoFEM::DataForcesAndSourcesCore::EntData Struct Reference

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

#include <src/finite_elements/DataStructures.hpp>

Inheritance diagram for MoFEM::DataForcesAndSourcesCore::EntData:
[legend]

Protected Attributes

int sEnse
 Entity sense (orientation) More...
 
ApproximationOrder oRder
 Entity order. More...
 
FieldSpace sPace
 Entity space. More...
 
FieldApproximationBase bAse
 Field approximation base. More...
 
VectorInt iNdices
 Global indices on entity. More...
 
VectorInt localIndices
 Local indices on entity. More...
 
VectorDofs dOfs
 DoFs on entity. More...
 
VectorFieldEntities fieldEntities
 Field entities. More...
 
VectorDouble fieldData
 Field data on entity. More...
 
std::array< boost::shared_ptr< MatrixDouble >, LASTBASEN
 Base functions. More...
 
std::array< boost::shared_ptr< MatrixDouble >, LASTBASEdiffN
 Derivatives of base functions. More...
 
std::string bbFieldName
 field name More...
 
VectorInt bbNodeOrder
 order of nodes More...
 
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 > > bbAlphaInduces
 Indices for Bernstein-Bezier base. More...
 
std::array< boost::shared_ptr< MatrixDouble >, MaxBernsteinBezierOrderbbNByOrder
 
std::array< boost::shared_ptr< MatrixDouble >, MaxBernsteinBezierOrderbbDiffNByOrder
 
std::array< boost::shared_ptr< MatrixInt >, MaxBernsteinBezierOrderbbAlphaInducesByOrder
 
boost::shared_ptr< MatrixDoubleswapBaseNPtr
 
boost::shared_ptr< MatrixDoubleswapBaseDiffNPtr
 

Specializations for tensor base function

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

Specializations for direcatives of base functions

template<>
FTensor::Tensor1< double *, 3 > getFTensor1DiffN (const FieldApproximationBase base)
 
template<>
FTensor::Tensor1< double *, 3 > getFTensor1DiffN ()
 
template<>
FTensor::Tensor1< double *, 2 > getFTensor1DiffN (const FieldApproximationBase base)
 
template<>
FTensor::Tensor1< double *, 2 > getFTensor1DiffN ()
 
template<>
FTensor::Tensor1< double *, 3 > getFTensor1DiffN (const FieldApproximationBase base, const int bb)
 
template<>
FTensor::Tensor1< double *, 3 > getFTensor1DiffN (const int bb)
 
template<>
FTensor::Tensor1< double *, 2 > getFTensor1DiffN (const FieldApproximationBase base, const int bb)
 
template<>
FTensor::Tensor1< double *, 2 > getFTensor1DiffN (const int bb)
 
template<>
FTensor::Tensor2< FTensor::PackPtr< double *, 6 >, 3, 2 > getFTensor2DiffN (FieldApproximationBase base)
 
template<>
FTensor::Tensor2< FTensor::PackPtr< double *, 6 >, 3, 2 > getFTensor2DiffN (FieldApproximationBase base, const int gg, const int bb)
 

Specializations for field data

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

Constructor and destructor

 EntData (const bool allocate_base_matrices=true)
 
virtual ~EntData ()=default
 

Sense, order and indices

virtual int getSense () const
 get entity sense, need to calculate base functions with conforming approximation fields More...
 
ApproximationOrder getOrder () const
 get approximation order More...
 
const VectorIntgetIndices () const
 Get global indices of dofs on entity. More...
 
const VectorIntAdaptor getIndicesUpToOrder (int order)
 get global indices of dofs on entity up to given order More...
 
const VectorIntgetLocalIndices () const
 get local indices of dofs on entity More...
 
const VectorIntAdaptor getLocalIndicesUpToOrder (int order)
 get local indices of dofs on entity up to given order More...
 
int & getSense ()
 
ApproximationOrdergetDataOrder ()
 
VectorIntgetIndices ()
 
VectorIntgetLocalIndices ()
 

Data on entity

const VectorDoublegetFieldData () const
 get dofs values More...
 
const VectorAdaptor getFieldDataUpToOrder (int order)
 get dofs values up to given order More...
 
const VectorDofsgetFieldDofs () const
 get dofs data stature FEDofEntity More...
 
VectorDoublegetFieldData ()
 get dofs data stature FEDofEntity More...
 
const VectorFieldEntitiesgetFieldEntities () const
 get field entities More...
 
VectorFieldEntitiesgetFieldEntities ()
 get field entities More...
 
template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1FieldData ()
 Return FTensor of rank 1, i.e. vector from filed data coeffinects. More...
 
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 filed data coeffinects. More...
 
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 filed data coeffinects. More...
 
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0FieldData ()
 Resturn scalar files as a FTensor of rank 0. More...
 
VectorDofsgetFieldDofs ()
 

Base and space

FieldApproximationBasegetBase ()
 Get approximation base. More...
 
FieldSpacegetSpace ()
 Get field space. More...
 
virtual boost::shared_ptr< MatrixDouble > & getNSharedPtr (const FieldApproximationBase base)
 
virtual const boost::shared_ptr< MatrixDouble > & getNSharedPtr (const FieldApproximationBase base) const
 
virtual boost::shared_ptr< MatrixDouble > & getDiffNSharedPtr (const FieldApproximationBase base)
 
virtual const boost::shared_ptr< MatrixDouble > & getDiffNSharedPtr (const FieldApproximationBase base) const
 

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. More...
 
MatrixDoublegetN (const std::string &field_name)
 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. More...
 
MatrixDoublegetN ()
 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. More...
 
MatrixDoublegetDiffN (const FieldApproximationBase base)
 get derivatives of base functions More...
 
MatrixDoublegetDiffN (const std::string &field_name)
 get derivatives of base functions More...
 
MatrixDoublegetDiffN ()
 get derivatives of base functions More...
 
const VectorAdaptor getN (const FieldApproximationBase base, const int gg)
 get base functions at Gauss pts More...
 
const VectorAdaptor getN (const int gg)
 get base functions at Gauss pts More...
 
const MatrixAdaptor getDiffN (const FieldApproximationBase base, const int gg)
 get derivative of base functions at Gauss pts More...
 
const MatrixAdaptor getDiffN (const int gg)
 get derivative of base functions at Gauss pts More...
 
const VectorAdaptor getN (const FieldApproximationBase base, const int gg, const int nb_base_functions)
 get base functions at Gauss pts More...
 
const VectorAdaptor getN (const int gg, const int nb_base_functions)
 get base functions at Gauss pts More...
 
const MatrixAdaptor getDiffN (const FieldApproximationBase base, const int gg, const int nb_base_functions)
 get derivatives of base functions at Gauss pts More...
 
const MatrixAdaptor getDiffN (const int gg, const int nb_base_functions)
 get derivatives of base functions at Gauss pts More...
 

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

Hdiv/Hcurl

template<int DIM>
const MatrixAdaptor getVectorN (const FieldApproximationBase base, const int gg)
 get Hdiv of base functions at Gauss pts More...
 
template<int DIM>
const MatrixAdaptor getVectorN (const int gg)
 get Hdiv of base functions at Gauss pts More...
 
template<int DIM0, int DIM1>
const MatrixAdaptor getVectorDiffN (FieldApproximationBase base, const int gg)
 get DiffHdiv of base functions at Gauss pts More...
 
template<int DIM0, int DIM1>
const MatrixAdaptor getVectorDiffN (const int gg)
 get DiffHdiv of base functions at Gauss pts More...
 
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 More...
 
template<int DIM0, int DIM1>
const MatrixAdaptor getVectorDiffN (const int dof, const int gg)
 get DiffHdiv of base functions at Gauss pts More...
 

Get base functions with FTensor

FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N (const FieldApproximationBase base)
 Get base function as Tensor0. More...
 
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N ()
 Get base function as Tensor0. More...
 
FTensor::Tensor0< double * > getFTensor0N (const FieldApproximationBase base, const int bb)
 Get base function as Tensor0 (Loop by integration points) More...
 
FTensor::Tensor0< double * > getFTensor0N (const int bb)
 Get base function as Tensor0 (Loop by integration points) More...
 
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) More...
 
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N (const int gg, const int bb)
 Get base function as Tensor0 (Loop by integration points) More...
 
template<int Tensor_Dim>
FTensor::Tensor1< double *, Tensor_Dim > getFTensor1DiffN (const FieldApproximationBase base)
 Get derivatives of base functions. More...
 
template<int Tensor_Dim>
FTensor::Tensor1< double *, Tensor_Dim > getFTensor1DiffN ()
 Get derivatives of base functions. More...
 
template<int Tensor_Dim>
FTensor::Tensor1< double *, Tensor_Dim > getFTensor1DiffN (const FieldApproximationBase base, const int bb)
 Get derivatives of base functions (Loop by integration points) More...
 
template<int Tensor_Dim>
FTensor::Tensor1< double *, Tensor_Dim > getFTensor1DiffN (const int bb)
 Get derivatives of base functions (Loop by integration points) More...
 
template<int Tensor_Dim>
FTensor::Tensor1< double *, Tensor_Dim > getFTensor1DiffN (const FieldApproximationBase base, const int gg, const int bb)
 Get derivatives of base functions (Loop by integration points) More...
 
template<int Tensor_Dim>
FTensor::Tensor1< double *, Tensor_Dim > getFTensor1DiffN (const int gg, const int bb)
 Get derivatives of base functions (Loop by integration points) More...
 
template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1N (FieldApproximationBase base)
 Get base functions for Hdiv/Hcurl spaces. More...
 
template<int Tensor_Dim>
auto getFTensor1N ()
 Get base functions for Hdiv space. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
template<int Tensor_Dim>
auto getFTensor1N (const int gg, const int bb)
 Get Hdiv base functions at integration point. More...
 
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. More...
 
template<int Tensor_Dim0, int Tensor_Dim1>
auto getFTensor2N ()
 Get base functions for Hdiv space. More...
 
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. More...
 
template<int Tensor_Dim0, int Tensor_Dim1>
auto getFTensor2N (const int gg, const int bb)
 Get base functions for Hdiv space. More...
 

Auxiliary functions

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

Bernstein-Bezier base only functions

static constexpr size_t MaxBernsteinBezierOrder = BITFEID_SIZE
 
VectorIntgetBBNodeOrder ()
 Get orders at the nodes. More...
 
MatrixIntgetBBAlphaIndices ()
 Get file BB indices. More...
 
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 ()
 
virtual std::map< std::string, boost::shared_ptr< MatrixDouble > > & getBBDiffNMap ()
 
virtual boost::shared_ptr< MatrixInt > & getBBAlphaIndicesByOrderSharedPtr (const size_t o)
 
virtual boost::shared_ptr< MatrixDouble > & getBBNByOrderSharedPtr (const size_t o)
 
virtual const boost::shared_ptr< MatrixDouble > & getBBNByOrderSharedPtr (const size_t o) const
 
virtual boost::shared_ptr< MatrixDouble > & getBBDiffNByOrderSharedPtr (const size_t o)
 
virtual const boost::shared_ptr< MatrixDouble > & getBBDiffNByOrderSharedPtr (const size_t o) const
 
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)
 

Specializations for H1/L2

template<>
FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > getFTensor1FieldData ()
 
template<>
FTensor::Tensor1< FTensor::PackPtr< double *, 2 >, 2 > getFTensor1FieldData ()
 
template<>
FTensor::Tensor2< FTensor::PackPtr< double *, 9 >, 3, 3 > getFTensor2FieldData ()
 
template<>
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *, 6 >, 3 > getFTensor2SymmetricFieldData ()
 
template<>
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *, 3 >, 2 > getFTensor2SymmetricFieldData ()
 
template<>
FTensor::Tensor1< double *, 3 > getFTensor1DiffN (const FieldApproximationBase base)
 Get spatial derivative of base function tensor for dimension 3d. More...
 
template<>
FTensor::Tensor1< double *, 3 > getFTensor1DiffN ()
 Get spatial derivative of base function tensor for dimension 3d. More...
 
template<>
FTensor::Tensor1< double *, 3 > getFTensor1DiffN (const FieldApproximationBase base, const int bb)
 Get spatial derivative of base function tensor for dimension 3d. More...
 
template<>
FTensor::Tensor1< double *, 3 > getFTensor1DiffN (const int bb)
 Get spatial derivative of base function tensor for dimension 3d. More...
 
template<>
FTensor::Tensor1< double *, 2 > getFTensor1DiffN (const FieldApproximationBase base)
 Get spatial derivative of base function tensor for dimension 2d. More...
 
template<>
FTensor::Tensor1< double *, 2 > getFTensor1DiffN ()
 Get spatial derivative of base function tensor for dimension 2d. More...
 
template<>
FTensor::Tensor1< double *, 2 > getFTensor1DiffN (const FieldApproximationBase base, const int bb)
 Get spatial derivative of base function tensor for dimension 3d. More...
 
template<>
FTensor::Tensor1< double *, 2 > getFTensor1DiffN (const int bb)
 Get spatial derivative of base function tensor for dimension 3d. More...
 
template<>
FTensor::Tensor1< double *, 3 > getFTensor1DiffN (const FieldApproximationBase base, const int gg, const int bb)
 Get spatial derivative of base function tensor for dimension 3d. More...
 
template<>
FTensor::Tensor1< double *, 3 > getFTensor1DiffN (const int gg, const int bb)
 Get spatial derivative of base function tensor for dimension 3d. More...
 
template<>
FTensor::Tensor1< double *, 2 > getFTensor1DiffN (const FieldApproximationBase base, const int gg, const int bb)
 Get spatial derivative of base function tensor for dimension 2d. More...
 
template<>
FTensor::Tensor1< double *, 2 > getFTensor1DiffN (const int gg, const int bb)
 Get spatial derivative of base function tensor for dimension 2d. More...
 

Specializations for HDiv/HCrul

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 > getFTensor2DiffN (FieldApproximationBase base)
 
template<>
FTensor::Tensor2< FTensor::PackPtr< double *, 9 >, 3, 3 > getFTensor2DiffN (FieldApproximationBase base, const int gg, const int bb)
 
template<>
FTensor::Tensor2< FTensor::PackPtr< double *, 6 >, 3, 2 > getFTensor2DiffN (FieldApproximationBase base)
 
template<>
FTensor::Tensor2< FTensor::PackPtr< double *, 6 >, 3, 2 > getFTensor2DiffN (FieldApproximationBase base, const int gg, const int bb)
 
template<>
FTensor::Tensor2< FTensor::PackPtr< double *, 9 >, 3, 3 > getFTensor2N (FieldApproximationBase base)
 
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
boundary_marker.cpp, build_large_problem.cpp, continuity_check_on_contact_prism_side_ele.cpp, continuity_check_on_skeleton_3d.cpp, continuity_check_on_skeleton_with_simple_2d.cpp, EshelbianOperators.cpp, EshelbianPlasticity.cpp, field_evaluator.cpp, forces_and_sources_testing_edge_element.cpp, forces_and_sources_testing_flat_prism_element.cpp, forces_and_sources_testing_users_base.cpp, hcurl_check_approx_in_2d.cpp, hcurl_curl_operator.cpp, hcurl_divergence_operator_2d.cpp, hdiv_divergence_operator.cpp, heat_equation.hpp, hello_world.cpp, HookeElement.cpp, HookeElement.hpp, lesson3_poisson.cpp, lesson6_radiation.cpp, lesson7_plastic.cpp, lesson8_contact.cpp, lorentz_force.cpp, mesh_smoothing.cpp, OpPostProcElastic.hpp, prism_elements_from_surface.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion.cpp, Remodeling.cpp, scalar_check_approximation_2d.cpp, simple_elasticity.cpp, simple_interface.cpp, test_cache_on_entities.cpp, and wave_equation.hpp.

Definition at line 60 of file DataStructures.hpp.

Constructor & Destructor Documentation

◆ EntData()

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

Definition at line 22 of file DataStructures.cpp.

23  : sEnse(0), oRder(0), bAse(NOBASE) {
24  if (allocate_base_matrices)
25  for (int b = 0; b != LASTBASE; ++b) {
26  N[b].reset(new MatrixDouble());
27  diffN[b].reset(new MatrixDouble());
28  }
29 }
ApproximationOrder oRder
Entity order.
std::array< boost::shared_ptr< MatrixDouble >, LASTBASE > N
Base functions.
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:76
FieldApproximationBase bAse
Field approximation base.
int sEnse
Entity sense (orientation)
std::array< boost::shared_ptr< MatrixDouble >, LASTBASE > diffN
Derivatives of base functions.

◆ ~EntData()

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

Member Function Documentation

◆ baseSwap()

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

Reimplemented in MoFEM::DerivedDataForcesAndSourcesCore::DerivedEntData.

Definition at line 180 of file DataStructures.cpp.

181  {
183  auto make_swap = [](boost::shared_ptr<MatrixDouble> &ptr,
184  boost::shared_ptr<MatrixDouble> &ptrBB,
185  boost::shared_ptr<MatrixDouble> &swap_ptr) {
186  if (swap_ptr) {
187  ptr = swap_ptr;
188  swap_ptr.reset();
189  } else {
190  swap_ptr = ptr;
191  ptr = ptrBB;
192  }
193  };
194  make_swap(getNSharedPtr(base), getBBNSharedPtr(field_name), swapBaseNPtr);
195  make_swap(getDiffNSharedPtr(base), getBBDiffNSharedPtr(field_name),
198 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
virtual boost::shared_ptr< MatrixDouble > & getBBNSharedPtr(const std::string &field_name)
virtual boost::shared_ptr< MatrixDouble > & getBBDiffNSharedPtr(const std::string &field_name)
virtual boost::shared_ptr< MatrixDouble > & getDiffNSharedPtr(const FieldApproximationBase base)
boost::shared_ptr< MatrixDouble > swapBaseNPtr
virtual boost::shared_ptr< MatrixDouble > & getNSharedPtr(const FieldApproximationBase base)
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
boost::shared_ptr< MatrixDouble > swapBaseDiffNPtr

◆ getBase()

FieldApproximationBase & MoFEM::DataForcesAndSourcesCore::EntData::getBase ( )

Get approximation base.

Returns
Approximation base

Definition at line 1281 of file DataStructures.hpp.

1281  {
1282  return bAse;
1283 }
FieldApproximationBase bAse
Field approximation base.

◆ getBBAlphaIndices()

MatrixInt & MoFEM::DataForcesAndSourcesCore::EntData::getBBAlphaIndices ( )

Get file BB indices.

Returns
MatrixInt&

Definition at line 1523 of file DataStructures.hpp.

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

◆ getBBAlphaIndicesByOrderArray()

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

Definition at line 837 of file DataStructures.cpp.

837  {
838  return bbAlphaInducesByOrder;
839 }
std::array< boost::shared_ptr< MatrixInt >, MaxBernsteinBezierOrder > bbAlphaInducesByOrder

◆ getBBAlphaIndicesByOrderSharedPtr()

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

Definition at line 809 of file DataStructures.cpp.

810  {
811  return bbAlphaInducesByOrder[o];
812 }
std::array< boost::shared_ptr< MatrixInt >, MaxBernsteinBezierOrder > bbAlphaInducesByOrder
static Index< 'o', 3 > o

◆ getBBAlphaIndicesMap()

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

Definition at line 794 of file DataStructures.cpp.

794  {
795  return bbAlphaInduces;
796 }
std::map< std::string, boost::shared_ptr< MatrixInt > > bbAlphaInduces
Indices for Bernstein-Bezier base.

◆ getBBAlphaIndicesSharedPtr()

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

Reimplemented in MoFEM::DerivedDataForcesAndSourcesCore::DerivedEntData.

Definition at line 755 of file DataStructures.cpp.

756  {
757  return bbAlphaInduces[field_name];
758 }
std::map< std::string, boost::shared_ptr< MatrixInt > > bbAlphaInduces
Indices for Bernstein-Bezier base.

◆ getBBDiffNByOrderArray()

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

Definition at line 849 of file DataStructures.cpp.

849  {
850  return bbDiffNByOrder;
851 }
std::array< boost::shared_ptr< MatrixDouble >, MaxBernsteinBezierOrder > bbDiffNByOrder

◆ getBBDiffNByOrderSharedPtr() [1/2]

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

Definition at line 825 of file DataStructures.cpp.

825  {
826  return bbDiffNByOrder[o];
827 }
std::array< boost::shared_ptr< MatrixDouble >, MaxBernsteinBezierOrder > bbDiffNByOrder
static Index< 'o', 3 > o

◆ getBBDiffNByOrderSharedPtr() [2/2]

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

Definition at line 830 of file DataStructures.cpp.

831  {
832  return bbDiffNByOrder[o];
833 }
std::array< boost::shared_ptr< MatrixDouble >, MaxBernsteinBezierOrder > bbDiffNByOrder
static Index< 'o', 3 > o

◆ getBBDiffNMap()

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

Definition at line 804 of file DataStructures.cpp.

804  {
805  return bbDiffN;
806 }
std::map< std::string, boost::shared_ptr< MatrixDouble > > bbDiffN

◆ getBBDiffNSharedPtr() [1/2]

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

Get shared pointer to BB derivatives of base base functions

Reimplemented in MoFEM::DerivedDataForcesAndSourcesCore::DerivedEntData.

Definition at line 779 of file DataStructures.cpp.

780  {
781  return bbDiffN[field_name];
782 }
std::map< std::string, boost::shared_ptr< MatrixDouble > > bbDiffN

◆ getBBDiffNSharedPtr() [2/2]

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

Get shared pointer to derivatives of BB base base functions

Reimplemented in MoFEM::DerivedDataForcesAndSourcesCore::DerivedEntData.

Definition at line 788 of file DataStructures.cpp.

789  {
790  return bbDiffN.at(field_name);
791 }
std::map< std::string, boost::shared_ptr< MatrixDouble > > bbDiffN

◆ getBBNByOrderArray()

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

Definition at line 843 of file DataStructures.cpp.

843  {
844  return bbNByOrder;
845 }
std::array< boost::shared_ptr< MatrixDouble >, MaxBernsteinBezierOrder > bbNByOrder

◆ getBBNByOrderSharedPtr() [1/2]

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

Definition at line 815 of file DataStructures.cpp.

815  {
816  return bbNByOrder[o];
817 }
std::array< boost::shared_ptr< MatrixDouble >, MaxBernsteinBezierOrder > bbNByOrder
static Index< 'o', 3 > o

◆ getBBNByOrderSharedPtr() [2/2]

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

Definition at line 820 of file DataStructures.cpp.

820  {
821  return bbNByOrder[o];
822 }
std::array< boost::shared_ptr< MatrixDouble >, MaxBernsteinBezierOrder > bbNByOrder
static Index< 'o', 3 > o

◆ getBBNMap()

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

Definition at line 799 of file DataStructures.cpp.

799  {
800  return bbN;
801 }
std::map< std::string, boost::shared_ptr< MatrixDouble > > bbN

◆ getBBNodeOrder()

VectorInt & MoFEM::DataForcesAndSourcesCore::EntData::getBBNodeOrder ( )

Get orders at the nodes.

Returns
VectorInt&

Definition at line 1519 of file DataStructures.hpp.

1519  {
1520  return bbNodeOrder;
1521 }

◆ getBBNSharedPtr() [1/2]

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

Get shared pointer to BB base base functions

Reimplemented in MoFEM::DerivedDataForcesAndSourcesCore::DerivedEntData.

Definition at line 761 of file DataStructures.cpp.

762  {
763  return bbN[field_name];
764 }
std::map< std::string, boost::shared_ptr< MatrixDouble > > bbN

◆ getBBNSharedPtr() [2/2]

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

Get shared pointer to BB base base functions

Reimplemented in MoFEM::DerivedDataForcesAndSourcesCore::DerivedEntData.

Definition at line 770 of file DataStructures.cpp.

771  {
772  return bbN.at(field_name);
773 }
std::map< std::string, boost::shared_ptr< MatrixDouble > > bbN

◆ getDataOrder()

ApproximationOrder & MoFEM::DataForcesAndSourcesCore::EntData::getDataOrder ( )

Definition at line 1210 of file DataStructures.hpp.

1210  {
1211  return oRder;
1212 }
ApproximationOrder oRder
Entity order.

◆ getDiffN() [1/7]

MatrixDouble & MoFEM::DataForcesAndSourcesCore::EntData::getDiffN ( const FieldApproximationBase  base)

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.

Tonsorial base functions:

Note
Note: In rows ale 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
hcurl_curl_operator.cpp, and hdiv_divergence_operator.cpp.

Definition at line 1300 of file DataStructures.hpp.

1300  {
1301  return *(getDiffNSharedPtr(base));
1302 }
virtual boost::shared_ptr< MatrixDouble > & getDiffNSharedPtr(const FieldApproximationBase base)

◆ getDiffN() [2/7]

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

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.

Tonsorial base functions:

Note
Note: In rows ale 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}\)

Definition at line 1305 of file DataStructures.hpp.

1305  {
1306  return *(getBBDiffNSharedPtr(field_name));
1307 }
virtual boost::shared_ptr< MatrixDouble > & getBBDiffNSharedPtr(const std::string &field_name)

◆ getDiffN() [3/7]

MatrixDouble & MoFEM::DataForcesAndSourcesCore::EntData::getDiffN ( )

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.

Tonsorial base functions:

Note
Note: In rows ale 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}\)

Definition at line 1309 of file DataStructures.hpp.

1309  {
1310  return getDiffN(bAse);
1311 }
MatrixDouble & getDiffN()
get derivatives of base functions
FieldApproximationBase bAse
Field approximation base.

◆ getDiffN() [4/7]

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

get derivative of base functions at Gauss pts

returned matrix on rows has base functions, in column its derivatives.

Parameters
baseApproximation base
ggNb. of Gauss pts.

Definition at line 1326 of file DataStructures.hpp.

1327  {
1328  // FIXME: That is bug, it will not work if number of integration pts is
1329  // equal to number of nodes on entity. User who not implementing low
1330  // level DataOperator will not experience this.
1331  if (getN(base).size1() == getDiffN(base).size1()) {
1332  int size = getN(base).size2();
1333  int dim = getDiffN(base).size2() / size;
1334  double *data = &getDiffN(base)(gg, 0);
1335  return MatrixAdaptor(
1336  getN(base).size2(), dim,
1337  ublas::shallow_array_adaptor<double>(getDiffN(base).size2(), data));
1338  } else {
1339  // in some cases, f.e. for derivatives of nodal base functions at only
1340  // one gauss point is needed
1341  return MatrixAdaptor(
1342  getN(base).size1(), getN(base).size2(),
1343  ublas::shallow_array_adaptor<double>(getDiffN(base).data().size(),
1344  &getDiffN(base).data()[0]));
1345  }
1346 }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const int dim
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition: Types.hpp:126
MatrixDouble & getDiffN()
get derivatives of base functions

◆ getDiffN() [5/7]

const MatrixAdaptor MoFEM::DataForcesAndSourcesCore::EntData::getDiffN ( const int  gg)

get derivative of base functions at Gauss pts

returned matrix on rows has base functions, in column its derivatives.

Parameters
ggnb. of Gauss pts.

Definition at line 1348 of file DataStructures.hpp.

1348  {
1349  return getDiffN(bAse, gg);
1350 }
MatrixDouble & getDiffN()
get derivatives of base functions
FieldApproximationBase bAse
Field approximation base.

◆ getDiffN() [6/7]

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

get derivatives of base functions at Gauss pts

Note that multi field element, two different field can have different approximation orders. Since we use hierarchical approximation basis, base functions are calculated once for element, using maximal approximation order on given entity.

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

Definition at line 1370 of file DataStructures.hpp.

1372  {
1373  // FIXME: That is bug, it will not work if number of integration pts is
1374  // equal to number of nodes on entity. User who not implementing low
1375  // level DataOperator will not experience this.
1376  if (getN(base).size1() == getDiffN(base).size1()) {
1377  (void)getN(base)(gg,
1378  nb_base_functions -
1379  1); // throw error if nb_base_functions is to big
1380  int dim = getDiffN(base).size2() / getN(base).size2();
1381  double *data = &getDiffN(base)(gg, 0);
1382  return MatrixAdaptor(
1383  nb_base_functions, dim,
1384  ublas::shallow_array_adaptor<double>(dim * nb_base_functions, data));
1385  } else {
1386  // in some cases, f.e. for derivatives of nodal base functions only one
1387  // gauss point is needed
1388  return MatrixAdaptor(
1389  getN(base).size1(), getN(base).size2(),
1390  ublas::shallow_array_adaptor<double>(getDiffN(base).data().size(),
1391  &getDiffN(base).data()[0]));
1392  }
1393 }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const int dim
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition: Types.hpp:126
MatrixDouble & getDiffN()
get derivatives of base functions

◆ getDiffN() [7/7]

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

get derivatives of base functions at Gauss pts

Note that multi field element, two different field can have different approximation orders. Since we use hierarchical approximation basis, base functions are calculated once for element, using maximal approximation order on given entity.

Parameters
ggnb. of Gauss point
nb_base_functionsnumber of of base functions

Definition at line 1396 of file DataStructures.hpp.

1397  {
1398  return getDiffN(bAse, gg, nb_base_functions);
1399 }
MatrixDouble & getDiffN()
get derivatives of base functions
FieldApproximationBase bAse
Field approximation base.

◆ getDiffNSharedPtr() [1/2]

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

Get shared pointer to derivatives of base base functions

Reimplemented in MoFEM::DerivedDataForcesAndSourcesCore::DerivedEntData.

Definition at line 46 of file DataStructures.cpp.

47  {
48  return diffN[base];
49 }
std::array< boost::shared_ptr< MatrixDouble >, LASTBASE > diffN
Derivatives of base functions.

◆ getDiffNSharedPtr() [2/2]

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

Get shared pointer to derivatives of base base functions

Reimplemented in MoFEM::DerivedDataForcesAndSourcesCore::DerivedEntData.

Definition at line 52 of file DataStructures.cpp.

53  {
54  return diffN[base];
55 }
std::array< boost::shared_ptr< MatrixDouble >, LASTBASE > diffN
Derivatives of base functions.

◆ getFieldData() [1/2]

const VectorDouble & MoFEM::DataForcesAndSourcesCore::EntData::getFieldData ( ) const

◆ getFieldData() [2/2]

VectorDouble & MoFEM::DataForcesAndSourcesCore::EntData::getFieldData ( )

get dofs data stature FEDofEntity

Definition at line 1241 of file DataStructures.hpp.

1241  {
1242  return fieldData;
1243 }
VectorDouble fieldData
Field data on entity.

◆ getFieldDataUpToOrder()

const VectorAdaptor MoFEM::DataForcesAndSourcesCore::EntData::getFieldDataUpToOrder ( int  order)

get dofs values up to given order

Definition at line 1225 of file DataStructures.hpp.

1225  {
1226  unsigned int size = 0;
1227  if (auto dof = dOfs[0]) {
1228  size = dof->getOrderNbDofs(order) * dof->getNbOfCoeffs();
1229  size = size < fieldData.size() ? size : fieldData.size();
1230  }
1231  double *data = &*fieldData.data().begin();
1232  return getVectorAdaptor(data, size);
1233 }
VectorDouble fieldData
Field data on entity.
constexpr int order
auto getVectorAdaptor(T1 ptr, const size_t n)
Get Vector adaptor.
Definition: Templates.hpp:44

◆ getFieldDofs() [1/2]

const VectorDofs & MoFEM::DataForcesAndSourcesCore::EntData::getFieldDofs ( ) const

get dofs data stature FEDofEntity

Examples
EshelbianOperators.cpp, HookeElement.cpp, and prism_elements_from_surface.cpp.

Definition at line 1235 of file DataStructures.hpp.

1235  {
1236  return dOfs;
1237 }

◆ getFieldDofs() [2/2]

VectorDofs & MoFEM::DataForcesAndSourcesCore::EntData::getFieldDofs ( )

Definition at line 1239 of file DataStructures.hpp.

1239 { return dOfs; }

◆ getFieldEntities() [1/2]

const VectorFieldEntities & MoFEM::DataForcesAndSourcesCore::EntData::getFieldEntities ( ) const

get field entities

Examples
test_cache_on_entities.cpp.

Definition at line 1250 of file DataStructures.hpp.

1250  {
1251  return fieldEntities;
1252 }
VectorFieldEntities fieldEntities
Field entities.

◆ getFieldEntities() [2/2]

VectorFieldEntities & MoFEM::DataForcesAndSourcesCore::EntData::getFieldEntities ( )

get field entities

Definition at line 1245 of file DataStructures.hpp.

1245  {
1246  return fieldEntities;
1247 }
VectorFieldEntities fieldEntities
Field entities.

◆ getFTensor0FieldData()

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

Resturn scalar files as a FTensor of rank 0.

Returns
FTensor::Tensor0<FTensor::PackPtr<double *,1> >
Examples
hcurl_check_approx_in_2d.cpp, and scalar_check_approximation_2d.cpp.

Definition at line 402 of file DataStructures.cpp.

402  {
403  if (dOfs[0]->getNbOfCoeffs() != 1) {
404  std::stringstream s;
405  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
406  s << " but expected scalar field, tensor of rank 0";
407  THROW_MESSAGE(s.str());
408  }
410  &*fieldData.data().begin());
411 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628
VectorDouble fieldData
Field data on entity.

◆ getFTensor0N() [1/6]

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

Get base function as Tensor0.

Parameters
base
Returns
Tensor0
Examples
EshelbianOperators.cpp, heat_equation.hpp, HookeElement.cpp, lesson3_poisson.cpp, lesson6_radiation.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion.cpp, Remodeling.cpp, scalar_check_approximation_2d.cpp, simple_elasticity.cpp, and wave_equation.hpp.

Definition at line 1459 of file DataStructures.hpp.

1460  {
1461  double *ptr = &*getN(base).data().begin();
1463 };
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....

◆ getFTensor0N() [2/6]

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

Get base function as Tensor0.

Return base functions for field base

Returns
Tensor0

Definition at line 1466 of file DataStructures.hpp.

1466  {
1467  return getFTensor0N(bAse);
1468 };
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N()
Get base function as Tensor0.
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor0N() [3/6]

FTensor::Tensor0< double * > MoFEM::DataForcesAndSourcesCore::EntData::getFTensor0N ( const FieldApproximationBase  base,
const int  bb 
)

Get base function as Tensor0 (Loop by integration points)

Parameters
base
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 1470 of file DataStructures.hpp.

1471  {
1472  double *ptr = &getN(base)(0, bb);
1473  return FTensor::Tensor0<double *>(ptr, getN(base).size2());
1474 };
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....

◆ getFTensor0N() [4/6]

FTensor::Tensor0< double * > MoFEM::DataForcesAndSourcesCore::EntData::getFTensor0N ( const int  bb)

Get base function as Tensor0 (Loop by integration points)

Return base functions for field base

Parameters
bbbase function
Returns
Tensor0

Definition at line 1477 of file DataStructures.hpp.

1477  {
1478  return getFTensor0N(bAse, bb);
1479 };
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N()
Get base function as Tensor0.
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor0N() [5/6]

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

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 1482 of file DataStructures.hpp.

1483  {
1484  double *ptr = &getN(base)(gg, bb);
1486 };
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....

◆ getFTensor0N() [6/6]

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

Get base function as Tensor0 (Loop by integration points)

Return base functions for field base

Parameters
bbbase function
Returns
Tensor0

Definition at line 1489 of file DataStructures.hpp.

1489  {
1490  return getFTensor0N(bAse, gg, bb);
1491 };
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N()
Get base function as Tensor0.
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [1/26]

template<>
FTensor::Tensor1<double *, 2> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( )

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

Definition at line 502 of file DataStructures.cpp.

502  {
503  return getFTensor1DiffN<2>(bAse);
504 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [2/26]

template<>
FTensor::Tensor1<double *, 3> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( const FieldApproximationBase  base)

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

Definition at line 450 of file DataStructures.cpp.

451  {
452  double *ptr = &*getDiffN(base).data().begin();
453  return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2], 3);
454 }
MatrixDouble & getDiffN()
get derivatives of base functions

◆ getFTensor1DiffN() [3/26]

template<>
FTensor::Tensor1<double *, 3> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( )

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

Definition at line 461 of file DataStructures.cpp.

461  {
462  return getFTensor1DiffN<3>(bAse);
463 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [4/26]

template<>
FTensor::Tensor1<double *, 3> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( const FieldApproximationBase  base,
const int  bb 
)

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

Definition at line 470 of file DataStructures.cpp.

471  {
472  double *ptr = &*getDiffN(base).data().begin();
474  &ptr[3 * bb], &ptr[3 * bb + 1], &ptr[3 * bb + 2], getDiffN(base).size2());
475 }
MatrixDouble & getDiffN()
get derivatives of base functions

◆ getFTensor1DiffN() [5/26]

template<>
FTensor::Tensor1<double *, 3> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( const int  bb)

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

Definition at line 482 of file DataStructures.cpp.

482  {
483  return getFTensor1DiffN<3>(bAse, bb);
484 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [6/26]

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

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

Definition at line 491 of file DataStructures.cpp.

492  {
493  double *ptr = &*getDiffN(base).data().begin();
494  return FTensor::Tensor1<double *, 2>(ptr, &ptr[1], 2);
495 }
MatrixDouble & getDiffN()
get derivatives of base functions

◆ getFTensor1DiffN() [7/26]

template<>
FTensor::Tensor1<double *, 2> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( const FieldApproximationBase  base,
const int  bb 
)

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

Definition at line 511 of file DataStructures.cpp.

512  {
513  double *ptr = &*getDiffN(base).data().begin();
514  return FTensor::Tensor1<double *, 2>(&ptr[2 * bb], &ptr[2 * bb + 1],
515  getDiffN(base).size1());
516 }
MatrixDouble & getDiffN()
get derivatives of base functions

◆ getFTensor1DiffN() [8/26]

template<>
FTensor::Tensor1<double *, 2> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( const int  bb)

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

Definition at line 523 of file DataStructures.cpp.

523  {
524  return getFTensor1DiffN<2>(bAse, bb);
525 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [9/26]

template<>
FTensor::Tensor1<double *, 3> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( const int  gg,
const int  bb 
)

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

Definition at line 553 of file DataStructures.cpp.

554  {
555  return getFTensor1DiffN<3>(bAse, gg, bb);
556 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [10/26]

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

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

Definition at line 574 of file DataStructures.cpp.

575  {
576  return getFTensor1DiffN<2>(bAse, gg, bb);
577 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [11/26]

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

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

Definition at line 542 of file DataStructures.cpp.

543  {
544  double *ptr = &getDiffN(base)(gg, 3 * bb);
545  return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2], 3);
546 }
MatrixDouble & getDiffN()
get derivatives of base functions

◆ getFTensor1DiffN() [12/26]

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

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

Definition at line 563 of file DataStructures.cpp.

564  {
565  double *ptr = &getDiffN(base)(gg, 2 * bb);
566  return FTensor::Tensor1<double *, 2>(ptr, &ptr[1], 2);
567 }
MatrixDouble & getDiffN()
get derivatives of base functions

◆ getFTensor1DiffN() [13/26]

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

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>();
Parameters
basefunctions
Returns
Tensor rank 1 (vector)
Examples
heat_equation.hpp, HookeElement.cpp, HookeElement.hpp, reaction_diffusion.cpp, Remodeling.cpp, scalar_check_approximation_2d.cpp, simple_elasticity.cpp, and wave_equation.hpp.

Definition at line 415 of file DataStructures.cpp.

416  {
417  std::stringstream s;
418  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
419  THROW_MESSAGE(s.str());
421 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628

◆ getFTensor1DiffN() [14/26]

template<int Tensor_Dim>
FTensor::Tensor1< double *, Tensor_Dim > MoFEM::DataForcesAndSourcesCore::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 425 of file DataStructures.cpp.

425  {
426  return getFTensor1DiffN<Tensor_Dim>(bAse);
427 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [15/26]

template<int Tensor_Dim>
FTensor::Tensor1< double *, Tensor_Dim > MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( const FieldApproximationBase  base,
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,bb);

where bb is base function. 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,bb);
Parameters
basefunctions
Returns
Tensor rank 1 (vector)

Definition at line 431 of file DataStructures.cpp.

432  {
433  std::stringstream s;
434  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
435  THROW_MESSAGE(s.str());
437 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628

◆ getFTensor1DiffN() [16/26]

template<int Tensor_Dim>
FTensor::Tensor1< double *, Tensor_Dim > MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( 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>(bb);

where bb is base function. 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>(bb);
Returns
Tensor rank 1 (vector)

Definition at line 441 of file DataStructures.cpp.

441  {
442  return getFTensor1DiffN<Tensor_Dim>(bAse, bb);
443 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [17/26]

template<int Tensor_Dim>
FTensor::Tensor1< double *, Tensor_Dim > MoFEM::DataForcesAndSourcesCore::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 529 of file DataStructures.cpp.

530  {
531  std::stringstream s;
532  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
533  THROW_MESSAGE(s.str());
535 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628

◆ getFTensor1DiffN() [18/26]

template<int Tensor_Dim>
FTensor::Tensor1<double *, Tensor_Dim> MoFEM::DataForcesAndSourcesCore::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() [19/26]

template<>
FTensor::Tensor1<double *, 3> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( const FieldApproximationBase  base)

◆ getFTensor1DiffN() [20/26]

template<>
FTensor::Tensor1<double *, 3> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( )

◆ getFTensor1DiffN() [21/26]

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

◆ getFTensor1DiffN() [22/26]

template<>
FTensor::Tensor1<double *, 2> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( )

◆ getFTensor1DiffN() [23/26]

template<>
FTensor::Tensor1<double *, 3> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( const FieldApproximationBase  base,
const int  bb 
)

◆ getFTensor1DiffN() [24/26]

template<>
FTensor::Tensor1<double *, 2> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( const FieldApproximationBase  base,
const int  bb 
)

◆ getFTensor1DiffN() [25/26]

template<>
FTensor::Tensor1<double *, 3> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( const int  bb)

◆ getFTensor1DiffN() [26/26]

template<>
FTensor::Tensor1<double *, 2> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( const int  bb)

◆ getFTensor1FieldData() [1/5]

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

Return FTensor of rank 1, i.e. vector from filed data coeffinects.

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 1256 of file DataStructures.hpp.

1256  {
1257  std::stringstream s;
1258  s << "Not implemented for this dimension dim = " << Tensor_Dim;
1259  THROW_MESSAGE(s.str());
1260 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628

◆ getFTensor1FieldData() [2/5]

template<>
FTensor::Tensor1<FTensor::PackPtr<double *, 2>, 2> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1FieldData ( )

Definition at line 342 of file DataStructures.cpp.

342  {
343  if (dOfs[0]->getNbOfCoeffs() != 2) {
344  std::stringstream s;
345  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
346  s << " but you ask for tensor rank 1 dimension 3";
347  THROW_MESSAGE(s.str());
348  }
349  double *ptr = &*fieldData.data().begin();
350  return FTensor::Tensor1<FTensor::PackPtr<double *, 2>, 2>(ptr, &ptr[1]);
351 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628
VectorDouble fieldData
Field data on entity.

◆ getFTensor1FieldData() [3/5]

template<>
FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1FieldData ( )

Definition at line 328 of file DataStructures.cpp.

328  {
329  if (dOfs[0]->getNbOfCoeffs() != 3) {
330  std::stringstream s;
331  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
332  s << " but you ask for tensor rank 1 dimension 3";
333  THROW_MESSAGE(s.str());
334  }
335  double *ptr = &*fieldData.data().begin();
336  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(ptr, &ptr[1],
337  &ptr[2]);
338 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628
VectorDouble fieldData
Field data on entity.

◆ getFTensor1FieldData() [4/5]

template<>
FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1FieldData ( )

◆ getFTensor1FieldData() [5/5]

template<>
FTensor::Tensor1<FTensor::PackPtr<double *, 2>, 2> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1FieldData ( )

◆ getFTensor1N() [1/7]

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

Definition at line 641 of file DataStructures.cpp.

642  {
643  double *t_n_ptr = &getN(base)(gg, 3 * bb);
644  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(t_n_ptr, // HVEC0
645  &t_n_ptr[HVEC1],
646  &t_n_ptr[HVEC2]);
647 }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....

◆ getFTensor1N() [2/7]

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

Definition at line 631 of file DataStructures.cpp.

632  {
633  double *t_n_ptr = &*getN(base).data().begin();
634  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(t_n_ptr, // HVEC0
635  &t_n_ptr[HVEC1],
636  &t_n_ptr[HVEC2]);
637 }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....

◆ getFTensor1N() [3/7]

template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > MoFEM::DataForcesAndSourcesCore::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
continuity_check_on_skeleton_3d.cpp, continuity_check_on_skeleton_with_simple_2d.cpp, EshelbianOperators.cpp, hcurl_check_approx_in_2d.cpp, hcurl_curl_operator.cpp, and hcurl_divergence_operator_2d.cpp.

Definition at line 587 of file DataStructures.cpp.

587  {
588  std::stringstream s;
589  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
590  THROW_MESSAGE(s.str());
592 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628

◆ getFTensor1N() [4/7]

template<int Tensor_Dim>
auto MoFEM::DataForcesAndSourcesCore::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;
}
}

Definition at line 1494 of file DataStructures.hpp.

1494  {
1495  return getFTensor1N<Tensor_Dim>(bAse);
1496 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1N() [5/7]

template<int Tensor_Dim>
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > MoFEM::DataForcesAndSourcesCore::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 596 of file DataStructures.cpp.

597  {
598  std::stringstream s;
599  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
600  THROW_MESSAGE(s.str());
602 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628

◆ getFTensor1N() [6/7]

template<int Tensor_Dim>
auto MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1N ( 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(gg,0);
for(int bb = 0;bb!=nb_base_functions;bb++) {
double dot = t_base(i)*t_base(i);
}
}

Definition at line 1499 of file DataStructures.hpp.

1500  {
1501  return getFTensor1N<Tensor_Dim>(bAse, gg, bb);
1502 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1N() [7/7]

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

◆ getFTensor2DiffN() [1/10]

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

Definition at line 662 of file DataStructures.cpp.

663  {
664  double *t_diff_n_ptr = &getDiffN(base)(gg, 9 * bb);
666  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC0_2],
667  &t_diff_n_ptr[HVEC1_0], &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC1_2],
668  &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1], &t_diff_n_ptr[HVEC2_2]);
669 }
MatrixDouble & getDiffN()
get derivatives of base functions

◆ getFTensor2DiffN() [2/10]

template<>
FTensor::Tensor2<FTensor::PackPtr<double *, 9>, 3, 3> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor2DiffN ( FieldApproximationBase  base)

Definition at line 651 of file DataStructures.cpp.

652  {
653  double *t_diff_n_ptr = &*getDiffN(base).data().begin();
655  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC0_2],
656  &t_diff_n_ptr[HVEC1_0], &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC1_2],
657  &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1], &t_diff_n_ptr[HVEC2_2]);
658 }
MatrixDouble & getDiffN()
get derivatives of base functions

◆ getFTensor2DiffN() [3/10]

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

Definition at line 683 of file DataStructures.cpp.

684  {
685  double *t_diff_n_ptr = &getDiffN(base)(gg, 6 * bb);
687  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC1_0],
688  &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1]);
689 }
MatrixDouble & getDiffN()
get derivatives of base functions

◆ getFTensor2DiffN() [4/10]

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

Definition at line 673 of file DataStructures.cpp.

674  {
675  double *t_diff_n_ptr = &*getDiffN(base).data().begin();
677  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC1_0],
678  &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1]);
679 }
MatrixDouble & getDiffN()
get derivatives of base functions

◆ getFTensor2DiffN() [5/10]

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

Get derivatives of base functions for Hdiv space.

Examples
EshelbianOperators.cpp, hcurl_check_approx_in_2d.cpp, and hcurl_divergence_operator_2d.cpp.

Definition at line 607 of file DataStructures.cpp.

608  {
609  std::stringstream s;
610  s << "Template for tensor dimension " << Tensor_Dim0 << "x" << Tensor_Dim1
611  << " not implemented";
612  THROW_MESSAGE(s.str());
614 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628

◆ getFTensor2DiffN() [6/10]

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

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

Definition at line 619 of file DataStructures.cpp.

621  {
622  std::stringstream s;
623  s << "Template for tensor dimension " << Tensor_Dim0 << "x" << Tensor_Dim1
624  << " not implemented";
625  THROW_MESSAGE(s.str());
627 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628

◆ getFTensor2DiffN() [7/10]

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

Get derivatives of base functions for Hdiv space.

Definition at line 735 of file DataStructures.hpp.

735  {
736  return getFTensor2DiffN<Tensor_Dim0, Tensor_Dim1>(bAse);
737  }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor2DiffN() [8/10]

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

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

Definition at line 746 of file DataStructures.hpp.

746  {
747  return getFTensor2DiffN<Tensor_Dim0, Tensor_Dim1>(bAse, gg, bb);
748  }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor2DiffN() [9/10]

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

◆ getFTensor2DiffN() [10/10]

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

◆ getFTensor2FieldData() [1/3]

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

Return FTensor rank 2, i.e. matrix from filed data coeffinects.

auto t_mat = data.getFTensor2FieldData<3,3>();
Template Parameters
Tensor_Dim0
Tensor_Dim1
Returns
FTensor::Tensor2<FTensor::PackPtr<double *, Tensor_Dim0 * Tensor_Dim1>, Tensor_Dim0, Tensor_Dim1>

Definition at line 1265 of file DataStructures.hpp.

1265  {
1266  std::stringstream s;
1267  s << "Not implemented for this dimension dim0 = " << Tensor_Dim0;
1268  s << " and dim1 " << Tensor_Dim1;
1269  THROW_MESSAGE(s.str());
1270 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628

◆ getFTensor2FieldData() [2/3]

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

Definition at line 355 of file DataStructures.cpp.

355  {
356  if (dOfs[0]->getNbOfCoeffs() != 9) {
357  std::stringstream s;
358  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
359  s << " but you ask for tensor rank 2 dimensions 3 by 3 so 9 coefficients "
360  "is expected";
361  THROW_MESSAGE(s.str());
362  }
363  double *ptr = &*fieldData.data().begin();
365  ptr, &ptr[1], &ptr[2], &ptr[3], &ptr[4], &ptr[5], &ptr[6], &ptr[7],
366  &ptr[8]);
367 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628
VectorDouble fieldData
Field data on entity.

◆ getFTensor2FieldData() [3/3]

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

◆ getFTensor2N() [1/7]

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

Definition at line 705 of file DataStructures.cpp.

706  {
707  double *t_n_ptr = &*(getN(base).data().begin());
709 
710  &t_n_ptr[HVEC0], &t_n_ptr[HVEC1], &t_n_ptr[HVEC2],
711 
712  &t_n_ptr[3 + HVEC0], &t_n_ptr[3 + HVEC1], &t_n_ptr[3 + HVEC2],
713 
714  &t_n_ptr[6 + HVEC0], &t_n_ptr[6 + HVEC1], &t_n_ptr[6 + HVEC2]
715 
716  );
717 }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....

◆ getFTensor2N() [2/7]

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

Definition at line 734 of file DataStructures.cpp.

735  {
736  double *t_n_ptr = &getN(base)(gg, 9 * bb);
738 
739  &t_n_ptr[HVEC0], &t_n_ptr[HVEC1], &t_n_ptr[HVEC2],
740 
741  &t_n_ptr[3 + HVEC0], &t_n_ptr[3 + HVEC1], &t_n_ptr[3 + HVEC2],
742 
743  &t_n_ptr[6 + HVEC0], &t_n_ptr[6 + HVEC1], &t_n_ptr[6 + HVEC2]
744 
745  );
746 }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....

◆ getFTensor2N() [3/7]

template<int Tensor_Dim0, int Tensor_Dim1>
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > MoFEM::DataForcesAndSourcesCore::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
EshelbianOperators.cpp.

Definition at line 694 of file DataStructures.cpp.

694  {
695  std::stringstream s;
696  s << "Template for tensor dimension " << Tensor_Dim0 << ", " << Tensor_Dim1
697  << " not implemented";
698  THROW_MESSAGE(s.str());
700  Tensor_Dim0, Tensor_Dim1>();
701 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628

◆ getFTensor2N() [4/7]

template<int Tensor_Dim0, int Tensor_Dim1>
auto MoFEM::DataForcesAndSourcesCore::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;
}
}

Definition at line 1505 of file DataStructures.hpp.

1505  {
1506  return getFTensor2N<Tensor_Dim0, Tensor_Dim1>(bAse);
1507 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor2N() [5/7]

template<int Tensor_Dim0, int Tensor_Dim1>
FTensor::Tensor2< FTensor::PackPtr< double *, Tensor_Dim0 *Tensor_Dim1 >, Tensor_Dim0, Tensor_Dim1 > MoFEM::DataForcesAndSourcesCore::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 722 of file DataStructures.cpp.

723  {
724  std::stringstream s;
725  s << "Template for tensor dimension " << Tensor_Dim0 << ", " << Tensor_Dim1
726  << " not implemented";
727  THROW_MESSAGE(s.str());
729  Tensor_Dim0, Tensor_Dim1>();
730 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628

◆ getFTensor2N() [6/7]

template<int Tensor_Dim0, int Tensor_Dim1>
auto MoFEM::DataForcesAndSourcesCore::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 1510 of file DataStructures.hpp.

1511  {
1512  return getFTensor2N<Tensor_Dim0, Tensor_Dim1>(bAse, gg, bb);
1513 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor2N() [7/7]

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

◆ getFTensor2SymmetricFieldData() [1/5]

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

Return symmetric FTensor rank 2, i.e. matrix from filed data coeffinects.

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

Definition at line 1275 of file DataStructures.hpp.

1275  {
1276  std::stringstream s;
1277  s << "Not implemented for this dimension dim = " << Tensor_Dim;
1278  THROW_MESSAGE(s.str());
1279 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628

◆ getFTensor2SymmetricFieldData() [2/5]

template<>
FTensor::Tensor2_symmetric<FTensor::PackPtr<double *, 6>, 3> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor2SymmetricFieldData ( )

Definition at line 371 of file DataStructures.cpp.

371  {
372  if (dOfs[0]->getNbOfCoeffs() != 6) {
373  std::stringstream s;
374  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
375  s << " but you ask for symmetric tensor rank 2 dimensions 3 by 3 so 6 "
376  "coefficients "
377  "is expected";
378  THROW_MESSAGE(s.str());
379  }
380  double *ptr = &*fieldData.data().begin();
382  ptr, &ptr[1], &ptr[2], &ptr[3], &ptr[4], &ptr[5]);
383 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628
VectorDouble fieldData
Field data on entity.

◆ getFTensor2SymmetricFieldData() [3/5]

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

Definition at line 387 of file DataStructures.cpp.

387  {
388  if (dOfs[0]->getNbOfCoeffs() != 3) {
389  std::stringstream s;
390  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
391  s << " but you ask for symmetric tensor rank 2 dimensions 2 by 2 so 3 "
392  "coefficients "
393  "is expected";
394  THROW_MESSAGE(s.str());
395  }
396  double *ptr = &*fieldData.data().begin();
398  ptr, &ptr[1], &ptr[2]);
399 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628
VectorDouble fieldData
Field data on entity.

◆ getFTensor2SymmetricFieldData() [4/5]

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

◆ getFTensor2SymmetricFieldData() [5/5]

template<>
FTensor::Tensor2_symmetric<FTensor::PackPtr<double *, 6>, 3> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor2SymmetricFieldData ( )

◆ getIndices() [1/2]

const VectorInt & MoFEM::DataForcesAndSourcesCore::EntData::getIndices ( ) const

◆ getIndices() [2/2]

VectorInt & MoFEM::DataForcesAndSourcesCore::EntData::getIndices ( )

Definition at line 1214 of file DataStructures.hpp.

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

◆ getIndicesUpToOrder()

const VectorIntAdaptor MoFEM::DataForcesAndSourcesCore::EntData::getIndicesUpToOrder ( int  order)

get global indices of dofs on entity up to given order

Definition at line 1183 of file DataStructures.hpp.

1183  {
1184  unsigned int size = 0;
1185  if (auto dof = dOfs[0]) {
1186  size = dof->getOrderNbDofs(order) * dof->getNbOfCoeffs();
1187  size = size < iNdices.size() ? size : iNdices.size();
1188  }
1189  int *data = &*iNdices.data().begin();
1190  return VectorIntAdaptor(size, ublas::shallow_array_adaptor<int>(size, data));
1191 }
VectorInt iNdices
Global indices on entity.
constexpr int order
VectorShallowArrayAdaptor< int > VectorIntAdaptor
Definition: Types.hpp:110

◆ getLocalIndices() [1/2]

const VectorInt & MoFEM::DataForcesAndSourcesCore::EntData::getLocalIndices ( ) const

get local indices of dofs on entity

Examples
boundary_marker.cpp, heat_equation.hpp, prism_elements_from_surface.cpp, Remodeling.cpp, and wave_equation.hpp.

Definition at line 1193 of file DataStructures.hpp.

1193  {
1194  return localIndices;
1195 }
VectorInt localIndices
Local indices on entity.

◆ getLocalIndices() [2/2]

VectorInt & MoFEM::DataForcesAndSourcesCore::EntData::getLocalIndices ( )

Definition at line 1216 of file DataStructures.hpp.

1216  {
1217  return localIndices;
1218 }
VectorInt localIndices
Local indices on entity.

◆ getLocalIndicesUpToOrder()

const VectorIntAdaptor MoFEM::DataForcesAndSourcesCore::EntData::getLocalIndicesUpToOrder ( int  order)

get local indices of dofs on entity up to given order

Definition at line 1198 of file DataStructures.hpp.

1198  {
1199  unsigned int size = 0;
1200  if (auto dof = dOfs[0]) {
1201  size = dof->getOrderNbDofs(order) * dof->getNbOfCoeffs();
1202  size = size < localIndices.size() ? size : localIndices.size();
1203  }
1204  int *data = &*localIndices.data().begin();
1205  return VectorIntAdaptor(size, ublas::shallow_array_adaptor<int>(size, data));
1206 }
constexpr int order
VectorShallowArrayAdaptor< int > VectorIntAdaptor
Definition: Types.hpp:110
VectorInt localIndices
Local indices on entity.

◆ getN() [1/7]

MatrixDouble & MoFEM::DataForcesAndSourcesCore::EntData::getN ( 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.

Note
Note that for vectorial base, like Hdiv or Hcurl, in columns are vectorial base functions. For tonsorial would be tonsorial base functions. Interpretation depends on type of base, scalar, vectorial or tonsorial and dimension fo problem.
Examples
continuity_check_on_contact_prism_side_ele.cpp, continuity_check_on_skeleton_3d.cpp, continuity_check_on_skeleton_with_simple_2d.cpp, EshelbianOperators.cpp, forces_and_sources_testing_edge_element.cpp, forces_and_sources_testing_users_base.cpp, hcurl_check_approx_in_2d.cpp, hcurl_curl_operator.cpp, hcurl_divergence_operator_2d.cpp, hdiv_divergence_operator.cpp, HookeElement.cpp, HookeElement.hpp, OpPostProcElastic.hpp, prism_elements_from_surface.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, Remodeling.cpp, scalar_check_approximation_2d.cpp, and simple_elasticity.cpp.

Definition at line 1288 of file DataStructures.hpp.

1288  {
1289  return *(getNSharedPtr(base));
1290 }
virtual boost::shared_ptr< MatrixDouble > & getNSharedPtr(const FieldApproximationBase base)

◆ getN() [2/7]

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

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 tonsorial would be tonsorial base functions. Interpretation depends on type of base, scalar, vectorial or tonsorial and dimension fo problem.

Definition at line 1293 of file DataStructures.hpp.

1293  {
1294  return *(getBBNSharedPtr(field_name));
1295 }
virtual boost::shared_ptr< MatrixDouble > & getBBNSharedPtr(const std::string &field_name)

◆ getN() [3/7]

MatrixDouble & MoFEM::DataForcesAndSourcesCore::EntData::getN ( )

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 tonsorial would be tonsorial base functions. Interpretation depends on type of base, scalar, vectorial or tonsorial and dimension fo problem.

Definition at line 1297 of file DataStructures.hpp.

1297 { return getN(bAse); }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FieldApproximationBase bAse
Field approximation base.

◆ getN() [4/7]

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

get base functions at Gauss pts

Definition at line 1314 of file DataStructures.hpp.

1315  {
1316  int size = getN(base).size2();
1317  double *data = &getN(base)(gg, 0);
1318  return VectorAdaptor(size, ublas::shallow_array_adaptor<double>(size, data));
1319 }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition: Types.hpp:109

◆ getN() [5/7]

const VectorAdaptor MoFEM::DataForcesAndSourcesCore::EntData::getN ( const int  gg)

get base functions at Gauss pts

Definition at line 1321 of file DataStructures.hpp.

1321  {
1322  return getN(bAse, gg);
1323 }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FieldApproximationBase bAse
Field approximation base.

◆ getN() [6/7]

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

get base functions at Gauss pts

Note that multi field element, two different field can have different approximation orders. Since we use hierarchical approximation basis, base functions are calculated once for element, using maximal approximation order on given entity.

Parameters
baseApproximation base
ggnumber of Gauss point
nb_base_functionsnumber of of base functions returned

Definition at line 1353 of file DataStructures.hpp.

1355  {
1356  (void)getN()(gg, nb_base_functions -
1357  1); // throw error if nb_base_functions is to big
1358  double *data = &getN(base)(gg, 0);
1359  return VectorAdaptor(nb_base_functions, ublas::shallow_array_adaptor<double>(
1360  nb_base_functions, data));
1361 }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition: Types.hpp:109

◆ getN() [7/7]

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

get base functions at Gauss pts

Note that multi field element, two different field can have different approximation orders. Since we use hierarchical approximation basis, base functions are calculated once for element, using maximal approximation order on given entity.

Parameters
ggnumber of Gauss point
nb_base_functionsnumber of of base functions returned

Definition at line 1364 of file DataStructures.hpp.

1365  {
1366  return getN(bAse, gg, nb_base_functions);
1367 }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FieldApproximationBase bAse
Field approximation base.

◆ getNSharedPtr() [1/2]

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

Get shared pointer to base base functions

Reimplemented in MoFEM::DerivedDataForcesAndSourcesCore::DerivedEntData.

Definition at line 34 of file DataStructures.cpp.

35  {
36  return N[base];
37 }
std::array< boost::shared_ptr< MatrixDouble >, LASTBASE > N
Base functions.

◆ getNSharedPtr() [2/2]

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

Get shared pointer to base base functions

Reimplemented in MoFEM::DerivedDataForcesAndSourcesCore::DerivedEntData.

Definition at line 40 of file DataStructures.cpp.

41  {
42  return N[base];
43 }
std::array< boost::shared_ptr< MatrixDouble >, LASTBASE > N
Base functions.

◆ getOrder()

ApproximationOrder MoFEM::DataForcesAndSourcesCore::EntData::getOrder ( ) const

get approximation order

Definition at line 1174 of file DataStructures.hpp.

1174  {
1175  return oRder;
1176 }
ApproximationOrder oRder
Entity order.

◆ getSense() [1/2]

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

get entity sense, need to calculate base functions with conforming approximation fields

Reimplemented in MoFEM::DerivedDataForcesAndSourcesCore::DerivedEntData.

Definition at line 31 of file DataStructures.cpp.

31 { return sEnse; }
int sEnse
Entity sense (orientation)

◆ getSense() [2/2]

int & MoFEM::DataForcesAndSourcesCore::EntData::getSense ( )

Definition at line 1208 of file DataStructures.hpp.

1208 { return sEnse; }
int sEnse
Entity sense (orientation)

◆ getSpace()

FieldSpace & MoFEM::DataForcesAndSourcesCore::EntData::getSpace ( )

Get field space.

Returns
Field space
Examples
continuity_check_on_contact_prism_side_ele.cpp, and continuity_check_on_skeleton_3d.cpp.

Definition at line 1285 of file DataStructures.hpp.

1285 { return sPace; }

◆ getVectorDiffN() [1/4]

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

get DiffHdiv of base functions at Gauss pts

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

Definition at line 1424 of file DataStructures.hpp.

1425  {
1426  if (PetscUnlikely(getDiffN(base).size2() % (DIM0 * DIM1))) {
1427  THROW_MESSAGE("Wrong dimension");
1428  }
1429 
1430  const int nb_base_functions = getN(base).size2() / (DIM0 * DIM1);
1431  double *data = &getN(base)(gg, 0);
1432  return MatrixAdaptor(nb_base_functions, DIM0 * DIM1,
1433  ublas::shallow_array_adaptor<double>(
1434  DIM0 * DIM1 * nb_base_functions, data));
1435 }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition: Types.hpp:126
MatrixDouble & getDiffN()
get derivatives of base functions

◆ getVectorDiffN() [2/4]

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

get DiffHdiv of base functions at Gauss pts

Parameters
ggnb. of Gauss point
numberof of base functions

Definition at line 1439 of file DataStructures.hpp.

1439  {
1440  return getVectorDiffN<DIM0, DIM1>(bAse, gg);
1441 }
FieldApproximationBase bAse
Field approximation base.

◆ getVectorDiffN() [3/4]

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

get DiffHdiv of base functions at Gauss pts

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

Definition at line 1444 of file DataStructures.hpp.

1445  {
1446  double *data =
1447  &DataForcesAndSourcesCore::EntData::getDiffN(base)(gg, DIM0 * DIM1 * dof);
1448  return MatrixAdaptor(DIM0, DIM1,
1449  ublas::shallow_array_adaptor<double>(DIM0 * DIM1, data));
1450 }
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition: Types.hpp:126
MatrixDouble & getDiffN()
get derivatives of base functions

◆ getVectorDiffN() [4/4]

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

get DiffHdiv of base functions at Gauss pts

Parameters
ggnb. of Gauss point
numberof of base functions

Definition at line 1454 of file DataStructures.hpp.

1454  {
1455  return getVectorDiffN<DIM0, DIM1>(bAse, dof, gg);
1456 }
FieldApproximationBase bAse
Field approximation base.

◆ getVectorN() [1/2]

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

get Hdiv of base functions at Gauss pts

Parameters
baseApproximation base
ggnb. of Gauss point
Examples
hdiv_divergence_operator.cpp.

Definition at line 1403 of file DataStructures.hpp.

1404  {
1405  if (PetscUnlikely(getN(base).size2() % DIM)) {
1406  THROW_MESSAGE("Wrong dimension");
1407  }
1408 
1409  const int nb_base_functions = getN(base).size2() / DIM;
1410  double *data = &getN(base)(gg, 0);
1411  return MatrixAdaptor(
1412  nb_base_functions, DIM,
1413  ublas::shallow_array_adaptor<double>(DIM * nb_base_functions, data));
1414 }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition: Types.hpp:126

◆ getVectorN() [2/2]

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

get Hdiv of base functions at Gauss pts

Parameters
ggnb. of Gauss point
numberof of base functions

Definition at line 1418 of file DataStructures.hpp.

1418  {
1419  return getVectorN<DIM>(bAse, gg);
1420 }
FieldApproximationBase bAse
Field approximation base.

◆ resetFieldDependentData()

MoFEMErrorCode MoFEM::DataForcesAndSourcesCore::EntData::resetFieldDependentData ( )

Reset data associated with particular field name

Returns
error code

Definition at line 160 of file DataStructures.cpp.

160  {
162  sPace = NOSPACE;
163  bAse = NOBASE;
164  iNdices.resize(0, false);
165  localIndices.resize(0, false);
166  dOfs.resize(0, false);
167  fieldData.resize(0, false);
169 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:509
VectorInt iNdices
Global indices on entity.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
VectorDouble fieldData
Field data on entity.
FieldApproximationBase bAse
Field approximation base.
VectorInt localIndices
Local indices on entity.

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 273 of file DataStructures.cpp.

274  {
275  os << "sEnse: " << e.getSense() << std::endl
276  << "oRder: " << e.getOrder() << std::endl
277  << "global indices: " << e.getIndices() << std::endl
278  << "local indices: " << e.getLocalIndices() << std::endl;
279  os.precision(2);
280  os << "fieldData: " << std::fixed << e.getFieldData() << std::endl;
281  MatrixDouble base = const_cast<DataForcesAndSourcesCore::EntData &>(e).getN();
282  MatrixDouble diff_base =
283  const_cast<DataForcesAndSourcesCore::EntData &>(e).getDiffN();
284  const double eps = 1e-6;
285  for (unsigned int ii = 0; ii != base.size1(); ii++) {
286  for (unsigned int jj = 0; jj != base.size2(); jj++) {
287  if (fabs(base(ii, jj)) < eps)
288  base(ii, jj) = 0;
289  }
290  }
291  for (unsigned int ii = 0; ii != diff_base.size1(); ii++) {
292  for (unsigned int jj = 0; jj != diff_base.size2(); jj++) {
293  if (fabs(diff_base(ii, jj)) < eps)
294  diff_base(ii, jj) = 0;
295  }
296  }
297  os << "N: " << std::fixed << base << std::endl
298  << "diffN: " << std::fixed << diff_base;
299  return os;
300 }
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:76
static const double eps

Member Data Documentation

◆ bAse

FieldApproximationBase MoFEM::DataForcesAndSourcesCore::EntData::bAse
protected

Field approximation base.

Definition at line 1000 of file DataStructures.hpp.

◆ bbAlphaInduces

std::map<std::string, boost::shared_ptr<MatrixInt> > MoFEM::DataForcesAndSourcesCore::EntData::bbAlphaInduces
protected

Indices for Bernstein-Bezier base.

Definition at line 1015 of file DataStructures.hpp.

◆ bbAlphaInducesByOrder

std::array<boost::shared_ptr<MatrixInt>, MaxBernsteinBezierOrder> MoFEM::DataForcesAndSourcesCore::EntData::bbAlphaInducesByOrder
protected

Definition at line 1022 of file DataStructures.hpp.

◆ bbDiffN

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

Definition at line 1013 of file DataStructures.hpp.

◆ bbDiffNByOrder

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

Definition at line 1020 of file DataStructures.hpp.

◆ bbFieldName

std::string MoFEM::DataForcesAndSourcesCore::EntData::bbFieldName
protected

field name

Definition at line 1010 of file DataStructures.hpp.

◆ bbN

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

Definition at line 1012 of file DataStructures.hpp.

◆ bbNByOrder

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

Definition at line 1018 of file DataStructures.hpp.

◆ bbNodeOrder

VectorInt MoFEM::DataForcesAndSourcesCore::EntData::bbNodeOrder
protected

order of nodes

Definition at line 1011 of file DataStructures.hpp.

◆ diffN

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

Derivatives of base functions.

Definition at line 1008 of file DataStructures.hpp.

◆ dOfs

VectorDofs MoFEM::DataForcesAndSourcesCore::EntData::dOfs
protected

DoFs on entity.

Definition at line 1003 of file DataStructures.hpp.

◆ fieldData

VectorDouble MoFEM::DataForcesAndSourcesCore::EntData::fieldData
protected

Field data on entity.

Definition at line 1005 of file DataStructures.hpp.

◆ fieldEntities

VectorFieldEntities MoFEM::DataForcesAndSourcesCore::EntData::fieldEntities
protected

Field entities.

Definition at line 1004 of file DataStructures.hpp.

◆ iNdices

VectorInt MoFEM::DataForcesAndSourcesCore::EntData::iNdices
protected

Global indices on entity.

Definition at line 1001 of file DataStructures.hpp.

◆ localIndices

VectorInt MoFEM::DataForcesAndSourcesCore::EntData::localIndices
protected

Local indices on entity.

Definition at line 1002 of file DataStructures.hpp.

◆ MaxBernsteinBezierOrder

constexpr size_t MoFEM::DataForcesAndSourcesCore::EntData::MaxBernsteinBezierOrder = BITFEID_SIZE
static

Definition at line 980 of file DataStructures.hpp.

◆ N

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

Base functions.

Definition at line 1006 of file DataStructures.hpp.

◆ oRder

ApproximationOrder MoFEM::DataForcesAndSourcesCore::EntData::oRder
protected

Entity order.

Definition at line 998 of file DataStructures.hpp.

◆ sEnse

int MoFEM::DataForcesAndSourcesCore::EntData::sEnse
protected

Entity sense (orientation)

Definition at line 997 of file DataStructures.hpp.

◆ sPace

FieldSpace MoFEM::DataForcesAndSourcesCore::EntData::sPace
protected

Entity space.

Definition at line 999 of file DataStructures.hpp.

◆ swapBaseDiffNPtr

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

Definition at line 1026 of file DataStructures.hpp.

◆ swapBaseNPtr

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

Definition at line 1025 of file DataStructures.hpp.


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