v0.8.23
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...
 
boost::shared_ptr< MatrixDoubleN [LASTBASE]
 Base functions. More...
 
boost::shared_ptr< MatrixDoublediffN [LASTBASE]
 Derivatives of base functions. More...
 

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 ()
 
virtual ~EntData ()
 

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

virtual const MatrixDoublegetN (const FieldApproximationBase base) const
 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...
 
const MatrixDoublegetN () const
 
virtual const MatrixDoublegetDiffN (const FieldApproximationBase base) const
 get derivatives of base functions More...
 
const MatrixDoublegetDiffN () const
 
MatrixDoublegetN (const FieldApproximationBase base)
 Get base functions. More...
 
MatrixDoublegetN ()
 Get base functions. More...
 
MatrixDoublegetDiffN (const FieldApproximationBase base)
 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)
 

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
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, hello_world.cpp, lorentz_force.cpp, mesh_smoothing.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 ( )

Definition at line 32 of file DataStructures.cpp.

33  : sEnse(0), oRder(0), bAse(NOBASE) {
34  for (int b = 0; b != LASTBASE;++b) {
35  N[b].reset(new MatrixDouble());
36  diffN[b].reset(new MatrixDouble());
37  }
38 }
boost::shared_ptr< MatrixDouble > N[LASTBASE]
Base functions.
ApproximationOrder oRder
Entity order.
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:77
boost::shared_ptr< MatrixDouble > diffN[LASTBASE]
Derivatives of base functions.
FieldApproximationBase bAse
Field approximation base.
int sEnse
Entity sense (orientation)

◆ ~EntData()

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

Definition at line 58 of file DataStructures.hpp.

58 {}

Member Function Documentation

◆ getBase()

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

Get approximation base.

Returns
Approximation base

Definition at line 212 of file DataStructures.hpp.

212 { return bAse; }
FieldApproximationBase bAse
Field approximation base.

◆ getDataOrder()

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

Definition at line 104 of file DataStructures.hpp.

104 { return oRder; }
ApproximationOrder oRder
Entity order.

◆ getDiffN() [1/8]

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

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 that for node element this function make no sense.

Tonsorial base functions: 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 301 of file DataStructures.hpp.

301  {
302  return *(getDiffNSharedPtr(base));
303  }
virtual boost::shared_ptr< MatrixDouble > & getDiffNSharedPtr(const FieldApproximationBase base)

◆ getDiffN() [2/8]

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

Definition at line 305 of file DataStructures.hpp.

305 { return getDiffN(bAse); }
const MatrixDouble & getDiffN() const
FieldApproximationBase bAse
Field approximation base.

◆ getDiffN() [3/8]

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

Get derivatives of base functions.

Parameters
baseApproximation base
Returns
Error code

Definition at line 331 of file DataStructures.hpp.

331  {
332  return *(getDiffNSharedPtr(base));
333  }
virtual boost::shared_ptr< MatrixDouble > & getDiffNSharedPtr(const FieldApproximationBase base)

◆ getDiffN() [4/8]

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

Get derivatives of base functions.

It assumed that approximation base for given field is known and stored in this data structure

Returns
Error code

Definition at line 343 of file DataStructures.hpp.

343 { return getDiffN(bAse); }
const MatrixDouble & getDiffN() const
FieldApproximationBase bAse
Field approximation base.

◆ getDiffN() [5/8]

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

366  {
367  // FIXME: That is bug, it will not work if number of integration pts is
368  // equal to number of nodes on entity. User who not implementing low level
369  // DataOperator will not experience this.
370  if (getN(base).size1() == getDiffN(base).size1()) {
371  int size = getN(base).size2();
372  int dim = getDiffN(base).size2() / size;
373  double *data = &getDiffN(base)(gg, 0);
374  return MatrixAdaptor(
375  getN(base).size2(), dim,
376  ublas::shallow_array_adaptor<double>(getDiffN(base).size2(), data));
377  } else {
378  // in some cases, f.e. for derivatives of nodal base functions at only
379  // one gauss point is needed
380  return MatrixAdaptor(
381  getN(base).size1(), getN(base).size2(),
382  ublas::shallow_array_adaptor<double>(getDiffN(base).data().size(),
383  &getDiffN(base).data()[0]));
384  }
385  }
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition: Types.hpp:121
const MatrixDouble & getDiffN() const

