v0.9.1
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...
 
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 ()
 
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, 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, hello_world.cpp, HookeElement.cpp, HookeElement.hpp, lesson1_moment_of_inertia.cpp, lesson2_approximaton.cpp, lesson3_poisson.cpp, lesson4_elastic.cpp, lesson5_helmholtz.cpp, lesson6_radiation.cpp, lesson7_plastic.cpp, lesson8_contact.cpp, lorentz_force.cpp, mesh_smoothing.cpp, PoissonOperators.hpp, prism_elements_from_surface.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion_equation.cpp, Remodeling.cpp, scalar_check_approximation_2d.cpp, simple_elasticity.cpp, and simple_interface.cpp.

Definition at line 53 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:75
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:483
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:413
boost::shared_ptr< MatrixDouble > swapBaseDiffNPtr

◆ getBase()

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

Get approximation base.

Returns
Approximation base

Definition at line 1244 of file DataStructures.hpp.

1244  {
1245  return bAse;
1246 }
FieldApproximationBase bAse
Field approximation base.

◆ getBBAlphaIndices()

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

Get file BB indices.

Returns
MatrixInt&

Definition at line 1486 of file DataStructures.hpp.

1486  {
1488 }
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

◆ 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

◆ 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

◆ 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

◆ 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

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

1482  {
1483  return bbNodeOrder;
1484 }

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

1182  {
1183  return oRder;
1184 }
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 1263 of file DataStructures.hpp.

1263  {
1264  return *(getDiffNSharedPtr(base));
1265 }
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 1268 of file DataStructures.hpp.

1268  {
1269  return *(getBBDiffNSharedPtr(field_name));
1270 }
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 1272 of file DataStructures.hpp.

1272  {
1273  return getDiffN(bAse);
1274 }
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 1289 of file DataStructures.hpp.

1290  {
1291  // FIXME: That is bug, it will not work if number of integration pts is
1292  // equal to number of nodes on entity. User who not implementing low
1293  // level DataOperator will not experience this.
1294  if (getN(base).size1() == getDiffN(base).size1()) {
1295  int size = getN(base).size2();
1296  int dim = getDiffN(base).size2() / size;
1297  double *data = &getDiffN(base)(gg, 0);
1298  return MatrixAdaptor(
1299  getN(base).size2(), dim,
1300  ublas::shallow_array_adaptor<double>(getDiffN(base).size2(), data));
1301  } else {
1302  // in some cases, f.e. for derivatives of nodal base functions at only
1303  // one gauss point is needed
1304  return MatrixAdaptor(
1305  getN(base).size1(), getN(base).size2(),
1306  ublas::shallow_array_adaptor<double>(getDiffN(base).data().size(),
1307  &getDiffN(base).data()[0]));
1308  }
1309 }
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:125
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 1311 of file DataStructures.hpp.

1311  {
1312  return getDiffN(bAse, gg);
1313 }
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 1333 of file DataStructures.hpp.

1335  {
1336  // FIXME: That is bug, it will not work if number of integration pts is
1337  // equal to number of nodes on entity. User who not implementing low
1338  // level DataOperator will not experience this.
1339  if (getN(base).size1() == getDiffN(base).size1()) {
1340  (void)getN(base)(gg,
1341  nb_base_functions -
1342  1); // throw error if nb_base_functions is to big
1343  int dim = getDiffN(base).size2() / getN(base).size2();
1344  double *data = &getDiffN(base)(gg, 0);
1345  return MatrixAdaptor(
1346  nb_base_functions, dim,
1347  ublas::shallow_array_adaptor<double>(dim * nb_base_functions, data));
1348  } else {
1349  // in some cases, f.e. for derivatives of nodal base functions only one
1350  // gauss point is needed
1351  return MatrixAdaptor(
1352  getN(base).size1(), getN(base).size2(),
1353  ublas::shallow_array_adaptor<double>(getDiffN(base).data().size(),
1354  &getDiffN(base).data()[0]));
1355  }
1356 }
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:125
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 1359 of file DataStructures.hpp.

1360  {
1361  return getDiffN(bAse, gg, nb_base_functions);
1362 }
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 ( )

