v0.8.17
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 getSense (EntityType type, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
 get sense (orientation) of entity More...
 
MoFEMErrorCode getDataOrder (const EntityType type, const FieldSpace space, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
 get maximal approximation order of approximation on the entity More...
 
template<EntityType type>
MoFEMErrorCode getEntitySense (DataForcesAndSourcesCore &data) const
 
template<EntityType type>
MoFEMErrorCode getEntityFieldDataOrder (DataForcesAndSourcesCore &data, const FieldSpace space) const
 
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)
 
- 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
 
boost::shared_ptr< const NumeredEntFiniteElementnumeredEntFiniteElementPtr
 
boost::shared_ptr< const FENumeredDofEntity_multiIndexrowPtr
 
boost::shared_ptr< const FENumeredDofEntity_multiIndexcolPtr
 
boost::shared_ptr< const FEDofEntity_multiIndexdataPtr
 
- Public Attributes inherited from MoFEM::BasicMethod
int nInTheLoop
 
int loopSize
 
int rAnk
 
int sIze
 
const RefEntity_multiIndexrefinedEntitiesPtr
 
const RefElement_multiIndexrefinedFiniteElementsPtr
 
const ProblemproblemPtr
 
const Field_multiIndexfieldsPtr
 
const FieldEntity_multiIndexentitiesPtr
 
const DofEntity_multiIndexdofsPtr
 
const FiniteElement_multiIndexfiniteElementsPtr
 
const EntFiniteElement_multiIndexfiniteElementsEntitiesPtr
 
const FieldEntityEntFiniteElementAdjacencyMap_multiIndexadjacenciesPtr
 
boost::function< MoFEMErrorCode()> preProcessHook
 
boost::function< MoFEMErrorCode()> postProcessHook
 
boost::function< MoFEMErrorCode()> operatorHook
 
- 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 278 of file ForcesAndSourcesCore.hpp.

Constructor & Destructor Documentation

◆ ForcesAndSourcesCore()

MoFEM::ForcesAndSourcesCore::ForcesAndSourcesCore ( Interface m_field)

Definition at line 72 of file ForcesAndSourcesCore.cpp.

73  :
74 
75  mField(m_field),
77 
78  nullptr,
79  boost::shared_ptr<DataForcesAndSourcesCore>(
80  new DataForcesAndSourcesCore(MBENTITYSET)), // NOFIELD
81  boost::shared_ptr<DataForcesAndSourcesCore>(
82  new DataForcesAndSourcesCore(MBENTITYSET)), // H1
83  boost::shared_ptr<DataForcesAndSourcesCore>(
84  new DataForcesAndSourcesCore(MBENTITYSET)), // HCURL
85  boost::shared_ptr<DataForcesAndSourcesCore>(
86  new DataForcesAndSourcesCore(MBENTITYSET)), // HDIV
87  boost::shared_ptr<DataForcesAndSourcesCore>(
88  new DataForcesAndSourcesCore(MBENTITYSET)) // L2
89 
90  },
92 
93  nullptr,
94  boost::shared_ptr<DataForcesAndSourcesCore>(
95  new DerivedDataForcesAndSourcesCore(dataOnElement[NOFIELD])),
96  boost::shared_ptr<DataForcesAndSourcesCore>(
97  new DerivedDataForcesAndSourcesCore(dataOnElement[H1])),
98  boost::shared_ptr<DataForcesAndSourcesCore>(
99  new DerivedDataForcesAndSourcesCore(dataOnElement[HCURL])),
100  boost::shared_ptr<DataForcesAndSourcesCore>(
101  new DerivedDataForcesAndSourcesCore(dataOnElement[HDIV])),
102  boost::shared_ptr<DataForcesAndSourcesCore>(
103  new DerivedDataForcesAndSourcesCore(dataOnElement[L2]))
104 
105  },
107  dataH1(*dataOnElement[H1].get()), dataHcurl(*dataOnElement[HCURL].get()),
108  dataHdiv(*dataOnElement[HDIV].get()), dataL2(*dataOnElement[L2].get()),
DataForcesAndSourcesCore & dataL2
field with continuous normal traction
Definition: definitions.h:170
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:167
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:169
DataForcesAndSourcesCore & dataHdiv
continuous field
Definition: definitions.h:168
field with C-1 continuity
Definition: definitions.h:171
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 840 of file ForcesAndSourcesCore.cpp.

841  {
843  if (dataOnElement[H1]->bAse.test(b)) {
844  switch (static_cast<FieldApproximationBase>(b)) {
845  case NOBASE:
846  break;
850  if (!getElementPolynomialBase()) {
851  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
852  "Functions genrating approximation base not defined");
853  }
854  for (int space = H1; space != LASTSPACE; ++space) {
855  if (dataOnElement[H1]->sPace.test(space) &&
856  dataOnElement[H1]->bAse.test(b) &&
857  dataOnElement[H1]->basesOnSpaces[space].test(b)) {
858  CHKERR getElementPolynomialBase()->getValue(
859  gaussPts,
860  boost::shared_ptr<BaseFunctionCtx>(new EntPolynomialBaseCtx(
861  *dataOnElement[space], static_cast<FieldSpace>(space),
862  static_cast<FieldApproximationBase>(b), NOBASE)));
863  }
864  }
865  break;
866  case USER_BASE:
867  if (!getUserPolynomialBase()) {
868  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
869  "Functions genrating user approximation base not defined");
870  }
871  for (int space = H1; space != LASTSPACE; ++space)
872  if (dataOnElement[H1]->sPace.test(space) &&
873  dataOnElement[H1]->bAse.test(b) &&
874  dataOnElement[H1]->basesOnSpaces[space].test(b)) {
875  CHKERR getUserPolynomialBase()->getValue(
876  gaussPts,
877  boost::shared_ptr<BaseFunctionCtx>(new EntPolynomialBaseCtx(
878  *dataOnElement[space], static_cast<FieldSpace>(space),
879  static_cast<FieldApproximationBase>(b), NOBASE)));
880  }
881  break;
882  default:
884  "Base <%s> not yet implemented",
886  }
887  }
889 }
MatrixDouble gaussPts
Matrix of integration points.
user implemented approximation base
Definition: definitions.h:151
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:467
const boost::shared_ptr< DataForcesAndSourcesCore > dataOnElement[LASTSPACE]
Entity data on element entity rows fields.
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:172
static const char *const ApproximationBaseNames[]
Definition: definitions.h:155
FieldApproximationBase
approximation base
Definition: definitions.h:140
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:142
#define CHKERR
Inline error check.
Definition: definitions.h:586
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404
virtual MPI_Comm & get_comm() const =0
continuous field
Definition: definitions.h:168
auto & getElementPolynomialBase()
Get the Entity Polynomial Base object.

