v0.8.20
Classes | Public Types | Public Member Functions | Public Attributes | Private Attributes | 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)
 
virtual ~ForcesAndSourcesCore ()
 
MoFEMErrorCode getNumberOfNodes (int &num_nodes) const
 
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 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 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...
 
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
 
MoFEMErrorCode getFaceTriNodes (DataForcesAndSourcesCore &data) const
 Get nodes on triangles. More...
 
MoFEMErrorCode getSpacesAndBaseOnEntities (DataForcesAndSourcesCore &data) const
 Get field approximation space and base on entities. More...
 
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
 
virtual int getRule (int order)
 set integration rule for finite element More...
 
virtual int getRule (int order_row, int order_col, int order_data)
 another variant of getRule More...
 
virtual MoFEMErrorCode setGaussPts (int order)
 It will be removed in the future use other variant. More...
 
virtual MoFEMErrorCode setGaussPts (int order_row, int order_col, int order_data)
 set user specific integration rule More...
 
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...
 
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...
 
- 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
 
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
 
RuleHookFun getRuleHook
 Hook to get rule. More...
 
boost::ptr_vector< UserDataOperatoropPtrVector
 Vector of finite element users data operators. 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...
 
- 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
 

Private Attributes

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

Additional Inherited Members

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

Detailed Description

structure to get information form mofem into DataForcesAndSourcesCore

Examples:
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 300 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),
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()),
DataForcesAndSourcesCore & dataL2
field with continuous normal traction
Definition: definitions.h:171
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:168
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:170
DataForcesAndSourcesCore & dataHdiv
continuous field
Definition: definitions.h:169
field with C-1 continuity
Definition: definitions.h:172
DataForcesAndSourcesCore & dataNoField

◆ ~ForcesAndSourcesCore()

virtual MoFEM::ForcesAndSourcesCore::~ForcesAndSourcesCore ( )
virtual

Definition at line 63 of file ForcesAndSourcesCore.hpp.

63 {}

Member Function Documentation

◆ calculateBaseFunctionsOnElement() [1/2]

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

Calculate base functions.

Returns
Error code

Definition at line 801 of file ForcesAndSourcesCore.cpp.

802  {
804  if (dataOnElement[H1]->bAse.test(b)) {
805  switch (static_cast<FieldApproximationBase>(b)) {
806  case NOBASE:
807  break;
811  if (!getElementPolynomialBase()) {
812  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
813  "Functions genrating approximation base not defined");
814  }
815  for (int space = H1; space != LASTSPACE; ++space) {
816  if (dataOnElement[H1]->sPace.test(space) &&
817  dataOnElement[H1]->bAse.test(b) &&
818  dataOnElement[H1]->basesOnSpaces[space].test(b)) {
819  CHKERR getElementPolynomialBase()->getValue(
820  gaussPts,
821  boost::shared_ptr<BaseFunctionCtx>(new EntPolynomialBaseCtx(
822  *dataOnElement[space], static_cast<FieldSpace>(space),
823  static_cast<FieldApproximationBase>(b), NOBASE)));
824  }
825  }
826  break;
827  case USER_BASE:
828  if (!getUserPolynomialBase()) {
829  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
830  "Functions genrating user approximation base not defined");
831  }
832  for (int space = H1; space != LASTSPACE; ++space)
833  if (dataOnElement[H1]->sPace.test(space) &&
834  dataOnElement[H1]->bAse.test(b) &&
835  dataOnElement[H1]->basesOnSpaces[space].test(b)) {
836  CHKERR getUserPolynomialBase()->getValue(
837  gaussPts,
838  boost::shared_ptr<BaseFunctionCtx>(new EntPolynomialBaseCtx(
839  *dataOnElement[space], static_cast<FieldSpace>(space),
840  static_cast<FieldApproximationBase>(b), NOBASE)));
841  }
842  break;
843  default:
845  "Base <%s> not yet implemented",
847  }
848  }
850 }
MatrixDouble gaussPts
Matrix of integration points.
user implemented approximation base
Definition: definitions.h:152
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:475
const boost::shared_ptr< DataForcesAndSourcesCore > dataOnElement[LASTSPACE]
Entity data on element entity rows fields.
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:173
static const char *const ApproximationBaseNames[]
Definition: definitions.h:156
FieldApproximationBase
approximation base
Definition: definitions.h:141
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:143
#define CHKERR
Inline error check.
Definition: definitions.h:594
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405
virtual MPI_Comm & get_comm() const =0
continuous field
Definition: definitions.h:169
auto & getElementPolynomialBase()
Get the Entity Polynomial Base object.

