v0.8.13
Classes | Public Member Functions | Public Attributes | List of all members
MoFEM::FaceElementForcesAndSourcesCore Struct Reference

Face finite elementUser is implementing own operator at Gauss point level, by own object derived from FaceElementForcesAndSourcesCoreL::UserDataOperator. Arbitrary number of operator added pushing objects to OpPtrVector. More...

#include <src/finite_elements/FaceElementForcesAndSourcesCore.hpp>

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

Classes

struct  UserDataOperator
 default operator for TRI element More...
 

Public Member Functions

 FaceElementForcesAndSourcesCore (Interface &m_field)
 
virtual MoFEMErrorCode calculateAreaAndNormal ()
 Calculate element area and normal of the face. More...
 
virtual MoFEMErrorCode setIntegrationPts ()
 Set integration points. More...
 
DEPRECATED MoFEMErrorCode setIntegartionPts ()
 
virtual MoFEMErrorCode getSpaceBaseAndOrderOnElement ()
 Determine approximation space and order of base functions. More...
 
virtual MoFEMErrorCode calculateCoordinatesAtGaussPts ()
 Calculate coordinate at integration points. More...
 
virtual MoFEMErrorCode calculateBaseFunctionsOnElement ()
 Calculate base functions. More...
 
virtual MoFEMErrorCode calculateHoNormal ()
 Calculate normal on curved elements. More...
 
MoFEMErrorCode operator() ()
 function is run for every finite element More...
 
- Public Member Functions inherited from MoFEM::ForcesAndSourcesCore
 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 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

double aRea
 
int num_nodes
 
const EntityHandleconn
 
VectorDouble nOrmal
 
VectorDouble tangentOne
 
VectorDouble tangentTwo
 
VectorDouble coords
 
MatrixDouble gaussPts
 
MatrixDouble coordsAtGaussPts
 
DataForcesAndSourcesCore dataH1
 
DerivedDataForcesAndSourcesCore derivedDataH1
 
DataForcesAndSourcesCore dataHdiv
 
DerivedDataForcesAndSourcesCore derivedDataHdiv
 
DataForcesAndSourcesCore dataHcurl
 
DerivedDataForcesAndSourcesCore derivedDataHcurl
 
DataForcesAndSourcesCore dataL2
 
DerivedDataForcesAndSourcesCore derivedDataL2
 
DataForcesAndSourcesCore dataNoField
 
DataForcesAndSourcesCore dataNoFieldCol
 
std::string meshPositionsFieldName
 Name of the field with geometry. More...
 
MatrixDouble hoCoordsAtGaussPts
 
MatrixDouble normalsAtGaussPts
 
MatrixDouble tangentOneAtGaussPts
 
MatrixDouble tangentTwoAtGaussPts
 
OpGetCoordsAndNormalsOnFace opHOCoordsAndNormals
 
OpSetContravariantPiolaTransformOnTriangle opContravariantTransform
 
OpSetCovariantPiolaTransformOnTriangle opCovariantTransform
 
int nbGaussPts
 Number of integration points. More...
 
- Public Attributes inherited from MoFEM::ForcesAndSourcesCore
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

- Public Types inherited from MoFEM::ForcesAndSourcesCore
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
}
 
- 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

Face finite element

User is implementing own operator at Gauss point level, by own object derived from FaceElementForcesAndSourcesCoreL::UserDataOperator. Arbitrary number of operator added pushing objects to OpPtrVector.

Examples:
hello_world.cpp, MagneticElement.hpp, simple_elasticity.cpp, and simple_interface.cpp.

Definition at line 38 of file FaceElementForcesAndSourcesCore.hpp.

Constructor & Destructor Documentation

◆ FaceElementForcesAndSourcesCore()

MoFEM::FaceElementForcesAndSourcesCore::FaceElementForcesAndSourcesCore ( Interface m_field)

Definition at line 69 of file FaceElementForcesAndSourcesCore.hpp.

70  : ForcesAndSourcesCore(m_field), dataH1(MBTRI), derivedDataH1(dataH1),
71  dataHdiv(MBTRI), derivedDataHdiv(dataHdiv), dataHcurl(MBTRI),
73  dataNoField(MBTRI), dataNoFieldCol(MBTRI),
74  meshPositionsFieldName("MESH_NODE_POSITIONS"),
ForcesAndSourcesCore(Interface &m_field)
OpSetCovariantPiolaTransformOnTriangle opCovariantTransform
std::string meshPositionsFieldName
Name of the field with geometry.
OpSetContravariantPiolaTransformOnTriangle opContravariantTransform

Member Function Documentation

◆ calculateAreaAndNormal()

MoFEMErrorCode FaceElementForcesAndSourcesCore::calculateAreaAndNormal ( )
virtual

Calculate element area and normal of the face.

Note that at that point is assumed that geometry is exclusively defined by corner nodes.

Returns
Error code

Definition at line 129 of file FaceElementForcesAndSourcesCore.cpp.

