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

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

#include <src/finite_elements/DataStructures.hpp>

Inheritance diagram for MoFEM::DataForcesAndSourcesCore::EntData:
[legend]
Collaboration 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 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::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::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::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/HCurl in 2d

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)
 

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...
 
intgetSense ()
 
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 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, hello_world.cpp, HookeElement.cpp, HookeElement.hpp, lorentz_force.cpp, mesh_smoothing.cpp, prism_elements_from_surface.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion_equation.cpp, Remodeling.cpp, simple_elasticity.cpp, simple_interface.cpp, and testing_jacobian_of_hook_scaled_with_density_element.cpp.

Definition at line 51 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:74
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:477
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:407
boost::shared_ptr< MatrixDouble > swapBaseDiffNPtr

◆ getBase()

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

Get approximation base.

Returns
Approximation base

Definition at line 1242 of file DataStructures.hpp.

1242  {
1243  return bAse;
1244 }
FieldApproximationBase bAse
Field approximation base.

◆ getBBAlphaIndices()

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

Get file BB indices.

Returns
MatrixInt&

Definition at line 1551 of file DataStructures.hpp.

1551  {
1553 }
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 821 of file DataStructures.cpp.

821  {
822  return bbAlphaInducesByOrder;
823 }
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 793 of file DataStructures.cpp.

794  {
795  return bbAlphaInducesByOrder[o];
796 }
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 778 of file DataStructures.cpp.

778  {
779  return bbAlphaInduces;
780 }
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 739 of file DataStructures.cpp.

740  {
741  return bbAlphaInduces[field_name];
742 }
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 833 of file DataStructures.cpp.

833  {
834  return bbDiffNByOrder;
835 }
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 809 of file DataStructures.cpp.

809  {
810  return bbDiffNByOrder[o];
811 }
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 814 of file DataStructures.cpp.

815  {
816  return bbDiffNByOrder[o];
817 }
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 788 of file DataStructures.cpp.

788  {
789  return bbDiffN;
790 }
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 763 of file DataStructures.cpp.

764  {
765  return bbDiffN[field_name];
766 }
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 772 of file DataStructures.cpp.

773  {
774  return bbDiffN.at(field_name);
775 }
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 827 of file DataStructures.cpp.

827  {
828  return bbNByOrder;
829 }
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 799 of file DataStructures.cpp.

799  {
800  return bbNByOrder[o];
801 }
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 804 of file DataStructures.cpp.

804  {
805  return bbNByOrder[o];
806 }
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 783 of file DataStructures.cpp.

783  {
784  return bbN;
785 }
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 1547 of file DataStructures.hpp.

1547  {
1548  return bbNodeOrder;
1549 }

◆ 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 745 of file DataStructures.cpp.

746  {
747  return bbN[field_name];
748 }
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 754 of file DataStructures.cpp.

755  {
756  return bbN.at(field_name);
757 }
std::map< std::string, boost::shared_ptr< MatrixDouble > > bbN

◆ getDataOrder()

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

Definition at line 1180 of file DataStructures.hpp.

1180  {
1181  return oRder;
1182 }
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.

Definition at line 1261 of file DataStructures.hpp.

1261  {
1262  return *(getDiffNSharedPtr(base));
1263 }
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 1266 of file DataStructures.hpp.

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

1270  {
1271  return getDiffN(bAse);
1272 }
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 1287 of file DataStructures.hpp.

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

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

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

1358  {
1359  return getDiffN(bAse, gg, nb_base_functions);
1360 }
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 1209 of file DataStructures.hpp.

1209  {
1210  return fieldData;
1211 }
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 1195 of file DataStructures.hpp.

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

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

1205  {
1206  return dOfs;
1207 }

◆ getFieldDofs() [2/2]

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

Definition at line 1240 of file DataStructures.hpp.

1240 { 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.

Definition at line 386 of file DataStructures.cpp.

386  {
387  if (dOfs[0]->getNbOfCoeffs() != 1) {
388  std::stringstream s;
389  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
390  s << " but expected scalar field, tensor of rank 0";
391  THROW_MESSAGE(s.str());
392  }
394  &*fieldData.data().begin());
395 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:620
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, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, reaction_diffusion_equation.cpp, Remodeling.cpp, and simple_elasticity.cpp.

Definition at line 1420 of file DataStructures.hpp.

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

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

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

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

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

1450  {
1451  return getFTensor0N(bAse, gg, bb);
1452 };
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 466 of file DataStructures.cpp.

466  {
467  return getFTensor1DiffN<3>(bAse, bb);
468 }
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 507 of file DataStructures.cpp.

507  {
508  return getFTensor1DiffN<2>(bAse, bb);
509 }
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 434 of file DataStructures.cpp.

435  {
436  double *ptr = &*getDiffN(base).data().begin();
437  return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2], 3);
438 }
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 445 of file DataStructures.cpp.

