v0.8.16
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:
forces_and_sources_testing_edge_element.cpp, forces_and_sources_testing_users_base.cpp, hello_world.cpp, mesh_smoothing.cpp, simple_elasticity.cpp, and simple_interface.cpp.

Definition at line 213 of file DataStructures.hpp.

Constructor & Destructor Documentation

◆ EntData()

MoFEM::DataForcesAndSourcesCore::EntData::EntData ( )

Definition at line 131 of file DataStructures.cpp.

132  : sEnse(0), oRder(0), bAse(NOBASE) {
133  for (int b = 0; b != LASTBASE;++b) {
134  N[b].reset(new MatrixDouble());
135  diffN[b].reset(new MatrixDouble());
136  }
137 }
boost::shared_ptr< MatrixDouble > N[LASTBASE]
Base functions.
ApproximationOrder oRder
Entity order.
boost::shared_ptr< MatrixDouble > diffN[LASTBASE]
Derivatives of base functions.
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Common.hpp:212
FieldApproximationBase bAse
Field approximation base.
int sEnse
Entity sense (orientation)

◆ ~EntData()

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

Definition at line 220 of file DataStructures.hpp.

220 {}

Member Function Documentation

◆ getBase()

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

Get approximation base.

Returns
Approximation base

Definition at line 374 of file DataStructures.hpp.

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

◆ getDataOrder()

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

Definition at line 266 of file DataStructures.hpp.