◆ calculateBaseFunctionsOnElement() [2/2]

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::calculateBaseFunctionsOnElement ( )

Calculate base functions.

Returns
Error code

Definition at line 891 of file ForcesAndSourcesCore.cpp.

891  {
893  /// Use the some node base. Node base is usually used for construction other
894  /// bases.
895  for (int space = HCURL; space != LASTSPACE; ++space) {
896  dataOnElement[space]->dataOnEntities[MBVERTEX][0].getNSharedPtr(NOBASE) =
897  dataOnElement[H1]->dataOnEntities[MBVERTEX][0].getNSharedPtr(NOBASE);
898  }
899  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
901  static_cast<FieldApproximationBase>(b));
902  }
904 }
MoFEMErrorCode calculateBaseFunctionsOnElement()
Calculate base functions.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
const boost::shared_ptr< DataForcesAndSourcesCore > dataOnElement[LASTSPACE]
Entity data on element entity rows fields.
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:172
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:142
field with continuous tangents
Definition: definitions.h:169
#define CHKERR
Inline error check.
Definition: definitions.h:586
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404
continuous field
Definition: definitions.h:168

◆ createDataOnElement()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::createDataOnElement ( )

Create a entity data on element object.

Returns
MoFEMErrorCode

Definition at line 906 of file ForcesAndSourcesCore.cpp.

906  {
908 
909  const EntityType type = numeredEntFiniteElementPtr->getEntType();
910  if (type == lastEvaluatedElementEntityType)
912 
913  // Data on elements for proper spaces
914  for (int space = H1; space != LASTSPACE; ++space) {
915  dataOnElement[space]->setElementType(type);
916  derivedDataOnElement[space]->setElementType(type);
917  }
918 
920 
922 }
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:467
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:498
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:172
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:404
continuous field
Definition: definitions.h:168

◆ getColNodesIndices()

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

get col node indices from FENumeredDofEntity_multiIndex

Definition at line 313 of file ForcesAndSourcesCore.cpp.

314  {
315  return getNodesIndices(field_name,
316  const_cast<FENumeredDofEntity_multiIndex &>(
317  numeredEntFiniteElementPtr->getColsDofs()),
318  data.dataOnEntities[MBVERTEX][0].getIndices(),
319  data.dataOnEntities[MBVERTEX][0].getLocalIndices());
320 }
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

◆ getDataOrder()

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

get maximal approximation order of approximation on the entity

Definition at line 200 of file ForcesAndSourcesCore.cpp.

202  {
204  SideNumber_multiIndex &side_table = const_cast<SideNumber_multiIndex &>(
205  numeredEntFiniteElementPtr->getSideNumberTable());
206  if (PetscUnlikely(data.size() < side_table.get<2>().count(type))) {
207  // prims has 9 edges, some of edges for "flat" prism are not active
208  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
209  "data structure too small to keep data %d < %d", data.size(),
210  side_table.get<2>().count(type));
211  }
212  for (unsigned int side = 0; side != data.size(); ++side) {
213  data[side].getDataOrder() = 0;
214  }
215  auto &data_dofs = const_cast<FEDofEntity_multiIndex::index<
216  Composite_EntType_and_Space_mi_tag>::type &>(
217  numeredEntFiniteElementPtr->getDataDofs()
218  .get<Composite_EntType_and_Space_mi_tag>());
219  auto tuple = boost::make_tuple(type, space);
220  auto dit = data_dofs.lower_bound(tuple);
221  if (dit != data_dofs.end()) {
222  auto hi_dit = data_dofs.upper_bound(tuple);
223  for (; dit != hi_dit; dit++) {
224  auto &dof = **dit;
225  if (dof.getEntDofIdx() == 0) {
226  ApproximationOrder ent_order = dof.getMaxOrder();
227  int side_number = dof.sideNumberPtr->side_number;
228  if (PetscUnlikely(side_number < 0)) {
229  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
230  "side number can not be negative");
231  }
232  auto &dat = data[side_number];
233  dat.getDataOrder() =
234  dat.getDataOrder() > ent_order ? dat.getDataOrder() : ent_order;
235  if (dof.sideNumberPtr->brother_side_number != -1) {
236  if (PetscUnlikely(
237  data.size() <
238  (unsigned int)(*dit)->sideNumberPtr->brother_side_number)) {
239  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
240  "data size not big enough to keep brother data");
241  }
242  data[dof.sideNumberPtr->brother_side_number].getDataOrder() =
243  dat.getDataOrder();
244  }
245  }
246  }
247  }
249 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
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
int ApproximationOrder
Approximation on the entity.
Definition: Common.hpp:131
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404

◆ getElementPolynomialBase()

auto& MoFEM::ForcesAndSourcesCore::getElementPolynomialBase ( )

Get the Entity Polynomial Base object.

Returns
boost::shared_ptr<BaseFunction>&&

Definition at line 626 of file ForcesAndSourcesCore.hpp.

