v0.6.9
Classes | Public Types | Public Member Functions | Public 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...
 
MoFEMErrorCode getDataOrderSpaceAndBase (const std::string &field_name, const EntityType type, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
 get maximal approximation order on entity More...
 
MoFEMErrorCode getEdgesSense (DataForcesAndSourcesCore &data) const
 
MoFEMErrorCode getTrisSense (DataForcesAndSourcesCore &data) const
 
MoFEMErrorCode getQuadSense (DataForcesAndSourcesCore &data) const
 
MoFEMErrorCode getEdgesDataOrder (DataForcesAndSourcesCore &data, const FieldSpace space) const
 
MoFEMErrorCode getTrisDataOrder (DataForcesAndSourcesCore &data, const FieldSpace space) const
 
MoFEMErrorCode getQuadDataOrder (DataForcesAndSourcesCore &data, const FieldSpace space) const
 
MoFEMErrorCode getTetDataOrder (DataForcesAndSourcesCore &data, const FieldSpace space) const
 
MoFEMErrorCode getPrismDataOrder (DataForcesAndSourcesCore &data, const FieldSpace space) const
 
MoFEMErrorCode getEdgesDataOrderSpaceAndBase (DataForcesAndSourcesCore &data, const std::string &field_name) const
 
MoFEMErrorCode getTrisDataOrderSpaceAndBase (DataForcesAndSourcesCore &data, const std::string &field_name) const
 
MoFEMErrorCode getQuadDataOrderSpaceAndBase (DataForcesAndSourcesCore &data, const std::string &field_name) const
 
MoFEMErrorCode getTetDataOrderSpaceAndBase (DataForcesAndSourcesCore &data, const std::string &field_name) const
 
MoFEMErrorCode getPrismDataOrderSpaceAndBase (DataForcesAndSourcesCore &data, const std::string &field_name) 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 getTypeIndices (const boost::string_ref field_name, FENumeredDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorInt &indices, VectorInt &local_indices) const
 get indices by type (generic function) More...
 
MoFEMErrorCode getTypeIndices (const boost::string_ref field_name, FENumeredDofEntity_multiIndex &dofs, EntityType type, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
 get indices by type (generic function) 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 getEdgesRowIndices (DataForcesAndSourcesCore &data, const std::string &field_name) const
 get Edges row indices from FENumeredDofEntity_multiIndex More...
 
MoFEMErrorCode getEdgesColIndices (DataForcesAndSourcesCore &data, const std::string &field_name) const
 get Edges col indices from FENumeredDofEntity_multiIndex More...
 
MoFEMErrorCode getTrisRowIndices (DataForcesAndSourcesCore &data, const std::string &field_name) const
 get Tris row indices from FENumeredDofEntity_multiIndex More...
 
MoFEMErrorCode getTrisColIndices (DataForcesAndSourcesCore &data, const std::string &field_name) const
 get Tris col indices from FENumeredDofEntity_multiIndex More...
 
MoFEMErrorCode getTetsRowIndices (DataForcesAndSourcesCore &data, const std::string &field_name) const
 get Tets row indices from FENumeredDofEntity_multiIndex More...
 
MoFEMErrorCode getTetsColIndices (DataForcesAndSourcesCore &data, const std::string &field_name) const
 get Tets col indices from FENumeredDofEntity_multiIndex More...
 
MoFEMErrorCode getQuadRowIndices (DataForcesAndSourcesCore &data, const std::string &field_name) const
 get Quad row indices from FENumeredDofEntity_multiIndex More...
 
MoFEMErrorCode getQuadColIndices (DataForcesAndSourcesCore &data, const std::string &field_name) const
 get Quad col indices from FENumeredDofEntity_multiIndex More...
 
MoFEMErrorCode getPrismRowIndices (DataForcesAndSourcesCore &data, const std::string &field_name) const
 get Prism row indices from FENumeredDofEntity_multiIndex More...
 
MoFEMErrorCode getPrismColIndices (DataForcesAndSourcesCore &data, const std::string &field_name) const
 get Prism col indices from FENumeredDofEntity_multiIndex More...
 
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 getTypeFieldData (const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorDouble &ent_field_data, VectorDofs &ent_field_dofs) const
 Get field data on entities. More...
 
MoFEMErrorCode getTypeFieldData (const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, EntityType type, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
 
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 getEdgesFieldData (DataForcesAndSourcesCore &data, const std::string &field_name) const
 
MoFEMErrorCode getTrisFieldData (DataForcesAndSourcesCore &data, const std::string &field_name) const
 
MoFEMErrorCode getQuadFieldData (DataForcesAndSourcesCore &data, const std::string &field_name) const
 
MoFEMErrorCode getTetsFieldData (DataForcesAndSourcesCore &data, const std::string &field_name) const
 
MoFEMErrorCode getPrismFieldData (DataForcesAndSourcesCore &data, const std::string &field_name) 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...
 
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...
 
- 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>
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 >
IFACE getInterface () const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type >
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...
 
DEPRECATED MoFEMErrorCode set_snes (SNES snes)
 
DEPRECATED MoFEMErrorCode set_snes_ctx (const SNESContext &ctx)
 
DEPRECATED MoFEMErrorCode copy_snes (const SnesMethod &snes)
 
- 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...
 
DEPRECATED MoFEMErrorCode set_ts_ctx (const TSContext &ctx)
 
DEPRECATED MoFEMErrorCode copy_ts (const TSMethod &ts)
 
DEPRECATED MoFEMErrorCode set_ts (TS _ts)
 

Public Attributes

InterfacemField
 
RuleHookFun getRuleHook
 Hook to get rule. More...
 
boost::ptr_vector< UserDataOperatoropPtrVector
 
- 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
 

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

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

Constructor & Destructor Documentation

◆ ForcesAndSourcesCore()

MoFEM::ForcesAndSourcesCore::ForcesAndSourcesCore ( Interface m_field)

Definition at line 39 of file ForcesAndSourcesCore.hpp.

39  :
40  mField(m_field),
41  getRuleHook(0) {
42  }
RuleHookFun getRuleHook
Hook to get rule.

◆ ~ForcesAndSourcesCore()

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

Definition at line 43 of file ForcesAndSourcesCore.hpp.

43  {
44 
45  }

Member Function Documentation

◆ getColNodesIndices()

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

get col node indices from FENumeredDofEntity_multiIndex

Definition at line 417 of file ForcesAndSourcesCore.cpp.

417  {
418 
421  field_name,const_cast<FENumeredDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getColsDofs()),
422  data.dataOnEntities[MBVERTEX][0].getIndices(),data.dataOnEntities[MBVERTEX][0].getLocalIndices()
423  ); CHKERRG(ierr);
425 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
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 180 of file ForcesAndSourcesCore.cpp.

180  {
182  try {
183  SideNumber_multiIndex& side_table = const_cast<SideNumber_multiIndex&>(numeredEntFiniteElementPtr->getSideNumberTable());
184  if(data.size() < side_table.get<2>().count(type)) {
185  // prims has 9 edges, some of edges for "flat" prism are not active
186  SETERRQ2(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,
187  "data inconsistency %d < %d",
188  data.size(),side_table.get<2>().count(type)
189  );
190  }
191  for(unsigned int side = 0;side<data.size();side++) {
192  data[side].getDataOrder() = 0;
193  }
194  FEDofEntity_multiIndex::index<Composite_EntType_and_Space_mi_tag>::type &data_dofs =
195  const_cast<FEDofEntity_multiIndex::index<Composite_EntType_and_Space_mi_tag>::type&>(
196  numeredEntFiniteElementPtr->getDataDofs().get<Composite_EntType_and_Space_mi_tag>()
197  );
198  FEDofEntity_multiIndex::index<Composite_EntType_and_Space_mi_tag>::type::iterator dit,hi_dit;
199  dit = data_dofs.lower_bound(boost::make_tuple(type,space));
200  hi_dit = data_dofs.upper_bound(boost::make_tuple(type,space));
201  for(;dit!=hi_dit;dit++) {
202  ApproximationOrder ent_order = (*dit)->getMaxOrder();
203  int side_number = (*dit)->sideNumberPtr->side_number;
204  if(side_number < 0) {
205  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
206  }
207  data[side_number].getDataOrder() = data[side_number].getDataOrder() > ent_order ? data[side_number].getDataOrder() : ent_order;
208  if((*dit)->sideNumberPtr->brother_side_number!=-1) {
209  if(data.size() < (unsigned int)(*dit)->sideNumberPtr->brother_side_number) {
210  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
211  }
212  data[(*dit)->sideNumberPtr->brother_side_number].getDataOrder() = data[side_number].getDataOrder();
213  }
214  }
215  } catch (std::exception& ex) {
216  std::ostringstream ss;
217  ss << "thorw in method: " << ex.what() << " at line " << __LINE__ << " in file " << __FILE__;
218  SETERRQ(PETSC_COMM_SELF,MOFEM_STD_EXCEPTION_THROW,ss.str().c_str());
219  }
221 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
int ApproximationOrder
Approximation on the entity.
Definition: Common.hpp:131
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.

◆ getDataOrderSpaceAndBase()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getDataOrderSpaceAndBase ( const std::string &  field_name,
const EntityType  type,
boost::ptr_vector< DataForcesAndSourcesCore::EntData > &  data 
) const

get maximal approximation order on entity

Definition at line 258 of file ForcesAndSourcesCore.cpp.

260  {
262 
263  SideNumber_multiIndex& side_table = const_cast<SideNumber_multiIndex&>(numeredEntFiniteElementPtr->getSideNumberTable());
264  if(data.size() < side_table.get<2>().count(type)) {
265  // prims has 9 edges, some of edges for "flat" prism are not active
266  SETERRQ2(
267  PETSC_COMM_SELF,
269  "data inconsistency %d < %d",
270  data.size(),side_table.get<2>().count(type)
271  );
272  }
273 
274  for(unsigned int side = 0;side<data.size();side++) {
275  data[side].getDataOrder() = 0;
276  data[side].getBase() = NOBASE;
277  data[side].getSpace() = NOSPACE;
278  }
279 
280  const FEDofEntity_multiIndex::index<Composite_Name_Type_And_Side_Number_mi_tag>::type
281  &data_dofs = numeredEntFiniteElementPtr->getDataDofs().get<Composite_Name_Type_And_Side_Number_mi_tag>();
282  FEDofEntity_multiIndex::index<Composite_Name_Type_And_Side_Number_mi_tag>::type::iterator dit,hi_dit;
283  dit = data_dofs.lower_bound(boost::make_tuple(field_name,type,0));
284  if(dit == data_dofs.end()) {
286  }
287  hi_dit = data_dofs.lower_bound(boost::make_tuple(field_name,type,data.size()));
288 
289  for(;dit!=hi_dit;) {
290 
291  // std::cerr << ApproximationBaseNames[dit->getApproxBase()] << std::endl;
292 
293  int side_number = (*dit)->sideNumberPtr->side_number;
294  if(data[side_number].getDataOrder()) continue;
295 
296  ApproximationOrder ent_order = (*dit)->getMaxOrder();
297  if(side_number < 0) {
298  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
299  }
300  data[side_number].getBase() = (*dit)->getApproxBase();
301  data[side_number].getSpace() = (*dit)->getSpace();
302  data[side_number].getDataOrder() = data[side_number].getDataOrder() > ent_order ? data[side_number].getDataOrder() : ent_order;
303  if((*dit)->sideNumberPtr->brother_side_number!=-1) {
304  if(data.size() < (unsigned int)(*dit)->sideNumberPtr->brother_side_number) {
305  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
306  }
307  data[(*dit)->sideNumberPtr->brother_side_number].getBase() = data[side_number].getBase();
308  data[(*dit)->sideNumberPtr->brother_side_number].getSpace() = data[side_number].getSpace();
309  data[(*dit)->sideNumberPtr->brother_side_number].getDataOrder() = data[side_number].getDataOrder();
310  }
311 
312  const int nb_dofs_on_ent = (*dit)->getNbDofsOnEnt();
313  for(int i = 0;i!=nb_dofs_on_ent;i++,dit++) {}
314 
315  }
316 
318 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
int ApproximationOrder
Approximation on the entity.
Definition: Common.hpp:131
MoFEMErrorCode getDataOrder(const EntityType type, const FieldSpace space, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
get maximal approximation order of approximation on the entity
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.

◆ getEdgesColIndices()

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

get Edges col indices from FENumeredDofEntity_multiIndex

Definition at line 533 of file ForcesAndSourcesCore.cpp.

533  {
534 
537  field_name,const_cast<FENumeredDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getColsDofs()),MBEDGE,data.dataOnEntities[MBEDGE]
538  ); CHKERRG(ierr);
540 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getTypeIndices(const boost::string_ref field_name, FENumeredDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorInt &indices, VectorInt &local_indices) const
get indices by type (generic function)

◆ getEdgesDataOrder()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getEdgesDataOrder ( DataForcesAndSourcesCore data,
const FieldSpace  space 
) const

Definition at line 223 of file ForcesAndSourcesCore.cpp.

223  {
224 
226  ierr = getDataOrder(MBEDGE,space,data.dataOnEntities[MBEDGE]); CHKERRG(ierr);
228 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getDataOrder(const EntityType type, const FieldSpace space, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
get maximal approximation order of approximation on the entity

◆ getEdgesDataOrderSpaceAndBase()

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

Definition at line 320 of file ForcesAndSourcesCore.cpp.

320  {
321 
323  ierr = getDataOrderSpaceAndBase(field_name,MBEDGE,data.dataOnEntities[MBEDGE]); CHKERRG(ierr);
325 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getDataOrderSpaceAndBase(const std::string &field_name, const EntityType type, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
get maximal approximation order on entity

◆ getEdgesFieldData()

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

Definition at line 1003 of file ForcesAndSourcesCore.cpp.

1003  {
1004 
1007  field_name,const_cast<FEDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getDataDofs()),MBEDGE,data.dataOnEntities[MBEDGE]
1008  ); CHKERRG(ierr);
1010 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
MoFEMErrorCode getTypeFieldData(const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorDouble &ent_field_data, VectorDofs &ent_field_dofs) const
Get field data on entities.
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80

◆ getEdgesRowIndices()

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

get Edges row indices from FENumeredDofEntity_multiIndex

Definition at line 524 of file ForcesAndSourcesCore.cpp.

524  {
525 
528  field_name,const_cast<FENumeredDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getRowsDofs()),MBEDGE,data.dataOnEntities[MBEDGE]
529  ); CHKERRG(ierr);
531 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getTypeIndices(const boost::string_ref field_name, FENumeredDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorInt &indices, VectorInt &local_indices) const
get indices by type (generic function)

◆ getEdgesSense()

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

get edge sense )orientation) in respect finite element entity

Parameters
datastructure where results are stored
Returns
error code

Definition at line 129 of file ForcesAndSourcesCore.cpp.

129  {
130 
132  ierr = getSense(MBEDGE,data.dataOnEntities[MBEDGE]); CHKERRG(ierr);
134 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
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 1069 of file ForcesAndSourcesCore.cpp.

1069  {
1070  //
1072  //PetscAttachDebugger();
1073  data.facesNodes.resize(4,3,false);
1074  SideNumber_multiIndex& side_table = const_cast<SideNumber_multiIndex&>(numeredEntFiniteElementPtr->getSideNumberTable());
1075  SideNumber_multiIndex::nth_index<1>::type::iterator siit = side_table.get<1>().lower_bound(boost::make_tuple(MBTRI,0));
1076  SideNumber_multiIndex::nth_index<1>::type::iterator hi_siit = side_table.get<1>().upper_bound(boost::make_tuple(MBTRI,4));
1077  if(distance(siit,hi_siit)!=4) {
1078  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"Should be 4 triangles on tet, side_table not initialized");
1079  }
1080  const int cannonical_face_sense_p1[4][3] = { {0,1,3}, {1,2,3}, {0,3,2}/**/, {0,2,1}/**/ }; //secon index is offset (positive sense)
1081  const int cannonical_face_sense_m1[4][3] = { {0,3,1}, {1,3,2}, {0,2,3}, {0,1,2} }; //second index is offset (negative sense
1082  for(;siit!=hi_siit;siit++) {
1083  const boost::shared_ptr<SideNumber> side = *siit;
1084  int face_conn[3] = {-1,-1,-1};
1085  if(side->offset == 0) {
1086  face_conn[0] = side->sense == 1 ? cannonical_face_sense_p1[(int)side->side_number][0] : cannonical_face_sense_m1[(int)side->side_number][0];
1087  face_conn[1] = side->sense == 1 ? cannonical_face_sense_p1[(int)side->side_number][1] : cannonical_face_sense_m1[(int)side->side_number][1];
1088  face_conn[2] = side->sense == 1 ? cannonical_face_sense_p1[(int)side->side_number][2] : cannonical_face_sense_m1[(int)side->side_number][2];
1089  }
1090  if(side->offset == 1) {
1091  face_conn[0] = side->sense == 1 ? cannonical_face_sense_p1[(int)side->side_number][1] : cannonical_face_sense_m1[(int)side->side_number][2]/**/;
1092  face_conn[1] = side->sense == 1 ? cannonical_face_sense_p1[(int)side->side_number][2] : cannonical_face_sense_m1[(int)side->side_number][0];
1093  face_conn[2] = side->sense == 1 ? cannonical_face_sense_p1[(int)side->side_number][0] : cannonical_face_sense_m1[(int)side->side_number][1];
1094  }
1095  if(side->offset == 2) {
1096  face_conn[0] = side->sense == 1 ? cannonical_face_sense_p1[(int)side->side_number][2] : cannonical_face_sense_m1[(int)side->side_number][1]/**/;
1097  face_conn[1] = side->sense == 1 ? cannonical_face_sense_p1[(int)side->side_number][0] : cannonical_face_sense_m1[(int)side->side_number][2];
1098  face_conn[2] = side->sense == 1 ? cannonical_face_sense_p1[(int)side->side_number][1] : cannonical_face_sense_m1[(int)side->side_number][0];
1099  }
1100  for(int nn = 0;nn<3;nn++) data.facesNodes(side->side_number,nn) = face_conn[nn];
1101  {
1102  const EntityHandle *conn_tet;
1103  int num_nodes_tet;
1104  EntityHandle ent = numeredEntFiniteElementPtr->getEnt();
1105  rval = mField.get_moab().get_connectivity(ent,conn_tet,num_nodes_tet,true); CHKERRQ_MOAB(rval);
1106  if(num_nodes_tet != 4) SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
1107  int num_nodes_face;
1108  const EntityHandle *conn_face;
1109  rval = mField.get_moab().get_connectivity(side->ent,conn_face,num_nodes_face,true); CHKERRQ_MOAB(rval);
1110  if(num_nodes_face != 3) SETERRQ(PETSC_COMM_SELF,1,"data inconsistency");
1111  if(conn_face[0] != conn_tet[data.facesNodes(side->side_number,0)])
1112  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
1113  if(conn_face[1] != conn_tet[data.facesNodes(side->side_number,1)])
1114  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
1115  if(conn_face[2] != conn_tet[data.facesNodes(side->side_number,2)])
1116  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
1117  }
1118  }
1120 }
#define CHKERRQ_MOAB(a)
check error code of MoAB function
Definition: definitions.h:482
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:468
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Common.hpp:78
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.

◆ getMaxColOrder()

int MoFEM::ForcesAndSourcesCore::getMaxColOrder ( ) const

Get max order of approximation for field in columns.

Definition at line 176 of file ForcesAndSourcesCore.cpp.

176  {
177  return getMaxOrder(numeredEntFiniteElementPtr->getColsDofs());
178 }
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 168 of file ForcesAndSourcesCore.cpp.

168  {
169  return getMaxOrder(numeredEntFiniteElementPtr->getDataDofs());
170 }
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 172 of file ForcesAndSourcesCore.cpp.

172  {
173  return getMaxOrder(numeredEntFiniteElementPtr->getRowsDofs());
174 }
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 777 of file ForcesAndSourcesCore.cpp.

784  {
785 
787  try {
788  FEDofEntityByNameAndType::iterator dit,hi_dit,it;
789  dit = dofs.get<Composite_Name_And_Type_mi_tag>().lower_bound(boost::make_tuple(field_name,MBVERTEX));
790  hi_dit = dofs.get<Composite_Name_And_Type_mi_tag>().upper_bound(boost::make_tuple(field_name,MBVERTEX));
791 
792  int num_nodes;
793  ierr = getNumberOfNodes(num_nodes); CHKERRG(ierr);
794  int max_nb_dofs = 0;
795  if(dit!=hi_dit) {
796  max_nb_dofs = (*dit)->getNbOfCoeffs()*num_nodes;
797  }
798 
799  if(distance(dit,hi_dit)!=max_nb_dofs) {
800  nodes_data.resize(max_nb_dofs,false);
801  nodes_data.clear();
802  nodes_dofs.resize(max_nb_dofs,false);
803  } else {
804  int size = distance(dit,hi_dit);
805  nodes_data.resize(size,false);
806  nodes_dofs.resize(size,false);
807  }
808 
809  if(dit!=hi_dit) {
810  space = (*dit)->getSpace();
811  base = (*dit)->getApproxBase();
812  }
813 
814  for(;dit!=hi_dit;dit++) {
815  FieldData val = (*dit)->getFieldData();
816  int side_number = (*dit)->sideNumberPtr->side_number;
817  if(side_number == -1) {
818  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
819  }
820  int pos = side_number*(*dit)->getNbOfCoeffs()+(*dit)->getDofCoeffIdx();
821  nodes_data[pos] = val;
822  nodes_dofs[pos] = *dit;
823  int brother_side_number = (*dit)->sideNumberPtr->brother_side_number;
824  if(brother_side_number!=-1) {
825  if(nodes_data.size()<(unsigned int)(brother_side_number*(*dit)->getNbOfCoeffs()+(*dit)->getNbOfCoeffs())) {
826  nodes_data.resize(brother_side_number*(*dit)->getNbOfCoeffs()+(*dit)->getNbOfCoeffs());
827  nodes_dofs.resize(brother_side_number*(*dit)->getNbOfCoeffs()+(*dit)->getNbOfCoeffs());
828  }
829  int brother_pos = brother_side_number*(*dit)->getNbOfCoeffs()+(*dit)->getDofCoeffIdx();
830  nodes_data[brother_pos] = val;
831  nodes_dofs[brother_pos] = *dit;
832  }
833  }
834 
835  } catch (std::exception& ex) {
836  std::ostringstream ss;
837  ss << "thorw in method: " << ex.what() << " at line " << __LINE__ << " in file " << __FILE__;
838  SETERRQ(PETSC_COMM_SELF,MOFEM_STD_EXCEPTION_THROW,ss.str().c_str());
839  }
841 }
double FieldData
Field data type.
Definition: Common.hpp:130
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getNumberOfNodes(int &num_nodes) const

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

843  {
845 
847  field_name,
848  const_cast<FEDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getDataDofs()),
849  data.dataOnEntities[MBVERTEX][0].getFieldData(),
850  data.dataOnEntities[MBVERTEX][0].getFieldDofs(),
851  data.dataOnEntities[MBVERTEX][0].getSpace(),
852  data.dataOnEntities[MBVERTEX][0].getBase()
853  ); CHKERRG(ierr);
855 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
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 CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80

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

359  {
360 
362 
363  FENumeredDofEntityByNameAndType::iterator dit,hi_dit,it;
364  dit = dofs.get<Composite_Name_And_Type_mi_tag>().lower_bound(boost::make_tuple(field_name,MBVERTEX));
365  hi_dit = dofs.get<Composite_Name_And_Type_mi_tag>().upper_bound(boost::make_tuple(field_name,MBVERTEX));
366 
367  int num_nodes;
368  ierr = getNumberOfNodes(num_nodes); CHKERRG(ierr);
369  int max_nb_dofs = 0;
370  if(dit!=hi_dit) {
371  max_nb_dofs = (*dit)->getNbOfCoeffs()*num_nodes;
372  }
373 
374  if(distance(dit,hi_dit)!=max_nb_dofs) {
375  nodes_indices.resize(max_nb_dofs,false);
376  local_nodes_indices.resize(max_nb_dofs,false);
377  for(int dd = 0;dd<max_nb_dofs;dd++) {
378  nodes_indices[dd] = -1;
379  local_nodes_indices[dd] = -1;
380  }
381  } else {
382  nodes_indices.resize(distance(dit,hi_dit),false);
383  local_nodes_indices.resize(distance(dit,hi_dit),false);
384  }
385 
386  for(;dit!=hi_dit;dit++) {
387  const int idx = (*dit)->getPetscGlobalDofIdx();
388  const int local_idx = (*dit)->getPetscLocalDofIdx();
389  const int side_number = (*dit)->sideNumberPtr->side_number;
390  const int pos = side_number*(*dit)->getNbOfCoeffs()+(*dit)->getDofCoeffIdx();
391  nodes_indices[pos] = idx;
392  local_nodes_indices[pos] = local_idx;
393  const int brother_side_number = (*dit)->sideNumberPtr->brother_side_number;
394  if(brother_side_number!=-1) {
395  if(nodes_indices.size()<(unsigned int)(brother_side_number*(*dit)->getNbOfCoeffs()+(*dit)->getNbOfCoeffs())) {
396  nodes_indices.resize(brother_side_number*(*dit)->getNbOfCoeffs()+(*dit)->getNbOfCoeffs());
397  }
398  const int elem_idx = brother_side_number*(*dit)->getNbOfCoeffs()+(*dit)->getDofCoeffIdx();
399  nodes_indices[elem_idx] = idx;
400  local_nodes_indices[elem_idx] = local_idx;
401  }
402  }
403 
405 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T *> &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:28
MoFEMErrorCode getNumberOfNodes(int &num_nodes) const

◆ getNoFieldColIndices()

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

get col NoField indices

Definition at line 657 of file ForcesAndSourcesCore.cpp.

657  {
658 
660  if(data.dataOnEntities[MBENTITYSET].size() == 0) {
661  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
662  }
664  field_name,const_cast<FENumeredDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getColsDofs()),data.dataOnEntities[MBENTITYSET][0].getIndices()
665  ); CHKERRG(ierr);
667 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getNoFieldIndices(const std::string &field_name, FENumeredDofEntity_multiIndex &dofs, VectorInt &nodes_indices) const
get NoField indices

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

970  {
971  //
973  FEDofEntityByFieldName::iterator dit,hi_dit;
974  dit = dofs.get<FieldName_mi_tag>().lower_bound(field_name);
975  hi_dit = dofs.get<FieldName_mi_tag>().upper_bound(field_name);
976  int size = distance(dit,hi_dit);
977  ent_field_data.resize(size,false);
978  ent_field_dofs.resize(size,false);
979  for(;dit!=hi_dit;dit++) {
980  int idx = (*dit)->getDofCoeffIdx();
981  ent_field_data[idx] = (*dit)->getFieldData();
982  ent_field_dofs[idx] = *dit;
983  }
985 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474

◆ getNoFieldFieldData() [2/2]

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

Definition at line 987 of file ForcesAndSourcesCore.cpp.

989  {
990 
992  if(data.dataOnEntities[MBENTITYSET].size() == 0) {
993  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
994  }
996  field_name,const_cast<FEDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getDataDofs()),
997  data.dataOnEntities[MBENTITYSET][0].getFieldData(),
998  data.dataOnEntities[MBENTITYSET][0].getFieldDofs()
999  ); CHKERRG(ierr);
1001 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
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
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80

◆ getNoFieldIndices()

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

get NoField indices

Definition at line 628 of file ForcesAndSourcesCore.cpp.

630  {
631  //
633  FENumeredDofEntityByFieldName::iterator dit,hi_dit;
634  dit = dofs.get<FieldName_mi_tag>().lower_bound(field_name);
635  hi_dit = dofs.get<FieldName_mi_tag>().upper_bound(field_name);
636  indices.resize(distance(dit,hi_dit));
637  for(;dit!=hi_dit;dit++) {
638  int idx = (*dit)->getPetscGlobalDofIdx();
639  indices[(*dit)->getDofCoeffIdx()] = idx;
640  }
642 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474

◆ getNoFieldRowIndices()

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

get col NoField indices

Definition at line 644 of file ForcesAndSourcesCore.cpp.

644  {
645 
647  //EntityType fe_type = numeredEntFiniteElementPtr->getEntType();
648  if(data.dataOnEntities[MBENTITYSET].size() == 0) {
649  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
650  }
652  field_name,const_cast<FENumeredDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getRowsDofs()),data.dataOnEntities[MBENTITYSET][0].getIndices()
653  ); CHKERRG(ierr);
655 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getNoFieldIndices(const std::string &field_name, FENumeredDofEntity_multiIndex &dofs, VectorInt &nodes_indices) const
get NoField indices

◆ getNumberOfNodes()

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

Definition at line 69 of file ForcesAndSourcesCore.cpp.

69  {
71 
73  switch(mField.get_moab().type_from_handle(ent)) {
74  case MBVERTEX:
75  num_nodes = 1;
76  break;
77  case MBEDGE:
78  num_nodes = 2;
79  break;
80  case MBTRI:
81  num_nodes = 3;
82  break;
83  case MBQUAD:
84  num_nodes = 4;
85  break;
86  case MBTET:
87  num_nodes = 4;
88  break;
89  case MBPRISM:
90  num_nodes = 6;
91  break;
92  default:
93  SETERRQ(PETSC_COMM_SELF,MOFEM_NOT_IMPLEMENTED,"not implemented");
94  }
95 
97 }
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:468
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
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:
cell_forces.cpp, elasticity.cpp, and MagneticElement.hpp.

Definition at line 578 of file ForcesAndSourcesCore.hpp.

578 { return opPtrVector; }
boost::ptr_vector< UserDataOperator > opPtrVector

◆ getPrismColIndices()

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

get Prism col indices from FENumeredDofEntity_multiIndex

Definition at line 619 of file ForcesAndSourcesCore.cpp.

619  {
620 
623  field_name,const_cast<FENumeredDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getColsDofs()),MBPRISM,data.dataOnEntities[MBPRISM]
624  ); CHKERRG(ierr);
626 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getTypeIndices(const boost::string_ref field_name, FENumeredDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorInt &indices, VectorInt &local_indices) const
get indices by type (generic function)

◆ getPrismDataOrder()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getPrismDataOrder ( DataForcesAndSourcesCore data,
const FieldSpace  space 
) const

Definition at line 251 of file ForcesAndSourcesCore.cpp.

251  {
252 
254  ierr = getDataOrder(MBPRISM,space,data.dataOnEntities[MBPRISM]); CHKERRG(ierr);
256 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getDataOrder(const EntityType type, const FieldSpace space, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
get maximal approximation order of approximation on the entity

◆ getPrismDataOrderSpaceAndBase()

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

Definition at line 348 of file ForcesAndSourcesCore.cpp.

348  {
349 
351  ierr = getDataOrderSpaceAndBase(field_name,MBPRISM,data.dataOnEntities[MBPRISM]); CHKERRG(ierr);
353 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getDataOrderSpaceAndBase(const std::string &field_name, const EntityType type, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
get maximal approximation order on entity

◆ getPrismFieldData()

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

Definition at line 1050 of file ForcesAndSourcesCore.cpp.

1050  {
1051 
1053  if(data.dataOnEntities[MBPRISM].size() == 0) {
1054  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
1055  }
1057  field_name,
1058  const_cast<FEDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getDataDofs()),
1059  MBPRISM,
1060  0,
1061  data.dataOnEntities[MBPRISM][0].getFieldData(),
1062  data.dataOnEntities[MBPRISM][0].getFieldDofs()
1063  ); CHKERRG(ierr);
1065 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
MoFEMErrorCode getTypeFieldData(const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorDouble &ent_field_data, VectorDofs &ent_field_dofs) const
Get field data on entities.
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80

◆ getPrismRowIndices()

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

get Prism row indices from FENumeredDofEntity_multiIndex

Definition at line 608 of file ForcesAndSourcesCore.cpp.

610  {
611 
614  field_name,const_cast<FENumeredDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getRowsDofs()),MBPRISM,data.dataOnEntities[MBPRISM]
615  ); CHKERRG(ierr);
617 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getTypeIndices(const boost::string_ref field_name, FENumeredDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorInt &indices, VectorInt &local_indices) const
get indices by type (generic function)

◆ getProblemNodesColIndices()

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

Definition at line 761 of file ForcesAndSourcesCore.cpp.

761  {
763 
764  ierr = getProblemNodesIndices(field_name,*(problemPtr->numeredDofsCols),nodes_indices); CHKERRG(ierr);
766 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
const Problem * problemPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
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 671 of file ForcesAndSourcesCore.cpp.

675  {
677 
678  nodes_indices.resize(0);
679 
680  SideNumber_multiIndex& side_table = const_cast<SideNumber_multiIndex&>(numeredEntFiniteElementPtr->getSideNumberTable());
681  SideNumber_multiIndex::nth_index<1>::type::iterator siit = side_table.get<1>().lower_bound(boost::make_tuple(MBVERTEX,0));
682  SideNumber_multiIndex::nth_index<1>::type::iterator hi_siit = side_table.get<1>().lower_bound(boost::make_tuple(MBVERTEX,10000));
683 
684  int nn = 0;
685  for(;siit!=hi_siit;siit++,nn++) {
686 
687  if(siit->get()->side_number == -1) continue;
688 
689  const EntityHandle ent = siit->get()->ent;
690  NumeredDofEntity_multiIndex::index<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>::type::iterator dit,hi_dit;
691  dit = dofs.get<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>().lower_bound(boost::make_tuple(field_name,ent,0));
692  hi_dit = dofs.get<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>().upper_bound(boost::make_tuple(field_name,ent,10000)); /// very large number
693 
694  if(dit!=hi_dit) {
695 
696  if(!nn) {
697  nodes_indices.resize((*dit)->getNbOfCoeffs()*distance(siit,hi_siit));
698  }
699  for(;dit!=hi_dit;dit++) {
700  nodes_indices[siit->get()->side_number*(*dit)->getNbOfCoeffs()+(*dit)->getDofCoeffIdx()] = (*dit)->getPetscGlobalDofIdx();
701  }
702 
703  }
704 
705  }
706 
708 
709 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
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.

◆ getProblemNodesRowIndices()

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

Definition at line 747 of file ForcesAndSourcesCore.cpp.

747  {
749 
750  ierr = getProblemNodesIndices(field_name,*(problemPtr->numeredDofsRows),nodes_indices); CHKERRG(ierr);
752 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
const Problem * problemPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
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 768 of file ForcesAndSourcesCore.cpp.

768  {
770 
771  ierr = getProblemTypeIndices(field_name,*(problemPtr->numeredDofsCols),type,side_number,indices); CHKERRG(ierr);
773 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
const Problem * problemPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
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 711 of file ForcesAndSourcesCore.cpp.

714  {
716 
717  indices.resize(0);
718 
719  SideNumber_multiIndex& side_table =
720  const_cast<SideNumber_multiIndex&>(numeredEntFiniteElementPtr->getSideNumberTable());
721  SideNumber_multiIndex::nth_index<1>::type::iterator siit =
722  side_table.get<1>().lower_bound(boost::make_tuple(type,side_number));
723  SideNumber_multiIndex::nth_index<1>::type::iterator hi_siit =
724  side_table.get<1>().upper_bound(boost::make_tuple(type,side_number));
725 
726  for(;siit!=hi_siit;siit++) {
727 
728  if(siit->get()->side_number == -1) continue;
729 
730  const EntityHandle ent = siit->get()->ent;
731  NumeredDofEntity_multiIndex::index<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>::type::iterator dit,hi_dit;
732  dit = dofs.get<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>().lower_bound(boost::make_tuple(field_name,ent,0));
733  hi_dit = dofs.get<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>().upper_bound(boost::make_tuple(field_name,ent,10000)); /// very large number
734 
735  indices.resize(distance(dit,hi_dit));
736  for(;dit!=hi_dit;dit++) {
737 
738  indices[(*dit)->getEntDofIdx()] = (*dit)->getPetscGlobalDofIdx();
739 
740  }
741 
742  }
743 
745 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
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.

◆ getProblemTypeRowIndices()

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

Definition at line 754 of file ForcesAndSourcesCore.cpp.

754  {
756 
757  ierr = getProblemTypeIndices(field_name,*(problemPtr->numeredDofsRows),type,side_number,indices); CHKERRG(ierr);
759 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
const Problem * problemPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
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...

◆ getQuadColIndices()

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

get Quad col indices from FENumeredDofEntity_multiIndex

Definition at line 599 of file ForcesAndSourcesCore.cpp.

599  {
600 
603  field_name,const_cast<FENumeredDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getColsDofs()),MBQUAD,data.dataOnEntities[MBQUAD]
604  ); CHKERRG(ierr);
606 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getTypeIndices(const boost::string_ref field_name, FENumeredDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorInt &indices, VectorInt &local_indices) const
get indices by type (generic function)

◆ getQuadDataOrder()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getQuadDataOrder ( DataForcesAndSourcesCore data,
const FieldSpace  space 
) const

Definition at line 237 of file ForcesAndSourcesCore.cpp.

237  {
238 
240  ierr = getDataOrder(MBQUAD,space,data.dataOnEntities[MBQUAD]); CHKERRG(ierr);
242 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getDataOrder(const EntityType type, const FieldSpace space, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
get maximal approximation order of approximation on the entity

◆ getQuadDataOrderSpaceAndBase()

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

Definition at line 334 of file ForcesAndSourcesCore.cpp.

334  {
335 
337  ierr = getDataOrderSpaceAndBase(field_name,MBQUAD,data.dataOnEntities[MBQUAD]); CHKERRG(ierr);
339 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getDataOrderSpaceAndBase(const std::string &field_name, const EntityType type, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
get maximal approximation order on entity

◆ getQuadFieldData()

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

Definition at line 1023 of file ForcesAndSourcesCore.cpp.

1025  {
1026 
1029  field_name,const_cast<FEDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getDataDofs()),MBQUAD,data.dataOnEntities[MBQUAD]
1030  ); CHKERRG(ierr);
1032 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
MoFEMErrorCode getTypeFieldData(const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorDouble &ent_field_data, VectorDofs &ent_field_dofs) const
Get field data on entities.
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80

◆ getQuadRowIndices()

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

get Quad row indices from FENumeredDofEntity_multiIndex

Definition at line 588 of file ForcesAndSourcesCore.cpp.

590  {
591 
594  field_name,const_cast<FENumeredDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getRowsDofs()),MBQUAD,data.dataOnEntities[MBQUAD]
595  ); CHKERRG(ierr);
597 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getTypeIndices(const boost::string_ref field_name, FENumeredDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorInt &indices, VectorInt &local_indices) const
get indices by type (generic function)

◆ getQuadSense()

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

Definition at line 143 of file ForcesAndSourcesCore.cpp.

143  {
144 
146  ierr = getSense(MBQUAD,data.dataOnEntities[MBQUAD]); CHKERRG(ierr);
148 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getSense(EntityType type, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
get sense (orientation) of entity

◆ getRowNodesIndices()

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

get row node indices from FENumeredDofEntity_multiIndex

Definition at line 407 of file ForcesAndSourcesCore.cpp.

407  {
408 
411  field_name,const_cast<FENumeredDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getRowsDofs()),
412  data.dataOnEntities[MBVERTEX][0].getIndices(),data.dataOnEntities[MBVERTEX][0].getLocalIndices()
413  ); CHKERRG(ierr);
415 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
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 coefficents 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 PostProcFaceOnRefinedMesh, BoneRemodeling::DensityMapFe, MoFEM::VolumeElementForcesAndSourcesCoreOnSide, GelModule::Gel::GelFE, SmallStrainPlasticity::MyVolumeFE, PostProcTemplateVolumeOnRefinedMesh< MoFEM::VolumeElementForcesAndSourcesCore >, KelvinVoigtDamper::DamperFE, NitscheMethod::MyVolumeFE, SurfaceSlidingConstrains::MyTriangleFE, GriffithForceElement::MyTriangleFE, ThermalElement::MyTriFE, NeummanForcesSurface::MyTriangleFE, MixTransport::MixTransportElement::MyTriFE, NonlinearElasticElement::MyVolumeFE, MagneticElement::TriFE, MoFEM::NormElement::MyTriFE, NeummanForcesSurfaceComplexForLazy::MyTriangleSpatialFE, ThermalElement::MyVolumeFE, CellEngineering::FaceElement, MixTransport::MixTransportElement::MyVolumeFE, MoFEM::NormElement::MyVolumeFE, OptimalMassTransport::TriFE, MagneticElement::VolumeFE, 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 309 of file ForcesAndSourcesCore.hpp.

309 { 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 330 of file ForcesAndSourcesCore.hpp.

330  {
331  return getRuleHook? getRuleHook(order_row,order_col,order_data) : getRule(order_data);
332  }
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 101 of file ForcesAndSourcesCore.cpp.

101  {
103  try {
104  SideNumber_multiIndex& side_table = const_cast<SideNumber_multiIndex&>(numeredEntFiniteElementPtr->getSideNumberTable());
105  if(data.size() < side_table.get<2>().count(type)) {
106  // prims has 9 edges, some of edges for "flat" prism are not active
107  SETERRQ2(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency %u < %u",data.size(),side_table.get<2>().count(type));
108  }
109  SideNumber_multiIndex::nth_index<2>::type::iterator siit = side_table.get<2>().lower_bound(type);
110  SideNumber_multiIndex::nth_index<2>::type::iterator hi_siit = side_table.get<2>().upper_bound(type);
111  for(;siit!=hi_siit;siit++) {
112  data[siit->get()->side_number].getSense() = siit->get()->sense;
113  if(siit->get()->brother_side_number!=-1) {
114  if(data.size() < (unsigned)siit->get()->brother_side_number) {
115  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
116  }
117  data[siit->get()->brother_side_number].getSense() = siit->get()->sense;
118  }
119  }
120  } catch (std::exception& ex) {
121  std::ostringstream ss;
122  ss << "thorw in method: " << ex.what() << " at line " << __LINE__ << " in file " << __FILE__;
123  SETERRQ(PETSC_COMM_SELF,MOFEM_STD_EXCEPTION_THROW,ss.str().c_str());
124  }
125 
127 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
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.

◆ getSpacesAndBaseOnEntities()

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

Get field approximation space and base on entities.

Definition at line 1124 of file ForcesAndSourcesCore.cpp.

1124  {
1125  //
1127  try {
1128  if(nInTheLoop==0) {
1129  data.sPace.reset();
1130  data.bAse.reset();
1131  for(EntityType t = MBVERTEX;t!=MBMAXTYPE;t++) {
1132  data.spacesOnEntities[t].reset();
1133  data.basesOnEntities[t].reset();
1134  }
1135  }
1136  for(_IT_GET_FEDATA_DOFS_FOR_LOOP_(this,dof)) {
1137  if(dof->get()->getEntDofIdx()!=0) continue;
1138  // std::cerr << *dof << std::endl;
1139  // std::cerr << dof->getSpace() << " " << data.sPace.size() << std::endl;
1140  // std::cerr << dof->getApproxBase() << " " << data.bAse.size() << std::endl;
1141  const FieldSpace space = dof->get()->getSpace();
1142  const FieldApproximationBase approx = dof->get()->getApproxBase();
1143  data.sPace.set(space);
1144  data.bAse.set(approx);
1145  const EntityType type = dof->get()->getEntType();
1146  data.spacesOnEntities[type].set(space);
1147  data.basesOnEntities[type].set(approx);
1148  // std::cerr << "approx base " << ApproximationBaseNames[dof->getApproxBase()] << " " << data.basesOnEntities[dof->getEntType()] << std::endl;
1149  }
1150  } catch (std::exception& ex) {
1151  std::ostringstream ss;
1152  ss << "thorw in method: " << ex.what() << " at line " << __LINE__ << " in file " << __FILE__;
1153  SETERRQ(PETSC_COMM_SELF,MOFEM_STD_EXCEPTION_THROW,ss.str().c_str());
1154  }
1156 }
#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:468
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
FieldApproximationBase
approximation base
Definition: definitions.h:138
FieldSpace
approximation spaces
Definition: definitions.h:172

◆ getTetDataOrder()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getTetDataOrder ( DataForcesAndSourcesCore data,
const FieldSpace  space 
) const

Definition at line 244 of file ForcesAndSourcesCore.cpp.

244  {
245 
247  ierr = getDataOrder(MBTET,space,data.dataOnEntities[MBTET]); CHKERRG(ierr);
249 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getDataOrder(const EntityType type, const FieldSpace space, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
get maximal approximation order of approximation on the entity

◆ getTetDataOrderSpaceAndBase()

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

Definition at line 341 of file ForcesAndSourcesCore.cpp.

341  {
342 
344  ierr = getDataOrderSpaceAndBase(field_name,MBTET,data.dataOnEntities[MBTET]); CHKERRG(ierr);
346 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getDataOrderSpaceAndBase(const std::string &field_name, const EntityType type, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
get maximal approximation order on entity

◆ getTetsColIndices()

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

get Tets col indices from FENumeredDofEntity_multiIndex

Definition at line 575 of file ForcesAndSourcesCore.cpp.

575  {
576 
578  if(data.dataOnEntities[MBTET].size() == 0) {
579  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
580  }
582  field_name,const_cast<FENumeredDofEntity_multiIndex&>(
583  numeredEntFiniteElementPtr->getColsDofs()),MBTET,0,data.dataOnEntities[MBTET][0].getIndices(),data.dataOnEntities[MBTET][0].getLocalIndices()
584  ); CHKERRG(ierr);
586 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getTypeIndices(const boost::string_ref field_name, FENumeredDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorInt &indices, VectorInt &local_indices) const
get indices by type (generic function)

◆ getTetsFieldData()

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

Definition at line 1034 of file ForcesAndSourcesCore.cpp.

1034  {
1035 
1037  if(data.dataOnEntities[MBTET].size() == 0) {
1038  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
1039  }
1041  field_name,const_cast<FEDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getDataDofs()),
1042  MBTET,
1043  0,
1044  data.dataOnEntities[MBTET][0].getFieldData(),
1045  data.dataOnEntities[MBTET][0].getFieldDofs()
1046  ); CHKERRG(ierr);
1048 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
MoFEMErrorCode getTypeFieldData(const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorDouble &ent_field_data, VectorDofs &ent_field_dofs) const
Get field data on entities.
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80

◆ getTetsRowIndices()

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

get Tets row indices from FENumeredDofEntity_multiIndex

Definition at line 562 of file ForcesAndSourcesCore.cpp.

562  {
563 
565  if(data.dataOnEntities[MBTET].size() == 0) {
566  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
567  }
569  field_name,const_cast<FENumeredDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getRowsDofs()),MBTET,0,
570  data.dataOnEntities[MBTET][0].getIndices(),data.dataOnEntities[MBTET][0].getLocalIndices()
571  ); CHKERRG(ierr);
573 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getTypeIndices(const boost::string_ref field_name, FENumeredDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorInt &indices, VectorInt &local_indices) const
get indices by type (generic function)

◆ getTrisColIndices()

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

get Tris col indices from FENumeredDofEntity_multiIndex

Definition at line 553 of file ForcesAndSourcesCore.cpp.

553  {
554 
557  field_name,const_cast<FENumeredDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getColsDofs()),MBTRI,data.dataOnEntities[MBTRI]
558  ); CHKERRG(ierr);
560 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getTypeIndices(const boost::string_ref field_name, FENumeredDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorInt &indices, VectorInt &local_indices) const
get indices by type (generic function)

◆ getTrisDataOrder()

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getTrisDataOrder ( DataForcesAndSourcesCore data,
const FieldSpace  space 
) const

Definition at line 230 of file ForcesAndSourcesCore.cpp.

230  {
231 
233  ierr = getDataOrder(MBTRI,space,data.dataOnEntities[MBTRI]); CHKERRG(ierr);
235 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getDataOrder(const EntityType type, const FieldSpace space, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
get maximal approximation order of approximation on the entity

◆ getTrisDataOrderSpaceAndBase()

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

Definition at line 327 of file ForcesAndSourcesCore.cpp.

327  {
328 
330  ierr = getDataOrderSpaceAndBase(field_name,MBTRI,data.dataOnEntities[MBTRI]); CHKERRG(ierr);
332 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getDataOrderSpaceAndBase(const std::string &field_name, const EntityType type, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
get maximal approximation order on entity

◆ getTrisFieldData()

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

Definition at line 1012 of file ForcesAndSourcesCore.cpp.

1014  {
1015 
1018  field_name,const_cast<FEDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getDataDofs()),MBTRI,data.dataOnEntities[MBTRI]
1019  ); CHKERRG(ierr);
1021 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
MoFEMErrorCode getTypeFieldData(const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorDouble &ent_field_data, VectorDofs &ent_field_dofs) const
Get field data on entities.
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80

◆ getTrisRowIndices()

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

get Tris row indices from FENumeredDofEntity_multiIndex

Definition at line 542 of file ForcesAndSourcesCore.cpp.

544  {
545 
548  field_name,const_cast<FENumeredDofEntity_multiIndex&>(numeredEntFiniteElementPtr->getRowsDofs()),MBTRI,data.dataOnEntities[MBTRI]
549  ); CHKERRG(ierr);
551 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getTypeIndices(const boost::string_ref field_name, FENumeredDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorInt &indices, VectorInt &local_indices) const
get indices by type (generic function)

◆ getTrisSense()

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

get triangle sense (orientation)

Parameters
datastructure where results are stored
Returns
error code

Definition at line 136 of file ForcesAndSourcesCore.cpp.

136  {
137 
139  ierr = getSense(MBTRI,data.dataOnEntities[MBTRI]); CHKERRG(ierr);
141 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
MoFEMErrorCode getSense(EntityType type, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
get sense (orientation) of entity

◆ getTypeFieldData() [1/2]

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getTypeFieldData ( const boost::string_ref  field_name,
FEDofEntity_multiIndex dofs,
EntityType  type,
int  side_number,
VectorDouble ent_field_data,
VectorDofs ent_field_dofs 
) const

Get field data on entities.

Parameters
field_nameField name
dofsDofs (element) multi index
typeEntity type
side_numberSide number (Local number of entity on element in canonical order)
ent_field_dataVector of DOFs values on entities
ent_field_dofsVector of pointers to DOFs data structure
Returns
Error code

Definition at line 857 of file ForcesAndSourcesCore.cpp.

864  {
865  //
867  FEDofEntity_multiIndex::index<Composite_Name_Type_And_Side_Number_mi_tag>::type::iterator dit,hi_dit;
868  dit = dofs.get<Composite_Name_Type_And_Side_Number_mi_tag>().lower_bound(boost::make_tuple(field_name,type,side_number));
869  if(dit == dofs.get<Composite_Name_Type_And_Side_Number_mi_tag>().end()) {
870  ent_field_data.resize(0,false);
871  ent_field_dofs.resize(0,false);
873  }
874  hi_dit = dofs.get<Composite_Name_Type_And_Side_Number_mi_tag>().upper_bound(boost::make_tuple(field_name,type,side_number));
875  if(dit!=hi_dit) {
876  ent_field_data.resize((*dit)->getNbDofsOnEnt(),false);
877  ent_field_dofs.resize((*dit)->getNbDofsOnEnt(),false);
878  for(;dit!=hi_dit;dit++) {
879  const FieldData val = (*dit)->getFieldData();
880  const int idx = (*dit)->getEntDofIdx();
881  ent_field_data[idx] = val;
882  ent_field_dofs[idx] = *dit;
883  }
884  } else {
885  ent_field_data.resize(0,false);
886  ent_field_dofs.resize(0,false);
887  }
889 }
double FieldData
Field data type.
Definition: Common.hpp:130
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474

◆ getTypeFieldData() [2/2]

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getTypeFieldData ( const boost::string_ref  field_name,
FEDofEntity_multiIndex dofs,
EntityType  type,
boost::ptr_vector< DataForcesAndSourcesCore::EntData > &  data 
) const

Definition at line 891 of file ForcesAndSourcesCore.cpp.

896  {
897 
899  SideNumber_multiIndex& side_table = const_cast<SideNumber_multiIndex&>(numeredEntFiniteElementPtr->getSideNumberTable());
900  // if(data.size() < side_table.get<2>().count(type)) {
901  // SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
902  // }
903  SideNumber_multiIndex::nth_index<2>::type::iterator siit,hi_siit;
904  siit = side_table.get<2>().lower_bound(type);
905  hi_siit = side_table.get<2>().upper_bound(type);
906  const boost::tuple<const boost::string_ref,EntityType> tuple = boost::make_tuple(field_name,type);
907  FEDofEntityByNameAndType::iterator dit,hi_dit;
908  dit = dofs.get<Composite_Name_And_Type_mi_tag>().lower_bound(tuple);
909  if(dit == dofs.get<Composite_Name_And_Type_mi_tag>().end()) {
910  for(
911  SideNumber_multiIndex::nth_index<2>::type::iterator
912  siiit = siit;siiit!=hi_siit;siiit++
913  ) {
914  const int side_number = siiit->get()->side_number;
915  data[side_number].getFieldData().resize(0,false);
916  data[side_number].getFieldDofs().resize(0,false);
917  }
919  }
920  for(
921  SideNumber_multiIndex::nth_index<2>::type::iterator
922  siiit = siit;siiit!=hi_siit;siiit++
923  ) {
924  const int side_number = siiit->get()->side_number;
925  data[side_number].semaphore = false;
926  }
927  hi_dit = dofs.get<Composite_Name_And_Type_mi_tag>().upper_bound(tuple);
928  for(;dit!=hi_dit;dit++) {
929  const int side = dit->get()->sideNumberPtr->side_number;
930  const int nb_dofs_on_ent = (*dit)->getNbDofsOnEnt();
931  VectorDouble &ent_field_data = data[side].getFieldData();
932  VectorDofs &ent_field_dofs = data[side].getFieldDofs();
933  if(!data[side].semaphore) {
934  data[side].semaphore = true;
935  ent_field_data.resize(nb_dofs_on_ent,false);
936  ent_field_dofs.resize(nb_dofs_on_ent,false);
937  }
938  if(!nb_dofs_on_ent) {
939  continue;
940  }
941  const int idx = dit->get()->getEntDofIdx();
942  ent_field_data[idx] = dit->get()->getFieldData();
943  ent_field_dofs[idx] = *dit;
944  }
945  for(;siit!=hi_siit;siit++) {
946  const int side_number = siit->get()->side_number;
947  if(!data[side_number].semaphore) {
948  data[side_number].getFieldData().resize(0,false);
949  data[side_number].getFieldDofs().resize(0,false);
950  }
951  if(siit->get()->brother_side_number!=-1) {
952  if(data.size() < (unsigned int)siit->get()->brother_side_number) {
953  SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
954  }
956  field_name,dofs,type,side_number,
957  data[siit->get()->brother_side_number].getFieldData(),
958  data[siit->get()->brother_side_number].getFieldDofs()
959  ); CHKERRG(ierr);
960  }
961  }
963 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
MoFEMErrorCode getTypeFieldData(const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorDouble &ent_field_data, VectorDofs &ent_field_dofs) const
Get field data on entities.
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
ublas::vector< double, DoubleAllocator > VectorDouble
Definition: Common.hpp:211
ublas::vector< boost::shared_ptr< const FEDofEntity >, DofsAllocator > VectorDofs
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.

◆ getTypeIndices() [1/2]

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getTypeIndices ( const boost::string_ref  field_name,
FENumeredDofEntity_multiIndex dofs,
EntityType  type,
int  side_number,
VectorInt indices,
VectorInt local_indices 
) const

get indices by type (generic function)

Definition at line 427 of file ForcesAndSourcesCore.cpp.

429  {
430  //
432  FENumeredDofEntity_multiIndex::index<Composite_Name_Type_And_Side_Number_mi_tag>::type::iterator dit,hi_dit;
433  dit = dofs.get<Composite_Name_Type_And_Side_Number_mi_tag>().lower_bound(boost::make_tuple(field_name,type,side_number));
434  if(dit==dofs.get<Composite_Name_Type_And_Side_Number_mi_tag>().end()) {
435  indices.resize(0);
436  local_indices.resize(0);
438  }
439  hi_dit = dofs.get<Composite_Name_Type_And_Side_Number_mi_tag>().upper_bound(boost::make_tuple(field_name,type,side_number));
440  if(dit!=hi_dit) {
441  indices.resize((*dit)->getNbDofsOnEnt(),false);
442  local_indices.resize((*dit)->getNbDofsOnEnt(),false);
443  for(;dit!=hi_dit;dit++) {
444  int idx = (*dit)->getPetscGlobalDofIdx();
445  int elemem_idx = (*dit)->getEntDofIdx();
446  indices[elemem_idx] = idx;
447  int local_idx = (*dit)->getPetscLocalDofIdx();
448  local_indices[elemem_idx] = local_idx;
449  }
450  } else {
451  indices.resize(0);
452  local_indices.resize(0);
453  }
455 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474

◆ getTypeIndices() [2/2]

MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getTypeIndices ( const boost::string_ref  field_name,
FENumeredDofEntity_multiIndex dofs,
EntityType  type,
boost::ptr_vector< DataForcesAndSourcesCore::EntData > &  data 
) const

get indices by type (generic function)

Definition at line 457 of file ForcesAndSourcesCore.cpp.

460  {
461 
463  SideNumber_multiIndex& side_table = const_cast<SideNumber_multiIndex&>(numeredEntFiniteElementPtr->getSideNumberTable());
464  SideNumber_multiIndex::nth_index<2>::type::iterator siit = side_table.get<2>().lower_bound(type);
465  SideNumber_multiIndex::nth_index<2>::type::iterator hi_siit = side_table.get<2>().upper_bound(type);
466  const boost::tuple<const boost::string_ref,EntityType> tuple
467  = boost::make_tuple(field_name,type);
468  FENumeredDofEntityByNameAndType::iterator dit,hi_dit;
469  dit = dofs.get<Composite_Name_And_Type_mi_tag>().lower_bound(tuple);
470  if(dit == dofs.get<Composite_Name_And_Type_mi_tag>().end()) {
471  for(
472  SideNumber_multiIndex::nth_index<2>::type::iterator
473  siiit = siit;siiit!=hi_siit;siiit++
474  ) {
475  data[siiit->get()->side_number].getIndices().resize(0,false);
476  data[siiit->get()->side_number].getLocalIndices().resize(0,false);
477  }
479  }
480  for(
481  SideNumber_multiIndex::nth_index<2>::type::iterator
482  siiit = siit;siiit!=hi_siit;siiit++
483  ) {
484  const int side_number = siiit->get()->side_number;
485  data[side_number].semaphore = false;
486  }
487  hi_dit = dofs.get<Composite_Name_And_Type_mi_tag>().upper_bound(tuple);
488  for(;dit!=hi_dit;dit++) {
489  const int side = dit->get()->sideNumberPtr->side_number;
490  const int nb_dofs_on_ent = dit->get()->getNbDofsOnEnt();
491  VectorInt &indices = data[side].getIndices();
492  VectorInt &local_indices = data[side].getLocalIndices();
493  if(!data[side].semaphore) {
494  data[side].semaphore = true;
495  indices.resize(nb_dofs_on_ent,false);
496  local_indices.resize(nb_dofs_on_ent,false);
497  }
498  if(!nb_dofs_on_ent) {
499  continue;
500  }
501  const int idx = dit->get()->getEntDofIdx();
502  indices[idx] = dit->get()->getPetscGlobalDofIdx();
503  local_indices[idx] = dit->get()->getPetscLocalDofIdx();
504  }
505  for(;siit!=hi_siit;siit++) {
506  const int side_number = siit->get()->side_number;
507  if(!data[side_number].semaphore) {
508  data[side_number].getIndices().resize(0,false);
509  data[side_number].getLocalIndices().resize(0,false);
510  }
511  if(siit->get()->brother_side_number!=-1) {
513  field_name,
514  dofs,type,
515  side_number,
516  data[siit->get()->brother_side_number].getIndices(),
517  data[siit->get()->brother_side_number].getLocalIndices()
518  ); CHKERRG(ierr);
519  }
520  }
522 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
ublas::vector< int, IntAllocator > VectorInt
Definition: Common.hpp:210
MoFEMErrorCode getTypeIndices(const boost::string_ref field_name, FENumeredDofEntity_multiIndex &dofs, EntityType type, int side_number, VectorInt &indices, VectorInt &local_indices) const
get indices by type (generic function)
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.

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

587  {
589  if(operatorHook) {
591  }
593  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
boost::function< MoFEMErrorCode()> operatorHook
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80

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

Examples:
Remodeling.hpp.

Definition at line 594 of file ForcesAndSourcesCore.hpp.

594  {
596  if(postProcessHook) {
598  }
600  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
boost::function< MoFEMErrorCode()> postProcessHook

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

Examples:
Remodeling.hpp.

Definition at line 580 of file ForcesAndSourcesCore.hpp.

580  {
582  if(preProcessHook) {
584  }
586  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
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 336 of file ForcesAndSourcesCore.hpp.

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

◆ 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

MatrixDouble gaussPts;

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

364  {
365 
367  ierr = setGaussPts(order_data); CHKERRG(ierr);
369  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:511
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
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

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

◆ mField

Interface& MoFEM::ForcesAndSourcesCore::mField

◆ opPtrVector

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

Definition at line 571 of file ForcesAndSourcesCore.hpp.


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