129  {
132  CHKERR mField.get_moab().get_connectivity(ent, conn, num_nodes, true);
133  coords.resize(num_nodes * 3, false);
134  CHKERR mField.get_moab().get_coords(conn, num_nodes, &*coords.data().begin());
135  double diff_n[6];
136  CHKERR ShapeDiffMBTRI(diff_n);
137  nOrmal.resize(3, false);
138  CHKERR ShapeFaceNormalMBTRI(diff_n, &*coords.data().begin(),
139  &*nOrmal.data().begin());
140  aRea = cblas_dnrm2(3, &*nOrmal.data().begin(), 1) * 0.5;
141  tangentOne.resize(3, false);
142  tangentTwo.resize(3, false);
143  for (int dd = 0; dd != 3; dd++) {
144  tangentOne[dd] = cblas_ddot(3, &diff_n[0], 2, &coords[dd], 3);
145  tangentTwo[dd] = cblas_ddot(3, &diff_n[1], 2, &coords[dd], 3);
146  }
148 }
virtual moab::Interface & get_moab()=0
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
PetscErrorCode ShapeFaceNormalMBTRI(double *diffN, const double *coords, double *normal)
Definition: fem_tools.c:219
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:495
double cblas_dnrm2(const int N, const double *X, const int incX)
Definition: cblas_dnrm2.c:12
double cblas_ddot(const int N, const double *X, const int incX, const double *Y, const int incY)
Definition: cblas_ddot.c:12
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
PetscErrorCode ShapeDiffMBTRI(double *diffN)
calculate derivatives of shape functions
Definition: fem_tools.c:186
#define CHKERR
Inline error check.
Definition: definitions.h:614
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:439

◆ calculateBaseFunctionsOnElement()

MoFEMErrorCode FaceElementForcesAndSourcesCore::calculateBaseFunctionsOnElement ( )
virtual

Calculate base functions.

Returns
Error code

Definition at line 261 of file FaceElementForcesAndSourcesCore.cpp.

261  {
263  // Calculate base base functions for faces.
264 
265  for (int b = AINSWORTH_LEGENDRE_BASE; b != LASTBASE; b++) {
266  if (dataH1.bAse.test(b)) {
267  switch (ApproximationBaseArray[b]) {
268  case NOBASE:
269  break;
272  if (dataH1.spacesOnEntities[MBVERTEX].test(H1) &&
273  dataH1.basesOnEntities[MBVERTEX].test(b) &&
274  dataH1.basesOnSpaces[H1].test(b)) {
275  CHKERR TriPolynomialBase().getValue(
276  gaussPts,
277  boost::shared_ptr<BaseFunctionCtx>(new EntPolynomialBaseCtx(
278  dataH1, H1, ApproximationBaseArray[b], NOBASE)));
279  }
280  if (dataH1.spacesOnEntities[MBTRI].test(L2) &&
281  dataH1.basesOnEntities[MBTRI].test(b) &&
282  dataH1.basesOnSpaces[L2].test(b)) {
283  CHKERR TriPolynomialBase().getValue(
284  gaussPts,
285  boost::shared_ptr<BaseFunctionCtx>(new EntPolynomialBaseCtx(
286  dataL2, L2, ApproximationBaseArray[b], NOBASE)));
287  }
289  if (dataH1.spacesOnEntities[MBEDGE].test(HCURL) &&
290  dataH1.basesOnEntities[MBEDGE].test(b) &&
291  dataH1.basesOnSpaces[HCURL].test(b)) {
292  CHKERR TriPolynomialBase().getValue(
293  gaussPts,
294  boost::shared_ptr<BaseFunctionCtx>(new EntPolynomialBaseCtx(
295  dataHcurl, HCURL, ApproximationBaseArray[b], NOBASE)));
296  }
297  if (dataH1.spacesOnEntities[MBTRI].test(HDIV) &&
298  dataH1.basesOnEntities[MBTRI].test(b) &&
299  dataH1.basesOnSpaces[HDIV].test(b)) {
300  CHKERR TriPolynomialBase().getValue(
301  gaussPts,
302  boost::shared_ptr<BaseFunctionCtx>(new EntPolynomialBaseCtx(
303  dataHdiv, HDIV, ApproximationBaseArray[b], NOBASE)));
304  }
305  break;
306  default:
307  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
308  "Base <%s> not yet implemented",
309  ApproximationBaseNames[ApproximationBaseArray[b]]);
310  }
311  }
312  }
314 }
std::bitset< LASTSPACE > spacesOnEntities[MBMAXTYPE]
spaces on entity types
field with continuous normal traction
Definition: definitions.h:181
std::bitset< LASTBASE > basesOnEntities[MBMAXTYPE]
bases on entity types
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:495
static const char *const ApproximationBaseNames[]
Definition: definitions.h:155
std::bitset< LASTBASE > basesOnSpaces[LASTSPACE]
base on spaces
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:142
field with continuous tangents
Definition: definitions.h:180
#define CHKERR
Inline error check.
Definition: definitions.h:614
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:439
continuous field
Definition: definitions.h:179
std::bitset< LASTBASE > bAse
bases on element
field with C-1 continuity
Definition: definitions.h:182

◆ calculateCoordinatesAtGaussPts()

MoFEMErrorCode FaceElementForcesAndSourcesCore::calculateCoordinatesAtGaussPts ( )
virtual

Calculate coordinate at integration points.

Returns
Error code

Definition at line 246 of file FaceElementForcesAndSourcesCore.cpp.

