v0.13.1
Classes | Typedefs | Functions | Variables
hanging_node_approx.cpp File Reference
#include <MoFEM.hpp>

Go to the source code of this file.

Classes

struct  ElementsAndOps< DIM >
 
struct  ElementsAndOps< 2 >
 
struct  ElementsAndOps< 3 >
 
struct  ApproxFieldFunction< 1 >
 third order polynomial used for testing More...
 
struct  ApproxFieldFunctionDerivative< 1 >
 third order polynomial used for testing More...
 
struct  AtomTest
 
struct  AtomTest::CommonData
 Collected data use d by operator to evaluate errors for the test. More...
 
struct  AtomTest::OpError< 1 >
 
struct  AtomTest::OpErrorSkel< 1 >
 

Typedefs

using DomainEle = ElementsAndOps< SPACE_DIM >::DomainEle
 
using DomainParentEle = ElementsAndOps< SPACE_DIM >::DomianParentEle
 
using DomainEleOp = DomainEle::UserDataOperator
 
using BoundaryEle = ElementsAndOps< SPACE_DIM >::BoundaryEle
 
using BoundaryEleOp = BoundaryEle::UserDataOperator
 
using BoundaryParentEle = ElementsAndOps< SPACE_DIM >::BoundaryParentEle
 
using EntData = EntitiesFieldData::EntData
 
using OpDomainMass = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, FIELD_DIM >
 evaluate mass matrix More...
 
using OpDomainSource = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, FIELD_DIM >
 evaluate source, i.e. rhs vector More...
 

Functions

template<typename PARENT_FE >
auto set_parent_dofs (MoFEM::Interface &m_field, boost::shared_ptr< FEMethod > &fe_top, ForcesAndSourcesCore::UserDataOperator::OpType op, int verbosity, LogManager::SeverityLevel sev)
 set levels of projection operators, which project field data from parent entities, to child, up to to level, i.e. last mesh refinement. More...
 
int main (int argc, char *argv[])
 

Variables

static char help [] = "...\n\n"
 
constexpr char FIELD_NAME [] = "U"
 
constexpr int FIELD_DIM = 1
 
constexpr int SPACE_DIM = 2
 
constexpr int nb_ref_levels = 3
 Three levels of refinement. More...
 
auto bit = [](auto l) { return BitRefLevel().set(l); }
 set bit More...
 
auto marker
 set bit to marker More...
 
auto test_bit_child
 lambda function used to select elements on which finite element pipelines are executed. More...
 

Typedef Documentation

◆ BoundaryEle

Definition at line 52 of file hanging_node_approx.cpp.

◆ BoundaryEleOp

Definition at line 53 of file hanging_node_approx.cpp.

◆ BoundaryParentEle

Definition at line 54 of file hanging_node_approx.cpp.

◆ DomainEle

Definition at line 49 of file hanging_node_approx.cpp.

◆ DomainEleOp

Definition at line 51 of file hanging_node_approx.cpp.

◆ DomainParentEle

Definition at line 50 of file hanging_node_approx.cpp.

◆ EntData

Examples
hanging_node_approx.cpp.

Definition at line 56 of file hanging_node_approx.cpp.

◆ OpDomainMass

evaluate mass matrix

Examples
hanging_node_approx.cpp.

Definition at line 88 of file hanging_node_approx.cpp.

◆ OpDomainSource

using OpDomainSource = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpSource<1, FIELD_DIM>

evaluate source, i.e. rhs vector

Examples
hanging_node_approx.cpp.

Definition at line 95 of file hanging_node_approx.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)
Examples
hanging_node_approx.cpp.

Definition at line 775 of file hanging_node_approx.cpp.

775 {
776
777 // Initialisation of MoFEM/PETSc and MOAB data structures
778 MoFEM::Core::Initialize(&argc, &argv, NULL, help);
779
780 try {
781
782 //! [Register MoFEM discrete manager in PETSc]
783 DMType dm_name = "DMMOFEM";
784 CHKERR DMRegister_MoFEM(dm_name);
785 //! [Register MoFEM discrete manager in PETSc
786
787 //! [Create MoAB]
788 moab::Core mb_instance; ///< mesh database
789 moab::Interface &moab = mb_instance; ///< mesh database interface
790 //! [Create MoAB]
791
792 //! [Create MoFEM]
793 MoFEM::Core core(moab); ///< finite element database
794 MoFEM::Interface &m_field = core; ///< finite element database insterface
795 //! [Create MoFEM]
796
797 //! [AtomTest]
798 AtomTest ex(m_field);
799 CHKERR ex.runProblem();
800 //! [AtomTest]
801 }
803
805}
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:385
#define CHKERR
Inline error check.
Definition: definitions.h:548
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMMoFEM.cpp:59
static char help[]
CoreTmp< 0 > Core
Definition: Core.hpp:1096
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1965
Core (interface) class.
Definition: Core.hpp:92
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition: Core.cpp:85
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:125
Deprecated interface functions.

◆ set_parent_dofs()

template<typename PARENT_FE >
auto set_parent_dofs ( MoFEM::Interface m_field,
boost::shared_ptr< FEMethod > &  fe_top,
ForcesAndSourcesCore::UserDataOperator::OpType  op,
int  verbosity,
LogManager::SeverityLevel  sev 
)

