v0.8.23
Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
MoFEM::ForcesAndSourcesCore Struct Reference

structure to get information form mofem into DataForcesAndSourcesCore More...

#include <src/finite_elements/ForcesAndSourcesCore.hpp>

Inheritance diagram for MoFEM::ForcesAndSourcesCore:
[legend]
Collaboration diagram for MoFEM::ForcesAndSourcesCore:
[legend]

Classes

struct  UserDataOperator
 Data operator to do calculations at integration points.Is inherited and implemented by user to do calculations. It can be used in many different ways but typically is used to integrate matrices (f.e. stiffness matrix) and the right hand vector (f.e. force vector). More...
 

Public Types

typedef boost::function< int(int order_row, int order_col, int order_data)> RuleHookFun
 
- Public Types inherited from MoFEM::KspMethod
enum  KSPContext { CTX_SETFUNCTION, CTX_OPERATORS, CTX_KSPNONE }
 pass information about context of KSP/DM for with finite element is computed More...
 
- Public Types inherited from MoFEM::SnesMethod
enum  SNESContext { CTX_SNESSETFUNCTION, CTX_SNESSETJACOBIAN, CTX_SNESNONE }
 
- Public Types inherited from MoFEM::TSMethod
enum  TSContext {
  CTX_TSSETRHSFUNCTION, CTX_TSSETRHSJACOBIAN, CTX_TSSETIFUNCTION, CTX_TSSETIJACOBIAN,
  CTX_TSTSMONITORSET, CTX_TSNONE
}
 

Public Member Functions

 ForcesAndSourcesCore (Interface &m_field)
 
boost::ptr_vector< UserDataOperator > & getOpPtrVector ()
 Use to push back operator for row operator. More...
 
auto & getElementPolynomialBase ()
 Get the Entity Polynomial Base object. More...
 
auto & getUserPolynomialBase ()
 Get the User Polynomial Base object. More...
 
virtual MoFEMErrorCode preProcess ()
 function is run at the beginning of loop More...
 
virtual MoFEMErrorCode operator() ()
 function is run for every finite element More...
 
virtual MoFEMErrorCode postProcess ()
 function is run at the end of loop More...
 
int getMaxDataOrder () const
 Get max order of approximation for data fields. More...
 
int getMaxRowOrder () const
 Get max order of approximation for field in rows. More...
 
int getMaxColOrder () const
 Get max order of approximation for field in columns. More...
 
MoFEMErrorCode getNumberOfNodes (int &num_nodes) const
 Get number of DOFs on element. More...
 
const DataForcesAndSourcesCore::EntDatagetEntData (const FieldSpace space, const EntityType type, const int side) const
 Get the entity data. More...
 
DataForcesAndSourcesCore::EntDatagetEntData (const FieldSpace space, const EntityType type, const int side)
 Get the entity data. More...
 
- Public Member Functions inherited from MoFEM::FEMethod
MoFEMErrorCode query_interface (const MOFEMuuid &uuid, UnknownInterface **iface) const
 
 FEMethod ()
 
template<class MULTIINDEX >
MULTIINDEX::iterator get_begin (const MULTIINDEX &index, const std::string &field_name, const EntityType type, const int side_number) const
 
template<class MULTIINDEX >
MULTIINDEX::iterator get_end (const MULTIINDEX &index, const std::string &field_name, const EntityType type, const int side_number) const
 
template<class MULTIINDEX >
MULTIINDEX::iterator get_begin (const MULTIINDEX &index, const std::string &field_name, const EntityType type) const
 
template<class MULTIINDEX >
MULTIINDEX::iterator get_end (const MULTIINDEX &index, const std::string &field_name, const EntityType type) const
 
template<class MULTIINDEX >
MULTIINDEX::iterator get_begin (const MULTIINDEX &index, const std::string &field_name) const
 
template<class MULTIINDEX >
MULTIINDEX::iterator get_end (const MULTIINDEX &index, const std::string &field_name) const
 
template<class MULTIINDEX >
MULTIINDEX::iterator get_begin (const MULTIINDEX &index, const EntityHandle ent) const
 
template<class MULTIINDEX >
MULTIINDEX::iterator get_end (const MULTIINDEX &index, const EntityHandle ent) const
 
template<class MULTIINDEX >
MULTIINDEX::iterator get_begin (const MULTIINDEX &index, const std::string &field_name, const EntityHandle ent) const
 
template<class MULTIINDEX >
MULTIINDEX::iterator get_end (const MULTIINDEX &index, const std::string &field_name, const EntityHandle ent) const
 
- Public Member Functions inherited from MoFEM::BasicMethod
 BasicMethod ()
 
virtual ~BasicMethod ()
 
int getNinTheLoop () const
 get number of evaluated element in the loop More...
 
int getLoopSize () const
 get loop size More...
 
MoFEMErrorCode copyBasicMethod (const BasicMethod &basic)
 Copy data from other base method to this base method. More...
 
- Public Member Functions inherited from MoFEM::KspMethod
 KspMethod ()
 
virtual ~KspMethod ()
 
MoFEMErrorCode setKspCtx (const KSPContext &ctx)
 set operator type More...
 
MoFEMErrorCode setKsp (KSP ksp)
 set solver More...
 
MoFEMErrorCode copyKsp (const KspMethod &ksp)
 copy data form another method More...
 
- Public Member Functions inherited from MoFEM::UnknownInterface
template<class IFACE >
MoFEMErrorCode registerInterface (const MOFEMuuid &uuid, bool error_if_registration_failed=true)
 Register interface. More...
 
template<class IFACE , bool VERIFY = false>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, IFACE *&iface) const
 Get interface by uuid and return reference to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface refernce to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface. More...
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface. More...
 
virtual ~UnknownInterface ()
 
virtual MoFEMErrorCode getLibVersion (Version &version) const
 Get library version. More...
 
virtual const MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version) const
 Get database major version. More...
 
virtual MoFEMErrorCode getInterfaceVersion (Version &version) const
 Get database major version. More...
 
template<>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, UnknownInterface *&iface) const
 
- Public Member Functions inherited from MoFEM::SnesMethod
 SnesMethod ()
 
virtual ~SnesMethod ()
 
MoFEMErrorCode setSnesCtx (const SNESContext &ctx)
 Set SNES context. More...
 
MoFEMErrorCode setSnes (SNES snes)
 Set SNES instance. More...
 
MoFEMErrorCode copySnes (const SnesMethod &snes)
 Copy snes data. More...
 
- Public Member Functions inherited from MoFEM::TSMethod
 TSMethod ()
 
virtual ~TSMethod ()
 
MoFEMErrorCode setTsCtx (const TSContext &ctx)
 Set Ts context. More...
 
MoFEMErrorCode copyTs (const TSMethod &ts)
 Copy TS solver data. More...
 
MoFEMErrorCode setTs (TS _ts)
 Set TS solver. More...
 

Public Attributes

InterfacemField
 
RuleHookFun getRuleHook
 Hook to get rule. More...
 
RuleHookFun setRuleHook
 Set function to calculate integration rule. More...
 
MatrixDouble gaussPts
 Matrix of integration points. More...
 
- Public Attributes inherited from MoFEM::FEMethod
std::string feName
 Name of finite element. More...
 
boost::shared_ptr< const NumeredEntFiniteElementnumeredEntFiniteElementPtr
 
boost::shared_ptr< const FENumeredDofEntity_multiIndexrowPtr
 Pointer to finite element rows dofs view. More...
 
boost::shared_ptr< const FENumeredDofEntity_multiIndexcolPtr
 Pointer to finite element columns dofs view. More...
 
boost::shared_ptr< const FEDofEntity_multiIndexdataPtr
 Pointer to finite element data dofs. More...
 
boost::shared_ptr< const FieldEntity_vector_viewrowFieldEntsPtr
 Pointer to finite element field entities row view. More...
 
boost::shared_ptr< const FieldEntity_vector_viewcolFieldEntsPtr
 Pointer to finite element field entities column view. More...
 
boost::shared_ptr< const FieldEntity_multiIndex_spaceType_viewdataFieldEntsPtr
 Pointer to finite element field entities data view. More...
 
- Public Attributes inherited from MoFEM::BasicMethod
int nInTheLoop
 number currently of processed method More...
 
int loopSize
 local number oe methods to process More...
 
int rAnk
 processor rank More...
 
int sIze
 number of processors in communicator More...
 
const RefEntity_multiIndexrefinedEntitiesPtr
 container of mofem dof entities More...
 
const RefElement_multiIndexrefinedFiniteElementsPtr
 container of mofem finite element entities More...
 
const ProblemproblemPtr
 raw pointer to problem More...
 
const Field_multiIndexfieldsPtr
 raw pointer to fields container More...
 
const FieldEntity_multiIndexentitiesPtr
 raw pointer to container of field entities More...
 
const DofEntity_multiIndexdofsPtr
 raw pointer container of dofs More...
 
const FiniteElement_multiIndexfiniteElementsPtr
 raw pointer to container finite elements More...
 
const EntFiniteElement_multiIndexfiniteElementsEntitiesPtr
 
const FieldEntityEntFiniteElementAdjacencyMap_multiIndexadjacenciesPtr
 
boost::function< MoFEMErrorCode()> preProcessHook
 Hook function for pre-processing. More...
 
boost::function< MoFEMErrorCode()> postProcessHook
 Hook function for post-processing. More...
 
boost::function< MoFEMErrorCode()> operatorHook
 Hook function for operator. More...
 
boost::movelib::unique_ptr< boolvecAssembleSwitch
 
boost::movelib::unique_ptr< boolmatAssembleSwitch
 
- Public Attributes inherited from MoFEM::KspMethod
KSPContext ksp_ctx
 Context. More...
 
KSP ksp
 KSP solver. More...
 
Vec ksp_f
 the right hand side vector More...
 
Mat ksp_A
 matrix More...
 
Mat ksp_B
 preconditioner matrix More...
 
- Public Attributes inherited from MoFEM::SnesMethod
SNESContext snes_ctx
 
SNES snes
 
Vec snes_x
 
Vec snes_f
 
Mat snes_A
 
Mat snes_B
 
- Public Attributes inherited from MoFEM::TSMethod
TSContext ts_ctx
 
TS ts
 
Vec ts_u
 
Vec ts_u_t
 
Vec ts_F
 
Mat ts_A
 
Mat ts_B
 
PetscInt ts_step
 
PetscReal ts_a
 
PetscReal ts_t
 

Protected Member Functions

