v0.16.0
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
test_broken_space.cpp File Reference
#include <MoFEM.hpp>
#include <FormsBrokenSpaceConstraintImpl.hpp>

Go to the source code of this file.

Classes

struct  SetUpSchur
 [Push operators to pipeline] More...
 
struct  SetUpSchurImpl
 

Typedefs

using DomainEle = PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::DomainEle
 
using BoundaryEle = PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::BoundaryEle
 
using EleOnSide = PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::FaceSideEle
 
using EntData = EntitiesFieldData::EntData
 
using DomainEleOp = DomainEle::UserDataOperator
 
using BdyEleOp = BoundaryEle::UserDataOperator
 
using SideEleOp = EleOnSide::UserDataOperator
 

Functions

int main (int argc, char *argv[])
 

Variables

static char help [] = "...\n\n"
 
constexpr bool debug = false
 
constexpr AssemblyType BlockAssemblyType
 
constexpr AssemblyType AT
 
constexpr IntegrationType IT
 
constexpr int SPACE_DIM
 
int approx_order = 1
 
int hybrid_approx_order = 0
 

Typedef Documentation

◆ BdyEleOp

Examples
mofem/atom_tests/test_broken_space.cpp.

Definition at line 41 of file test_broken_space.cpp.

◆ BoundaryEle

Definition at line 35 of file test_broken_space.cpp.

◆ DomainEle

Definition at line 34 of file test_broken_space.cpp.

◆ DomainEleOp

Definition at line 40 of file test_broken_space.cpp.

◆ EleOnSide

Definition at line 37 of file test_broken_space.cpp.

◆ EntData

Definition at line 39 of file test_broken_space.cpp.

◆ SideEleOp

Definition at line 42 of file test_broken_space.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

[Register MoFEM discrete manager in PETSc]