set levels of projection operators, which project field data from parent entities, to child, up to to level, i.e. last mesh refinement.

Examples
hanging_node_approx.cpp, and poisson_2d_homogeneous.cpp.

Definition at line 119 of file hanging_node_approx.cpp.

122 {
123
124 auto jac_ptr = boost::make_shared<MatrixDouble>();
125 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
126 auto det_ptr = boost::make_shared<VectorDouble>();
127
128 BitRefLevel bit_marker;
129 for (auto l = 1; l <= nb_ref_levels; ++l)
130 bit_marker |= marker(l);
131
132 boost::function<void(boost::shared_ptr<ForcesAndSourcesCore>, int)>
133 add_parent_level =
134 [&](boost::shared_ptr<ForcesAndSourcesCore> parent_fe_pt, int level) {
135 if (level > 0) {
136
137 auto fe_ptr_current = boost::shared_ptr<ForcesAndSourcesCore>(
138 new PARENT_FE(m_field));
139 if (op == DomainEleOp::OPSPACE) {
140 if (typeid(PARENT_FE) == typeid(DomainParentEle)) {
141 fe_ptr_current->getOpPtrVector().push_back(
142 new OpCalculateHOJac<2>(jac_ptr));
143 fe_ptr_current->getOpPtrVector().push_back(
144 new OpInvertMatrix<2>(jac_ptr, det_ptr, inv_jac_ptr));
145 fe_ptr_current->getOpPtrVector().push_back(
146 new OpSetHOInvJacToScalarBases<2>(H1, inv_jac_ptr));
147 }
148 }
149
150 add_parent_level(
151 boost::dynamic_pointer_cast<ForcesAndSourcesCore>(
152 fe_ptr_current),
153 level - 1);
154
155 if (op == DomainEleOp::OPSPACE) {
156
157 parent_fe_pt->getOpPtrVector().push_back(
158
160
161 H1, op, fe_ptr_current,
162
163 BitRefLevel().set(), bit(0).flip(),
164
165 bit_marker, BitRefLevel().set(),
166
167 verbosity, sev));
168
169 } else {
170
171 parent_fe_pt->getOpPtrVector().push_back(
172
174
175 FIELD_NAME, op, fe_ptr_current,
176
177 BitRefLevel().set(), bit(0).flip(),
178
179 bit_marker, BitRefLevel().set(),
180
181 verbosity, sev));
182 }
183 }
184 };
185
186 add_parent_level(boost::dynamic_pointer_cast<ForcesAndSourcesCore>(fe_top),
188};
ElementsAndOps< SPACE_DIM >::DomianParentEle DomainParentEle
@ H1
continuous field
Definition: definitions.h:98
auto marker
set bit to marker
constexpr int nb_ref_levels
Three levels of refinement.
constexpr char FIELD_NAME[]
auto bit
set bit
FTensor::Index< 'l', 3 > l
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
@ OPSPACE
operator do Work is execute on space data
Operator to project base functions from parent entity.

Variable Documentation

◆ bit

auto bit = [](auto l) { return BitRefLevel().set(l); }

◆ FIELD_DIM

constexpr int FIELD_DIM = 1
constexpr
Examples
hanging_node_approx.cpp.

Definition at line 29 of file hanging_node_approx.cpp.

◆ FIELD_NAME

constexpr char FIELD_NAME[] = "U"
constexpr
Examples
hanging_node_approx.cpp.

Definition at line 28 of file hanging_node_approx.cpp.

◆ help

char help[] = "...\n\n"
static
Examples
hanging_node_approx.cpp.

Definition at line 26 of file hanging_node_approx.cpp.

◆ marker

auto marker
Initial value:
= [](auto l) {
return BitRefLevel().set(BITREFLEVEL_SIZE - 1 - l);
}
#define BITREFLEVEL_SIZE
max number of refinements
Definition: definitions.h:232

set bit to marker

Marker is used to mark field entities on skin on which we have hanging nodes

Examples
boundary_marker.cpp, and hanging_node_approx.cpp.

Definition at line 109 of file hanging_node_approx.cpp.

◆ nb_ref_levels

constexpr int nb_ref_levels = 3
constexpr

Three levels of refinement.

Examples
hanging_node_approx.cpp, and poisson_2d_homogeneous.cpp.

Definition at line 31 of file hanging_node_approx.cpp.

◆ SPACE_DIM

constexpr int SPACE_DIM = 2
constexpr
Examples
hanging_node_approx.cpp.

Definition at line 30 of file hanging_node_approx.cpp.

◆ test_bit_child

auto test_bit_child
Initial value:
= [](FEMethod *fe_ptr) {
return fe_ptr->numeredEntFiniteElementPtr->getBitRefLevel().test(
}
structure for User Loop Methods on finite elements

lambda function used to select elements on which finite element pipelines are executed.

Note
childs elements on pipeline, retrive data from parents using operators pushed by set_parent_dofs
Examples
child_and_parent.cpp, hanging_node_approx.cpp, and poisson_2d_homogeneous.cpp.

Definition at line 198 of file hanging_node_approx.cpp.