v0.7.26
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 = false>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, IFACE *&iface) const
 Get interface by uuid and return reference to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface refernce to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface. More...
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface. More...
 
virtual ~UnknownInterface ()
 
virtual MoFEMErrorCode getLibVersion (Version &version) const
 Get library version. More...
 
virtual const MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version) const
 Get database major version. More...
 
virtual MoFEMErrorCode getInterfaceVersion (Version &version) const
 Get database major version. More...
 
template<>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, UnknownInterface *&iface) const
 
- Public Member Functions inherited from MoFEM::SnesMethod
 SnesMethod ()
 
virtual ~SnesMethod ()
 
MoFEMErrorCode setSnesCtx (const SNESContext &ctx)
 Set SNES context. More...
 
MoFEMErrorCode setSnes (SNES snes)
 Set SNES instance. More...
 
MoFEMErrorCode copySnes (const SnesMethod &snes)
 Copy snes data. More...
 
- Public Member Functions inherited from MoFEM::TSMethod
 TSMethod ()
 
virtual ~TSMethod ()
 
MoFEMErrorCode setTsCtx (const TSContext &ctx)
 Set Ts context. More...
 
MoFEMErrorCode copyTs (const TSMethod &ts)
 Copy TS solver data. More...
 
MoFEMErrorCode setTs (TS _ts)
 Set TS solver. More...
 

Public Attributes

InterfacemField
 
RuleHookFun getRuleHook
 Hook to get rule. More...
 
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 505 of file ForcesAndSourcesCore.cpp.

506  {
507 
509  ierr = getNodesIndices(field_name,
510  const_cast<FENumeredDofEntity_multiIndex &>(
511  numeredEntFiniteElementPtr->getColsDofs()),
512  data.dataOnEntities[MBVERTEX][0].getIndices(),
513  data.dataOnEntities[MBVERTEX][0].getLocalIndices());
514  CHKERRG(ierr);
516 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 194 of file ForcesAndSourcesCore.cpp.

196  {
198  try {
199  SideNumber_multiIndex &side_table = const_cast<SideNumber_multiIndex &>(
200  numeredEntFiniteElementPtr->getSideNumberTable());
201  if (data.size() < side_table.get<2>().count(type)) {
202  // prims has 9 edges, some of edges for "flat" prism are not active
203  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
204  "data inconsistency %d < %d", data.size(),
205  side_table.get<2>().count(type));
206  }
207  for (unsigned int side = 0; side < data.size(); side++) {
208  data[side].getDataOrder() = 0;
209  }
210  FEDofEntity_multiIndex::index<Composite_EntType_and_Space_mi_tag>::type
211  &data_dofs = const_cast<FEDofEntity_multiIndex::index<
212  Composite_EntType_and_Space_mi_tag>::type &>(
213  numeredEntFiniteElementPtr->getDataDofs()
214  .get<Composite_EntType_and_Space_mi_tag>());
215  FEDofEntity_multiIndex::index<
216  Composite_EntType_and_Space_mi_tag>::type::iterator dit,
217  hi_dit;
218  dit = data_dofs.lower_bound(boost::make_tuple(type, space));
219  hi_dit = data_dofs.upper_bound(boost::make_tuple(type, space));
220  for (; dit != hi_dit; dit++) {
221  ApproximationOrder ent_order = (*dit)->getMaxOrder();
222  int side_number = (*dit)->sideNumberPtr->side_number;
223  if (side_number < 0) {
224  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
225  "data inconsistency");
226  }
227  data[side_number].getDataOrder() =
228  data[side_number].getDataOrder() > ent_order
229  ? data[side_number].getDataOrder()
230  : ent_order;
231  if ((*dit)->sideNumberPtr->brother_side_number != -1) {
232  if (data.size() <
233  (unsigned int)(*dit)->sideNumberPtr->brother_side_number) {
234  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
235  "data inconsistency");
236  }
237  data[(*dit)->sideNumberPtr->brother_side_number].getDataOrder() =
238  data[side_number].getDataOrder();
239  }
240  }
241  } catch (std::exception &ex) {
242  std::ostringstream ss;
243  ss << "thorw in method: " << ex.what() << " at line " << __LINE__
244  << " in file " << __FILE__;
245  SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, ss.str().c_str());
246  }
248 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< hashed_unique< member< SideNumber, EntityHandle, &SideNumber::ent > >, ordered_non_unique< composite_key< SideNumber, const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType >, member< SideNumber, char, &SideNumber::side_number > > >, ordered_non_unique< const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
int ApproximationOrder
Approximation on the entity.
Definition: Common.hpp:131

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

302  {
304 
305  SideNumber_multiIndex &side_table = const_cast<SideNumber_multiIndex &>(
306  numeredEntFiniteElementPtr->getSideNumberTable());
307  if (data.size() < side_table.get<2>().count(type)) {
308  // prims has 9 edges, some of edges for "flat" prism are not active
309  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
310  "data inconsistency %d < %d", data.size(),
311  side_table.get<2>().count(type));
312  }
313 
314  for (unsigned int side = 0; side != data.size(); ++side) {
315  data[side].getDataOrder() = 0;
316  data[side].getBase() = NOBASE;
317  data[side].getSpace() = NOSPACE;
318  }
319 
320  // get dofs by name, type and side
321  const FEDofEntity_multiIndex::index<
322  Composite_Name_Type_And_Side_Number_mi_tag>::type &data_dofs =
323  numeredEntFiniteElementPtr->getDataDofs()
324  .get<Composite_Name_Type_And_Side_Number_mi_tag>();
325  FEDofEntity_multiIndex::index<
326  Composite_Name_Type_And_Side_Number_mi_tag>::type::iterator dit,
327  hi_dit;
328  dit = data_dofs.lower_bound(boost::make_tuple(field_name, type, 0));
329  if (dit == data_dofs.end()) {
331  }
332  hi_dit =
333  data_dofs.upper_bound(boost::make_tuple(field_name, type, data.size()));
334 
335  for (; dit != hi_dit;) {
336 
337  // std::cerr << ApproximationBaseNames[dit->getApproxBase()] << std::endl;
338 
339  int side_number = (*dit)->sideNumberPtr->side_number;
340  if (data[side_number].getDataOrder()) {
341  const int nb_dofs_on_ent = (*dit)->getNbDofsOnEnt();
342  for (int i = 0; i != nb_dofs_on_ent; ++i, ++dit) {
343  }
344  continue;
345  }
346 
347  ApproximationOrder ent_order = (*dit)->getMaxOrder();
348  if (PetscUnlikely(side_number < 0)) {
349  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
350  "Side number is not set to dof entity");
351  }
352  data[side_number].getBase() = (*dit)->getApproxBase();
353  data[side_number].getSpace() = (*dit)->getSpace();
354  data[side_number].getDataOrder() =
355  data[side_number].getDataOrder() > ent_order
356  ? data[side_number].getDataOrder()
357  : ent_order;
358  if ((*dit)->sideNumberPtr->brother_side_number != -1) {
359  if (data.size() <
360  (unsigned int)(*dit)->sideNumberPtr->brother_side_number) {
361  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
362  "data inconsistency");
363  }
364  data[(*dit)->sideNumberPtr->brother_side_number].getBase() =
365  data[side_number].getBase();
366  data[(*dit)->sideNumberPtr->brother_side_number].getSpace() =
367  data[side_number].getSpace();
368  data[(*dit)->sideNumberPtr->brother_side_number].getDataOrder() =
369  data[side_number].getDataOrder();
370  }
371 
372  const int nb_dofs_on_ent = (*dit)->getNbDofsOnEnt();
373  for (int i = 0; i != nb_dofs_on_ent; ++i, ++dit) {
374  }
375  }
376 
378 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< hashed_unique< member< SideNumber, EntityHandle, &SideNumber::ent > >, ordered_non_unique< composite_key< SideNumber, const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType >, member< SideNumber, char, &SideNumber::side_number > > >, ordered_non_unique< const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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