◆ calculateBaseFunctionsOnElement() [2/2]

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::calculateBaseFunctionsOnElement ( )

Calculate base functions.

Returns
Error code

Definition at line 852 of file ForcesAndSourcesCore.cpp.

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

◆ createDataOnElement()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::createDataOnElement ( )

Create a entity data on element object.

Returns
MoFEMErrorCode

Definition at line 867 of file ForcesAndSourcesCore.cpp.

867  {
869 
870  const EntityType type = numeredEntFiniteElementPtr->getEntType();
871  if (type == lastEvaluatedElementEntityType)
873 
874  // Data on elements for proper spaces
875  for (int space = H1; space != LASTSPACE; ++space) {
876  dataOnElement[space]->setElementType(type);
877  derivedDataOnElement[space]->setElementType(type);
878  }
879 
881 
883 }
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:475
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:506
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:173
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:405
continuous field
Definition: definitions.h:169

◆ getColNodesIndices()

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

get col node indices from FENumeredDofEntity_multiIndex

Definition at line 263 of file ForcesAndSourcesCore.cpp.

264  {
265  return getNodesIndices(field_name,
266  const_cast<FENumeredDofEntity_multiIndex &>(
267  numeredEntFiniteElementPtr->getColsDofs()),
268  data.dataOnEntities[MBVERTEX][0].getIndices(),
269  data.dataOnEntities[MBVERTEX][0].getLocalIndices());
270 }
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 654 of file ForcesAndSourcesCore.hpp.

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

◆ getEntityColIndices()

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

Definition at line 167 of file ForcesAndSourcesCore.hpp.

170  {
171  return getEntityIndices(data, field_name,
172  const_cast<FENumeredDofEntity_multiIndex &>(
173  numeredEntFiniteElementPtr->getColsDofs()),
174  type_lo, type_hi);
175  }
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

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  const int order = e.getMaxOrder();
180  dat.getDataOrder() =
181  dat.getDataOrder() > ent_order ? dat.getDataOrder() : ent_order;
182  } else
183  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
184  "Entity on side of the element not found");
185 
186  }
187 
188  for (auto r = side_table.get<2>().equal_range(type); r.first != r.second;
189  ++r.first) {
190  const int brother_side_number = (*r.first)->brother_side_number;
191  if (brother_side_number != -1) {
192  const int side_number = (*r.first)->side_number;
193  data[brother_side_number].getDataOrder() =
194  data[side_number].getDataOrder();
195  }
196  }
197 
199 }
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:475
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:405

◆ getEntityDataOrder() [2/2]

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

Get the entity data order for given space.

Template Parameters
type
Parameters
data
space
Returns
MoFEMErrorCode

Definition at line 129 of file ForcesAndSourcesCore.hpp.

130  {
131  return getEntityDataOrder(type, space, data.dataOnEntities[type]);
132  }
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

Definition at line 559 of file ForcesAndSourcesCore.cpp.