246  {
248  double *shape_functions =
249  &*dataH1.dataOnEntities[MBVERTEX][0].getN(NOBASE).data().begin();
250  coordsAtGaussPts.resize(nbGaussPts, 3, false);
251  for (int gg = 0; gg < nbGaussPts; gg++) {
252  for (int dd = 0; dd < 3; dd++) {
253  coordsAtGaussPts(gg, dd) =
254  cblas_ddot(3, &shape_functions[3 * gg], 1, &coords[dd], 3);
255  }
256  }
258 }
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:519
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526
boost::ptr_vector< EntData > dataOnEntities[MBMAXTYPE]
double cblas_ddot(const int N, const double *X, const int incX, const double *Y, const int incY)
Definition: cblas_ddot.c:12

◆ calculateHoNormal()

MoFEMErrorCode FaceElementForcesAndSourcesCore::calculateHoNormal ( )
virtual

Calculate normal on curved elements.

Geometry is given by other field.

Returns
error code

Definition at line 316 of file FaceElementForcesAndSourcesCore.cpp.

316  {
318  // Check if field for high-order geometry is set and if it is set calculate
319  // higher-order normals and face tangent vectors.
320  if (dataPtr->get<FieldName_mi_tag>().find(meshPositionsFieldName) !=
321  dataPtr->get<FieldName_mi_tag>().end()) {
322 
323  const Field *field_struture =
325  BitFieldId id = field_struture->getId();
326 
327  if ((numeredEntFiniteElementPtr->getBitFieldIdData() & id).none()) {
328  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_FOUND,
329  "no MESH_NODE_POSITIONS in element data");
330  }
331 
332  // Calculate normal for high-order geometry
340 
341  } else {
342  hoCoordsAtGaussPts.resize(0, 0, false);
343  normalsAtGaussPts.resize(0, 0, false);
344  tangentOneAtGaussPts.resize(0, 0, false);
345  tangentTwoAtGaussPts.resize(0, 0, false);
346  }
348 }
MoFEMErrorCode getTrisDataOrderSpaceAndBase(DataForcesAndSourcesCore &data, const std::string &field_name) const
MoFEMErrorCode getEdgesFieldData(DataForcesAndSourcesCore &data, const std::string &field_name) const
MoFEMErrorCode getNodesFieldData(const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, VectorDouble &nodes_data, VectorDofs &nodes_dofs, FieldSpace &space, FieldApproximationBase &base) const
Get field data on nodes.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:495
std::bitset< BITFIELDID_SIZE > BitFieldId
Definition: Common.hpp:149
boost::shared_ptr< const FEDofEntity_multiIndex > dataPtr
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
std::string meshPositionsFieldName
Name of the field with geometry.
#define CHKERR
Inline error check.
Definition: definitions.h:614
virtual MoFEMErrorCode opRhs(DataForcesAndSourcesCore &data, const bool do_vertices, const bool do_edges, const bool do_quads, const bool do_tris, const bool do_tets, const bool do_prisms, const bool error_if_no_base=true)
MoFEMErrorCode getTrisFieldData(DataForcesAndSourcesCore &data, const std::string &field_name) const
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:439
virtual const Field * get_field_structure(const std::string &name)=0
get field structure
MoFEMErrorCode getEdgesDataOrderSpaceAndBase(DataForcesAndSourcesCore &data, const std::string &field_name) const

◆ getSpaceBaseAndOrderOnElement()

MoFEMErrorCode FaceElementForcesAndSourcesCore::getSpaceBaseAndOrderOnElement ( )
virtual

Determine approximation space and order of base functions.

Returns
Error code

Definition at line 200 of file FaceElementForcesAndSourcesCore.cpp.

200  {
202  // Get spaces order/base and sense of entities.
203 
205 
206  // H1
207  if (dataH1.spacesOnEntities[MBEDGE].test(H1)) {
210  }
211  if (dataH1.spacesOnEntities[MBTRI].test(H1)) {
214  }
215 
216  // Hcurl
217  if (dataH1.spacesOnEntities[MBEDGE].test(HCURL)) {
220  dataHcurl.spacesOnEntities[MBEDGE].set(HCURL);
221  }
222  if (dataH1.spacesOnEntities[MBTRI].test(HCURL)) {
225  dataHcurl.spacesOnEntities[MBTRI].set(HCURL);
226  }
227 
228  // Hdiv
229  if (dataH1.spacesOnEntities[MBTRI].test(HDIV)) {
232  dataHcurl.spacesOnEntities[MBTRI].set(HDIV);
233  }
234 
235  // L2
236  if (dataH1.spacesOnEntities[MBTRI].test(L2)) {
239  dataHcurl.spacesOnEntities[MBTRI].set(L2);
240  }
241 
243 }
std::bitset< LASTSPACE > spacesOnEntities[MBMAXTYPE]
spaces on entity types
MoFEMErrorCode getTrisSense(DataForcesAndSourcesCore &data) const
field with continuous normal traction
Definition: definitions.h:181
MoFEMErrorCode getEdgesDataOrder(DataForcesAndSourcesCore &data, const FieldSpace space) const
MoFEMErrorCode getTrisDataOrder(DataForcesAndSourcesCore &data, const FieldSpace space) const
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:495
MoFEMErrorCode getEdgesSense(DataForcesAndSourcesCore &data) const
field with continuous tangents
Definition: definitions.h:180
#define CHKERR
Inline error check.
Definition: definitions.h:614
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:439
continuous field
Definition: definitions.h:179
MoFEMErrorCode getSpacesAndBaseOnEntities(DataForcesAndSourcesCore &data) const
Get field approximation space and base on entities.
field with C-1 continuity
Definition: definitions.h:182