◆ getEdgesColIndices()

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

get Edges col indices from FENumeredDofEntity_multiIndex

Definition at line 631 of file ForcesAndSourcesCore.cpp.

632  {
633 
635  ierr = getTypeIndices(field_name,
636  const_cast<FENumeredDofEntity_multiIndex &>(
637  numeredEntFiniteElementPtr->getColsDofs()),
638  MBEDGE, data.dataOnEntities[MBEDGE]);
639  CHKERRG(ierr);
641 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 251 of file ForcesAndSourcesCore.cpp.

252  {
253 
255  ierr = getDataOrder(MBEDGE, space, data.dataOnEntities[MBEDGE]);
256  CHKERRG(ierr);
258 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 380 of file ForcesAndSourcesCore.cpp.

381  {
382 
384  ierr =
385  getDataOrderSpaceAndBase(field_name, MBEDGE, data.dataOnEntities[MBEDGE]);
386  CHKERRG(ierr);
388 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 1167 of file ForcesAndSourcesCore.cpp.

1168  {
1169 
1171  ierr = getTypeFieldData(field_name,
1172  const_cast<FEDofEntity_multiIndex &>(
1173  numeredEntFiniteElementPtr->getDataDofs()),
1174  MBEDGE, data.dataOnEntities[MBEDGE]);
1175  CHKERRG(ierr);
1177 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
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:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 618 of file ForcesAndSourcesCore.cpp.

619  {
620 
622  ierr = getTypeIndices(field_name,
623  const_cast<FENumeredDofEntity_multiIndex &>(
624  numeredEntFiniteElementPtr->getRowsDofs()),
625  MBEDGE, data.dataOnEntities[MBEDGE]);
626  CHKERRG(ierr);
628 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 139 of file ForcesAndSourcesCore.cpp.

139  {
140 
142  ierr = getSense(MBEDGE, data.dataOnEntities[MBEDGE]);
143  CHKERRG(ierr);
145 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 1244 of file ForcesAndSourcesCore.cpp.

1244  {
1245  //
1247  // PetscAttachDebugger();
1248  data.facesNodes.resize(4, 3, false);
1249  SideNumber_multiIndex &side_table = const_cast<SideNumber_multiIndex &>(
1250  numeredEntFiniteElementPtr->getSideNumberTable());
1251  SideNumber_multiIndex::nth_index<1>::type::iterator siit =
1252  side_table.get<1>().lower_bound(boost::make_tuple(MBTRI, 0));
1253  SideNumber_multiIndex::nth_index<1>::type::iterator hi_siit =
1254  side_table.get<1>().upper_bound(boost::make_tuple(MBTRI, 4));
1255  if (distance(siit, hi_siit) != 4) {
1256  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1257  "Should be 4 triangles on tet, side_table not initialized");
1258  }
1259  const int cannonical_face_sense_p1[4][3] = {
1260  {0, 1, 3},
1261  {1, 2, 3},
1262  {0, 3, 2} /**/,
1263  {0, 2, 1} /**/}; //secon index is offset (positive sense)
1264  const int cannonical_face_sense_m1[4][3] = {
1265  {0, 3, 1},
1266  {1, 3, 2},
1267  {0, 2, 3},
1268  {0, 1, 2}}; //second index is offset (negative sense
1269  for (; siit != hi_siit; siit++) {
1270  const boost::shared_ptr<SideNumber> side = *siit;
1271  int face_conn[3] = {-1, -1, -1};
1272  if (side->offset == 0) {
1273  face_conn[0] = side->sense == 1
1274  ? cannonical_face_sense_p1[(int)side->side_number][0]
1275  : cannonical_face_sense_m1[(int)side->side_number][0];
1276  face_conn[1] = side->sense == 1
1277  ? cannonical_face_sense_p1[(int)side->side_number][1]
1278  : cannonical_face_sense_m1[(int)side->side_number][1];
1279  face_conn[2] = side->sense == 1
1280  ? cannonical_face_sense_p1[(int)side->side_number][2]
1281  : cannonical_face_sense_m1[(int)side->side_number][2];
1282  }
1283  if (side->offset == 1) {
1284  face_conn[0] =
1285  side->sense == 1
1286  ? cannonical_face_sense_p1[(int)side->side_number][1]
1287  : cannonical_face_sense_m1[(int)side->side_number][2] /**/;
1288  face_conn[1] = side->sense == 1
1289  ? cannonical_face_sense_p1[(int)side->side_number][2]
1290  : cannonical_face_sense_m1[(int)side->side_number][0];
1291  face_conn[2] = side->sense == 1
1292  ? cannonical_face_sense_p1[(int)side->side_number][0]
1293  : cannonical_face_sense_m1[(int)side->side_number][1];
1294  }
1295  if (side->offset == 2) {
1296  face_conn[0] =
1297  side->sense == 1
1298  ? cannonical_face_sense_p1[(int)side->side_number][2]
1299  : cannonical_face_sense_m1[(int)side->side_number][1] /**/;
1300  face_conn[1] = side->sense == 1
1301  ? cannonical_face_sense_p1[(int)side->side_number][0]
1302  : cannonical_face_sense_m1[(int)side->side_number][2];
1303  face_conn[2] = side->sense == 1
1304  ? cannonical_face_sense_p1[(int)side->side_number][1]
1305  : cannonical_face_sense_m1[(int)side->side_number][0];
1306  }
1307  for (int nn = 0; nn < 3; nn++)
1308  data.facesNodes(side->side_number, nn) = face_conn[nn];
1309  {
1310  const EntityHandle *conn_tet;
1311  int num_nodes_tet;
1312  EntityHandle ent = numeredEntFiniteElementPtr->getEnt();
1313  rval = mField.get_moab().get_connectivity(ent, conn_tet, num_nodes_tet,
1314  true);
1315  CHKERRQ_MOAB(rval);
1316  if (num_nodes_tet != 4)
1317  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1318  "data inconsistency");
1319  int num_nodes_face;
1320  const EntityHandle *conn_face;
1321  rval = mField.get_moab().get_connectivity(side->ent, conn_face,
1322  num_nodes_face, true);
1323  CHKERRQ_MOAB(rval);
1324  if (num_nodes_face != 3)
1325  SETERRQ(PETSC_COMM_SELF, 1, "data inconsistency");
1326  if (conn_face[0] != conn_tet[data.facesNodes(side->side_number, 0)])
1327  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1328  "data inconsistency");
1329  if (conn_face[1] != conn_tet[data.facesNodes(side->side_number, 1)])
1330  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1331  "data inconsistency");
1332  if (conn_face[2] != conn_tet[data.facesNodes(side->side_number, 2)])
1333  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1334  "data inconsistency");
1335  }
1336  }
1338 }
#define CHKERRQ_MOAB(a)
check error code of MoAB function
Definition: definitions.h:536
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:522
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< hashed_unique< member< SideNumber, EntityHandle, &SideNumber::ent > >, ordered_non_unique< composite_key< SideNumber, const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType >, member< SideNumber, char, &SideNumber::side_number > > >, ordered_non_unique< const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Common.hpp:78

◆ getMaxColOrder()

int MoFEM::ForcesAndSourcesCore::getMaxColOrder ( ) const

Get max order of approximation for field in columns.

Definition at line 190 of file ForcesAndSourcesCore.cpp.

190  {
191  return getMaxOrder(numeredEntFiniteElementPtr->getColsDofs());
192 }
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 182 of file ForcesAndSourcesCore.cpp.

182  {
183  return getMaxOrder(numeredEntFiniteElementPtr->getDataDofs());
184 }
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 186 of file ForcesAndSourcesCore.cpp.

186  {
187  return getMaxOrder(numeredEntFiniteElementPtr->getRowsDofs());
188 }
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 936 of file ForcesAndSourcesCore.cpp.

939  {
940 
942  try {
943  FEDofEntityByNameAndType::iterator dit, hi_dit, it;
944  dit = dofs.get<Composite_Name_And_Type_mi_tag>().lower_bound(
945  boost::make_tuple(field_name, MBVERTEX));
946  hi_dit = dofs.get<Composite_Name_And_Type_mi_tag>().upper_bound(
947  boost::make_tuple(field_name, MBVERTEX));
948 
949  int num_nodes;
950  ierr = getNumberOfNodes(num_nodes);
951  CHKERRG(ierr);
952  int max_nb_dofs = 0;
953  if (dit != hi_dit) {
954  max_nb_dofs = (*dit)->getNbOfCoeffs() * num_nodes;
955  }
956 
957  if (distance(dit, hi_dit) != max_nb_dofs) {
958  nodes_data.resize(max_nb_dofs, false);
959  nodes_data.clear();
960  nodes_dofs.resize(max_nb_dofs, false);
961  } else {
962  int size = distance(dit, hi_dit);
963  nodes_data.resize(size, false);
964  nodes_dofs.resize(size, false);
965  }
966 
967  if (dit != hi_dit) {
968  space = (*dit)->getSpace();
969  base = (*dit)->getApproxBase();
970  }
971 
972  for (; dit != hi_dit; dit++) {
973  FieldData val = (*dit)->getFieldData();
974  int side_number = (*dit)->sideNumberPtr->side_number;
975  if (side_number == -1) {
976  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
977  "data inconsistency");
978  }
979  int pos =
980  side_number * (*dit)->getNbOfCoeffs() + (*dit)->getDofCoeffIdx();
981  nodes_data[pos] = val;
982  nodes_dofs[pos] = *dit;
983  int brother_side_number = (*dit)->sideNumberPtr->brother_side_number;
984  if (brother_side_number != -1) {
985  if (nodes_data.size() <
986  (unsigned int)(brother_side_number * (*dit)->getNbOfCoeffs() +
987  (*dit)->getNbOfCoeffs())) {
988  nodes_data.resize(brother_side_number * (*dit)->getNbOfCoeffs() +
989  (*dit)->getNbOfCoeffs());
990  nodes_dofs.resize(brother_side_number * (*dit)->getNbOfCoeffs() +
991  (*dit)->getNbOfCoeffs());
992  }
993  int brother_pos = brother_side_number * (*dit)->getNbOfCoeffs() +
994  (*dit)->getDofCoeffIdx();
995  nodes_data[brother_pos] = val;
996  nodes_dofs[brother_pos] = *dit;
997  }
998  }
999 
1000  } catch (std::exception &ex) {
1001  std::ostringstream ss;
1002  ss << "thorw in method: " << ex.what() << " at line " << __LINE__
1003  << " in file " << __FILE__;
1004  SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, ss.str().c_str());
1005  }
1007 }
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:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 1010 of file ForcesAndSourcesCore.cpp.