561  {
563 
564  for (EntityType t = type_lo; t != type_hi; ++t) {
565  for (auto &dat : data.dataOnEntities[t]) {
566  dat.getDataOrder() = 0;
567  dat.getBase() = NOBASE;
568  dat.getSpace() = NOSPACE;
569  dat.getFieldData().resize(0, false);
570  dat.getFieldDofs().resize(0, false);
571  }
572  }
573 
574  auto &dofs = const_cast<FEDofEntity_multiIndex &>(
575  numeredEntFiniteElementPtr->getDataDofs());
576  auto &dofs_by_type = dofs.get<Composite_Name_And_Type_mi_tag>();
577  auto dit = dofs_by_type.lower_bound(boost::make_tuple(field_name, type_lo));
578  if (dit == dofs_by_type.end())
580  auto hi_dit =
581  dofs_by_type.lower_bound(boost::make_tuple(field_name, type_hi));
582  std::vector<boost::weak_ptr<FEDofEntity>> brother_dofs_vec;
583  for (; dit != hi_dit;) {
584 
585  auto &dof = **dit;
586  const int nb_dofs_on_ent = dof.getNbDofsOnEnt();
587  if (nb_dofs_on_ent) {
588 
589  const EntityType type = dof.getEntType();
590  const int side = dof.sideNumberPtr->side_number;
591  auto &dat = data.dataOnEntities[type][side];
592 
593  auto &ent_field_dofs = dat.getFieldDofs();
594  auto &ent_field_data = dat.getFieldData();
595  const int brother_side = dof.sideNumberPtr->brother_side_number;
596  if (brother_side != -1)
597  brother_dofs_vec.emplace_back(*dit);
598 
599  if (ent_field_data.empty()) {
600 
601  dat.getBase() = dof.getApproxBase();
602  dat.getSpace() = dof.getSpace();
603  const int ent_order = dof.getMaxOrder();
604  dat.getDataOrder() =
605  dat.getDataOrder() > ent_order ? dat.getDataOrder() : ent_order;
606  const auto dof_ent_field_data = dof.getEntFieldData();
607  ent_field_data.resize(nb_dofs_on_ent, false);
608  noalias(ent_field_data) = dof.getEntFieldData();
609  ent_field_dofs.resize(nb_dofs_on_ent, false);
610  for (int ii = 0; ii != nb_dofs_on_ent; ++ii) {
611  ent_field_dofs[ii] = *dit;
612  ++dit;
613  }
614  }
615  }
616  }
617 
618  for (auto &dof_ptr : brother_dofs_vec) {
619  if (auto d = dof_ptr.lock()) {
620  const EntityType type = d->getEntType();
621  const int side = d->sideNumberPtr->side_number;
622  const int brother_side = d->sideNumberPtr->brother_side_number;
623  auto &dat = data.dataOnEntities[type][side];
624  auto &dat_brother = data.dataOnEntities[type][brother_side];
625  dat_brother.getBase() = dat.getBase();
626  dat_brother.getSpace() = dat.getSpace();
627  dat_brother.getDataOrder() = dat.getDataOrder();
628  dat_brother.getFieldData() = dat.getFieldData();
629  dat_brother.getFieldDofs() = dat.getFieldDofs();
630  }
631  }
632 
634 }
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 MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
multi_index_container< boost::shared_ptr< FEDofEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< FEDofEntity::interface_type_DofEntity, const UId &, &FEDofEntity::getGlobalUniqueId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FEDofEntity::interface_type_DofEntity, EntityHandle, &FEDofEntity::getEnt > >, ordered_non_unique< tag< FieldName_mi_tag >, const_mem_fun< FEDofEntity::interface_type_Field, boost::string_ref, &FEDofEntity::getNameRef > >, ordered_non_unique< tag< EntType_mi_tag >, const_mem_fun< FEDofEntity::interface_type_RefEntity, EntityType, &FEDofEntity::getEntType > >, ordered_non_unique< tag< Composite_Name_And_Type_mi_tag >, composite_key< FEDofEntity, const_mem_fun< FEDofEntity::interface_type_Field, boost::string_ref, &FEDofEntity::getNameRef >, const_mem_fun< FEDofEntity::interface_type_RefEntity, EntityType, &FEDofEntity::getEntType > > >, ordered_non_unique< tag< Composite_Name_And_Ent_mi_tag >, composite_key< FEDofEntity, const_mem_fun< FEDofEntity::interface_type_Field, boost::string_ref, &FEDofEntity::getNameRef >, const_mem_fun< FEDofEntity::interface_type_DofEntity, EntityHandle, &FEDofEntity::getEnt > > >, ordered_non_unique< tag< Composite_Name_Type_And_Side_Number_mi_tag >, composite_key< FEDofEntity, const_mem_fun< FEDofEntity::interface_type_Field, boost::string_ref, &FEDofEntity::getNameRef >, const_mem_fun< FEDofEntity::interface_type_RefEntity, EntityType, &FEDofEntity::getEntType >, KeyFromKey< member< SideNumber, char, &SideNumber::side_number >, member< FEDofEntity::BaseFEEntity, boost::shared_ptr< SideNumber >, &FEDofEntity::sideNumberPtr > > > > > > FEDofEntity_multiIndex
MultiIndex container keeps FEDofEntity.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ 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