◆ operator()()

MoFEMErrorCode FaceElementForcesAndSourcesCore::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::ForcesAndSourcesCore.

Reimplemented in NeummanForcesSurfaceComplexForLazy::MyTriangleSpatialFE.

Definition at line 350 of file FaceElementForcesAndSourcesCore.cpp.

350  {
352 
353  if (numeredEntFiniteElementPtr->getEntType() != MBTRI)
355 
356  // Calculate normal and tangent vectors for face geometry given by 3 nodes.
359 
361  if (nbGaussPts == 0)
363 
364  dataH1.dataOnEntities[MBVERTEX][0].getDiffN(NOBASE).resize(3, 2, false);
366  &*dataH1.dataOnEntities[MBVERTEX][0].getDiffN(NOBASE).data().begin());
367 
368  /// Use the some node base
370 
371  // Share base shape functions between spaces
372  dataHdiv.dataOnEntities[MBVERTEX][0].getNSharedPtr(NOBASE) =
373  dataH1.dataOnEntities[MBVERTEX][0].getNSharedPtr(NOBASE);
374  dataHcurl.dataOnEntities[MBVERTEX][0].getNSharedPtr(NOBASE) =
375  dataH1.dataOnEntities[MBVERTEX][0].getNSharedPtr(NOBASE);
376  dataL2.dataOnEntities[MBVERTEX][0].getNSharedPtr(NOBASE) =
377  dataH1.dataOnEntities[MBVERTEX][0].getNSharedPtr(NOBASE);
378  dataHdiv.dataOnEntities[MBVERTEX][0].getDiffNSharedPtr(NOBASE) =
379  dataH1.dataOnEntities[MBVERTEX][0].getDiffNSharedPtr(NOBASE);
380  dataHcurl.dataOnEntities[MBVERTEX][0].getDiffNSharedPtr(NOBASE) =
381  dataH1.dataOnEntities[MBVERTEX][0].getDiffNSharedPtr(NOBASE);
382  dataL2.dataOnEntities[MBVERTEX][0].getDiffNSharedPtr(NOBASE) =
383  dataH1.dataOnEntities[MBVERTEX][0].getDiffNSharedPtr(NOBASE);
384 
387 
388  // Apply Piola transform to HDiv and HCurl spaces, uses previously calculated
389  // faces normal and tangent vectors.
390  if (dataH1.spacesOnEntities[MBTRI].test(HDIV)) {
392  }
393  if (dataH1.spacesOnEntities[MBEDGE].test(HCURL)) {
394  // cerr << dataHcurl.dataOnEntities[MBEDGE][0].getN(AINSWORTH_LEGENDRE_BASE)
395  // << endl;
397  }
398 
401  std::vector<std::string> last_eval_field_name(2);
402  DataForcesAndSourcesCore *op_data[2];
403  FieldSpace space[2];
404  FieldApproximationBase base[2];
405 
406  boost::ptr_vector<UserDataOperator>::iterator oit, hi_oit;
407 
408  oit = opPtrVector.begin();
409  hi_oit = opPtrVector.end();
410 
411  for (; oit != hi_oit; oit++) {
412 
413  oit->setPtrFE(this);
414 
415  if (oit->opType == UserDataOperator::OPLAST) {
416 
417  // Set field
418  switch (oit->sPace) {
419  case NOSPACE:
420  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown space");
421  case H1:
422  op_data[0] = &dataH1;
423  break;
424  case HCURL:
425  op_data[0] = &dataHcurl;
426  break;
427  case HDIV:
428  op_data[0] = &dataHdiv;
429  break;
430  case L2:
431  op_data[0] = &dataL2;
432  break;
433  case NOFIELD:
434  op_data[0] = &dataNoField;
435  break;
436  case LASTSPACE:
437  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown space");
438  }
439 
440  // Reseat all data which all field dependent
441  op_data[0]->resetFieldDependentData();
442  last_eval_field_name[0] = "";
443  last_eval_field_name[1] = "";
444 
445  // Run operator
446  CHKERR oit->opRhs(*op_data[0], oit->doVertices, oit->doEdges,
447  oit->doQuads, oit->doTris, false, false);
448 
449  } else {
450 
451  for (int ss = 0; ss != 2; ss++) {
452 
453  std::string field_name = !ss ? oit->rowFieldName : oit->colFieldName;
454  const Field *field_struture = mField.get_field_structure(field_name);
455  BitFieldId data_id = field_struture->getId();
456 
457  if ((oit->getNumeredEntFiniteElementPtr()->getBitFieldIdData() &
458  data_id)
459  .none()) {
460  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
461  "no data field < %s > on finite element < %s >",
462  field_name.c_str(), feName.c_str());
463  }
464 
465  if (oit->getOpType() & types[ss] ||
466  oit->getOpType() & UserDataOperator::OPROWCOL) {
467 
468  space[ss] = field_struture->getSpace();
469  switch (space[ss]) {
470  case NOSPACE:
471  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown space");
472  case H1:
473  op_data[ss] = !ss ? &dataH1 : &derivedDataH1;
474  break;
475  case HCURL:
476  op_data[ss] = !ss ? &dataHcurl : &derivedDataHcurl;
477  break;
478  case HDIV:
479  op_data[ss] = !ss ? &dataHdiv : &derivedDataHdiv;
480  break;
481  case L2:
482  op_data[ss] = !ss ? &dataL2 : &derivedDataL2;
483  break;
484  case NOFIELD:
485  op_data[ss] = !ss ? &dataNoField : &dataNoFieldCol;
486  break;
487  case LASTSPACE:
488  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown space");
489  }
490 
491  base[ss] = field_struture->getApproxBase();
492  switch (base[ss]) {
493  case NOBASE:
497  break;
498  default:
499  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
500  "unknown or not implemented base");
501  break;
502  }
503 
504  if (last_eval_field_name[ss] != field_name) {
505 
506  switch (space[ss]) {
507  case NOSPACE:
508  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
509  "unknown space");
510  case H1:
511  if (!ss) {
512  CHKERR getRowNodesIndices(*op_data[ss], field_name);
513  } else {
514  CHKERR getColNodesIndices(*op_data[ss], field_name);
515  }
516  CHKERR getNodesFieldData(*op_data[ss], field_name);
517  case HCURL:
518  if (!ss) {
519  CHKERR getEdgesRowIndices(*op_data[ss], field_name);
520  } else {
521  CHKERR getEdgesColIndices(*op_data[ss], field_name);
522  }
523  CHKERR getEdgesDataOrderSpaceAndBase(*op_data[ss], field_name);
524  CHKERR getEdgesFieldData(*op_data[ss], field_name);
525  case HDIV:
526  case L2:
527  if (!ss) {
528  CHKERR getTrisRowIndices(*op_data[ss], field_name);
529  } else {
530  CHKERR getTrisColIndices(*op_data[ss], field_name);
531  }
532  CHKERR getTrisDataOrderSpaceAndBase(*op_data[ss], field_name);
533  CHKERR getTrisFieldData(*op_data[ss], field_name);
534  break;
535  case NOFIELD:
536  if (!getNinTheLoop()) {
537  // NOFIELD data are the same for each element, can be retrieved
538  // only once
539  if (!ss) {
540  CHKERR getNoFieldRowIndices(*op_data[ss], field_name);
541  } else {
542  CHKERR getNoFieldColIndices(*op_data[ss], field_name);
543  }
544  CHKERR getNoFieldFieldData(*op_data[ss], field_name);
545  }
546  break;
547  case LASTSPACE:
548  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
549  "unknown space");
550  }
551  last_eval_field_name[ss] = field_name;
552  }
553  }
554  }
555 
556  if (oit->getOpType() & UserDataOperator::OPROW) {
557  try {
558  ierr = oit->opRhs(*op_data[0], oit->doVertices, oit->doEdges,
559  oit->doQuads, oit->doTris, false, false);
560  if (PetscUnlikely(ierr)) {
561  std::ostringstream ss;
562  ss << "(Calling user data operator "
563  << boost::typeindex::type_id_runtime(*oit).pretty_name() << ") "
564  << PETSC_FUNCTION_NAME;
565  return PetscError(PETSC_COMM_SELF, __LINE__, ss.str().c_str(),
566  __FILE__, ierr, PETSC_ERROR_REPEAT, " ");
567  }
568  } catch (std::exception &ex) {
569  std::ostringstream ss;
570  ss << "Operator "
571  << boost::typeindex::type_id_runtime(*oit).pretty_name()
572  << " operator number "
573  << std::distance<boost::ptr_vector<UserDataOperator>::iterator>(
574  opPtrVector.begin(), oit)
575  << " throw in method: " << ex.what() << " at line " << __LINE__
576  << " in file " << __FILE__;
577  SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, ss.str().c_str());
578  }
579  }
580 
581  if (oit->getOpType() & UserDataOperator::OPCOL) {
582  try {
583  ierr = oit->opRhs(*op_data[1], oit->doVertices, oit->doEdges,
584  oit->doQuads, oit->doTris, false, false);
585  if (PetscUnlikely(ierr)) {
586  std::ostringstream ss;
587  ss << "(Calling user data operator "
588  << boost::typeindex::type_id_runtime(*oit).pretty_name() << ") "
589  << PETSC_FUNCTION_NAME;
590  return PetscError(PETSC_COMM_SELF, __LINE__, ss.str().c_str(),
591  __FILE__, ierr, PETSC_ERROR_REPEAT, " ");
592  }
593  } catch (std::exception &ex) {
594  std::ostringstream ss;
595  ss << "Operator "
596  << boost::typeindex::type_id_runtime(*oit).pretty_name()
597  << " operator number "
598  << std::distance<boost::ptr_vector<UserDataOperator>::iterator>(
599  opPtrVector.begin(), oit)
600  << " throw in method: " << ex.what() << " at line " << __LINE__
601  << " in file " << __FILE__;
602  SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, ss.str().c_str());
603  }
604  }
605 
606  if (oit->getOpType() & UserDataOperator::OPROWCOL) {
607  try {
608  ierr = oit->opLhs(*op_data[0], *op_data[1], oit->sYmm);
609  if (PetscUnlikely(ierr)) {
610  std::ostringstream ss;
611  ss << "(Calling user data operator "
612  << boost::typeindex::type_id_runtime(*oit).pretty_name() << ") "
613  << PETSC_FUNCTION_NAME;
614  return PetscError(PETSC_COMM_SELF, __LINE__, ss.str().c_str(),
615  __FILE__, ierr, PETSC_ERROR_REPEAT, " ");
616  }
617  } catch (std::exception &ex) {
618  std::ostringstream ss;
619  ss << "Operator "
620  << boost::typeindex::type_id_runtime(*oit).pretty_name()
621  << " operator number "
622  << std::distance<boost::ptr_vector<UserDataOperator>::iterator>(
623  opPtrVector.begin(), oit)
624  << " throw in method: " << ex.what() << " at line " << __LINE__
625  << " in file " << __FILE__;
626  SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, ss.str().c_str());
627  }
628  }
629  }
630  }
631 
633 }
std::bitset< LASTSPACE > spacesOnEntities[MBMAXTYPE]
spaces on entity types
virtual MoFEMErrorCode getSpaceBaseAndOrderOnElement()
Determine approximation space and order of base functions.
boost::ptr_vector< UserDataOperator > opPtrVector
field with continuous normal traction
Definition: definitions.h:181
MoFEMErrorCode getNoFieldColIndices(DataForcesAndSourcesCore &data, const std::string &field_name) const
get col NoField indices
MoFEMErrorCode getTrisDataOrderSpaceAndBase(DataForcesAndSourcesCore &data, const std::string &field_name) const
MoFEMErrorCode getEdgesRowIndices(DataForcesAndSourcesCore &data, const std::string &field_name) const
get Edges row indices from FENumeredDofEntity_multiIndex
MoFEMErrorCode getEdgesFieldData(DataForcesAndSourcesCore &data, const std::string &field_name) const
MoFEMErrorCode getColNodesIndices(DataForcesAndSourcesCore &data, const std::string &field_name) const
get col node indices from FENumeredDofEntity_multiIndex
virtual MoFEMErrorCode setIntegrationPts()
Set integration points.
MoFEMErrorCode getTrisRowIndices(DataForcesAndSourcesCore &data, const std::string &field_name) const
get Tris row indices from FENumeredDofEntity_multiIndex
scalar or vector of scalars describe (no true field)
Definition: definitions.h:178
MoFEMErrorCode getNodesFieldData(const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, VectorDouble &nodes_data, VectorDofs &nodes_dofs, FieldSpace &space, FieldApproximationBase &base) const
Get field data on nodes.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:495
std::string feName
std::bitset< BITFIELDID_SIZE > BitFieldId
Definition: Common.hpp:149
int getNinTheLoop() const
get number of evaluated element in the loop
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526
MoFEMErrorCode getNoFieldRowIndices(DataForcesAndSourcesCore &data, const std::string &field_name) const
get col NoField indices
OpType
Controls loop over entities on element.
MoFEMErrorCode getNoFieldFieldData(const boost::string_ref field_name, FEDofEntity_multiIndex &dofs, VectorDouble &ent_field_data, VectorDofs &ent_field_dofs) const
boost::ptr_vector< EntData > dataOnEntities[MBMAXTYPE]
FieldSpace in [ 0, LASTSPACE )
Definition: definitions.h:183
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
virtual MoFEMErrorCode calculateBaseFunctionsOnElement()
Calculate base functions.
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Common.hpp:80
OpSetCovariantPiolaTransformOnTriangle opCovariantTransform
PetscErrorCode ShapeDiffMBTRI(double *diffN)
calculate derivatives of shape functions
Definition: fem_tools.c:186
FieldApproximationBase
approximation base
Definition: definitions.h:140
virtual MoFEMErrorCode calculateHoNormal()
Calculate normal on curved elements.
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:142
field with continuous tangents
Definition: definitions.h:180
FieldSpace
approximation spaces
Definition: definitions.h:176
#define CHKERR
Inline error check.
Definition: definitions.h:614
MoFEMErrorCode getTrisFieldData(DataForcesAndSourcesCore &data, const std::string &field_name) const
virtual MoFEMErrorCode opRhs(DataForcesAndSourcesCore &data, const bool do_vertices, const bool do_edges, const bool do_quads, const bool do_tris, const bool do_tets, const bool do_prisms, const bool error_if_no_base=true)
MoFEMErrorCode getEdgesColIndices(DataForcesAndSourcesCore &data, const std::string &field_name) const
get Edges col indices from FENumeredDofEntity_multiIndex
MoFEMErrorCode getTrisColIndices(DataForcesAndSourcesCore &data, const std::string &field_name) const
get Tris col indices from FENumeredDofEntity_multiIndex
OpSetContravariantPiolaTransformOnTriangle opContravariantTransform
virtual MoFEMErrorCode calculateCoordinatesAtGaussPts()
Calculate coordinate at integration points.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:439
virtual MoFEMErrorCode calculateAreaAndNormal()
Calculate element area and normal of the face.
continuous field
Definition: definitions.h:179
virtual const Field * get_field_structure(const std::string &name)=0
get field structure
MoFEMErrorCode getRowNodesIndices(DataForcesAndSourcesCore &data, const std::string &field_name) const
get row node indices from FENumeredDofEntity_multiIndex
MoFEMErrorCode getEdgesDataOrderSpaceAndBase(DataForcesAndSourcesCore &data, const std::string &field_name) const
field with C-1 continuity
Definition: definitions.h:182

