6#ifndef __MESH_PROJECTION_DATA_OPERATORS_HPP__
7#define __MESH_PROJECTION_DATA_OPERATORS_HPP__
37 OpRunParent(boost::shared_ptr<ForcesAndSourcesCore> parent_ele_ptr,
39 boost::shared_ptr<ForcesAndSourcesCore> this_ele_ptr,
41 Sev sev = Sev::noisy);
81 boost::shared_ptr<ForcesAndSourcesCore> parent_ele_ptr,
85 Sev sev = Sev::noisy);
101 boost::shared_ptr<ForcesAndSourcesCore> parent_ele_ptr,
105 Sev sev = Sev::noisy);
108 const bool error_if_no_base =
false);
156 std::vector<EntityHandle> &adjacency) {
159 static_assert(DIM >= 0 && DIM <= 3,
"DIM is out of scope");
166 auto th_parent_handle = basic_entity_data_ptr->th_RefParentHandle;
167 auto th_bit_level = basic_entity_data_ptr->th_RefBitLevel;
169 std::vector<EntityHandle> parents;
180 adjacency.insert(adjacency.end(),
adjTmp.begin(),
adjTmp.end());
182 std::sort(adjacency.begin(), adjacency.end());
183 auto it = std::unique(adjacency.begin(), adjacency.end());
184 adjacency.resize(std::distance(adjacency.begin(), it));
186 for (
auto e : adjacency) {
188 if (side_table.find(e) == side_table.end())
190 .insert(boost::shared_ptr<SideNumber>(
new SideNumber(e, -1, 0, 0)));
198 moab::Interface &moab, Tag th_parent_handle,
202 auto check = [](
auto &b,
auto &
m,
auto &
bit) {
203 return ((
bit & b).any()) && ((
bit &
m) ==
bit);
207 CHKERR moab.tag_get_data(th_bit_level, &fe, 1, &bit_fe);
218 std::vector<EntityHandle> &parents) {
222 CHKERR moab.tag_get_data(th_parent_handle, &fe, 1, &fe_parent);
226 CHKERR moab.tag_get_data(th_bit_level, &fe_parent, 1, &bit_parent);
228 if ((fe_parent != 0) && (fe_parent != fe) &&
229 (parent_type == back_type)) {
230 parents.push_back(fe_parent);
231 CHKERR get_parent(parents.back(), parents);
237 CHKERR get_parent(fe, parents);
243 moab::Interface &moab,
244 std::vector<EntityHandle> &parents,
245 std::vector<EntityHandle> &adjacency) {
250 for (
auto fe_ent : parents)
251 CHKERR moab.get_connectivity(&*parents.begin(), parents.size(),
254 if constexpr (DIM >= 1)
255 for (
auto fe_ent : parents)
256 CHKERR moab.get_adjacencies(&fe_ent, 1, 1,
false, adjacency,
257 moab::Interface::UNION);
259 if constexpr (DIM == 2)
260 for (
auto fe_ent : parents)
261 CHKERR moab.get_adjacencies(&fe_ent, 1, 2,
false, adjacency,
262 moab::Interface::UNION);
264 for (
auto fe_ent : parents)
265 adjacency.push_back(fe_ent);
269 "this field is not implemented for face finite element");
272 if (adjacency.size()) {
273 std::sort(adjacency.begin(), adjacency.end());
274 auto it = std::unique(adjacency.begin(), adjacency.end());
275 adjacency.resize(std::distance(adjacency.begin(), it));
284 std::vector<EntityHandle> &adjacency) {
286 if constexpr (DIM == 3)
288 if constexpr (DIM == 2)
290 else if constexpr (DIM == 1)
292 else if constexpr (DIM == 0)
320 bit_ent, bit_ent_mask) {}
337 std::vector<EntityHandle> &adjacency) {
345 const auto fe_ent = fe.
getEnt();
347 CHKERR moab.get_adjacencies(&fe_ent, 1, DIM + 1,
false,
350 std::vector<EntityHandle> parents;
354 auto th_parent_handle = basic_entity_data_ptr->th_RefParentHandle;
355 auto th_bit_level = basic_entity_data_ptr->th_RefBitLevel;
369 std::sort(adjacency.begin(), adjacency.end());
370 auto it = std::unique(adjacency.begin(), adjacency.end());
371 adjacency.resize(std::distance(adjacency.begin(), it));
373 for (
auto e : adjacency) {
375 if (side_table.find(e) == side_table.end())
378 boost::shared_ptr<SideNumber>(
new SideNumber(e, -1, 0, 0)));
#define BITREFLEVEL_SIZE
max number of refinements
FieldSpace
approximation spaces
@ L2
field with C-1 continuity
@ NOFIELD
scalar or vector of scalars describe (no true field)
@ HCURL
field with continuous tangents
@ HDIV
field with continuous normal traction
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'm', SPACE_DIM > m
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, signed char, &SideNumber::side_number > > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
SeverityLevel
Severity levels.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
implementation of Data Operators for Forces and Sources
auto type_from_handle(const EntityHandle h)
get type from entity handle
constexpr auto field_name
static MoFEMErrorCode defaultVertex(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
static MoFEMErrorCode defaultVolume(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
static MoFEMErrorCode defaultEdge(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
static MoFEMErrorCode defaultFace(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
Finite element data for entity.
Data on single entity (This is passed as argument to DataOperator::doWork)
data structure for finite element entity
Provide data structure for (tensor) field approximation.
FieldSpace getSpace() const
Get field approximation space.
OpType
Controls loop over entities on element.
Operator to project base functions from parent entity to child.
const BitRefLevel bitParentEntMask
const BitRefLevel bitParentEnt
MoFEMErrorCode opRhs(EntitiesFieldData &data, const bool error_if_no_base=false)
const BitRefLevel bitChildMask
boost::ptr_deque< EntitiesFieldData::EntData > poolEntsVector
boost::shared_ptr< ForcesAndSourcesCore > parentElePtr
const BitRefLevel bitChild
Operator to execute finite element instance on parent element. This operator is typically used to pro...
const BitRefLevel bitThisMask
const BitRefLevel bitParent
boost::shared_ptr< ForcesAndSourcesCore > parentElePtr
boost::shared_ptr< ForcesAndSourcesCore > thisElePtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
const BitRefLevel bitParentMask
const BitRefLevel bitThis
Create adjacency to parent elements.
MoFEMErrorCode operator()(moab::Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
Function setting adjacencies to DOFs of parent element.
BitRefLevel bitParentMask
MoFEMErrorCode getParent(EntityHandle fe, std::vector< EntityHandle > &parents, moab::Interface &moab, Tag th_parent_handle, Tag th_bit_level)
std::vector< EntityHandle > adjTmp
MoFEMErrorCode getParentsAdjacencies(const Field &field, moab::Interface &moab, std::vector< EntityHandle > &parents, std::vector< EntityHandle > &adjacency)
ParentFiniteElementAdjacencyFunction(BitRefLevel bit_parent, BitRefLevel bit_parent_mask, BitRefLevel bit_ent, BitRefLevel bit_ent_mask)
MoFEMErrorCode getDefaultAdjacencies(moab::Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
Create adjacency to parent skeleton elements.
std::vector< EntityHandle > brideAdjacencyEdge
ParentFiniteElementAdjacencyFunctionSkeleton(BitRefLevel bit_parent, BitRefLevel bit_parent_mask, BitRefLevel bit_ent, BitRefLevel bit_ent_mask)
MoFEMErrorCode operator()(moab::Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
Function setting adjacencies to DOFs of parent element.
keeps information about side number for the finite element
SideNumber_multiIndex & getSideNumberTable() const
const boost::shared_ptr< BasicEntityData > getBasicDataPtr() const
EntityHandle getEnt() const