 |
| v0.10.0
|
structure to get information form mofem into DataForcesAndSourcesCore
More...
#include <src/finite_elements/ForcesAndSourcesCore.hpp>
|
typedef boost::function< int(int order_row, int order_col, int order_data)> | RuleHookFun |
|
enum | KSPContext { CTX_SETFUNCTION,
CTX_OPERATORS,
CTX_KSPNONE
} |
| pass information about context of KSP/DM for with finite element is computed More...
|
|
enum | DataContext {
CTX_SET_NONE = 0,
CTX_SET_F = 1 << 0,
CTX_SET_A = 1 << 1,
CTX_SET_B = 1 << 2,
CTX_SET_X = 1 << 3,
CTX_SET_X_T = 1 << 4,
CTX_SET_X_TT = 1 << 6,
CTX_SET_TIME = 1 << 7
} |
|
using | Switches = std::bitset< 8 > |
|
enum | SNESContext { CTX_SNESSETFUNCTION,
CTX_SNESSETJACOBIAN,
CTX_SNESNONE
} |
|
enum | TSContext {
CTX_TSSETRHSFUNCTION,
CTX_TSSETRHSJACOBIAN,
CTX_TSSETIFUNCTION,
CTX_TSSETIJACOBIAN,
CTX_TSTSMONITORSET,
CTX_TSNONE
} |
|
|
| ForcesAndSourcesCore (Interface &m_field) |
|
boost::ptr_vector< UserDataOperator > & | getOpPtrVector () |
| Use to push back operator for row operator. More...
|
|
auto & | getElementPolynomialBase () |
| Get the Entity Polynomial Base object. More...
|
|
auto & | getUserPolynomialBase () |
| Get the User Polynomial Base object. More...
|
|
virtual MoFEMErrorCode | preProcess () |
| function is run at the beginning of loop More...
|
|
virtual MoFEMErrorCode | operator() () |
| function is run for every finite element More...
|
|
virtual MoFEMErrorCode | postProcess () |
| function is run at the end of loop More...
|
|
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...
|
|
const DataForcesAndSourcesCore::EntData & | getEntData (const FieldSpace space, const EntityType type, const int side) const |
| Get the entity data. More...
|
|
DataForcesAndSourcesCore::EntData & | getEntData (const FieldSpace space, const EntityType type, const int side) |
| Get the entity data. More...
|
|
MoFEMErrorCode | query_interface (const MOFEMuuid &uuid, UnknownInterface **iface) const |
|
| FEMethod () |
|
auto | getDataDofsPtr () const |
|
auto | getDataVectorDofsPtr () const |
|
const FieldEntity_vector_view & | getDataFieldEnts () const |
|
boost::shared_ptr< FieldEntity_vector_view > & | getDataFieldEntsPtr () const |
|
auto & | getRowFieldEnts () const |
|
auto & | getRowFieldEntsPtr () const |
|
auto & | getColFieldEnts () const |
|
auto & | getColFieldEntsPtr () const |
|
auto | getRowDofsPtr () const |
|
auto | getColDofsPtr () const |
|
MoFEMErrorCode | getNumberOfNodes (int &num_nodes) const |
| Get number of DOFs on element. More...
|
|
EntityHandle | getFEEntityHandle () const |
|
MoFEMErrorCode | getNodeData (const std::string field_name, VectorDouble &data, const bool reset_dofs=true) |
|
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 |
|
| BasicMethod () |
|
virtual | ~BasicMethod ()=default |
|
int | getNinTheLoop () const |
| get number of evaluated element in the loop More...
|
|
int | getLoopSize () const |
| get loop size More...
|
|
unsigned int | getFieldBitNumber (std::string field_name) const |
|
MoFEMErrorCode | copyBasicMethod (const BasicMethod &basic) |
| Copy data from other base method to this base method. More...
|
|
| KspMethod () |
|
virtual | ~KspMethod ()=default |
|
MoFEMErrorCode | copyKsp (const KspMethod &ksp) |
| copy data form another method More...
|
|
| PetscData () |
|
virtual | ~PetscData ()=default |
|
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 ()=default |
|
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 |
|
| SnesMethod () |
|
virtual | ~SnesMethod ()=default |
|
MoFEMErrorCode | copySnes (const SnesMethod &snes) |
| Copy snes data. More...
|
|
DEPRECATED MoFEMErrorCode | setSnesCtx (SNESContext ctx) |
|
| TSMethod () |
|
virtual | ~TSMethod ()=default |
|
MoFEMErrorCode | copyTs (const TSMethod &ts) |
| Copy TS solver data. More...
|
|
DEPRECATED MoFEMErrorCode | setTsCtx (TSContext ctx) |
|
|
MoFEMErrorCode | getEntitySense (const EntityType type, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const |
| get sense (orientation) of entity More...
|
|
MoFEMErrorCode | getEntityDataOrder (const EntityType type, const FieldSpace space, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const |
| Get the entity data order. More...
|
|
template<EntityType type> |
MoFEMErrorCode | getEntitySense (DataForcesAndSourcesCore &data) const |
| Get the entity sense (orientation) More...
|
|
template<EntityType type> |
MoFEMErrorCode | getEntityDataOrder (DataForcesAndSourcesCore &data, const FieldSpace space) const |
| Get the entity data order for given space. More...
|
|
MoFEMErrorCode | getFaceTriNodes (DataForcesAndSourcesCore &data) const |
| Get nodes on triangles. More...
|
|
MoFEMErrorCode | getSpacesAndBaseOnEntities (DataForcesAndSourcesCore &data) const |
| Get field approximation space and base on entities. More...
|
|
virtual int | getRule (int order_row, int order_col, int order_data) |
| another variant of getRule More...
|
|
virtual MoFEMErrorCode | setGaussPts (int order_row, int order_col, int order_data) |
| set user specific integration rule More...
|
|
MoFEMErrorCode | calHierarchicalBaseFunctionsOnElement (const FieldApproximationBase b) |
| Calculate base functions. More...
|
|
MoFEMErrorCode | calHierarchicalBaseFunctionsOnElement () |
| Calculate base functions. More...
|
|
MoFEMErrorCode | calBernsteinBezierBaseFunctionsOnElement () |
| Calculate Bernstein-Bezier base. More...
|
|
MoFEMErrorCode | createDataOnElement () |
| Create a entity data on element object. More...
|
|
MoFEMErrorCode | loopOverOperators () |
| Iterate user data operators. More...
|
|
|
template<typename EXTRACTOR > |
MoFEMErrorCode | getNodesIndices (const std::string &field_name, FieldEntity_vector_view &ents_field, VectorInt &nodes_indices, VectorInt &local_nodes_indices, EXTRACTOR &&extractor) const |
| get node indices More...
|
|
MoFEMErrorCode | getRowNodesIndices (DataForcesAndSourcesCore &data, const std::string &field_name) const |
| get row node indices from FENumeredDofEntity_multiIndex More...
|
|
MoFEMErrorCode | getColNodesIndices (DataForcesAndSourcesCore &data, const std::string &field_name) const |
| get col node indices from FENumeredDofEntity_multiIndex More...
|
|
template<typename EXTRACTOR > |
MoFEMErrorCode | getEntityIndices (DataForcesAndSourcesCore &data, const std::string &field_name, FieldEntity_vector_view &ents_field, const EntityType type_lo, const EntityType type_hi, EXTRACTOR &&extractor) const |
|
MoFEMErrorCode | getEntityRowIndices (DataForcesAndSourcesCore &data, const std::string &field_name, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const |
|
MoFEMErrorCode | getEntityColIndices (DataForcesAndSourcesCore &data, const std::string &field_name, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const |
|
MoFEMErrorCode | getNoFieldIndices (const std::string &field_name, boost::shared_ptr< 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 | getNoFieldFieldData (const std::string field_name, VectorDouble &ent_field_data, VectorDofs &ent_field_dofs, VectorFieldEntities &ent_field) const |
| Get field data on nodes. More...
|
|
MoFEMErrorCode | getNoFieldFieldData (DataForcesAndSourcesCore &data, const std::string field_name) const |
|
MoFEMErrorCode | getNodesFieldData (DataForcesAndSourcesCore &data, const std::string &field_name) const |
| Get data on nodes. More...
|
|
MoFEMErrorCode | getEntityFieldData (DataForcesAndSourcesCore &data, const std::string &field_name, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const |
|
|
MoFEMErrorCode | 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 |
|
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...
|
|
◆ RuleHookFun
◆ ForcesAndSourcesCore()
MoFEM::ForcesAndSourcesCore::ForcesAndSourcesCore |
( |
Interface & |
m_field | ) |
|
Definition at line 54 of file ForcesAndSourcesCore.cpp.
60 boost::make_shared<DataForcesAndSourcesCore>(MBENTITYSET),
61 boost::make_shared<DataForcesAndSourcesCore>(MBENTITYSET),
62 boost::make_shared<DataForcesAndSourcesCore>(MBENTITYSET),
63 boost::make_shared<DataForcesAndSourcesCore>(MBENTITYSET),
64 boost::make_shared<DataForcesAndSourcesCore>(MBENTITYSET),
65 boost::make_shared<DataForcesAndSourcesCore>(MBENTITYSET)
71 boost::make_shared<DerivedDataForcesAndSourcesCore>(
73 boost::make_shared<DerivedDataForcesAndSourcesCore>(
75 boost::make_shared<DerivedDataForcesAndSourcesCore>(
77 boost::make_shared<DerivedDataForcesAndSourcesCore>(
79 boost::make_shared<DerivedDataForcesAndSourcesCore>(
◆ calBernsteinBezierBaseFunctionsOnElement()
MoFEMErrorCode MoFEM::ForcesAndSourcesCore::calBernsteinBezierBaseFunctionsOnElement |
( |
| ) |
|
|
protected |
Calculate Bernstein-Bezier base.
- Returns
- MoFEMErrorCode
Definition at line 1087 of file ForcesAndSourcesCore.cpp.
1090 auto get_nodal_base_data = [&](DataForcesAndSourcesCore &data,
1093 auto &space = data.dataOnEntities[MBVERTEX][0].getSpace();
1094 auto &base = data.dataOnEntities[MBVERTEX][0].getBase();
1095 auto &bb_node_order = data.dataOnEntities[MBVERTEX][0].getBBNodeOrder();
1098 auto bit_number = field_ptr->getBitNumber();
1100 bit_number, get_id_for_min_type<MBVERTEX>());
1101 auto lo = std::lower_bound(field_ents.begin(), field_ents.end(), lo_uid,
1103 if (lo != field_ents.end()) {
1105 bit_number, get_id_for_max_type<MBVERTEX>());
1106 auto hi = std::upper_bound(lo, field_ents.end(), hi_uid,
cmp_uid_hi);
1109 for (
auto it = lo; it != hi; ++it)
1110 if (
auto first_e = it->lock()) {
1111 space = first_e->getSpace();
1112 base = first_e->getApproxBase();
1115 bb_node_order.resize(num_nodes,
false);
1116 bb_node_order.clear();
1117 const int nb_dof_idx = first_e->getNbOfCoeffs();
1119 std::vector<boost::weak_ptr<FieldEntity>> brother_ents_vec;
1121 for (; it != hi; ++it) {
1122 if (
auto e = it->lock()) {
1123 const auto &sn = e->getSideNumberPtr();
1124 const int side_number = sn->side_number;
1125 const int brother_side_number = sn->brother_side_number;
1126 if (brother_side_number != -1)
1127 brother_ents_vec.emplace_back(e);
1128 bb_node_order[side_number] = e->getMaxOrder();
1132 for (
auto &it : brother_ents_vec) {
1133 if (
const auto e = it.lock()) {
1134 const auto &sn = e->getSideNumberPtr();
1135 const int side_number = sn->side_number;
1136 const int brother_side_number = sn->brother_side_number;
1137 bb_node_order[brother_side_number] = bb_node_order[side_number];
1149 auto get_entity_base_data = [&](DataForcesAndSourcesCore &data,
1150 auto field_ptr,
const EntityType type_lo,
1151 const EntityType type_hi) {
1153 for (EntityType t = type_lo; t != type_hi; ++t) {
1154 for (
auto &dat : data.dataOnEntities[t]) {
1155 dat.getDataOrder() = 0;
1158 dat.getFieldData().resize(0,
false);
1159 dat.getFieldDofs().resize(0,
false);
1164 auto bit_number = field_ptr->getBitNumber();
1167 auto lo = std::lower_bound(field_ents.begin(), field_ents.end(), lo_uid,
1169 if (lo != field_ents.end()) {
1172 auto hi = std::upper_bound(lo, field_ents.end(), hi_uid,
cmp_uid_hi);
1174 std::vector<boost::weak_ptr<FieldEntity>> brother_ents_vec;
1175 for (; lo != hi; ++lo) {
1176 if (
auto e = lo->lock()) {
1177 if (
auto cache = e->entityCacheDataDofs.lock()) {
1179 const EntityType
type = e->getEntType();
1180 const int side = e->getSideNumberPtr()->side_number;
1181 auto &dat = data.dataOnEntities[
type][side];
1182 const int brother_side =
1183 e->getSideNumberPtr()->brother_side_number;
1184 if (brother_side != -1)
1185 brother_ents_vec.emplace_back(e);
1186 dat.getBase() = e->getApproxBase();
1187 dat.getSpace() = e->getSpace();
1188 const auto ent_order = e->getMaxOrder();
1189 dat.getDataOrder() = dat.getDataOrder() > ent_order
1190 ? dat.getDataOrder()
1197 for (
auto &ent_ptr : brother_ents_vec) {
1198 if (
auto e = ent_ptr.lock()) {
1199 const EntityType
type = e->getEntType();
1200 const int side = e->getSideNumberPtr()->side_number;
1201 const int brother_side = e->getSideNumberPtr()->brother_side_number;
1202 auto &dat = data.dataOnEntities[
type][side];
1203 auto &dat_brother = data.dataOnEntities[
type][brother_side];
1204 dat_brother.getBase() = dat.getBase();
1205 dat_brother.getSpace() = dat.getSpace();
1206 dat_brother.getDataOrder() = dat.getDataOrder();
1214 if (
auto ent_data_ptr = e.lock()) {
1216 auto space = ent_data_ptr->getSpace();
1217 for (EntityType t = MBVERTEX; t != MBPOLYHEDRON; ++t) {
1218 for (
auto &dat : (*
dataOnElement[space]).dataOnEntities[t]) {
1219 for (
auto &ptr : dat.getBBAlphaIndicesByOrderArray())
1221 for (
auto &ptr : dat.getBBNByOrderArray())
1223 for (
auto &ptr : dat.getBBDiffNByOrderArray())
1231 std::set<string> fields_list;
1233 if (
auto ent_data_ptr = e.lock()) {
1235 auto field_name = ent_data_ptr->getName();
1236 if (fields_list.find(field_name) == fields_list.end()) {
1237 auto field_ptr = ent_data_ptr->getFieldRawPtr();
1238 auto space = ent_data_ptr->getSpace();
1243 gaussPts, boost::make_shared<EntPolynomialBaseCtx>(
1247 fields_list.insert(field_name);
◆ calHierarchicalBaseFunctionsOnElement() [1/2]
MoFEMErrorCode MoFEM::ForcesAndSourcesCore::calHierarchicalBaseFunctionsOnElement |
( |
| ) |
|
|
protected |
◆ calHierarchicalBaseFunctionsOnElement() [2/2]
Calculate base functions.
- Returns
- Error code
Definition at line 1013 of file ForcesAndSourcesCore.cpp.
1028 "Functions genrating approximation base not defined");
1030 for (
int space =
H1; space !=
LASTSPACE; ++space) {
1036 boost::make_shared<EntPolynomialBaseCtx>(
1045 "Functions genrating user approximation base not defined");
1053 boost::make_shared<EntPolynomialBaseCtx>(
1060 "Base <%s> not yet implemented",
◆ createDataOnElement()
◆ getColNodesIndices()
get col node indices from FENumeredDofEntity_multiIndex
Definition at line 334 of file ForcesAndSourcesCore.cpp.
338 boost::weak_ptr<EntityCacheNumeredDofs>
339 operator()(boost::shared_ptr<FieldEntity> &e) {
340 return e->entityCacheColDofs;
345 data.dataOnEntities[MBVERTEX][0].getIndices(),
346 data.dataOnEntities[MBVERTEX][0].getLocalIndices(),
◆ getElementPolynomialBase()
auto& MoFEM::ForcesAndSourcesCore::getElementPolynomialBase |
( |
| ) |
|
Get the Entity Polynomial Base object.
- Returns
- boost::shared_ptr<BaseFunction>&&
Definition at line 432 of file ForcesAndSourcesCore.hpp.
◆ getEntData() [1/2]
◆ getEntData() [2/2]
◆ getEntityColIndices()
MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getEntityColIndices |
( |
DataForcesAndSourcesCore & |
data, |
|
|
const std::string & |
field_name, |
|
|
const EntityType |
type_lo = MBVERTEX , |
|
|
const EntityType |
type_hi = MBPOLYHEDRON |
|
) |
| const |
|
protected |
Definition at line 435 of file ForcesAndSourcesCore.cpp.
440 boost::weak_ptr<EntityCacheNumeredDofs>
441 operator()(boost::shared_ptr<FieldEntity> &e) {
442 return e->entityCacheColDofs;
◆ getEntityDataOrder() [1/2]
Get the entity data order.
- Parameters
-
- Returns
- MoFEMErrorCode
Definition at line 146 of file ForcesAndSourcesCore.cpp.
151 auto set_order = [&]() {
155 for (
unsigned int s = 0; s != data.size(); ++s)
156 data[s].getDataOrder() = 0;
160 for (
auto r =
fieldsPtr->get<BitFieldId_space_mi_tag>().equal_range(space);
161 r.first !=
r.second; ++
r.first) {
163 const auto field_bit_number = (*
r.first)->getBitNumber();
166 auto lo = std::lower_bound(data_field_ent.begin(), data_field_ent.end(),
168 if (lo != data_field_ent.end()) {
172 std::upper_bound(lo, data_field_ent.end(), hi_uid,
cmp_uid_hi);
173 for (; lo != hi; ++lo) {
175 if (
auto ptr = lo->lock()) {
178 auto sit = side_table.find(e.getEnt());
179 if (sit != side_table.end()) {
181 const int side_number = side->side_number;
182 if (side_number >= 0) {
184 auto &dat = data[side_number];
185 dat.getDataOrder() = dat.getDataOrder() > ent_order
191 "Entity on side of the element not found");
200 auto set_order_on_brother = [&]() {
205 if (sit != side_table.end()) {
207 for (; sit != hi_sit; ++sit) {
208 const int brother_side_number = (*sit)->brother_side_number;
209 if (brother_side_number != -1) {
210 const int side_number = (*sit)->side_number;
211 data[brother_side_number].getDataOrder() =
212 data[side_number].getDataOrder();
220 CHKERR set_order_on_brother();
◆ getEntityDataOrder() [2/2]
template<EntityType type>
Get the entity data order for given space.
- Template Parameters
-
- Parameters
-
- Returns
- MoFEMErrorCode
Definition at line 549 of file ForcesAndSourcesCore.hpp.
◆ getEntityFieldData()
MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getEntityFieldData |
( |
DataForcesAndSourcesCore & |
data, |
|
|
const std::string & |
field_name, |
|
|
const EntityType |
type_lo = MBVERTEX , |
|
|
const EntityType |
type_hi = MBPOLYHEDRON |
|
) |
| const |
|
protected |
Definition at line 722 of file ForcesAndSourcesCore.cpp.
726 for (EntityType t = type_lo; t != type_hi; ++t) {
727 for (
auto &dat : data.dataOnEntities[t]) {
728 dat.getDataOrder() = 0;
731 dat.getFieldData().resize(0,
false);
732 dat.getFieldDofs().resize(0,
false);
733 dat.getFieldEntities().resize(0,
false);
741 auto lo = std::lower_bound(field_ents.begin(), field_ents.end(), lo_uid,
743 if (lo != field_ents.end()) {
746 auto hi = std::upper_bound(lo, field_ents.end(), hi_uid,
cmp_uid_hi);
749 std::vector<boost::weak_ptr<FieldEntity>> brother_ents_vec;
751 for (
auto it = lo; it != hi; ++it)
752 if (
auto e = it->lock()) {
754 const EntityType
type = e->getEntType();
755 auto side_ptr = e->getSideNumberPtr();
756 const int side = side_ptr->side_number;
759 auto &dat = data.dataOnEntities[
type][side];
760 auto &ent_field = dat.getFieldEntities();
761 auto &ent_field_dofs = dat.getFieldDofs();
762 auto &ent_field_data = dat.getFieldData();
764 const int brother_side = side_ptr->brother_side_number;
765 if (brother_side != -1)
766 brother_ents_vec.emplace_back(e);
768 dat.getBase() = e->getApproxBase();
769 dat.getSpace() = e->getSpace();
770 const int ent_order = e->getMaxOrder();
772 dat.getDataOrder() > ent_order ? dat.getDataOrder() : ent_order;
774 auto ent_data = e->getEntFieldData();
775 ent_field_data.resize(ent_data.size(),
false);
776 noalias(ent_field_data) = ent_data;
777 ent_field_dofs.resize(ent_data.size(),
false);
778 std::fill(ent_field_dofs.begin(), ent_field_dofs.end(),
nullptr);
779 ent_field.resize(1,
false);
780 ent_field[0] = e.get();
781 if (
auto cache = e->entityCacheDataDofs.lock()) {
782 for (
auto dit =
cache->loHi[0]; dit !=
cache->loHi[1]; ++dit) {
783 ent_field_dofs[(*dit)->getEntDofIdx()] =
784 reinterpret_cast<FEDofEntity *
>((*dit).get());
790 for (
auto &it : brother_ents_vec) {
791 if (
const auto e = it.lock()) {
792 const EntityType
type = e->getEntType();
793 const int side = e->getSideNumberPtr()->side_number;
794 const int brother_side = e->getSideNumberPtr()->brother_side_number;
795 auto &dat = data.dataOnEntities[
type][side];
796 auto &dat_brother = data.dataOnEntities[
type][brother_side];
797 dat_brother.getBase() = dat.getBase();
798 dat_brother.getSpace() = dat.getSpace();
799 dat_brother.getDataOrder() = dat.getDataOrder();
800 dat_brother.getFieldData() = dat.getFieldData();
801 dat_brother.getFieldDofs() = dat.getFieldDofs();
802 dat_brother.getFieldEntities() = dat.getFieldEntities();
◆ getEntityIndices()
template<typename EXTRACTOR >
Definition at line 351 of file ForcesAndSourcesCore.cpp.
357 for (EntityType t = type_lo; t != type_hi; ++t) {
358 for (
auto &dat : data.dataOnEntities[t]) {
359 dat.getIndices().resize(0,
false);
360 dat.getLocalIndices().resize(0,
false);
367 auto lo = std::lower_bound(ents_field.begin(), ents_field.end(), lo_uid,
369 if (lo != ents_field.end()) {
372 auto hi = std::upper_bound(lo, ents_field.end(), hi_uid,
cmp_uid_hi);
375 std::vector<boost::weak_ptr<FieldEntity>> brother_ents_vec;
377 for (
auto it = lo; it != hi; ++it)
378 if (
auto e = it->lock()) {
380 const EntityType
type = e->getEntType();
381 auto side_ptr = e->getSideNumberPtr();
382 const int side = side_ptr->side_number;
384 const int nb_dofs_on_ent = e->getNbDofsOnEnt();
385 const int brother_side = side_ptr->brother_side_number;
386 auto &dat = data.dataOnEntities[
type][side];
387 auto &ent_field_indices = dat.getIndices();
388 auto &ent_field_local_indices = dat.getLocalIndices();
390 ent_field_indices.resize(nb_dofs_on_ent,
false);
391 ent_field_local_indices.resize(nb_dofs_on_ent,
false);
392 std::fill(ent_field_indices.data().begin(),
393 ent_field_indices.data().end(), -1);
394 std::fill(ent_field_local_indices.data().begin(),
395 ent_field_local_indices.data().end(), -1);
397 if (
auto cache = extractor(e).lock()) {
398 for (
auto dit =
cache->loHi[0]; dit !=
cache->loHi[1]; ++dit) {
399 const int idx = (*dit)->getEntDofIdx();
400 ent_field_indices[idx] = (*dit)->getPetscGlobalDofIdx();
401 ent_field_local_indices[idx] = (*dit)->getPetscLocalDofIdx();
405 if (brother_side != -1) {
406 auto &dat_brother = data.dataOnEntities[
type][brother_side];
407 dat_brother.getIndices().resize(nb_dofs_on_ent,
false);
408 dat_brother.getLocalIndices().resize(nb_dofs_on_ent,
false);
409 noalias(dat_brother.getIndices()) = dat.getIndices();
410 noalias(dat_brother.getLocalIndices()) = dat.getLocalIndices();
◆ getEntityRowIndices()
MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getEntityRowIndices |
( |
DataForcesAndSourcesCore & |
data, |
|
|
const std::string & |
field_name, |
|
|
const EntityType |
type_lo = MBVERTEX , |
|
|
const EntityType |
type_hi = MBPOLYHEDRON |
|
) |
| const |
|
protected |
Definition at line 420 of file ForcesAndSourcesCore.cpp.
425 boost::weak_ptr<EntityCacheNumeredDofs>
426 operator()(boost::shared_ptr<FieldEntity> &e) {
427 return e->entityCacheRowDofs;
◆ getEntitySense() [1/2]
get sense (orientation) of entity
- Parameters
-
type | type of entity |
data | entity data |
- Returns
- error code
Definition at line 90 of file ForcesAndSourcesCore.cpp.
97 if (sit != side_table.end()) {
99 for (; sit != hi_sit; ++sit) {
100 const int side_number = (*sit)->side_number;
101 if (side_number >= 0) {
102 const int brother_side_number = (*sit)->brother_side_number;
103 const int sense = (*sit)->sense;
105 data[side_number].getSense() = sense;
106 if (brother_side_number != -1)
107 data[brother_side_number].getSense() = sense;
◆ getEntitySense() [2/2]
template<EntityType type>
Get the entity sense (orientation)
- Template Parameters
-
- Parameters
-
- Returns
- MoFEMErrorCode
Definition at line 536 of file ForcesAndSourcesCore.hpp.
◆ getFaceTriNodes()
Get nodes on triangles.
Definition at line 878 of file ForcesAndSourcesCore.cpp.
881 data.facesNodes.resize(4, 3,
false);
884 auto siit = side_table.get<1>().lower_bound(boost::make_tuple(MBTRI, 0));
885 auto hi_siit = side_table.get<1>().upper_bound(boost::make_tuple(MBTRI, 4));
886 if (std::distance(siit, hi_siit) != 4) {
888 "Should be 4 triangles on tet, side_table not initialized");
890 const int canonical_face_sense_p1[4][3] = {
895 const int canonical_face_sense_m1[4][3] = {
900 for (; siit != hi_siit; siit++) {
901 const boost::shared_ptr<SideNumber> side = *siit;
902 int face_conn[3] = {-1, -1, -1};
903 if (side->offset == 0) {
904 face_conn[0] = side->sense == 1
905 ? canonical_face_sense_p1[(
int)side->side_number][0]
906 : canonical_face_sense_m1[(
int)side->side_number][0];
907 face_conn[1] = side->sense == 1
908 ? canonical_face_sense_p1[(
int)side->side_number][1]
909 : canonical_face_sense_m1[(
int)side->side_number][1];
910 face_conn[2] = side->sense == 1
911 ? canonical_face_sense_p1[(
int)side->side_number][2]
912 : canonical_face_sense_m1[(
int)side->side_number][2];
914 if (side->offset == 1) {
917 ? canonical_face_sense_p1[(
int)side->side_number][1]
918 : canonical_face_sense_m1[(
int)side->side_number][2] ;
919 face_conn[1] = side->sense == 1
920 ? canonical_face_sense_p1[(
int)side->side_number][2]
921 : canonical_face_sense_m1[(
int)side->side_number][0];
922 face_conn[2] = side->sense == 1
923 ? canonical_face_sense_p1[(
int)side->side_number][0]
924 : canonical_face_sense_m1[(
int)side->side_number][1];
926 if (side->offset == 2) {
929 ? canonical_face_sense_p1[(
int)side->side_number][2]
930 : canonical_face_sense_m1[(
int)side->side_number][1] ;
931 face_conn[1] = side->sense == 1
932 ? canonical_face_sense_p1[(
int)side->side_number][0]
933 : canonical_face_sense_m1[(
int)side->side_number][2];
934 face_conn[2] = side->sense == 1
935 ? canonical_face_sense_p1[(
int)side->side_number][1]
936 : canonical_face_sense_m1[(
int)side->side_number][0];
938 for (
int nn = 0; nn < 3; nn++)
939 data.facesNodes(side->side_number, nn) = face_conn[nn];
946 if (num_nodes_tet != 4)
948 "data inconsistency");
952 num_nodes_face,
true);
953 if (num_nodes_face != 3)
954 SETERRQ(PETSC_COMM_SELF, 1,
"data inconsistency");
955 if (conn_face[0] != conn_tet[data.facesNodes(side->side_number, 0)])
957 "data inconsistency");
958 if (conn_face[1] != conn_tet[data.facesNodes(side->side_number, 1)])
960 "data inconsistency");
961 if (conn_face[2] != conn_tet[data.facesNodes(side->side_number, 2)])
963 "data inconsistency");
◆ getMaxColOrder()
int MoFEM::ForcesAndSourcesCore::getMaxColOrder |
( |
| ) |
const |
◆ 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 127 of file ForcesAndSourcesCore.cpp.
130 if (
auto ptr = e.lock()) {
131 const int order = ptr->getMaxOrder();
132 max_order = (max_order <
order) ?
order : max_order;
◆ getMaxRowOrder()
int MoFEM::ForcesAndSourcesCore::getMaxRowOrder |
( |
| ) |
const |
◆ getNodesFieldData()
Get data on nodes.
- Parameters
-
data | Data structure |
field_name | Field name |
- Returns
- Error code
Definition at line 602 of file ForcesAndSourcesCore.cpp.
605 auto get_nodes_field_data = [&](
VectorDouble &nodes_data,
612 nodes_data.resize(0,
false);
613 nodes_dofs.resize(0,
false);
614 field_entities.resize(0,
false);
616 auto field_it =
fieldsPtr->get<FieldName_mi_tag>().find(field_name);
617 if (field_it !=
fieldsPtr->get<FieldName_mi_tag>().end()) {
619 auto bit_number = (*field_it)->getBitNumber();
620 const int nb_dofs_on_vert = (*field_it)->getNbOfCoeffs();
621 space = (*field_it)->getSpace();
622 base = (*field_it)->getApproxBase();
626 bit_number, get_id_for_min_type<MBVERTEX>());
627 auto lo = std::lower_bound(field_ents.begin(), field_ents.end(), lo_uid,
629 if (lo != field_ents.end()) {
631 bit_number, get_id_for_max_type<MBVERTEX>());
632 auto hi = std::upper_bound(lo, field_ents.end(), hi_uid,
cmp_uid_hi);
636 for (
auto it = lo; it != hi; ++it) {
637 if (
auto e = it->lock()) {
638 nb_dofs += e->getNbDofsOnEnt();
646 bb_node_order.resize(num_nodes,
false);
647 bb_node_order.clear();
648 const int max_nb_dofs = nb_dofs_on_vert * num_nodes;
649 nodes_data.resize(max_nb_dofs,
false);
650 nodes_dofs.resize(max_nb_dofs,
false);
651 field_entities.resize(num_nodes,
false);
652 std::fill(nodes_data.begin(), nodes_data.end(), 0);
653 std::fill(nodes_dofs.begin(), nodes_dofs.end(),
nullptr);
654 std::fill(field_entities.begin(), field_entities.end(),
nullptr);
656 std::vector<boost::weak_ptr<FieldEntity>> brother_ents_vec;
658 for (
auto it = lo; it != hi; ++it) {
659 if (
auto e = it->lock()) {
660 const auto &sn = e->getSideNumberPtr();
661 const int side_number = sn->side_number;
664 if (side_number >= 0) {
665 const int brother_side_number = sn->brother_side_number;
667 field_entities[side_number] = e.get();
668 if (brother_side_number != -1) {
669 brother_ents_vec.emplace_back(e);
670 field_entities[side_number] = field_entities[side_number];
673 bb_node_order[side_number] = e->getMaxOrder();
674 int pos = side_number * nb_dofs_on_vert;
675 auto ent_filed_data_vec = e->getEntFieldData();
676 if (
auto cache = e->entityCacheDataDofs.lock()) {
677 for (
auto dit =
cache->loHi[0]; dit !=
cache->loHi[1];
679 const auto dof_idx = (*dit)->getEntDofIdx();
680 nodes_data[pos + dof_idx] = ent_filed_data_vec[dof_idx];
681 nodes_dofs[pos + dof_idx] =
682 reinterpret_cast<FEDofEntity *
>((*dit).get());
689 for (
auto &it : brother_ents_vec) {
690 if (
const auto e = it.lock()) {
691 const auto &sn = e->getSideNumberPtr();
692 const int side_number = sn->side_number;
693 const int brother_side_number = sn->brother_side_number;
694 bb_node_order[brother_side_number] = bb_node_order[side_number];
695 int pos = side_number * nb_dofs_on_vert;
696 int brother_pos = brother_side_number * nb_dofs_on_vert;
697 for (
int ii = 0; ii != nb_dofs_on_vert; ++ii) {
698 nodes_data[brother_pos] = nodes_data[pos];
699 nodes_dofs[brother_pos] = nodes_dofs[pos];
713 return get_nodes_field_data(
714 data.dataOnEntities[MBVERTEX][0].getFieldData(),
715 data.dataOnEntities[MBVERTEX][0].getFieldEntities(),
716 data.dataOnEntities[MBVERTEX][0].getFieldDofs(),
717 data.dataOnEntities[MBVERTEX][0].getSpace(),
718 data.dataOnEntities[MBVERTEX][0].getBase(),
719 data.dataOnEntities[MBVERTEX][0].getBBNodeOrder());
◆ getNodesIndices()
template<typename EXTRACTOR >
get node indices
Definition at line 228 of file ForcesAndSourcesCore.cpp.
234 auto field_it =
fieldsPtr->get<FieldName_mi_tag>().find(field_name);
235 if (field_it !=
fieldsPtr->get<FieldName_mi_tag>().end()) {
237 auto bit_number = (*field_it)->getBitNumber();
239 bit_number, get_id_for_min_type<MBVERTEX>());
240 auto lo = std::lower_bound(ents_field.begin(), ents_field.end(), lo_uid,
242 if (lo != ents_field.end()) {
244 bit_number, get_id_for_max_type<MBVERTEX>());
245 auto hi = std::upper_bound(lo, ents_field.end(), hi_uid,
cmp_uid_hi);
249 const int nb_dofs_on_vert = (*field_it)->getNbOfCoeffs();
250 const int max_nb_dofs = nb_dofs_on_vert * num_nodes;
253 for (
auto it = lo; it != hi; ++it) {
254 if (
auto e = it->lock()) {
255 if (
auto cache = extractor(e).lock()) {
257 nb_dofs += std::distance(
cache->loHi[0],
cache->loHi[1]);
265 nodes_indices.resize(max_nb_dofs,
false);
266 local_nodes_indices.resize(max_nb_dofs,
false);
268 nodes_indices.resize(0,
false);
269 local_nodes_indices.resize(0,
false);
272 if (nb_dofs != max_nb_dofs) {
273 std::fill(nodes_indices.begin(), nodes_indices.end(), -1);
274 std::fill(local_nodes_indices.begin(), local_nodes_indices.end(), -1);
277 for (
auto it = lo; it != hi; ++it) {
278 if (
auto e = it->lock()) {
279 auto side_ptr = e->getSideNumberPtr();
280 const auto side_number = side_ptr->side_number;
281 if (side_number >= 0) {
282 const auto brother_side_number = side_ptr->brother_side_number;
283 if (
auto cache = extractor(e).lock()) {
284 for (
auto dit =
cache->loHi[0]; dit !=
cache->loHi[1]; ++dit) {
286 const int idx = dof.getPetscGlobalDofIdx();
287 const int local_idx = dof.getPetscLocalDofIdx();
289 side_number * nb_dofs_on_vert + dof.getDofCoeffIdx();
290 nodes_indices[pos] = idx;
291 local_nodes_indices[pos] = local_idx;
292 if (brother_side_number != -1) {
293 const int elem_idx = brother_side_number * nb_dofs_on_vert +
294 (*dit)->getDofCoeffIdx();
295 nodes_indices[elem_idx] = idx;
296 local_nodes_indices[elem_idx] = local_idx;
304 nodes_indices.resize(0,
false);
305 local_nodes_indices.resize(0,
false);
309 nodes_indices.resize(0,
false);
310 local_nodes_indices.resize(0,
false);
◆ getNoFieldColIndices()
get col NoField indices
Definition at line 479 of file ForcesAndSourcesCore.cpp.
482 if (data.dataOnEntities[MBENTITYSET].size() == 0) {
486 data.dataOnEntities[MBENTITYSET][0].getIndices());
◆ getNoFieldFieldData() [1/2]
Get field data on nodes.
Definition at line 811 of file ForcesAndSourcesCore.cpp.
817 ent_field_data.resize(0,
false);
818 ent_field_dofs.resize(0,
false);
819 ent_field.resize(0,
false);
824 bit_number, get_id_for_min_type<MBVERTEX>());
825 auto lo = std::lower_bound(field_ents.begin(), field_ents.end(), lo_uid,
827 if (lo != field_ents.end()) {
829 ent_field.resize(field_ents.size(),
false);
830 std::fill(ent_field.begin(), ent_field.end(),
nullptr);
833 bit_number, get_id_for_max_type<MBVERTEX>());
834 auto hi = std::upper_bound(lo, field_ents.end(), hi_uid,
cmp_uid_hi);
838 for (
auto it = lo; it != hi; ++it, ++side)
839 if (
auto e = it->lock()) {
841 const auto size = e->getNbDofsOnEnt();
842 ent_field_data.resize(size,
false);
843 ent_field_dofs.resize(size,
false);
844 ent_field[side] = e.get();
845 noalias(ent_field_data) = e->getEntFieldData();
847 if (
auto cache = e->entityCacheDataDofs.lock()) {
848 for (
auto dit =
cache->loHi[0]; dit !=
cache->loHi[1]; ++dit) {
849 ent_field_dofs[(*dit)->getEntDofIdx()] =
850 reinterpret_cast<FEDofEntity *
>((*dit).get());
◆ getNoFieldFieldData() [2/2]
Definition at line 861 of file ForcesAndSourcesCore.cpp.
864 if (data.dataOnEntities[MBENTITYSET].size() == 0)
866 "No space to insert data");
869 field_name, data.dataOnEntities[MBENTITYSET][0].getFieldData(),
870 data.dataOnEntities[MBENTITYSET][0].getFieldDofs(),
871 data.dataOnEntities[MBENTITYSET][0].getFieldEntities());
◆ getNoFieldIndices()
get NoField indices
Definition at line 450 of file ForcesAndSourcesCore.cpp.
455 auto field_it =
fieldsPtr->get<FieldName_mi_tag>().find(field_name);
456 auto dit = dofs->get<Unique_mi_tag>().lower_bound(
458 auto hi_dit = dofs->get<Unique_mi_tag>().upper_bound(
460 indices.resize(std::distance(dit, hi_dit));
461 for (; dit != hi_dit; dit++) {
462 int idx = (*dit)->getPetscGlobalDofIdx();
463 indices[(*dit)->getDofCoeffIdx()] = idx;
◆ getNoFieldRowIndices()
get col NoField indices
Definition at line 468 of file ForcesAndSourcesCore.cpp.
471 if (data.dataOnEntities[MBENTITYSET].size() == 0) {
475 data.dataOnEntities[MBENTITYSET][0].getIndices());
◆ getOpPtrVector()
boost::ptr_vector<UserDataOperator>& MoFEM::ForcesAndSourcesCore::getOpPtrVector |
( |
| ) |
|
◆ getProblemNodesColIndices()
MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getProblemNodesColIndices |
( |
const std::string & |
field_name, |
|
|
VectorInt & |
nodes_indices |
|
) |
| const |
|
protected |
◆ getProblemNodesIndices()
get indices of nodal indices which are declared for problem but not this particular element
Definition at line 492 of file ForcesAndSourcesCore.cpp.
498 if (field_struture->getSpace() ==
H1) {
502 nodes_indices.resize(field_struture->getNbOfCoeffs() * num_nodes,
false);
503 std::fill(nodes_indices.begin(), nodes_indices.end(), -1);
507 auto siit = side_table.get<1>().lower_bound(boost::make_tuple(MBVERTEX, 0));
509 side_table.get<1>().lower_bound(boost::make_tuple(MBVERTEX, 10000));
512 for (; siit != hi_siit; siit++, nn++) {
514 if (siit->get()->side_number == -1)
519 auto dit = dofs.get<Unique_mi_tag>().lower_bound(
521 auto hi_dit = dofs.get<Unique_mi_tag>().upper_bound(
523 for (; dit != hi_dit; dit++) {
524 nodes_indices[siit->get()->side_number * (*dit)->getNbOfCoeffs() +
525 (*dit)->getDofCoeffIdx()] =
526 (*dit)->getPetscGlobalDofIdx();
530 nodes_indices.resize(0,
false);
◆ getProblemNodesRowIndices()
MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getProblemNodesRowIndices |
( |
const std::string & |
field_name, |
|
|
VectorInt & |
nodes_indices |
|
) |
| const |
|
protected |
◆ getProblemTypeColIndices()
MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getProblemTypeColIndices |
( |
const std::string & |
field_name, |
|
|
EntityType |
type, |
|
|
int |
side_number, |
|
|
VectorInt & |
indices |
|
) |
| const |
|
protected |
◆ getProblemTypeIndices()
get indices by type (generic function) which are declared for problem but not this particular element
Definition at line 536 of file ForcesAndSourcesCore.cpp.
546 side_table.get<1>().lower_bound(boost::make_tuple(
type, side_number));
548 side_table.get<1>().upper_bound(boost::make_tuple(
type, side_number));
550 for (; siit != hi_siit; siit++) {
552 if (siit->get()->side_number == -1)
557 auto dit = dofs.get<Unique_mi_tag>().lower_bound(
559 auto hi_dit = dofs.get<Unique_mi_tag>().upper_bound(
561 indices.resize(std::distance(dit, hi_dit));
562 for (; dit != hi_dit; dit++) {
564 indices[(*dit)->getEntDofIdx()] = (*dit)->getPetscGlobalDofIdx();
◆ getProblemTypeRowIndices()
MoFEMErrorCode MoFEM::ForcesAndSourcesCore::getProblemTypeRowIndices |
( |
const std::string & |
field_name, |
|
|
EntityType |
type, |
|
|
int |
side_number, |
|
|
VectorInt & |
indices |
|
) |
| const |
|
protected |
◆ getRowNodesIndices()
get row node indices from FENumeredDofEntity_multiIndex
Definition at line 317 of file ForcesAndSourcesCore.cpp.
321 boost::weak_ptr<EntityCacheNumeredDofs>
322 operator()(boost::shared_ptr<FieldEntity> &e) {
323 return e->entityCacheRowDofs;
328 data.dataOnEntities[MBVERTEX][0].getIndices(),
329 data.dataOnEntities[MBVERTEX][0].getLocalIndices(),
◆ getRule() [1/2]
int MoFEM::ForcesAndSourcesCore::getRule |
( |
int |
order | ) |
|
|
protectedvirtual |
- Deprecated:
- Use getRule(int row_order, int col_order, int data order)
Reimplemented in MixTransport::MixTransportElement::MyVolumeFE, MagneticElement::VolumeFE, SmallStrainPlasticity::MyVolumeFE, OptimalMassTransport::VolumeFE, NitscheMethod::MyVolumeFE, GelModule::Gel::GelFE, BoneRemodeling::Remodeling::Fe, BoneRemodeling::DensityMapFe, ThermalStressElement::MyVolumeFE, ThermalElement::MyTriFE, ThermalElement::MyVolumeFE, EdgeSlidingConstrains::MyEdgeFE, PostProcEdgeOnRefinedMesh, PostProcTemplateVolumeOnRefinedMesh< MoFEM::VolumeElementForcesAndSourcesCore >, NonlinearElasticElement::MyVolumeFE, KelvinVoigtDamper::DamperFE, EdgeForce::MyFE, BodyForceConstantField::MyVolumeFE, CohesiveElement::CohesiveInterfaceElement::MyPrism, MoFEM::VolumeElementForcesAndSourcesCoreOnSideBase, MoFEM::VolumeElementForcesAndSourcesCoreOnContactPrismSideBase, and MoFEM::FaceElementForcesAndSourcesCoreOnSideBase.
Definition at line 1603 of file ForcesAndSourcesCore.cpp.
1603 {
return 2 *
order; }
◆ getRule() [2/2]
int MoFEM::ForcesAndSourcesCore::getRule |
( |
int |
order_row, |
|
|
int |
order_col, |
|
|
int |
order_data |
|
) |
| |
|
protectedvirtual |
another variant of getRule
- Parameters
-
order_row | order of base function on row |
order_col | order of base function on columns |
order_data | order of base function approximating data |
- Returns
- integration rule
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
The integration points and weights are set appropriately for given entity type and integration rule from quad.c
Method ForcesAndSourcesCore::getRule takes at argument takes maximal polynomial order set on the element on all fields defined on the element. If a user likes to have more control, another variant of this function can be called which distinguishing between field orders on rows, columns and data, the i.e. first argument of a bilinear form, the second argument of bilinear form and field coefficients on the element.
- Note
- If user set rule to -1 or any other negative integer, then method ForcesAndSourcesCore::setGaussPts is called. In that method user can implement own (specific) integration method.
- Bug:
- this function should be const
Reimplemented in EdgeFE, and QuadFE.
Definition at line 1591 of file ForcesAndSourcesCore.cpp.
◆ getSpacesAndBaseOnEntities()
Get field approximation space and base on entities.
Definition at line 971 of file ForcesAndSourcesCore.cpp.
978 for (EntityType t = MBVERTEX; t != MBMAXTYPE; ++t) {
979 data.spacesOnEntities[t].reset();
980 data.basesOnEntities[t].reset();
983 data.basesOnSpaces[s].reset();
991 if (
auto ptr = e.lock()) {
993 const EntityType
type = ptr->getEntType();
998 data.sPace.set(space);
999 data.bAse.set(approx);
1000 data.spacesOnEntities[
type].set(space);
1001 data.basesOnEntities[
type].set(approx);
1002 data.basesOnSpaces[space].set(approx);
1008 "data fields ents not allocated on element");
◆ getUserPolynomialBase()
auto& MoFEM::ForcesAndSourcesCore::getUserPolynomialBase |
( |
| ) |
|
◆ loopOverOperators()
Iterate user data operators.
- Returns
- MoFEMErrorCode
Definition at line 1304 of file ForcesAndSourcesCore.cpp.
1310 std::vector<std::string> last_eval_field_name(2);
1312 boost::ptr_vector<UserDataOperator>::iterator oit, hi_oit;
1316 for (; oit != hi_oit; oit++) {
1320 CHKERR oit->setPtrFE(
this);
1325 switch (oit->sPace) {
1339 "Not implemented for this space", oit->sPace);
1344 last_eval_field_name[0] =
"";
1354 boost::shared_ptr<DataForcesAndSourcesCore> op_data[2];
1355 std::array<bool, 2> base_swap;
1356 std::array<std::pair<std::string, FieldApproximationBase>, 2>
1358 auto swap_bases = [&]() {
1360 for (
size_t ss = 0; ss != 2; ++ss)
1362 CHKERR op_data[ss]->baseSwap(base_swap_data[ss].first,
1363 base_swap_data[ss].second);
1367 for (
size_t ss = 0; ss != 2; ss++) {
1369 const std::string field_name =
1370 !ss ? oit->rowFieldName : oit->colFieldName;
1371 if (field_name.empty()) {
1374 "No field name in operator %d (0-row, 1-column) in operator %s",
1376 (boost::typeindex::type_id_runtime(*oit).pretty_name())
1380 const BitFieldId data_id = field_struture->getId();
1381 const FieldSpace space = field_struture->getSpace();
1388 base_swap_data[ss] = std::pair<std::string, FieldApproximationBase>(
1390 base_swap[ss] =
true;
1393 base_swap[ss] =
false;
1396 if ((oit->getNumeredEntFiniteElementPtr()->getBitFieldIdData() &
1400 "no data field < %s > on finite element < %s >",
1401 field_name.c_str(),
feName.c_str());
1404 if (oit->getOpType() & types[ss] ||
1420 "Not implemented for this space", space);
1423 if (last_eval_field_name[ss] != field_name) {
1469 "Not implemented for this space", space);
1471 last_eval_field_name[ss] = field_name;
1480 CHKERR oit->opRhs(*op_data[0],
false);
1487 CHKERR oit->opRhs(*op_data[1],
false);
1494 CHKERR oit->opLhs(*op_data[0], *op_data[1]);
◆ operator()()
◆ postProcess()
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 SolidShellModule::SolidShellPrismElement::PostProcFatPrismOnTriangleOnRefinedMesh, SolidShellModule::SolidShellPrismElement::SolidShellError, SolidShellModule::SolidShellPrismElement::SolidShell, GelModule::Gel::GelFE, Smoother::MyVolumeFE, PostProcEdgeOnRefinedMesh, PostProcFatPrismOnRefinedMesh, PostProcTemplateVolumeOnRefinedMesh< MoFEM::VolumeElementForcesAndSourcesCore >, NonlinearElasticElement::MyVolumeFE, and KelvinVoigtDamper::DamperFE.
Definition at line 1645 of file ForcesAndSourcesCore.cpp.
◆ preProcess()
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 SolidShellModule::SolidShellPrismElement::SolidShellError, SolidShellModule::SolidShellPrismElement::SolidShell, GelModule::Gel::GelFE, EdgeSlidingConstrains::MyEdgeFE, Smoother::MyVolumeFE, PostProcEdgeOnRefinedMesh, PostProcFatPrismOnRefinedMesh, PostProcTemplateVolumeOnRefinedMesh< MoFEM::VolumeElementForcesAndSourcesCore >, NonlinearElasticElement::MyVolumeFE, and KelvinVoigtDamper::DamperFE.
Definition at line 1629 of file ForcesAndSourcesCore.cpp.
◆ setGaussPts() [1/2]
◆ setGaussPts() [2/2]
MoFEMErrorCode MoFEM::ForcesAndSourcesCore::setGaussPts |
( |
int |
order_row, |
|
|
int |
order_col, |
|
|
int |
order_data |
|
) |
| |
|
protectedvirtual |
set user specific integration rule
This function allows for user defined integration rule. The key is to called matrix gaussPts, which is used by other MoFEM procedures. Matrix has number of rows equal to problem dimension plus one, where last index is used to store weight values. Number of columns is equal to number of integration points.
- Note
- This function is called if method ForcesAndSourcesCore::getRule is returning integer -1 or any other negative integer.
User sets
where
number rows represents local coordinates of integration points in reference element, where last index in row is for integration weight.
Reimplemented in EdgeFE, and QuadFE.
Definition at line 1597 of file ForcesAndSourcesCore.cpp.
◆ setSideFEPtr()
Set the pointer to face element on the side.
- Note
- Function is is used by face element, while it iterates over elements on the side
- Parameters
-
- Returns
- MoFEMErrorCode
Definition at line 1542 of file ForcesAndSourcesCore.cpp.
◆ FaceElementForcesAndSourcesCoreOnSideBase
◆ UserDataOperator
- Examples
- continuity_check_on_contact_prism_side_ele.cpp, continuity_check_on_skeleton_with_simple_2d_for_h1.cpp, continuity_check_on_skeleton_with_simple_2d_for_hcurl.cpp, continuity_check_on_skeleton_with_simple_2d_for_hdiv.cpp, forces_and_sources_testing_edge_element.cpp, hcurl_divergence_operator_2d.cpp, heat_equation.hpp, hello_world.cpp, helmholtz.cpp, mesh_smoothing.cpp, and wave_equation.hpp.
Definition at line 818 of file ForcesAndSourcesCore.hpp.
◆ VolumeElementForcesAndSourcesCoreOnContactPrismSideBase
◆ VolumeElementForcesAndSourcesCoreOnSideBase
◆ dataH1
◆ dataHcurl
◆ dataHdiv
◆ dataL2
◆ dataNoField
◆ dataOnElement
◆ derivedDataOnElement
◆ elementPolynomialBasePtr
boost::shared_ptr<BaseFunction> MoFEM::ForcesAndSourcesCore::elementPolynomialBasePtr |
|
private |
◆ gaussPts
Matrix of integration points.
Columns is equal to number of integration points, numver of rows depends on dimension of finite element entity, for example for tetrahedron rows are x,y,z,weight. Last row is integration weight.
FIXME: that should be moved to private class data and acessed only by member function
- Examples
- prism_elements_from_surface.cpp.
Definition at line 451 of file ForcesAndSourcesCore.hpp.
◆ getRuleHook
◆ lastEvaluatedElementEntityType
EntityType MoFEM::ForcesAndSourcesCore::lastEvaluatedElementEntityType |
|
protected |
◆ mField
Interface& MoFEM::ForcesAndSourcesCore::mField |
◆ opPtrVector
◆ setRuleHook
◆ sidePtrFE
◆ userPolynomialBasePtr
boost::shared_ptr<BaseFunction> MoFEM::ForcesAndSourcesCore::userPolynomialBasePtr |
|
private |
The documentation for this struct was generated from the following files:
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
int getNinTheLoop() const
get number of evaluated element in the loop
boost::shared_ptr< BaseFunction > elementPolynomialBasePtr
Pointer to entity polynomial base.
DataForcesAndSourcesCore & dataNoField
boost::shared_ptr< FieldEntity_vector_view > & getDataFieldEntsPtr() const
static UId getLoBitNumberUId(const FieldBitNumber bit_number)
MoFEMErrorCode getRowNodesIndices(DataForcesAndSourcesCore &data, const std::string &field_name) const
get row node indices from FENumeredDofEntity_multiIndex
boost::shared_ptr< NumeredDofEntity_multiIndex > numeredRowDofsPtr
store DOFs on rows for this problem
MatrixDouble gaussPts
Matrix of integration points.
int nInTheLoop
number currently of processed method
MoFEMErrorCode getNoFieldRowIndices(DataForcesAndSourcesCore &data, const std::string &field_name) const
get col NoField indices
MoFEMErrorCode getNodesIndices(const std::string &field_name, FieldEntity_vector_view &ents_field, VectorInt &nodes_indices, VectorInt &local_nodes_indices, EXTRACTOR &&extractor) const
get node indices
ublas::vector< FieldEntity *, FieldEntAllocator > VectorFieldEntities
static const char *const ApproximationBaseNames[]
static auto cmp_uid_hi(const UId &b, const boost::weak_ptr< FieldEntity > &a)
DataForcesAndSourcesCore & dataL2
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
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
@ L2
field with C-1 continuity
virtual MoFEMErrorCode setGaussPts(int order_row, int order_col, int order_data)
set user specific integration rule
MoFEMErrorCode getNoFieldIndices(const std::string &field_name, boost::shared_ptr< FENumeredDofEntity_multiIndex > dofs, VectorInt &nodes_indices) const
get NoField indices
static int getMaxOrder(const ENTMULTIINDEX &multi_index)
MoFEMErrorCode getEntityColIndices(DataForcesAndSourcesCore &data, const std::string &field_name, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const
const Field_multiIndex * fieldsPtr
raw pointer to fields container
int ApproximationOrder
Approximation on the entity.
OpType
Controls loop over entities on element.
static auto cmp_uid_lo(const boost::weak_ptr< FieldEntity > &a, const UId &b)
boost::function< MoFEMErrorCode()> postProcessHook
Hook function for post-processing.
virtual moab::Interface & get_moab()=0
@ USER_BASE
user implemented approximation base
auto & getColFieldEnts() const
EntityType lastEvaluatedElementEntityType
Last evaluated type of element entity.
auto & getUserPolynomialBase()
Get the User Polynomial Base object.
static bool getDefTypeMap(const EntityType fe_type, const EntityType ent_type)
MoFEMErrorCode getColNodesIndices(DataForcesAndSourcesCore &data, const std::string &field_name) const
get col node indices from FENumeredDofEntity_multiIndex
FieldSpace
approximation spaces
virtual const Field * get_field_structure(const std::string &name)=0
get field structure
#define CHKERR
Inline error check.
virtual MoFEMErrorCode operator()()
function is run for every finite element
DataForcesAndSourcesCore & dataH1
virtual int getRule(int order_row, int order_col, int order_data)
another variant of getRule
auto getRowDofsPtr() const
const std::array< boost::shared_ptr< DataForcesAndSourcesCore >, LASTSPACE > derivedDataOnElement
Entity data on element entity columns fields.
MoFEMErrorCode getNumberOfNodes(int &num_nodes) const
Get number of DOFs on element.
MoFEMErrorCode getEntityFieldData(DataForcesAndSourcesCore &data, const std::string &field_name, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const
UId getLocalUniqueIdCalculate()
Get the Local Unique Id Calculate object.
MoFEMErrorCode getEntitySense(const EntityType type, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
get sense (orientation) of entity
MoFEMErrorCode getNoFieldColIndices(DataForcesAndSourcesCore &data, const std::string &field_name) const
get col NoField indices
const FieldEntity_vector_view & getDataFieldEnts() const
boost::shared_ptr< NumeredDofEntity_multiIndex > numeredColDofsPtr
store DOFs on columns for this problem
boost::function< MoFEMErrorCode()> operatorHook
Hook function for operator.
EntityHandle get_id_for_max_type()
MoFEMErrorCode getNodesFieldData(DataForcesAndSourcesCore &data, const std::string &field_name) const
Get data on nodes.
@ LASTSPACE
FieldSpace in [ 0, LASTSPACE )
#define CATCH_OP_ERRORS(OP)
boost::shared_ptr< BaseFunction > userPolynomialBasePtr
Pointer to user polynomail base.
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< ordered_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 > > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
static UId getLoLocalEntityBitNumber(const char bit_number, const EntityHandle ent)
auto & getElementPolynomialBase()
Get the Entity Polynomial Base object.
MoFEMErrorCode calHierarchicalBaseFunctionsOnElement()
Calculate base functions.
auto getColDofsPtr() const
boost::shared_ptr< const NumeredEntFiniteElement > numeredEntFiniteElementPtr
RuleHookFun getRuleHook
Hook to get rule.
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
MoFEMErrorCode getNoFieldFieldData(const std::string field_name, VectorDouble &ent_field_data, VectorDofs &ent_field_dofs, VectorFieldEntities &ent_field) const
Get field data on nodes.
virtual FieldBitNumber get_field_bit_number(const std::string name) const =0
get field bit number
DataForcesAndSourcesCore & dataHcurl
const std::array< boost::shared_ptr< DataForcesAndSourcesCore >, LASTSPACE > dataOnElement
Entity data on element entity rows fields.
const Problem * problemPtr
raw pointer to problem
EntityHandle get_id_for_min_type()
static UId getHiBitNumberUId(const FieldBitNumber bit_number)
MoFEMErrorCode getEntityDataOrder(const EntityType type, const FieldSpace space, boost::ptr_vector< DataForcesAndSourcesCore::EntData > &data) const
Get the entity data order.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
@ HCURL
field with continuous tangents
ForcesAndSourcesCore * sidePtrFE
Element to integrate on the sides.
@ MOFEM_DATA_INCONSISTENCY
ublas::vector< int, IntAllocator > VectorInt
ublas::vector< FEDofEntity *, DofsAllocator > VectorDofs
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
FieldApproximationBase
approximation base
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
virtual MPI_Comm & get_comm() const =0
boost::ptr_vector< UserDataOperator > opPtrVector
Vector of finite element users data operators.
static UId getHiLocalEntityBitNumber(const char bit_number, const EntityHandle ent)
std::vector< boost::weak_ptr< FieldEntity > > FieldEntity_vector_view
boost::function< MoFEMErrorCode()> preProcessHook
Hook function for pre-processing.
ForcesAndSourcesCore(Interface &m_field)
auto & getRowFieldEnts() const
DataForcesAndSourcesCore & dataHdiv
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
MoFEMErrorCode getEntityIndices(DataForcesAndSourcesCore &data, const std::string &field_name, FieldEntity_vector_view &ents_field, const EntityType type_lo, const EntityType type_hi, EXTRACTOR &&extractor) const
@ HDIV
field with continuous normal traction
ublas::vector< double, DoubleAllocator > VectorDouble
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
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
MoFEMErrorCode getEntityRowIndices(DataForcesAndSourcesCore &data, const std::string &field_name, const EntityType type_lo=MBVERTEX, const EntityType type_hi=MBPOLYHEDRON) const
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
const double r
rate factor
std::string feName
Name of finite element.
@ NOFIELD
scalar or vector of scalars describe (no true field)
RuleHookFun setRuleHook
Set function to calculate integration rule.