◆ setIntegartionPts()

DEPRECATED MoFEMErrorCode MoFEM::FaceElementForcesAndSourcesCore::setIntegartionPts ( )
Deprecated:
method with spelling mistake, use setIntegrationPts

Definition at line 462 of file FaceElementForcesAndSourcesCore.hpp.

462 { return setIntegrationPts(); }
virtual MoFEMErrorCode setIntegrationPts()
Set integration points.

◆ setIntegrationPts()

MoFEMErrorCode FaceElementForcesAndSourcesCore::setIntegrationPts ( )
virtual

Set integration points.

Returns
Error code

Definition at line 150 of file FaceElementForcesAndSourcesCore.cpp.

150  {
152  // Set integration points
153  int order_data = getMaxDataOrder();
154  int order_row = getMaxRowOrder();
155  int order_col = getMaxColOrder();
156  int rule = getRule(order_row, order_col, order_data);
157  if (rule >= 0) {
158  if (rule < QUAD_2D_TABLE_SIZE) {
159  if (QUAD_2D_TABLE[rule]->dim != 2) {
160  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "wrong dimension");
161  }
162  if (QUAD_2D_TABLE[rule]->order < rule) {
163  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
164  "wrong order %d != %d", QUAD_2D_TABLE[rule]->order, rule);
165  }
167  gaussPts.resize(3, nbGaussPts, false);
168  cblas_dcopy(nbGaussPts, &QUAD_2D_TABLE[rule]->points[1], 3,
169  &gaussPts(0, 0), 1);
170  cblas_dcopy(nbGaussPts, &QUAD_2D_TABLE[rule]->points[2], 3,
171  &gaussPts(1, 0), 1);
172  cblas_dcopy(nbGaussPts, QUAD_2D_TABLE[rule]->weights, 1, &gaussPts(2, 0),
173  1);
174  dataH1.dataOnEntities[MBVERTEX][0].getN(NOBASE).resize(nbGaussPts, 3,
175  false);
176  double *shape_ptr =
177  &*dataH1.dataOnEntities[MBVERTEX][0].getN(NOBASE).data().begin();
178  cblas_dcopy(3 * nbGaussPts, QUAD_2D_TABLE[rule]->points, 1, shape_ptr, 1);
179  } else {
180  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
181  "rule > quadrature order %d < %d", rule, QUAD_2D_TABLE_SIZE);
182  nbGaussPts = 0;
183  }
184  } else {
185  // If rule is negative, set user defined integration points
186  CHKERR setGaussPts(order_row, order_col, order_data);
187  nbGaussPts = gaussPts.size2();
188  dataH1.dataOnEntities[MBVERTEX][0].getN(NOBASE).resize(nbGaussPts, 3,
189  false);
190  if (nbGaussPts) {
192  &*dataH1.dataOnEntities[MBVERTEX][0].getN(NOBASE).data().begin(),
193  &gaussPts(0, 0), &gaussPts(1, 0), nbGaussPts);
194  }
195  }
197 }
int getMaxRowOrder() const
Get max order of approximation for field in rows.
int npoints
Definition: quad.h:29
void cblas_dcopy(const int N, const double *X, const int incX, double *Y, const int incY)
Definition: cblas_dcopy.c:11
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:495
boost::ptr_vector< EntData > dataOnEntities[MBMAXTYPE]
#define QUAD_2D_TABLE_SIZE
Definition: quad.h:174
static QUAD *const QUAD_2D_TABLE[]
Definition: quad.h:175
virtual MoFEMErrorCode setGaussPts(int order)
It will be removed in the future use other variant.
#define CHKERR
Inline error check.
Definition: definitions.h:614
PetscErrorCode ShapeMBTRI(double *N, const double *X, const double *Y, const int G_DIM)
calculate shape functions on triangle
Definition: fem_tools.c:175
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:439
virtual int getRule(int order)
set integration rule for finite element
int getMaxColOrder() const
Get max order of approximation for field in columns.
int getMaxDataOrder() const
Get max order of approximation for data fields.

