v0.16.0
Loading...
Searching...
No Matches
initial_diffusion.cpp
Go to the documentation of this file.
1/**
2 * \file inital_diffusion.cpp
3 * \example mofem/tutorials/scl-10/initial_diffusion.cpp
4 *
5 **/
6
7#include <stdlib.h>
8#include <cmath>
9#include <MoFEM.hpp>
10#include <SourceFunction.hpp>
11
12#define BOOST_MATH_GAUSS_NO_COMPUTE_ON_DEMAND
13
14using namespace MoFEM;
15
16static char help[] = "...\n\n";
17
18template <int DIM> struct ElementsAndOps {};
19
20//! [Define dimension]
21constexpr int SPACE_DIM = 3; //< Space dimension of problem, mesh
22//! [Define dimension]
23
25using DomainEleOp = DomainEle::UserDataOperator;
27
38
39const double n = 1.44; ///< refractive index of diffusive medium
40const double c = 30.; ///< speed of light (cm/ns)
41const double v = c / n; ///< phase velocity of light in medium (cm/ns)
42
43double mu_a; ///< absorption coefficient (cm^-1)
44double mu_sp; ///< scattering coefficient (cm^-1)
45double D;
46
48double beam_radius; //< spot radius
51double flux_magnitude = 1e3; ///< impulse magnitude
52const int kronrod_points =
53 15; ///< number of points for kronrod integration, can be 15, 31, 41, 51, or 61 (from boost library docs)
54///< This has been tested and gives the same result for any number of points. Increasing the number of points will increase the compute time, so 15 is used as default.
56
57char out_file_name[255] = "init_file.dat";
58;
60
61PetscBool output_volume = PETSC_FALSE;
62PetscBool testing = PETSC_FALSE;
63
64#include <boost/math/quadrature/gauss_kronrod.hpp>
65using namespace boost::math::quadrature;
66
68public:
70
71 // Declaration of the main function to run analysis
73
74 static inline double sourceFunction(const double x, const double y,
75 const double z) {
79 }
80 //! [sourceFunction]
81
82private:
83 // Declaration of other main functions called in runProgram()
93
94 // Main interfaces
96
97 struct CommonData {
98 boost::shared_ptr<VectorDouble> uAtPtsPtr;
101 };
102
103 boost::shared_ptr<CommonData> commonDataPtr;
104
105 struct OpError;
106};
107
109
111 boost::shared_ptr<CommonData> commonDataPtr;
112
113 OpError(boost::shared_ptr<CommonData> &common_data_ptr)
114 : DomainEleOp("PHOTON_FLUENCE_RATE", OPROW),
115 commonDataPtr(common_data_ptr) {}
116
117 MoFEMErrorCode doWork(int side, EntityType type, EntData &data) {
119
120 if (const size_t nb_dofs = data.getIndices().size()) {
121
122 const int nb_integration_pts = getGaussPts().size2();
123 auto t_w = getFTensor0IntegrationWeight();
124 auto t_val = getFTensor0FromVec(*(commonDataPtr->uAtPtsPtr));
125 auto t_coords = getFTensor1CoordsAtGaussPts();
126
127 VectorDouble nf(nb_dofs, false);
128 nf.clear();
129
130 FTensor::Index<'i', 3> i;
131 const double volume = getMeasure();
132
133 auto t_row_base = data.getFTensor0N();
134 double error = 0;
135 for (int gg = 0; gg != nb_integration_pts; ++gg) {
136
137 const double alpha = t_w * volume;
138 double diff = t_val - PhotonDiffusion::sourceFunction(
139 t_coords(0), t_coords(1), t_coords(2));
140
141 error += alpha * pow(diff, 2);
142
143 for (size_t r = 0; r != nb_dofs; ++r) {
144 nf[r] += alpha * t_row_base * diff;
145 ++t_row_base;
146 }
147
148 ++t_w;
149 ++t_val;
150 ++t_coords;
151 }
152
153 const int index = 0;
154 CHKERR VecSetValue(commonDataPtr->L2Vec, index, error, ADD_VALUES);
155 CHKERR VecSetValues(commonDataPtr->resVec, data, &nf[0], ADD_VALUES);
156 }
157
159 }
160};
161
172
175
176 auto *simple = mField.getInterface<Simple>();
177 CHKERR simple->addDomainField("PHOTON_FLUENCE_RATE", H1,
179 CHKERR simple->addBoundaryField("PHOTON_FLUENCE_RATE", H1,
181
182 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "", "-flux_magnitude",
183 &flux_magnitude, PETSC_NULLPTR);
184 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "", "-slab_thickness",
185 &slab_thickness, PETSC_NULLPTR);
186 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "", "-beam_radius", &beam_radius,
187 PETSC_NULLPTR);
188 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "", "-beam_centre_x",
189 &beam_centre_x, PETSC_NULLPTR);
190 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "", "-beam_centre_y",
191 &beam_centre_y, PETSC_NULLPTR);
192 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "", "-mu_a", &mu_a,
193 PETSC_NULLPTR);
194 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "", "-mu_sp", &mu_sp,
195 PETSC_NULLPTR);
196 CHKERR PetscOptionsGetScalar(PETSC_NULLPTR, "", "-initial_time",
197 &initial_time, PETSC_NULLPTR);
198
199 CHKERR PetscOptionsGetString(PETSC_NULLPTR, "", "-output_file", out_file_name,
200 255, PETSC_NULLPTR);
201 CHKERR PetscOptionsGetBool(PETSC_NULLPTR, "", "-output_volume",
202 &output_volume, PETSC_NULLPTR);
203 CHKERR PetscOptionsGetBool(PETSC_NULLPTR, "", "-testing", &testing,
204 PETSC_NULLPTR);
205
206 D = 1. / (3. * (mu_a + mu_sp));
207
208 MOFEM_LOG("INITIAL", Sev::inform) << "Refractive index: " << n;
209 MOFEM_LOG("INITIAL", Sev::inform) << "Speed of light (cm/ns): " << c;
210 MOFEM_LOG("INITIAL", Sev::inform)
211 << "Phase velocity in medium (cm/ns): " << v;
212 MOFEM_LOG("INITIAL", Sev::inform)
213 << "Absorption coefficient (cm^-1): " << mu_a;
214 MOFEM_LOG("INITIAL", Sev::inform)
215 << "Scattering coefficient (cm^-1): " << mu_sp;
216 MOFEM_LOG("INITIAL", Sev::inform) << "Diffusion coefficient D : " << D;
217 MOFEM_LOG("INITIAL", Sev::inform) << "Impulse magnitude: " << flux_magnitude;
218 MOFEM_LOG("INITIAL", Sev::inform) << "Compute time (ns): " << initial_time;
219 MOFEM_LOG("INITIAL", Sev::inform) << "Slab thickness: " << slab_thickness;
220
221 int order = 2;
222 CHKERR PetscOptionsGetInt(PETSC_NULLPTR, "", "-order", &order, PETSC_NULLPTR);
223
224 MOFEM_LOG("INITIAL", Sev::inform) << "Approximation order: " << order;
225 MOFEM_LOG("INITIAL", Sev::inform) << "Kronrod points: " << kronrod_points;
226
227 CHKERR simple->setFieldOrder("PHOTON_FLUENCE_RATE", order);
228
229 // if (numHoLevels > 0) {
230
231 // Range ho_ents;
232 // for (_IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(mField, BLOCKSET, it)) {
233 // if (it->getName().compare(0, 3, "CAM") == 0) {
234 // CHKERR mField.get_moab().get_entities_by_dimension(it->getMeshset(), 2,
235 // ho_ents, true);
236 // }
237 // }
238
239 // EntityHandle meshset;
240 // CHKERR mField.get_moab().create_meshset(MESHSET_SET, meshset);
241 // CHKERR mField.get_moab().add_entities(meshset, ho_ents);
242 // std::string field_name;
243 // field_name = "out_test_" +
244 // boost::lexical_cast<std::string>(mField.get_comm_rank()) +
245 // ".vtk";
246 // CHKERR mField.get_moab().write_file(field_name.c_str(), "VTK", "", &meshset,
247 // 1);
248 // CHKERR mField.get_moab().delete_entities(&meshset, 1);
249
250 // CHKERR mField.getInterface<CommInterface>()->synchroniseEntities(ho_ents);
251
252 // CHKERR simple->setFieldOrder("PHOTON_FLUENCE_RATE", order + 1, &ho_ents);
253
254 // CHKERR mField.getInterface<CommInterface>()->synchroniseFieldEntities(
255 // "PHOTON_FLUENCE_RATE");
256 // }
257
258 CHKERR simple->setUp();
259
261}
262
265 auto *simple = mField.getInterface<Simple>();
266
267 commonDataPtr = boost::make_shared<PhotonDiffusion::CommonData>();
268 commonDataPtr->resVec = createDMVector(simple->getDM());
269 commonDataPtr->L2Vec =
271 commonDataPtr->uAtPtsPtr = boost::make_shared<VectorDouble>();
272
274}
275
280
281//![interior_boundary]
284
285 auto *simple = mField.getInterface<Simple>();
286
287 // Get boundary faces marked in block named "INT"
288 Range boundary_faces;
290 std::string entity_name = it->getName();
291 if (entity_name.compare(0, 3, "INT") == 0) {
292 CHKERR it->getMeshsetIdEntitiesByDimension(mField.get_moab(), 2,
293 boundary_faces, true);
294 }
295 }
296
297 if (boundary_faces.empty()) {
299 std::string entity_name = it->getName();
300 CHKERR it->getMeshsetIdEntitiesByDimension(mField.get_moab(), 2,
301 boundary_faces, true);
302 }
303 }
304
305 // Get boundary edges in "INT"
306 Range boundary_ents;
307 CHKERR mField.get_moab().get_adjacencies(
308 boundary_faces, 1, false, boundary_ents, moab::Interface::UNION);
309 // Add vertices to boundary entities
310 Range boundary_verts;
311 CHKERR mField.get_moab().get_adjacencies(
312 boundary_faces, 0, false, boundary_verts, moab::Interface::UNION);
313
314 boundary_faces.merge(boundary_verts);
315 boundary_faces.merge(boundary_ents);
316
317 CHKERR mField.getInterface<CommInterface>()->synchroniseEntities(
318 boundary_faces);
319
320 EntityHandle meshset;
321 CHKERR mField.get_moab().create_meshset(MESHSET_SET, meshset);
322 CHKERR mField.get_moab().add_entities(meshset, boundary_faces);
323
324 // Remove DOFs as homogeneous boundary condition is used
325
326 CHKERR mField.getInterface<ProblemsManager>()->removeDofsOnEntities(
327 simple->getProblemName(), "PHOTON_FLUENCE_RATE", boundary_faces);
328
330}
331//! [interior_boundary]
332
333//! [assembleSystem]
337
338 auto integration_rule = [](int o_row, int o_col, int approx_order) {
339 return 2 * approx_order;
340 };
341
342 auto set_domain = [&]() {
345 pipeline_mng->getOpDomainLhsPipeline(), {H1});
346
347 pipeline_mng->getOpDomainLhsPipeline().push_back(new OpDomainMass(
348 "PHOTON_FLUENCE_RATE", "PHOTON_FLUENCE_RATE",
349 [](const double, const double, const double) { return 1; }));
350
351 pipeline_mng->getOpDomainRhsPipeline().push_back(
352 new OpDomainSource("PHOTON_FLUENCE_RATE", sourceFunction));
353
357 };
358
359 auto set_boundary = [&]() {
364 };
365
366 CHKERR set_domain();
367 CHKERR set_boundary();
368
370}
371//! [assembleSystem]
372
373//! [solveSystem]
376 auto *simple = mField.getInterface<Simple>();
377 auto *pipeline_mng = mField.getInterface<PipelineManager>();
378 auto solver = pipeline_mng->createKSP();
379
380 CHKERR KSPSetFromOptions(solver);
381
382 auto dm = simple->getDM();
383 auto X = createDMVector(dm);
384 auto F = vectorDuplicate(X);
385
386 MOFEM_LOG("INITIAL", Sev::inform) << "Solver start";
387 CHKERR KSPSolve(solver, F, X);
388 CHKERR VecGhostUpdateBegin(X, INSERT_VALUES, SCATTER_FORWARD);
389 CHKERR VecGhostUpdateEnd(X, INSERT_VALUES, SCATTER_FORWARD);
390 CHKERR DMoFEMMeshToLocalVector(dm, X, INSERT_VALUES, SCATTER_REVERSE);
391
392 MOFEM_LOG("INITIAL", Sev::inform)
393 << "writing vector in binary to " << out_file_name << " ...";
394 PetscViewer viewer;
395 PetscViewerBinaryOpen(PETSC_COMM_WORLD, out_file_name, FILE_MODE_WRITE,
396 &viewer);
397 VecView(X, viewer);
398 PetscViewerDestroy(&viewer);
399
400 MOFEM_LOG("INITIAL", Sev::inform) << "Solver done";
402}
403//! [solveSystem]
404
407 auto *pipeline_mng = mField.getInterface<PipelineManager>();
408 auto post_proc_fe = boost::make_shared<PostProcEle>(mField);
409
410 auto u_ptr = boost::make_shared<VectorDouble>();
411 post_proc_fe->getOpPtrVector().push_back(
412 new OpCalculateScalarFieldValues("PHOTON_FLUENCE_RATE", u_ptr));
413
415
416 post_proc_fe->getOpPtrVector().push_back(
417
418 new OpPPMap(
419
420 post_proc_fe->getPostProcMesh(), post_proc_fe->getMapGaussPts(),
421
422 {{"PHOTON_FLUENCE_RATE", u_ptr}},
423
424 {},
425
426 {},
427
428 {})
429
430 );
431
432 pipeline_mng->getDomainPostProcFE() = post_proc_fe;
433 CHKERR pipeline_mng->loopFiniteElementsPostProc();
434 CHKERR post_proc_fe->writeFile("out_initial.h5m");
436}
437
438//! [runProgram]
456//! [runProgram]
457
458//! [Check results]
462 pipeline_mng->getDomainLhsFE().reset();
463 pipeline_mng->getDomainRhsFE().reset();
464 pipeline_mng->getOpDomainRhsPipeline().clear();
465 pipeline_mng->getOpDomainRhsPipeline().push_back(
466 new OpCalculateScalarFieldValues("PHOTON_FLUENCE_RATE",
467 commonDataPtr->uAtPtsPtr));
468 pipeline_mng->getOpDomainRhsPipeline().push_back(new OpError(commonDataPtr));
469 CHKERR pipeline_mng->loopFiniteElements();
470 CHKERR VecAssemblyBegin(commonDataPtr->L2Vec);
471 CHKERR VecAssemblyEnd(commonDataPtr->L2Vec);
472 CHKERR VecAssemblyBegin(commonDataPtr->resVec);
473 CHKERR VecAssemblyEnd(commonDataPtr->resVec);
474 double nrm2;
475 CHKERR VecNorm(commonDataPtr->resVec, NORM_2, &nrm2);
476 const double *array;
477 CHKERR VecGetArrayRead(commonDataPtr->L2Vec, &array);
478 if (mField.get_comm_rank() == 0)
479 PetscPrintf(PETSC_COMM_SELF, "Error %6.4e Vec norm %6.4e\n",
480 std::sqrt(array[0]), nrm2);
481 CHKERR VecRestoreArrayRead(commonDataPtr->L2Vec, &array);
482 constexpr double eps = 1e-8;
483 if (nrm2 > eps)
484 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
485 "Not converged solution");
487}
488//! [Check results]
489
490int main(int argc, char *argv[]) {
491
492 // Initialisation of MoFEM/PETSc and MOAB data structures
493 const char param_file[] = "param_file.petsc";
494 MoFEM::Core::Initialize(&argc, &argv, param_file, help);
495
496 // Add logging channel for example
497 auto core_log = logging::core::get();
498 core_log->add_sink(
500 LogManager::setLog("INITIAL");
501 MOFEM_LOG_TAG("INITIAL", "initial_diffusion")
502
503 // Error handling
504 try {
505 // Register MoFEM discrete manager in PETSc
506 DMType dm_name = "DMMOFEM";
507 CHKERR DMRegister_MoFEM(dm_name);
508
509 // Create MOAB instance
510 moab::Core mb_instance; // mesh database
511 moab::Interface &moab = mb_instance; // mesh database interface
512
513 // Create MoFEM instance
514 MoFEM::Core core(moab); // finite element database
515 MoFEM::Interface &m_field = core; // finite element interface
516
517 // Run the main analysis
518 PhotonDiffusion heat_problem(m_field);
519 CHKERR heat_problem.runProgram();
520 }
522
523 // Finish work: cleaning memory, getting statistics, etc.
525
526 return 0;
527}
std::string type
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition acoustic.cpp:69
int main()
static const double eps
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, FIELD_DIM > OpDomainSource
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, FIELD_DIM > OpDomainMass
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition definitions.h:60
@ 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 ...
@ SIDESET
@ BLOCKSET
@ 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.
@ F
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
auto createDMVector(DM dm, RowColData rc=RowColData::COL)
Get smart vector from DM.
Definition DMMoFEM.hpp:1237
MoFEMErrorCode loopFiniteElements(SmartPetscObj< DM > dm=nullptr)
Iterate finite elements.
boost::ptr_deque< UserDataOperator > & getOpDomainLhsPipeline()
Get the Op Domain Lhs Pipeline object.
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(channel, severity)
Log.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
#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.
FTensor::Index< 'i', SPACE_DIM > i
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGrad< 1, 1, SPACE_DIM > OpDomainGradGrad
Definition helmholtz.cpp:25
double mu_sp
scattering coefficient (cm^-1)
static char help[]
double flux_magnitude
impulse magnitude
const int kronrod_points
This has been tested and gives the same result for any number of points. Increasing the number of poi...
char out_file_name[255]
double beam_centre_y
int numHoLevels
constexpr int SPACE_DIM
[Define dimension]
PetscBool testing
double beam_centre_x
const double c
speed of light (cm/ns)
double slab_thickness
double beam_radius
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesTensor< 1, 1, SPACE_DIM > OpDomainGradTimesVec
double initial_time
double D
PetscBool output_volume
double mu_a
absorption coefficient (cm^-1)
const double v
phase velocity of light in medium (cm/ns)
const double n
refractive index of diffusive medium
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, 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.
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
static auto getFTensor0FromVec(V &data)
Get tensor rank 0 (scalar) form data vector.
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
double sourceFunctionEval(const double x, const double y, const double z, const double beam_radius, const double beam_centre_x, const double beam_centre_y, const double slab_thickness, const double mu_a, const double mu_sp, const double flux_magnitude, double initial_time, const double v, const double D)
Pulse is infinitely short.
double mu_sp
scattering coefficient (cm^-1)
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, 1 > OpDomainMass
double flux_magnitude
impulse magnitude
const int kronrod_points
This has been tested and gives the same result for any number of points. Increasing the number of poi...
double beam_centre_y
PetscBool testing
double beam_centre_x
const double c
speed of light (cm/ns)
double slab_thickness
double beam_radius
int order
double D
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, 1 > OpDomainSource
PetscBool output_volume
double mu_a
absorption coefficient (cm^-1)
const double v
phase velocity of light in medium (cm/ns)
const double n
refractive index of diffusive medium
static constexpr int approx_order
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesScalar< 1 > OpDomainTimesScalarField
Definition seepage.cpp:141
[Operators_definition]
Add operators pushing bases from local to physical configuration.
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: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.
const VectorInt & getIndices() const
Get global indices of degrees of freedom on entity.
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.
Specialization for double precision scalar field values calculation.
Post post-proc data at points from hash maps.
PipelineManager interface.
boost::shared_ptr< FEMethod > & getDomainRhsFE()
Get domain right-hand side finite element.
boost::shared_ptr< FEMethod > & getDomainLhsFE()
Get domain left-hand side finite element.
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.
MoFEMErrorCode setDomainLhsIntegrationRule(RuleHookFun rule)
Set integration rule for domain left-hand side finite element.
Problem manager is used to build and partition problems.
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
intrusive_ptr for managing petsc objects
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
boost::shared_ptr< VectorDouble > uAtPtsPtr
OpError(boost::shared_ptr< CommonData > &common_data_ptr)
boost::shared_ptr< CommonData > commonDataPtr
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
MoFEMErrorCode assembleSystem()
[interior_boundary]
MoFEMErrorCode solveSystem()
[assembleSystem]
MoFEM::Interface & mField
MoFEMErrorCode readMesh()
[sourceFunction]
MoFEMErrorCode outputResults()
[solveSystem]
MoFEMErrorCode initialCondition()
PhotonDiffusion(MoFEM::Interface &m_field)
MoFEMErrorCode checkResults()
[runProgram]
MoFEMErrorCode runProgram()
[runProgram]
MoFEMErrorCode createCommonData()
MoFEMErrorCode boundaryCondition()
[interior_boundary]
static double sourceFunction(const double x, const double y, const double z)
MoFEMErrorCode setupProblem()
boost::shared_ptr< CommonData > commonDataPtr