MoFEMErrorCode getEntitySense (const EntityType type, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
 get sense (orientation) of entity More...
 
MoFEMErrorCode getEntityDataOrder (const EntityType type, const FieldSpace space, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
 Get the entity data order. More...
 
template<EntityType type>
MoFEMErrorCode getEntitySense (DataForcesAndSourcesCore &data) const
 Get the entity sense (orientation) More...
 
template<EntityType type>
MoFEMErrorCode getEntityDataOrder (DataForcesAndSourcesCore &data, const FieldSpace space) const
 Get the entity data order for given space. More...
 
MoFEMErrorCode getFaceTriNodes (DataForcesAndSourcesCore &data) const
 Get nodes on triangles. More...
 
MoFEMErrorCode getSpacesAndBaseOnEntities (DataForcesAndSourcesCore &data) const
 Get field approximation space and base on entities. More...
 
virtual int getRule (int order_row, int order_col, int order_data)
 another variant of getRule More...
 
virtual MoFEMErrorCode setGaussPts (int order_row, int order_col, int order_data)
 set user specific integration rule More...
 
MoFEMErrorCode calculateBaseFunctionsOnElement (const FieldApproximationBase b)
 Calculate base functions. More...
 
MoFEMErrorCode calculateBaseFunctionsOnElement ()
 Calculate base functions. More...
 
MoFEMErrorCode createDataOnElement ()
 Create a entity data on element object. More...
 
MoFEMErrorCode loopOverOperators ()
 Iterate user data operators. More...
 
Indices
MoFEMErrorCode getNodesIndices (const boost::string_ref field_name, FENumeredDofEntity_multiIndex &dofs, VectorInt &nodes_indices, VectorInt &local_nodes_indices) const
 get node indices More...
 
MoFEMErrorCode getRowNodesIndices (DataForcesAndSourcesCore &data, const std::string &field_name) const
 get row node indices from FENumeredDofEntity_multiIndex More...
 
MoFEMErrorCode getColNodesIndices (DataForcesAndSourcesCore &data, const std::string &field_name) const
 get col node indices from FENumeredDofEntity_multiIndex More...
 
MoFEMErrorCode getEntityIndices (DataForcesAndSourcesCore &data, const std::string &field_name, FENumeredDofEntity_multiIndex &dofs, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const
 
MoFEMErrorCode getEntityRowIndices (DataForcesAndSourcesCore &data, const std::string &field_name, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const
 
MoFEMErrorCode getEntityColIndices (DataForcesAndSourcesCore &data, const std::string &field_name, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const
 
MoFEMErrorCode getNoFieldIndices (const std::string &field_name, FENumeredDofEntity_multiIndex &dofs, VectorInt &nodes_indices) const
 get NoField indices More...
 
MoFEMErrorCode getNoFieldRowIndices (DataForcesAndSourcesCore &data, const std::string &field_name) const
 get col NoField indices More...
 
MoFEMErrorCode getNoFieldColIndices (DataForcesAndSourcesCore &data, const std::string &field_name) const
 get col NoField indices More...
 
Data
MoFEMErrorCode getNodesFieldData (const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, VectorDouble &nodes_data, VectorDofs &nodes_dofs, FieldSpace &space, FieldApproximationBase &base) const
 Get field data on nodes. More...
 
MoFEMErrorCode getNoFieldFieldData (const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, VectorDouble &ent_field_data, VectorDofs &ent_field_dofs) const
 
MoFEMErrorCode getNoFieldFieldData (DataForcesAndSourcesCore &data, const boost::string_ref field_name) const
 
MoFEMErrorCode getNodesFieldData (DataForcesAndSourcesCore &data, const std::string &field_name) const
 Get data on nodes. More...
 
MoFEMErrorCode getEntityFieldData (DataForcesAndSourcesCore &data, const std::string &field_name, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const
 
Data form NumeredDofEntity_multiIndex
MoFEMErrorCode getProblemNodesIndices (const std::string &field_name, const NumeredDofEntity_multiIndex &dofs, VectorInt &nodes_indices) const
 get indices of nodal indices which are declared for problem but not this particular element More...
 
MoFEMErrorCode getProblemTypeIndices (const std::string &field_name, const NumeredDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorInt &indices) const
 get indices by type (generic function) which are declared for problem but not this particular element More...
 
MoFEMErrorCode getProblemNodesRowIndices (const std::string &field_name, VectorInt &nodes_indices) const
 
MoFEMErrorCode getProblemTypeRowIndices (const std::string &field_name, EntityType type, int side_number, VectorInt &indices) const
 
MoFEMErrorCode getProblemNodesColIndices (const std::string &field_name, VectorInt &nodes_indices) const
 
MoFEMErrorCode getProblemTypeColIndices (const std::string &field_name, EntityType type, int side_number, VectorInt &indices) const
 
- Protected Member Functions inherited from MoFEM::UnknownInterface
boost::typeindex::type_index getClassIdx (const MOFEMuuid &uid) const
 Get type name for interface Id. More...
 
MOFEMuuid getUId (const boost::typeindex::type_index &class_idx) const
 Get interface Id for class name. More...
 

Deprecated (do not use)

const boost::shared_ptr< DataForcesAndSourcesCoredataOnElement [LASTSPACE]
 Entity data on element entity rows fields. More...
 
const boost::shared_ptr< DataForcesAndSourcesCorederivedDataOnElement [LASTSPACE]
 Entity data on element entity columns fields. More...
 
DataForcesAndSourcesCoredataNoField
 
DataForcesAndSourcesCoredataH1
 
DataForcesAndSourcesCoredataHcurl
 
DataForcesAndSourcesCoredataHdiv
 
DataForcesAndSourcesCoredataL2
 
boost::ptr_vector< UserDataOperatoropPtrVector
 Vector of finite element users data operators. More...
 
class UserDataOperator
 
class VolumeElementForcesAndSourcesCoreOnSideBase
 
class FaceElementForcesAndSourcesCoreOnSideBase
 
EntityType lastEvaluatedElementEntityType
 Last evaluated type of element entity. More...
 
boost::shared_ptr< BaseFunctionelementPolynomialBasePtr
 Pointer to entity polynomial base. More...
 
boost::shared_ptr< BaseFunctionuserPolynomialBasePtr
 Pointer to user polynomail base. More...
 
ForcesAndSourcesCoresidePtrFE
 Element to integrate on the sides. More...
 
virtual int getRule (int order)
 
virtual MoFEMErrorCode setGaussPts (int order)
 
MoFEMErrorCode setSideFEPtr (const ForcesAndSourcesCore *side_fe_ptr)
 Set the pointer to face element on the side. More...
 

Detailed Description

structure to get information form mofem into DataForcesAndSourcesCore

Examples
EshelbianPlasticity.cpp, and hello_world.cpp.

Definition at line 34 of file ForcesAndSourcesCore.hpp.

Member Typedef Documentation

◆ RuleHookFun

typedef boost::function<int(int order_row, int order_col, int order_data)> MoFEM::ForcesAndSourcesCore::RuleHookFun

Definition at line 41 of file ForcesAndSourcesCore.hpp.

Constructor & Destructor Documentation

◆ ForcesAndSourcesCore()

MoFEM::ForcesAndSourcesCore::ForcesAndSourcesCore ( Interface m_field)

Definition at line 33 of file ForcesAndSourcesCore.cpp.

34  :
35 
36  mField(m_field), getRuleHook(0), setRuleHook(0),
38 
39  nullptr,
40  boost::shared_ptr<DataForcesAndSourcesCore>(
41  new DataForcesAndSourcesCore(MBENTITYSET)), // NOFIELD
42  boost::shared_ptr<DataForcesAndSourcesCore>(
43  new DataForcesAndSourcesCore(MBENTITYSET)), // H1
44  boost::shared_ptr<DataForcesAndSourcesCore>(
45  new DataForcesAndSourcesCore(MBENTITYSET)), // HCURL
46  boost::shared_ptr<DataForcesAndSourcesCore>(
47  new DataForcesAndSourcesCore(MBENTITYSET)), // HDIV
48  boost::shared_ptr<DataForcesAndSourcesCore>(
49  new DataForcesAndSourcesCore(MBENTITYSET)) // L2
50 
51  },
53 
54  nullptr,
55  boost::shared_ptr<DataForcesAndSourcesCore>(
56  new DerivedDataForcesAndSourcesCore(dataOnElement[NOFIELD])),
57  boost::shared_ptr<DataForcesAndSourcesCore>(
58  new DerivedDataForcesAndSourcesCore(dataOnElement[H1])),
59  boost::shared_ptr<DataForcesAndSourcesCore>(
60  new DerivedDataForcesAndSourcesCore(dataOnElement[HCURL])),
61  boost::shared_ptr<DataForcesAndSourcesCore>(
62  new DerivedDataForcesAndSourcesCore(dataOnElement[HDIV])),
63  boost::shared_ptr<DataForcesAndSourcesCore>(
64  new DerivedDataForcesAndSourcesCore(dataOnElement[L2]))
65 
66  },
69  dataHdiv(*dataOnElement[HDIV].get()), dataL2(*dataOnElement[L2].get()),
70  lastEvaluatedElementEntityType(MBMAXTYPE), sidePtrFE(nullptr) {}
DataForcesAndSourcesCore & dataL2
field with continuous normal traction
Definition: definitions.h:173
ForcesAndSourcesCore * sidePtrFE
Element to integrate on the sides.
DataForcesAndSourcesCore & dataH1
const boost::shared_ptr< DataForcesAndSourcesCore > derivedDataOnElement[LASTSPACE]
Entity data on element entity columns fields.
scalar or vector of scalars describe (no true field)
Definition: definitions.h:170
const boost::shared_ptr< DataForcesAndSourcesCore > dataOnElement[LASTSPACE]
Entity data on element entity rows fields.
RuleHookFun getRuleHook
Hook to get rule.
DataForcesAndSourcesCore & dataHcurl
EntityType lastEvaluatedElementEntityType
Last evaluated type of element entity.
field with continuous tangents
Definition: definitions.h:172
DataForcesAndSourcesCore & dataHdiv
continuous field
Definition: definitions.h:171
RuleHookFun setRuleHook
Set function to calculate integration rule.
field with C-1 continuity
Definition: definitions.h:174
DataForcesAndSourcesCore & dataNoField

Member Function Documentation

◆ calculateBaseFunctionsOnElement() [1/2]

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::calculateBaseFunctionsOnElement ( const FieldApproximationBase  b)
protected

Calculate base functions.

Returns
Error code

Definition at line 798 of file ForcesAndSourcesCore.cpp.

799  {
801  if (dataOnElement[H1]->bAse.test(b)) {
802  switch (static_cast<FieldApproximationBase>(b)) {
803  case NOBASE:
804  break;
808  if (!getElementPolynomialBase()) {
809  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
810  "Functions genrating approximation base not defined");
811  }
812  for (int space = H1; space != LASTSPACE; ++space) {
813  if (dataOnElement[H1]->sPace.test(space) &&
814  dataOnElement[H1]->bAse.test(b) &&
815  dataOnElement[H1]->basesOnSpaces[space].test(b)) {
816  CHKERR getElementPolynomialBase()->getValue(
817  gaussPts,
818  boost::shared_ptr<BaseFunctionCtx>(new EntPolynomialBaseCtx(
819  *dataOnElement[space], static_cast<FieldSpace>(space),
820  static_cast<FieldApproximationBase>(b), NOBASE)));
821  }
822  }
823  break;
824  case USER_BASE:
825  if (!getUserPolynomialBase()) {
826  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
827  "Functions genrating user approximation base not defined");
828  }
829  for (int space = H1; space != LASTSPACE; ++space)
830  if (dataOnElement[H1]->sPace.test(space) &&
831  dataOnElement[H1]->bAse.test(b) &&
832  dataOnElement[H1]->basesOnSpaces[space].test(b)) {
833  CHKERR getUserPolynomialBase()->getValue(
834  gaussPts,
835  boost::shared_ptr<BaseFunctionCtx>(new EntPolynomialBaseCtx(
836  *dataOnElement[space], static_cast<FieldSpace>(space),
837  static_cast<FieldApproximationBase>(b), NOBASE)));
838  }
839  break;
840  default:
842  "Base <%s> not yet implemented",
843  ApproximationBaseNames[static_cast<FieldApproximationBase>(b)]);
844  }
845  }
847 }
MatrixDouble gaussPts
Matrix of integration points.
user implemented approximation base
Definition: definitions.h:154
auto & getUserPolynomialBase()
Get the User Polynomial Base object.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
const boost::shared_ptr< DataForcesAndSourcesCore > dataOnElement[LASTSPACE]
Entity data on element entity rows fields.
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:175
static const char *const ApproximationBaseNames[]
Definition: definitions.h:158
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:145
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
virtual MPI_Comm & get_comm() const =0
continuous field
Definition: definitions.h:171
auto & getElementPolynomialBase()
Get the Entity Polynomial Base object.

◆ calculateBaseFunctionsOnElement() [2/2]

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::calculateBaseFunctionsOnElement ( )
protected

Calculate base functions.

Returns
Error code

Definition at line 849 of file ForcesAndSourcesCore.cpp.

849  {
851  /// Use the some node base. Node base is usually used for construction other
852  /// bases.
853  for (int space = HCURL; space != LASTSPACE; ++space) {
854  dataOnElement[space]->dataOnEntities[MBVERTEX][0].getNSharedPtr(NOBASE) =
855  dataOnElement[H1]->dataOnEntities[MBVERTEX][0].getNSharedPtr(NOBASE);
856  }
857  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
859  static_cast<FieldApproximationBase>(b));
860  }
862 }
MoFEMErrorCode calculateBaseFunctionsOnElement()
Calculate base functions.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
const boost::shared_ptr< DataForcesAndSourcesCore > dataOnElement[LASTSPACE]
Entity data on element entity rows fields.
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:175
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:145
field with continuous tangents
Definition: definitions.h:172
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
continuous field
Definition: definitions.h:171