◆ getDiffN() [6/8]

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

394  {
395  return getDiffN(bAse, gg);
396  }
const MatrixDouble & getDiffN() const
FieldApproximationBase bAse
Field approximation base.

◆ getDiffN() [7/8]

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

449  {
450  // FIXME: That is bug, it will not work if number of integration pts is
451  // equal to number of nodes on entity. User who not implementing low level
452  // DataOperator will not experience this.
453  if (getN(base).size1() == getDiffN(base).size1()) {
454  (void)getN(base)(gg,
455  nb_base_functions -
456  1); // throw error if nb_base_functions is to big
457  int dim = getDiffN(base).size2() / getN(base).size2();
458  double *data = &getDiffN(base)(gg, 0);
459  return MatrixAdaptor(nb_base_functions, dim,
460  ublas::shallow_array_adaptor<double>(
461  dim * nb_base_functions, data));
462  } else {
463  // in some cases, f.e. for derivatives of nodal base functions only one
464  // gauss point is needed
465  return MatrixAdaptor(
466  getN(base).size1(), getN(base).size2(),
467  ublas::shallow_array_adaptor<double>(getDiffN(base).data().size(),
468  &getDiffN(base).data()[0]));
469  }
470  }
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition: Types.hpp:121
const MatrixDouble & getDiffN() const

◆ getDiffN() [8/8]

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

484  {
485  return getDiffN(bAse, gg, nb_base_functions);
486  }
const MatrixDouble & getDiffN() const
FieldApproximationBase bAse
Field approximation base.

◆ getDiffNSharedPtr() [1/2]

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

240  {
241  return diffN[base];
242  }
boost::shared_ptr< MatrixDouble > diffN[LASTBASE]
Derivatives of base functions.

◆ getDiffNSharedPtr() [2/2]

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

248  {
249  return diffN[base];
250  }
boost::shared_ptr< MatrixDouble > diffN[LASTBASE]
Derivatives of base functions.

◆ getFieldData() [1/2]

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

get dofs values

Examples
forces_and_sources_testing_flat_prism_element.cpp, lorentz_force.cpp, and mesh_smoothing.cpp.

Definition at line 115 of file DataStructures.hpp.

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

◆ getFieldData() [2/2]

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

Definition at line 131 of file DataStructures.hpp.

131 { return fieldData; }
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 118 of file DataStructures.hpp.

118  {
119  unsigned int size = 0;
120  if (fieldData.size()) {
121  size = dOfs[0]->getOrderNbDofs(order) * dOfs[0]->getNbOfCoeffs();
122  size = size < fieldData.size() ? size : fieldData.size();
123  }
124  double *data = &*fieldData.data().begin();
125  return getVectorAdaptor(data, size);
126  }
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

Definition at line 129 of file DataStructures.hpp.

129 { return dOfs; }

◆ getFieldDofs() [2/2]

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

Definition at line 200 of file DataStructures.hpp.

200 { 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> >

Definition at line 248 of file DataStructures.cpp.

248  {
249  if (dOfs[0]->getNbOfCoeffs() != 1) {
250  std::stringstream s;
251  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
252  s << " but expected scalar field, tensor of rank 0";
253  THROW_MESSAGE(s.str());
254  }
256  &*fieldData.data().begin());
257 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619
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
Remodeling.cpp, and simple_elasticity.cpp.

Definition at line 598 of file DataStructures.hpp.

598  {
599  double *ptr = &*getN(base).data().begin();
601  };

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

611  {
612  return getFTensor0N(bAse);
613  };
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 633 of file DataStructures.hpp.

633  {
634  double *ptr = &getN(base)(0, bb);
635  return FTensor::Tensor0<double *>(ptr, getN(base).size2());
636  };

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

648  {
649  return getFTensor0N(bAse, bb);
650  };
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 671 of file DataStructures.hpp.

672  {
673  double *ptr = &getN(base)(gg, bb);
675  };

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

687  {
688  return getFTensor0N(bAse, gg, bb);
689  };
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 FieldApproximationBase  base)

