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);
82 boost::shared_ptr<ForcesAndSourcesCore> parent_ele_ptr,
86 Sev sev = Sev::noisy);
102 boost::shared_ptr<ForcesAndSourcesCore> parent_ele_ptr,
106 Sev sev = Sev::noisy);
109 const bool error_if_no_base =
false);
157 std::vector<EntityHandle> &adjacency) {
160 static_assert(DIM >= 0 && DIM <= 3,
"DIM is out of scope");
167 auto th_parent_handle = basic_entity_data_ptr->th_RefParentHandle;
168 auto th_bit_level = basic_entity_data_ptr->th_RefBitLevel;
170 std::vector<EntityHandle> parents;
181 adjacency.insert(adjacency.end(),
adjTmp.begin(),
adjTmp.end());
183 std::sort(adjacency.begin(), adjacency.end());
184 auto it = std::unique(adjacency.begin(), adjacency.end());
185 adjacency.resize(std::distance(adjacency.begin(), it));
187 for (
auto e : adjacency) {
189 if (side_table.find(e) == side_table.end())
191 .insert(boost::shared_ptr<SideNumber>(
new SideNumber(e, -1, 0, 0)));
199 moab::Interface &moab, Tag th_parent_handle,
203 auto check = [](
auto &b,
auto &
m,
auto &
bit) {
204 return ((
bit & b).any()) && ((
bit &
m) ==
bit);
208 CHKERR moab.tag_get_data(th_bit_level, &fe, 1, &bit_fe);
219 std::vector<EntityHandle> &parents) {
223 CHKERR moab.tag_get_data(th_parent_handle, &fe, 1, &fe_parent);
227 CHKERR moab.tag_get_data(th_bit_level, &fe_parent, 1, &bit_parent);
229 if ((fe_parent != 0) && (fe_parent != fe) &&
230 (parent_type == back_type)) {
231 parents.push_back(fe_parent);
232 CHKERR get_parent(parents.back(), parents);
238 CHKERR get_parent(fe, parents);
244 moab::Interface &moab,
245 std::vector<EntityHandle> &parents,
246 std::vector<EntityHandle> &adjacency) {
251 for (
int i = 0;
i != parents.size(); ++
i)
252 CHKERR moab.get_connectivity(&*parents.begin(), parents.size(),
255 if constexpr (DIM >= 1)
256 for (
auto fe_ent : parents)
257 CHKERR moab.get_adjacencies(&fe_ent, 1, 1,
false, adjacency,
258 moab::Interface::UNION);
260 if constexpr (DIM == 2)
261 for (
auto fe_ent : parents)
262 CHKERR moab.get_adjacencies(&fe_ent, 1, 2,
false, adjacency,
263 moab::Interface::UNION);
265 for (
auto fe_ent : parents)
266 adjacency.push_back(fe_ent);
270 "this field is not implemented for face finite element");
273 if (adjacency.size()) {
274 std::sort(adjacency.begin(), adjacency.end());
275 auto it = std::unique(adjacency.begin(), adjacency.end());
276 adjacency.resize(std::distance(adjacency.begin(), it));
285 std::vector<EntityHandle> &adjacency) {
287 if constexpr (DIM == 3)
289 if constexpr (DIM == 2)
291 else if constexpr (DIM == 1)
293 else if constexpr (DIM == 0)
321 bit_ent, bit_ent_mask) {}
338 std::vector<EntityHandle> &adjacency) {
346 const auto fe_ent = fe.
getEnt();
348 CHKERR moab.get_adjacencies(&fe_ent, 1, DIM + 1,
false,
351 std::vector<EntityHandle> parents;
355 auto th_parent_handle = basic_entity_data_ptr->th_RefParentHandle;
356 auto th_bit_level = basic_entity_data_ptr->th_RefBitLevel;
370 std::sort(adjacency.begin(), adjacency.end());
371 auto it = std::unique(adjacency.begin(), adjacency.end());
372 adjacency.resize(std::distance(adjacency.begin(), it));
374 for (
auto e : adjacency) {
376 if (side_table.find(e) == side_table.end())
379 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.
FTensor::Index< 'i', SPACE_DIM > i
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