1011  {
1013 
1014  ierr = getNodesFieldData(field_name,
1015  const_cast<FEDofEntity_multiIndex &>(
1016  numeredEntFiniteElementPtr->getDataDofs()),
1017  data.dataOnEntities[MBVERTEX][0].getFieldData(),
1018  data.dataOnEntities[MBVERTEX][0].getFieldDofs(),
1019  data.dataOnEntities[MBVERTEX][0].getSpace(),
1020  data.dataOnEntities[MBVERTEX][0].getBase());
1021  CHKERRG(ierr);
1023 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
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:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 432 of file ForcesAndSourcesCore.cpp.

434  {
435 
437 
438  FENumeredDofEntityByNameAndType::iterator dit, hi_dit, it;
439  dit = dofs.get<Composite_Name_And_Type_mi_tag>().lower_bound(
440  boost::make_tuple(field_name, MBVERTEX));
441  hi_dit = dofs.get<Composite_Name_And_Type_mi_tag>().upper_bound(
442  boost::make_tuple(field_name, MBVERTEX));
443 
444  int num_nodes;
445  ierr = getNumberOfNodes(num_nodes);
446  CHKERRG(ierr);
447  int max_nb_dofs = 0;
448  if (dit != hi_dit) {
449  max_nb_dofs = (*dit)->getNbOfCoeffs() * num_nodes;
450  }
451 
452  if (distance(dit, hi_dit) != max_nb_dofs) {
453  nodes_indices.resize(max_nb_dofs, false);
454  local_nodes_indices.resize(max_nb_dofs, false);
455  for (int dd = 0; dd < max_nb_dofs; dd++) {
456  nodes_indices[dd] = -1;
457  local_nodes_indices[dd] = -1;
458  }
459  } else {
460  nodes_indices.resize(distance(dit, hi_dit), false);
461  local_nodes_indices.resize(distance(dit, hi_dit), false);
462  }
463 
464  for (; dit != hi_dit; dit++) {
465  const int idx = (*dit)->getPetscGlobalDofIdx();
466  const int local_idx = (*dit)->getPetscLocalDofIdx();
467  const int side_number = (*dit)->sideNumberPtr->side_number;
468  const int pos =
469  side_number * (*dit)->getNbOfCoeffs() + (*dit)->getDofCoeffIdx();
470  nodes_indices[pos] = idx;
471  local_nodes_indices[pos] = local_idx;
472  const int brother_side_number = (*dit)->sideNumberPtr->brother_side_number;
473  if (brother_side_number != -1) {
474  if (nodes_indices.size() <
475  (unsigned int)(brother_side_number * (*dit)->getNbOfCoeffs() +
476  (*dit)->getNbOfCoeffs())) {
477  nodes_indices.resize(brother_side_number * (*dit)->getNbOfCoeffs() +
478  (*dit)->getNbOfCoeffs());
479  }
480  const int elem_idx = brother_side_number * (*dit)->getNbOfCoeffs() +
481  (*dit)->getDofCoeffIdx();
482  nodes_indices[elem_idx] = idx;
483  local_nodes_indices[elem_idx] = local_idx;
484  }
485  }
486 
488 }
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:33
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
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 788 of file ForcesAndSourcesCore.cpp.

789  {
790 
792  if (data.dataOnEntities[MBENTITYSET].size() == 0) {
793  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
794  }
795  ierr = getNoFieldIndices(field_name,
796  const_cast<FENumeredDofEntity_multiIndex &>(
797  numeredEntFiniteElementPtr->getColsDofs()),
798  data.dataOnEntities[MBENTITYSET][0].getIndices());
799  CHKERRG(ierr);
801 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 1130 of file ForcesAndSourcesCore.cpp.

1132  {
1133  //
1135  FEDofEntityByFieldName::iterator dit, hi_dit;
1136  dit = dofs.get<FieldName_mi_tag>().lower_bound(field_name);
1137  hi_dit = dofs.get<FieldName_mi_tag>().upper_bound(field_name);
1138  int size = distance(dit, hi_dit);
1139  ent_field_data.resize(size, false);
1140  ent_field_dofs.resize(size, false);
1141  for (; dit != hi_dit; dit++) {
1142  int idx = (*dit)->getDofCoeffIdx();
1143  ent_field_data[idx] = (*dit)->getFieldData();
1144  ent_field_dofs[idx] = *dit;
1145  }
1147 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528

◆ getNoFieldFieldData() [2/2]

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

Definition at line 1149 of file ForcesAndSourcesCore.cpp.

1150  {
1151 
1153  if (data.dataOnEntities[MBENTITYSET].size() == 0) {
1154  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
1155  }
1156  ierr =
1157  getNoFieldFieldData(field_name,
1158  const_cast<FEDofEntity_multiIndex &>(
1159  numeredEntFiniteElementPtr->getDataDofs()),
1160  data.dataOnEntities[MBENTITYSET][0].getFieldData(),
1161  data.dataOnEntities[MBENTITYSET][0].getFieldDofs());
1162  CHKERRG(ierr);
1164 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 756 of file ForcesAndSourcesCore.cpp.

758  {
759  //
761  FENumeredDofEntityByFieldName::iterator dit, hi_dit;
762  dit = dofs.get<FieldName_mi_tag>().lower_bound(field_name);
763  hi_dit = dofs.get<FieldName_mi_tag>().upper_bound(field_name);
764  indices.resize(distance(dit, hi_dit));
765  for (; dit != hi_dit; dit++) {
766  int idx = (*dit)->getPetscGlobalDofIdx();
767  indices[(*dit)->getDofCoeffIdx()] = idx;
768  }
770 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528

◆ getNoFieldRowIndices()

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

get col NoField indices

Definition at line 772 of file ForcesAndSourcesCore.cpp.

773  {
774 
776  // EntityType fe_type = numeredEntFiniteElementPtr->getEntType();
777  if (data.dataOnEntities[MBENTITYSET].size() == 0) {
778  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
779  }
780  ierr = getNoFieldIndices(field_name,
781  const_cast<FENumeredDofEntity_multiIndex &>(
782  numeredEntFiniteElementPtr->getRowsDofs()),
783  data.dataOnEntities[MBENTITYSET][0].getIndices());
784  CHKERRG(ierr);
786 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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:522
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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, forces_and_sources_testing_edge_element.cpp, and MagneticElement.hpp.

Definition at line 620 of file ForcesAndSourcesCore.hpp.

620 { 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 743 of file ForcesAndSourcesCore.cpp.

744  {
745 
747  ierr = getTypeIndices(field_name,
748  const_cast<FENumeredDofEntity_multiIndex &>(
749  numeredEntFiniteElementPtr->getColsDofs()),
750  MBPRISM, data.dataOnEntities[MBPRISM]);
751  CHKERRG(ierr);
753 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 291 of file ForcesAndSourcesCore.cpp.

292  {
293 
295  ierr = getDataOrder(MBPRISM, space, data.dataOnEntities[MBPRISM]);
296  CHKERRG(ierr);
298 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 420 of file ForcesAndSourcesCore.cpp.

421  {
422 
424  ierr = getDataOrderSpaceAndBase(field_name, MBPRISM,
425  data.dataOnEntities[MBPRISM]);
426  CHKERRG(ierr);
428 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 1224 of file ForcesAndSourcesCore.cpp.

1225  {
1226 
1228  if (data.dataOnEntities[MBPRISM].size() == 0) {
1229  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
1230  }
1231  ierr = getTypeFieldData(field_name,
1232  const_cast<FEDofEntity_multiIndex &>(
1233  numeredEntFiniteElementPtr->getDataDofs()),
1234  MBPRISM, 0,
1235  data.dataOnEntities[MBPRISM][0].getFieldData(),
1236  data.dataOnEntities[MBPRISM][0].getFieldDofs());
1237  CHKERRG(ierr);
1239 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
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:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 730 of file ForcesAndSourcesCore.cpp.

731  {
732 
734  ierr = getTypeIndices(field_name,
735  const_cast<FENumeredDofEntity_multiIndex &>(
736  numeredEntFiniteElementPtr->getRowsDofs()),
737  MBPRISM, data.dataOnEntities[MBPRISM]);
738  CHKERRG(ierr);
740 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 912 of file ForcesAndSourcesCore.cpp.

913  {
915 
917  nodes_indices);
918  CHKERRG(ierr);
920 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 805 of file ForcesAndSourcesCore.cpp.

807  {
809 
810  nodes_indices.resize(0);
811 
812  SideNumber_multiIndex &side_table = const_cast<SideNumber_multiIndex &>(
813  numeredEntFiniteElementPtr->getSideNumberTable());
814  SideNumber_multiIndex::nth_index<1>::type::iterator siit =
815  side_table.get<1>().lower_bound(boost::make_tuple(MBVERTEX, 0));
816  SideNumber_multiIndex::nth_index<1>::type::iterator hi_siit =
817  side_table.get<1>().lower_bound(boost::make_tuple(MBVERTEX, 10000));
818 
819  int nn = 0;
820  for (; siit != hi_siit; siit++, nn++) {
821 
822  if (siit->get()->side_number == -1)
823  continue;
824 
825  const EntityHandle ent = siit->get()->ent;
826  NumeredDofEntity_multiIndex::index<
827  Composite_Name_And_Ent_And_EntDofIdx_mi_tag>::type::iterator dit,
828  hi_dit;
829  dit = dofs.get<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>().lower_bound(
830  boost::make_tuple(field_name, ent, 0));
831  hi_dit =
832  dofs.get<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>().upper_bound(
833  boost::make_tuple(field_name, ent, 10000)); /// very large number
834 
835  if (dit != hi_dit) {
836 
837  if (!nn) {
838  nodes_indices.resize((*dit)->getNbOfCoeffs() * distance(siit, hi_siit));
839  }
840  for (; dit != hi_dit; dit++) {
841  nodes_indices[siit->get()->side_number * (*dit)->getNbOfCoeffs() +
842  (*dit)->getDofCoeffIdx()] =
843  (*dit)->getPetscGlobalDofIdx();
844  }
845  }
846  }
847 
849 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< hashed_unique< member< SideNumber, EntityHandle, &SideNumber::ent > >, ordered_non_unique< composite_key< SideNumber, const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType >, member< SideNumber, char, &SideNumber::side_number > > >, ordered_non_unique< const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr

◆ getProblemNodesRowIndices()

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

Definition at line 890 of file ForcesAndSourcesCore.cpp.

891  {
893 
895  nodes_indices);
896  CHKERRG(ierr);
898 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 923 of file ForcesAndSourcesCore.cpp.

925  {
927 
928  ierr = getProblemTypeIndices(field_name, *(problemPtr->numeredDofsCols), type,
929  side_number, indices);
930  CHKERRG(ierr);
932 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 851 of file ForcesAndSourcesCore.cpp.

853  {
855 
856  indices.resize(0);
857 
858  SideNumber_multiIndex &side_table = const_cast<SideNumber_multiIndex &>(
859  numeredEntFiniteElementPtr->getSideNumberTable());
860  SideNumber_multiIndex::nth_index<1>::type::iterator siit =
861  side_table.get<1>().lower_bound(boost::make_tuple(type, side_number));
862  SideNumber_multiIndex::nth_index<1>::type::iterator hi_siit =
863  side_table.get<1>().upper_bound(boost::make_tuple(type, side_number));
864 
865  for (; siit != hi_siit; siit++) {
866 
867  if (siit->get()->side_number == -1)
868  continue;
869 
870  const EntityHandle ent = siit->get()->ent;
871  NumeredDofEntity_multiIndex::index<
872  Composite_Name_And_Ent_And_EntDofIdx_mi_tag>::type::iterator dit,
873  hi_dit;
874  dit = dofs.get<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>().lower_bound(
875  boost::make_tuple(field_name, ent, 0));
876  hi_dit =
877  dofs.get<Composite_Name_And_Ent_And_EntDofIdx_mi_tag>().upper_bound(
878  boost::make_tuple(field_name, ent, 10000)); /// very large number
879 
880  indices.resize(distance(dit, hi_dit));
881  for (; dit != hi_dit; dit++) {
882 
883  indices[(*dit)->getEntDofIdx()] = (*dit)->getPetscGlobalDofIdx();
884  }
885  }
886 
888 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< hashed_unique< member< SideNumber, EntityHandle, &SideNumber::ent > >, ordered_non_unique< composite_key< SideNumber, const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType >, member< SideNumber, char, &SideNumber::side_number > > >, ordered_non_unique< const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr

◆ getProblemTypeRowIndices()

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

Definition at line 901 of file ForcesAndSourcesCore.cpp.

903  {
905 
906  ierr = getProblemTypeIndices(field_name, *(problemPtr->numeredDofsRows), type,
907  side_number, indices);
908  CHKERRG(ierr);
910 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 717 of file ForcesAndSourcesCore.cpp.

718  {
719 
721  ierr = getTypeIndices(field_name,
722  const_cast<FENumeredDofEntity_multiIndex &>(
723  numeredEntFiniteElementPtr->getColsDofs()),
724  MBQUAD, data.dataOnEntities[MBQUAD]);
725  CHKERRG(ierr);
727 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 271 of file ForcesAndSourcesCore.cpp.

272  {
273 
275  ierr = getDataOrder(MBQUAD, space, data.dataOnEntities[MBQUAD]);
276  CHKERRG(ierr);
278 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 400 of file ForcesAndSourcesCore.cpp.

401  {
402 
404  ierr =
405  getDataOrderSpaceAndBase(field_name, MBQUAD, data.dataOnEntities[MBQUAD]);
406  CHKERRG(ierr);
408 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 1193 of file ForcesAndSourcesCore.cpp.

1194  {
1195 
1197  ierr = getTypeFieldData(field_name,
1198  const_cast<FEDofEntity_multiIndex &>(
1199  numeredEntFiniteElementPtr->getDataDofs()),
1200  MBQUAD, data.dataOnEntities[MBQUAD]);
1201  CHKERRG(ierr);
1203 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
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:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 704 of file ForcesAndSourcesCore.cpp.

705  {
706 
708  ierr = getTypeIndices(field_name,
709  const_cast<FENumeredDofEntity_multiIndex &>(
710  numeredEntFiniteElementPtr->getRowsDofs()),
711  MBQUAD, data.dataOnEntities[MBQUAD]);
712  CHKERRG(ierr);
714 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 157 of file ForcesAndSourcesCore.cpp.

157  {
158 
160  ierr = getSense(MBQUAD, data.dataOnEntities[MBQUAD]);
161  CHKERRG(ierr);
163 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 491 of file ForcesAndSourcesCore.cpp.

492  {
493 
495  ierr = getNodesIndices(field_name,
496  const_cast<FENumeredDofEntity_multiIndex &>(
497  numeredEntFiniteElementPtr->getRowsDofs()),
498  data.dataOnEntities[MBVERTEX][0].getIndices(),
499  data.dataOnEntities[MBVERTEX][0].getLocalIndices());
500  CHKERRG(ierr);
502 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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, ThermalElement::MyTriFE, MixTransport::MixTransportElement::MyTriFE, MagneticElement::TriFE, NonlinearElasticElement::MyVolumeFE, NeummanForcesSurface::MyTriangleFE, 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.

103  {
105  try {
106  SideNumber_multiIndex &side_table = const_cast<SideNumber_multiIndex &>(
107  numeredEntFiniteElementPtr->getSideNumberTable());
108  if (data.size() < side_table.get<2>().count(type)) {
109  // prims has 9 edges, some of edges for "flat" prism are not active
110  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
111  "data inconsistency %u < %u", data.size(),
112  side_table.get<2>().count(type));
113  }
114  SideNumber_multiIndex::nth_index<2>::type::iterator siit =
115  side_table.get<2>().lower_bound(type);
116  SideNumber_multiIndex::nth_index<2>::type::iterator hi_siit =
117  side_table.get<2>().upper_bound(type);
118  for (; siit != hi_siit; siit++) {
119  data[siit->get()->side_number].getSense() = siit->get()->sense;
120  if (siit->get()->brother_side_number != -1) {
121  if (data.size() < (unsigned)siit->get()->brother_side_number) {
122  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
123  "data inconsistency");
124  }
125  data[siit->get()->brother_side_number].getSense() = siit->get()->sense;
126  }
127  }
128  } catch (std::exception &ex) {
129  std::ostringstream ss;
130  ss << "thorw in method: " << ex.what() << " at line " << __LINE__
131  << " in file " << __FILE__;
132  SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, ss.str().c_str());
133  }
134 
136 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< hashed_unique< member< SideNumber, EntityHandle, &SideNumber::ent > >, ordered_non_unique< composite_key< SideNumber, const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType >, member< SideNumber, char, &SideNumber::side_number > > >, ordered_non_unique< const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr

◆ getSpacesAndBaseOnEntities()

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

Get field approximation space and base on entities.

Definition at line 1342 of file ForcesAndSourcesCore.cpp.

1343  {
1344  //
1346  try {
1347  if (nInTheLoop == 0) {
1348  data.sPace.reset();
1349  data.bAse.reset();
1350  for (EntityType t = MBVERTEX; t != MBMAXTYPE; t++) {
1351  data.spacesOnEntities[t].reset();
1352  data.basesOnEntities[t].reset();
1353  }
1354  }
1355  for (_IT_GET_FEDATA_DOFS_FOR_LOOP_(this, dof)) {
1356  if (dof->get()->getEntDofIdx() != 0)
1357  continue;
1358  // std::cerr << *dof << std::endl;
1359  // std::cerr << dof->getSpace() << " " << data.sPace.size() << std::endl;
1360  // std::cerr << dof->getApproxBase() << " " << data.bAse.size() <<
1361  // std::endl;
1362  const FieldSpace space = dof->get()->getSpace();
1363  const FieldApproximationBase approx = dof->get()->getApproxBase();
1364  data.sPace.set(space);
1365  data.bAse.set(approx);
1366  const EntityType type = dof->get()->getEntType();
1367  data.spacesOnEntities[type].set(space);
1368  data.basesOnEntities[type].set(approx);
1369  // std::cerr << "approx base " <<
1370  // ApproximationBaseNames[dof->getApproxBase()] << " " <<
1371  // data.basesOnEntities[dof->getEntType()] << std::endl;
1372  }
1373  } catch (std::exception &ex) {
1374  std::ostringstream ss;
1375  ss << "thorw in method: " << ex.what() << " at line " << __LINE__
1376  << " in file " << __FILE__;
1377  SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, ss.str().c_str());
1378  }
1380 }
#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:522
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
FieldApproximationBase
approximation base
Definition: definitions.h:140
FieldSpace
approximation spaces
Definition: definitions.h:174

◆ getTetDataOrder()

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

Definition at line 281 of file ForcesAndSourcesCore.cpp.

282  {
283 
285  ierr = getDataOrder(MBTET, space, data.dataOnEntities[MBTET]);
286  CHKERRG(ierr);
288 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 410 of file ForcesAndSourcesCore.cpp.

411  {
412 
414  ierr =
415  getDataOrderSpaceAndBase(field_name, MBTET, data.dataOnEntities[MBTET]);
416  CHKERRG(ierr);
418 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 687 of file ForcesAndSourcesCore.cpp.

688  {
689 
691  if (data.dataOnEntities[MBTET].size() == 0) {
692  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
693  }
694  ierr = getTypeIndices(field_name,
695  const_cast<FENumeredDofEntity_multiIndex &>(
696  numeredEntFiniteElementPtr->getColsDofs()),
697  MBTET, 0, data.dataOnEntities[MBTET][0].getIndices(),
698  data.dataOnEntities[MBTET][0].getLocalIndices());
699  CHKERRG(ierr);
701 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 1206 of file ForcesAndSourcesCore.cpp.

1207  {
1208 
1210  if (data.dataOnEntities[MBTET].size() == 0) {
1211  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
1212  }
1213  ierr =
1214  getTypeFieldData(field_name,
1215  const_cast<FEDofEntity_multiIndex &>(
1216  numeredEntFiniteElementPtr->getDataDofs()),
1217  MBTET, 0, data.dataOnEntities[MBTET][0].getFieldData(),
1218  data.dataOnEntities[MBTET][0].getFieldDofs());
1219  CHKERRG(ierr);
1221 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
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:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 670 of file ForcesAndSourcesCore.cpp.

671  {
672 
674  if (data.dataOnEntities[MBTET].size() == 0) {
675  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "data inconsistency");
676  }
677  ierr = getTypeIndices(field_name,
678  const_cast<FENumeredDofEntity_multiIndex &>(
679  numeredEntFiniteElementPtr->getRowsDofs()),
680  MBTET, 0, data.dataOnEntities[MBTET][0].getIndices(),
681  data.dataOnEntities[MBTET][0].getLocalIndices());
682  CHKERRG(ierr);
684 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 657 of file ForcesAndSourcesCore.cpp.

658  {
659 
661  ierr = getTypeIndices(field_name,
662  const_cast<FENumeredDofEntity_multiIndex &>(
663  numeredEntFiniteElementPtr->getColsDofs()),
664  MBTRI, data.dataOnEntities[MBTRI]);
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:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 261 of file ForcesAndSourcesCore.cpp.

262  {
263 
265  ierr = getDataOrder(MBTRI, space, data.dataOnEntities[MBTRI]);
266  CHKERRG(ierr);
268 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 390 of file ForcesAndSourcesCore.cpp.

391  {
392 
394  ierr =
395  getDataOrderSpaceAndBase(field_name, MBTRI, data.dataOnEntities[MBTRI]);
396  CHKERRG(ierr);
398 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 1180 of file ForcesAndSourcesCore.cpp.

1181  {
1182 
1184  ierr = getTypeFieldData(field_name,
1185  const_cast<FEDofEntity_multiIndex &>(
1186  numeredEntFiniteElementPtr->getDataDofs()),
1187  MBTRI, data.dataOnEntities[MBTRI]);
1188  CHKERRG(ierr);
1190 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
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:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 644 of file ForcesAndSourcesCore.cpp.

645  {
646 
648  ierr = getTypeIndices(field_name,
649  const_cast<FENumeredDofEntity_multiIndex &>(
650  numeredEntFiniteElementPtr->getRowsDofs()),
651  MBTRI, data.dataOnEntities[MBTRI]);
652  CHKERRG(ierr);
654 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 148 of file ForcesAndSourcesCore.cpp.

148  {
149 
151  ierr = getSense(MBTRI, data.dataOnEntities[MBTRI]);
152  CHKERRG(ierr);
154 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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 1025 of file ForcesAndSourcesCore.cpp.

1028  {
1029  //
1031  FEDofEntity_multiIndex::index<
1032  Composite_Name_Type_And_Side_Number_mi_tag>::type::iterator dit,
1033  hi_dit;
1034  dit = dofs.get<Composite_Name_Type_And_Side_Number_mi_tag>().lower_bound(
1035  boost::make_tuple(field_name, type, side_number));
1036  if (dit == dofs.get<Composite_Name_Type_And_Side_Number_mi_tag>().end()) {
1037  ent_field_data.resize(0, false);
1038  ent_field_dofs.resize(0, false);
1040  }
1041  hi_dit = dofs.get<Composite_Name_Type_And_Side_Number_mi_tag>().upper_bound(
1042  boost::make_tuple(field_name, type, side_number));
1043  if (dit != hi_dit) {
1044  ent_field_data.resize((*dit)->getNbDofsOnEnt(), false);
1045  ent_field_dofs.resize((*dit)->getNbDofsOnEnt(), false);
1046  for (; dit != hi_dit; dit++) {
1047  const FieldData val = (*dit)->getFieldData();
1048  const int idx = (*dit)->getEntDofIdx();
1049  ent_field_data[idx] = val;
1050  ent_field_dofs[idx] = *dit;
1051  }
1052  } else {
1053  ent_field_data.resize(0, false);
1054  ent_field_dofs.resize(0, false);
1055  }
1057 }
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:522
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528

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

1062  {
1063 
1065  SideNumber_multiIndex &side_table = const_cast<SideNumber_multiIndex &>(
1066  numeredEntFiniteElementPtr->getSideNumberTable());
1067  // if(data.size() < side_table.get<2>().count(type)) {
1068  // SETERRQ(PETSC_COMM_SELF,MOFEM_DATA_INCONSISTENCY,"data inconsistency");
1069  // }
1070  SideNumber_multiIndex::nth_index<2>::type::iterator siit, hi_siit;
1071  siit = side_table.get<2>().lower_bound(type);
1072  hi_siit = side_table.get<2>().upper_bound(type);
1073  const boost::tuple<const boost::string_ref, EntityType> tuple =
1074  boost::make_tuple(field_name, type);
1075  FEDofEntityByNameAndType::iterator dit, hi_dit;
1076  dit = dofs.get<Composite_Name_And_Type_mi_tag>().lower_bound(tuple);
1077  if (dit == dofs.get<Composite_Name_And_Type_mi_tag>().end()) {
1078  for (SideNumber_multiIndex::nth_index<2>::type::iterator siiit = siit;
1079  siiit != hi_siit; siiit++) {
1080  const int side_number = siiit->get()->side_number;
1081  data[side_number].getFieldData().resize(0, false);
1082  data[side_number].getFieldDofs().resize(0, false);
1083  }
1085  }
1086  for (SideNumber_multiIndex::nth_index<2>::type::iterator siiit = siit;
1087  siiit != hi_siit; siiit++) {
1088  const int side_number = siiit->get()->side_number;
1089  data[side_number].semaphore = false;
1090  }
1091  hi_dit = dofs.get<Composite_Name_And_Type_mi_tag>().upper_bound(tuple);
1092  for (; dit != hi_dit; dit++) {
1093  const int side = dit->get()->sideNumberPtr->side_number;
1094  const int nb_dofs_on_ent = (*dit)->getNbDofsOnEnt();
1095  VectorDouble &ent_field_data = data[side].getFieldData();
1096  VectorDofs &ent_field_dofs = data[side].getFieldDofs();
1097  if (!data[side].semaphore) {
1098  data[side].semaphore = true;
1099  ent_field_data.resize(nb_dofs_on_ent, false);
1100  ent_field_dofs.resize(nb_dofs_on_ent, false);
1101  }
1102  if (!nb_dofs_on_ent) {
1103  continue;
1104  }
1105  const int idx = dit->get()->getEntDofIdx();
1106  ent_field_data[idx] = dit->get()->getFieldData();
1107  ent_field_dofs[idx] = *dit;
1108  }
1109  for (; siit != hi_siit; siit++) {
1110  const int side_number = siit->get()->side_number;
1111  if (!data[side_number].semaphore) {
1112  data[side_number].getFieldData().resize(0, false);
1113  data[side_number].getFieldDofs().resize(0, false);
1114  }
1115  if (siit->get()->brother_side_number != -1) {
1116  if (data.size() < (unsigned int)siit->get()->brother_side_number) {
1117  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1118  "data inconsistency");
1119  }
1121  field_name, dofs, type, side_number,
1122  data[siit->get()->brother_side_number].getFieldData(),
1123  data[siit->get()->brother_side_number].getFieldDofs());
1124  CHKERRG(ierr);
1125  }
1126  }
1128 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
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:565
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< hashed_unique< member< SideNumber, EntityHandle, &SideNumber::ent > >, ordered_non_unique< composite_key< SideNumber, const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType >, member< SideNumber, char, &SideNumber::side_number > > >, ordered_non_unique< const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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

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

521  {
522  //
524  FENumeredDofEntity_multiIndex::index<
525  Composite_Name_Type_And_Side_Number_mi_tag>::type::iterator dit,
526  hi_dit;
527  dit = dofs.get<Composite_Name_Type_And_Side_Number_mi_tag>().lower_bound(
528  boost::make_tuple(field_name, type, side_number));
529  if (dit == dofs.get<Composite_Name_Type_And_Side_Number_mi_tag>().end()) {
530  indices.resize(0);
531  local_indices.resize(0);
533  }
534  hi_dit = dofs.get<Composite_Name_Type_And_Side_Number_mi_tag>().upper_bound(
535  boost::make_tuple(field_name, type, side_number));
536  if (dit != hi_dit) {
537  indices.resize((*dit)->getNbDofsOnEnt(), false);
538  local_indices.resize((*dit)->getNbDofsOnEnt(), false);
539  for (; dit != hi_dit; dit++) {
540  int idx = (*dit)->getPetscGlobalDofIdx();
541  int elem_idx = (*dit)->getEntDofIdx();
542  indices[elem_idx] = idx;
543  int local_idx = (*dit)->getPetscLocalDofIdx();
544  local_indices[elem_idx] = local_idx;
545  }
546  } else {
547  indices.resize(0);
548  local_indices.resize(0);
549  }
551 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528

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

556  {
557 
559  SideNumber_multiIndex &side_table = const_cast<SideNumber_multiIndex &>(
560  numeredEntFiniteElementPtr->getSideNumberTable());
561  SideNumber_multiIndex::nth_index<2>::type::iterator siit =
562  side_table.get<2>().lower_bound(type);
563  SideNumber_multiIndex::nth_index<2>::type::iterator hi_siit =
564  side_table.get<2>().upper_bound(type);
565  const boost::tuple<const boost::string_ref, EntityType> tuple =
566  boost::make_tuple(field_name, type);
567  FENumeredDofEntityByNameAndType::iterator dit, hi_dit;
568  dit = dofs.get<Composite_Name_And_Type_mi_tag>().lower_bound(tuple);
569  if (dit == dofs.get<Composite_Name_And_Type_mi_tag>().end()) {
570  for (SideNumber_multiIndex::nth_index<2>::type::iterator siiit = siit;
571  siiit != hi_siit; siiit++) {
572  data[siiit->get()->side_number].getIndices().resize(0, false);
573  data[siiit->get()->side_number].getLocalIndices().resize(0, false);
574  }
576  }
577  for (SideNumber_multiIndex::nth_index<2>::type::iterator siiit = siit;
578  siiit != hi_siit; siiit++) {
579  const int side_number = siiit->get()->side_number;
580  data[side_number].semaphore = false;
581  }
582  hi_dit = dofs.get<Composite_Name_And_Type_mi_tag>().upper_bound(tuple);
583  for (; dit != hi_dit; dit++) {
584  const int side = dit->get()->sideNumberPtr->side_number;
585  const int nb_dofs_on_ent = dit->get()->getNbDofsOnEnt();
586  VectorInt &indices = data[side].getIndices();
587  VectorInt &local_indices = data[side].getLocalIndices();
588  if (!data[side].semaphore) {
589  data[side].semaphore = true;
590  indices.resize(nb_dofs_on_ent, false);
591  local_indices.resize(nb_dofs_on_ent, false);
592  }
593  if (!nb_dofs_on_ent) {
594  continue;
595  }
596  const int idx = dit->get()->getEntDofIdx();
597  indices[idx] = dit->get()->getPetscGlobalDofIdx();
598  local_indices[idx] = dit->get()->getPetscLocalDofIdx();
599  }
600  for (; siit != hi_siit; siit++) {
601  const int side_number = siit->get()->side_number;
602  if (!data[side_number].semaphore) {
603  data[side_number].getIndices().resize(0, false);
604  data[side_number].getLocalIndices().resize(0, false);
605  }
606  if (siit->get()->brother_side_number != -1) {
608  field_name, dofs, type, side_number,
609  data[siit->get()->brother_side_number].getIndices(),
610  data[siit->get()->brother_side_number].getLocalIndices());
611  CHKERRG(ierr);
612  }
613  }
615 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< hashed_unique< member< SideNumber, EntityHandle, &SideNumber::ent > >, ordered_non_unique< composite_key< SideNumber, const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType >, member< SideNumber, char, &SideNumber::side_number > > >, ordered_non_unique< const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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)

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

629  {
631  if(operatorHook) {
633  }
635  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
boost::function< MoFEMErrorCode()> operatorHook

◆ postProcess()

virtual MoFEMErrorCode MoFEM::ForcesAndSourcesCore::postProcess ( )
virtual

function is run at the end of loop

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

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

Reimplemented from MoFEM::BasicMethod.

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

Examples:
Remodeling.hpp.

Definition at line 636 of file ForcesAndSourcesCore.hpp.

636  {
638  if(postProcessHook) {
640  }
642  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
boost::function< MoFEMErrorCode()> postProcessHook
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80

◆ preProcess()

virtual MoFEMErrorCode MoFEM::ForcesAndSourcesCore::preProcess ( )
virtual

function is run at the beginning of loop

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

Reimplemented from MoFEM::BasicMethod.

Reimplemented in PostProcFaceOnRefinedMesh, PostProcFatPrismOnRefinedMesh, PostProcTemplateVolumeOnRefinedMesh< MoFEM::VolumeElementForcesAndSourcesCore >, GelModule::Gel::GelFE, MoFEM::FatPrismElementForcesAndSourcesCore, KelvinVoigtDamper::DamperFE, SolidShellModule::SolidShellPrismElement::SolidShellError, SolidShellModule::SolidShellPrismElement::SolidShell, NeummanForcesSurfaceComplexForLazy::MyTriangleSpatialFE, Smoother::MyVolumeFE, NonlinearElasticElement::MyVolumeFE, and FluidPressure::MyTriangleFE.

Examples:
Remodeling.hpp.

Definition at line 622 of file ForcesAndSourcesCore.hpp.

622  {
624  if(preProcessHook) {
626  }
628  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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:522
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528

◆ 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:522
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:565
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
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
Examples:
MagneticElement.hpp, and Remodeling.hpp.

Definition at line 38 of file ForcesAndSourcesCore.hpp.

◆ opPtrVector

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

Definition at line 613 of file ForcesAndSourcesCore.hpp.


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