Member Data Documentation

◆ aRea

double MoFEM::FaceElementForcesAndSourcesCore::aRea

Definition at line 40 of file FaceElementForcesAndSourcesCore.hpp.

◆ conn

const EntityHandle* MoFEM::FaceElementForcesAndSourcesCore::conn

Definition at line 43 of file FaceElementForcesAndSourcesCore.hpp.

◆ coords

VectorDouble MoFEM::FaceElementForcesAndSourcesCore::coords

Definition at line 45 of file FaceElementForcesAndSourcesCore.hpp.

◆ coordsAtGaussPts

MatrixDouble MoFEM::FaceElementForcesAndSourcesCore::coordsAtGaussPts

Definition at line 47 of file FaceElementForcesAndSourcesCore.hpp.

◆ dataH1

DataForcesAndSourcesCore MoFEM::FaceElementForcesAndSourcesCore::dataH1

Definition at line 49 of file FaceElementForcesAndSourcesCore.hpp.

◆ dataHcurl

DataForcesAndSourcesCore MoFEM::FaceElementForcesAndSourcesCore::dataHcurl

Definition at line 53 of file FaceElementForcesAndSourcesCore.hpp.

◆ dataHdiv

DataForcesAndSourcesCore MoFEM::FaceElementForcesAndSourcesCore::dataHdiv