Definition at line 1211 of file DataStructures.hpp.

1211  {
1212  return fieldData;
1213 }
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 1197 of file DataStructures.hpp.

1197  {
1198  unsigned int size = 0;
1199  if (auto dof = dOfs[0]) {
1200  size = dof->getOrderNbDofs(order) * dof->getNbOfCoeffs();
1201  size = size < fieldData.size() ? size : fieldData.size();
1202  }
1203  double *data = &*fieldData.data().begin();
1204  return getVectorAdaptor(data, size);
1205 }
VectorDouble fieldData
Field data on entity.
auto getVectorAdaptor(T1 ptr, const size_t n)
Get Vector adaptor.
Definition: Templates.hpp:42
constexpr int order

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

1207  {
1208  return dOfs;
1209 }

◆ getFieldDofs() [2/2]

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

Definition at line 1242 of file DataStructures.hpp.

1242 { return dOfs; }

◆ 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:626
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, HookeElement.cpp, lesson2_approximaton.cpp, lesson3_poisson.cpp, lesson6_radiation.cpp, PoissonOperators.hpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion_equation.cpp, Remodeling.cpp, scalar_check_approximation_2d.cpp, and simple_elasticity.cpp.

Definition at line 1422 of file DataStructures.hpp.

1423  {
1424  double *ptr = &*getN(base).data().begin();
1426 };
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 1429 of file DataStructures.hpp.

1429  {
1430  return getFTensor0N(bAse);
1431 };
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 1433 of file DataStructures.hpp.

1434  {
1435  double *ptr = &getN(base)(0, bb);
1436  return FTensor::Tensor0<double *>(ptr, getN(base).size2());
1437 };
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 1440 of file DataStructures.hpp.

1440  {
1441  return getFTensor0N(bAse, bb);
1442 };
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 1445 of file DataStructures.hpp.

1446  {
1447  double *ptr = &getN(base)(gg, bb);
1449 };
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 1452 of file DataStructures.hpp.

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