◆ getFTensor1DiffN() [2/26]

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

◆ getFTensor1DiffN() [3/26]

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

◆ getFTensor1DiffN() [4/26]

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

◆ getFTensor1DiffN() [5/26]

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

◆ getFTensor1DiffN() [6/26]

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

◆ getFTensor1DiffN() [7/26]

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

◆ getFTensor1DiffN() [8/26]

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

◆ getFTensor1DiffN() [9/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 337 of file DataStructures.cpp.

338  {
339  double *ptr = &*getDiffN(base).data().begin();
340  return FTensor::Tensor1<double *, 2>(ptr, &ptr[1], 2);
341 }
const MatrixDouble & getDiffN() const

◆ getFTensor1DiffN() [10/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 296 of file DataStructures.cpp.

297  {
298  double *ptr = &*getDiffN(base).data().begin();
299  return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2], 3);
300 }
const MatrixDouble & getDiffN() const

◆ getFTensor1DiffN() [11/26]

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

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

Definition at line 307 of file DataStructures.cpp.

307  {
308  return getFTensor1DiffN<3>(bAse);
309 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [12/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 316 of file DataStructures.cpp.

317  {
318  double *ptr = &*getDiffN(base).data().begin();
320  &ptr[3 * bb], &ptr[3 * bb + 1], &ptr[3 * bb + 2], getDiffN(base).size2());
321 }
const MatrixDouble & getDiffN() const

◆ getFTensor1DiffN() [13/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 328 of file DataStructures.cpp.

328  {
329  return getFTensor1DiffN<3>(bAse, bb);
330 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [14/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 357 of file DataStructures.cpp.

358  {
359  double *ptr = &*getDiffN(base).data().begin();
360  return FTensor::Tensor1<double *, 2>(&ptr[2 * bb], &ptr[2 * bb + 1],
361  getDiffN(base).size1());
362 }
const MatrixDouble & getDiffN() const

◆ getFTensor1DiffN() [15/26]

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

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

Definition at line 348 of file DataStructures.cpp.

348  {
349  return getFTensor1DiffN<2>(bAse);
350 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [16/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 369 of file DataStructures.cpp.

369  {
370  return getFTensor1DiffN<2>(bAse, bb);
371 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [17/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 388 of file DataStructures.cpp.

389  {
390  double *ptr = &getDiffN(base)(gg, 3 * bb);
391  return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2], 3);
392 }
const MatrixDouble & getDiffN() const

◆ getFTensor1DiffN() [18/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 420 of file DataStructures.cpp.

421  {
422  return getFTensor1DiffN<2>(bAse, gg, bb);
423 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [19/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 409 of file DataStructures.cpp.

410  {
411  double *ptr = &getDiffN(base)(gg, 2 * bb);
412  return FTensor::Tensor1<double *, 2>(ptr, &ptr[1], 2);
413 }
const MatrixDouble & getDiffN() const

◆ getFTensor1DiffN() [20/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 399 of file DataStructures.cpp.

400  {
401  return getFTensor1DiffN<3>(bAse, gg, bb);
402 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [21/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
Remodeling.cpp, and simple_elasticity.cpp.

Definition at line 261 of file DataStructures.cpp.

262  {
263  std::stringstream s;
264  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
265  THROW_MESSAGE(s.str());
267 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619

◆ getFTensor1DiffN() [22/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 271 of file DataStructures.cpp.

271  {
272  return getFTensor1DiffN<Tensor_Dim>(bAse);
273 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [23/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 277 of file DataStructures.cpp.

278  {
279  std::stringstream s;
280  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
281  THROW_MESSAGE(s.str());
283 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619

◆ getFTensor1DiffN() [24/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 287 of file DataStructures.cpp.

287  {
288  return getFTensor1DiffN<Tensor_Dim>(bAse, bb);
289 }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor1DiffN() [25/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 375 of file DataStructures.cpp.

376  {
377  std::stringstream s;
378  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
379  THROW_MESSAGE(s.str());
381 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619

◆ getFTensor1DiffN() [26/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)

◆ getFTensor1FieldData() [1/5]

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

◆ getFTensor1FieldData() [2/5]

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

◆ getFTensor1FieldData() [3/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 146 of file DataStructures.hpp.

146  {
147  std::stringstream s;
148  s << "Not implemented for this dimension dim = " << Tensor_Dim;
149  THROW_MESSAGE(s.str());
150  }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619

◆ getFTensor1FieldData() [4/5]

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

Definition at line 190 of file DataStructures.cpp.

190  {
191  if (dOfs[0]->getNbOfCoeffs() != 3) {
192  std::stringstream s;
193  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
194  s << " but you ask for tensor rank 1 dimension 3";
195  THROW_MESSAGE(s.str());
196  }
197  double *ptr = &*fieldData.data().begin();
198  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(ptr, &ptr[1],
199  &ptr[2]);
200 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619
VectorDouble fieldData
Field data on entity.

◆ getFTensor1FieldData() [5/5]

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

Definition at line 204 of file DataStructures.cpp.

204  {
205  if (dOfs[0]->getNbOfCoeffs() != 2) {
206  std::stringstream s;
207  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
208  s << " but you ask for tensor rank 1 dimension 3";
209  THROW_MESSAGE(s.str());
210  }
211  double *ptr = &*fieldData.data().begin();
212  return FTensor::Tensor1<FTensor::PackPtr<double *, 2>, 2>(ptr, &ptr[1]);
213 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619
VectorDouble fieldData
Field data on entity.

◆ getFTensor1N() [1/6]

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

Definition at line 478 of file DataStructures.cpp.

479  {
480  double *t_n_ptr = &*getN(base).data().begin();
481  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(t_n_ptr, // HVEC0
482  &t_n_ptr[HVEC1],
483  &t_n_ptr[HVEC2]);
484 }

◆ getFTensor1N() [2/6]

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

Definition at line 488 of file DataStructures.cpp.

489  {
490  double *t_n_ptr = &getN(base)(gg, 3 * bb);
491  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(t_n_ptr, // HVEC0
492  &t_n_ptr[HVEC1],
493  &t_n_ptr[HVEC2]);
494 }

◆ 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;
}
}

Definition at line 433 of file DataStructures.cpp.

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

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

869  {
870  return getFTensor1N<Tensor_Dim>(bAse);
871  }
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 443 of file DataStructures.cpp.

445  {
446  std::stringstream s;
447  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
448  THROW_MESSAGE(s.str());
450 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619

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

943  {
944  return getFTensor1N<Tensor_Dim>(bAse, gg, bb);
945  }
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 
)

◆ getFTensor2DiffN() [2/10]

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

◆ getFTensor2DiffN() [3/10]

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

Definition at line 498 of file DataStructures.cpp.

499  {
500  double *t_diff_n_ptr = &*getDiffN(base).data().begin();
502  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC0_2],
503  &t_diff_n_ptr[HVEC1_0], &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC1_2],
504  &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1], &t_diff_n_ptr[HVEC2_2]);
505 }
const MatrixDouble & getDiffN() const

◆ getFTensor2DiffN() [4/10]

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

Definition at line 520 of file DataStructures.cpp.

521  {
522  double *t_diff_n_ptr = &*getDiffN(base).data().begin();
524  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC1_0],
525  &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC2_0],
526  &t_diff_n_ptr[HVEC2_1]);
527 }
const MatrixDouble & getDiffN() const

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

510  {
511  double *t_diff_n_ptr = &getDiffN(base)(gg, 9 * bb);
513  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC0_2],
514  &t_diff_n_ptr[HVEC1_0], &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC1_2],
515  &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1], &t_diff_n_ptr[HVEC2_2]);
516 }
const MatrixDouble & getDiffN() const

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

532  {
533  double *t_diff_n_ptr = &getDiffN(base)(gg, 6 * bb);
535  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC1_0],
536  &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1]);
537 }
const MatrixDouble & getDiffN() const

◆ 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 ( FieldApproximationBase  base)

Get derivatives of base functions for Hdiv space.

Definition at line 455 of file DataStructures.cpp.

456  {
457  std::stringstream s;
458  s << "Template for tensor dimension " << Tensor_Dim0 << "x" << Tensor_Dim1
459  << " not implemented";
460  THROW_MESSAGE(s.str());
462 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619

◆ 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 ( FieldApproximationBase  base,
const int  gg,
const int  bb 
)

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

Definition at line 467 of file DataStructures.cpp.

468  {
469  std::stringstream s;
470  s << "Template for tensor dimension " << Tensor_Dim0 << "x" << Tensor_Dim1
471  << " not implemented";
472  THROW_MESSAGE(s.str());
474 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619

◆ getFTensor2DiffN() [9/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 895 of file DataStructures.hpp.

895  {
896  return getFTensor2DiffN<Tensor_Dim0, Tensor_Dim1>(bAse);
897  }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor2DiffN() [10/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 906 of file DataStructures.hpp.

906  {
907  return getFTensor2DiffN<Tensor_Dim0, Tensor_Dim1>(bAse, gg, bb);
908  }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor2FieldData() [1/3]

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

◆ getFTensor2FieldData() [2/3]

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

Definition at line 217 of file DataStructures.cpp.

217  {
218  if (dOfs[0]->getNbOfCoeffs() != 9) {
219  std::stringstream s;
220  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
221  s << " but you ask for tensor rank 2 dimensions 3 by 3 so 9 coefficients "
222  "is expected";
223  THROW_MESSAGE(s.str());
224  }
225  double *ptr = &*fieldData.data().begin();
227  ptr, &ptr[1], &ptr[2], &ptr[3], &ptr[4], &ptr[5], &ptr[6], &ptr[7],
228  &ptr[8]);
229 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619
VectorDouble fieldData
Field data on entity.

◆ getFTensor2FieldData() [3/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 166 of file DataStructures.hpp.

166  {
167  std::stringstream s;
168  s << "Not implemented for this dimension dim0 = " << Tensor_Dim0;
169  s << " and dim1 " << Tensor_Dim1;
170  THROW_MESSAGE(s.str());
171  }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619

◆ getFTensor2N() [1/6]

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

Definition at line 553 of file DataStructures.cpp.

554  {
555  double *t_n_ptr = &*(getN(base).data().begin());
557 
558  &t_n_ptr[HVEC0], &t_n_ptr[HVEC1], &t_n_ptr[HVEC2],
559 
560  &t_n_ptr[3 + HVEC0], &t_n_ptr[3 + HVEC1], &t_n_ptr[3 + HVEC2],
561 
562  &t_n_ptr[6 + HVEC0], &t_n_ptr[6 + HVEC1], &t_n_ptr[6 + HVEC2]
563 
564  );
565 }

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

583  {
584  double *t_n_ptr = &getN(base)(gg, 9 * bb);
586 
587  &t_n_ptr[HVEC0], &t_n_ptr[HVEC1], &t_n_ptr[HVEC2],
588 
589  &t_n_ptr[3 + HVEC0], &t_n_ptr[3 + HVEC1], &t_n_ptr[3 + HVEC2],
590 
591  &t_n_ptr[6 + HVEC0], &t_n_ptr[6 + HVEC1], &t_n_ptr[6 + HVEC2]
592 
593  );
594 }

◆ 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;
}
}

Definition at line 542 of file DataStructures.cpp.

542  {
543  std::stringstream s;
544  s << "Template for tensor dimension " << Tensor_Dim0 << ", " << Tensor_Dim1
545  << " not implemented";
546  THROW_MESSAGE(s.str());
548  Tensor_Dim0, Tensor_Dim1>();
549 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619

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

1000  {
1001  return getFTensor2N<Tensor_Dim0, Tensor_Dim1>(bAse);
1002  }
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 570 of file DataStructures.cpp.

571  {
572  std::stringstream s;
573  s << "Template for tensor dimension " << Tensor_Dim0 << ", " << Tensor_Dim1
574  << " not implemented";
575  THROW_MESSAGE(s.str());
577  Tensor_Dim0, Tensor_Dim1>();
578 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619

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

1057  {
1058  return getFTensor2N<Tensor_Dim0, Tensor_Dim1>(bAse, gg, bb);
1059  }
FieldApproximationBase bAse
Field approximation base.

◆ getFTensor2SymmetricFieldData() [1/3]

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

◆ getFTensor2SymmetricFieldData() [2/3]

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

Definition at line 233 of file DataStructures.cpp.

233  {
234  if (dOfs[0]->getNbOfCoeffs() != 6) {
235  std::stringstream s;
236  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
237  s << " but you ask for symmetric tensor rank 2 dimensions 3 by 3 so 6 "
238  "coefficients "
239  "is expected";
240  THROW_MESSAGE(s.str());
241  }
242  double *ptr = &*fieldData.data().begin();
244  ptr, &ptr[1], &ptr[2], &ptr[3], &ptr[4], &ptr[5]);
245 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619
VectorDouble fieldData
Field data on entity.

◆ getFTensor2SymmetricFieldData() [3/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 187 of file DataStructures.hpp.

187  {
188  std::stringstream s;
189  s << "Not implemented for this dimension dim = " << Tensor_Dim;
190  THROW_MESSAGE(s.str());
191  }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619

◆ getIndices() [1/2]

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

Get global indices of dofs on entity.

Examples
forces_and_sources_testing_users_base.cpp, hello_world.cpp, Remodeling.cpp, and simple_elasticity.cpp.

Definition at line 74 of file DataStructures.hpp.

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

◆ getIndices() [2/2]

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

Definition at line 105 of file DataStructures.hpp.

105 { 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 77 of file DataStructures.hpp.

77  {
78  unsigned int size = 0;
79  if (iNdices.size()) {
80  size = dOfs[0]->getOrderNbDofs(order) * dOfs[0]->getNbOfCoeffs();
81  size = size < iNdices.size() ? size : iNdices.size();
82  }
83  int *data = &*iNdices.data().begin();
84  return VectorIntAdaptor(size,
85  ublas::shallow_array_adaptor<int>(size, data));
86  }
VectorInt iNdices
Global indices on entity.
VectorShallowArrayAdaptor< int > VectorIntAdaptor
Definition: Types.hpp:105

◆ getLocalIndices() [1/2]

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

get local indices of dofs on entity

Examples
Remodeling.cpp.

Definition at line 89 of file DataStructures.hpp.

89 { return localIndices; }
VectorInt localIndices
Local indices on entity.

◆ getLocalIndices() [2/2]

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

Definition at line 106 of file DataStructures.hpp.

106 { return localIndices; }
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 92 of file DataStructures.hpp.

92  {
93  unsigned int size = 0;
94  if (localIndices.size()) {
95  size = dOfs[0]->getOrderNbDofs(order) * dOfs[0]->getNbOfCoeffs();
96  size = size < localIndices.size() ? size : localIndices.size();
97  }
98  int *data = &*localIndices.data().begin();
99  return VectorIntAdaptor(size,
100  ublas::shallow_array_adaptor<int>(size, data));
101  }
VectorShallowArrayAdaptor< int > VectorIntAdaptor
Definition: Types.hpp:105
VectorInt localIndices
Local indices on entity.

◆ getN() [1/8]

virtual const MatrixDouble& MoFEM::DataForcesAndSourcesCore::EntData::getN ( const FieldApproximationBase  base) const
virtual

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 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
EshelbianOperators.cpp, forces_and_sources_testing_edge_element.cpp, forces_and_sources_testing_users_base.cpp, Remodeling.cpp, and simple_elasticity.cpp.

Definition at line 268 of file DataStructures.hpp.

268  {
269  return *(getNSharedPtr(base));
270  }
virtual boost::shared_ptr< MatrixDouble > & getNSharedPtr(const FieldApproximationBase base)

◆ getN() [2/8]

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

Definition at line 272 of file DataStructures.hpp.

272 { return getN(bAse); }
FieldApproximationBase bAse
Field approximation base.

◆ getN() [3/8]

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

Get base functions.

Parameters
baseApproximation base
Returns
Error code

Definition at line 312 of file DataStructures.hpp.

312  {
313  return *(getNSharedPtr(base));
314  }
virtual boost::shared_ptr< MatrixDouble > & getNSharedPtr(const FieldApproximationBase base)

◆ getN() [4/8]

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

Get base functions.

It assumed that approximation base for given field is known and stored in this data structure

Returns
Error code

Definition at line 324 of file DataStructures.hpp.

324 { return getN(bAse); }
FieldApproximationBase bAse
Field approximation base.

◆ getN() [5/8]

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

get base functions at Gauss pts

Definition at line 346 of file DataStructures.hpp.

347  {
348  int size = getN(base).size2();
349  double *data = &getN(base)(gg, 0);
350  return VectorAdaptor(size,
351  ublas::shallow_array_adaptor<double>(size, data));
352  }
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition: Types.hpp:104

◆ getN() [6/8]

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

get base functions at Gauss pts

Definition at line 355 of file DataStructures.hpp.

355 { return getN(bAse, gg); }
FieldApproximationBase bAse
Field approximation base.

◆ getN() [7/8]

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

411  {
412  (void)getN()(gg, nb_base_functions -
413  1); // throw error if nb_base_functions is to big
414  double *data = &getN(base)(gg, 0);
415  return VectorAdaptor(
416  nb_base_functions,
417  ublas::shallow_array_adaptor<double>(nb_base_functions, data));
418  }
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition: Types.hpp:104

◆ getN() [8/8]

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

431  {
432  return getN(bAse, gg, nb_base_functions);
433  }
FieldApproximationBase bAse
Field approximation base.

◆ getNSharedPtr() [1/2]

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

224  {
225  return N[base];
226  }
boost::shared_ptr< MatrixDouble > N[LASTBASE]
Base functions.

◆ getNSharedPtr() [2/2]

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

232  {
233  return N[base];
234  }
boost::shared_ptr< MatrixDouble > N[LASTBASE]
Base functions.

◆ getOrder()

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

get approximation order

Definition at line 71 of file DataStructures.hpp.

71 { return oRder; }
ApproximationOrder oRder
Entity order.

◆ getSense() [1/2]

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

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

◆ getSense() [2/2]

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

Definition at line 103 of file DataStructures.hpp.

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

◆ getSpace()

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

Get field space.

Returns
Field space

Definition at line 218 of file DataStructures.hpp.

218 { 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 534 of file DataStructures.hpp.

535  {
536  if (PetscUnlikely(getDiffN(base).size2() % (DIM0*DIM1))) {
537  THROW_MESSAGE("Wrong dimension");
538  }
539 
540  const int nb_base_functions = getN(base).size2() / (DIM0 * DIM1);
541  double *data = &getN(base)(gg, 0);
542  return MatrixAdaptor(nb_base_functions, DIM0 * DIM1,
543  ublas::shallow_array_adaptor<double>(
544  DIM0 * DIM1 * nb_base_functions, data));
545  }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition: Types.hpp:121
const MatrixDouble & getDiffN() const

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

554  {
555  return getVectorDiffN<DIM0,DIM1>(bAse, gg);
556  }
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 566 of file DataStructures.hpp.

567  {
568  double *data = &getDiffN(base)(gg, DIM0 * DIM1 * dof);
569  return MatrixAdaptor(
570  DIM0, DIM1, ublas::shallow_array_adaptor<double>(DIM0 * DIM1, data));
571  }
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition: Types.hpp:121
const MatrixDouble & getDiffN() const

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

580  {
581  return getVectorDiffN<DIM0,DIM1>(bAse, dof, gg);
582  }
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 502 of file DataStructures.hpp.

503  {
504  if (PetscUnlikely(getN(base).size2() % DIM)) {
505  THROW_MESSAGE("Wrong dimension");
506  }
507 
508  const int nb_base_functions = getN(base).size2() / DIM;
509  double *data = &getN(base)(gg, 0);
510  return MatrixAdaptor(
511  nb_base_functions, DIM,
512  ublas::shallow_array_adaptor<double>(DIM * nb_base_functions, data));
513  }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:619
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition: Types.hpp:121

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

522  {
523  return getVectorN<DIM>(bAse, gg);
524  }
FieldApproximationBase bAse
Field approximation base.

◆ resetFieldDependentData()

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

Reset data associated with particular field name

Returns
error code

Definition at line 1074 of file DataStructures.hpp.

1074  {
1076  sPace = NOSPACE;
1077  bAse = NOBASE;
1078  iNdices.resize(0, false);
1079  localIndices.resize(0, false);
1080  dOfs.resize(0, false);
1081  fieldData.resize(0, false);
1083  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:500
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:507
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 136 of file DataStructures.cpp.

137  {
138  os << "sEnse: " << e.getSense() << std::endl
139  << "oRder: " << e.getOrder() << std::endl
140  << "global indices: " << e.getIndices() << std::endl
141  << "local indices: " << e.getLocalIndices() << std::endl;
142  os.precision(2);
143  os << "fieldData: " << std::fixed << e.getFieldData() << std::endl;
144  MatrixDouble base = e.getN();
145  MatrixDouble diff_base = e.getDiffN();
146  const double eps = 1e-6;
147  for (unsigned int ii = 0; ii != base.size1(); ii++) {
148  for (unsigned int jj = 0; jj != base.size2(); jj++) {
149  if (fabs(base(ii, jj)) < eps)
150  base(ii, jj) = 0;
151  }
152  }
153  for (unsigned int ii = 0; ii != diff_base.size1(); ii++) {
154  for (unsigned int jj = 0; jj != diff_base.size2(); jj++) {
155  if (fabs(diff_base(ii, jj)) < eps)
156  diff_base(ii, jj) = 0;
157  }
158  }
159  os << "N: " << std::fixed << base << std::endl
160  << "diffN: " << std::fixed << diff_base;
161  return os;
162 }
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:77
static const double eps

Member Data Documentation

◆ bAse

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

Field approximation base.

Definition at line 1091 of file DataStructures.hpp.

◆ diffN

boost::shared_ptr<MatrixDouble> MoFEM::DataForcesAndSourcesCore::EntData::diffN[LASTBASE]
protected

Derivatives of base functions.

Definition at line 1098 of file DataStructures.hpp.

◆ dOfs

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

DoFs on entity.

Definition at line 1094 of file DataStructures.hpp.

◆ fieldData

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

Field data on entity.

Definition at line 1095 of file DataStructures.hpp.

◆ iNdices

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

Global indices on entity.

Definition at line 1092 of file DataStructures.hpp.

◆ localIndices

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

Local indices on entity.

Definition at line 1093 of file DataStructures.hpp.

◆ N

boost::shared_ptr<MatrixDouble> MoFEM::DataForcesAndSourcesCore::EntData::N[LASTBASE]
protected

Base functions.

Definition at line 1096 of file DataStructures.hpp.

◆ oRder

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

Entity order.

Definition at line 1089 of file DataStructures.hpp.

◆ sEnse

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

Entity sense (orientation)

Definition at line 1088 of file DataStructures.hpp.

◆ sPace

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

Entity space.

Definition at line 1090 of file DataStructures.hpp.


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