◆ createDataOnElement()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::createDataOnElement ( )
protected

Create a entity data on element object.

Returns
MoFEMErrorCode

Definition at line 864 of file ForcesAndSourcesCore.cpp.

864  {
866 
867  const EntityType type = numeredEntFiniteElementPtr->getEntType();
868  if (type == lastEvaluatedElementEntityType)
870 
871  // Data on elements for proper spaces
872  for (int space = H1; space != LASTSPACE; ++space) {
873  dataOnElement[space]->setElementType(type);
874  derivedDataOnElement[space]->setElementType(type);
875  }
876 
878 
880 }
const boost::shared_ptr< DataForcesAndSourcesCore > derivedDataOnElement[LASTSPACE]
Entity data on element entity columns fields.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
const boost::shared_ptr< DataForcesAndSourcesCore > dataOnElement[LASTSPACE]
Entity data on element entity rows fields.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:175
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
EntityType lastEvaluatedElementEntityType
Last evaluated type of element entity.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
continuous field
Definition: definitions.h:171

◆ getColNodesIndices()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getColNodesIndices ( DataForcesAndSourcesCore data,
const std::string &  field_name 
) const
protected

get col node indices from FENumeredDofEntity_multiIndex

Definition at line 261 of file ForcesAndSourcesCore.cpp.

262  {
263  return getNodesIndices(field_name,
264  const_cast<FENumeredDofEntity_multiIndex &>(
265  numeredEntFiniteElementPtr->getColsDofs()),
266  data.dataOnEntities[MBVERTEX][0].getIndices(),
267  data.dataOnEntities[MBVERTEX][0].getLocalIndices());
268 }
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
MoFEMErrorCode getNodesIndices(const boost::string_ref field_name, FENumeredDofEntity_multiIndex &dofs, VectorInt &nodes_indices, VectorInt &local_nodes_indices) const
get node indices

◆ getElementPolynomialBase()

auto& MoFEM::ForcesAndSourcesCore::getElementPolynomialBase ( )

Get the Entity Polynomial Base object.

Returns
boost::shared_ptr<BaseFunction>&&

Definition at line 388 of file ForcesAndSourcesCore.hpp.

388 { return elementPolynomialBasePtr; }
boost::shared_ptr< BaseFunction > elementPolynomialBasePtr
Pointer to entity polynomial base.

◆ getEntData() [1/2]

const DataForcesAndSourcesCore::EntData& MoFEM::ForcesAndSourcesCore::getEntData ( const FieldSpace  space,
const EntityType  type,
const int  side 
) const

Get the entity data.

Parameters
space
type
side
Returns
const DataForcesAndSourcesCore::EntData&

Definition at line 445 of file ForcesAndSourcesCore.hpp.

447  {
448  return dataOnElement[space]->dataOnEntities[type][side];
449  }
const boost::shared_ptr< DataForcesAndSourcesCore > dataOnElement[LASTSPACE]
Entity data on element entity rows fields.

◆ getEntData() [2/2]

DataForcesAndSourcesCore::EntData& MoFEM::ForcesAndSourcesCore::getEntData ( const FieldSpace  space,
const EntityType  type,
const int  side 
)

Get the entity data.

Parameters
space
type
side
Returns
DataForcesAndSourcesCore::EntData&

Definition at line 460 of file ForcesAndSourcesCore.hpp.

460  {
461  return dataOnElement[space]->dataOnEntities[type][side];
462  }
const boost::shared_ptr< DataForcesAndSourcesCore > dataOnElement[LASTSPACE]
Entity data on element entity rows fields.

◆ getEntityColIndices()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getEntityColIndices ( DataForcesAndSourcesCore data,
const std::string &  field_name,
const EntityType  type_lo = MBVERTEX,
const EntityType  type_hi = MBPOLYHEDRON 
) const
protected

Definition at line 829 of file ForcesAndSourcesCore.hpp.

831  {
832  return getEntityIndices(data, field_name,
833  const_cast<FENumeredDofEntity_multiIndex &>(
834  numeredEntFiniteElementPtr->getColsDofs()),
835  type_lo, type_hi);
836 }
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
MoFEMErrorCode getEntityIndices(DataForcesAndSourcesCore &data, const std::string &field_name, FENumeredDofEntity_multiIndex &dofs, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const

◆ getEntityDataOrder() [1/2]

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getEntityDataOrder ( const EntityType  type,
const FieldSpace  space,
boost::ptr_vector< DataForcesAndSourcesCore::EntData > &  data 
) const
protected

Get the entity data order.

Parameters
type
space
data
Returns
MoFEMErrorCode

Definition at line 153 of file ForcesAndSourcesCore.cpp.

155  {
157 
158  auto &side_table = numeredEntFiniteElementPtr->getSideNumberTable();
159 
160  for (unsigned int s = 0; s != data.size(); ++s)
161  data[s].getDataOrder() = 0;
162 
163  auto &fields_ents =
164  dataFieldEntsPtr->get<Composite_EntType_and_Space_mi_tag>();
165 
166  for (auto r = fields_ents.equal_range(boost::make_tuple(type, space));
167  r.first != r.second; ++r.first) {
168 
169  auto &e = **r.first;
170 
171  auto sit = side_table.find(e.getEnt());
172  if (sit != side_table.end()) {
173 
174  auto &side = *sit;
175  const int side_number = side->side_number;
176 
177  ApproximationOrder ent_order = e.getMaxOrder();
178  auto &dat = data[side_number];
179  dat.getDataOrder() =
180  dat.getDataOrder() > ent_order ? dat.getDataOrder() : ent_order;
181  } else
182  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
183  "Entity on side of the element not found");
184  }
185 
186  for (auto r = side_table.get<2>().equal_range(type); r.first != r.second;
187  ++r.first) {
188  const int brother_side_number = (*r.first)->brother_side_number;
189  if (brother_side_number != -1) {
190  const int side_number = (*r.first)->side_number;
191  data[brother_side_number].getDataOrder() =
192  data[side_number].getDataOrder();
193  }
194  }
195 
197 }
int ApproximationOrder
Approximation on the entity.
Definition: Types.hpp:37
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
boost::shared_ptr< const FieldEntity_multiIndex_spaceType_view > dataFieldEntsPtr
Pointer to finite element field entities data view.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ getEntityDataOrder() [2/2]

template<EntityType type>
MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getEntityDataOrder ( DataForcesAndSourcesCore data,
const FieldSpace  space 
) const
protected

Get the entity data order for given space.

Template Parameters
type
Parameters
data
space
Returns
MoFEMErrorCode

Definition at line 508 of file ForcesAndSourcesCore.hpp.