Definition at line 51 of file FaceElementForcesAndSourcesCore.hpp.

◆ dataL2

DataForcesAndSourcesCore MoFEM::FaceElementForcesAndSourcesCore::dataL2

Definition at line 55 of file FaceElementForcesAndSourcesCore.hpp.

◆ dataNoField

DataForcesAndSourcesCore MoFEM::FaceElementForcesAndSourcesCore::dataNoField

Definition at line 57 of file FaceElementForcesAndSourcesCore.hpp.

◆ dataNoFieldCol

DataForcesAndSourcesCore MoFEM::FaceElementForcesAndSourcesCore::dataNoFieldCol

Definition at line 57 of file FaceElementForcesAndSourcesCore.hpp.

◆ derivedDataH1

DerivedDataForcesAndSourcesCore MoFEM::FaceElementForcesAndSourcesCore::derivedDataH1

Definition at line 50 of file FaceElementForcesAndSourcesCore.hpp.

◆ derivedDataHcurl

DerivedDataForcesAndSourcesCore MoFEM::FaceElementForcesAndSourcesCore::derivedDataHcurl

Definition at line 54 of file FaceElementForcesAndSourcesCore.hpp.

◆ derivedDataHdiv

DerivedDataForcesAndSourcesCore MoFEM::FaceElementForcesAndSourcesCore::derivedDataHdiv