266 { 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 463 of file DataStructures.hpp.

463  {
464  return *(getDiffNSharedPtr(base));
465  }
virtual boost::shared_ptr< MatrixDouble > & getDiffNSharedPtr(const FieldApproximationBase base)

◆ getDiffN() [2/8]

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

Definition at line 467 of file DataStructures.hpp.

467 { 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 493 of file DataStructures.hpp.

493  {
494  return *(getDiffNSharedPtr(base));
495  }
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 505 of file DataStructures.hpp.

505 { 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 527 of file DataStructures.hpp.

528  {
529  // FIXME: That is bug, it will not work if number of integration pts is
530  // equal to number of nodes on entity. User who not implementing low level
531  // DataOperator will not experience this.
532  if (getN(base).size1() == getDiffN(base).size1()) {
533  int size = getN(base).size2();
534  int dim = getDiffN(base).size2() / size;
535  double *data = &getDiffN(base)(gg, 0);
536  return MatrixAdaptor(
537  getN(base).size2(), dim,
538  ublas::shallow_array_adaptor<double>(getDiffN(base).size2(), data));
539  } else {
540  // in some cases, f.e. for derivatives of nodal base functions at only
541  // one gauss point is needed
542  return MatrixAdaptor(
543  getN(base).size1(), getN(base).size2(),
544  ublas::shallow_array_adaptor<double>(getDiffN(base).data().size(),
545  &getDiffN(base).data()[0]));
546  }
547  }
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Definition: Common.hpp:266
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 556 of file DataStructures.hpp.

556  {
557  return getDiffN(bAse, gg);
558  }
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 609 of file DataStructures.hpp.

611  {
612  // FIXME: That is bug, it will not work if number of integration pts is
613  // equal to number of nodes on entity. User who not implementing low level
614  // DataOperator will not experience this.
615  if (getN(base).size1() == getDiffN(base).size1()) {
616  (void)getN(base)(gg,
617  nb_base_functions -
618  1); // throw error if nb_base_functions is to big
619  int dim = getDiffN(base).size2() / getN(base).size2();
620  double *data = &getDiffN(base)(gg, 0);
621  return MatrixAdaptor(nb_base_functions, dim,
622  ublas::shallow_array_adaptor<double>(
623  dim * nb_base_functions, data));
624  } else {
625  // in some cases, f.e. for derivatives of nodal base functions only one
626  // gauss point is needed
627  return MatrixAdaptor(
628  getN(base).size1(), getN(base).size2(),
629  ublas::shallow_array_adaptor<double>(getDiffN(base).data().size(),
630  &getDiffN(base).data()[0]));
631  }
632  }
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Definition: Common.hpp:266
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 645 of file DataStructures.hpp.

646  {
647  return getDiffN(bAse, gg, nb_base_functions);
648  }
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 402 of file DataStructures.hpp.

402  {
403  return diffN[base];
404  }
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 410 of file DataStructures.hpp.

410  {
411  return diffN[base];
412  }
boost::shared_ptr< MatrixDouble > diffN[LASTBASE]
Derivatives of base functions.

◆ getFieldData() [1/2]

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

get dofs values

Examples:
mesh_smoothing.cpp.

Definition at line 277 of file DataStructures.hpp.

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

◆ getFieldData() [2/2]

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

Definition at line 293 of file DataStructures.hpp.

293 { 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 280 of file DataStructures.hpp.

280  {
281  unsigned int size = 0;
282  if (fieldData.size()) {
283  size = dOfs[0]->getOrderNbDofs(order) * dOfs[0]->getNbOfCoeffs();
284  size = size < fieldData.size() ? size : fieldData.size();
285  }
286  double *data = &*fieldData.data().begin();
287  return getVectorAdaptor(data, size);
288  }
VectorDouble fieldData
Field data on entity.
auto getVectorAdaptor
Get Vector adaptor.
Definition: Common.hpp:256

◆ getFieldDofs() [1/2]

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

get dofs data stature FEDofEntity

Definition at line 291 of file DataStructures.hpp.

291 { return dOfs; }

◆ getFieldDofs() [2/2]

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

Definition at line 362 of file DataStructures.hpp.

362 { 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 347 of file DataStructures.cpp.

347  {
348  if (dOfs[0]->getNbOfCoeffs() != 1) {
349  std::stringstream s;
350  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
351  s << " but expected scalar field, tensor of rank 0";
352  THROW_MESSAGE(s.str());
353  }
355  &*fieldData.data().begin());
356 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602
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:
simple_elasticity.cpp.

Definition at line 760 of file DataStructures.hpp.

760  {
761  double *ptr = &*getN(base).data().begin();
763  };

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

773  {
774  return getFTensor0N(bAse);
775  };
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 795 of file DataStructures.hpp.

795  {
796  double *ptr = &getN(base)(0, bb);
797  return FTensor::Tensor0<double *>(ptr, getN(base).size2());
798  };

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

810  {
811  return getFTensor0N(bAse, bb);
812  };
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 833 of file DataStructures.hpp.

834  {
835  double *ptr = &getN(base)(gg, bb);
837  };

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

849  {
850  return getFTensor0N(bAse, gg, bb);
851  };
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 436 of file DataStructures.cpp.

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

396  {
397  double *ptr = &*getDiffN(base).data().begin();
398  return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2], 3);
399 }
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 406 of file DataStructures.cpp.

406  {
407  return getFTensor1DiffN<3>(bAse);
408 }
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 415 of file DataStructures.cpp.

416  {
417  double *ptr = &*getDiffN(base).data().begin();
419  &ptr[3 * bb], &ptr[3 * bb + 1], &ptr[3 * bb + 2], getDiffN(base).size2());
420 }
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 427 of file DataStructures.cpp.

427  {
428  return getFTensor1DiffN<3>(bAse, bb);
429 }
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 456 of file DataStructures.cpp.

457  {
458  double *ptr = &*getDiffN(base).data().begin();
459  return FTensor::Tensor1<double *, 2>(&ptr[2 * bb], &ptr[2 * bb + 1],
460  getDiffN(base).size1());
461 }
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 447 of file DataStructures.cpp.

447  {
448  return getFTensor1DiffN<2>(bAse);
449 }
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 468 of file DataStructures.cpp.

468  {
469  return getFTensor1DiffN<2>(bAse, bb);
470 }
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 487 of file DataStructures.cpp.

488  {
489  double *ptr = &getDiffN(base)(gg, 3 * bb);
490  return FTensor::Tensor1<double *, 3>(ptr, &ptr[1], &ptr[2], 3);
491 }
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 519 of file DataStructures.cpp.

520  {
521  return getFTensor1DiffN<2>(bAse, gg, bb);
522 }
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 508 of file DataStructures.cpp.

509  {
510  double *ptr = &getDiffN(base)(gg, 2 * bb);
511  return FTensor::Tensor1<double *, 2>(ptr, &ptr[1], 2);
512 }
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 498 of file DataStructures.cpp.

499  {
500  return getFTensor1DiffN<3>(bAse, gg, bb);
501 }
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:
simple_elasticity.cpp.

Definition at line 360 of file DataStructures.cpp.

361  {
362  std::stringstream s;
363  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
364  THROW_MESSAGE(s.str());
366 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602

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

370  {
371  return getFTensor1DiffN<Tensor_Dim>(bAse);
372 }
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 376 of file DataStructures.cpp.

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

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

386  {
387  return getFTensor1DiffN<Tensor_Dim>(bAse, bb);
388 }
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 474 of file DataStructures.cpp.

475  {
476  std::stringstream s;
477  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
478  THROW_MESSAGE(s.str());
480 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602

◆ 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 integration point.

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<>
FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3> MoFEM::DataForcesAndSourcesCore::EntData::getFTensor1FieldData ( )

Definition at line 289 of file DataStructures.cpp.

289  {
290  if (dOfs[0]->getNbOfCoeffs() != 3) {
291  std::stringstream s;
292  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
293  s << " but you ask for tensor rank 1 dimension 3";
294  THROW_MESSAGE(s.str());
295  }
296  double *ptr = &*fieldData.data().begin();
297  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(ptr, &ptr[1],
298  &ptr[2]);
299 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602
VectorDouble fieldData
Field data on entity.

◆ getFTensor1FieldData() [4/5]

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

Definition at line 303 of file DataStructures.cpp.

303  {
304  if (dOfs[0]->getNbOfCoeffs() != 2) {
305  std::stringstream s;
306  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
307  s << " but you ask for tensor rank 1 dimension 3";
308  THROW_MESSAGE(s.str());
309  }
310  double *ptr = &*fieldData.data().begin();
311  return FTensor::Tensor1<FTensor::PackPtr<double *, 2>, 2>(ptr, &ptr[1]);
312 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602
VectorDouble fieldData
Field data on entity.

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

308  {
309  std::stringstream s;
310  s << "Not implemented for this dimension dim = " << Tensor_Dim;
311  THROW_MESSAGE(s.str());
312  }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602

◆ getFTensor1N() [1/6]

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

Definition at line 577 of file DataStructures.cpp.

578  {
579  double *t_n_ptr = &*getN(base).data().begin();
580  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(t_n_ptr, // HVEC0
581  &t_n_ptr[HVEC1],
582  &t_n_ptr[HVEC2]);
583 }

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

588  {
589  double *t_n_ptr = &getN(base)(gg, 3 * bb);
590  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(t_n_ptr, // HVEC0
591  &t_n_ptr[HVEC1],
592  &t_n_ptr[HVEC2]);
593 }

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

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

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

1031  {
1032  return getFTensor1N<Tensor_Dim>(bAse);
1033  }
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 542 of file DataStructures.cpp.

544  {
545  std::stringstream s;
546  s << "Template for tensor dimension " << Tensor_Dim << " not implemented";
547  THROW_MESSAGE(s.str());
549 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602

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

1105  {
1106  return getFTensor1N<Tensor_Dim>(bAse, gg, bb);
1107  }
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 597 of file DataStructures.cpp.

598  {
599  double *t_diff_n_ptr = &*getDiffN(base).data().begin();
601  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC0_2],
602  &t_diff_n_ptr[HVEC1_0], &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC1_2],
603  &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1], &t_diff_n_ptr[HVEC2_2]);
604 }
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 619 of file DataStructures.cpp.

620  {
621  double *t_diff_n_ptr = &*getDiffN(base).data().begin();
623  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC1_0],
624  &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC2_0],
625  &t_diff_n_ptr[HVEC2_1]);
626 }
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 608 of file DataStructures.cpp.