509  {
510  return getEntityDataOrder(type, space, data.dataOnEntities[type]);
511  }
MoFEMErrorCode getEntityDataOrder(const EntityType type, const FieldSpace space, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
Get the entity data order.

◆ getEntityFieldData()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getEntityFieldData ( DataForcesAndSourcesCore data,
const std::string &  field_name,
const EntityType  type_lo = MBVERTEX,
const EntityType  type_hi = MBPOLYHEDRON 
) const
protected

Definition at line 557 of file ForcesAndSourcesCore.cpp.

559  {
561 
562  for (EntityType t = type_lo; t != type_hi; ++t) {
563  for (auto &dat : data.dataOnEntities[t]) {
564  dat.getDataOrder() = 0;
565  dat.getBase() = NOBASE;
566  dat.getSpace() = NOSPACE;
567  dat.getFieldData().resize(0, false);
568  dat.getFieldDofs().resize(0, false);
569  }
570  }
571 
572  auto &dofs = const_cast<FEDofEntity_multiIndex &>(
573  numeredEntFiniteElementPtr->getDataDofs());
574  auto &dofs_by_type = dofs.get<Composite_Name_And_Type_mi_tag>();
575  auto dit = dofs_by_type.lower_bound(boost::make_tuple(field_name, type_lo));
576  if (dit == dofs_by_type.end())
578  auto hi_dit =
579  dofs_by_type.lower_bound(boost::make_tuple(field_name, type_hi));
580  std::vector<boost::weak_ptr<FEDofEntity>> brother_dofs_vec;
581  for (; dit != hi_dit;) {
582 
583  auto &dof = **dit;
584  const int nb_dofs_on_ent = dof.getNbDofsOnEnt();
585  if (nb_dofs_on_ent) {
586 
587  const EntityType type = dof.getEntType();
588  const int side = dof.sideNumberPtr->side_number;
589  auto &dat = data.dataOnEntities[type][side];
590 
591  auto &ent_field_dofs = dat.getFieldDofs();
592  auto &ent_field_data = dat.getFieldData();
593  const int brother_side = dof.sideNumberPtr->brother_side_number;
594  if (brother_side != -1)
595  brother_dofs_vec.emplace_back(*dit);
596 
597  if (ent_field_data.empty()) {
598 
599  dat.getBase() = dof.getApproxBase();
600  dat.getSpace() = dof.getSpace();
601  const int ent_order = dof.getMaxOrder();
602  dat.getDataOrder() =
603  dat.getDataOrder() > ent_order ? dat.getDataOrder() : ent_order;
604  ent_field_data.resize(nb_dofs_on_ent, false);
605  noalias(ent_field_data) = dof.getEntFieldData();
606  ent_field_dofs.resize(nb_dofs_on_ent, false);
607  for (int ii = 0; ii != nb_dofs_on_ent; ++ii) {
608  ent_field_dofs[ii] = *dit;
609  ++dit;
610  }
611  }
612  }
613  }
614 
615  for (auto &dof_ptr : brother_dofs_vec) {
616  if (auto d = dof_ptr.lock()) {
617  const EntityType type = d->getEntType();
618  const int side = d->sideNumberPtr->side_number;
619  const int brother_side = d->sideNumberPtr->brother_side_number;
620  auto &dat = data.dataOnEntities[type][side];
621  auto &dat_brother = data.dataOnEntities[type][brother_side];
622  dat_brother.getBase() = dat.getBase();
623  dat_brother.getSpace() = dat.getSpace();
624  dat_brother.getDataOrder() = dat.getDataOrder();
625  dat_brother.getFieldData() = dat.getFieldData();
626  dat_brother.getFieldDofs() = dat.getFieldDofs();
627  }
628  }
629 
631 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T * > &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: dTensor0.hpp:27
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ getEntityIndices()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getEntityIndices ( DataForcesAndSourcesCore data,
const std::string &  field_name,
FENumeredDofEntity_multiIndex dofs,
const EntityType  type_lo = MBVERTEX,
const EntityType  type_hi = MBPOLYHEDRON 
) const
protected

Definition at line 270 of file ForcesAndSourcesCore.cpp.

273  {
275 
276  for (EntityType t = type_lo; t != type_hi; ++t) {
277  for (auto &dat : data.dataOnEntities[t]) {
278  dat.getIndices().resize(0, false);
279  dat.getLocalIndices().resize(0, false);
280  }
281  }
282 
283  auto &dofs_by_type = dofs.get<Composite_Name_And_Type_mi_tag>();
284  auto dit = dofs_by_type.lower_bound(boost::make_tuple(field_name, type_lo));
285  if (dit == dofs_by_type.end())
287  auto hi_dit =
288  dofs_by_type.lower_bound(boost::make_tuple(field_name, type_hi));
289  for (; dit != hi_dit; ++dit) {
290  auto &dof = **dit;
291  const EntityType type = dof.getEntType();
292  const int side = dof.sideNumberPtr->side_number;
293  auto &dat = data.dataOnEntities[type][side];
294 
295  const int nb_dofs_on_ent = dof.getNbDofsOnEnt();
296  if (nb_dofs_on_ent) {
297  const int brother_side = dof.sideNumberPtr->brother_side_number;
298  auto &ent_field_indices = dat.getIndices();
299  auto &ent_field_local_indices = dat.getLocalIndices();
300  if (ent_field_indices.empty()) {
301  ent_field_indices.resize(nb_dofs_on_ent, false);
302  ent_field_local_indices.resize(nb_dofs_on_ent, false);
303  std::fill(ent_field_indices.data().begin(),
304  ent_field_indices.data().end(), -1);
305  std::fill(ent_field_local_indices.data().begin(),
306  ent_field_local_indices.data().end(), -1);
307  }
308  const int idx = dof.getEntDofIdx();
309  ent_field_indices[idx] = dof.getPetscGlobalDofIdx();
310  ent_field_local_indices[idx] = dof.getPetscLocalDofIdx();
311  if (brother_side != -1) {
312  auto &dat_brother = data.dataOnEntities[type][brother_side];
313  dat_brother.getIndices().resize(nb_dofs_on_ent, false);
314  dat_brother.getLocalIndices().resize(nb_dofs_on_ent, false);
315  dat_brother.getIndices()[idx] = dat.getIndices()[idx];
316  dat_brother.getLocalIndices()[idx] = dat.getLocalIndices()[idx];
317  }
318  }
319  }
320 
322 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ getEntityRowIndices()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getEntityRowIndices ( DataForcesAndSourcesCore data,
const std::string &  field_name,
const EntityType  type_lo = MBVERTEX,
const EntityType  type_hi = MBPOLYHEDRON 
) const
protected

Definition at line 820 of file ForcesAndSourcesCore.hpp.

822  {
823  return getEntityIndices(data, field_name,
824  const_cast<FENumeredDofEntity_multiIndex &>(
825  numeredEntFiniteElementPtr->getRowsDofs()),
826  type_lo, type_hi);
827 }
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
MoFEMErrorCode getEntityIndices(DataForcesAndSourcesCore &data, const std::string &field_name, FENumeredDofEntity_multiIndex &dofs, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const

◆ getEntitySense() [1/2]

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getEntitySense ( const EntityType  type,
boost::ptr_vector< DataForcesAndSourcesCore::EntData > &  data 
) const
protected

get sense (orientation) of entity

Parameters
typetype of entity
dataentity data
Returns
error code

Definition at line 104 of file ForcesAndSourcesCore.cpp.

106  {
108 
109  auto &side_table = numeredEntFiniteElementPtr->getSideNumberTable().get<2>();
110  for (auto r = side_table.equal_range(type); r.first != r.second; ++r.first) {
111 
112  const int side_number = (*r.first)->side_number;
113  const int brother_side_number = (*r.first)->brother_side_number;
114  const int sense = (*r.first)->sense;
115 
116  data[side_number].getSense() = sense;
117  if (brother_side_number != -1)
118  data[brother_side_number].getSense() = sense;
119  }
121 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ getEntitySense() [2/2]

template<EntityType type>
MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getEntitySense ( DataForcesAndSourcesCore data) const
protected

Get the entity sense (orientation)

Template Parameters
type
Parameters
data
Returns
MoFEMErrorCode

Definition at line 495 of file ForcesAndSourcesCore.hpp.

495  {
496  return getEntitySense(type, data.dataOnEntities[type]);
497  }
MoFEMErrorCode getEntitySense(const EntityType type, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
get sense (orientation) of entity

◆ getFaceTriNodes()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getFaceTriNodes ( DataForcesAndSourcesCore data) const
protected

Get nodes on triangles.

Definition at line 668 of file ForcesAndSourcesCore.cpp.

668  {
670  // PetscAttachDebugger();
671  data.facesNodes.resize(4, 3, false);
672  auto &side_table = const_cast<SideNumber_multiIndex &>(
673  numeredEntFiniteElementPtr->getSideNumberTable());
674  auto siit = side_table.get<1>().lower_bound(boost::make_tuple(MBTRI, 0));
675  auto hi_siit = side_table.get<1>().upper_bound(boost::make_tuple(MBTRI, 4));
676  if (std::distance(siit, hi_siit) != 4) {
677  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
678  "Should be 4 triangles on tet, side_table not initialized");
679  }
680  const int canonical_face_sense_p1[4][3] = {
681  {0, 1, 3},
682  {1, 2, 3},
683  {0, 3, 2} /**/,
684  {0, 2, 1} /**/}; // second index is offset (positive sense)
685  const int canonical_face_sense_m1[4][3] = {
686  {0, 3, 1},
687  {1, 3, 2},
688  {0, 2, 3},
689  {0, 1, 2}}; // second index is offset (negative sense
690  for (; siit != hi_siit; siit++) {
691  const boost::shared_ptr<SideNumber> side = *siit;
692  int face_conn[3] = {-1, -1, -1};
693  if (side->offset == 0) {
694  face_conn[0] = side->sense == 1
695  ? canonical_face_sense_p1[(int)side->side_number][0]
696  : canonical_face_sense_m1[(int)side->side_number][0];
697  face_conn[1] = side->sense == 1
698  ? canonical_face_sense_p1[(int)side->side_number][1]
699  : canonical_face_sense_m1[(int)side->side_number][1];
700  face_conn[2] = side->sense == 1
701  ? canonical_face_sense_p1[(int)side->side_number][2]
702  : canonical_face_sense_m1[(int)side->side_number][2];
703  }
704  if (side->offset == 1) {
705  face_conn[0] =
706  side->sense == 1
707  ? canonical_face_sense_p1[(int)side->side_number][1]
708  : canonical_face_sense_m1[(int)side->side_number][2] /**/;
709  face_conn[1] = side->sense == 1
710  ? canonical_face_sense_p1[(int)side->side_number][2]
711  : canonical_face_sense_m1[(int)side->side_number][0];
712  face_conn[2] = side->sense == 1
713  ? canonical_face_sense_p1[(int)side->side_number][0]
714  : canonical_face_sense_m1[(int)side->side_number][1];
715  }
716  if (side->offset == 2) {
717  face_conn[0] =
718  side->sense == 1
719  ? canonical_face_sense_p1[(int)side->side_number][2]
720  : canonical_face_sense_m1[(int)side->side_number][1] /**/;
721  face_conn[1] = side->sense == 1
722  ? canonical_face_sense_p1[(int)side->side_number][0]
723  : canonical_face_sense_m1[(int)side->side_number][2];
724  face_conn[2] = side->sense == 1
725  ? canonical_face_sense_p1[(int)side->side_number][1]
726  : canonical_face_sense_m1[(int)side->side_number][0];
727  }
728  for (int nn = 0; nn < 3; nn++)
729  data.facesNodes(side->side_number, nn) = face_conn[nn];
730  {
731  const EntityHandle *conn_tet;
732  int num_nodes_tet;
734  CHKERR mField.get_moab().get_connectivity(ent, conn_tet, num_nodes_tet,
735  true);
736  if (num_nodes_tet != 4)
737  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
738  "data inconsistency");
739  int num_nodes_face;
740  const EntityHandle *conn_face;
741  CHKERR mField.get_moab().get_connectivity(side->ent, conn_face,
742  num_nodes_face, true);
743  if (num_nodes_face != 3)
744  SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
745  if (conn_face[0] != conn_tet[data.facesNodes(side->side_number, 0)])
746  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
747  "data inconsistency");
748  if (conn_face[1] != conn_tet[data.facesNodes(side->side_number, 1)])
749  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
750  "data inconsistency");
751  if (conn_face[2] != conn_tet[data.facesNodes(side->side_number, 2)])
752  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
753  "data inconsistency");
754  }
755  }
757 }
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ getMaxColOrder()

int MoFEM::ForcesAndSourcesCore::getMaxColOrder ( ) const

Get max order of approximation for field in columns.

Definition at line 149 of file ForcesAndSourcesCore.cpp.

149  {
150  return getMaxOrder(*colFieldEntsPtr);
151 }
boost::shared_ptr< const FieldEntity_vector_view > colFieldEntsPtr
Pointer to finite element field entities column view.
static int getMaxOrder(const ENTMULTIINDEX &multi_index)

◆ getMaxDataOrder()

int MoFEM::ForcesAndSourcesCore::getMaxDataOrder ( ) const

Get max order of approximation for data fields.

Method getMaxDataOrder () return maximal order on entities, for all data on the element. So for example if finite element is triangle, and triangle base function have order 4 and on edges base function have order 2, this function return 4.

If finite element has for example 2 or more approximated fields, for example Pressure (order 3) and displacement field (order 5), this function returns 5.

Definition at line 136 of file ForcesAndSourcesCore.cpp.

136  {
137  int max_order = 0;
138  for (auto e : *dataFieldEntsPtr) {
139  const int order = e->getMaxOrder();
140  max_order = (max_order < order) ? order : max_order;
141  }
142  return max_order;
143 }
boost::shared_ptr< const FieldEntity_multiIndex_spaceType_view > dataFieldEntsPtr
Pointer to finite element field entities data view.
const int order
approximation order

◆ getMaxRowOrder()

int MoFEM::ForcesAndSourcesCore::getMaxRowOrder ( ) const

Get max order of approximation for field in rows.

Definition at line 145 of file ForcesAndSourcesCore.cpp.

145  {
146  return getMaxOrder(*rowFieldEntsPtr);
147 }
boost::shared_ptr< const FieldEntity_vector_view > rowFieldEntsPtr
Pointer to finite element field entities row view.
static int getMaxOrder(const ENTMULTIINDEX &multi_index)

◆ getNodesFieldData() [1/2]

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getNodesFieldData ( const boost::string_ref  field_name,
FEDofEntity_multiIndex dofs,
VectorDouble nodes_data,
VectorDofs nodes_dofs,
FieldSpace space,
FieldApproximationBase base 
) const
protected

Get field data on nodes.

Parameters
field_nameName of field
dofsDofs (element) multi index
nodes_dataReturned DOFs values
nodes_dofsVector of pointers to DOFs data structure
spaceGet space on nodes (Only H! is valid)
baseGet base on nodes
Returns
Error code

Definition at line 476 of file ForcesAndSourcesCore.cpp.

479  {
481  auto &dofs_by_name_and_type = dofs.get<Composite_Name_And_Type_mi_tag>();
482  auto tuple = boost::make_tuple(field_name, MBVERTEX);
483  auto dit = dofs_by_name_and_type.lower_bound(tuple);
484  if (dit == dofs_by_name_and_type.end())
485  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
486  "No nodal dofs on element");
487  auto hi_dit = dofs.get<Composite_Name_And_Type_mi_tag>().upper_bound(tuple);
488 
489  if (dit != hi_dit) {
490  auto &first_dof = **dit;
491  space = first_dof.getSpace();
492  base = first_dof.getApproxBase();
493  int num_nodes;
494  CHKERR getNumberOfNodes(num_nodes);
495  const int nb_dof_idx = first_dof.getNbOfCoeffs();
496  const int max_nb_dofs = nb_dof_idx * num_nodes;
497  nodes_data.resize(max_nb_dofs, false);
498  nodes_dofs.resize(max_nb_dofs, false);
499  nodes_data.clear();
500 
501  std::vector<boost::weak_ptr<FEDofEntity>> brother_dofs_vec;
502  for (; dit != hi_dit;) {
503  const auto &dof_ptr = *dit;
504  const auto &dof = *dof_ptr;
505  const auto &sn = *dof.sideNumberPtr;
506  const int side_number = sn.side_number;
507  const int brother_side_number = sn.brother_side_number;
508  if (brother_side_number != -1)
509  brother_dofs_vec.emplace_back(dof_ptr);
510 
511  int pos = side_number * nb_dof_idx;
512  auto ent_filed_data_vec = dof.getEntFieldData();
513  for (int ii = 0; ii != nb_dof_idx; ++ii) {
514  nodes_data[pos] = ent_filed_data_vec[ii];
515  nodes_dofs[pos] = *dit;
516  ++pos;
517  ++dit;
518  }
519  }
520 
521  for (auto &dof_ptr : brother_dofs_vec) {
522  if (const auto d = dof_ptr.lock()) {
523  const auto &sn = d->sideNumberPtr;
524  const int side_number = sn->side_number;
525  const int brother_side_number = sn->brother_side_number;
526  int pos = side_number * nb_dof_idx;
527  int brother_pos = brother_side_number * nb_dof_idx;
528  for (int ii = 0; ii != nb_dof_idx; ++ii) {
529  nodes_data[brother_pos] = nodes_data[pos];
530  nodes_dofs[brother_pos] = nodes_dofs[pos];
531  ++pos;
532  ++brother_pos;
533  }
534  }
535  }
536 
537  } else {
538  nodes_data.resize(0, false);
539  nodes_dofs.resize(0, false);
540  }
541 
543 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T * > &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: dTensor0.hpp:27
#define CHKERR
Inline error check.
Definition: definitions.h:596
MoFEMErrorCode getNumberOfNodes(int &num_nodes) const
Get number of DOFs on element.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ getNodesFieldData() [2/2]

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getNodesFieldData ( DataForcesAndSourcesCore data,
const std::string &  field_name 
) const
protected

Get data on nodes.

Parameters
dataData structure
field_nameField name
Returns
Error code

Definition at line 546 of file ForcesAndSourcesCore.cpp.

547  {
548  return getNodesFieldData(field_name,
549  const_cast<FEDofEntity_multiIndex &>(
550  numeredEntFiniteElementPtr->getDataDofs()),
551  data.dataOnEntities[MBVERTEX][0].getFieldData(),
552  data.dataOnEntities[MBVERTEX][0].getFieldDofs(),
553  data.dataOnEntities[MBVERTEX][0].getSpace(),
554  data.dataOnEntities[MBVERTEX][0].getBase());
555 }
MoFEMErrorCode getNodesFieldData(const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, VectorDouble &nodes_data, VectorDofs &nodes_dofs, FieldSpace &space, FieldApproximationBase &base) const
Get field data on nodes.
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr

◆ getNodesIndices()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getNodesIndices ( const boost::string_ref  field_name,
FENumeredDofEntity_multiIndex dofs,
VectorInt nodes_indices,
VectorInt local_nodes_indices 
) const
protected

get node indices

Definition at line 201 of file ForcesAndSourcesCore.cpp.

203  {
205  auto &dofs_by_type = dofs.get<Composite_Name_And_Type_mi_tag>();
206  auto tuple = boost::make_tuple(field_name, MBVERTEX);
207  auto dit = dofs_by_type.lower_bound(tuple);
208  auto hi_dit = dofs_by_type.upper_bound(tuple);
209 
210  if (dit != hi_dit) {
211 
212  int num_nodes;
213  CHKERR getNumberOfNodes(num_nodes);
214  int max_nb_dofs = 0;
215  const int nb_dofs_on_vert = (*dit)->getNbOfCoeffs();
216  max_nb_dofs = nb_dofs_on_vert * num_nodes;
217  nodes_indices.resize(max_nb_dofs, false);
218  local_nodes_indices.resize(max_nb_dofs, false);
219  if (std::distance(dit, hi_dit) != max_nb_dofs) {
220  std::fill(nodes_indices.begin(), nodes_indices.end(), -1);
221  std::fill(local_nodes_indices.begin(), local_nodes_indices.end(), -1);
222  }
223 
224  for (; dit != hi_dit; dit++) {
225  auto &dof = **dit;
226  const int idx = dof.getPetscGlobalDofIdx();
227  const int local_idx = dof.getPetscLocalDofIdx();
228  const int side_number = dof.sideNumberPtr->side_number;
229  const int pos = side_number * nb_dofs_on_vert + dof.getDofCoeffIdx();
230  nodes_indices[pos] = idx;
231  local_nodes_indices[pos] = local_idx;
232  const int brother_side_number =
233  (*dit)->sideNumberPtr->brother_side_number;
234  if (brother_side_number != -1) {
235  const int elem_idx =
236  brother_side_number * nb_dofs_on_vert + (*dit)->getDofCoeffIdx();
237  nodes_indices[elem_idx] = idx;
238  local_nodes_indices[elem_idx] = local_idx;
239  }
240  }
241 
242  } else {
243  nodes_indices.resize(0, false);
244  local_nodes_indices.resize(0, false);
245  }
246 
248 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define CHKERR
Inline error check.
Definition: definitions.h:596
MoFEMErrorCode getNumberOfNodes(int &num_nodes) const
Get number of DOFs on element.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ getNoFieldColIndices()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getNoFieldColIndices ( DataForcesAndSourcesCore data,
const std::string &  field_name 
) const
protected

get col NoField indices

Definition at line 352 of file ForcesAndSourcesCore.cpp.

353  {
355  if (data.dataOnEntities[MBENTITYSET].size() == 0) {
356  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
357  }
358  CHKERR getNoFieldIndices(field_name,
359  const_cast<FENumeredDofEntity_multiIndex &>(
360  numeredEntFiniteElementPtr->getColsDofs()),
361  data.dataOnEntities[MBENTITYSET][0].getIndices());
363 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
#define CHKERR
Inline error check.
Definition: definitions.h:596
MoFEMErrorCode getNoFieldIndices(const std::string &field_name, FENumeredDofEntity_multiIndex &dofs, VectorInt &nodes_indices) const
get NoField indices
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ getNoFieldFieldData() [1/2]

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getNoFieldFieldData ( const boost::string_ref  field_name,
FEDofEntity_multiIndex dofs,
VectorDouble ent_field_data,
VectorDofs ent_field_dofs 
) const
protected

Definition at line 633 of file ForcesAndSourcesCore.cpp.

635  {
637  auto dit = dofs.get<FieldName_mi_tag>().lower_bound(field_name);
638  auto hi_dit = dofs.get<FieldName_mi_tag>().upper_bound(field_name);
639  int size = std::distance(dit, hi_dit);
640  ent_field_data.resize(size, false);
641  ent_field_dofs.resize(size, false);
642  for (; dit != hi_dit; dit++) {
643  int idx = (*dit)->getDofCoeffIdx();
644  ent_field_data[idx] = (*dit)->getFieldData();
645  ent_field_dofs[idx] = *dit;
646  }
648 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508

◆ getNoFieldFieldData() [2/2]

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getNoFieldFieldData ( DataForcesAndSourcesCore data,
const boost::string_ref  field_name 
) const
protected

Definition at line 650 of file ForcesAndSourcesCore.cpp.

651  {
653  if (data.dataOnEntities[MBENTITYSET].size() == 0) {
654  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
655  }
657  field_name,
658  const_cast<FEDofEntity_multiIndex &>(
659  numeredEntFiniteElementPtr->getDataDofs()),
660  data.dataOnEntities[MBENTITYSET][0].getFieldData(),
661  data.dataOnEntities[MBENTITYSET][0].getFieldDofs());
663 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
MoFEMErrorCode getNoFieldFieldData(const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, VectorDouble &ent_field_data, VectorDofs &ent_field_dofs) const
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ getNoFieldIndices()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getNoFieldIndices ( const std::string &  field_name,
FENumeredDofEntity_multiIndex dofs,
VectorInt nodes_indices 
) const
protected

get NoField indices

Definition at line 325 of file ForcesAndSourcesCore.cpp.

327  {
329  auto dit = dofs.get<FieldName_mi_tag>().lower_bound(field_name);
330  auto hi_dit = dofs.get<FieldName_mi_tag>().upper_bound(field_name);
331  indices.resize(std::distance(dit, hi_dit));
332  for (; dit != hi_dit; dit++) {
333  int idx = (*dit)->getPetscGlobalDofIdx();
334  indices[(*dit)->getDofCoeffIdx()] = idx;
335  }
337 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508

◆ getNoFieldRowIndices()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getNoFieldRowIndices ( DataForcesAndSourcesCore data,
const std::string &  field_name 
) const
protected

get col NoField indices

Definition at line 339 of file ForcesAndSourcesCore.cpp.

340  {
342  if (data.dataOnEntities[MBENTITYSET].size() == 0) {
343  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
344  }
345  CHKERR getNoFieldIndices(field_name,
346  const_cast<FENumeredDofEntity_multiIndex &>(
347  numeredEntFiniteElementPtr->getRowsDofs()),
348  data.dataOnEntities[MBENTITYSET][0].getIndices());
350 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
#define CHKERR
Inline error check.
Definition: definitions.h:596
MoFEMErrorCode getNoFieldIndices(const std::string &field_name, FENumeredDofEntity_multiIndex &dofs, VectorInt &nodes_indices) const
get NoField indices
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ getNumberOfNodes()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getNumberOfNodes ( int num_nodes) const

Get number of DOFs on element.

Definition at line 72 of file ForcesAndSourcesCore.cpp.

72  {
74 
76  switch (mField.get_moab().type_from_handle(ent)) {
77  case MBVERTEX:
78  num_nodes = 1;
79  break;
80  case MBEDGE:
81  num_nodes = 2;
82  break;
83  case MBTRI:
84  num_nodes = 3;
85  break;
86  case MBQUAD:
87  num_nodes = 4;
88  break;
89  case MBTET:
90  num_nodes = 4;
91  break;
92  case MBPRISM:
93  num_nodes = 6;
94  break;
95  default:
96  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
97  }
98 
100 }
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr

◆ getOpPtrVector()

boost::ptr_vector<UserDataOperator>& MoFEM::ForcesAndSourcesCore::getOpPtrVector ( )

Use to push back operator for row operator.

It can be used to calculate nodal forces or other quantities on the mesh.

Examples
continuity_check_on_skeleton_3d.cpp, continuity_check_on_skeleton_with_simple_2d.cpp, elasticity_mixed_formulation.cpp, EshelbianPlasticity.cpp, forces_and_sources_testing_edge_element.cpp, forces_and_sources_testing_flat_prism_element.cpp, MagneticElement.hpp, and prisms_elements_from_surface.cpp.

Definition at line 381 of file ForcesAndSourcesCore.hpp.

381 { return opPtrVector; }
boost::ptr_vector< UserDataOperator > opPtrVector
Vector of finite element users data operators.

◆ getProblemNodesColIndices()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getProblemNodesColIndices ( const std::string &  field_name,
VectorInt nodes_indices 
) const
protected

Definition at line 460 of file ForcesAndSourcesCore.cpp.

461  {
462  return getProblemNodesIndices(field_name, *(problemPtr->numeredDofsCols),
463  nodes_indices);
464 }
const Problem * problemPtr
raw pointer to problem
boost::shared_ptr< NumeredDofEntity_multiIndex > numeredDofsCols
store DOFs on columns for this problem
MoFEMErrorCode getProblemNodesIndices(const std::string &field_name, const NumeredDofEntity_multiIndex &dofs, VectorInt &nodes_indices) const
get indices of nodal indices which are declared for problem but not this particular element

◆ getProblemNodesIndices()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getProblemNodesIndices ( const std::string &  field_name,
const NumeredDofEntity_multiIndex dofs,
VectorInt nodes_indices 
) const
protected

get indices of nodal indices which are declared for problem but not this particular element

Definition at line 367 of file ForcesAndSourcesCore.cpp.

369  {
371  nodes_indices.resize(0);
372  auto &side_table = const_cast<SideNumber_multiIndex &>(
373  numeredEntFiniteElementPtr->getSideNumberTable());
374  auto siit = side_table.get<1>().lower_bound(boost::make_tuple(MBVERTEX, 0));
375  auto hi_siit =
376  side_table.get<1>().lower_bound(boost::make_tuple(MBVERTEX, 10000));
377 
378  int nn = 0;
379  for (; siit != hi_siit; siit++, nn++) {
380 
381  if (siit->get()->side_number == -1)
382  continue;
383 
384  const EntityHandle ent = siit->get()->ent;
385  auto dit =
386  dofs.get<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>().lower_bound(
387  boost::make_tuple(field_name, ent, 0));
388  auto hi_dit =
389  dofs.get<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>().upper_bound(
390  boost::make_tuple(field_name, ent, 10000)); /// very large number
391  if (dit != hi_dit) {
392  if (!nn) {
393  nodes_indices.resize((*dit)->getNbOfCoeffs() *
394  std::distance(siit, hi_siit));
395  }
396  for (; dit != hi_dit; dit++) {
397  nodes_indices[siit->get()->side_number * (*dit)->getNbOfCoeffs() +
398  (*dit)->getDofCoeffIdx()] =
399  (*dit)->getPetscGlobalDofIdx();
400  }
401  }
402  }
403 
405 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr

◆ getProblemNodesRowIndices()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getProblemNodesRowIndices ( const std::string &  field_name,
VectorInt nodes_indices 
) const
protected

Definition at line 446 of file ForcesAndSourcesCore.cpp.

447  {
448  return getProblemNodesIndices(field_name, *(problemPtr->numeredDofsRows),
449  nodes_indices);
450 }
const Problem * problemPtr
raw pointer to problem
boost::shared_ptr< NumeredDofEntity_multiIndex > numeredDofsRows
store DOFs on rows for this problem
MoFEMErrorCode getProblemNodesIndices(const std::string &field_name, const NumeredDofEntity_multiIndex &dofs, VectorInt &nodes_indices) const
get indices of nodal indices which are declared for problem but not this particular element

◆ getProblemTypeColIndices()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getProblemTypeColIndices ( const std::string &  field_name,
EntityType  type,
int  side_number,
VectorInt indices 
) const
protected

Definition at line 467 of file ForcesAndSourcesCore.cpp.

469  {
470  return getProblemTypeIndices(field_name, *(problemPtr->numeredDofsCols), type,
471  side_number, indices);
472 }
const Problem * problemPtr
raw pointer to problem
MoFEMErrorCode getProblemTypeIndices(const std::string &field_name, const NumeredDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorInt &indices) const
get indices by type (generic function) which are declared for problem but not this particular element
boost::shared_ptr< NumeredDofEntity_multiIndex > numeredDofsCols
store DOFs on columns for this problem

◆ getProblemTypeIndices()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getProblemTypeIndices ( const std::string &  field_name,
const NumeredDofEntity_multiIndex dofs,
EntityType  type,
int  side_number,
VectorInt indices 
) const
protected

get indices by type (generic function) which are declared for problem but not this particular element

Definition at line 407 of file ForcesAndSourcesCore.cpp.

409  {
411 
412  indices.resize(0);
413 
414  auto &side_table = const_cast<SideNumber_multiIndex &>(
415  numeredEntFiniteElementPtr->getSideNumberTable());
416  auto siit =
417  side_table.get<1>().lower_bound(boost::make_tuple(type, side_number));
418  auto hi_siit =
419  side_table.get<1>().upper_bound(boost::make_tuple(type, side_number));
420 
421  for (; siit != hi_siit; siit++) {
422 
423  if (siit->get()->side_number == -1)
424  continue;
425 
426  const EntityHandle ent = siit->get()->ent;
427  NumeredDofEntity_multiIndex::index<
428  Composite_Name_And_Ent_And_EntDofIdx_mi_tag>::type::iterator dit,
429  hi_dit;
430  dit = dofs.get<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>().lower_bound(
431  boost::make_tuple(field_name, ent, 0));
432  hi_dit =
433  dofs.get<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>().upper_bound(
434  boost::make_tuple(field_name, ent, 10000)); /// very large number
435 
436  indices.resize(std::distance(dit, hi_dit));
437  for (; dit != hi_dit; dit++) {
438 
439  indices[(*dit)->getEntDofIdx()] = (*dit)->getPetscGlobalDofIdx();
440  }
441  }
442 
444 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr

◆ getProblemTypeRowIndices()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getProblemTypeRowIndices ( const std::string &  field_name,
EntityType  type,
int  side_number,
VectorInt indices 
) const
protected

Definition at line 453 of file ForcesAndSourcesCore.cpp.

455  {
456  return getProblemTypeIndices(field_name, *(problemPtr->numeredDofsRows), type,
457  side_number, indices);
458 }
const Problem * problemPtr
raw pointer to problem
boost::shared_ptr< NumeredDofEntity_multiIndex > numeredDofsRows
store DOFs on rows for this problem
MoFEMErrorCode getProblemTypeIndices(const std::string &field_name, const NumeredDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorInt &indices) const
get indices by type (generic function) which are declared for problem but not this particular element

◆ getRowNodesIndices()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getRowNodesIndices ( DataForcesAndSourcesCore data,
const std::string &  field_name 
) const
protected

get row node indices from FENumeredDofEntity_multiIndex

Definition at line 251 of file ForcesAndSourcesCore.cpp.

252  {
253  return getNodesIndices(field_name,
254  const_cast<FENumeredDofEntity_multiIndex &>(
255  numeredEntFiniteElementPtr->getRowsDofs()),
256  data.dataOnEntities[MBVERTEX][0].getIndices(),
257  data.dataOnEntities[MBVERTEX][0].getLocalIndices());
258 }
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
MoFEMErrorCode getNodesIndices(const boost::string_ref field_name, FENumeredDofEntity_multiIndex &dofs, VectorInt &nodes_indices, VectorInt &local_nodes_indices) const
get node indices

◆ getRule() [1/2]

int MoFEM::ForcesAndSourcesCore::getRule ( int  order_row,
int  order_col,
int  order_data 
)
protectedvirtual

another variant of getRule

Parameters
order_roworder of base function on row
order_colorder of base function on columns
order_dataorder of base function approximating data
Returns
integration rule

This function is overloaded by the user. The integration rule is set such that specific operator implemented by the user is integrated accurately. For example if user implement bilinear operator

\[ b(u,v) = \int_\mathcal{T} \frac{\partial u_i}{\partial x_j}\frac{\partial v_i}{\partial x_j} \textrm{d}\mathcal{T} \]

then if \(u\) and \(v\) are polynomial of given order, then exact integral would be

int getRule(int order) { return
2*(order-1); };

The integration points and weights are set appropriately for given entity type and integration rule from quad.c

Method ForcesAndSourcesCore::getRule takes at argument takes maximal polynomial order set on the element on all fields defined on the element. If a user likes to have more control, another variant of this function can be called which distinguishing between field orders on rows, columns and data, the i.e. first argument of a bilinear form, the second argument of bilinear form and field coefficients on the element.

Note
If user set rule to -1 or any other negative integer, then method ForcesAndSourcesCore::setGaussPts is called. In that method user can implement own (specific) integration method.
Bug:
this function should be const

Definition at line 1164 of file ForcesAndSourcesCore.cpp.

1165  {
1166  return getRuleHook ? getRuleHook(order_row, order_col, order_data)
1167  : getRule(order_data);
1168 }
virtual int getRule(int order_row, int order_col, int order_data)
another variant of getRule
RuleHookFun getRuleHook
Hook to get rule.

◆ getRule() [2/2]

int MoFEM::ForcesAndSourcesCore::getRule ( int  order)
protectedvirtual

◆ getSpacesAndBaseOnEntities()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getSpacesAndBaseOnEntities ( DataForcesAndSourcesCore data) const
protected

Get field approximation space and base on entities.

Definition at line 761 of file ForcesAndSourcesCore.cpp.

762  {
764 
765  if (nInTheLoop == 0) {
766  data.sPace.reset();
767  data.bAse.reset();
768  for (EntityType t = MBVERTEX; t != MBMAXTYPE; ++t) {
769  data.spacesOnEntities[t].reset();
770  data.basesOnEntities[t].reset();
771  }
772  for (int s = 0; s != LASTSPACE; ++s) {
773  data.basesOnSpaces[s].reset();
774  }
775  }
776 
777  if (dataFieldEntsPtr)
778  for (auto e : *dataFieldEntsPtr) {
779  // get data from entity
780  const EntityType type = e->getEntType();
781  const FieldSpace space = e->getSpace();
782  const FieldApproximationBase approx = e->getApproxBase();
783 
784  // set data
785  data.sPace.set(space);
786  data.bAse.set(approx);
787  data.spacesOnEntities[type].set(space);
788  data.basesOnEntities[type].set(approx);
789  data.basesOnSpaces[space].set(approx);
790  }
791  else
792  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
793  "data fields ents not allocated on element");
794 
796 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:175
FieldApproximationBase
approximation base
Definition: definitions.h:143
FieldSpace
approximation spaces
Definition: definitions.h:168
int nInTheLoop
number currently of processed method
boost::shared_ptr< const FieldEntity_multiIndex_spaceType_view > dataFieldEntsPtr
Pointer to finite element field entities data view.

◆ getUserPolynomialBase()

auto& MoFEM::ForcesAndSourcesCore::getUserPolynomialBase ( )

Get the User Polynomial Base object.

Returns
boost::shared_ptr<BaseFunction>&
Examples
EshelbianPlasticity.cpp.

Definition at line 395 of file ForcesAndSourcesCore.hpp.

395 { return userPolynomialBasePtr; }
boost::shared_ptr< BaseFunction > userPolynomialBasePtr
Pointer to user polynomail base.

◆ loopOverOperators()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::loopOverOperators ( )
protected

Iterate user data operators.

Returns
MoFEMErrorCode

Definition at line 912 of file ForcesAndSourcesCore.cpp.

912  {
914 
915  const EntityType type = numeredEntFiniteElementPtr->getEntType();
918  std::vector<std::string> last_eval_field_name(2);
919 
920  boost::ptr_vector<UserDataOperator>::iterator oit, hi_oit;
921  oit = opPtrVector.begin();
922  hi_oit = opPtrVector.end();
923 
924  for (; oit != hi_oit; oit++) {
925 
926  oit->setPtrFE(this);
927 
928  if (oit->opType == UserDataOperator::OPLAST) {
929 
930  // Set field
931  switch (oit->sPace) {
932  case NOSPACE:
933  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Unknown space");
934  case NOFIELD:
935  case H1:
936  case HCURL:
937  case HDIV:
938  case L2:
939  break;
940  default:
941  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
942  "Not implemented for this space", oit->sPace);
943  }
944 
945  // Reseat all data which all field dependent
946  dataOnElement[oit->sPace]->resetFieldDependentData();
947  last_eval_field_name[0] = "";
948 
949  // Run operator
950  try {
951  CHKERR oit->opRhs(*dataOnElement[oit->sPace], oit->doVertices,
952  oit->doEdges, oit->doQuads, oit->doTris, oit->doTets,
953  false);
954  }
955  CATCH_OP_ERRORS(*oit);
956 
957  } else {
958 
959  boost::shared_ptr<DataForcesAndSourcesCore> op_data[2];
960 
961  for (int ss = 0; ss != 2; ss++) {
962 
963  const std::string field_name =
964  !ss ? oit->rowFieldName : oit->colFieldName;
965  const Field *field_struture = mField.get_field_structure(field_name);
966  const BitFieldId data_id = field_struture->getId();
967  const FieldSpace space = field_struture->getSpace();
968  op_data[ss] = !ss ? dataOnElement[space] : derivedDataOnElement[space];
969 
970  if ((oit->getNumeredEntFiniteElementPtr()->getBitFieldIdData() &
971  data_id)
972  .none()) {
973  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
974  "no data field < %s > on finite element < %s >",
975  field_name.c_str(), feName.c_str());
976  }
977 
978  if (oit->getOpType() & types[ss] ||
979  oit->getOpType() & UserDataOperator::OPROWCOL) {
980 
981  switch (space) {
982  case NOSPACE:
983  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown space");
984  break;
985  case NOFIELD:
986  case H1:
987  case HCURL:
988  case HDIV:
989  case L2:
990  break;
991  default:
992  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
993  "Not implemented for this space", space);
994  }
995 
996  if (last_eval_field_name[ss] != field_name) {
997 
998  CHKERR getEntityFieldData(*op_data[ss], field_name, MBEDGE);
999  if (!ss)
1000  CHKERR getEntityRowIndices(*op_data[ss], field_name, MBEDGE);
1001  else
1002  CHKERR getEntityColIndices(*op_data[ss], field_name, MBEDGE);
1003 
1004  switch (space) {
1005  case NOSPACE:
1006  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1007  "unknown space");
1008  break;
1009  case H1:
1010  if (!ss)
1011  CHKERR getRowNodesIndices(*op_data[ss], field_name);
1012  else
1013  CHKERR getColNodesIndices(*op_data[ss], field_name);
1014  CHKERR getNodesFieldData(*op_data[ss], field_name);
1015  break;
1016  case HCURL:
1017  case HDIV:
1018  break;
1019  case L2:
1020  switch (type) {
1021  case MBVERTEX:
1022  CHKERR getNodesFieldData(*op_data[ss], field_name);
1023  break;
1024  default:
1025  break;
1026  }
1027  break;
1028  case NOFIELD:
1029  if (!getNinTheLoop()) {
1030  // NOFIELD data are the same for each element, can be
1031  // retrieved only once
1032  if (!ss) {
1033  CHKERR getNoFieldRowIndices(*op_data[ss], field_name);
1034  } else {
1035  CHKERR getNoFieldColIndices(*op_data[ss], field_name);
1036  }
1037  CHKERR getNoFieldFieldData(*op_data[ss], field_name);
1038  }
1039  break;
1040  default:
1041  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
1042  "Not implemented for this space", space);
1043  }
1044  last_eval_field_name[ss] = field_name;
1045  }
1046  }
1047  }
1048 
1049  if (oit->getOpType() & UserDataOperator::OPROW) {
1050  try {
1051  CHKERR oit->opRhs(*op_data[0], false);
1052  }
1053  CATCH_OP_ERRORS(*oit);
1054  }
1055 
1056  if (oit->getOpType() & UserDataOperator::OPCOL) {
1057  try {
1058  CHKERR oit->opRhs(*op_data[1], false);
1059  }
1060  CATCH_OP_ERRORS(*oit);
1061  }
1062 
1063  if (oit->getOpType() & UserDataOperator::OPROWCOL) {
1064  try {
1065  CHKERR oit->opLhs(*op_data[0], *op_data[1], oit->sYmm);
1066  }
1067  CATCH_OP_ERRORS(*oit);
1068  }
1069  }
1070  }
1072 }
boost::ptr_vector< UserDataOperator > opPtrVector
Vector of finite element users data operators.
field with continuous normal traction
Definition: definitions.h:173
MoFEMErrorCode getNoFieldColIndices(DataForcesAndSourcesCore &data, const std::string &field_name) const
get col NoField indices
MoFEMErrorCode getColNodesIndices(DataForcesAndSourcesCore &data, const std::string &field_name) const
get col node indices from FENumeredDofEntity_multiIndex
const boost::shared_ptr< DataForcesAndSourcesCore > derivedDataOnElement[LASTSPACE]
Entity data on element entity columns fields.
scalar or vector of scalars describe (no true field)
Definition: definitions.h:170
MoFEMErrorCode getNodesFieldData(const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, VectorDouble &nodes_data, VectorDofs &nodes_dofs, FieldSpace &space, FieldApproximationBase &base) const
Get field data on nodes.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
const boost::shared_ptr< DataForcesAndSourcesCore > dataOnElement[LASTSPACE]
Entity data on element entity rows fields.
std::string feName
Name of finite element.
int getNinTheLoop() const
get number of evaluated element in the loop
MoFEMErrorCode getNoFieldRowIndices(DataForcesAndSourcesCore &data, const std::string &field_name) const
get col NoField indices
OpType
Controls loop over entities on element.
MoFEMErrorCode getNoFieldFieldData(const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, VectorDouble &ent_field_data, VectorDofs &ent_field_dofs) const
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
#define CATCH_OP_ERRORS(OP)
field with continuous tangents
Definition: definitions.h:172
FieldSpace
approximation spaces
Definition: definitions.h:168
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:53
#define CHKERR
Inline error check.
Definition: definitions.h:596
MoFEMErrorCode getEntityFieldData(DataForcesAndSourcesCore &data, const std::string &field_name, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const
MoFEMErrorCode getEntityColIndices(DataForcesAndSourcesCore &data, const std::string &field_name, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
continuous field
Definition: definitions.h:171
virtual const Field * get_field_structure(const std::string &name)=0
get field structure
MoFEMErrorCode getRowNodesIndices(DataForcesAndSourcesCore &data, const std::string &field_name) const
get row node indices from FENumeredDofEntity_multiIndex
MoFEMErrorCode getEntityRowIndices(DataForcesAndSourcesCore &data, const std::string &field_name, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const
field with C-1 continuity
Definition: definitions.h:174

◆ operator()()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::operator() ( )
virtual

function is run for every finite element

It is used to calculate element local matrices and assembly. It can be used for post-processing.

Reimplemented from MoFEM::BasicMethod.

Reimplemented in MoFEM::VolumeElementForcesAndSourcesCoreSwitch< SWITCH >, MoFEM::FaceElementForcesAndSourcesCoreSwitch< SWITCH >, MoFEM::FatPrismElementForcesAndSourcesCore, MoFEM::FlatPrismElementForcesAndSourcesCore, MoFEM::VolumeElementForcesAndSourcesCoreOnSideSwitch< SWITCH >, MoFEM::EdgeElementForcesAndSourcesCoreSwitch< SWITCH >, MoFEM::FaceElementForcesAndSourcesCoreOnSideSwitch< SWITCH >, MoFEM::FaceElementForcesAndSourcesCoreOnSideSwitch< FaceElementForcesAndSourcesCore::NO_HO_GEOMETRY >, and MoFEM::VertexElementForcesAndSourcesCore.

Definition at line 1210 of file ForcesAndSourcesCore.cpp.

1210  {
1212  if (operatorHook) {
1213  ierr = operatorHook();
1214  CHKERRG(ierr);
1215  }
1217 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:544
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
boost::function< MoFEMErrorCode()> operatorHook
Hook function for operator.

◆ postProcess()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::postProcess ( )
virtual

function is run at the end of loop

It is used to assembly matrices and vectors, calculating global variables, f.e. total internal energy, ect.

Iterating over dofs: Example1 iterating over dofs in row by name of the field for(IT_GET_FEROW_BY_NAME_DOFS_FOR_LOOP(this,"DISPLACEMENT",it)) { ... }

Reimplemented from MoFEM::BasicMethod.

Reimplemented in PostProcFatPrismOnRefinedMesh, SolidShellModule::SolidShellPrismElement::PostProcFatPrismOnTriangleOnRefinedMesh, PostProcTemplateVolumeOnRefinedMesh< MoFEM::VolumeElementForcesAndSourcesCore >, GelModule::Gel::GelFE, KelvinVoigtDamper::DamperFE, SolidShellModule::SolidShellPrismElement::SolidShellError, SolidShellModule::SolidShellPrismElement::SolidShell, Smoother::MyVolumeFE, and NonlinearElasticElement::MyVolumeFE.

Definition at line 1218 of file ForcesAndSourcesCore.cpp.

1218  {
1220  if (postProcessHook) {
1221  ierr = postProcessHook();
1222  CHKERRG(ierr);
1223  }
1225 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:544
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
boost::function< MoFEMErrorCode()> postProcessHook
Hook function for post-processing.

◆ preProcess()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::preProcess ( )
virtual

function is run at the beginning of loop

It is used to zeroing matrices and vectors, calculation of shape functions on reference element, preprocessing boundary conditions, etc.

Reimplemented from MoFEM::BasicMethod.

Reimplemented in EdgeSlidingConstrains::MyEdgeFE, PostProcFatPrismOnRefinedMesh, PostProcTemplateVolumeOnRefinedMesh< MoFEM::VolumeElementForcesAndSourcesCore >, GelModule::Gel::GelFE, KelvinVoigtDamper::DamperFE, SolidShellModule::SolidShellPrismElement::SolidShellError, SolidShellModule::SolidShellPrismElement::SolidShell, Smoother::MyVolumeFE, and NonlinearElasticElement::MyVolumeFE.

Definition at line 1202 of file ForcesAndSourcesCore.cpp.

1202  {
1204  if (preProcessHook) {
1205  ierr = preProcessHook();
1206  CHKERRG(ierr);
1207  }
1209 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:544
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
boost::function< MoFEMErrorCode()> preProcessHook
Hook function for pre-processing.

◆ setGaussPts() [1/2]

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::setGaussPts ( int  order_row,
int  order_col,
int  order_data 
)
protectedvirtual

set user specific integration rule

This function allows for user defined integration rule. The key is to called matrix gaussPts, which is used by other MoFEM procedures. Matrix has number of rows equal to problem dimension plus one, where last index is used to store weight values. Number of columns is equal to number of integration points.

Note
This function is called if method ForcesAndSourcesCore::getRule is returning integer -1 or any other negative integer.

User sets

where

gaussPts.resize(dim+1,nb_gauss_pts);

number rows represents local coordinates of integration points in reference element, where last index in row is for integration weight.

Definition at line 1170 of file ForcesAndSourcesCore.cpp.

1171  {
1172  return setRuleHook ? setRuleHook(order_row, order_col, order_data)
1173  : setGaussPts(order_data);
1174 }
virtual MoFEMErrorCode setGaussPts(int order_row, int order_col, int order_data)
set user specific integration rule
RuleHookFun setRuleHook
Set function to calculate integration rule.

◆ setGaussPts() [2/2]

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::setGaussPts ( int  order)
protectedvirtual
Deprecated:
setGaussPts(int row_order, int col_order, int data order);
Deprecated:
setGaussPts(int row_order, int col_order, int data order);

Reimplemented in PostProcTemplateVolumeOnRefinedMesh< MoFEM::VolumeElementForcesAndSourcesCore >, NitscheMethod::MyVolumeFE, MoFEM::VolumeElementForcesAndSourcesCoreOnSideBase, and MoFEM::FaceElementForcesAndSourcesCoreOnSideBase.

Definition at line 1180 of file ForcesAndSourcesCore.cpp.

1180  {
1182  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Sorry, not implemented");
1184 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508

◆ setSideFEPtr()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::setSideFEPtr ( const ForcesAndSourcesCore side_fe_ptr)
private

Set the pointer to face element on the side.

Note
Function is is used by face element, while it iterates over elements on the side
Parameters
side_fe_ptr
Returns
MoFEMErrorCode

Definition at line 1109 of file ForcesAndSourcesCore.cpp.

1109  {
1111  sidePtrFE = const_cast<ForcesAndSourcesCore *>(side_fe_ptr);
1113 }
ForcesAndSourcesCore * sidePtrFE
Element to integrate on the sides.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508

Friends And Related Function Documentation

◆ FaceElementForcesAndSourcesCoreOnSideBase

Definition at line 814 of file ForcesAndSourcesCore.hpp.

◆ UserDataOperator

friend class UserDataOperator
friend

◆ VolumeElementForcesAndSourcesCoreOnSideBase

Definition at line 813 of file ForcesAndSourcesCore.hpp.

Member Data Documentation

◆ dataH1

DataForcesAndSourcesCore& MoFEM::ForcesAndSourcesCore::dataH1
protected

Definition at line 765 of file ForcesAndSourcesCore.hpp.

◆ dataHcurl

DataForcesAndSourcesCore& MoFEM::ForcesAndSourcesCore::dataHcurl
protected

Definition at line 766 of file ForcesAndSourcesCore.hpp.

◆ dataHdiv

DataForcesAndSourcesCore& MoFEM::ForcesAndSourcesCore::dataHdiv
protected

Definition at line 767 of file ForcesAndSourcesCore.hpp.

◆ dataL2

DataForcesAndSourcesCore& MoFEM::ForcesAndSourcesCore::dataL2
protected

Definition at line 768 of file ForcesAndSourcesCore.hpp.

◆ dataNoField

DataForcesAndSourcesCore& MoFEM::ForcesAndSourcesCore::dataNoField
protected

Definition at line 764 of file ForcesAndSourcesCore.hpp.

◆ dataOnElement

const boost::shared_ptr<DataForcesAndSourcesCore> MoFEM::ForcesAndSourcesCore::dataOnElement[LASTSPACE]
protected

Entity data on element entity rows fields.

@/}

Definition at line 755 of file ForcesAndSourcesCore.hpp.

◆ derivedDataOnElement

const boost::shared_ptr<DataForcesAndSourcesCore> MoFEM::ForcesAndSourcesCore::derivedDataOnElement[LASTSPACE]
protected

Entity data on element entity columns fields.

Definition at line 762 of file ForcesAndSourcesCore.hpp.

◆ elementPolynomialBasePtr

boost::shared_ptr<BaseFunction> MoFEM::ForcesAndSourcesCore::elementPolynomialBasePtr
private

Pointer to entity polynomial base.

Definition at line 789 of file ForcesAndSourcesCore.hpp.

◆ gaussPts

MatrixDouble MoFEM::ForcesAndSourcesCore::gaussPts

Matrix of integration points.

Columns is equal to number of integration points, numver of rows depends on dimension of finite element entity, for example for tetrahedron rows are x,y,z,weight. Last row is integration weight.

FIXME: that should be moved to private class data and acessed only by member function

Definition at line 407 of file ForcesAndSourcesCore.hpp.

◆ getRuleHook

RuleHookFun MoFEM::ForcesAndSourcesCore::getRuleHook

Hook to get rule.

Todo:
check preferred format how works with gcc and clang, see http://www.boost.org/doc/libs/1_64_0/doc/html/function/tutorial.html#idp247873024

Definition at line 50 of file ForcesAndSourcesCore.hpp.

◆ lastEvaluatedElementEntityType

EntityType MoFEM::ForcesAndSourcesCore::lastEvaluatedElementEntityType
private

Last evaluated type of element entity.

Definition at line 783 of file ForcesAndSourcesCore.hpp.

◆ mField

Interface& MoFEM::ForcesAndSourcesCore::mField

Definition at line 36 of file ForcesAndSourcesCore.hpp.

◆ opPtrVector

boost::ptr_vector<UserDataOperator> MoFEM::ForcesAndSourcesCore::opPtrVector
protected

Vector of finite element users data operators.

Definition at line 774 of file ForcesAndSourcesCore.hpp.

◆ setRuleHook

RuleHookFun MoFEM::ForcesAndSourcesCore::setRuleHook

Set function to calculate integration rule.

Definition at line 56 of file ForcesAndSourcesCore.hpp.

◆ sidePtrFE

ForcesAndSourcesCore* MoFEM::ForcesAndSourcesCore::sidePtrFE
private

Element to integrate on the sides.

Definition at line 800 of file ForcesAndSourcesCore.hpp.

◆ userPolynomialBasePtr

boost::shared_ptr<BaseFunction> MoFEM::ForcesAndSourcesCore::userPolynomialBasePtr
private

Pointer to user polynomail base.

Definition at line 794 of file ForcesAndSourcesCore.hpp.


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