[Register MoFEM discrete manager in PETSc

Definition at line 57 of file test_broken_space.cpp.

57 {
58
59 MoFEM::Core::Initialize(&argc, &argv, (char *)0, help);
60
61 try {
62
63 //! [Register MoFEM discrete manager in PETSc]
64 DMType dm_name = "DMMOFEM";
65 CHKERR DMRegister_MoFEM(dm_name);
66 DMType dm_name_mg = "DMMOFEM_MG";
68 //! [Register MoFEM discrete manager in PETSc
69
70 moab::Core mb_instance;
71 moab::Interface &moab = mb_instance;
72
73 // Add logging channel for example
74 auto core_log = logging::core::get();
75 core_log->add_sink(
77 core_log->add_sink(
80 LogManager::setLog("TIMER");
81 MOFEM_LOG_TAG("AT", "atom_test");
82 MOFEM_LOG_TAG("TIMER", "timer");
83
84 // Create MoFEM instance
85 MoFEM::Core core(moab);
86 MoFEM::Interface &m_field = core;
87
88 auto *simple = m_field.getInterface<Simple>();
90 simple->getAddBoundaryFE() = true;
91 CHKERR simple->loadFile();
92
93 auto add_shared_entities_on_skeleton = [&]() {
95 auto boundary_meshset = simple->getBoundaryMeshSet();
96 auto skeleton_meshset = simple->getSkeletonMeshSet();
97 Range bdy_ents;
98 CHKERR m_field.get_moab().get_entities_by_handle(boundary_meshset,
99 bdy_ents, true);
100 Range skeleton_ents;
101 CHKERR m_field.get_moab().get_entities_by_dimension(
102 0, simple->getDim() - 1, skeleton_ents, true);
103 skeleton_ents = subtract(skeleton_ents, bdy_ents);
104 CHKERR m_field.get_moab().clear_meshset(&skeleton_meshset, 1);
105 CHKERR m_field.get_moab().add_entities(skeleton_meshset, skeleton_ents);
107 };
108
109 CHKERR add_shared_entities_on_skeleton();
110
111 // Declare elements
112 enum bases {
113 AINSWORTH,
114 AINSWORTH_LOBATTO,
115 DEMKOWICZ,
116 BERNSTEIN,
117 LASBASETOP
118 };
119 const char *list_bases[] = {"ainsworth", "ainsworth_lobatto", "demkowicz",
120 "bernstein"};
121 PetscBool flg;
122 PetscInt choice_base_value = AINSWORTH;
123 CHKERR PetscOptionsGetEList(PETSC_NULLPTR, NULL, "-base", list_bases,
124 LASBASETOP, &choice_base_value, &flg);
125
126 if (flg != PETSC_TRUE)
127 SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "base not set");
129 if (choice_base_value == AINSWORTH)
131 if (choice_base_value == AINSWORTH_LOBATTO)
133 else if (choice_base_value == DEMKOWICZ)
135 else if (choice_base_value == BERNSTEIN)
137
138 enum spaces { hdiv, hcurl, last_space };
139 const char *list_spaces[] = {"hdiv", "hcurl"};
140 PetscInt choice_space_value = hdiv;
141 CHKERR PetscOptionsGetEList(PETSC_NULLPTR, NULL, "-space", list_spaces,
142 last_space, &choice_space_value, &flg);
143 if (flg != PETSC_TRUE)
144 SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "space not set");
145 FieldSpace space = HDIV;
146 if (choice_space_value == hdiv)
147 space = HDIV;
148 else if (choice_space_value == hcurl)
149 space = HCURL;
150
151 CHKERR PetscOptionsGetInt(PETSC_NULLPTR, "", "-order", &approx_order,
152 PETSC_NULLPTR);
153
154 CHKERR simple->addDomainBrokenField("BROKEN", space, base, 1);
155 CHKERR simple->addDomainField("U", L2, base, 1);
156 CHKERR simple->addSkeletonField("HYBRID", L2, base, 1);
157
158 const auto u_order = approx_order - 1;
160 (space == HDIV &&
164 : u_order;
165
166 CHKERR simple->setFieldOrder("BROKEN", approx_order);
167 CHKERR simple->setFieldOrder("U", u_order);
168 CHKERR simple->setFieldOrder("HYBRID", hybrid_approx_order);
169
170 CHKERR simple->setUp();
171
172 auto bc_mng = m_field.getInterface<BcManager>();
173 CHKERR bc_mng->removeSideDOFs(simple->getProblemName(), "ZERO_FLUX",
174 "BROKEN", SPACE_DIM, 0, 1, true);
175
176 auto integration_rule = [](int, int, int p) { return 2 * p; };
177
178 auto assemble_domain_lhs = [&](auto &pip) {
181
185 IT>::OpMixDivTimesScalar<SPACE_DIM>;
186
187 auto beta = [](const double, const double, const double) constexpr {
188 return 1;
189 };
190
191 pip.push_back(new OpHdivHdiv("BROKEN", "BROKEN", beta));
192 auto unity = []() constexpr { return 1; };
193 pip.push_back(new OpHdivU("BROKEN", "U", unity, true));
194
195 // First: Iterate over skeleton FEs adjacent to Domain FEs
196 // Note: BoundaryEle, i.e. uses skeleton interation rule
197 auto op_loop_skeleton_side = new OpLoopSide<BoundaryEle>(
198 m_field, simple->getSkeletonFEName(), SPACE_DIM - 1, Sev::noisy);
199 op_loop_skeleton_side->getSideFEPtr()->getRuleHook = integration_rule;
201 op_loop_skeleton_side->getOpPtrVector(), {});
202
203 // Second: Iterate over domain FEs adjacent to skelton, particularly one
204 // domain element.
205 auto broken_data_ptr =
206 boost::make_shared<std::vector<BrokenBaseSideData>>();
207 // Note: EleOnSide, i.e. uses on domain projected skeleton rule
208 auto op_loop_domain_side = new OpBrokenLoopSide<EleOnSide>(
209 m_field, simple->getDomainFEName(), SPACE_DIM, Sev::noisy);
211 op_loop_domain_side->getOpPtrVector(), {HDIV});
212 op_loop_domain_side->getOpPtrVector().push_back(
213 new OpGetBrokenBaseSideData<SideEleOp>("BROKEN", broken_data_ptr));
214
215 op_loop_skeleton_side->getOpPtrVector().push_back(op_loop_domain_side);
217 IT>::OpBrokenSpaceConstrain<1>;
218 op_loop_skeleton_side->getOpPtrVector().push_back(
219 new OpC("HYBRID", broken_data_ptr, 1., true, false));
220
221 if (debug) {
222 // print skeleton elements on partition
223 constexpr int partition = 1;
224 auto op_print = new BdyEleOp(NOSPACE, BdyEleOp::OPSPACE);
225 op_print->doWorkRhsHook = [&](DataOperator *base_op_ptr, int side,
226 EntityType type,
229 if (auto op_ptr = dynamic_cast<BdyEleOp *>(base_op_ptr)) {
230 auto fe_method = op_ptr->getFEMethod();
231 auto num_fe = fe_method->numeredEntFiniteElementPtr;
232
233 if (m_field.get_comm_rank() == partition) {
234 if (num_fe->getPStatus() & PSTATUS_SHARED)
235 MOFEM_LOG("SELF", Sev::inform) << "Num FE: " << *num_fe;
236 }
237 }
239 };
240 op_loop_skeleton_side->getOpPtrVector().push_back(op_print);
241 };
242
243 pip.push_back(op_loop_skeleton_side);
244
246 };
247
248 auto assemble_domain_rhs = [&](auto &pip) {
253 auto source = [&](const double x, const double y,
254 const double z) constexpr {
255 return -1; // sin(100 * (x / 10.) * M_PI_2);
256 };
257 pip.push_back(new OpDomainSource("U", source));
259 };
260
261 auto *pip_mng = m_field.getInterface<PipelineManager>();
262
263 CHKERR assemble_domain_lhs(pip_mng->getOpDomainLhsPipeline());
264 CHKERR assemble_domain_rhs(pip_mng->getOpDomainRhsPipeline());
265
266 CHKERR pip_mng->setDomainLhsIntegrationRule(integration_rule);
267 CHKERR pip_mng->setDomainRhsIntegrationRule(integration_rule);
268 CHKERR pip_mng->setSkeletonLhsIntegrationRule(integration_rule);
269 CHKERR pip_mng->setSkeletonRhsIntegrationRule(integration_rule);
270
271 TetPolynomialBase::switchCacheBaseOn<HDIV>(
272 {pip_mng->getDomainLhsFE().get(), pip_mng->getDomainRhsFE().get()});
273 TetPolynomialBase::switchCacheBaseOn<L2>(
274 {pip_mng->getDomainLhsFE().get(), pip_mng->getDomainRhsFE().get()});
275
276 if (m_field.get_comm_rank() == 0)
278 "pipeline_manager_graph.dot", pip_mng);
279
280 auto x = createDMVector(simple->getDM());
281 auto f = vectorDuplicate(x);
282
283 if (AT == PETSC) {
284 auto ksp = pip_mng->createKSP();
285
286 CHKERR KSPSetFromOptions(ksp);
287 BOOST_LOG_SCOPED_THREAD_ATTR("Timeline", attrs::timer());
288 MOFEM_LOG("TIMER", Sev::inform) << "KSPSetUp";
289 CHKERR KSPSetUp(ksp);
290 MOFEM_LOG("TIMER", Sev::inform) << "KSPSetUp <= Done";
291
292 MOFEM_LOG("TIMER", Sev::inform) << "KSPSolve";
293 CHKERR KSPSolve(ksp, f, x);
294 MOFEM_LOG("TIMER", Sev::inform) << "KSPSolve <= Done";
295
296 CHKERR VecGhostUpdateBegin(x, INSERT_VALUES, SCATTER_FORWARD);
297 CHKERR VecGhostUpdateEnd(x, INSERT_VALUES, SCATTER_FORWARD);
298 CHKERR DMoFEMMeshToLocalVector(simple->getDM(), x, INSERT_VALUES,
299 SCATTER_REVERSE);
300
301 if (m_field.get_comm_rank() == 0) {
302 DM dm;
303 CHKERR KSPGetDM(ksp, &dm);
305 getDMKspCtx(dm).get(), "ksp_manager_graph.dot");
306 }
307
308 } else {
309 auto ksp = pip_mng->createKSP();
310 auto schur_ptr = SetUpSchur::createSetUpSchur(m_field);
311 BOOST_LOG_SCOPED_THREAD_ATTR("Timeline", attrs::timer());
312 MOFEM_LOG("TIMER", Sev::inform) << "KSPSetUp";
313 CHKERR schur_ptr->setUp(ksp);
314 MOFEM_LOG("TIMER", Sev::inform) << "KSPSetUp <= Done";
315
316 MOFEM_LOG("TIMER", Sev::inform) << "KSPSolve";
317 CHKERR KSPSolve(ksp, f, x);
318 MOFEM_LOG("TIMER", Sev::inform) << "KSPSolve <= Done";
319
320 CHKERR VecGhostUpdateBegin(x, INSERT_VALUES, SCATTER_FORWARD);
321 CHKERR VecGhostUpdateEnd(x, INSERT_VALUES, SCATTER_FORWARD);
322 CHKERR DMoFEMMeshToLocalVector(simple->getDM(), x, INSERT_VALUES,
323 SCATTER_REVERSE);
324
325 if (m_field.get_comm_rank() == 0) {
326 DM dm;
327 CHKERR KSPGetDM(ksp, &dm);
329 getDMKspCtx(dm).get(), "ksp_manager_graph.dot");
330 }
331
332 }
333
334 auto check_residual = [&](auto x, auto f) {
336 auto *simple = m_field.getInterface<Simple>();
337 auto *pip_mng = m_field.getInterface<PipelineManager>();
338
339 // auto &skeleton_rhs = pip_mng->getOpSkeletonRhsPipeline();
340 auto &domain_rhs = pip_mng->getOpDomainRhsPipeline();
341 // skeleton_rhs.clear();
342 domain_rhs.clear();
343
345
346 auto div_flux_ptr = boost::make_shared<VectorDouble>();
347 domain_rhs.push_back(new OpCalculateHdivVectorDivergence<3, SPACE_DIM>(
348 "BROKEN", div_flux_ptr));
351 auto beta = [](double, double, double) constexpr { return 1; };
352 domain_rhs.push_back(new OpUDivFlux("U", div_flux_ptr, beta));
353 auto source = [&](const double x, const double y,
354 const double z) constexpr { return 1; };
357 domain_rhs.push_back(new OpDomainSource("U", source));
358
360 IT>::OpMixDivTimesU<3, 1, SPACE_DIM>;
363 auto flux_ptr = boost::make_shared<MatrixDouble>();
364 domain_rhs.push_back(
365 new OpCalculateHVecVectorField<3>("BROKEN", flux_ptr));
366 boost::shared_ptr<VectorDouble> u_ptr =
367 boost::make_shared<VectorDouble>();
368 domain_rhs.push_back(new OpCalculateScalarFieldValues("U", u_ptr));
369 domain_rhs.push_back(new OpHDivH("BROKEN", u_ptr, beta));
370 domain_rhs.push_back(new OpHdivFlux("BROKEN", flux_ptr, beta));
371
372 // First: Iterate over skeleton FEs adjacent to Domain FEs
373 // Note: BoundaryEle, i.e. uses skeleton interation rule
374 auto op_loop_skeleton_side = new OpLoopSide<BoundaryEle>(
375 m_field, simple->getSkeletonFEName(), SPACE_DIM - 1, Sev::noisy);
376 op_loop_skeleton_side->getSideFEPtr()->getRuleHook = integration_rule;
378 op_loop_skeleton_side->getOpPtrVector(), {});
379
380 // Second: Iterate over domain FEs adjacent to skelton, particularly one
381 // domain element.
382 auto broken_data_ptr =
383 boost::make_shared<std::vector<BrokenBaseSideData>>();
384 // Note: EleOnSide, i.e. uses on domain projected skeleton rule
385 auto op_loop_domain_side = new OpBrokenLoopSide<EleOnSide>(
386 m_field, simple->getDomainFEName(), SPACE_DIM, Sev::noisy);
388 op_loop_domain_side->getOpPtrVector(), {HDIV});
389 op_loop_domain_side->getOpPtrVector().push_back(
390 new OpGetBrokenBaseSideData<SideEleOp>("BROKEN", broken_data_ptr));
391 auto flux_mat_ptr = boost::make_shared<MatrixDouble>();
392 op_loop_domain_side->getOpPtrVector().push_back(
393 new OpCalculateHVecTensorField<1, 3>("BROKEN", flux_mat_ptr));
394 op_loop_domain_side->getOpPtrVector().push_back(
395 new OpSetFlux<SideEleOp>(broken_data_ptr, flux_mat_ptr));
396
397 // Assemble on skeleton
398 op_loop_skeleton_side->getOpPtrVector().push_back(op_loop_domain_side);
400 IT>::OpBrokenSpaceConstrainDHybrid<1>;
402 IT>::OpBrokenSpaceConstrainDFlux<1>;
403 op_loop_skeleton_side->getOpPtrVector().push_back(
404 new OpC_dHybrid("HYBRID", broken_data_ptr, 1.));
405 auto hybrid_ptr = boost::make_shared<MatrixDouble>();
406 op_loop_skeleton_side->getOpPtrVector().push_back(
407 new OpCalculateVectorFieldValues<1>("HYBRID", hybrid_ptr));
408 op_loop_skeleton_side->getOpPtrVector().push_back(
409 new OpC_dBroken(broken_data_ptr, hybrid_ptr, 1.));
410
411 // Add skeleton to domain pipeline
412 domain_rhs.push_back(op_loop_skeleton_side);
413
414 CHKERR VecZeroEntries(f);
415 CHKERR VecGhostUpdateBegin(f, INSERT_VALUES, SCATTER_FORWARD);
416 CHKERR VecGhostUpdateEnd(f, INSERT_VALUES, SCATTER_FORWARD);
417
418 pip_mng->getDomainRhsFE()->f = f;
419 pip_mng->getSkeletonRhsFE()->f = f;
420 pip_mng->getDomainRhsFE()->x = x;
421 pip_mng->getSkeletonRhsFE()->x = x;
422
424 simple->getDomainFEName(),
425 pip_mng->getDomainRhsFE());
426
427 CHKERR VecGhostUpdateBegin(f, ADD_VALUES, SCATTER_REVERSE);
428 CHKERR VecGhostUpdateEnd(f, ADD_VALUES, SCATTER_REVERSE);
429 CHKERR VecAssemblyBegin(f);
430 CHKERR VecAssemblyEnd(f);
431
432 double fnrm;
433 CHKERR VecNorm(f, NORM_2, &fnrm);
434 MOFEM_LOG_C("AT", Sev::inform, "Residual %3.4e", fnrm);
435
436 constexpr double eps = 1e-8;
437 if (fnrm > eps)
438 SETERRQ(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID,
439 "Residual norm larger than accepted");
440
442 "domain_rhs_graph.dot", "OpDomainRhsPipeline",
443 pip_mng->getOpDomainRhsPipeline());
444
446 };
447
448 auto calculate_error = [&]() {
450
451 // auto &skeleton_rhs = pip_mng->getOpSkeletonRhsPipeline();
452 auto &domain_rhs = pip_mng->getOpDomainRhsPipeline();
453 // skeleton_rhs.clear();
454 domain_rhs.clear();
455
457
458 auto u_grad_ptr = boost::make_shared<MatrixDouble>();
459 auto flux_val_ptr = boost::make_shared<MatrixDouble>();
460 auto div_val_ptr = boost::make_shared<VectorDouble>();
461 auto source_ptr = boost::make_shared<VectorDouble>();
462
463 domain_rhs.push_back(
464 new OpCalculateScalarFieldGradient<SPACE_DIM>("U", u_grad_ptr));
465 domain_rhs.push_back(
466 new OpCalculateHVecVectorField<3, SPACE_DIM>("BROKEN", flux_val_ptr));
467 domain_rhs.push_back(new OpCalculateHdivVectorDivergence<3, SPACE_DIM>(
468 "BROKEN", div_val_ptr));
469 auto source = [&](const double x, const double y,
470 const double z) constexpr { return -1; };
471 domain_rhs.push_back(new OpGetTensor0fromFunc(source_ptr, source));
472
473 enum { DIV, GRAD, LAST };
474 auto mpi_vec = createVectorMPI(
475 m_field.get_comm(), (!m_field.get_comm_rank()) ? LAST : 0, LAST);
476 domain_rhs.push_back(
477 new OpCalcNormL2Tensor0(div_val_ptr, mpi_vec, DIV, source_ptr));
478 domain_rhs.push_back(new OpCalcNormL2Tensor1<SPACE_DIM>(
479 u_grad_ptr, mpi_vec, GRAD, flux_val_ptr));
480
482 simple->getDomainFEName(),
483 pip_mng->getDomainRhsFE());
484 CHKERR VecAssemblyBegin(mpi_vec);
485 CHKERR VecAssemblyEnd(mpi_vec);
486
487 if (!m_field.get_comm_rank()) {
488 const double *error_ind;
489 CHKERR VecGetArrayRead(mpi_vec, &error_ind);
490 MOFEM_LOG("AT", Sev::inform)
491 << "Approximation error ||div flux - source||: "
492 << std::sqrt(error_ind[DIV]);
493 MOFEM_LOG("AT", Sev::inform) << "Approximation error ||grad-flux||: "
494 << std::sqrt(error_ind[GRAD]);
495 CHKERR VecRestoreArrayRead(mpi_vec, &error_ind);
496 }
497
499 };
500
501 auto get_post_proc_fe = [&]() {
504 auto post_proc_fe = boost::make_shared<PostProcEle>(m_field);
505
506 auto op_loop_side = new OpLoopSide<EleOnSide>(
507 m_field, simple->getDomainFEName(), SPACE_DIM, Sev::noisy,
508 boost::make_shared<
510 post_proc_fe->getOpPtrVector().push_back(op_loop_side);
511
513 op_loop_side->getOpPtrVector(), {HDIV});
514 auto u_vec_ptr = boost::make_shared<VectorDouble>();
515 auto flux_mat_ptr = boost::make_shared<MatrixDouble>();
516 op_loop_side->getOpPtrVector().push_back(
517 new OpCalculateScalarFieldValues("U", u_vec_ptr));
518 op_loop_side->getOpPtrVector().push_back(
519 new OpCalculateHVecVectorField<3>("BROKEN", flux_mat_ptr));
520 op_loop_side->getOpPtrVector().push_back(
521
522 new OpPPMap(
523
524 post_proc_fe->getPostProcMesh(),
525
526 post_proc_fe->getMapGaussPts(),
527
528 {{"U", u_vec_ptr}},
529
530 {{"BROKEN", flux_mat_ptr}},
531
532 {}, {})
533
534 );
535
536 return post_proc_fe;
537 };
538
539 auto post_proc_fe = get_post_proc_fe();
541 simple->getBoundaryFEName(), post_proc_fe);
542 CHKERR post_proc_fe->writeFile("out_result.h5m");
543
544 CHKERR calculate_error();
545 CHKERR check_residual(x, f);
546 }
548
550}
std::string type
#define MOFEM_LOG_C(channel, severity, format,...)
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition acoustic.cpp:69
static const double eps
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, FIELD_DIM > OpDomainSource
#define CATCH_ERRORS
Catch errors.
FieldApproximationBase
approximation base
Definition definitions.h:58
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition definitions.h:60
@ AINSWORTH_LOBATTO_BASE
Definition definitions.h:62
@ DEMKOWICZ_JACOBI_BASE
Definition definitions.h:66
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
Definition definitions.h:64
FieldSpace
approximation spaces
Definition definitions.h:82
@ L2
field with C-1 continuity
Definition definitions.h:88
@ NOSPACE
Definition definitions.h:83
@ HCURL
field with continuous tangents
Definition definitions.h:86
@ HDIV
field with continuous normal traction
Definition definitions.h:87
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_IMPOSSIBLE_CASE
Definition definitions.h:35
@ MOFEM_ATOM_TEST_INVALID
Definition definitions.h:40
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
auto integration_rule
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode, RowColData rc=RowColData::COL)
set local (or ghosted) vector values on mesh for partition only
Definition DMMoFEM.cpp:514
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition DMMoFEM.cpp:43
MoFEMErrorCode DMRegister_MGViaApproxOrders(const char sname[])
Register DM for Multi-Grid via approximation orders.
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
Definition DMMoFEM.cpp:576
auto createDMVector(DM dm, RowColData rc=RowColData::COL)
Get smart vector from DM.
Definition DMMoFEM.hpp:1237
@ PETSC
Standard PETSc assembly.
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
MoFEMErrorCode removeSideDOFs(const std::string problem_name, const std::string block_name, const std::string field_name, int bridge_dim, int lo, int hi, bool is_distributed_mesh=true)
Remove DOFs on side entities from problem.
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMixDivTimesScalar< 2 > OpHdivU
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
SmartPetscObj< Vec > vectorDuplicate(Vec vec)
Create duplicate vector of smart vector.
auto createVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
auto getDMKspCtx(DM dm)
Get KSP context data structure used by DM.
Definition DMMoFEM.hpp:1251
PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 3, 3, 3 > OpHdivFlux
Integrating Rhs flux base (1/k) flux (FLUX)
Definition seepage.cpp:108
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpMixDivTimesU< 3, 1, SPACE_DIM > OpHDivH
Integrate Rhs div flux base times temperature (T)
Definition seepage.cpp:119
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 3, 3 > OpHdivHdiv
Integrate Lhs base of flux (1/k) base of flux (FLUX x FLUX)
Definition seepage.cpp:86
Add operators pushing bases from local to physical configuration.
Boundary condition manager for finite element problem setup.
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
Core (interface) class.
Definition Core.hpp:83
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:68
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:123
base operator to do operations at Gauss Pt. level
Deprecated interface functions.
Data on single entity (This is passed as argument to DataOperator::doWork)
std::map< EntityHandle, std::vector< boost::weak_ptr< NumeredEntFiniteElement > > > AdjCache
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
Operator for broken loop side.
Get norm of input VectorDouble for Tensor0.
Get norm of input MatrixDouble for Tensor1.
Calculate tenor field using vectorial base, i.e. Hdiv/Hcurl.
Get vector field for H-div approximation.
Calculate divergence of vector field.
Get field gradients at integration pts for scalar field rank 0, i.e. vector field.
Specialization for double precision scalar field values calculation.
Specialization for MatrixDouble vector field values calculation.
Get values from scalar function at integration points and save them to VectorDouble for Tensor0.
Element used to execute operators on side of the element.
Post post-proc data at points from hash maps.
static MoFEMErrorCode writeKSPGraphGraphviz(KspCtx *ksp_ctx, std::string filename)
KSP graph to Graphviz file.
static MoFEMErrorCode writeGraphGraphviz(std::string filename, std::string pip_name, const boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip)
Pipeline graph to Graphviz file.
static MoFEMErrorCode writePiplineManagerGraphGraphviz(std::string filename, PipelineManager *pip_mng)
Write pipeline manager graph to Graphviz file.
PipelineManager interface.
Simple interface for fast problem set-up.
Definition Simple.hpp:27
MoFEMErrorCode getOptions()
get options
Definition Simple.cpp:180
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
static boost::shared_ptr< SetUpSchur > createSetUpSchur(MoFEM::Interface &m_field)
constexpr AssemblyType AT
int approx_order
constexpr IntegrationType IT
static char help[]
constexpr int SPACE_DIM
constexpr bool debug
BoundaryEle::UserDataOperator BdyEleOp
int hybrid_approx_order