626 { 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 146 of file ForcesAndSourcesCore.hpp.

149  {
150  return getEntityIndices(data, field_name,
151  const_cast<FENumeredDofEntity_multiIndex &>(
152  numeredEntFiniteElementPtr->getColsDofs()),
153  type_lo, type_hi);
154  }
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

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

610  {
612 
613  for (EntityType t = type_lo; t != type_hi; ++t) {
614  for (auto &dat : data.dataOnEntities[t]) {
615  dat.getDataOrder() = 0;
616  dat.getBase() = NOBASE;
617  dat.getSpace() = NOSPACE;
618  dat.getFieldData().resize(0, false);
619  dat.getFieldDofs().resize(0, false);
620  }
621  }
622 
623  auto &dofs = const_cast<FEDofEntity_multiIndex &>(
624  numeredEntFiniteElementPtr->getDataDofs());
625  auto &dofs_by_type = dofs.get<Composite_Name_And_Type_mi_tag>();
626  auto dit = dofs_by_type.lower_bound(boost::make_tuple(field_name, type_lo));
627  if (dit == dofs_by_type.end())
629  auto hi_dit =
630  dofs_by_type.lower_bound(boost::make_tuple(field_name, type_hi));
631  std::vector<boost::weak_ptr<FEDofEntity>> brother_dofs_vec;
632  for (; dit != hi_dit;) {
633 
634  auto &dof = **dit;
635  const int nb_dofs_on_ent = dof.getNbDofsOnEnt();
636  if (nb_dofs_on_ent) {
637 
638  const EntityType type = dof.getEntType();
639  const int side = dof.sideNumberPtr->side_number;
640  auto &dat = data.dataOnEntities[type][side];
641 
642  auto &ent_field_dofs = dat.getFieldDofs();
643  auto &ent_field_data = dat.getFieldData();
644  const int brother_side = dof.sideNumberPtr->brother_side_number;
645  if (brother_side != -1)
646  brother_dofs_vec.emplace_back(*dit);
647 
648  if (ent_field_data.empty()) {
649 
650  dat.getBase() = dof.getApproxBase();
651  dat.getSpace() = dof.getSpace();
652  const int ent_order = dof.getMaxOrder();
653  dat.getDataOrder() =
654  dat.getDataOrder() > ent_order ? dat.getDataOrder() : ent_order;
655  const auto dof_ent_field_data = dof.getEntFieldData();
656  ent_field_data.resize(nb_dofs_on_ent, false);
657  noalias(ent_field_data) = dof.getEntFieldData();
658  ent_field_dofs.resize(nb_dofs_on_ent, false);
659  for (int ii = 0; ii != nb_dofs_on_ent; ++ii) {
660  ent_field_dofs[ii] = *dit;
661  ++dit;
662  }
663  }
664  }
665  }
666 
667  for(auto &dof_ptr : brother_dofs_vec) {
668  const EntityType type = dof_ptr.lock()->getEntType();
669  const int side = dof_ptr.lock()->sideNumberPtr->side_number;
670  const int brother_side = dof_ptr.lock()->sideNumberPtr->brother_side_number;
671  auto &dat = data.dataOnEntities[type][side];
672  auto &dat_brother = data.dataOnEntities[type][brother_side];
673  dat_brother.getBase() = dat.getBase();
674  dat_brother.getSpace() = dat.getSpace();
675  dat_brother.getDataOrder() = dat.getDataOrder();
676  dat_brother.getFieldData() = dat.getFieldData();
677  dat_brother.getFieldDofs() = dat.getFieldDofs();
678  }
679 
681 }
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::BaseFEDofEntity, boost::shared_ptr< SideNumber >, &FEDofEntity::sideNumberPtr > > > >, ordered_non_unique< tag< Composite_EntType_and_Space_mi_tag >, composite_key< FEDofEntity, const_mem_fun< FEDofEntity::interface_type_RefEntity, EntityType, &FEDofEntity::getEntType >, const_mem_fun< FEDofEntity::interface_type_Field, FieldSpace, &FEDofEntity::getSpace > > > > > FEDofEntity_multiIndex
MultiIndex container keeps FEDofEntity.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
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:404

◆ getEntityFieldDataOrder()

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

Definition at line 108 of file ForcesAndSourcesCore.hpp.

109  {
110  return getDataOrder(type, space, data.dataOnEntities[type]);
111  }
MoFEMErrorCode getDataOrder(const EntityType type, const FieldSpace space, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
get maximal approximation order of approximation on the entity

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

325  {
327 
328  for (EntityType t = type_lo; t != type_hi; ++t) {
329  for (auto &dat : data.dataOnEntities[t]) {
330  dat.getIndices().resize(0, false);
331  dat.getLocalIndices().resize(0, false);
332  }
333  }
334 
335  auto &dofs_by_type = dofs.get<Composite_Name_And_Type_mi_tag>();
336  auto dit = dofs_by_type.lower_bound(boost::make_tuple(field_name, type_lo));
337  if (dit == dofs_by_type.end())
339  auto hi_dit =
340  dofs_by_type.lower_bound(boost::make_tuple(field_name, type_hi));
341  for (; dit != hi_dit; ++dit) {
342  auto &dof = **dit;
343  const EntityType type = dof.getEntType();
344  const int side = dof.sideNumberPtr->side_number;
345  auto &dat = data.dataOnEntities[type][side];
346 
347  const int nb_dofs_on_ent = dof.getNbDofsOnEnt();
348  if (nb_dofs_on_ent) {
349  const int brother_side = dof.sideNumberPtr->brother_side_number;
350  auto &ent_field_indices = dat.getIndices();
351  auto &ent_field_local_indices = dat.getLocalIndices();
352  if (ent_field_indices.empty()) {
353  ent_field_indices.resize(nb_dofs_on_ent, false);
354  ent_field_local_indices.resize(nb_dofs_on_ent, false);
355  std::fill(ent_field_indices.data().begin(),
356  ent_field_indices.data().end(), -1);
357  std::fill(ent_field_local_indices.data().begin(),
358  ent_field_local_indices.data().end(), -1);
359  }
360  const int idx = dof.getEntDofIdx();
361  ent_field_indices[idx] = dof.getPetscGlobalDofIdx();
362  ent_field_local_indices[idx] = dof.getPetscLocalDofIdx();
363  if (brother_side != -1) {
364  auto &dat_brother = data.dataOnEntities[type][brother_side];
365  dat_brother.getIndices().resize(nb_dofs_on_ent, false);
366  dat_brother.getLocalIndices().resize(nb_dofs_on_ent, false);
367  dat_brother.getIndices()[idx] = dat.getIndices()[idx];
368  dat_brother.getLocalIndices()[idx] = dat.getLocalIndices()[idx];
369  }
370  }
371  }
372 
374 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404

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

138  {
139  return getEntityIndices(data, field_name,
140  const_cast<FENumeredDofEntity_multiIndex &>(
141  numeredEntFiniteElementPtr->getRowsDofs()),
142  type_lo, type_hi);
143  }
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()

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

Definition at line 103 of file ForcesAndSourcesCore.hpp.

103  {
104  return getSense(type, data.dataOnEntities[type]);
105  }
MoFEMErrorCode getSense(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 718 of file ForcesAndSourcesCore.cpp.

718  {
720  // PetscAttachDebugger();
721  data.facesNodes.resize(4, 3, false);
722  auto &side_table = const_cast<SideNumber_multiIndex &>(
723  numeredEntFiniteElementPtr->getSideNumberTable());
724  auto siit = side_table.get<1>().lower_bound(boost::make_tuple(MBTRI, 0));
725  auto hi_siit = side_table.get<1>().upper_bound(boost::make_tuple(MBTRI, 4));
726  if (std::distance(siit, hi_siit) != 4) {
727  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
728  "Should be 4 triangles on tet, side_table not initialized");
729  }
730  const int canonical_face_sense_p1[4][3] = {
731  {0, 1, 3},
732  {1, 2, 3},
733  {0, 3, 2} /**/,
734  {0, 2, 1} /**/}; // second index is offset (positive sense)
735  const int canonical_face_sense_m1[4][3] = {
736  {0, 3, 1},
737  {1, 3, 2},
738  {0, 2, 3},
739  {0, 1, 2}}; // second index is offset (negative sense
740  for (; siit != hi_siit; siit++) {
741  const boost::shared_ptr<SideNumber> side = *siit;
742  int face_conn[3] = {-1, -1, -1};
743  if (side->offset == 0) {
744  face_conn[0] = side->sense == 1
745  ? canonical_face_sense_p1[(int)side->side_number][0]
746  : canonical_face_sense_m1[(int)side->side_number][0];
747  face_conn[1] = side->sense == 1
748  ? canonical_face_sense_p1[(int)side->side_number][1]
749  : canonical_face_sense_m1[(int)side->side_number][1];
750  face_conn[2] = side->sense == 1
751  ? canonical_face_sense_p1[(int)side->side_number][2]
752  : canonical_face_sense_m1[(int)side->side_number][2];
753  }
754  if (side->offset == 1) {
755  face_conn[0] =
756  side->sense == 1
757  ? canonical_face_sense_p1[(int)side->side_number][1]
758  : canonical_face_sense_m1[(int)side->side_number][2] /**/;
759  face_conn[1] = side->sense == 1
760  ? canonical_face_sense_p1[(int)side->side_number][2]
761  : canonical_face_sense_m1[(int)side->side_number][0];
762  face_conn[2] = side->sense == 1
763  ? canonical_face_sense_p1[(int)side->side_number][0]
764  : canonical_face_sense_m1[(int)side->side_number][1];
765  }
766  if (side->offset == 2) {
767  face_conn[0] =
768  side->sense == 1
769  ? canonical_face_sense_p1[(int)side->side_number][2]
770  : canonical_face_sense_m1[(int)side->side_number][1] /**/;
771  face_conn[1] = side->sense == 1
772  ? canonical_face_sense_p1[(int)side->side_number][0]
773  : canonical_face_sense_m1[(int)side->side_number][2];
774  face_conn[2] = side->sense == 1
775  ? canonical_face_sense_p1[(int)side->side_number][1]
776  : canonical_face_sense_m1[(int)side->side_number][0];
777  }
778  for (int nn = 0; nn < 3; nn++)
779  data.facesNodes(side->side_number, nn) = face_conn[nn];
780  {
781  const EntityHandle *conn_tet;
782  int num_nodes_tet;
784  CHKERR mField.get_moab().get_connectivity(ent, conn_tet, num_nodes_tet,
785  true);
786  if (num_nodes_tet != 4)
787  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
788  "data inconsistency");
789  int num_nodes_face;
790  const EntityHandle *conn_face;
791  CHKERR mField.get_moab().get_connectivity(side->ent, conn_face,
792  num_nodes_face, true);
793  if (num_nodes_face != 3)
794  SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
795  if (conn_face[0] != conn_tet[data.facesNodes(side->side_number, 0)])
796  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
797  "data inconsistency");
798  if (conn_face[1] != conn_tet[data.facesNodes(side->side_number, 1)])
799  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
800  "data inconsistency");
801  if (conn_face[2] != conn_tet[data.facesNodes(side->side_number, 2)])
802  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
803  "data inconsistency");
804  }
805  }
807 }
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:467
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:586
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404