Definition at line 272 of file ForcesAndSourcesCore.cpp.

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

◆ getEntityRowIndices()

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

Definition at line 156 of file ForcesAndSourcesCore.hpp.

159  {
160  return getEntityIndices(data, field_name,
161  const_cast<FENumeredDofEntity_multiIndex &>(
162  numeredEntFiniteElementPtr->getRowsDofs()),
163  type_lo, type_hi);
164  }
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

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:475
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:405

◆ getEntitySense() [2/2]

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

Get the entity sense (orientation)

Template Parameters
type
Parameters
data
Returns
MoFEMErrorCode

Definition at line 116 of file ForcesAndSourcesCore.hpp.

116  {
117  return getEntitySense(type, data.dataOnEntities[type]);
118  }
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

Get nodes on triangles.

Definition at line 671 of file ForcesAndSourcesCore.cpp.

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

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

◆ 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

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 478 of file ForcesAndSourcesCore.cpp.

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

◆ getNodesFieldData() [2/2]

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

Get data on nodes.

Parameters
dataData structure
field_nameField name
Returns
Error code

Definition at line 548 of file ForcesAndSourcesCore.cpp.

549  {
550  return getNodesFieldData(field_name,
551  const_cast<FEDofEntity_multiIndex &>(
552  numeredEntFiniteElementPtr->getDataDofs()),
553  data.dataOnEntities[MBVERTEX][0].getFieldData(),
554  data.dataOnEntities[MBVERTEX][0].getFieldDofs(),
555  data.dataOnEntities[MBVERTEX][0].getSpace(),
556  data.dataOnEntities[MBVERTEX][0].getBase());
557 }
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

get node indices

Definition at line 203 of file ForcesAndSourcesCore.cpp.

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

◆ getNoFieldColIndices()

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

get col NoField indices

Definition at line 354 of file ForcesAndSourcesCore.cpp.