◆ getFTensor1DiffN() [1/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() [2/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() [3/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() [4/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() [5/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() [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 ( )

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() [8/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() [9/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() [10/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() [11/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() [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
HookeElement.cpp, HookeElement.hpp, PoissonOperators.hpp, reaction_diffusion_equation.cpp, Remodeling.cpp, scalar_check_approximation_2d.cpp, and simple_elasticity.cpp.

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:626

◆ 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:626

◆ 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:626

◆ 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 *, 2> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( )

◆ getFTensor1DiffN() [20/26]

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

◆ getFTensor1DiffN() [21/26]

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

◆ getFTensor1DiffN() [22/26]

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

◆ 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 *, 3> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( const int  bb)

◆ getFTensor1DiffN() [25/26]

template<>
FTensor::Tensor1<double *, 2> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1DiffN ( const FieldApproximationBase  base,
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 1217 of file DataStructures.hpp.

1217  {
1218  std::stringstream s;
1219  s << "Not implemented for this dimension dim = " << Tensor_Dim;
1220  THROW_MESSAGE(s.str());
1221 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:626

◆ getFTensor1FieldData() [2/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:626
VectorDouble fieldData
Field data on entity.

◆ getFTensor1FieldData() [3/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:626
VectorDouble fieldData
Field data on entity.

◆ getFTensor1FieldData() [4/5]

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

◆ getFTensor1FieldData() [5/5]

template<>
FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3> 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:626

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

1457  {
1458  return getFTensor1N<Tensor_Dim>(bAse);
1459 }
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:626

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

1463  {
1464  return getFTensor1N<Tensor_Dim>(bAse, gg, bb);
1465 }
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 *, 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() [2/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() [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 *, 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() [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:626

◆ 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:626

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

721  {
722  return getFTensor2DiffN<Tensor_Dim0, Tensor_Dim1>(bAse);
723  }
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 732 of file DataStructures.hpp.

732  {
733  return getFTensor2DiffN<Tensor_Dim0, Tensor_Dim1>(bAse, gg, bb);
734  }
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 1226 of file DataStructures.hpp.

1226  {
1227  std::stringstream s;
1228  s << "Not implemented for this dimension dim0 = " << Tensor_Dim0;
1229  s << " and dim1 " << Tensor_Dim1;
1230  THROW_MESSAGE(s.str());
1231 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:626

◆ 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:626
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:626

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

1468  {
1469  return getFTensor2N<Tensor_Dim0, Tensor_Dim1>(bAse);
1470 }
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:626

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

1474  {
1475  return getFTensor2N<Tensor_Dim0, Tensor_Dim1>(bAse, gg, bb);
1476 }
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 1236 of file DataStructures.hpp.

1236  {
1237  std::stringstream s;
1238  s << "Not implemented for this dimension dim = " << Tensor_Dim;
1239  THROW_MESSAGE(s.str());
1240 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:626

◆ 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:626
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:626
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 1186 of file DataStructures.hpp.

1186 { 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 1155 of file DataStructures.hpp.

1155  {
1156  unsigned int size = 0;
1157  if (auto dof = dOfs[0]) {
1158  size = dof->getOrderNbDofs(order) * dof->getNbOfCoeffs();
1159  size = size < iNdices.size() ? size : iNdices.size();
1160  }
1161  int *data = &*iNdices.data().begin();
1162  return VectorIntAdaptor(size, ublas::shallow_array_adaptor<int>(size, data));
1163 }
VectorInt iNdices
Global indices on entity.
constexpr int order
VectorShallowArrayAdaptor< int > VectorIntAdaptor
Definition: Types.hpp:109

◆ getLocalIndices() [1/2]

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

get local indices of dofs on entity

Examples
boundary_marker.cpp, prism_elements_from_surface.cpp, and Remodeling.cpp.

Definition at line 1165 of file DataStructures.hpp.

1165  {
1166  return localIndices;
1167 }
VectorInt localIndices
Local indices on entity.

◆ getLocalIndices() [2/2]

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

Definition at line 1188 of file DataStructures.hpp.

1188  {
1189  return localIndices;
1190 }
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 1170 of file DataStructures.hpp.

1170  {
1171  unsigned int size = 0;
1172  if (auto dof = dOfs[0]) {
1173  size = dof->getOrderNbDofs(order) * dof->getNbOfCoeffs();
1174  size = size < localIndices.size() ? size : localIndices.size();
1175  }
1176  int *data = &*localIndices.data().begin();
1177  return VectorIntAdaptor(size, ublas::shallow_array_adaptor<int>(size, data));
1178 }
constexpr int order
VectorShallowArrayAdaptor< int > VectorIntAdaptor
Definition: Types.hpp:109
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_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, 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 1251 of file DataStructures.hpp.

1251  {
1252  return *(getNSharedPtr(base));
1253 }
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 1256 of file DataStructures.hpp.

1256  {
1257  return *(getBBNSharedPtr(field_name));
1258 }
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 1260 of file DataStructures.hpp.

1260 { 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 1277 of file DataStructures.hpp.

1278  {
1279  int size = getN(base).size2();
1280  double *data = &getN(base)(gg, 0);
1281  return VectorAdaptor(size, ublas::shallow_array_adaptor<double>(size, data));
1282 }
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:108

◆ getN() [5/7]

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

get base functions at Gauss pts

Definition at line 1284 of file DataStructures.hpp.

1284  {
1285  return getN(bAse, gg);
1286 }
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 1316 of file DataStructures.hpp.

1318  {
1319  (void)getN()(gg, nb_base_functions -
1320  1); // throw error if nb_base_functions is to big
1321  double *data = &getN(base)(gg, 0);
1322  return VectorAdaptor(nb_base_functions, ublas::shallow_array_adaptor<double>(
1323  nb_base_functions, data));
1324 }
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:108

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

1328  {
1329  return getN(bAse, gg, nb_base_functions);
1330 }
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 1146 of file DataStructures.hpp.

1146  {
1147  return oRder;
1148 }
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 1180 of file DataStructures.hpp.

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

◆ getSpace()

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

Get field space.

Returns
Field space
Examples
continuity_check_on_skeleton_3d.cpp.

Definition at line 1248 of file DataStructures.hpp.

1248 { 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 1387 of file DataStructures.hpp.

1388  {
1389  if (PetscUnlikely(getDiffN(base).size2() % (DIM0 * DIM1))) {
1390  THROW_MESSAGE("Wrong dimension");
1391  }
1392 
1393  const int nb_base_functions = getN(base).size2() / (DIM0 * DIM1);
1394  double *data = &getN(base)(gg, 0);
1395  return MatrixAdaptor(nb_base_functions, DIM0 * DIM1,
1396  ublas::shallow_array_adaptor<double>(
1397  DIM0 * DIM1 * nb_base_functions, data));
1398 }
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:626
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition: Types.hpp:125
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 1402 of file DataStructures.hpp.

1402  {
1403  return getVectorDiffN<DIM0, DIM1>(bAse, gg);
1404 }
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 1407 of file DataStructures.hpp.

1408  {
1409  double *data =
1410  &DataForcesAndSourcesCore::EntData::getDiffN(base)(gg, DIM0 * DIM1 * dof);
1411  return MatrixAdaptor(DIM0, DIM1,
1412  ublas::shallow_array_adaptor<double>(DIM0 * DIM1, data));
1413 }
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition: Types.hpp:125
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 1417 of file DataStructures.hpp.

1417  {
1418  return getVectorDiffN<DIM0, DIM1>(bAse, dof, gg);
1419 }
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 1366 of file DataStructures.hpp.

1367  {
1368  if (PetscUnlikely(getN(base).size2() % DIM)) {
1369  THROW_MESSAGE("Wrong dimension");
1370  }
1371 
1372  const int nb_base_functions = getN(base).size2() / DIM;
1373  double *data = &getN(base)(gg, 0);
1374  return MatrixAdaptor(
1375  nb_base_functions, DIM,
1376  ublas::shallow_array_adaptor<double>(DIM * nb_base_functions, data));
1377 }
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:626
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition: Types.hpp:125

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

1381  {
1382  return getVectorN<DIM>(bAse, gg);
1383 }
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:507
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:514
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:75
static const double eps

Member Data Documentation

◆ bAse

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

Field approximation base.

Definition at line 986 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 1000 of file DataStructures.hpp.

◆ bbAlphaInducesByOrder

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

Definition at line 1007 of file DataStructures.hpp.

◆ bbDiffN

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

Definition at line 998 of file DataStructures.hpp.

◆ bbDiffNByOrder

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

Definition at line 1005 of file DataStructures.hpp.

◆ bbFieldName

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

field name

Definition at line 995 of file DataStructures.hpp.

◆ bbN

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

Definition at line 997 of file DataStructures.hpp.

◆ bbNByOrder

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

Definition at line 1003 of file DataStructures.hpp.

◆ bbNodeOrder

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

order of nodes

Definition at line 996 of file DataStructures.hpp.

◆ diffN

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

Derivatives of base functions.

Definition at line 993 of file DataStructures.hpp.

◆ dOfs

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

DoFs on entity.

Definition at line 989 of file DataStructures.hpp.

◆ fieldData

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

Field data on entity.

Definition at line 990 of file DataStructures.hpp.

◆ iNdices

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

Global indices on entity.

Definition at line 987 of file DataStructures.hpp.

◆ localIndices

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

Local indices on entity.

Definition at line 988 of file DataStructures.hpp.

◆ MaxBernsteinBezierOrder

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

Definition at line 966 of file DataStructures.hpp.

◆ N

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

Base functions.

Definition at line 991 of file DataStructures.hpp.

◆ oRder

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

Entity order.

Definition at line 984 of file DataStructures.hpp.

◆ sEnse

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

Entity sense (orientation)

Definition at line 983 of file DataStructures.hpp.

◆ sPace

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

Entity space.

Definition at line 985 of file DataStructures.hpp.

◆ swapBaseDiffNPtr

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

Definition at line 1011 of file DataStructures.hpp.

◆ swapBaseNPtr

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

Definition at line 1010 of file DataStructures.hpp.


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