v0.14.0
Loading...
Searching...
No Matches
elec_phys_2D.cpp
Go to the documentation of this file.
1#include <stdlib.h>
4
5using namespace MoFEM;
6using namespace ElectroPhysiology;
7
8static char help[] = "...\n\n";
9
10// #define M_PI 3.14159265358979323846 /* pi */
11
12const int dim = 2;
13
14double init_val_u = 0.4;
15double init_val_v = 0.0;
16
17// double alpha = -0.08;
18// double gma = 3;
19// double ep = 0.005;
20
21
22
23struct Istimulus {
24 double operator()(const double x, const double y, const double z,
25 const double t) const {
26 if (y <= -1.6000 && t <= 0.50000) {
27 return 80;
28 } else {
29 return 0;
30 }
31 }
32};
33
34struct RhsU {
35 double operator()(const double u, const double v) const {
36 return factor * (1.0 * (c * u * (u - alpha) * (1.0 - u) - u * v));
37 }
38};
39
40struct DRhsU_u {
41 double operator()(const double u, const double v) const {
42 return factor * (c * ((u - alpha) * (1.0 - u) + u * (1.0 - u) - u * (u - alpha)) - v);
43 }
44};
45
46struct RhsV {
47 double operator()(const double u, const double v) const {
48 return factor * ((gma + mu1 * v / (mu2 + u)) * (-v - c * u * (u - b - 1.0)));
49 }
50};
51
52struct DRhsV_v {
53 double operator()(const double u, const double v) const {
54 return factor * (((gma + mu1 / (mu2 + u)) * (-v - c * u * (u - b - 1.0)) -
55 - (gma + mu1 * v / (mu2 + u))));
56 }
57};
58
59const double Tol = 1e-9;
60
61struct RK4 {
64 double operator()(const double u, const double v, const double dt) const {
65
66
67 double dv;
68
69 double vk = v;
70
71 double err = 1;
72
73 while (err > Tol){
74 double rhsv = rhs_v(u, vk);
75 double Drhsv = Drhs_v(u, vk);
76 dv = - 1.0 / (1 - dt * Drhsv) * (vk - v - dt * rhsv);
77 vk += dv;
78 err = abs(dv);
79 }
80
81 return vk;
82
83 // double k1 = dt * rhs_v(u, v);
84 // // double k2 = dt * rhs_v(u, v + 0.5 * k1);
85 // // double k3 = dt * rhs_v(u, v + 0.5 * k2);
86 // double k4 = dt * rhs_v(u, v + k1);
87 // return v + 0.5 * (k1 + k4);
88 }
89};
90
91struct RDProblem {
92public:
93 RDProblem(MoFEM::Core &core, const int order)
94 : m_field(core), order(order), cOmm(m_field.get_comm()),
95 rAnk(m_field.get_comm_rank()) {
96 vol_ele_slow_rhs = boost::shared_ptr<FaceEle>(new FaceEle(m_field));
98 boost::shared_ptr<BoundaryEle>(new BoundaryEle(m_field));
99 vol_ele_stiff_rhs = boost::shared_ptr<FaceEle>(new FaceEle(m_field));
100 vol_ele_stiff_lhs = boost::shared_ptr<FaceEle>(new FaceEle(m_field));
101 post_proc = boost::shared_ptr<PostProcFaceOnRefinedMesh>(
103
104 data1 = boost::shared_ptr<PreviousData>(new PreviousData());
105 data2 = boost::shared_ptr<PreviousData>(new PreviousData());
106
107
109 boost::shared_ptr<MatrixDouble>(data1, &data1->flux_values);
110
111 flux_divs_ptr1 = boost::shared_ptr<VectorDouble>(data1, &data1->flux_divs);
112
114 boost::shared_ptr<VectorDouble>(data1, &data1->mass_values);
115
116 mass_dots_ptr1 = boost::shared_ptr<VectorDouble>(data1, &data1->mass_dots);
117
119 boost::shared_ptr<MatrixDouble>(data2, &data2->flux_values);
120 flux_divs_ptr2 = boost::shared_ptr<VectorDouble>(data2, &data2->flux_divs);
121
123 boost::shared_ptr<VectorDouble>(data2, &data2->mass_values);
124 mass_dots_ptr2 = boost::shared_ptr<VectorDouble>(data2, &data2->mass_dots);
125
126
127 }
128
129 // RDProblem(const int order) : order(order){}
131
133
134private:
137 MoFEMErrorCode set_blockData(std::map<int, BlockData> &block_data_map);
138 MoFEMErrorCode extract_bd_ents(std::string ESSENTIAL, std::string NATURAL);
140 MoFEMErrorCode update_slow_rhs(std::string mass_fiedl,
141 boost::shared_ptr<VectorDouble> &mass_ptr);
142 MoFEMErrorCode push_slow_rhs(std::string mass_field, std::string flux_field,
143 boost::shared_ptr<PreviousData> &data1,
144 boost::shared_ptr<PreviousData> &data2);
145 MoFEMErrorCode update_vol_fe(boost::shared_ptr<FaceEle> &vol_ele,
146 boost::shared_ptr<PreviousData> &data);
148 update_stiff_rhs(std::string mass_field, std::string flux_field,
149 boost::shared_ptr<VectorDouble> &mass_ptr,
150 boost::shared_ptr<MatrixDouble> &flux_ptr,
151 boost::shared_ptr<VectorDouble> &mass_dot_ptr,
152 boost::shared_ptr<VectorDouble> &flux_div_ptr);
153 MoFEMErrorCode push_stiff_rhs(std::string mass_field, std::string flux_field,
154 boost::shared_ptr<PreviousData> &data1,
155 boost::shared_ptr<PreviousData> &data2,
156 std::map<int, BlockData> &block_map,
157 Range &surface);
158 MoFEMErrorCode update_stiff_lhs(std::string mass_fiedl,
159 std::string flux_field,
160 boost::shared_ptr<VectorDouble> &mass_ptr,
161 boost::shared_ptr<MatrixDouble> &flux_ptr);
162 MoFEMErrorCode push_stiff_lhs(std::string mass_field, std::string flux_field,
163 boost::shared_ptr<PreviousData> &datau,
164 boost::shared_ptr<PreviousData> &datav,
165 std::map<int, BlockData> &block_map);
166
168 MoFEMErrorCode apply_IC(std::string mass_field, Range &surface,
169 boost::shared_ptr<FaceEle> &initial_ele,
170 double & init_val);
171 MoFEMErrorCode apply_BC(std::string flux_field);
176
181
184
185 Range inner_surface1; // nb_species times
187
188
189 MPI_Comm cOmm;
190 const int rAnk;
191
192 int order;
194
195 std::map<int, BlockData> material_blocks;
196
197 boost::shared_ptr<FaceEle> vol_ele_slow_rhs;
198 boost::shared_ptr<FaceEle> vol_ele_stiff_rhs;
199 boost::shared_ptr<FaceEle> vol_ele_stiff_lhs;
200 boost::shared_ptr<BoundaryEle> natural_bdry_ele_slow_rhs;
201
202 boost::shared_ptr<PostProcFaceOnRefinedMesh> post_proc;
203 boost::shared_ptr<Monitor> monitor_ptr;
204
205 boost::shared_ptr<PreviousData> data1; // nb_species times
206 boost::shared_ptr<PreviousData> data2;
207
208
209 boost::shared_ptr<MatrixDouble> flux_values_ptr1; // nb_species times
210 boost::shared_ptr<MatrixDouble> flux_values_ptr2;
211
212
213 boost::shared_ptr<VectorDouble> flux_divs_ptr1; // nb_species times
214 boost::shared_ptr<VectorDouble> flux_divs_ptr2;
215
216
217 boost::shared_ptr<VectorDouble> mass_values_ptr1; // nb_species times
218 boost::shared_ptr<VectorDouble> mass_values_ptr2;
219
220
221 boost::shared_ptr<VectorDouble> mass_dots_ptr1; // nb_species times
222 boost::shared_ptr<VectorDouble> mass_dots_ptr2;
223
224
225 boost::shared_ptr<ForcesAndSourcesCore> null;
226};
227
234}
235
242
245
248
249
250
254
255
257}
258
259MoFEMErrorCode RDProblem::set_blockData(std::map<int, BlockData> &block_map) {
262 string name = it->getName();
263 const int id = it->getMeshsetId();
264 if (name.compare(0, 14, "REGION1") == 0) {
265 CHKERR m_field.getInterface<MeshsetsManager>()->getEntitiesByDimension(
266 id, BLOCKSET, 2, block_map[id].block_ents, true);
267 block_map[id].B0 = 1e-3;
268 block_map[id].block_id = id;
269 } else if (name.compare(0, 14, "REGION2") == 0) {
270 CHKERR m_field.getInterface<MeshsetsManager>()->getEntitiesByDimension(
271 id, BLOCKSET, 2, block_map[id].block_ents, true);
272 block_map[id].B0 = 1e-1;
273 block_map[id].block_id = id;
274 }
275 }
277}
278
280 std::string natural) {
283 string name = it->getName();
284 if (name.compare(0, 14, natural) == 0) {
285
286 CHKERR it->getMeshsetIdEntitiesByDimension(m_field.get_moab(), 1,
287 natural_bdry_ents, true);
288 } else if (name.compare(0, 14, essential) == 0) {
289 CHKERR it->getMeshsetIdEntitiesByDimension(m_field.get_moab(), 1,
290 essential_bdry_ents, true);
291 }
292 }
294}
295
299 BLOCKSET)) {
300 CHKERR m_field.getInterface<MeshsetsManager>()->getEntitiesByDimension(
301 block_id, BLOCKSET, 2, surface, true);
302 }
304}
305
307RDProblem::update_slow_rhs(std::string mass_field,
308 boost::shared_ptr<VectorDouble> &mass_ptr) {
310 vol_ele_slow_rhs->getOpPtrVector().push_back(
311 new OpCalculateScalarFieldValues(mass_field, mass_ptr));
313}
314
316RDProblem::push_slow_rhs(std::string mass_field, std::string flux_field,
317 boost::shared_ptr<PreviousData> &data_1,
318 boost::shared_ptr<PreviousData> &data_2) {
320
321 vol_ele_slow_rhs->getOpPtrVector().push_back(
322 new OpAssembleSlowRhsV(mass_field, data_1, data_2, RhsU()));
323
324 // natural_bdry_ele_slow_rhs->getOpPtrVector().push_back(
325 // new OpAssembleNaturalBCRhsTau(flux_field, natural_bdry_ents));
326
327 natural_bdry_ele_slow_rhs->getOpPtrVector().push_back(
328 new OpEssentialBC(flux_field, essential_bdry_ents));
329
331}
332
333MoFEMErrorCode RDProblem::update_vol_fe(boost::shared_ptr<FaceEle> &vol_ele,
334 boost::shared_ptr<PreviousData> &data) {
336 auto det_ptr = boost::make_shared<VectorDouble>();
337 auto jac_ptr = boost::make_shared<MatrixDouble>();
338 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
339 vol_ele->getOpPtrVector().push_back(new OpCalculateHOJacForFace(jac_ptr));
340 vol_ele->getOpPtrVector().push_back(
341 new OpInvertMatrix<2>(jac_ptr, det_ptr, inv_jac_ptr));
342 vol_ele->getOpPtrVector().push_back(new OpMakeHdivFromHcurl());
343 vol_ele->getOpPtrVector().push_back(
345 vol_ele->getOpPtrVector().push_back(new OpSetInvJacHcurlFace(inv_jac_ptr));
347}
348
350RDProblem::update_stiff_rhs(std::string mass_field, std::string flux_field,
351 boost::shared_ptr<VectorDouble> &mass_ptr,
352 boost::shared_ptr<MatrixDouble> &flux_ptr,
353 boost::shared_ptr<VectorDouble> &mass_dot_ptr,
354 boost::shared_ptr<VectorDouble> &flux_div_ptr) {
355
357
358 vol_ele_stiff_rhs->getOpPtrVector().push_back(
359 new OpCalculateScalarFieldValues(mass_field, mass_ptr));
360
361 vol_ele_stiff_rhs->getOpPtrVector().push_back(
362 new OpCalculateHVecVectorField<3>(flux_field, flux_ptr));
363
364 vol_ele_stiff_rhs->getOpPtrVector().push_back(
365 new OpCalculateScalarValuesDot(mass_field, mass_dot_ptr));
366
367 vol_ele_stiff_rhs->getOpPtrVector().push_back(
368 new OpCalculateHdivVectorDivergence<3, 2>(flux_field, flux_div_ptr));
370}
371
373 std::string flux_field,
374 boost::shared_ptr<PreviousData> &data1,
375 boost::shared_ptr<PreviousData> &data2,
376 std::map<int, BlockData> &block_map,
377 Range &surface) {
379 vol_ele_stiff_rhs->getOpPtrVector().push_back(
380 new OpAssembleStiffRhsTau<3>(flux_field, data1, block_map));
381
382 vol_ele_stiff_rhs->getOpPtrVector().push_back(
383 new OpAssembleStiffRhsV<3>(mass_field, data1, data2, RhsU(), block_map, surface));
385}
386
388RDProblem::update_stiff_lhs(std::string mass_field, std::string flux_field,
389 boost::shared_ptr<VectorDouble> &mass_ptr,
390 boost::shared_ptr<MatrixDouble> &flux_ptr) {
392 vol_ele_stiff_lhs->getOpPtrVector().push_back(
393 new OpCalculateScalarFieldValues(mass_field, mass_ptr));
394
395 vol_ele_stiff_lhs->getOpPtrVector().push_back(
396 new OpCalculateHVecVectorField<3>(flux_field, flux_ptr));
398}
399
401 std::string flux_field,
402 boost::shared_ptr<PreviousData> &data1,
403 boost::shared_ptr<PreviousData> &data2,
404 std::map<int, BlockData> &block_map) {
406 vol_ele_stiff_lhs->getOpPtrVector().push_back(
407 new OpAssembleLhsTauTau<3>(flux_field, data1, block_map));
408
409 vol_ele_stiff_lhs->getOpPtrVector().push_back(
410 new OpAssembleLhsVV(mass_field, data1, data2, DRhsU_u()));
411
412 vol_ele_stiff_lhs->getOpPtrVector().push_back(
413 new OpAssembleLhsTauV<3>(flux_field, mass_field, data1, block_map));
414
415 vol_ele_stiff_lhs->getOpPtrVector().push_back(
416 new OpAssembleLhsVTau(mass_field, flux_field));
418}
419
420
423 auto vol_rule = [](int, int, int p) -> int { return 2 * p; };
424 vol_ele_slow_rhs->getRuleHook = vol_rule;
425 natural_bdry_ele_slow_rhs->getRuleHook = vol_rule;
426
427 vol_ele_stiff_rhs->getRuleHook = vol_rule;
428
429 vol_ele_stiff_lhs->getRuleHook = vol_rule;
431}
432
434 boost::shared_ptr<FaceEle> &initial_ele,
435 double & init_val) {
437 initial_ele->getOpPtrVector().push_back(
438 new OpInitialMass(mass_field, surface, init_val));
440}
441
442MoFEMErrorCode RDProblem::apply_BC(std::string flux_field) {
444 CHKERR m_field.getInterface<ProblemsManager>()->removeDofsOnEntities(
445 "SimpleProblem", flux_field, essential_bdry_ents);
446
448}
451 CHKERR TSSetType(ts, TSARKIMEX);
452 CHKERR TSARKIMEXSetType(ts, TSARKIMEXA2);
453
456
459
465}
466
469 post_proc->addFieldValuesPostProc("U");
470 post_proc->addFieldValuesPostProc("F");
471 post_proc->addFieldValuesPostProc("V");
472
474 }
475
481 }
484 // Create solution vector
487 CHKERR DMoFEMMeshToLocalVector(dm, X, INSERT_VALUES, SCATTER_FORWARD);
488 // Solve problem
489 double ftime = 1;
490 CHKERR TSSetDM(ts, dm);
491 CHKERR TSSetDuration(ts, PETSC_DEFAULT, ftime);
492 CHKERR TSSetSolution(ts, X);
493 CHKERR TSSetFromOptions(ts);
494
495 if (1) {
496 SNES snes;
497 CHKERR TSGetSNES(ts, &snes);
498 KSP ksp;
499 CHKERR SNESGetKSP(snes, &ksp);
500 PC pc;
501 CHKERR KSPGetPC(ksp, &pc);
502 PetscBool is_pcfs = PETSC_FALSE;
503 PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
504 // Set up FIELDSPLIT
505 // Only is user set -pc_type fieldsplit
506 if (is_pcfs == PETSC_TRUE) {
507 IS is_mass, is_flux;
508 const MoFEM::Problem *problem_ptr;
509 CHKERR DMMoFEMGetProblemPtr(dm, &problem_ptr);
510 CHKERR m_field.getInterface<ISManager>()->isCreateProblemFieldAndRank(
511 problem_ptr->getName(), ROW, "U", 0, 1, &is_mass);
512 CHKERR m_field.getInterface<ISManager>()->isCreateProblemFieldAndRank(
513 problem_ptr->getName(), ROW, "F", 0, 1, &is_flux);
514 // CHKERR ISView(is_flux, PETSC_VIEWER_STDOUT_SELF);
515 // CHKERR ISView(is_mass, PETSC_VIEWER_STDOUT_SELF);
516
517 CHKERR PCFieldSplitSetIS(pc, NULL, is_mass);
518 CHKERR PCFieldSplitSetIS(pc, NULL, is_flux);
519
520
521 CHKERR ISDestroy(&is_flux);
522 CHKERR ISDestroy(&is_mass);
523 }
524 }
525
526 CHKERR TSSolve(ts, X);
528 }
529
532 global_error = 0;
533
534 CHKERR setup_system(); // only once
535
536 CHKERR add_fe(); // nb_species times
537
539
541
542 CHKERR extract_bd_ents("ESSENTIAL", "NATURAL"); // nb_species times
543
546
549
550 natural_bdry_ele_slow_rhs->getOpPtrVector().push_back(
552
553 CHKERR push_slow_rhs("U", "F", data1, data2); // nb_species times
554
556
559 vol_ele_stiff_rhs->getOpPtrVector().push_back(
561 CHKERR push_stiff_rhs("U", "F", data1, data2,
562 material_blocks, inner_surface2); // nb_species times
563
565
568
569 vol_ele_stiff_lhs->getOpPtrVector().push_back(
571 CHKERR push_stiff_lhs("U", "F", data1, data2,
572 material_blocks); // nb_species times
573 vol_ele_stiff_lhs->getOpPtrVector().push_back(
574 new OpSolveRecovery("V", data1, data2, RK4()));
575
579 boost::shared_ptr<FaceEle> initial_mass_ele(new FaceEle(m_field));
580
581 CHKERR apply_IC("U", inner_surface1, initial_mass_ele,
582 init_val_u); // nb_species times
583 CHKERR apply_IC("V", inner_surface1, initial_mass_ele,
584 init_val_v); // nb_species times
585
587 initial_mass_ele);
588
589 CHKERR apply_BC("F"); // nb_species times
590
591 CHKERR loop_fe(); // only once
592 post_proc->generateReferenceElementMesh(); // only once
593
595
596 monitor_ptr = boost::shared_ptr<Monitor>(
597 new Monitor(cOmm, rAnk, dm, post_proc)); // nb_species times
598 CHKERR output_result(); // only once
599 CHKERR solve(); // only once
601 }
602
603 int main(int argc, char *argv[]) {
604 const char param_file[] = "param_file.petsc";
606 try {
607 moab::Core mb_instance;
608 moab::Interface &moab = mb_instance;
609 MoFEM::Core core(moab);
610 DMType dm_name = "DMMOFEM";
611 CHKERR DMRegister_MoFEM(dm_name);
612
613 int order = 1;
614 CHKERR PetscOptionsGetInt(PETSC_NULL, "", "-order", &order, PETSC_NULL);
615 RDProblem reac_diff_problem(core, order + 1);
616 CHKERR reac_diff_problem.run_analysis();
617 }
620 return 0;
621 }
static Index< 'p', 3 > p
std::string param_file
int main()
Definition: adol-c_atom.cpp:46
MoFEM::FaceElementForcesAndSourcesCore FaceEle
ElementsAndOps< SPACE_DIM >::BoundaryEle BoundaryEle
@ ROW
Definition: definitions.h:123
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:372
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:60
@ DEMKOWICZ_JACOBI_BASE
Definition: definitions.h:66
@ L2
field with C-1 continuity
Definition: definitions.h:88
@ HCURL
field with continuous tangents
Definition: definitions.h:86
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ BLOCKSET
Definition: definitions.h:148
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
constexpr int order
static char help[]
Definition: elec_phys_2D.cpp:8
double init_val_v
double init_val_u
const double Tol
const int dim
PetscErrorCode DMMoFEMTSSetIFunction(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set TS implicit function evaluation function
Definition: DMMoFEM.cpp:786
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
Definition: DMMoFEM.cpp:509
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
Definition: DMMoFEM.cpp:412
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:47
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:572
PetscErrorCode DMMoFEMTSSetIJacobian(DM dm, 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 TS Jacobian evaluation function
Definition: DMMoFEM.cpp:839
PetscErrorCode DMCreateGlobalVector_MoFEM(DM dm, Vec *g)
DMShellSetCreateGlobalVector.
Definition: DMMoFEM.cpp:1153
bool checkMeshset(const int ms_id, const CubitBCType cubit_bc_type) const
check for CUBIT Id and CUBIT type
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
double dt
Definition: heat_method.cpp:26
const double v
phase velocity of light in medium (cm/ns)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
OpSetInvJacHcurlFaceImpl< 2 > OpSetInvJacHcurlFace
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:1042
PetscErrorCode DMMoFEMTSSetRHSFunction(DM dm, 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 TS the right hand side function
Definition: DMMoFEM.cpp:868
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
OpCalculateHOJacForFaceImpl< 2 > OpCalculateHOJacForFace
OpCalculateScalarFieldValuesDot OpCalculateScalarValuesDot
auto createTS(MPI_Comm comm)
OpSetContravariantPiolaTransformOnEdge2D OpSetContrariantPiolaTransformOnEdge
OpSetContravariantPiolaTransformOnFace2DImpl< 2 > OpSetContravariantPiolaTransformOnFace2D
constexpr double t
plate stiffness
Definition: plate.cpp:59
double operator()(const double u, const double v) const
double operator()(const double u, const double v) const
double operator()(const double x, const double y, const double z, const double t) const
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() 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.
Section manager is used to create indexes and sections.
Definition: ISManager.hpp:23
Interface for managing meshsets containing materials and boundary conditions.
Get vector field for H-div approximation.
Calculate divergence of vector field.
Get value at integration points for scalar field.
Make Hdiv space from Hcurl space in 2d.
keeps basic data about problem
Problem manager is used to build and partition problems.
Simple interface for fast problem set-up.
Definition: Simple.hpp:27
const std::string getBoundaryFEName() const
Get the Boundary FE Name.
Definition: Simple.hpp:348
MoFEMErrorCode loadFile(const std::string options, const std::string mesh_file_name, LoadFileFunc loadFunc=defaultLoadFileFunc)
Load mesh file.
Definition: Simple.cpp:194
MoFEMErrorCode addDataField(const std::string &name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_ZERO, int verb=-1)
Add field on domain.
Definition: Simple.cpp:320
MoFEMErrorCode addDomainField(const std::string &name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_ZERO, int verb=-1)
Add field on domain.
Definition: Simple.cpp:264
MoFEMErrorCode getOptions()
get options
Definition: Simple.cpp:180
MoFEMErrorCode getDM(DM *dm)
Get DM.
Definition: Simple.cpp:667
MoFEMErrorCode setFieldOrder(const std::string field_name, const int order, const Range *ents=NULL)
Set field order.
Definition: Simple.cpp:473
MoFEMErrorCode addBoundaryField(const std::string &name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_ZERO, int verb=-1)
Add field on boundary.
Definition: Simple.cpp:282
MoFEMErrorCode setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
Definition: Simple.cpp:611
const std::string getDomainFEName() const
Get the Domain FE Name.
Definition: Simple.hpp:341
intrusive_ptr for managing petsc objects
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
Postprocess on face.
MoFEMErrorCode update_slow_rhs(std::string mass_fiedl, boost::shared_ptr< VectorDouble > &mass_ptr)
boost::shared_ptr< MatrixDouble > flux_values_ptr2
boost::shared_ptr< FaceEle > vol_ele_stiff_lhs
std::map< int, BlockData > material_blocks
SmartPetscObj< TS > ts
MoFEMErrorCode update_stiff_rhs()
Range inner_surface1
SmartPetscObj< DM > dm
MoFEMErrorCode apply_BC(std::string flux_field)
boost::shared_ptr< Monitor > monitor_ptr
MoFEMErrorCode add_fe()
MoFEMErrorCode push_slow_rhs()
boost::shared_ptr< PreviousData > data1
MoFEMErrorCode update_vol_fe(boost::shared_ptr< FaceEle > &vol_ele, boost::shared_ptr< PreviousData > &data)
Range inner_surface2
Range essential_bdry_ents
MoFEMErrorCode post_proc_fields()
boost::shared_ptr< ForcesAndSourcesCore > null
boost::shared_ptr< VectorDouble > flux_divs_ptr2
MoFEMErrorCode loop_fe()
MoFEM::Interface & m_field
Simple * simple_interface
MoFEMErrorCode run_analysis()
MPI_Comm cOmm
boost::shared_ptr< VectorDouble > flux_divs_ptr1
MoFEMErrorCode extract_bd_ents(std::string ESSENTIAL, std::string NATURAL)
double global_error
boost::shared_ptr< BoundaryEle > natural_bdry_ele_slow_rhs
MoFEMErrorCode set_blockData(std::map< int, BlockData > &block_data_map)
const int rAnk
RDProblem(MoFEM::Core &core, const int order)
MoFEMErrorCode push_stiff_lhs()
MoFEMErrorCode push_stiff_rhs()
MoFEMErrorCode extract_initial_ents(int block_id, Range &surface)
MoFEMErrorCode solve()
boost::shared_ptr< VectorDouble > mass_values_ptr2
MoFEMErrorCode apply_IC(std::string mass_field, Range &surface, boost::shared_ptr< FaceEle > &initial_ele, double &init_val)
Range natural_bdry_ents
boost::shared_ptr< VectorDouble > mass_dots_ptr1
boost::shared_ptr< VectorDouble > mass_values_ptr1
boost::shared_ptr< VectorDouble > mass_dots_ptr2
boost::shared_ptr< PreviousData > data2
MoFEMErrorCode setup_system()
MoFEMErrorCode output_result()
std::vector< boost::shared_ptr< PreviousData > > data
boost::shared_ptr< FaceEle > vol_ele_slow_rhs
MoFEMErrorCode update_stiff_lhs()
MoFEMErrorCode set_integration_rule()
boost::shared_ptr< PostProcFaceOnRefinedMesh > post_proc
boost::shared_ptr< MatrixDouble > flux_values_ptr1
boost::shared_ptr< FaceEle > vol_ele_stiff_rhs
double operator()(const double u, const double v, const double dt) const
RhsV rhs_v
DRhsV_v Drhs_v
double operator()(const double u, const double v) const
double operator()(const double u, const double v) const