Variable Documentation

◆ approx_order

int approx_order = 1

Definition at line 54 of file test_broken_space.cpp.

◆ AT

constexpr AssemblyType AT
constexpr
Initial value:
=
AssemblyType
[Storage and set boundary conditions]
constexpr AssemblyType BlockAssemblyType
#define SCHUR_ASSEMBLE
Definition contact.cpp:18
Examples
mofem/atom_tests/test_broken_space.cpp, mofem/tutorials/adv-0_plasticity/plastic.cpp, plastic.cpp, thermo_elastic.cpp, and thermoplastic.cpp.

Definition at line 24 of file test_broken_space.cpp.

◆ BlockAssemblyType

constexpr AssemblyType BlockAssemblyType
constexpr
Initial value:
= (BLOCK_ASSEMBLE_SELECTION)
? AssemblyType::BLOCK_MAT
@ BLOCK_SCHUR
Block Schur assembly.
Examples
mofem/atom_tests/test_broken_space.cpp.

Definition at line 20 of file test_broken_space.cpp.

◆ debug

constexpr bool debug = false
constexpr

Definition at line 18 of file test_broken_space.cpp.

◆ help

char help[] = "...\n\n"
static

Definition at line 16 of file test_broken_space.cpp.

◆ hybrid_approx_order

int hybrid_approx_order = 0
Examples
mofem/atom_tests/test_broken_space.cpp.

Definition at line 55 of file test_broken_space.cpp.

◆ IT

constexpr IntegrationType IT
constexpr

◆ SPACE_DIM

constexpr int SPACE_DIM
constexpr
Initial value:
=
#define EXECUTABLE_DIMENSION
Definition plastic.cpp:13

Definition at line 31 of file test_broken_space.cpp.