355  {
357  if (data.dataOnEntities[MBENTITYSET].size() == 0) {
358  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
359  }
360  CHKERR getNoFieldIndices(field_name,
361  const_cast<FENumeredDofEntity_multiIndex &>(
362  numeredEntFiniteElementPtr->getColsDofs()),
363  data.dataOnEntities[MBENTITYSET][0].getIndices());
365 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
#define CHKERR
Inline error check.
Definition: definitions.h:594
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:405

◆ 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

Definition at line 636 of file ForcesAndSourcesCore.cpp.

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

◆ getNoFieldFieldData() [2/2]

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

Definition at line 653 of file ForcesAndSourcesCore.cpp.

654  {
656  if (data.dataOnEntities[MBENTITYSET].size() == 0) {
657  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
658  }
660  field_name,
661  const_cast<FEDofEntity_multiIndex &>(
662  numeredEntFiniteElementPtr->getDataDofs()),
663  data.dataOnEntities[MBENTITYSET][0].getFieldData(),
664  data.dataOnEntities[MBENTITYSET][0].getFieldDofs());
666 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
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:594
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ getNoFieldIndices()

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

get NoField indices

Definition at line 327 of file ForcesAndSourcesCore.cpp.

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

◆ getNoFieldRowIndices()

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

get col NoField indices

Definition at line 341 of file ForcesAndSourcesCore.cpp.

342  {
344  if (data.dataOnEntities[MBENTITYSET].size() == 0) {
345  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
346  }
347  CHKERR getNoFieldIndices(field_name,
348  const_cast<FENumeredDofEntity_multiIndex &>(
349  numeredEntFiniteElementPtr->getRowsDofs()),
350  data.dataOnEntities[MBENTITYSET][0].getIndices());
352 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
#define CHKERR
Inline error check.
Definition: definitions.h:594
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:405

◆ getNumberOfNodes()

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

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:499
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
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:
elasticity_mixed_formulation.cpp, forces_and_sources_testing_edge_element.cpp, and MagneticElement.hpp.

Definition at line 647 of file ForcesAndSourcesCore.hpp.

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

Definition at line 462 of file ForcesAndSourcesCore.cpp.

463  {
464  return getProblemNodesIndices(field_name, *(problemPtr->numeredDofsCols),
465  nodes_indices);
466 }
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

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

Definition at line 369 of file ForcesAndSourcesCore.cpp.

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

◆ getProblemNodesRowIndices()

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

Definition at line 448 of file ForcesAndSourcesCore.cpp.

449  {
450  return getProblemNodesIndices(field_name, *(problemPtr->numeredDofsRows),
451  nodes_indices);
452 }
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

Definition at line 469 of file ForcesAndSourcesCore.cpp.

471  {
472  return getProblemTypeIndices(field_name, *(problemPtr->numeredDofsCols), type,
473  side_number, indices);
474 }
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

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

Definition at line 409 of file ForcesAndSourcesCore.cpp.

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

◆ getProblemTypeRowIndices()

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

Definition at line 455 of file ForcesAndSourcesCore.cpp.

457  {
458  return getProblemTypeIndices(field_name, *(problemPtr->numeredDofsRows), type,
459  side_number, indices);
460 }
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

get row node indices from FENumeredDofEntity_multiIndex

Definition at line 253 of file ForcesAndSourcesCore.cpp.

254  {
255  return getNodesIndices(field_name,
256  const_cast<FENumeredDofEntity_multiIndex &>(
257  numeredEntFiniteElementPtr->getRowsDofs()),
258  data.dataOnEntities[MBVERTEX][0].getIndices(),
259  data.dataOnEntities[MBVERTEX][0].getLocalIndices());
260 }
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]

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

set integration rule for finite element

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

Reimplemented in EdgeSlidingConstrains::MyEdgeFE, PostProcFaceOnRefinedMesh, BoneRemodeling::DensityMapFe, MoFEM::VolumeElementForcesAndSourcesCoreOnSide, GelModule::Gel::GelFE, SurfaceSlidingConstrains::MyTriangleFE, SmallStrainPlasticity::MyVolumeFE, PostProcTemplateVolumeOnRefinedMesh< MoFEM::VolumeElementForcesAndSourcesCore >, KelvinVoigtDamper::DamperFE, NitscheMethod::MyVolumeFE, ThermalElement::MyTriFE, NeummanForcesSurface::MyTriangleFE, MixTransport::MixTransportElement::MyTriFE, NonlinearElasticElement::MyVolumeFE, MagneticElement::TriFE, MoFEM::NormElement::MyTriFE, ThermalElement::MyVolumeFE, NeummanForcesSurfaceComplexForLazy::MyTriangleSpatialFE, MixTransport::MixTransportElement::MyVolumeFE, MoFEM::NormElement::MyVolumeFE, OptimalMassTransport::TriFE, MagneticElement::VolumeFE, CellEngineering::FaceElement, BoneRemodeling::Remodeling::Fe, NitscheMethod::MyFace, AnalyticalDirichletBC::ApproxField::MyTriFE, AnalyticalDirichletHelmholtzBC::ApproxField::MyTriFE, AnalyticalDirihletBC::ApproxField::MyTriFE, OptimalMassTransport::VolumeFE, FluidPressure::MyTriangleFE, AnalyticalDirihletBC::ApproxField::MyTriFE, CohesiveElement::CohesiveInterfaceElement::MyPrism, EdgeForce::MyFE, ThermalStressElement::MyVolumeFE, BodyForceConstantField::MyVolumeFE, TestFE, and CellEngineering::DispMapFe.

Definition at line 297 of file ForcesAndSourcesCore.hpp.

297 { return 2 * order; }

◆ getRule() [2/2]

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

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
Bug:
this function should be const

Definition at line 320 of file ForcesAndSourcesCore.hpp.

320  {
321  return getRuleHook ? getRuleHook(order_row, order_col, order_data)
322  : getRule(order_data);
323  }
RuleHookFun getRuleHook
Hook to get rule.
virtual int getRule(int order)
set integration rule for finite element

◆ getSpacesAndBaseOnEntities()

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

Get field approximation space and base on entities.

Definition at line 764 of file ForcesAndSourcesCore.cpp.

765  {
767 
768  if (nInTheLoop == 0) {
769  data.sPace.reset();
770  data.bAse.reset();
771  for (EntityType t = MBVERTEX; t != MBMAXTYPE; ++t) {
772  data.spacesOnEntities[t].reset();
773  data.basesOnEntities[t].reset();
774  }
775  for (int s = 0; s != LASTSPACE; ++s) {
776  data.basesOnSpaces[s].reset();
777  }
778  }
779 
780  if (dataFieldEntsPtr)
781  for (auto e : *dataFieldEntsPtr) {
782  // get data from entity
783  const EntityType type = e->getEntType();
784  const FieldSpace space = e->getSpace();
785  const FieldApproximationBase approx = e->getApproxBase();
786 
787  // set data
788  data.sPace.set(space);
789  data.bAse.set(approx);
790  data.spacesOnEntities[type].set(space);
791  data.basesOnEntities[type].set(approx);
792  data.basesOnSpaces[space].set(approx);
793  }
794  else
795  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
796  "data fields ents not allocated on element");
797 
799 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:173
FieldApproximationBase
approximation base
Definition: definitions.h:141
FieldSpace
approximation spaces
Definition: definitions.h:166
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>&

Definition at line 661 of file ForcesAndSourcesCore.hpp.

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

◆ loopOverOperators()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::loopOverOperators ( )

Iterate user data operators.

Returns
MoFEMErrorCode

Definition at line 915 of file ForcesAndSourcesCore.cpp.

915  {
917 
918  const EntityType type = numeredEntFiniteElementPtr->getEntType();
921  std::vector<std::string> last_eval_field_name(2);
922 
923  boost::ptr_vector<UserDataOperator>::iterator oit, hi_oit;
924  oit = opPtrVector.begin();
925  hi_oit = opPtrVector.end();
926 
927  for (; oit != hi_oit; oit++) {
928 
929  oit->setPtrFE(this);
930 
931  if (oit->opType == UserDataOperator::OPLAST) {
932 
933  // Set field
934  switch (oit->sPace) {
935  case NOSPACE:
936  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Unknown space");
937  case NOFIELD:
938  case H1:
939  case HCURL:
940  case HDIV:
941  case L2:
942  break;
943  default:
944  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
945  "Not implemented for this space", oit->sPace);
946  }
947 
948  // Reseat all data which all field dependent
949  dataOnElement[oit->sPace]->resetFieldDependentData();
950  last_eval_field_name[0] = "";
951 
952  // Run operator
953  try {
954  CHKERR oit->opRhs(*dataOnElement[oit->sPace], oit->doVertices,
955  oit->doEdges, oit->doQuads, oit->doTris, oit->doTets,
956  false);
957  }
958  CATCH_OP_ERRORS(*oit);
959 
960  } else {
961 
962  boost::shared_ptr<DataForcesAndSourcesCore> op_data[2];
963 
964  for (int ss = 0; ss != 2; ss++) {
965 
966  const std::string field_name =
967  !ss ? oit->rowFieldName : oit->colFieldName;
968  const Field *field_struture = mField.get_field_structure(field_name);
969  const BitFieldId data_id = field_struture->getId();
970  const FieldSpace space = field_struture->getSpace();
971  op_data[ss] = !ss ? dataOnElement[space] : derivedDataOnElement[space];
972 
973  if ((oit->getNumeredEntFiniteElementPtr()->getBitFieldIdData() &
974  data_id)
975  .none()) {
976  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
977  "no data field < %s > on finite element < %s >",
978  field_name.c_str(), feName.c_str());
979  }
980 
981  if (oit->getOpType() & types[ss] ||
982  oit->getOpType() & UserDataOperator::OPROWCOL) {
983 
984  switch (space) {
985  case NOSPACE:
986  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown space");
987  break;
988  case NOFIELD:
989  case H1:
990  case HCURL:
991  case HDIV:
992  case L2:
993  break;
994  default:
995  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
996  "Not implemented for this space", space);
997  }
998 
999  if (last_eval_field_name[ss] != field_name) {
1000 
1001  CHKERR getEntityFieldData(*op_data[ss], field_name, MBEDGE);
1002  if (!ss)
1003  CHKERR getEntityRowIndices(*op_data[ss], field_name, MBEDGE);
1004  else
1005  CHKERR getEntityColIndices(*op_data[ss], field_name, MBEDGE);
1006 
1007  switch (space) {
1008  case NOSPACE:
1009  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1010  "unknown space");
1011  break;
1012  case H1:
1013  if (!ss)
1014  CHKERR getRowNodesIndices(*op_data[ss], field_name);
1015  else
1016  CHKERR getColNodesIndices(*op_data[ss], field_name);
1017  CHKERR getNodesFieldData(*op_data[ss], field_name);
1018  break;
1019  case HCURL:
1020  case HDIV:
1021  break;
1022  case L2:
1023  switch (type) {
1024  case MBVERTEX:
1025  CHKERR getNodesFieldData(*op_data[ss], field_name);
1026  break;
1027  default:
1028  break;
1029  }
1030  break;
1031  case NOFIELD:
1032  if (!getNinTheLoop()) {
1033  // NOFIELD data are the same for each element, can be
1034  // retrieved only once
1035  if (!ss) {
1036  CHKERR getNoFieldRowIndices(*op_data[ss], field_name);
1037  } else {
1038  CHKERR getNoFieldColIndices(*op_data[ss], field_name);
1039  }
1040  CHKERR getNoFieldFieldData(*op_data[ss], field_name);
1041  }
1042  break;
1043  default:
1044  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
1045  "Not implemented for this space", space);
1046  }
1047  last_eval_field_name[ss] = field_name;
1048  }
1049  }
1050  }
1051 
1052  if (oit->getOpType() & UserDataOperator::OPROW) {
1053  try {
1054  CHKERR oit->opRhs(*op_data[0], false);
1055  }
1056  CATCH_OP_ERRORS(*oit);
1057  }
1058 
1059  if (oit->getOpType() & UserDataOperator::OPCOL) {
1060  try {
1061  CHKERR oit->opRhs(*op_data[1], false);
1062  }
1063  CATCH_OP_ERRORS(*oit);
1064  }
1065 
1066  if (oit->getOpType() & UserDataOperator::OPROWCOL) {
1067  try {
1068  CHKERR oit->opLhs(*op_data[0], *op_data[1], oit->sYmm);
1069  }
1070  CATCH_OP_ERRORS(*oit);
1071  }
1072  }
1073  }
1075 }
boost::ptr_vector< UserDataOperator > opPtrVector
Vector of finite element users data operators.
field with continuous normal traction
Definition: definitions.h:171
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:168
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:475
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:170
FieldSpace
approximation spaces
Definition: definitions.h:166
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:53
#define CHKERR
Inline error check.
Definition: definitions.h:594
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:405
continuous field
Definition: definitions.h:169
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:172