609  {
610  double *t_diff_n_ptr = &getDiffN(base)(gg, 9 * bb);
612  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC0_2],
613  &t_diff_n_ptr[HVEC1_0], &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC1_2],
614  &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1], &t_diff_n_ptr[HVEC2_2]);
615 }
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 630 of file DataStructures.cpp.

631  {
632  double *t_diff_n_ptr = &getDiffN(base)(gg, 6 * bb);
634  t_diff_n_ptr, &t_diff_n_ptr[HVEC0_1], &t_diff_n_ptr[HVEC1_0],
635  &t_diff_n_ptr[HVEC1_1], &t_diff_n_ptr[HVEC2_0], &t_diff_n_ptr[HVEC2_1]);
636 }
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 554 of file DataStructures.cpp.

555  {
556  std::stringstream s;
557  s << "Template for tensor dimension " << Tensor_Dim0 << "x" << Tensor_Dim1
558  << " not implemented";
559  THROW_MESSAGE(s.str());
561 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602

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

567  {
568  std::stringstream s;
569  s << "Template for tensor dimension " << Tensor_Dim0 << "x" << Tensor_Dim1
570  << " not implemented";
571  THROW_MESSAGE(s.str());
573 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602

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

1057  {
1058  return getFTensor2DiffN<Tensor_Dim0, Tensor_Dim1>(bAse);
1059  }
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 1068 of file DataStructures.hpp.

1068  {
1069  return getFTensor2DiffN<Tensor_Dim0, Tensor_Dim1>(bAse, gg, bb);
1070  }
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 316 of file DataStructures.cpp.

316  {
317  if (dOfs[0]->getNbOfCoeffs() != 9) {
318  std::stringstream s;
319  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
320  s << " but you ask for tensor rank 2 dimensions 3 by 3 so 9 coefficients "
321  "is expected";
322  THROW_MESSAGE(s.str());
323  }
324  double *ptr = &*fieldData.data().begin();
326  ptr, &ptr[1], &ptr[2], &ptr[3], &ptr[4], &ptr[5], &ptr[6], &ptr[7],
327  &ptr[8]);
328 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602
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 328 of file DataStructures.hpp.

328  {
329  std::stringstream s;
330  s << "Not implemented for this dimension dim0 = " << Tensor_Dim0;
331  s << " and dim1 " << Tensor_Dim1;
332  THROW_MESSAGE(s.str());
333  }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602

◆ getFTensor2N() [1/6]

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

Definition at line 652 of file DataStructures.cpp.

653  {
654  double *t_n_ptr = &*(getN(base).data().begin());
656 
657  &t_n_ptr[HVEC0], &t_n_ptr[HVEC1], &t_n_ptr[HVEC2],
658 
659  &t_n_ptr[3 + HVEC0], &t_n_ptr[3 + HVEC1], &t_n_ptr[3 + HVEC2],
660 
661  &t_n_ptr[6 + HVEC0], &t_n_ptr[6 + HVEC1], &t_n_ptr[6 + HVEC2]
662 
663  );
664 }

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

682  {
683  double *t_n_ptr = &getN(base)(gg, 9 * bb);
685 
686  &t_n_ptr[HVEC0], &t_n_ptr[HVEC1], &t_n_ptr[HVEC2],
687 
688  &t_n_ptr[3 + HVEC0], &t_n_ptr[3 + HVEC1], &t_n_ptr[3 + HVEC2],
689 
690  &t_n_ptr[6 + HVEC0], &t_n_ptr[6 + HVEC1], &t_n_ptr[6 + HVEC2]
691 
692  );
693 }

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