445  {
446  return getFTensor1DiffN<3>(bAse);
447 }
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 454 of file DataStructures.cpp.

455  {
456  double *ptr = &*getDiffN(base).data().begin();
458  &ptr[3 * bb], &ptr[3 * bb + 1], &ptr[3 * bb + 2], getDiffN(base).size2());
459 }
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 475 of file DataStructures.cpp.

476  {
477  double *ptr = &*getDiffN(base).data().begin();
478  return FTensor::Tensor1<double *, 2>(ptr, &ptr[1], 2);
479 }
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 486 of file DataStructures.cpp.

486  {
487  return getFTensor1DiffN<2>(bAse);
488 }
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 495 of file DataStructures.cpp.

496  {
497  double *ptr = &*getDiffN(base).data().begin();
498  return FTensor::Tensor1<double *, 2>(&ptr[2 * bb], &ptr[2 * bb + 1],
499  getDiffN(base).size1());
500 }
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 558 of file DataStructures.cpp.

559  {
560  return getFTensor1DiffN<2>(bAse, gg, bb);
561 }
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 526 of file DataStructures.cpp.

527  {
528  double *ptr = &getDiffN(base)(gg, 3 * bb);
529  return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2], 3);
530 }
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 537 of file DataStructures.cpp.

538  {
539  return getFTensor1DiffN<3>(bAse, gg, bb);
540 }
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 547 of file DataStructures.cpp.

548  {
549  double *ptr = &getDiffN(base)(gg, 2 * bb);
550  return FTensor::Tensor1<double *, 2>(ptr, &ptr[1], 2);
551 }
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
EshelbianOperators.cpp, HookeElement.cpp, HookeElement.hpp, reaction_diffusion_equation.cpp, Remodeling.cpp, and simple_elasticity.cpp.

Definition at line 399 of file DataStructures.cpp.

400  {
401  std::stringstream s;
402  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
403  THROW_MESSAGE(s.str());
405 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:620

◆ 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 409 of file DataStructures.cpp.

409  {
410  return getFTensor1DiffN<Tensor_Dim>(bAse);
411 }
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 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:620

◆ 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 425 of file DataStructures.cpp.

425  {
426  return getFTensor1DiffN<Tensor_Dim>(bAse, bb);
427 }
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 513 of file DataStructures.cpp.

514  {
515  std::stringstream s;
516  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
517  THROW_MESSAGE(s.str());
519 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:620

◆ getFTensor1DiffN() [18/26]

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

Get derivatives of base functions (Loop by integration points)

For volume element like tetrahedral or prism,

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

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

For face element like triangle or quad

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

◆ getFTensor1DiffN() [19/26]

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

◆ getFTensor1DiffN() [20/26]

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

◆ getFTensor1DiffN() [21/26]

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

◆ 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 int  bb)

◆ getFTensor1DiffN() [24/26]

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

◆ getFTensor1DiffN() [25/26]

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

◆ getFTensor1DiffN() [26/26]

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

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

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

◆ 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:620
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:620
VectorDouble fieldData
Field data on entity.

◆ getFTensor1FieldData() [4/5]

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

◆ getFTensor1FieldData() [5/5]

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

◆ getFTensor1N() [1/6]

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

Definition at line 625 of file DataStructures.cpp.

626  {
627  double *t_n_ptr = &getN(base)(gg, 3 * bb);
628  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(t_n_ptr, // HVEC0
629  &t_n_ptr[HVEC1],
630  &t_n_ptr[HVEC2]);
631 }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....

◆ getFTensor1N() [2/6]

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

Definition at line 615 of file DataStructures.cpp.

616  {
617  double *t_n_ptr = &*getN(base).data().begin();
618  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(t_n_ptr, // HVEC0
619  &t_n_ptr[HVEC1],
620  &t_n_ptr[HVEC2]);
621 }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....

◆ getFTensor1N() [3/6]

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 571 of file DataStructures.cpp.

571  {
572  std::stringstream s;
573  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
574  THROW_MESSAGE(s.str());
576 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:620

◆ getFTensor1N() [4/6]

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

1455  {
1456  return getFTensor1N<Tensor_Dim>(bAse);
1457 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1N() [5/6]

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 580 of file DataStructures.cpp.

581  {
582  std::stringstream s;
583  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
584  THROW_MESSAGE(s.str());
586 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:620

◆ getFTensor1N() [6/6]

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

1461  {
1462  return getFTensor1N<Tensor_Dim>(bAse, gg, bb);
1463 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor2DiffN() [1/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 667 of file DataStructures.cpp.

668  {
669  double *t_diff_n_ptr = &getDiffN(base)(gg, 6 * bb);
671  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC1_0],
672  &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1]);
673 }
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 646 of file DataStructures.cpp.

647  {
648  double *t_diff_n_ptr = &getDiffN(base)(gg, 9 * bb);
650  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC0_2],
651  &t_diff_n_ptr[HVEC1_0], &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC1_2],
652  &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1], &t_diff_n_ptr[HVEC2_2]);
653 }
MatrixDouble & getDiffN()
get derivatives of base functions