Definition at line 52 of file FaceElementForcesAndSourcesCore.hpp.

◆ derivedDataL2

DerivedDataForcesAndSourcesCore MoFEM::FaceElementForcesAndSourcesCore::derivedDataL2

Definition at line 56 of file FaceElementForcesAndSourcesCore.hpp.

◆ gaussPts

MatrixDouble MoFEM::FaceElementForcesAndSourcesCore::gaussPts

Definition at line 46 of file FaceElementForcesAndSourcesCore.hpp.

◆ hoCoordsAtGaussPts

MatrixDouble MoFEM::FaceElementForcesAndSourcesCore::hoCoordsAtGaussPts

Definition at line 61 of file FaceElementForcesAndSourcesCore.hpp.

◆ meshPositionsFieldName

std::string MoFEM::FaceElementForcesAndSourcesCore::meshPositionsFieldName

Name of the field with geometry.

Definition at line 59 of file FaceElementForcesAndSourcesCore.hpp.

◆ nbGaussPts

int MoFEM::FaceElementForcesAndSourcesCore::nbGaussPts

Number of integration points.

Definition at line 453 of file FaceElementForcesAndSourcesCore.hpp.

◆ nOrmal

VectorDouble MoFEM::FaceElementForcesAndSourcesCore::nOrmal

Definition at line 44 of file FaceElementForcesAndSourcesCore.hpp.

◆ normalsAtGaussPts

MatrixDouble MoFEM::FaceElementForcesAndSourcesCore::normalsAtGaussPts

Definition at line 62 of file FaceElementForcesAndSourcesCore.hpp.

◆ num_nodes

int MoFEM::FaceElementForcesAndSourcesCore::num_nodes

Definition at line 41 of file FaceElementForcesAndSourcesCore.hpp.

◆ opContravariantTransform

OpSetContravariantPiolaTransformOnTriangle MoFEM::FaceElementForcesAndSourcesCore::opContravariantTransform

Definition at line 66 of file FaceElementForcesAndSourcesCore.hpp.

◆ opCovariantTransform

OpSetCovariantPiolaTransformOnTriangle MoFEM::FaceElementForcesAndSourcesCore::opCovariantTransform

Definition at line 67 of file FaceElementForcesAndSourcesCore.hpp.

◆ opHOCoordsAndNormals

OpGetCoordsAndNormalsOnFace MoFEM::FaceElementForcesAndSourcesCore::opHOCoordsAndNormals

Definition at line 65 of file FaceElementForcesAndSourcesCore.hpp.

◆ tangentOne

VectorDouble MoFEM::FaceElementForcesAndSourcesCore::tangentOne

Definition at line 44 of file FaceElementForcesAndSourcesCore.hpp.

◆ tangentOneAtGaussPts

MatrixDouble MoFEM::FaceElementForcesAndSourcesCore::tangentOneAtGaussPts

Definition at line 63 of file FaceElementForcesAndSourcesCore.hpp.

◆ tangentTwo

VectorDouble MoFEM::FaceElementForcesAndSourcesCore::tangentTwo

Definition at line 44 of file FaceElementForcesAndSourcesCore.hpp.

◆ tangentTwoAtGaussPts

MatrixDouble MoFEM::FaceElementForcesAndSourcesCore::tangentTwoAtGaussPts

Definition at line 64 of file FaceElementForcesAndSourcesCore.hpp.


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