◆ operator()()

virtual 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::FaceElementForcesAndSourcesCore, MoFEM::VolumeElementForcesAndSourcesCore, MoFEM::FatPrismElementForcesAndSourcesCore, MoFEM::FlatPrismElementForcesAndSourcesCore, MoFEM::EdgeElementForcesAndSourcesCore, NeummanForcesSurfaceComplexForLazy::MyTriangleSpatialFE, and MoFEM::VertexElementForcesAndSourcesCore.

Definition at line 683 of file ForcesAndSourcesCore.hpp.

683  {
685  if (operatorHook) {
686  ierr = operatorHook();
687  CHKERRG(ierr);
688  }
690  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:542
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
boost::function< MoFEMErrorCode()> operatorHook
Hook function for operator.

◆ postProcess()

virtual 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 PostProcFaceOnRefinedMesh, PostProcFatPrismOnRefinedMesh, SolidShellModule::SolidShellPrismElement::PostProcFatPrismOnTriangleOnRefinedMesh, PostProcTemplateVolumeOnRefinedMesh< MoFEM::VolumeElementForcesAndSourcesCore >, GelModule::Gel::GelFE, MoFEM::FatPrismElementForcesAndSourcesCore, KelvinVoigtDamper::DamperFE, SolidShellModule::SolidShellPrismElement::SolidShellError, SolidShellModule::SolidShellPrismElement::SolidShell, Smoother::MyVolumeFE, and NonlinearElasticElement::MyVolumeFE.

Definition at line 691 of file ForcesAndSourcesCore.hpp.

691  {
693  if (postProcessHook) {
694  ierr = postProcessHook();
695  CHKERRG(ierr);
696  }
698  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:542
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
boost::function< MoFEMErrorCode()> postProcessHook
Hook function for post-processing.

◆ preProcess()

virtual 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, PostProcFaceOnRefinedMesh, PostProcFatPrismOnRefinedMesh, PostProcTemplateVolumeOnRefinedMesh< MoFEM::VolumeElementForcesAndSourcesCore >, GelModule::Gel::GelFE, SurfaceSlidingConstrains::MyTriangleFE, MoFEM::FatPrismElementForcesAndSourcesCore, KelvinVoigtDamper::DamperFE, SolidShellModule::SolidShellPrismElement::SolidShellError, SolidShellModule::SolidShellPrismElement::SolidShell, NeummanForcesSurfaceComplexForLazy::MyTriangleSpatialFE, Smoother::MyVolumeFE, NonlinearElasticElement::MyVolumeFE, and FluidPressure::MyTriangleFE.

Definition at line 675 of file ForcesAndSourcesCore.hpp.

675  {
677  if (preProcessHook) {
678  ierr = preProcessHook();
679  CHKERRG(ierr);
680  }
682  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:542
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
boost::function< MoFEMErrorCode()> preProcessHook
Hook function for pre-processing.

◆ setGaussPts() [1/2]

virtual MoFEMErrorCode MoFEM::ForcesAndSourcesCore::setGaussPts ( int  order)
virtual

It will be removed in the future use other variant.

Reimplemented in PostProcFaceOnRefinedMesh, PostProcTemplateVolumeOnRefinedMesh< MoFEM::VolumeElementForcesAndSourcesCore >, MoFEM::VolumeElementForcesAndSourcesCoreOnSide, and NitscheMethod::MyVolumeFE.

Definition at line 327 of file ForcesAndSourcesCore.hpp.

327  {
329  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "sorry, not implemented");
331  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506

◆ setGaussPts() [2/2]

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

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 356 of file ForcesAndSourcesCore.hpp.

357  {
358 
360  ierr = setGaussPts(order_data);
361  CHKERRG(ierr);
363  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:542
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
virtual MoFEMErrorCode setGaussPts(int order)
It will be removed in the future use other variant.

Member Data Documentation

◆ dataH1

DataForcesAndSourcesCore& MoFEM::ForcesAndSourcesCore::dataH1

Definition at line 57 of file ForcesAndSourcesCore.hpp.

◆ dataHcurl

DataForcesAndSourcesCore& MoFEM::ForcesAndSourcesCore::dataHcurl

Definition at line 58 of file ForcesAndSourcesCore.hpp.

◆ dataHdiv

DataForcesAndSourcesCore& MoFEM::ForcesAndSourcesCore::dataHdiv

Definition at line 59 of file ForcesAndSourcesCore.hpp.

◆ dataL2

DataForcesAndSourcesCore& MoFEM::ForcesAndSourcesCore::dataL2

Definition at line 60 of file ForcesAndSourcesCore.hpp.

◆ dataNoField

DataForcesAndSourcesCore& MoFEM::ForcesAndSourcesCore::dataNoField

Definition at line 56 of file ForcesAndSourcesCore.hpp.

◆ dataOnElement

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

Entity data on element entity rows fields.

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

Definition at line 45 of file ForcesAndSourcesCore.hpp.

◆ derivedDataOnElement

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

Entity data on element entity columns fields.

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

Definition at line 54 of file ForcesAndSourcesCore.hpp.

◆ elementPolynomialBasePtr

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

Pointer to entity polynomial base.

Definition at line 738 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 673 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 309 of file ForcesAndSourcesCore.hpp.

◆ lastEvaluatedElementEntityType

EntityType MoFEM::ForcesAndSourcesCore::lastEvaluatedElementEntityType
private

Last evaluated type of element entity.

Definition at line 732 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

Vector of finite element users data operators.

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

Definition at line 640 of file ForcesAndSourcesCore.hpp.

◆ userPolynomialBasePtr

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

Pointer to user polynomail base.

Definition at line 743 of file ForcesAndSourcesCore.hpp.


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