◆ getFTensor2DiffN() [3/10]

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

Definition at line 635 of file DataStructures.cpp.

636  {
637  double *t_diff_n_ptr = &*getDiffN(base).data().begin();
639  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC0_2],
640  &t_diff_n_ptr[HVEC1_0], &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC1_2],
641  &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1], &t_diff_n_ptr[HVEC2_2]);
642 }
MatrixDouble & getDiffN()
get derivatives of base functions

◆ getFTensor2DiffN() [4/10]

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

Definition at line 657 of file DataStructures.cpp.

658  {
659  double *t_diff_n_ptr = &*getDiffN(base).data().begin();
661  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC1_0],
662  &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1]);
663 }
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 591 of file DataStructures.cpp.

592  {
593  std::stringstream s;
594  s << "Template for tensor dimension " << Tensor_Dim0 << "x" << Tensor_Dim1
595  << " not implemented";
596  THROW_MESSAGE(s.str());
598 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:620

◆ 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 603 of file DataStructures.cpp.

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

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

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

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

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

◆ 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:620
VectorDouble fieldData
Field data on entity.

◆ getFTensor2FieldData() [3/3]

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

◆ getFTensor2N() [1/6]

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

Definition at line 689 of file DataStructures.cpp.

690  {
691  double *t_n_ptr = &*(getN(base).data().begin());
693 
694  &t_n_ptr[HVEC0], &t_n_ptr[HVEC1], &t_n_ptr[HVEC2],
695 
696  &t_n_ptr[3 + HVEC0], &t_n_ptr[3 + HVEC1], &t_n_ptr[3 + HVEC2],
697 
698  &t_n_ptr[6 + HVEC0], &t_n_ptr[6 + HVEC1], &t_n_ptr[6 + HVEC2]
699 
700  );
701 }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....

◆ getFTensor2N() [2/6]

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

Definition at line 718 of file DataStructures.cpp.

719  {
720  double *t_n_ptr = &getN(base)(gg, 9 * bb);
722 
723  &t_n_ptr[HVEC0], &t_n_ptr[HVEC1], &t_n_ptr[HVEC2],
724 
725  &t_n_ptr[3 + HVEC0], &t_n_ptr[3 + HVEC1], &t_n_ptr[3 + HVEC2],
726 
727  &t_n_ptr[6 + HVEC0], &t_n_ptr[6 + HVEC1], &t_n_ptr[6 + HVEC2]
728 
729  );
730 }
MatrixDouble & getN()
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....

◆ getFTensor2N() [3/6]

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 678 of file DataStructures.cpp.