◆ getMaxColOrder()

int MoFEM::ForcesAndSourcesCore::getMaxColOrder ( ) const

Get max order of approximation for field in columns.

Definition at line 196 of file ForcesAndSourcesCore.cpp.

196  {
197  return getMaxOrder(numeredEntFiniteElementPtr->getColsDofs());
198 }
static int getMaxOrder(const DOFMULTIINDEX &dof_multi_index)
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr

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

188  {
189  return getMaxOrder(numeredEntFiniteElementPtr->getDataDofs());
190 }
static int getMaxOrder(const DOFMULTIINDEX &dof_multi_index)
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr

◆ getMaxRowOrder()

int MoFEM::ForcesAndSourcesCore::getMaxRowOrder ( ) const

Get max order of approximation for field in rows.

Definition at line 192 of file ForcesAndSourcesCore.cpp.

192  {
193  return getMaxOrder(numeredEntFiniteElementPtr->getRowsDofs());
194 }
static int getMaxOrder(const DOFMULTIINDEX &dof_multi_index)
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr

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

531  {
533  auto &dofs_by_name_and_type = dofs.get<Composite_Name_And_Type_mi_tag>();
534  auto tuple = boost::make_tuple(field_name, MBVERTEX);
535  auto dit = dofs_by_name_and_type.lower_bound(tuple);
536  if(dit == dofs_by_name_and_type.end())
537  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
538  "No nodal dofs on element");
539  auto hi_dit = dofs.get<Composite_Name_And_Type_mi_tag>().upper_bound(tuple);
540 
541  if (dit != hi_dit) {
542  auto &first_dof = **dit;
543  space = first_dof.getSpace();
544  base = first_dof.getApproxBase();
545  int num_nodes;
546  CHKERR getNumberOfNodes(num_nodes);
547  const int nb_dof_idx = first_dof.getNbOfCoeffs();
548  const int max_nb_dofs = nb_dof_idx * num_nodes;
549  nodes_data.resize(max_nb_dofs, false);
550  nodes_dofs.resize(max_nb_dofs, false);
551  nodes_data.clear();
552 
553  std::vector<boost::weak_ptr<FEDofEntity>> brother_dofs_vec;
554  for (; dit != hi_dit;) {
555  const auto &dof_ptr = *dit;
556  const auto &dof = *dof_ptr;
557  const auto &sn = *dof.sideNumberPtr;
558  const int side_number = sn.side_number;
559  const int brother_side_number = sn.brother_side_number;
560  if(brother_side_number != -1)
561  brother_dofs_vec.emplace_back(dof_ptr);
562 
563  int pos = side_number * nb_dof_idx;
564  auto ent_filed_data_vec = dof.getEntFieldData();
565  for (int ii = 0; ii != nb_dof_idx; ++ii) {
566  nodes_data[pos] = ent_filed_data_vec[ii];
567  nodes_dofs[pos] = *dit;
568  ++pos;
569  ++dit;
570  }
571  }
572 
573  for(auto &dof_ptr : brother_dofs_vec) {
574  const auto &dof = *dof_ptr.lock();
575  const auto &sn = *dof.sideNumberPtr;
576  const int side_number = sn.side_number;
577  const int brother_side_number = sn.brother_side_number;
578  int pos = side_number * nb_dof_idx;
579  int brother_pos = brother_side_number * nb_dof_idx;
580  for (int ii = 0; ii != nb_dof_idx; ++ii) {
581  nodes_data[brother_pos] = nodes_data[pos];
582  nodes_dofs[brother_pos] = nodes_dofs[pos];
583  ++pos;
584  ++brother_pos;
585  }
586  }
587 
588  } else {
589  nodes_data.resize(0, false);
590  nodes_dofs.resize(0, false);
591  }
592 
594 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
#define CHKERR
Inline error check.
Definition: definitions.h:586
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:404

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