641  {
642  std::stringstream s;
643  s << "Template for tensor dimension " << Tensor_Dim0 << ", " << Tensor_Dim1
644  << " not implemented";
645  THROW_MESSAGE(s.str());
647  Tensor_Dim0, Tensor_Dim1>();
648 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602

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

1162  {
1163  return getFTensor2N<Tensor_Dim0, Tensor_Dim1>(bAse);
1164  }
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 669 of file DataStructures.cpp.

670  {
671  std::stringstream s;
672  s << "Template for tensor dimension " << Tensor_Dim0 << ", " << Tensor_Dim1
673  << " not implemented";
674  THROW_MESSAGE(s.str());
676  Tensor_Dim0, Tensor_Dim1>();
677 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602

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

1219  {
1220  return getFTensor2N<Tensor_Dim0, Tensor_Dim1>(bAse, gg, bb);
1221  }
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 332 of file DataStructures.cpp.

332  {
333  if (dOfs[0]->getNbOfCoeffs() != 6) {
334  std::stringstream s;
335  s << "Wrong number of coefficients is " << dOfs[0]->getNbOfCoeffs();
336  s << " but you ask for symmetric tensor rank 2 dimensions 3 by 3 so 6 "
337  "coefficients "
338  "is expected";
339  THROW_MESSAGE(s.str());
340  }
341  double *ptr = &*fieldData.data().begin();
343  ptr, &ptr[1], &ptr[2], &ptr[3], &ptr[4], &ptr[5]);
344 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602
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 349 of file DataStructures.hpp.

349  {
350  std::stringstream s;
351  s << "Not implemented for this dimension dim = " << Tensor_Dim;
352  THROW_MESSAGE(s.str());
353  }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602

◆ 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, and simple_elasticity.cpp.

Definition at line 236 of file DataStructures.hpp.

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

◆ getIndices() [2/2]

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

Definition at line 267 of file DataStructures.hpp.

267 { 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 239 of file DataStructures.hpp.

239  {
240  unsigned int size = 0;
241  if (iNdices.size()) {
242  size = dOfs[0]->getOrderNbDofs(order) * dOfs[0]->getNbOfCoeffs();
243  size = size < iNdices.size() ? size : iNdices.size();
244  }
245  int *data = &*iNdices.data().begin();
246  return VectorIntAdaptor(size,
247  ublas::shallow_array_adaptor<int>(size, data));
248  }
VectorShallowArrayAdaptor< int > VectorIntAdaptor
Definition: Common.hpp:235
VectorInt iNdices
Global indices on entity.

◆ getLocalIndices() [1/2]

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

get local indices of dofs on entity

Definition at line 251 of file DataStructures.hpp.

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

◆ getLocalIndices() [2/2]

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

Definition at line 268 of file DataStructures.hpp.

268 { 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 254 of file DataStructures.hpp.

254  {
255  unsigned int size = 0;
256  if (localIndices.size()) {
257  size = dOfs[0]->getOrderNbDofs(order) * dOfs[0]->getNbOfCoeffs();
258  size = size < localIndices.size() ? size : localIndices.size();
259  }
260  int *data = &*localIndices.data().begin();
261  return VectorIntAdaptor(size,
262  ublas::shallow_array_adaptor<int>(size, data));
263  }
VectorShallowArrayAdaptor< int > VectorIntAdaptor
Definition: Common.hpp:235
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:
forces_and_sources_testing_edge_element.cpp, forces_and_sources_testing_users_base.cpp, and simple_elasticity.cpp.

Definition at line 430 of file DataStructures.hpp.

430  {
431  return *(getNSharedPtr(base));
432  }
virtual boost::shared_ptr< MatrixDouble > & getNSharedPtr(const FieldApproximationBase base)

◆ getN() [2/8]

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

Definition at line 434 of file DataStructures.hpp.

434 { 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 474 of file DataStructures.hpp.

474  {
475  return *(getNSharedPtr(base));
476  }
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 486 of file DataStructures.hpp.

486 { 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 508 of file DataStructures.hpp.

509  {
510  int size = getN(base).size2();
511  double *data = &getN(base)(gg, 0);
512  return VectorAdaptor(size,
513  ublas::shallow_array_adaptor<double>(size, data));
514  }
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition: Common.hpp:234

◆ getN() [6/8]

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

get base functions at Gauss pts

Definition at line 517 of file DataStructures.hpp.

517 { 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 572 of file DataStructures.hpp.

573  {
574  (void)getN()(gg, nb_base_functions -
575  1); // throw error if nb_base_functions is to big
576  double *data = &getN(base)(gg, 0);
577  return VectorAdaptor(
578  nb_base_functions,
579  ublas::shallow_array_adaptor<double>(nb_base_functions, data));
580  }
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition: Common.hpp:234

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

593  {
594  return getN(bAse, gg, nb_base_functions);
595  }
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 386 of file DataStructures.hpp.

386  {
387  return N[base];
388  }
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 394 of file DataStructures.hpp.

394  {
395  return N[base];
396  }
boost::shared_ptr< MatrixDouble > N[LASTBASE]
Base functions.

◆ getOrder()

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

get approximation order

Definition at line 233 of file DataStructures.hpp.

233 { 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 230 of file DataStructures.hpp.

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

◆ getSense() [2/2]

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

Definition at line 265 of file DataStructures.hpp.

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

◆ getSpace()

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

Get field space.

Returns
Field space

Definition at line 380 of file DataStructures.hpp.

380 { 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 696 of file DataStructures.hpp.

697  {
698  if (PetscUnlikely(getDiffN(base).size2() % (DIM0*DIM1))) {
699  THROW_MESSAGE("Wrong dimension");
700  }
701 
702  const int nb_base_functions = getN(base).size2() / (DIM0 * DIM1);
703  double *data = &getN(base)(gg, 0);
704  return MatrixAdaptor(nb_base_functions, DIM0 * DIM1,
705  ublas::shallow_array_adaptor<double>(
706  DIM0 * DIM1 * nb_base_functions, data));
707  }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Definition: Common.hpp:266
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 716 of file DataStructures.hpp.

716  {
717  return getVectorDiffN<DIM0,DIM1>(bAse, gg);
718  }
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 728 of file DataStructures.hpp.

729  {
730  double *data = &getDiffN(base)(gg, DIM0 * DIM1 * dof);
731  return MatrixAdaptor(
732  DIM0, DIM1, ublas::shallow_array_adaptor<double>(DIM0 * DIM1, data));
733  }
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Definition: Common.hpp:266
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 742 of file DataStructures.hpp.

742  {
743  return getVectorDiffN<DIM0,DIM1>(bAse, dof, gg);
744  }
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 664 of file DataStructures.hpp.

665  {
666  if (PetscUnlikely(getN(base).size2() % DIM)) {
667  THROW_MESSAGE("Wrong dimension");
668  }
669 
670  const int nb_base_functions = getN(base).size2() / DIM;
671  double *data = &getN(base)(gg, 0);
672  return MatrixAdaptor(
673  nb_base_functions, DIM,
674  ublas::shallow_array_adaptor<double>(DIM * nb_base_functions, data));
675  }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:602
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Definition: Common.hpp:266

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

684  {
685  return getVectorN<DIM>(bAse, gg);
686  }
FieldApproximationBase bAse
Field approximation base.

◆ resetFieldDependentData()

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

Reset data associated with particular field name

Returns
error code

Definition at line 1236 of file DataStructures.hpp.

1236  {
1238  sPace = NOSPACE;
1239  bAse = NOBASE;
1240  iNdices.resize(0, false);
1241  localIndices.resize(0, false);
1242  dOfs.resize(0, false);
1243  fieldData.resize(0, false);
1245  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:483
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:490
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 235 of file DataStructures.cpp.

236  {
237  os << "sEnse: " << e.getSense() << std::endl
238  << "oRder: " << e.getOrder() << std::endl
239  << "global indices: " << e.getIndices() << std::endl
240  << "local indices: " << e.getLocalIndices() << std::endl;
241  os.precision(2);
242  os << "fieldData: " << std::fixed << e.getFieldData() << std::endl;
243  MatrixDouble base = e.getN();
244  MatrixDouble diff_base = e.getDiffN();
245  const double eps = 1e-6;
246  for (unsigned int ii = 0; ii != base.size1(); ii++) {
247  for (unsigned int jj = 0; jj != base.size2(); jj++) {
248  if (fabs(base(ii, jj)) < eps)
249  base(ii, jj) = 0;
250  }
251  }
252  for (unsigned int ii = 0; ii != diff_base.size1(); ii++) {
253  for (unsigned int jj = 0; jj != diff_base.size2(); jj++) {
254  if (fabs(diff_base(ii, jj)) < eps)
255  diff_base(ii, jj) = 0;
256  }
257  }
258  os << "N: " << std::fixed << base << std::endl
259  << "diffN: " << std::fixed << diff_base;
260  return os;
261 }
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Common.hpp:212
static const double eps

Member Data Documentation

◆ bAse

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

Field approximation base.

Definition at line 1253 of file DataStructures.hpp.

◆ diffN

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

Derivatives of base functions.

Definition at line 1260 of file DataStructures.hpp.

◆ dOfs

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

DoFs on entity.

Definition at line 1256 of file DataStructures.hpp.

◆ fieldData

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

Field data on entity.

Definition at line 1257 of file DataStructures.hpp.

◆ iNdices

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

Global indices on entity.

Definition at line 1254 of file DataStructures.hpp.

◆ localIndices

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

Local indices on entity.

Definition at line 1255 of file DataStructures.hpp.

◆ N

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

Base functions.

Definition at line 1258 of file DataStructures.hpp.

◆ oRder

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

Entity order.

Definition at line 1251 of file DataStructures.hpp.

◆ sEnse

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

Entity sense (orientation)

Definition at line 1250 of file DataStructures.hpp.

◆ sPace

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

Entity space.

Definition at line 1252 of file DataStructures.hpp.


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