v0.14.0
Loading...
Searching...
No Matches
seepage.cpp
Go to the documentation of this file.
1/**
2 * \file seepage.cpp
3 * \example seepage.cpp
4 *
5 * Hydromechanical problem
6 *
7 */
8
9/* This file is part of MoFEM.
10 * MoFEM is free software: you can redistribute it and/or modify it under
11 * the terms of the GNU Lesser General Public License as published by the
12 * Free Software Foundation, either version 3 of the License, or (at your
13 * option) any later version.
14 *
15 * MoFEM is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>. */
22
23#ifndef EXECUTABLE_DIMENSION
24#define EXECUTABLE_DIMENSION 2
25#endif
26
27#include <MoFEM.hpp>
28#include <MatrixFunction.hpp>
29#include <IntegrationRules.hpp>
30
31
32using namespace MoFEM;
33
34constexpr int SPACE_DIM =
35 EXECUTABLE_DIMENSION; //< Space dimension of problem, mesh
36
39using DomainEleOp = DomainEle::UserDataOperator;
42using BoundaryEleOp = BoundaryEle::UserDataOperator;
44
47
48//! [Only used with Hooke equation (linear material model)]
50 GAUSS>::OpGradSymTensorGrad<1, SPACE_DIM, SPACE_DIM, 0>;
53//! [Only used with Hooke equation (linear material model)]
54
55//! [Only used for dynamics]
60//! [Only used for dynamics]
61
62//! [Only used with Hencky/nonlinear material]
64 GAUSS>::OpGradTensorGrad<1, SPACE_DIM, SPACE_DIM, 1>;
67//! [Only used with Hencky/nonlinear material]
68
69//! [Essential boundary conditions]
76//! [Essential boundary conditions]
77
80
81// Thermal operators
82/**
83 * @brief Integrate Lhs base of flux (1/k) base of flux (FLUX x FLUX)
84 *
85 */
88
89/**
90 * @brief Integrate Lhs div of base of flux time base of temperature (FLUX x T)
91 * and transpose of it, i.e. (T x FLAX)
92 *
93 */
95 GAUSS>::OpMixDivTimesScalar<SPACE_DIM>;
96
97/**
98 * @brief Integrate Lhs base of temperature times (heat capacity) times base of
99 * temperature (T x T)
100 *
101 */
104
105/**
106 * @brief Integrating Rhs flux base (1/k) flux (FLUX)
107 */
109 GAUSS>::OpBaseTimesVector<3, 3, 1>;
110
111/**
112 * @brief Integrate Rhs div flux base times temperature (T)
113 *
114 */
116 GAUSS>::OpMixDivTimesU<3, 1, 2>;
117
118/**
119 * @brief Integrate Rhs base of temperature time heat capacity times heat rate
120 * (T)
121 *
122 */
124 GAUSS>::OpBaseTimesScalarField<1>;
125
126/**
127 * @brief Integrate Rhs base of temperature times divergent of flux (T)
128 *
129 */
131
132//! [Body and heat source]
141//! [Body and heat source]
142
143//! [Natural boundary conditions]
149//! [Natural boundary conditions]
150
151//! [Essential boundary conditions (Least square approach)]
154 GAUSS>::OpEssentialRhs<HeatFluxCubitBcData, 3, SPACE_DIM>;
157 GAUSS>::OpEssentialLhs<HeatFluxCubitBcData, 3, SPACE_DIM>;
158//! [Essential boundary conditions (Least square approach)]
159
160double scale = 1.;
161
163double default_poisson_ratio = 0.25; // zero for verification
165double fluid_density = 10;
166
167// #include <OpPostProcElastic.hpp>
168#include <SeepageOps.hpp>
169
170auto save_range = [](moab::Interface &moab, const std::string name,
171 const Range r) {
173 auto out_meshset = get_temp_meshset_ptr(moab);
174 CHKERR moab.add_entities(*out_meshset, r);
175 CHKERR moab.write_file(name.c_str(), "VTK", "", out_meshset->get_ptr(), 1);
177};
178
179struct Seepage {
180
181 Seepage(MoFEM::Interface &m_field) : mField(m_field) {}
182
184
185private:
187
193
194 PetscBool doEvalField;
195 std::array<double, SPACE_DIM> fieldEvalCoords;
196
197 std::tuple<SmartPetscObj<Vec>, SmartPetscObj<VecScatter>> uXScatter;
198 std::tuple<SmartPetscObj<Vec>, SmartPetscObj<VecScatter>> uYScatter;
199 std::tuple<SmartPetscObj<Vec>, SmartPetscObj<VecScatter>> uZScatter;
200
202 : public boost::enable_shared_from_this<BlockedParameters> {
205
206 inline auto getDPtr() {
207 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &mD);
208 }
209
210 inline auto getConductivityPtr() {
211 return boost::shared_ptr<double>(shared_from_this(), &fluidConductivity);
212 }
213 };
214
216 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
217 std::string block_elastic_name, std::string block_thermal_name,
218 boost::shared_ptr<BlockedParameters> blockedParamsPtr, Sev sev);
219};
220
222 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
223 std::string block_elastic_name, std::string block_thermal_name,
224 boost::shared_ptr<BlockedParameters> blockedParamsPtr, Sev sev) {
226
227 struct OpMatElasticBlocks : public DomainEleOp {
228 OpMatElasticBlocks(boost::shared_ptr<MatrixDouble> m, double bulk_modulus_K,
229 double shear_modulus_G, MoFEM::Interface &m_field,
230 Sev sev,
231 std::vector<const CubitMeshSets *> meshset_vec_ptr)
232 : DomainEleOp(NOSPACE, DomainEleOp::OPSPACE), matDPtr(m),
233 bulkModulusKDefault(bulk_modulus_K),
234 shearModulusGDefault(shear_modulus_G) {
235 CHK_THROW_MESSAGE(extractElasticBlockData(m_field, meshset_vec_ptr, sev),
236 "Can not get data from block");
237 }
238
239 MoFEMErrorCode doWork(int side, EntityType type,
242
243 for (auto &b : blockData) {
244
245 if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
246 CHKERR getMatDPtr(matDPtr, b.bulkModulusK, b.shearModulusG);
248 }
249 }
250
251 CHKERR getMatDPtr(matDPtr, bulkModulusKDefault, shearModulusGDefault);
253 }
254
255 private:
256 boost::shared_ptr<MatrixDouble> matDPtr;
257
258 struct BlockData {
259 double bulkModulusK;
260 double shearModulusG;
261 Range blockEnts;
262 };
263
264 double bulkModulusKDefault;
265 double shearModulusGDefault;
266 std::vector<BlockData> blockData;
267
269 extractElasticBlockData(MoFEM::Interface &m_field,
270 std::vector<const CubitMeshSets *> meshset_vec_ptr,
271 Sev sev) {
273
274 for (auto m : meshset_vec_ptr) {
275 MOFEM_TAG_AND_LOG("WORLD", sev, "Mat Elastic Block") << *m;
276 std::vector<double> block_data;
277 CHKERR m->getAttributes(block_data);
278 if (block_data.size() < 2) {
279 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
280 "Expected that block has two attributes");
281 }
282 auto get_block_ents = [&]() {
283 Range ents;
284 CHKERR
285 m_field.get_moab().get_entities_by_handle(m->meshset, ents, true);
286 return ents;
287 };
288
289 double young_modulus = block_data[0];
290 double poisson_ratio = block_data[1];
291 double bulk_modulus_K = young_modulus / (3 * (1 - 2 * poisson_ratio));
292 double shear_modulus_G = young_modulus / (2 * (1 + poisson_ratio));
293
294 MOFEM_TAG_AND_LOG("WORLD", sev, "Mat Elastic Block")
295 << m->getName() << ": E = " << young_modulus
296 << " nu = " << poisson_ratio;
297
298 blockData.push_back(
299 {bulk_modulus_K, shear_modulus_G, get_block_ents()});
300 }
301 MOFEM_LOG_CHANNEL("WORLD");
303 }
304
305 MoFEMErrorCode getMatDPtr(boost::shared_ptr<MatrixDouble> mat_D_ptr,
306 double bulk_modulus_K, double shear_modulus_G) {
308 //! [Calculate elasticity tensor]
309 auto set_material_stiffness = [&]() {
315 double A = (SPACE_DIM == 2)
316 ? 2 * shear_modulus_G /
317 (bulk_modulus_K + (4. / 3.) * shear_modulus_G)
318 : 1;
320 t_D(i, j, k, l) =
321 2 * shear_modulus_G * ((t_kd(i, k) ^ t_kd(j, l)) / 4.) +
322 A * (bulk_modulus_K - (2. / 3.) * shear_modulus_G) * t_kd(i, j) *
323 t_kd(k, l);
324 };
325 //! [Calculate elasticity tensor]
326 constexpr auto size_symm = (SPACE_DIM * (SPACE_DIM + 1)) / 2;
327 mat_D_ptr->resize(size_symm * size_symm, 1);
328 set_material_stiffness();
330 }
331 };
332
333 double default_bulk_modulus_K =
335 double default_shear_modulus_G =
337
338 pipeline.push_back(new OpMatElasticBlocks(
339 blockedParamsPtr->getDPtr(), default_bulk_modulus_K,
340 default_bulk_modulus_K, mField, sev,
341
342 // Get blockset using regular expression
344
345 (boost::format("%s(.*)") % block_elastic_name).str()
346
347 ))
348
349 ));
350
351 struct OpMatFluidBlocks : public DomainEleOp {
352 OpMatFluidBlocks(boost::shared_ptr<double> conductivity_ptr,
353 MoFEM::Interface &m_field, Sev sev,
354 std::vector<const CubitMeshSets *> meshset_vec_ptr)
355 : DomainEleOp(NOSPACE, DomainEleOp::OPSPACE),
356 conductivityPtr(conductivity_ptr) {
357 CHK_THROW_MESSAGE(extractThermalBlockData(m_field, meshset_vec_ptr, sev),
358 "Can not get data from block");
359 }
360
361 MoFEMErrorCode doWork(int side, EntityType type,
364
365 for (auto &b : blockData) {
366
367 if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
368 *conductivityPtr = b.conductivity;
370 }
371 }
372
373 *conductivityPtr = default_conductivity;
374
376 }
377
378 private:
379 struct BlockData {
380 double conductivity;
381 Range blockEnts;
382 };
383
384 std::vector<BlockData> blockData;
385
387 extractThermalBlockData(MoFEM::Interface &m_field,
388 std::vector<const CubitMeshSets *> meshset_vec_ptr,
389 Sev sev) {
391
392 for (auto m : meshset_vec_ptr) {
393 MOFEM_TAG_AND_LOG("WORLD", sev, "Mat Thermal Block") << *m;
394 std::vector<double> block_data;
395 CHKERR m->getAttributes(block_data);
396 if (block_data.size() < 1) {
397 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
398 "Expected that block has two attributes");
399 }
400 auto get_block_ents = [&]() {
401 Range ents;
402 CHKERR
403 m_field.get_moab().get_entities_by_handle(m->meshset, ents, true);
404 return ents;
405 };
406
407 MOFEM_TAG_AND_LOG("WORLD", sev, "Mat Thermal Block")
408 << m->getName() << ": conductivity = " << block_data[0];
409
410 blockData.push_back({block_data[0], get_block_ents()});
411 }
412 MOFEM_LOG_CHANNEL("WORLD");
414 }
415
416 boost::shared_ptr<double> expansionPtr;
417 boost::shared_ptr<double> conductivityPtr;
418 boost::shared_ptr<double> capacityPtr;
419 };
420
421 pipeline.push_back(new OpMatFluidBlocks(
422 blockedParamsPtr->getConductivityPtr(), mField, sev,
423
424 // Get blockset using regular expression
426
427 (boost::format("%s(.*)") % block_thermal_name).str()
428
429 ))
430
431 ));
432
434}
435
436//! [Run problem]
446//! [Run problem]
447
448//! [Set up problem]
452 // Add field
454 // Mechanical fields
455 CHKERR simple->addDomainField("U", H1, base, SPACE_DIM);
456 CHKERR simple->addBoundaryField("U", H1, base, SPACE_DIM);
457 // Temerature
458 const auto flux_space = (SPACE_DIM == 2) ? HCURL : HDIV;
459 CHKERR simple->addDomainField("H", L2, AINSWORTH_LEGENDRE_BASE, 1);
460 CHKERR simple->addDomainField("FLUX", flux_space, DEMKOWICZ_JACOBI_BASE, 1);
461 CHKERR simple->addBoundaryField("FLUX", flux_space, DEMKOWICZ_JACOBI_BASE, 1);
462
463 int order = 2.;
464 CHKERR PetscOptionsGetInt(PETSC_NULL, "", "-order", &order, PETSC_NULL);
465 CHKERR simple->setFieldOrder("U", order);
466 CHKERR simple->setFieldOrder("H", order - 1);
467 CHKERR simple->setFieldOrder("FLUX", order);
468
469 CHKERR simple->setUp();
470
472}
473//! [Set up problem]
474
475//! [Create common data]
478
479 auto get_command_line_parameters = [&]() {
481 CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-young_modulus",
482 &default_young_modulus, PETSC_NULL);
483 CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-poisson_ratio",
484 &default_poisson_ratio, PETSC_NULL);
485 CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-conductivity",
486 &default_conductivity, PETSC_NULL);
487 CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-fluid_density",
488 &fluid_density, PETSC_NULL);
489
490 MOFEM_LOG("Seepage", Sev::inform)
491 << "Default Young modulus " << default_young_modulus;
492 MOFEM_LOG("Seepage", Sev::inform)
493 << "Default Poisson ratio " << default_poisson_ratio;
494 MOFEM_LOG("Seepage", Sev::inform)
495 << "Default conductivity " << default_conductivity;
496 MOFEM_LOG("Seepage", Sev::inform) << "Fluid denisty " << fluid_density;
497
498 int coords_dim = SPACE_DIM;
499 CHKERR PetscOptionsGetRealArray(NULL, NULL, "-field_eval_coords",
500 fieldEvalCoords.data(), &coords_dim,
501 &doEvalField);
502
504 };
505
506 CHKERR get_command_line_parameters();
507
509}
510//! [Create common data]
511
512//! [Boundary condition]
515
516 MOFEM_LOG("SYNC", Sev::noisy) << "bC";
518
520 auto bc_mng = mField.getInterface<BcManager>();
521
522 CHKERR bc_mng->pushMarkDOFsOnEntities<DisplacementCubitBcData>(
523 simple->getProblemName(), "U");
524 CHKERR bc_mng->pushMarkDOFsOnEntities<HeatFluxCubitBcData>(
525 simple->getProblemName(), "FLUX", false);
526
527 auto get_skin = [&]() {
528 Range body_ents;
529 CHKERR mField.get_moab().get_entities_by_dimension(0, SPACE_DIM, body_ents);
530 Skinner skin(&mField.get_moab());
531 Range skin_ents;
532 CHKERR skin.find_skin(0, body_ents, false, skin_ents);
533 return skin_ents;
534 };
535
536 auto filter_flux_blocks = [&](auto skin) {
537 auto remove_cubit_blocks = [&](auto c) {
539 for (auto m :
540
542
543 ) {
544 Range ents;
545 CHKERR mField.get_moab().get_entities_by_dimension(
546 m->getMeshset(), SPACE_DIM - 1, ents, true);
547 skin = subtract(skin, ents);
548 }
550 };
551
552 auto remove_named_blocks = [&](auto n) {
555 std::regex(
556
557 (boost::format("%s(.*)") % n).str()
558
559 ))
560
561 ) {
562 Range ents;
563 CHKERR mField.get_moab().get_entities_by_dimension(
564 m->getMeshset(), SPACE_DIM - 1, ents, true);
565 skin = subtract(skin, ents);
566 }
568 };
569
570 CHK_THROW_MESSAGE(remove_cubit_blocks(NODESET | TEMPERATURESET),
571 "remove_cubit_blocks");
572 CHK_THROW_MESSAGE(remove_cubit_blocks(SIDESET | HEATFLUXSET),
573 "remove_cubit_blocks");
574 CHK_THROW_MESSAGE(remove_named_blocks("PRESSURE"), "remove_named_blocks");
575 CHK_THROW_MESSAGE(remove_named_blocks("FLUIDFLUX"), "remove_named_blocks");
576
577 return skin;
578 };
579
580 auto filter_true_skin = [&](auto skin) {
581 Range boundary_ents;
582 ParallelComm *pcomm =
583 ParallelComm::get_pcomm(&mField.get_moab(), MYPCOMM_INDEX);
584 CHKERR pcomm->filter_pstatus(skin, PSTATUS_SHARED | PSTATUS_MULTISHARED,
585 PSTATUS_NOT, -1, &boundary_ents);
586 return boundary_ents;
587 };
588
589 auto remove_flux_ents = filter_true_skin(filter_flux_blocks(get_skin()));
590
591 CHKERR mField.getInterface<CommInterface>()->synchroniseEntities(
592 remove_flux_ents);
593
594 MOFEM_LOG("SYNC", Sev::noisy) << remove_flux_ents << endl;
596
597#ifndef NDEBUG
598
601 (boost::format("flux_remove_%d.vtk") % mField.get_comm_rank()).str(),
602 remove_flux_ents);
603
604#endif
605
606 CHKERR mField.getInterface<ProblemsManager>()->removeDofsOnEntities(
607 simple->getProblemName(), "FLUX", remove_flux_ents);
608
610}
611//! [Boundary condition]
612
613//! [Push operators to pipeline]
616 auto pipeline_mng = mField.getInterface<PipelineManager>();
618 auto bc_mng = mField.getInterface<BcManager>();
619
620 auto boundary_marker =
621 bc_mng->getMergedBlocksMarker(vector<string>{"FLUIDFLUX"});
622
623 auto u_grad_ptr = boost::make_shared<MatrixDouble>();
624 auto dot_u_grad_ptr = boost::make_shared<MatrixDouble>();
625 auto trace_dot_u_grad_ptr = boost::make_shared<VectorDouble>();
626 auto h_ptr = boost::make_shared<VectorDouble>();
627 auto dot_h_ptr = boost::make_shared<VectorDouble>();
628 auto flux_ptr = boost::make_shared<MatrixDouble>();
629 auto div_flux_ptr = boost::make_shared<VectorDouble>();
630 auto strain_ptr = boost::make_shared<MatrixDouble>();
631 auto stress_ptr = boost::make_shared<MatrixDouble>();
632
633 auto time_scale = boost::make_shared<TimeScale>();
634
635 auto block_params = boost::make_shared<BlockedParameters>();
636 auto mDPtr = block_params->getDPtr();
637 auto conductivity_ptr = block_params->getConductivityPtr();
638
639 auto integration_rule = [](int, int, int approx_order) {
640 return 2 * approx_order;
641 };
642
643 CHKERR pipeline_mng->setDomainRhsIntegrationRule(integration_rule);
644 CHKERR pipeline_mng->setDomainLhsIntegrationRule(integration_rule);
645 CHKERR pipeline_mng->setBoundaryLhsIntegrationRule(integration_rule);
646 CHKERR pipeline_mng->setBoundaryRhsIntegrationRule(integration_rule);
647
648 auto add_domain_base_ops = [&](auto &pip) {
650
651 CHKERR addMatBlockOps(pip, "MAT_ELASTIC", "MAT_FLUID", block_params,
652 Sev::inform);
654
656 "U", u_grad_ptr));
657 pip.push_back(new OpSymmetrizeTensor<SPACE_DIM>(u_grad_ptr, strain_ptr));
659 "U", dot_u_grad_ptr));
660 pip.push_back(new OpCalculateTraceFromMat<SPACE_DIM>(dot_u_grad_ptr,
661 trace_dot_u_grad_ptr));
662
663 pip.push_back(new OpCalculateScalarFieldValues("H", h_ptr));
664 pip.push_back(new OpCalculateScalarFieldValuesDot("H", dot_h_ptr));
665 pip.push_back(new OpCalculateHVecVectorField<3>("FLUX", flux_ptr));
667 "FLUX", div_flux_ptr));
668
670 };
671
672 auto add_domain_ops_lhs_mechanical = [&](auto &pip) {
674 pip.push_back(new OpKCauchy("U", "U", mDPtr));
675 pip.push_back(new OpBaseDivU(
676 "H", "U",
677 [](const double, const double, const double) { return -9.81; }, true,
678 true));
680 };
681
682 auto add_domain_ops_rhs_mechanical = [&](auto &pip) {
684
686 pip, mField, "U", {time_scale}, "BODY_FORCE", Sev::inform);
687
688 // Calculate internal forece
690 "U", strain_ptr, stress_ptr, mDPtr));
691 pip.push_back(new OpInternalForceCauchy("U", stress_ptr));
692 pip.push_back(
694
696 };
697
698 auto add_domain_ops_lhs_seepage = [&](auto &pip, auto &fe) {
700 auto resistance = [conductivity_ptr](const double, const double,
701 const double) {
702 return (1. / *(conductivity_ptr));
703 };
704
705 auto unity = []() constexpr { return -1; };
706 pip.push_back(new OpHdivHdiv("FLUX", "FLUX", resistance));
707 pip.push_back(new OpHdivQ("FLUX", "H", unity, true));
708 auto op_base_div_u = new OpBaseDivU(
709 "H", "U", [](double, double, double) constexpr { return -1; }, false,
710 false);
711 op_base_div_u->feScalingFun = [](const FEMethod *fe_ptr) {
712 return fe_ptr->ts_a;
713 };
714 pip.push_back(op_base_div_u);
715
717 };
718
719 auto add_domain_ops_rhs_seepage = [&](auto &pip) {
721 auto resistance = [conductivity_ptr](double, double, double) {
722 return (1. / (*conductivity_ptr));
723 };
724 auto minus_one = [](double, double, double) constexpr { return -1; };
725
726 pip.push_back(new OpHdivFlux("FLUX", flux_ptr, resistance));
727 pip.push_back(new OpHDivH("FLUX", h_ptr, minus_one));
728 pip.push_back(new OpBaseDotH("H", trace_dot_u_grad_ptr, minus_one));
729 pip.push_back(new OpBaseDivFlux("H", div_flux_ptr, minus_one));
730
732 };
733
734 auto add_boundary_rhs_ops = [&](auto &pip) {
736
738
739 pip.push_back(new OpSetBc("FLUX", true, boundary_marker));
740
742 pipeline_mng->getOpBoundaryRhsPipeline(), mField, "U", {time_scale},
743 "FORCE", Sev::inform);
744
746 pipeline_mng->getOpBoundaryRhsPipeline(), mField, "FLUX", {time_scale},
747 "PRESSURE", Sev::inform);
748
749 pip.push_back(new OpUnSetBc("FLUX"));
750
751 auto mat_flux_ptr = boost::make_shared<MatrixDouble>();
752 pip.push_back(
753 new OpCalculateHVecVectorField<3, SPACE_DIM>("FLUX", mat_flux_ptr));
756 mField, pip, simple->getProblemName(), "FLUX", mat_flux_ptr,
757 {time_scale});
758
760 };
761
762 auto add_boundary_lhs_ops = [&](auto &pip) {
764
766
769 mField, pip, simple->getProblemName(), "FLUX");
770
772 };
773
774 // LHS
775 CHKERR add_domain_base_ops(pipeline_mng->getOpDomainLhsPipeline());
776 CHKERR add_domain_ops_lhs_mechanical(pipeline_mng->getOpDomainLhsPipeline());
777 CHKERR add_domain_ops_lhs_seepage(pipeline_mng->getOpDomainLhsPipeline(),
778 pipeline_mng->getDomainLhsFE());
779
780 // RHS
781 CHKERR add_domain_base_ops(pipeline_mng->getOpDomainRhsPipeline());
782 CHKERR add_domain_ops_rhs_mechanical(pipeline_mng->getOpDomainRhsPipeline());
783 CHKERR add_domain_ops_rhs_seepage(pipeline_mng->getOpDomainRhsPipeline());
784
785 CHKERR add_boundary_rhs_ops(pipeline_mng->getOpBoundaryRhsPipeline());
786 CHKERR add_boundary_lhs_ops(pipeline_mng->getOpBoundaryLhsPipeline());
787
789}
790//! [Push operators to pipeline]
791
792//! [Solve]
797 ISManager *is_manager = mField.getInterface<ISManager>();
798
799 auto dm = simple->getDM();
800 auto solver = pipeline_mng->createTSIM();
801 auto snes_ctx_ptr = getDMSnesCtx(dm);
802
803 auto set_section_monitor = [&](auto solver) {
805 SNES snes;
806 CHKERR TSGetSNES(solver, &snes);
807 CHKERR SNESMonitorSet(snes,
808 (MoFEMErrorCode(*)(SNES, PetscInt, PetscReal,
810 (void *)(snes_ctx_ptr.get()), nullptr);
812 };
813
814 auto create_post_process_element = [&]() {
815 auto post_proc_fe = boost::make_shared<PostProcEle>(mField);
816
817 auto block_params = boost::make_shared<BlockedParameters>();
818 auto mDPtr = block_params->getDPtr();
819 CHKERR addMatBlockOps(post_proc_fe->getOpPtrVector(), "MAT_ELASTIC",
820 "MAT_FLUID", block_params, Sev::verbose);
822 post_proc_fe->getOpPtrVector(), {H1, HDIV});
823
824 auto mat_grad_ptr = boost::make_shared<MatrixDouble>();
825 auto mat_strain_ptr = boost::make_shared<MatrixDouble>();
826 auto mat_stress_ptr = boost::make_shared<MatrixDouble>();
827
828 auto h_ptr = boost::make_shared<VectorDouble>();
829 auto mat_flux_ptr = boost::make_shared<MatrixDouble>();
830
831 post_proc_fe->getOpPtrVector().push_back(
832 new OpCalculateScalarFieldValues("H", h_ptr));
833 post_proc_fe->getOpPtrVector().push_back(
834 new OpCalculateHVecVectorField<3, SPACE_DIM>("FLUX", mat_flux_ptr));
835
836 auto u_ptr = boost::make_shared<MatrixDouble>();
837 post_proc_fe->getOpPtrVector().push_back(
839 post_proc_fe->getOpPtrVector().push_back(
841 mat_grad_ptr));
842 post_proc_fe->getOpPtrVector().push_back(
843 new OpSymmetrizeTensor<SPACE_DIM>(mat_grad_ptr, mat_strain_ptr));
844 post_proc_fe->getOpPtrVector().push_back(
846 "U", mat_strain_ptr, mat_stress_ptr, mDPtr));
847
849
850 post_proc_fe->getOpPtrVector().push_back(
851
852 new OpPPMap(
853
854 post_proc_fe->getPostProcMesh(), post_proc_fe->getMapGaussPts(),
855
856 {{"H", h_ptr}},
857
858 {{"U", u_ptr}, {"FLUX", mat_flux_ptr}},
859
860 {},
861
862 {{"STRAIN", mat_strain_ptr}, {"STRESS", mat_stress_ptr}}
863
864 )
865
866 );
867
868 return post_proc_fe;
869 };
870
871 auto create_creaction_fe = [&]() {
872 auto fe_ptr = boost::make_shared<DomainEle>(mField);
873 fe_ptr->getRuleHook = [](int, int, int o) { return 2 * o; };
874
875 auto &pip = fe_ptr->getOpPtrVector();
876
877 auto block_params = boost::make_shared<BlockedParameters>();
878 auto mDPtr = block_params->getDPtr();
879 CHKERR addMatBlockOps(pip, "MAT_ELASTIC", "MAT_FLUID", block_params,
880 Sev::verbose);
882
883 auto u_grad_ptr = boost::make_shared<MatrixDouble>();
884 auto strain_ptr = boost::make_shared<MatrixDouble>();
885 auto stress_ptr = boost::make_shared<MatrixDouble>();
886
888 "U", u_grad_ptr));
889 pip.push_back(new OpSymmetrizeTensor<SPACE_DIM>(u_grad_ptr, strain_ptr));
890
891 // Calculate internal forece
893 "U", strain_ptr, stress_ptr, mDPtr));
894 pip.push_back(new OpInternalForceCauchy("U", stress_ptr));
895
896 fe_ptr->postProcessHook =
898
899 return fe_ptr;
900 };
901
902 auto monitor_ptr = boost::make_shared<FEMethod>();
903 auto post_proc_fe = create_post_process_element();
904 auto res = createDMVector(dm);
905 auto rections_fe = create_creaction_fe();
906
907 auto set_time_monitor = [&](auto dm, auto solver) {
909 monitor_ptr->preProcessHook = [&]() {
911
912 CHKERR DMoFEMLoopFiniteElements(dm, simple->getDomainFEName(),
913 post_proc_fe,
914 monitor_ptr->getCacheWeakPtr());
915 CHKERR post_proc_fe->writeFile(
916 "out_" + boost::lexical_cast<std::string>(monitor_ptr->ts_step) +
917 ".h5m");
918
919 rections_fe->f = res;
920 CHKERR DMoFEMLoopFiniteElements(dm, simple->getDomainFEName(),
921 rections_fe,
922 monitor_ptr->getCacheWeakPtr());
923
924 double nrm;
925 CHKERR VecNorm(res, NORM_2, &nrm);
926 MOFEM_LOG("Seepage", Sev::verbose)
927 << "Residual norm " << nrm << " at time step "
928 << monitor_ptr->ts_step;
929
930 if (doEvalField) {
931
932 auto scalar_field_ptr = boost::make_shared<VectorDouble>();
933 auto vector_field_ptr = boost::make_shared<MatrixDouble>();
934 auto tensor_field_ptr = boost::make_shared<MatrixDouble>();
935
936 auto field_eval_data = mField.getInterface<FieldEvaluatorInterface>()
937 ->getData<DomainEle>();
938
939 if constexpr (SPACE_DIM == 3) {
940 CHKERR mField.getInterface<FieldEvaluatorInterface>()->buildTree3D(
941 field_eval_data, simple->getDomainFEName());
942 } else {
943 CHKERR mField.getInterface<FieldEvaluatorInterface>()->buildTree2D(
944 field_eval_data, simple->getDomainFEName());
945 }
946
947 field_eval_data->setEvalPoints(fieldEvalCoords.data(), 1);
948 auto no_rule = [](int, int, int) { return -1; };
949
950 auto field_eval_ptr = field_eval_data->feMethodPtr.lock();
951 field_eval_ptr->getRuleHook = no_rule;
952
953 auto u_grad_ptr = boost::make_shared<MatrixDouble>();
954 auto strain_ptr = boost::make_shared<MatrixDouble>();
955 auto stress_ptr = boost::make_shared<MatrixDouble>();
956 auto h_ptr = boost::make_shared<VectorDouble>();
957
958 auto block_params = boost::make_shared<BlockedParameters>();
959 auto mDPtr = block_params->getDPtr();
960 CHKERR addMatBlockOps(field_eval_ptr->getOpPtrVector(), "MAT_ELASTIC",
961 "MAT_FLUID", block_params, Sev::noisy);
963 field_eval_ptr->getOpPtrVector(), {H1, HDIV});
964 field_eval_ptr->getOpPtrVector().push_back(
966 "U", u_grad_ptr));
967 field_eval_ptr->getOpPtrVector().push_back(
968 new OpSymmetrizeTensor<SPACE_DIM>(u_grad_ptr, strain_ptr));
969 field_eval_ptr->getOpPtrVector().push_back(
970 new OpCalculateScalarFieldValues("H", h_ptr));
971 field_eval_ptr->getOpPtrVector().push_back(
973 "U", strain_ptr, stress_ptr, mDPtr));
974
975 if constexpr (SPACE_DIM == 3) {
976 CHKERR mField.getInterface<FieldEvaluatorInterface>()
977 ->evalFEAtThePoint3D(
978 fieldEvalCoords.data(), 1e-12, simple->getProblemName(),
979 simple->getDomainFEName(), field_eval_data,
980 mField.get_comm_rank(), mField.get_comm_rank(), nullptr,
981 MF_EXIST, QUIET);
982 } else {
983 CHKERR mField.getInterface<FieldEvaluatorInterface>()
984 ->evalFEAtThePoint2D(
985 fieldEvalCoords.data(), 1e-12, simple->getProblemName(),
986 simple->getDomainFEName(), field_eval_data,
987 mField.get_comm_rank(), mField.get_comm_rank(), nullptr,
988 MF_EXIST, QUIET);
989 }
990
991 MOFEM_LOG("SeepageSync", Sev::inform)
992 << "Eval point hydrostatic hight: " << *h_ptr;
993 MOFEM_LOG("SeepageSync", Sev::inform)
994 << "Eval point skeleton stress pressure: " << *stress_ptr;
995 MOFEM_LOG_SEVERITY_SYNC(mField.get_comm(), Sev::inform);
996 }
997
999 };
1000 auto null = boost::shared_ptr<FEMethod>();
1001 CHKERR DMMoFEMTSSetMonitor(dm, solver, simple->getDomainFEName(), null,
1002 monitor_ptr, null);
1004 };
1005
1006 auto set_fieldsplit_preconditioner = [&](auto solver) {
1008
1009 SNES snes;
1010 CHKERR TSGetSNES(solver, &snes);
1011 KSP ksp;
1012 CHKERR SNESGetKSP(snes, &ksp);
1013 PC pc;
1014 CHKERR KSPGetPC(ksp, &pc);
1015 PetscBool is_pcfs = PETSC_FALSE;
1016 PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
1017
1018 // Setup fieldsplit (block) solver - optional: yes/no
1019 if (is_pcfs == PETSC_TRUE) {
1020 auto bc_mng = mField.getInterface<BcManager>();
1021 auto is_mng = mField.getInterface<ISManager>();
1022 auto name_prb = simple->getProblemName();
1023
1024 SmartPetscObj<IS> is_u;
1025 CHKERR is_mng->isCreateProblemFieldAndRank(name_prb, ROW, "U", 0,
1026 SPACE_DIM, is_u);
1027 SmartPetscObj<IS> is_flux;
1028 CHKERR is_mng->isCreateProblemFieldAndRank(name_prb, ROW, "FLUX", 0, 0,
1029 is_flux);
1030 SmartPetscObj<IS> is_H;
1031 CHKERR is_mng->isCreateProblemFieldAndRank(name_prb, ROW, "H", 0, 0,
1032 is_H);
1033 IS is_tmp;
1034 CHKERR ISExpand(is_H, is_flux, &is_tmp);
1035 auto is_Flux = SmartPetscObj<IS>(is_tmp);
1036
1037 auto is_all_bc = bc_mng->getBlockIS(name_prb, "FLUIDFLUX", "FLUX", 0, 0);
1038 int is_all_bc_size;
1039 CHKERR ISGetSize(is_all_bc, &is_all_bc_size);
1040 MOFEM_LOG("ThermoElastic", Sev::inform)
1041 << "Field split block size " << is_all_bc_size;
1042 if (is_all_bc_size) {
1043 IS is_tmp2;
1044 CHKERR ISDifference(is_Flux, is_all_bc, &is_tmp2);
1045 is_Flux = SmartPetscObj<IS>(is_tmp2);
1046 CHKERR PCFieldSplitSetIS(pc, PETSC_NULL,
1047 is_all_bc); // boundary block
1048 }
1049
1050 CHKERR ISSort(is_u);
1051 CHKERR ISSort(is_Flux);
1052 CHKERR PCFieldSplitSetIS(pc, PETSC_NULL, is_Flux);
1053 CHKERR PCFieldSplitSetIS(pc, PETSC_NULL, is_u);
1054 }
1055
1057 };
1058
1059 auto pre_proc_ptr = boost::make_shared<FEMethod>();
1060 auto post_proc_rhs_ptr = boost::make_shared<FEMethod>();
1061 auto post_proc_lhs_ptr = boost::make_shared<FEMethod>();
1062 auto time_scale = boost::make_shared<TimeScale>();
1063
1064 auto get_bc_hook_rhs = [this, pre_proc_ptr, time_scale]() {
1065 EssentialPreProc<DisplacementCubitBcData> hook(mField, pre_proc_ptr,
1066 {time_scale}, false);
1067 return hook;
1068 };
1069
1070 auto get_post_proc_hook_rhs = [this, post_proc_rhs_ptr]() {
1073 mField, post_proc_rhs_ptr, nullptr, Sev::verbose)();
1075 mField, post_proc_rhs_ptr, 1.)();
1077 };
1078 auto get_post_proc_hook_lhs = [this, post_proc_lhs_ptr]() {
1080 post_proc_lhs_ptr, 1.);
1081 };
1082
1083 pre_proc_ptr->preProcessHook = get_bc_hook_rhs();
1084 post_proc_rhs_ptr->postProcessHook = get_post_proc_hook_rhs;
1085 post_proc_lhs_ptr->postProcessHook = get_post_proc_hook_lhs();
1086
1087 auto ts_ctx_ptr = getDMTsCtx(dm);
1088 ts_ctx_ptr->getPreProcessIFunction().push_front(pre_proc_ptr);
1089 ts_ctx_ptr->getPreProcessIJacobian().push_front(pre_proc_ptr);
1090 ts_ctx_ptr->getPostProcessIFunction().push_back(post_proc_rhs_ptr);
1091 ts_ctx_ptr->getPostProcessIJacobian().push_back(post_proc_lhs_ptr);
1092
1093 auto D = createDMVector(dm);
1094 CHKERR TSSetSolution(solver, D);
1095 CHKERR TSSetFromOptions(solver);
1096
1097 CHKERR set_section_monitor(solver);
1098 CHKERR set_fieldsplit_preconditioner(solver);
1099 CHKERR set_time_monitor(dm, solver);
1100
1101 CHKERR TSSetUp(solver);
1102 CHKERR TSSolve(solver, NULL);
1103
1105}
1106//! [Solve]
1107
1108static char help[] = "...\n\n";
1109
1110int main(int argc, char *argv[]) {
1111
1112 // Initialisation of MoFEM/PETSc and MOAB data structures
1113 const char param_file[] = "param_file.petsc";
1114 MoFEM::Core::Initialize(&argc, &argv, param_file, help);
1115
1116 // Add logging channel for example
1117 auto core_log = logging::core::get();
1118 core_log->add_sink(
1120 LogManager::setLog("Seepage");
1121 MOFEM_LOG_TAG("Seepage", "seepage");
1122 core_log->add_sink(
1124 LogManager::setLog("SeepageSync");
1125 MOFEM_LOG_TAG("SeepageSync", "seepage");
1126
1127 try {
1128
1129 //! [Register MoFEM discrete manager in PETSc]
1130 DMType dm_name = "DMMOFEM";
1131 CHKERR DMRegister_MoFEM(dm_name);
1132 //! [Register MoFEM discrete manager in PETSc
1133
1134 //! [Create MoAB]
1135 moab::Core mb_instance; ///< mesh database
1136 moab::Interface &moab = mb_instance; ///< mesh database interface
1137 //! [Create MoAB]
1138
1139 //! [Create MoFEM]
1140 MoFEM::Core core(moab); ///< finite element database
1141 MoFEM::Interface &m_field = core; ///< finite element database insterface
1142 //! [Create MoFEM]
1143
1144 //! [Load mesh]
1145 Simple *simple = m_field.getInterface<Simple>();
1146 CHKERR simple->getOptions();
1147 CHKERR simple->loadFile();
1148 //! [Load mesh]
1149
1150 //! [Seepage]
1151 Seepage ex(m_field);
1152 CHKERR ex.runProblem();
1153 //! [Seepage]
1154 }
1156
1158}
static auto filter_true_skin(MoFEM::Interface &m_field, Range &&skin)
static auto get_skin(MoFEM::Interface &m_field, Range body_ents)
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition acoustic.cpp:69
int main()
DomainEle::UserDataOperator DomainEleOp
Finire element operator type.
constexpr int SPACE_DIM
ElementsAndOps< SPACE_DIM >::BoundaryEle BoundaryEle
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
[Define dimension]
Kronecker Delta class symmetric.
@ QUIET
@ ROW
#define CATCH_ERRORS
Catch errors.
@ MF_EXIST
FieldApproximationBase
approximation base
Definition definitions.h:58
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base nme:nme847.
Definition definitions.h:60
@ DEMKOWICZ_JACOBI_BASE
Definition definitions.h:66
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ L2
field with C-1 continuity
Definition definitions.h:88
@ H1
continuous field
Definition definitions.h:85
@ 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 MYPCOMM_INDEX
default communicator number PCOMM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ TEMPERATURESET
@ HEATFLUXSET
@ NODESET
@ SIDESET
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
constexpr int order
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, SPACE_DIM, 1 > OpInertiaForce
double bulk_modulus_K
double shear_modulus_G
auto integration_rule
constexpr auto t_kd
FormsIntegrators< DomainEleOp >::Assembly< A >::BiLinearForm< I >::OpMixScalarTimesDiv< SPACE_DIM, COORD_TYPE > OpMixScalarTimesDiv
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition DMMoFEM.cpp:43
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:586
auto createDMVector(DM dm)
Get smart vector from DM.
Definition DMMoFEM.hpp:1099
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG(channel, severity)
Log.
SeverityLevel
Severity levels.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
MoFEMErrorCode getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
get cubit meshset
FTensor::Index< 'i', SPACE_DIM > i
PetscBool doEvalField
const double c
speed of light (cm/ns)
double D
const double n
refractive index of diffusive medium
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
PetscErrorCode DMMoFEMTSSetMonitor(DM dm, TS ts, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
Set Monitor To TS solver.
Definition DMMoFEM.cpp:1056
auto getDMTsCtx(DM dm)
Get TS context data structure used by DM.
Definition DMMoFEM.hpp:1141
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
MoFEMErrorCode MoFEMSNESMonitorFields(SNES snes, PetscInt its, PetscReal fgnorm, SnesCtx *snes_ctx)
Sens monitor printing residual field by field.
Definition SnesCtx.cpp:232
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)
PetscErrorCode PetscOptionsGetRealArray(PetscOptions *, const char pre[], const char name[], PetscReal dval[], PetscInt *nmax, PetscBool *set)
static FTensor::Ddg< FTensor::PackPtr< T *, 1 >, Tensor_Dim01, Tensor_Dim23 > getFTensor4DdgFromMat(ublas::matrix< T, L, A > &data)
Get symmetric tensor rank 4 on first two and last indices from form data matrix.
auto get_temp_meshset_ptr(moab::Interface &moab)
Create smart pointer to temporary meshset.
OpCalculateScalarFieldValuesFromPetscVecImpl< PetscData::CTX_SET_X_T > OpCalculateScalarFieldValuesDot
auto getDMSnesCtx(DM dm)
Get SNES context data structure used by DM.
Definition DMMoFEM.hpp:1127
MoFEMErrorCode addMatBlockOps(MoFEM::Interface &m_field, std::string block_name, Pip &pip, boost::shared_ptr< MatrixDouble > mat_D_Ptr, boost::shared_ptr< CommonData::BlockParams > mat_params_ptr, double scale_value, Sev sev)
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
double young_modulus
Young modulus.
Definition plastic.cpp:121
double poisson_ratio
Poisson ratio.
Definition plastic.cpp:122
constexpr auto size_symm
Definition plastic.cpp:42
static constexpr int approx_order
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition radiation.cpp:29
auto save_range
Definition seepage.cpp:170
double default_conductivity
Definition seepage.cpp:164
OpBaseDotH OpBaseDivFlux
Integrate Rhs base of temperature times divergent of flux (T)
Definition seepage.cpp:130
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesSymTensor< 1, SPACE_DIM, SPACE_DIM > OpInternalForceCauchy
Definition seepage.cpp:51
static char help[]
[Solve]
Definition seepage.cpp:1108
double fluid_density
Definition seepage.cpp:165
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesScalarField< 1 > OpBaseDotH
Integrate Rhs base of temperature time heat capacity times heat rate (T)
Definition seepage.cpp:123
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradSymTensorGrad< 1, SPACE_DIM, SPACE_DIM, 0 > OpKCauchy
[Only used with Hooke equation (linear material model)]
Definition seepage.cpp:49
#define EXECUTABLE_DIMENSION
Definition seepage.cpp:24
constexpr int SPACE_DIM
Definition seepage.cpp:34
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMixScalarTimesDiv< SPACE_DIM > OpBaseDivU
[Essential boundary conditions]
Definition seepage.cpp:78
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 3, 3, 1 > OpHdivFlux
Integrating Rhs flux base (1/k) flux (FLUX)
Definition seepage.cpp:108
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM > OpMass
[Only used with Hooke equation (linear material model)]
Definition seepage.cpp:56
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
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, SPACE_DIM, 1 > OpBoundaryInternal
Definition seepage.cpp:74
double scale
[Essential boundary conditions (Least square approach)]
Definition seepage.cpp:160
double default_young_modulus
Definition seepage.cpp:162
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM > OpBoundaryMass
[Only used with Hencky/nonlinear material]
Definition seepage.cpp:70
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMixDivTimesScalar< SPACE_DIM > OpHdivQ
Integrate Lhs div of base of flux time base of temperature (FLUX x T) and transpose of it,...
Definition seepage.cpp:94
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradTensorGrad< 1, SPACE_DIM, SPACE_DIM, 1 > OpKPiola
[Only used for dynamics]
Definition seepage.cpp:63
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, SPACE_DIM, 0 > OpBoundaryVec
Definition seepage.cpp:72
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpMixDivTimesU< 3, 1, 2 > OpHDivH
Integrate Rhs div flux base times temperature (T)
Definition seepage.cpp:115
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesTensor< 1, SPACE_DIM, SPACE_DIM > OpInternalForcePiola
Definition seepage.cpp:65
double default_poisson_ratio
Definition seepage.cpp:163
FTensor::Index< 'm', 3 > m
Add operators pushing bases from local to physical configuration.
Simple interface for fast problem set-up.
Definition BcManager.hpp:25
Managing BitRefLevels.
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:82
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:72
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:112
Deprecated interface functions.
Definition of the displacement bc data structure.
Definition BCData.hpp:76
Data on single entity (This is passed as argument to DataOperator::doWork)
Essential boundary conditions.
Class (Function) to enforce essential constrains on the left hand side diagonal.
Definition Essential.hpp:33
Class (Function) to enforce essential constrains on the right hand side diagonal.
Definition Essential.hpp:41
Class (Function) to enforce essential constrains.
Definition Essential.hpp:25
Class (Function) to calculate residual side diagonal.
Definition Essential.hpp:49
structure for User Loop Methods on finite elements
Field evaluator interface.
Definition of the heat flux bc data structure.
Definition BCData.hpp:427
Section manager is used to create indexes and sections.
Definition ISManager.hpp:23
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.
static boost::shared_ptr< std::ostream > getStrmSync()
Get the strm sync object.
Interface for managing meshsets containing materials and boundary conditions.
Assembly methods.
Definition Natural.hpp:65
Get vector field for H-div approximation.
Calculate divergence of vector field.
Get value at integration points for scalar field.
Calculates the trace of an input matrix.
Get field gradients time derivative at integration pts for scalar filed rank 0, i....
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
Get values at integration pts for tensor filed rank 1, i.e. vector field.
Enforce essential constrains on lhs.
Definition Essential.hpp:81
Enforce essential constrains on rhs.
Definition Essential.hpp:65
Post post-proc data at points from hash maps.
Set indices on entities on finite element.
PipelineManager interface.
Problem manager is used to build and partition problems.
Simple interface for fast problem set-up.
Definition Simple.hpp:27
intrusive_ptr for managing petsc objects
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Seepage(MoFEM::Interface &m_field)
Definition seepage.cpp:181
MoFEMErrorCode setupProblem()
[Run problem]
Definition seepage.cpp:449
std::array< double, SPACE_DIM > fieldEvalCoords
Definition seepage.cpp:195
MoFEMErrorCode createCommonData()
[Set up problem]
Definition seepage.cpp:476
MoFEMErrorCode bC()
[Create common data]
Definition seepage.cpp:513
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uZScatter
Definition seepage.cpp:199
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uXScatter
Definition seepage.cpp:197
MoFEMErrorCode runProblem()
[Run problem]
Definition seepage.cpp:437
MoFEMErrorCode OPs()
[Boundary condition]
Definition seepage.cpp:614
PetscBool doEvalField
Definition seepage.cpp:194
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uYScatter
Definition seepage.cpp:198
MoFEM::Interface & mField
Definition seepage.cpp:186
MoFEMErrorCode addMatBlockOps(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, std::string block_elastic_name, std::string block_thermal_name, boost::shared_ptr< BlockedParameters > blockedParamsPtr, Sev sev)
Definition seepage.cpp:221
MoFEMErrorCode tsSolve()
[Push operators to pipeline]
Definition seepage.cpp:793
FormsIntegrators< DomainEleOp >::Assembly< A >::OpBase AssemblyDomainEleOp
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradSymTensorGrad< 1, SPACE_DIM, SPACE_DIM, 0 > OpKCauchy
[Linear elastic problem]
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, 1 > OpCapacity
Integrate Lhs base of temperature times (heat capacity) times base of temperature (T x T)
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 3, SPACE_DIM, 1 > OpHdivFlux
Integrating Rhs flux base (1/k) flux (FLUX)
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 3, SPACE_DIM > OpHdivHdiv
[Linear elastic problem]
OpBaseDotT OpBaseDivFlux
Integrate Rhs base of temperature times divergence of flux (T)
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesSymTensor< 1, SPACE_DIM, SPACE_DIM > OpInternalForceCauchy