598  {
599  return getNodesFieldData(field_name,
600  const_cast<FEDofEntity_multiIndex &>(
601  numeredEntFiniteElementPtr->getDataDofs()),
602  data.dataOnEntities[MBVERTEX][0].getFieldData(),
603  data.dataOnEntities[MBVERTEX][0].getFieldDofs(),
604  data.dataOnEntities[MBVERTEX][0].getSpace(),
605  data.dataOnEntities[MBVERTEX][0].getBase());
606 }
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 253 of file ForcesAndSourcesCore.cpp.

255  {
257  auto &dofs_by_type = dofs.get<Composite_Name_And_Type_mi_tag>();
258  auto tuple = boost::make_tuple(field_name, MBVERTEX);
259  auto dit = dofs_by_type.lower_bound(tuple);
260  auto hi_dit = dofs_by_type.upper_bound(tuple);
261 
262  if (dit != hi_dit) {
263 
264  int num_nodes;
265  CHKERR getNumberOfNodes(num_nodes);
266  int max_nb_dofs = 0;
267  const int nb_dofs_on_vert = (*dit)->getNbOfCoeffs();
268  max_nb_dofs = nb_dofs_on_vert * num_nodes;
269  nodes_indices.resize(max_nb_dofs, false);
270  local_nodes_indices.resize(max_nb_dofs, false);
271  if (std::distance(dit, hi_dit) != max_nb_dofs) {
272  std::fill(nodes_indices.begin(), nodes_indices.end(), -1);
273  std::fill(local_nodes_indices.begin(), local_nodes_indices.end(), -1);
274  }
275 
276  for (; dit != hi_dit; dit++) {
277  auto &dof = **dit;
278  const int idx = dof.getPetscGlobalDofIdx();
279  const int local_idx = dof.getPetscLocalDofIdx();
280  const int side_number = dof.sideNumberPtr->side_number;
281  const int pos = side_number * nb_dofs_on_vert + dof.getDofCoeffIdx();
282  nodes_indices[pos] = idx;
283  local_nodes_indices[pos] = local_idx;
284  const int brother_side_number =
285  (*dit)->sideNumberPtr->brother_side_number;
286  if (brother_side_number != -1) {
287  const int elem_idx =
288  brother_side_number * nb_dofs_on_vert + (*dit)->getDofCoeffIdx();
289  nodes_indices[elem_idx] = idx;
290  local_nodes_indices[elem_idx] = local_idx;
291  }
292  }
293 
294  } else {
295  nodes_indices.resize(0, false);
296  local_nodes_indices.resize(0, false);
297  }
298 
300 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
#define CHKERR
Inline error check.
Definition: definitions.h:586
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:404

◆ getNoFieldColIndices()

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

get col NoField indices

Definition at line 404 of file ForcesAndSourcesCore.cpp.

405  {
407  if (data.dataOnEntities[MBENTITYSET].size() == 0) {
408  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
409  }
410  CHKERR getNoFieldIndices(field_name,
411  const_cast<FENumeredDofEntity_multiIndex &>(
412  numeredEntFiniteElementPtr->getColsDofs()),
413  data.dataOnEntities[MBENTITYSET][0].getIndices());
415 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
#define CHKERR
Inline error check.
Definition: definitions.h:586
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:404

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

685  {
687  auto dit = dofs.get<FieldName_mi_tag>().lower_bound(field_name);
688  auto hi_dit = dofs.get<FieldName_mi_tag>().upper_bound(field_name);
689  int size = std::distance(dit, hi_dit);
690  ent_field_data.resize(size, false);
691  ent_field_dofs.resize(size, false);
692  for (; dit != hi_dit; dit++) {
693  int idx = (*dit)->getDofCoeffIdx();
694  ent_field_data[idx] = (*dit)->getFieldData();
695  ent_field_dofs[idx] = *dit;
696  }
698 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:491
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498

◆ getNoFieldFieldData() [2/2]

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

Definition at line 700 of file ForcesAndSourcesCore.cpp.

701  {
703  if (data.dataOnEntities[MBENTITYSET].size() == 0) {
704  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
705  }
707  field_name,
708  const_cast<FEDofEntity_multiIndex &>(
709  numeredEntFiniteElementPtr->getDataDofs()),
710  data.dataOnEntities[MBENTITYSET][0].getFieldData(),
711  data.dataOnEntities[MBENTITYSET][0].getFieldDofs());
713 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
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:586
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404

◆ getNoFieldIndices()

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

get NoField indices

Definition at line 377 of file ForcesAndSourcesCore.cpp.

379  {
381  auto dit = dofs.get<FieldName_mi_tag>().lower_bound(field_name);
382  auto hi_dit = dofs.get<FieldName_mi_tag>().upper_bound(field_name);
383  indices.resize(std::distance(dit, hi_dit));
384  for (; dit != hi_dit; dit++) {
385  int idx = (*dit)->getPetscGlobalDofIdx();
386  indices[(*dit)->getDofCoeffIdx()] = idx;
387  }
389 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:491
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498

◆ getNoFieldRowIndices()

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

get col NoField indices

Definition at line 391 of file ForcesAndSourcesCore.cpp.

392  {
394  if (data.dataOnEntities[MBENTITYSET].size() == 0) {
395  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
396  }
397  CHKERR getNoFieldIndices(field_name,
398  const_cast<FENumeredDofEntity_multiIndex &>(
399  numeredEntFiniteElementPtr->getRowsDofs()),
400  data.dataOnEntities[MBENTITYSET][0].getIndices());
402 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
#define CHKERR
Inline error check.
Definition: definitions.h:586
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:404

◆ getNumberOfNodes()

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

Definition at line 111 of file ForcesAndSourcesCore.cpp.

111  {
113 
115  switch (mField.get_moab().type_from_handle(ent)) {
116  case MBVERTEX:
117  num_nodes = 1;
118  break;
119  case MBEDGE:
120  num_nodes = 2;
121  break;
122  case MBTRI:
123  num_nodes = 3;
124  break;
125  case MBQUAD:
126  num_nodes = 4;
127  break;
128  case MBTET:
129  num_nodes = 4;
130  break;
131  case MBPRISM:
132  num_nodes = 6;
133  break;
134  default:
135  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
136  }
137 
139 }
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:491
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
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 619 of file ForcesAndSourcesCore.hpp.

619 { 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 512 of file ForcesAndSourcesCore.cpp.

513  {
514  return getProblemNodesIndices(field_name, *(problemPtr->numeredDofsCols),
515  nodes_indices);
516 }
const Problem * problemPtr
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 419 of file ForcesAndSourcesCore.cpp.

421  {
423  nodes_indices.resize(0);
424  auto &side_table = const_cast<SideNumber_multiIndex &>(
425  numeredEntFiniteElementPtr->getSideNumberTable());
426  auto siit = side_table.get<1>().lower_bound(boost::make_tuple(MBVERTEX, 0));
427  auto hi_siit =
428  side_table.get<1>().lower_bound(boost::make_tuple(MBVERTEX, 10000));
429 
430  int nn = 0;
431  for (; siit != hi_siit; siit++, nn++) {
432 
433  if (siit->get()->side_number == -1)
434  continue;
435 
436  const EntityHandle ent = siit->get()->ent;
437  auto dit =
438  dofs.get<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>().lower_bound(
439  boost::make_tuple(field_name, ent, 0));
440  auto hi_dit =
441  dofs.get<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>().upper_bound(
442  boost::make_tuple(field_name, ent, 10000)); /// very large number
443  if (dit != hi_dit) {
444  if (!nn) {
445  nodes_indices.resize((*dit)->getNbOfCoeffs() *
446  std::distance(siit, hi_siit));
447  }
448  for (; dit != hi_dit; dit++) {
449  nodes_indices[siit->get()->side_number * (*dit)->getNbOfCoeffs() +
450  (*dit)->getDofCoeffIdx()] =
451  (*dit)->getPetscGlobalDofIdx();
452  }
453  }
454  }
455 
457 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:491
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:498
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr

◆ getProblemNodesRowIndices()

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

Definition at line 498 of file ForcesAndSourcesCore.cpp.

499  {
500  return getProblemNodesIndices(field_name, *(problemPtr->numeredDofsRows),
501  nodes_indices);
502 }
const Problem * problemPtr
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 519 of file ForcesAndSourcesCore.cpp.

521  {
522  return getProblemTypeIndices(field_name, *(problemPtr->numeredDofsCols), type,
523  side_number, indices);
524 }
const Problem * problemPtr
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 459 of file ForcesAndSourcesCore.cpp.

461  {
463 
464  indices.resize(0);
465 
466  auto &side_table = const_cast<SideNumber_multiIndex &>(
467  numeredEntFiniteElementPtr->getSideNumberTable());
468  auto siit =
469  side_table.get<1>().lower_bound(boost::make_tuple(type, side_number));
470  auto hi_siit =
471  side_table.get<1>().upper_bound(boost::make_tuple(type, side_number));
472 
473  for (; siit != hi_siit; siit++) {
474 
475  if (siit->get()->side_number == -1)
476  continue;
477 
478  const EntityHandle ent = siit->get()->ent;
479  NumeredDofEntity_multiIndex::index<
480  Composite_Name_And_Ent_And_EntDofIdx_mi_tag>::type::iterator dit,
481  hi_dit;
482  dit = dofs.get<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>().lower_bound(
483  boost::make_tuple(field_name, ent, 0));
484  hi_dit =
485  dofs.get<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>().upper_bound(
486  boost::make_tuple(field_name, ent, 10000)); /// very large number
487 
488  indices.resize(std::distance(dit, hi_dit));
489  for (; dit != hi_dit; dit++) {
490 
491  indices[(*dit)->getEntDofIdx()] = (*dit)->getPetscGlobalDofIdx();
492  }
493  }
494 
496 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:491
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:498
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 505 of file ForcesAndSourcesCore.cpp.

507  {
508  return getProblemTypeIndices(field_name, *(problemPtr->numeredDofsRows), type,
509  side_number, indices);
510 }
const Problem * problemPtr
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 303 of file ForcesAndSourcesCore.cpp.

304  {
305  return getNodesIndices(field_name,
306  const_cast<FENumeredDofEntity_multiIndex &>(
307  numeredEntFiniteElementPtr->getRowsDofs()),
308  data.dataOnEntities[MBVERTEX][0].getIndices(),
309  data.dataOnEntities[MBVERTEX][0].getLocalIndices());
310 }
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, NeummanForcesSurfaceComplexForLazy::MyTriangleSpatialFE, ThermalElement::MyVolumeFE, MixTransport::MixTransportElement::MyVolumeFE, MoFEM::NormElement::MyVolumeFE, OptimalMassTransport::TriFE, MagneticElement::VolumeFE, CellEngineering::FaceElement, BoneRemodeling::Remodeling::Fe, AnalyticalDirichletBC::ApproxField::MyTriFE, AnalyticalDirichletHelmholtzBC::ApproxField::MyTriFE, AnalyticalDirihletBC::ApproxField::MyTriFE, FluidPressure::MyTriangleFE, NitscheMethod::MyFace, OptimalMassTransport::VolumeFE, AnalyticalDirihletBC::ApproxField::MyTriFE, CohesiveElement::CohesiveInterfaceElement::MyPrism, EdgeForce::MyFE, BodyForceConstantField::MyVolumeFE, ThermalStressElement::MyVolumeFE, TestFE, and CellEngineering::DispMapFe.

Definition at line 275 of file ForcesAndSourcesCore.hpp.

275 { 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 298 of file ForcesAndSourcesCore.hpp.

298  {
299  return getRuleHook ? getRuleHook(order_row, order_col, order_data)
300  : getRule(order_data);
301  }
RuleHookFun getRuleHook
Hook to get rule.
virtual int getRule(int order)
set integration rule for finite element

◆ getSense()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getSense ( 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 143 of file ForcesAndSourcesCore.cpp.

145  {
147  auto &side_table = const_cast<SideNumber_multiIndex &>(
148  numeredEntFiniteElementPtr->getSideNumberTable());
149  if (PetscUnlikely(data.size() < side_table.get<2>().count(type))) {
150  // prims has 9 edges, some of edges for "flat" prism are not active
151  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
152  "wrong number of sides %u < %u", data.size(),
153  side_table.get<2>().count(type));
154  }
155  const auto &st = side_table.get<2>();
156  auto sit = st.lower_bound(type);
157  auto hi_sit = st.upper_bound(type);
158  for (; sit != hi_sit; sit++) {
159  const auto &side = **sit;
160  data[side.side_number].getSense() = sit->get()->sense;
161  if (side.brother_side_number != -1) {
162  if (PetscUnlikely(data.size() < (unsigned)side.brother_side_number)) {
163  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
164  "data struture too small to keep data about brother node");
165  }
166  data[side.brother_side_number].getSense() = side.sense;
167  }
168  }
170 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:467
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 MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:404

◆ getSpacesAndBaseOnEntities()

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

Get field approximation space and base on entities.

Definition at line 811 of file ForcesAndSourcesCore.cpp.

812  {
814  if (nInTheLoop == 0) {
815  data.sPace.reset();
816  data.bAse.reset();
817  for (EntityType t = MBVERTEX; t != MBMAXTYPE; ++t) {
818  data.spacesOnEntities[t].reset();
819  data.basesOnEntities[t].reset();
820  }
821  for (int s = 0; s != LASTSPACE; ++s) {
822  data.basesOnSpaces[s].reset();
823  }
824  }
825  for (_IT_GET_FEDATA_DOFS_FOR_LOOP_(this, dof)) {
826  if (dof->get()->getEntDofIdx() != 0)
827  continue;
828  const EntityType type = dof->get()->getEntType();
829  const FieldSpace space = dof->get()->getSpace();
830  const FieldApproximationBase approx = dof->get()->getApproxBase();
831  data.sPace.set(space);
832  data.bAse.set(approx);
833  data.spacesOnEntities[type].set(space);
834  data.basesOnEntities[type].set(approx);
835  data.basesOnSpaces[space].set(approx);
836  }
838 }
#define _IT_GET_FEDATA_DOFS_FOR_LOOP_(FE, IT)
loop over all dofs which are on a particular FE data
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:491
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:172
FieldApproximationBase
approximation base
Definition: definitions.h:140
FieldSpace
approximation spaces
Definition: definitions.h:165

◆ getUserPolynomialBase()

auto& MoFEM::ForcesAndSourcesCore::getUserPolynomialBase ( )

Get the User Polynomial Base object.

Returns
boost::shared_ptr<BaseFunction>&

Definition at line 633 of file ForcesAndSourcesCore.hpp.

633 { 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 954 of file ForcesAndSourcesCore.cpp.

954  {
956 
957  const EntityType type = numeredEntFiniteElementPtr->getEntType();
960  std::vector<std::string> last_eval_field_name(2);
961 
962  boost::ptr_vector<UserDataOperator>::iterator oit, hi_oit;
963  oit = opPtrVector.begin();
964  hi_oit = opPtrVector.end();
965 
966  for (; oit != hi_oit; oit++) {
967 
968  oit->setPtrFE(this);
969 
970  if (oit->opType == UserDataOperator::OPLAST) {
971 
972  // Set field
973  switch (oit->sPace) {
974  case NOSPACE:
975  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Unknown space");
976  case NOFIELD:
977  case H1:
978  case HCURL:
979  case HDIV:
980  case L2:
981  break;
982  default:
983  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
984  "Not implemented for this space", oit->sPace);
985  }
986 
987  // Reseat all data which all field dependent
988  dataOnElement[oit->sPace]->resetFieldDependentData();
989  last_eval_field_name[0] = "";
990 
991  // Run operator
992  try {
993  CHKERR oit->opRhs(*dataOnElement[oit->sPace], oit->doVertices,
994  oit->doEdges, oit->doQuads, oit->doTris, oit->doTets,
995  false);
996  }
997  CATCH_OP_ERRORS(*oit);
998 
999  } else {
1000 
1001  boost::shared_ptr<DataForcesAndSourcesCore> op_data[2];
1002 
1003  for (int ss = 0; ss != 2; ss++) {
1004 
1005  const std::string field_name =
1006  !ss ? oit->rowFieldName : oit->colFieldName;
1007  const Field *field_struture = mField.get_field_structure(field_name);
1008  const BitFieldId data_id = field_struture->getId();
1009  const FieldSpace space = field_struture->getSpace();
1010  op_data[ss] = !ss ? dataOnElement[space] : derivedDataOnElement[space];
1011 
1012  if ((oit->getNumeredEntFiniteElementPtr()->getBitFieldIdData() &
1013  data_id)
1014  .none()) {
1015  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1016  "no data field < %s > on finite element < %s >",
1017  field_name.c_str(), feName.c_str());
1018  }
1019 
1020  if (oit->getOpType() & types[ss] ||
1021  oit->getOpType() & UserDataOperator::OPROWCOL) {
1022 
1023  switch (space) {
1024  case NOSPACE:
1025  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1026  "unknown space");
1027  break;
1028  case NOFIELD:
1029  case H1:
1030  case HCURL:
1031  case HDIV:
1032  case L2:
1033  break;
1034  default:
1035  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
1036  "Not implemented for this space", space);
1037  }
1038 
1039  if (last_eval_field_name[ss] != field_name) {
1040 
1041  CHKERR getEntityFieldData(*op_data[ss], field_name, MBEDGE);
1042  if (!ss)
1043  CHKERR getEntityRowIndices(*op_data[ss], field_name, MBEDGE);
1044  else
1045  CHKERR getEntityColIndices(*op_data[ss], field_name, MBEDGE);
1046 
1047  switch (space) {
1048  case NOSPACE:
1049  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1050  "unknown space");
1051  break;
1052  case H1:
1053  if (!ss)
1054  CHKERR getRowNodesIndices(*op_data[ss], field_name);
1055  else
1056  CHKERR getColNodesIndices(*op_data[ss], field_name);
1057  CHKERR getNodesFieldData(*op_data[ss], field_name);
1058  break;
1059  case HCURL:
1060  case HDIV:
1061  break;
1062  case L2:
1063  switch (type) {
1064  case MBVERTEX:
1065  CHKERR getNodesFieldData(*op_data[ss], field_name);
1066  break;
1067  default:
1068  break;
1069  }
1070  break;
1071  case NOFIELD:
1072  if (!getNinTheLoop()) {
1073  // NOFIELD data are the same for each element, can be
1074  // retrieved only once
1075  if (!ss) {
1076  CHKERR getNoFieldRowIndices(*op_data[ss], field_name);
1077  } else {
1078  CHKERR getNoFieldColIndices(*op_data[ss], field_name);
1079  }
1080  CHKERR getNoFieldFieldData(*op_data[ss], field_name);
1081  }
1082  break;
1083  default:
1084  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
1085  "Not implemented for this space", space);
1086  }
1087  last_eval_field_name[ss] = field_name;
1088 
1089  }
1090 
1091  }
1092  }
1093 
1094  if (oit->getOpType() & UserDataOperator::OPROW) {
1095  try {
1096  CHKERR oit->opRhs(*op_data[0], false);
1097  }
1098  CATCH_OP_ERRORS(*oit);
1099  }
1100 
1101  if (oit->getOpType() & UserDataOperator::OPCOL) {
1102  try {
1103  CHKERR oit->opRhs(*op_data[1], false);
1104  }
1105  CATCH_OP_ERRORS(*oit);
1106  }
1107 
1108  if (oit->getOpType() & UserDataOperator::OPROWCOL) {
1109  try {
1110  CHKERR oit->opLhs(*op_data[0], *op_data[1], oit->sYmm);
1111  }
1112  CATCH_OP_ERRORS(*oit);
1113  }
1114  }
1115  }
1117 }
boost::ptr_vector< UserDataOperator > opPtrVector
Vector of finite element users data operators.
field with continuous normal traction
Definition: definitions.h:170
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:167
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:467
const boost::shared_ptr< DataForcesAndSourcesCore > dataOnElement[LASTSPACE]
Entity data on element entity rows fields.
std::string feName
std::bitset< BITFIELDID_SIZE > BitFieldId
Definition: Common.hpp:149
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:169
FieldSpace
approximation spaces
Definition: definitions.h:165
#define CHKERR
Inline error check.
Definition: definitions.h:586
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:404
continuous field
Definition: definitions.h:168
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:171

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

655  {
657  if (operatorHook) {
658  ierr = operatorHook();
659  CHKERRG(ierr);
660  }
662  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:491
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:534
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
boost::function< MoFEMErrorCode()> operatorHook

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

663  {
665  if (postProcessHook) {
666  ierr = postProcessHook();
667  CHKERRG(ierr);
668  }
670  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:491
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:534
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
boost::function< MoFEMErrorCode()> postProcessHook
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80

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

647  {
649  if (preProcessHook) {
650  ierr = preProcessHook();
651  CHKERRG(ierr);
652  }
654  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:491
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:534
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
boost::function< MoFEMErrorCode()> preProcessHook

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

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

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

335  {
336 
338  ierr = setGaussPts(order_data);
339  CHKERRG(ierr);
341  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:491
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:534
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
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 710 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 645 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 287 of file ForcesAndSourcesCore.hpp.

◆ lastEvaluatedElementEntityType

EntityType MoFEM::ForcesAndSourcesCore::lastEvaluatedElementEntityType
private

Last evaluated type of element entity.

Definition at line 704 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 612 of file ForcesAndSourcesCore.hpp.

◆ userPolynomialBasePtr

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

Pointer to user polynomail base.

Definition at line 715 of file ForcesAndSourcesCore.hpp.


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