678  {
679  std::stringstream s;
680  s << "Template for tensor dimension " << Tensor_Dim0 << ", " << Tensor_Dim1
681  << " not implemented";
682  THROW_MESSAGE(s.str());
684  Tensor_Dim0, Tensor_Dim1>();
685 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:620

◆ getFTensor2N() [4/6]

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

1466  {
1467  return getFTensor2N<Tensor_Dim0, Tensor_Dim1>(bAse);
1468 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor2N() [5/6]

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 706 of file DataStructures.cpp.

707  {
708  std::stringstream s;
709  s << "Template for tensor dimension " << Tensor_Dim0 << ", " << Tensor_Dim1
710  << " not implemented";
711  THROW_MESSAGE(s.str());
713  Tensor_Dim0, Tensor_Dim1>();
714 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:620

◆ getFTensor2N() [6/6]

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

1472  {
1473  return getFTensor2N<Tensor_Dim0, Tensor_Dim1>(bAse, gg, bb);
1474 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor2SymmetricFieldData() [1/3]

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

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

◆ getFTensor2SymmetricFieldData() [2/3]

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:620
VectorDouble fieldData
Field data on entity.

◆ getFTensor2SymmetricFieldData() [3/3]

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

1184 { 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 1153 of file DataStructures.hpp.

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

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

1163  {
1164  return localIndices;
1165 }
VectorInt localIndices
Local indices on entity.

◆ getLocalIndices() [2/2]

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

Definition at line 1186 of file DataStructures.hpp.

1186  {
1187  return localIndices;
1188 }
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 1168 of file DataStructures.hpp.

1168  {
1169  unsigned int size = 0;
1170  if (localIndices.size()) {
1171  size = dOfs[0]->getOrderNbDofs(order) * dOfs[0]->getNbOfCoeffs();
1172  size = size < localIndices.size() ? size : localIndices.size();
1173  }
1174  int *data = &*localIndices.data().begin();
1175  return VectorIntAdaptor(size, ublas::shallow_array_adaptor<int>(size, data));
1176 }
VectorShallowArrayAdaptor< int > VectorIntAdaptor
Definition: Types.hpp:102
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, HookeElement.cpp, HookeElement.hpp, prism_elements_from_surface.cpp, prism_polynomial_approximation.cpp, quad_polynomial_approximation.cpp, Remodeling.cpp, and simple_elasticity.cpp.

Definition at line 1249 of file DataStructures.hpp.

1249  {
1250  return *(getNSharedPtr(base));
1251 }
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 1254 of file DataStructures.hpp.

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

1258 { 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 1275 of file DataStructures.hpp.

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

◆ getN() [5/7]

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

get base functions at Gauss pts

Definition at line 1282 of file DataStructures.hpp.

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

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

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

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

1144  {
1145  return oRder;
1146 }
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 1178 of file DataStructures.hpp.

1178 { 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 1246 of file DataStructures.hpp.

1246 { 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 1385 of file DataStructures.hpp.

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

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

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

1415  {
1416  return getVectorDiffN<DIM0, DIM1>(bAse, dof, gg);
1417 }
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

Definition at line 1364 of file DataStructures.hpp.

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

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

1379  {
1380  return getVectorN<DIM>(bAse, gg);
1381 }
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:501
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:508
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:74
static const double eps

Member Data Documentation

◆ bAse

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

Field approximation base.

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

◆ bbAlphaInducesByOrder

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

Definition at line 1005 of file DataStructures.hpp.

◆ bbDiffN

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

Definition at line 996 of file DataStructures.hpp.

◆ bbDiffNByOrder

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

Definition at line 1003 of file DataStructures.hpp.

◆ bbFieldName

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

field name

Definition at line 993 of file DataStructures.hpp.

◆ bbN

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

Definition at line 995 of file DataStructures.hpp.

◆ bbNByOrder

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

Definition at line 1001 of file DataStructures.hpp.

◆ bbNodeOrder

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

order of nodes

Definition at line 994 of file DataStructures.hpp.

◆ diffN

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

Derivatives of base functions.

Definition at line 991 of file DataStructures.hpp.

◆ dOfs

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

DoFs on entity.

Definition at line 987 of file DataStructures.hpp.

◆ fieldData

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

Field data on entity.

Definition at line 988 of file DataStructures.hpp.

◆ iNdices

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

Global indices on entity.

Definition at line 985 of file DataStructures.hpp.

◆ localIndices

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

Local indices on entity.

Definition at line 986 of file DataStructures.hpp.

◆ MaxBernsteinBezierOrder

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

Definition at line 964 of file DataStructures.hpp.

◆ N

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

Base functions.

Definition at line 989 of file DataStructures.hpp.

◆ oRder

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

Entity order.

Definition at line 982 of file DataStructures.hpp.

◆ sEnse

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

Entity sense (orientation)

Definition at line 981 of file DataStructures.hpp.

◆ sPace

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

Entity space.

Definition at line 983 of file DataStructures.hpp.

◆ swapBaseDiffNPtr

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

Definition at line 1009 of file DataStructures.hpp.

◆ swapBaseNPtr

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

Definition at line 1008 of file DataStructures.hpp.


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