v0.16.3
Loading...
Searching...
No Matches
radiation.cpp
Go to the documentation of this file.
1/**
2 * \file lesson6_radiation.cpp
3 * \example mofem/tutorials/scl-8_heat_radiation/radiation.cpp
4 *
5 * Using PipelineManager interface calculate the divergence of base functions,
6 * and integral of flux on the boundary. Since the h-div space is used, volume
7 * integral and boundary integral should give the same result.
8 */
9
10
11
12#include <MoFEM.hpp>
13
14using namespace MoFEM;
15
16static char help[] = "...\n\n";
17
18#include <MoFEM.hpp>
19
21using DomainEleOp = DomainEle::UserDataOperator;
30
31// Units
32// Temperature: Kelvins
33// Length: 1 km
34// Time: 1 s
35
36constexpr double heat_conductivity = ((0.4 + 0.7) / 2) * 1e3;
37
38constexpr double emissivity = 1;
39constexpr double boltzmann_constant = 5.670374419e-2;
40constexpr double Beta = emissivity * boltzmann_constant;
41
42constexpr double T_ambient = 2.7;
43struct Example {
44
45 Example(MoFEM::Interface &m_field) : mField(m_field) {}
46
48
49private:
51
52 static int integrationRule(int, int, int p_data) { return 2 * p_data; };
53
61
62 boost::shared_ptr<VectorDouble> approxVals;
63 boost::shared_ptr<MatrixDouble> approxGradVals;
64
65 struct OpRadiationLhs : public OpBase {
66
67 private:
68 boost::shared_ptr<VectorDouble> approxVals;
69
70 public:
71 OpRadiationLhs(boost::shared_ptr<VectorDouble> &approx_vals)
72 : OpBase("T", "T", OpBase::OPROWCOL), approxVals(approx_vals) {
73 this->sYmm = false;
74 }
75
76 MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
77 };
78
79 struct OpRadiationRhs : public OpBase {
80
81 private:
82 boost::shared_ptr<VectorDouble> approxVals;
83
84 public:
85 OpRadiationRhs(boost::shared_ptr<VectorDouble> &approx_vals)
86 : OpBase("T", "T", OpBase::OPROW), approxVals(approx_vals) {}
87
89 };
90
91 struct OpFluxRhs : public OpBase {
92
93 private:
94 FTensor::Index<'i', 2> i; ///< summit Index
95
96 public:
97 OpFluxRhs() : OpBase("T", "T", OpBase::OPROW) {}
98
100 };
101
103
104 private:
105 boost::shared_ptr<VectorDouble> approxVals;
107 double &surfaceArea;
108
109 public:
111 boost::shared_ptr<VectorDouble> &approx_vals, double &sum_temp,
112 double &surf)
113 : EdgeEleOp("T", "T", OpBase::OPROW), approxVals(approx_vals),
114 sumTemperature(sum_temp), surfaceArea(surf) {}
115
116 MoFEMErrorCode doWork(int side, EntityType type,
118 };
119};
120
125 CHKERR bC();
126 CHKERR OPs();
131}
132
133//! [Set up problem]
137 // Add field
140 constexpr int order = 3;
144}
145//! [Set up problem]
146
147//! [Create common data]
150 approxVals = boost::make_shared<VectorDouble>();
151 approxGradVals = boost::make_shared<MatrixDouble>();
153}
154//! [Create common data]
155
156//! [Boundary condition]
159 // Set initial values
160 auto set_initial_temperature = [&](VectorAdaptor &&field_data, double *xcoord,
161 double *ycoord, double *zcoord) {
163 field_data[0] = T_ambient;
165 };
166 FieldBlas *field_blas;
167 CHKERR mField.getInterface(field_blas);
168 CHKERR field_blas->setVertexDofs(set_initial_temperature, "T");
170}
171//! [Boundary condition]
172
173//! [Push operators to pipeline]
177 auto beta = [](const double r, const double, const double) {
178 return heat_conductivity * (2 * M_PI * r);
179 };
180
181 auto det_ptr = boost::make_shared<VectorDouble>();
182 auto jac_ptr = boost::make_shared<MatrixDouble>();
183 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
184
185 pipeline_mng->getOpDomainLhsPipeline().push_back(
186 new OpCalculateHOJac<2>(jac_ptr));
187 pipeline_mng->getOpDomainLhsPipeline().push_back(
188 new OpInvertMatrix<2>(jac_ptr, det_ptr, inv_jac_ptr));
189 pipeline_mng->getOpDomainLhsPipeline().push_back(
190 new OpSetHOInvJacToScalarBases<2>(H1, inv_jac_ptr));
191 pipeline_mng->getOpDomainLhsPipeline().push_back(
193
194 pipeline_mng->getOpDomainLhsPipeline().push_back(
195 new OpDomainGradGrad("T", "T", beta));
197
198 pipeline_mng->getOpDomainRhsPipeline().push_back(
199 new OpCalculateHOJac<2>(jac_ptr));
200 pipeline_mng->getOpDomainRhsPipeline().push_back(
201 new OpInvertMatrix<2>(jac_ptr, det_ptr, inv_jac_ptr));
202 pipeline_mng->getOpDomainRhsPipeline().push_back(
203 new OpSetHOInvJacToScalarBases<2>(H1, inv_jac_ptr));
204 pipeline_mng->getOpDomainRhsPipeline().push_back(
206
207 pipeline_mng->getOpDomainRhsPipeline().push_back(
209 pipeline_mng->getOpDomainRhsPipeline().push_back(
210 new OpDomainGradTimesVec("T", approxGradVals, beta));
212
213 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
215 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
216 new OpRadiationRhs(approxVals));
217 pipeline_mng->getOpBoundaryRhsPipeline().push_back(new OpFluxRhs());
219
220 pipeline_mng->getOpBoundaryLhsPipeline().push_back(
222 pipeline_mng->getOpBoundaryLhsPipeline().push_back(
223 new OpRadiationLhs(approxVals));
226}
227//! [Push operators to pipeline]
228
229//! [Solve]
234 auto ts = pipeline_mng->createTSIM();
235
236 double ftime = 1;
237 CHKERR TSSetMaxTime(ts, ftime);
238 CHKERR TSSetFromOptions(ts);
239 CHKERR TSSetExactFinalTime(ts, TS_EXACTFINALTIME_MATCHSTEP);
240
241 auto T = createDMVector(simple->getDM());
242 CHKERR DMoFEMMeshToLocalVector(simple->getDM(), T, INSERT_VALUES,
243 SCATTER_FORWARD);
244
245 CHKERR TSSolve(ts, T);
246 // Solver convergence is cheap to check and carries no magic numbers, so it
247 // stands alone rather than waiting on a "-test_nb"/"-test_name" selector.
248 {
249 PetscReal expected_time;
250 CHKERR TSGetTime(ts, &expected_time);
252 ts, expected_time, {1e-12, 1e-12}, "heat radiation");
253 }
254 CHKERR TSGetTime(ts, &ftime);
255
256 PetscInt steps, snesfails, rejects, nonlinits, linits;
257 CHKERR TSGetStepNumber(ts, &steps);
258 CHKERR TSGetSNESFailures(ts, &snesfails);
259 CHKERR TSGetStepRejections(ts, &rejects);
260 CHKERR TSGetSNESIterations(ts, &nonlinits);
261 CHKERR TSGetKSPIterations(ts, &linits);
262 MOFEM_LOG_C("EXAMPLE", Sev::inform,
263 "steps %d (%d rejected, %d SNES fails), ftime %g, nonlinits "
264 "%d, linits %d",
265 steps, rejects, snesfails, ftime, nonlinits, linits);
266
268}
269//! [Solve]
270
271//! [Postprocess results]
275 auto post_proc_fe =
276 boost::make_shared<PostProcBrokenMeshInMoab<DomainEle>>(mField);
277
278 auto t_ptr = boost::make_shared<VectorDouble>();
279 post_proc_fe->getOpPtrVector().push_back(
280 new OpCalculateScalarFieldValues("T", t_ptr));
281
283
284 post_proc_fe->getOpPtrVector().push_back(
285
286 new OpPPMap(post_proc_fe->getPostProcMesh(),
287 post_proc_fe->getMapGaussPts(),
288
289 {{"T", t_ptr}},
290
291 {}, {}, {}
292
293 )
294
295 );
296
297 pipeline_mng->getDomainPostProcFE() = post_proc_fe;
298
299 pipeline_mng->getOpBoundaryPostProcPipeline().push_back(
300 new OpCalculateScalarFieldValues("T", approxVals));
301
302 double sum_temperature;
303 double surface_area;
304 pipeline_mng->getOpBoundaryPostProcPipeline().push_back(
305 new OpCalcSurfaceAverageTemperature(approxVals, sum_temperature,
306 surface_area));
307 auto calc_surfcae_area_op =
308 pipeline_mng->getOpBoundaryPostProcPipeline().back();
309
310 sum_temperature = 0;
311 surface_area = 0;
312 CHKERR pipeline_mng->loopFiniteElementsPostProc();
313 CHKERR post_proc_fe->writeFile("out_radiation.h5m");
314
315 MOFEM_LOG_C("EXAMPLE", Sev::inform, "Surface area %3.4e [km]", surface_area);
316 MOFEM_LOG_C("EXAMPLE", Sev::inform,
317 "Average subsurface temperatute %3.4e [K]",
318 sum_temperature / surface_area);
319
321}
322//! [Postprocess results]
323
324//! [Check results]
326//! [Check results]
327
328int main(int argc, char *argv[]) {
329
330 // Initialisation of MoFEM/PETSc and MOAB data structures
331 const char param_file[] = "param_file.petsc";
332 MoFEM::Core::Initialize(&argc, &argv, param_file, help);
333
334 // Add logging channel for example
335 auto core_log = logging::core::get();
336 core_log->add_sink(
338 LogManager::setLog("EXAMPLE");
339 MOFEM_LOG_TAG("EXAMPLE", "example");
340
341 try {
342
343 //! [Register MoFEM discrete manager in PETSc]
344 DMType dm_name = "DMMOFEM";
345 CHKERR DMRegister_MoFEM(dm_name);
346 //! [Register MoFEM discrete manager in PETSc
347
348 //! [Create MoAB]
349 moab::Core mb_instance; ///< mesh database
350 moab::Interface &moab = mb_instance; ///< mesh database interface
351 //! [Create MoAB]
352
353 //! [Create MoFEM]
354 MoFEM::Core core(moab); ///< finite element database
355 MoFEM::Interface &m_field = core; ///< finite element database insterface
356 //! [Create MoFEM]
357
358 //! [Load mesh]
359 Simple *simple = m_field.getInterface<Simple>();
361 CHKERR simple->loadFile("");
362 //! [Load mesh]
363
364 //! [Example]
365 Example ex(m_field);
366 CHKERR ex.runProblem();
367 //! [Example]
368 }
370
372}
373
374//! [Radiation Lhs]
376 EntData &col_data) {
378 // get element volume
379 const double vol = this->getMeasure();
380 // get integration weights
381 auto t_w = getFTensor0IntegrationWeight();
382 // get base function gradient on rows
383 auto t_row_base = row_data.getFTensor0N();
384 // gat temperature at integration points
385 auto t_val = getFTensor0FromVec(*(approxVals));
386 // get coordinate at integration points
387 auto t_coords = getFTensor1CoordsAtGaussPts();
388
389 // loop over integration points
390 for (int gg = 0; gg != nbIntegrationPts; gg++) {
391
392 // Cylinder radius
393 const double r_cylinder = t_coords(0);
394
395 // take into account Jacobean
396 const double alpha = t_w * vol * Beta * (2 * M_PI * r_cylinder);
397 // loop over rows base functions
398 for (int rr = 0; rr != nbRows; ++rr) {
399 auto t_col_base = col_data.getFTensor0N(gg, 0);
400 // loop over columns
401 for (int cc = 0; cc != nbCols; cc++) {
402 if (std::abs(t_coords(0)) > std::numeric_limits<double>::epsilon()) {
403 locMat(rr, cc) += alpha * t_row_base * t_col_base * 4 *
404 std::pow(static_cast<double>(t_val), 3);
405 }
406 ++t_col_base;
407 }
408 ++t_row_base;
409 }
410
411 ++t_val;
412 ++t_coords;
413 ++t_w; // move to another integration weight
414 }
416}
417//! [Radiation Lhs]
418
419//! [Radiation Lhs]
422 // get element volume
423 const double vol = getMeasure();
424 // get integration weights
425 auto t_w = getFTensor0IntegrationWeight();
426 // get base function gradient on rows
427 auto t_row_base = row_data.getFTensor0N();
428 // gat temperature at integration points
429 auto t_val = getFTensor0FromVec(*(approxVals));
430 // get coordinate at integration points
431 auto t_coords = getFTensor1CoordsAtGaussPts();
432
433 // loop over integration points
434 for (int gg = 0; gg != nbIntegrationPts; gg++) {
435
436 // Cylinder radius
437 const double r_cylinder = t_coords(0);
438
439 // take into account Jacobean
440 const double alpha = t_w * vol * Beta * (2 * M_PI * r_cylinder);
441 // loop over rows base functions
442 for (int rr = 0; rr != nbRows; ++rr) {
443 if (std::abs(t_coords(0)) > std::numeric_limits<double>::epsilon()) {
444 locF[rr] += alpha * t_row_base *
445 (std::pow(static_cast<double>(t_val), 4) -
446 std::pow(T_ambient, 4));
447 }
448 ++t_row_base;
449 }
450 ++t_coords;
451 ++t_val;
452 ++t_w; // move to another integration weight
453 }
454
456}
457//! [Radiation Lhs]
458
459//! [Flux Rhs]
462 // get element volume
463 const double vol = getMeasure();
464 // get integration weights
465 auto t_w = getFTensor0IntegrationWeight();
466 // get base function gradient on rows
467 auto t_row_base = row_data.getFTensor0N();
468 // get coordinate at integration points
469 auto t_coords = getFTensor1CoordsAtGaussPts();
470 // // get time
471 const double time = getFEMethod()->ts_t;
472
473 // Look to https://doi.org/10.1016/j.icarus.2014.12.028s
474 constexpr double flux_p = -0.03e6;
475 constexpr double flux_c = -0.23e6;
476
477 // loop over integration points
478 for (int gg = 0; gg != nbIntegrationPts; gg++) {
479
480 // Cylinder radius
481 const double r_cylinder = t_coords(0);
482
483 const double r = std::sqrt(t_coords(i) * t_coords(i));
484 const double s = std::abs(t_coords(1)) / r;
485
486 // take into account Jacobean
487 const double alpha = t_w * vol * (2 * M_PI * r_cylinder);
488 // loop over rows base functions
489 for (int rr = 0; rr != nbRows; ++rr) {
490 locF[rr] += alpha * t_row_base * (s * flux_p + flux_c) * time;
491 ++t_row_base;
492 }
493 ++t_coords;
494 ++t_w; // move to another integration weight
495 }
496
498}
499//! [Flux Rhs]
500
501//! [Ave Temp]
503 int side, EntityType type, EntitiesFieldData::EntData &data) {
504
506 if (type == MBVERTEX) {
507 // get element volume
508 const double vol = getMeasure();
509 // get integration weights
510 auto t_w = getFTensor0IntegrationWeight();
511 // gat temperature at integration points
512 auto t_val = getFTensor0FromVec(*(approxVals));
513 // get coordinate at integration points
514 auto t_coords = getFTensor1CoordsAtGaussPts();
515 // number of integration pts
516 size_t nb_integration_pts = getGaussPts().size2();
517
518 // loop over integration points
519 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
520
521 // Cylinder radius
522 const double r_cylinder = t_coords(0);
523
524 // take into account Jacobean
525 const double alpha = t_w * vol * (2 * M_PI * r_cylinder);
526
527 sumTemperature += alpha * t_val;
528 surfaceArea += alpha;
529
530 ++t_coords;
531 ++t_val;
532 ++t_w; // move to another integration weight
533 }
534 }
536}
537
538//! [Ave Temp]
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
int main()
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition definitions.h:60
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ H1
continuous field
Definition definitions.h:85
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
constexpr int order
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:543
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition DMMoFEM.cpp:43
auto createDMVector(DM dm, RowColData rc=RowColData::COL)
Get smart vector from DM.
Definition DMMoFEM.hpp:1250
boost::ptr_deque< UserDataOperator > & getOpBoundaryPostProcPipeline()
Get the Op Boundary PostProc Pipeline object.
boost::ptr_deque< UserDataOperator > & getOpDomainLhsPipeline()
Get the Op Domain Lhs Pipeline object.
SmartPetscObj< TS > createTSIM(SmartPetscObj< DM > dm=nullptr)
Create TS (time) implicit solver.
boost::ptr_deque< UserDataOperator > & getOpBoundaryLhsPipeline()
Get the Op Boundary Lhs Pipeline object.
boost::ptr_deque< UserDataOperator > & getOpBoundaryRhsPipeline()
Get the Op Boundary Rhs Pipeline object.
MoFEMErrorCode loopFiniteElementsPostProc(SmartPetscObj< DM > dm=nullptr)
Iterate postprocessing finite elements.
boost::ptr_deque< UserDataOperator > & getOpDomainRhsPipeline()
Get the Op Domain Rhs Pipeline object.
@ PETSC
Standard PETSc assembly.
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
FTensor::Index< 'i', SPACE_DIM > i
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGrad< 1, 1, SPACE_DIM > OpDomainGradGrad
Definition helmholtz.cpp:25
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesTensor< 1, 1, SPACE_DIM > OpDomainGradTimesVec
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition Types.hpp:115
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
static auto getFTensor0FromVec(V &data)
Get tensor rank 0 (scalar) form data vector.
int r
Definition sdf.py:205
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
static char help[]
Definition radiation.cpp:16
constexpr double Beta
Definition radiation.cpp:40
constexpr double boltzmann_constant
Definition radiation.cpp:39
constexpr double T_ambient
Definition radiation.cpp:42
constexpr double emissivity
Definition radiation.cpp:38
constexpr double heat_conductivity
Definition radiation.cpp:36
OpCalcSurfaceAverageTemperature(boost::shared_ptr< VectorDouble > &approx_vals, double &sum_temp, double &surf)
boost::shared_ptr< VectorDouble > approxVals
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
[Flux Rhs]
FTensor::Index< 'i', 2 > i
summit Index
Definition radiation.cpp:94
MoFEMErrorCode iNtegrate(EntData &row_data)
[Radiation Lhs]
boost::shared_ptr< VectorDouble > approxVals
Definition radiation.cpp:68
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
[Radiation Lhs]
OpRadiationLhs(boost::shared_ptr< VectorDouble > &approx_vals)
Definition radiation.cpp:71
OpRadiationRhs(boost::shared_ptr< VectorDouble > &approx_vals)
Definition radiation.cpp:85
boost::shared_ptr< VectorDouble > approxVals
Definition radiation.cpp:82
MoFEMErrorCode iNtegrate(EntData &row_data)
[Radiation Lhs]
[Example]
Definition plastic.cpp:217
static int integrationRule(int, int, int p_data)
Definition radiation.cpp:52
boost::shared_ptr< VectorDouble > approxVals
Definition radiation.cpp:62
MoFEMErrorCode kspSolve()
[Push operators to pipeline]
Simple * simple
MoFEMErrorCode checkResults()
MoFEMErrorCode createCommonData()
Example(MoFEM::Interface &m_field)
Definition radiation.cpp:45
MoFEMErrorCode OPs()
MoFEMErrorCode runProblem()
boost::shared_ptr< MatrixDouble > approxGradVals
Definition radiation.cpp:63
MoFEM::Interface & mField
Reference to MoFEM interface.
Definition plastic.cpp:227
MoFEMErrorCode postProcess()
MoFEMErrorCode setupProblem()
MoFEMErrorCode bC()
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
Deprecated interface functions.
Data on single entity (This is passed as argument to DataOperator::doWork)
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
Basic algebra on fields.
Definition FieldBlas.hpp:21
MoFEMErrorCode setVertexDofs(VertexCoordsFunction lambda, const std::string field_name, Range *verts=nullptr)
Set DOFs on vertices using user function.
@ OPROW
operator doWork function is executed on FE rows
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.
int nbRows
number of dofs on rows
int nbIntegrationPts
number of integration points
MatrixDouble locMat
local entity block matrix
int nbCols
number if dof on column
Get field gradients at integration pts for scalar field rank 0, i.e. vector field.
Specialization for double precision scalar field values calculation.
Operator for inverting matrices at integration points.
Post post-proc data at points from hash maps.
Set inverse jacobian to base functions.
Modify integration weights on face to take into account higher-order geometry.
PipelineManager interface.
MoFEM::FaceElementForcesAndSourcesCore FaceEle
boost::shared_ptr< FEMethod > & getDomainPostProcFE()
Get domain postprocessing finite element.
MoFEMErrorCode setDomainRhsIntegrationRule(RuleHookFun rule)
Set integration rule for domain right-hand side finite element.
MoFEMErrorCode setBoundaryLhsIntegrationRule(RuleHookFun rule)
Set integration rule for boundary left-hand side finite element.
MoFEMErrorCode setBoundaryRhsIntegrationRule(RuleHookFun rule)
Set integration rule for boundary right-hand side finite element.
MoFEM::EdgeElementForcesAndSourcesCore EdgeEle
MoFEMErrorCode setDomainLhsIntegrationRule(RuleHookFun rule)
Set integration rule for domain left-hand side finite element.
Simple interface for fast problem set-up.
Definition Simple.hpp:27
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:261
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:355
MoFEMErrorCode getOptions()
get options
Definition Simple.cpp:180
MoFEMErrorCode getDM(DM *dm)
Get DM.
Definition Simple.cpp:799
MoFEMErrorCode setFieldOrder(const std::string field_name, const int order, const Range *ents=NULL)
Set field order.
Definition Simple.cpp:575
MoFEMErrorCode setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
Definition Simple.cpp:735
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.