10#include <boost/math/constants/constants.hpp>
13#ifdef ENABLE_PYTHON_BINDING
14 #include <boost/python.hpp>
15 #include <boost/python/def.hpp>
16 #include <boost/python/numpy.hpp>
18namespace bp = boost::python;
19namespace np = boost::python::numpy;
24static char help[] =
"...\n\n";
64const double v =
c /
n;
100#include <boost/math/quadrature/gauss_kronrod.hpp>
101using namespace boost::math::quadrature;
134#ifdef ENABLE_PYTHON_BINDING
135 boost::shared_ptr<InterpPython> interpPythonPtr;
139 boost::shared_ptr<VectorDouble>
uAtPtsPtr;
156 std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE],
false);
157 doEntities[MBTRI] = doEntities[MBQUAD] =
true;
171 DataForcesAndSourcesCore::EntData &data) {
173 if (
type != MBVERTEX)
183 boost::shared_ptr<PostProcFaceEle> skin_post_proc,
184 boost::shared_ptr<BoundaryEle> skin_post_proc_integ,
185 boost::shared_ptr<CommonData> common_data_ptr,
203 auto vector_update = [&](
auto vec) {
206 CHKERR VecZeroEntries(vec);
207 CHKERR VecGhostUpdateBegin(vec, INSERT_VALUES, SCATTER_FORWARD);
208 CHKERR VecGhostUpdateEnd(vec, INSERT_VALUES, SCATTER_FORWARD);
210 CHKERR VecAssemblyBegin(vec);
211 CHKERR VecAssemblyEnd(vec);
212 CHKERR VecGhostUpdateBegin(vec, ADD_VALUES, SCATTER_REVERSE);
213 CHKERR VecGhostUpdateEnd(vec, ADD_VALUES, SCATTER_REVERSE);
214 CHKERR VecGhostUpdateBegin(vec, INSERT_VALUES, SCATTER_FORWARD);
215 CHKERR VecGhostUpdateEnd(vec, INSERT_VALUES, SCATTER_FORWARD);
224 <<
"Fluence rate integral: " << array[0];
227 MOFEM_LOG(
"PHOTON", Sev::inform) <<
"Testing";
234 const double *array2;
237 <<
"Error " << array2[0] <<
" N of Entities " << nrm2;
239 constexpr double eps = 0.02;
240 if (array2[0] / nrm2 >
eps)
242 "Not converged solution");
250 boost::lexical_cast<std::string>(
ts_step) +
256 "out_camera_" + boost::lexical_cast<std::string>(
ts_step) +
277 const double z,
double time) {
283 OpError(boost::shared_ptr<CommonData> &common_data_ptr)
289 const int nb_integration_pts = getGaussPts().size2();
290 auto t_w = getFTensor0IntegrationWeight();
292 auto t_coords = getFTensor1CoordsAtGaussPts();
297 const double volume = getMeasure();
300 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
302 const double alpha = t_w * volume;
305 double diff = t_val - analytical;
307 error += alpha * pow(diff, 2) / std::abs(t_val);
324#ifdef ENABLE_PYTHON_BINDING
325struct PhotonDiffusion::InterpPython {
326 InterpPython() =
default;
327 virtual ~InterpPython() =
default;
331 np::ndarray gauss_coords_x,
332 np::ndarray gauss_coords_y,
double cam_len_x,
333 double cam_len_y, np::ndarray &sens_vals);
335 template <
typename T>
336 inline std::vector<T>
337 py_list_to_std_vector(
const boost::python::object &iterable) {
338 return std::vector<T>(boost::python::stl_input_iterator<T>(iterable),
339 boost::python::stl_input_iterator<T>());
343 bp::object mainNamespace;
344 bp::object InterpFun;
347static boost::weak_ptr<PhotonDiffusion::InterpPython> interpPythonWeakPtr;
350#ifdef ENABLE_PYTHON_BINDING
352PhotonDiffusion::InterpPython::InterpInit(
const std::string py_file) {
356 bp::object main_module = bp::import(
"__main__");
357 mainNamespace = main_module.attr(
"__dict__");
359 bp::object ignored = bp::exec_file(py_file.c_str(), mainNamespace);
361 InterpFun = mainNamespace
364 }
catch (bp::error_already_set
const &) {
373 const std::string sens_image, np::ndarray gauss_coords_x,
375 np::ndarray &sens_vals) {
378 sens_vals = bp::extract<np::ndarray>(InterpFun(
381 }
catch (bp::error_already_set
const &) {
390inline np::ndarray convert_to_numpy(
VectorDouble &data,
int nb_gauss_pts,
392 auto dtype = np::dtype::get_builtin<double>();
393 auto size = bp::make_tuple(nb_gauss_pts);
394 auto stride = bp::make_tuple(3 *
sizeof(
double));
395 return (np::from_data(&data[
id], dtype, size, stride, bp::object()));
403 const std::string block_name) {
404#ifdef ENABLE_PYTHON_BINDING
405 if (
auto interp_ptr = interpPythonWeakPtr.lock()) {
408 bp::list python_coords;
410 for (
int idx = 0; idx < 3; ++idx) {
411 python_coords.append(convert_to_numpy(v_ref_coords, nb_gauss_pts, idx));
414 np::ndarray np_interp = np::empty(bp::make_tuple(nb_gauss_pts, 3),
415 np::dtype::get_builtin<double>());
417 auto interp_block_name =
"(.*)INTERPOLATION(.*)";
418 std::regex reg_interp_name(interp_block_name);
419 if (std::regex_match(block_name, reg_interp_name)) {
421 sens_image, bp::extract<np::ndarray>(python_coords[0]),
422 bp::extract<np::ndarray>(python_coords[1]),
cam_len_x,
424 "Failed py_Interp() python call");
430 if (np_interp.get_shape()[0] != nb_gauss_pts ||
431 np_interp.get_shape()[1] != 1) {
433 "Wrong shape of analytical expression returned from "
434 "python, expected: (" +
435 std::to_string(nb_gauss_pts) +
", 1), got: (" +
436 std::to_string(np_interp.get_shape()[0]) +
", " +
437 std::to_string(np_interp.get_shape()[1]) +
")");
439 double *interp_val_ptr =
reinterpret_cast<double *
>(np_interp.get_data());
442 v_interp.resize(nb_gauss_pts,
false);
443 for (
size_t gg = 0; gg < nb_gauss_pts; ++gg) {
444 v_interp(gg) = *(interp_val_ptr + gg);
449 "InterpPython pointer is expired");
473 commonDataPtr->uAtPtsPtr = boost::make_shared<VectorDouble>();
475 PetscInt ghosts[1] = {0};
487 commonDataPtr->approxVals = boost::make_shared<VectorDouble>();
535#ifdef ENABLE_PYTHON_BINDING
537 auto file_exists = [](std::string myfile) {
538 std::ifstream
file(myfile.c_str());
548 #ifdef ENABLE_PYTHON_BINDING
551 interpPythonPtr = boost::make_shared<PhotonDiffusion::InterpPython>();
553 interpPythonWeakPtr = interpPythonPtr;
565 MOFEM_LOG(
"PHOTON", Sev::inform) <<
"Refractive index: " <<
n;
566 MOFEM_LOG(
"PHOTON", Sev::inform) <<
"Speed of light (cm/ns): " <<
c;
567 MOFEM_LOG(
"PHOTON", Sev::inform) <<
"Phase velocity in medium (cm/ns): " <<
v;
568 MOFEM_LOG(
"PHOTON", Sev::inform) <<
"Inverse velocity : " <<
inv_v;
570 <<
"Absorption coefficient (cm^-1): " <<
mu_a;
572 <<
"Scattering coefficient (cm^-1): " <<
mu_sp;
573 MOFEM_LOG(
"PHOTON", Sev::inform) <<
"Diffusion coefficient D : " <<
D;
574 MOFEM_LOG(
"PHOTON", Sev::inform) <<
"Coefficient A : " <<
A;
575 MOFEM_LOG(
"PHOTON", Sev::inform) <<
"Coefficient h : " <<
h;
577 MOFEM_LOG(
"PHOTON", Sev::inform) <<
"Approximation order: " <<
order;
582 auto set_camera_skin_fe = [&]() {
585 Range camera_surface;
586 const std::string block_name =
"CAM";
590 if (
bit->getName().compare(0, block_name.size(), block_name) == 0) {
591 MOFEM_LOG(
"PHOTON", Sev::inform) <<
"Found CAM block";
593 bit->getMeshset(), 2, camera_surface,
true);
598 MOFEM_LOG(
"PHOTON", Sev::noisy) <<
"CAM block entities:\n"
604 "PHOTON_FLUENCE_RATE");
611 auto my_simple_set_up = [&]() {
627 CHKERR set_camera_skin_fe();
628 CHKERR my_simple_set_up();
643 CHKERR bc_mng->pushMarkDOFsOnEntities(
simple->getProblemName(),
"EXT",
644 "PHOTON_FLUENCE_RATE", 0, 0,
false);
647 Range boundary_faces;
649 std::string entity_name = it->getName();
650 if (entity_name.compare(0, 3,
"INT") == 0) {
652 boundary_faces,
true);
657 if (boundary_faces.empty()) {
659 std::string entity_name = it->getName();
661 boundary_faces,
true);
668 boundary_faces, 1,
false, boundary_ents, moab::Interface::UNION);
670 Range boundary_verts;
672 boundary_faces, 0,
false, boundary_verts, moab::Interface::UNION);
674 boundary_faces.merge(boundary_verts);
675 boundary_faces.merge(boundary_ents);
682 simple->getProblemName(),
"PHOTON_FLUENCE_RATE", boundary_faces);
699 auto set_domain = [&]() {
705 "PHOTON_FLUENCE_RATE",
"PHOTON_FLUENCE_RATE",
706 [](
double,
double,
double) ->
double {
return D; }));
712 "PHOTON_FLUENCE_RATE",
"PHOTON_FLUENCE_RATE", get_mass_coefficient));
714 auto grad_u_at_gauss_pts = boost::make_shared<MatrixDouble>();
715 auto u_at_gauss_pts = boost::make_shared<VectorDouble>();
716 auto dot_u_at_gauss_pts = boost::make_shared<VectorDouble>();
719 grad_u_at_gauss_pts));
725 dot_u_at_gauss_pts));
727 "PHOTON_FLUENCE_RATE", grad_u_at_gauss_pts,
728 [](
double,
double,
double) ->
double {
return D; }));
731 "PHOTON_FLUENCE_RATE", dot_u_at_gauss_pts,
732 [](
const double,
const double,
const double) {
return inv_v; }));
735 "PHOTON_FLUENCE_RATE", u_at_gauss_pts,
736 [](
const double,
const double,
const double) {
return mu_a; }));
743 auto set_boundary = [&]() {
751 auto u_at_gauss_pts = boost::make_shared<VectorDouble>();
755 for (
auto b : bc_map) {
756 if (std::regex_match(b.first, std::regex(
"(.*)EXT(.*)"))) {
758 "PHOTON_FLUENCE_RATE",
"PHOTON_FLUENCE_RATE",
760 [](
const double,
const double,
const double) {
return h; },
762 b.second->getBcEntsPtr()));
766 "PHOTON_FLUENCE_RATE", u_at_gauss_pts,
768 [](
const double,
const double,
const double) {
return h; },
770 b.second->getBcEntsPtr()));
797 auto create_post_process_element = [&]() {
798 auto post_froc_fe = boost::make_shared<PostProcEle>(
mField);
799 auto u_ptr = boost::make_shared<VectorDouble>();
800 auto grad_ptr = boost::make_shared<MatrixDouble>();
801 post_froc_fe->getOpPtrVector().push_back(
803 post_froc_fe->getOpPtrVector().push_back(
806 post_froc_fe->getOpPtrVector().push_back(
new OpPPMap(
807 post_froc_fe->getPostProcMesh(), post_froc_fe->getMapGaussPts(),
808 {{
"PHOTON_FLUENCE_RATE", u_ptr}},
809 {{
"GRAD_PHOTON_FLUENCE_RATE", grad_ptr}}, {}, {}));
813 auto create_post_process_camera_element = [&]() {
814 if (mField.check_finite_element(
"CAMERA_FE")) {
815 auto post_proc_skin = boost::make_shared<PostProcFaceEle>(mField);
817 auto u_ptr = boost::make_shared<VectorDouble>();
818 auto grad_ptr = boost::make_shared<MatrixDouble>();
825 op_loop_side->getOpPtrVector(), {H1});
826 op_loop_side->getOpPtrVector().push_back(
828 op_loop_side->getOpPtrVector().push_back(
832 post_proc_skin->getOpPtrVector().push_back(op_loop_side);
834 post_proc_skin->getOpPtrVector().push_back(
new OpPPMap(
835 post_proc_skin->getPostProcMesh(), post_proc_skin->getMapGaussPts(),
836 {{
"PHOTON_FLUENCE_RATE", u_ptr}},
837 {{
"GRAD_PHOTON_FLUENCE_RATE", grad_ptr}}, {}, {}));
839 return post_proc_skin;
841 return boost::shared_ptr<PostProcFaceEle>();
845 auto create_post_process_integ_camera_element = [&]() {
846 if (mField.check_finite_element(
"CAMERA_FE")) {
847 auto post_proc_integ_skin = boost::make_shared<BoundaryEle>(mField);
851 <<
"Creating post process integ camera element";
852 post_proc_integ_skin->getOpPtrVector().push_back(
854 post_proc_integ_skin->getOpPtrVector().push_back(
856 commonDataPtr->approxVals));
857 post_proc_integ_skin->getOpPtrVector().push_back(
858 new OpCameraInteg(commonDataPtr));
861 <<
"Creating testing camera error element";
862 post_proc_integ_skin->getOpPtrVector().push_back(
868 post_proc_integ_skin->getOpPtrVector(), {NOSPACE});
869 post_proc_integ_skin->getOpPtrVector().push_back(
871 commonDataPtr->uAtPtsPtr));
872 post_proc_integ_skin->getOpPtrVector().push_back(
875 return post_proc_integ_skin;
877 return boost::shared_ptr<BoundaryEle>();
883 auto set_time_monitor = [&](
auto dm,
auto solver) {
885 boost::shared_ptr<Monitor> monitor_ptr(
new Monitor(
886 dm, create_post_process_element(), create_post_process_camera_element(),
887 create_post_process_integ_camera_element(), commonDataPtr, mField));
888 boost::shared_ptr<ForcesAndSourcesCore> null;
890 monitor_ptr, null, null);
894 auto dm =
simple->getDM();
899 MOFEM_LOG(
"PHOTON", Sev::inform) <<
"reading vector in binary from file "
909 auto solver = pipeline_mng->createTSIM();
911 CHKERR TSSetSolution(solver, X);
912 CHKERR set_time_monitor(dm, solver);
913 CHKERR TSSetSolution(solver, X);
914 CHKERR TSSetFromOptions(solver);
916 CHKERR TSSetIJacobian(solver,
B,
B, PETSC_NULLPTR, PETSC_NULLPTR);
918 CHKERR TSSolve(solver, NULL);
920 CHKERR VecGhostUpdateBegin(X, INSERT_VALUES, SCATTER_FORWARD);
921 CHKERR VecGhostUpdateEnd(X, INSERT_VALUES, SCATTER_FORWARD);
957 const int nb_integration_pts = getGaussPts().size2();
958 const double area = getMeasure();
959 auto t_w = getFTensor0IntegrationWeight();
962 double values_integ = 0;
964#ifdef ENABLE_PYTHON_BINDING
974 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
977#ifdef ENABLE_PYTHON_BINDING
979 sens = sens_vals_vec(gg);
983 const double alpha = t_w * area * sens;
985 values_integ += alpha * t_val;
992 std::array<double, 1> values;
993 values[0] = values_integ;
1002 const char param_file[] =
"param_file.petsc";
1006 auto core_log = logging::core::get();
1012#ifdef ENABLE_PYTHON_BINDING
1019 MOFEM_LOG(
"PHOTON", Sev::inform) <<
"Python initialised";
1021 MOFEM_LOG(
"PHOTON", Sev::inform) <<
"Python NOT initialised";
1028 DMType dm_name =
"DMMOFEM";
1032 moab::Core mb_instance;
1033 moab::Interface &moab = mb_instance;
1047#ifdef ENABLE_PYTHON_BINDING
1049 MOFEM_LOG(
"PHOTON", Sev::inform) <<
"Finalizing Python";
1050 if (Py_FinalizeEx() < 0) {
void simple(double P1[], double P2[], double P3[], double c[], const int N)
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
ElementsAndOps< SPACE_DIM >::BoundaryEle BoundaryEle
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
#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()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
@ MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
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
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
auto createDMVector(DM dm, RowColData rc=RowColData::COL)
Get smart vector from DM.
auto createDMMatrix(DM dm)
Get smart matrix from DM.
boost::ptr_deque< UserDataOperator > & getOpDomainLhsPipeline()
Get the Op Domain Lhs Pipeline object.
boost::ptr_deque< UserDataOperator > & getOpBoundaryLhsPipeline()
Get the Op Boundary Lhs Pipeline object.
boost::ptr_deque< UserDataOperator > & getOpBoundaryRhsPipeline()
Get the Op Boundary Rhs Pipeline object.
boost::ptr_deque< UserDataOperator > & getOpDomainRhsPipeline()
Get the Op Domain Rhs Pipeline object.
virtual MoFEMErrorCode add_ents_to_finite_element_by_dim(const EntityHandle entities, const int dim, const std::string name, const bool recursive=true)=0
add entities to finite element
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
virtual MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)=0
Build finite elements.
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_field)=0
set finite element field data
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.
BcMapByBlockName & getBcMapByBlockName()
Get the boundary condition map.
FTensor::Index< 'i', SPACE_DIM > i
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGrad< 1, 1, SPACE_DIM > OpDomainGradGrad
FormsIntegrators< EdgeEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, 1 > OpBoundarySource
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesTensor< 1, 1, SPACE_DIM > OpDomainGradTimesVec
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasVector< double > VectorDouble
implementation of Data Operators for Forces and Sources
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.
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)
OpCalculateScalarFieldValuesFromPetscVecImpl< PetscData::CTX_SET_X_T > OpCalculateScalarFieldValuesDot
auto createGhostVector(MPI_Comm comm, PetscInt n, PetscInt N, PetscInt nghost, const PetscInt ghosts[])
Create smart ghost 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.
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesScalar< 1 > OpBoundaryTimeScalarField
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...
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesScalar< 1 > OpDomainTimesScalarField
constexpr int SPACE_DIM
[Define dimension]
const double c
speed of light (cm/ns)
char init_data_file_name[255]
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesTensor< 1, 1, SPACE_DIM > OpDomainGradTimesVec
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGrad< 1, 1, SPACE_DIM > OpDomainGradGrad
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, 1 > OpBoundaryMass
char interp_file_name[255]
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
VectorDouble interp_function(const std::string sens_image, MatrixDouble &m_ref_coords, int nb_gauss_pts, double cam_len_x, double cam_len_y, const std::string block_name)
double mu_a
absorption coefficient (cm^-1)
const double v
phase velocity of light in medium (cm/ns)
char interp_image_name[255]
const double n
refractive index of diffusive medium
static constexpr int approx_order
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesScalar< 1 > OpDomainTimesScalarField
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM > OpBoundaryMass
[Only used with Hencky/nonlinear material]
Add operators pushing bases from local to physical configuration.
Boundary condition manager for finite element problem setup.
virtual moab::Interface & get_moab()=0
virtual bool check_finite_element(const std::string &name) const =0
Check if finite element is in database.
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Deprecated interface functions.
Data on single entity (This is passed as argument to DataOperator::doWork)
Structure for user loop methods on finite elements.
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.
Get field gradients at integration pts for scalar field rank 0, i.e. vector field.
Specialization for double precision scalar field values calculation.
Element used to execute operators on side of the element.
Post post-proc data at points from hash maps.
Modify integration weights on face to take into account higher-order geometry.
PipelineManager interface.
boost::shared_ptr< FEMethod > & getDomainLhsFE()
Get domain left-hand side finite element.
boost::shared_ptr< FEMethod > & getBoundaryLhsFE()
Get boundary left-hand side 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.
boost::shared_ptr< FEMethod > & getBoundaryRhsFE()
Get 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.
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.
intrusive_ptr for managing petsc objects
PetscInt ts_step
Current time step number.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Base volume element used to integrate on skeleton.
Volume finite element base.
[Push operators to pipeline]
boost::shared_ptr< VectorDouble > uAtPtsPtr
SmartPetscObj< Vec > L2Vec
boost::shared_ptr< VectorDouble > approxVals
SmartPetscObj< Vec > petscVec
SmartPetscObj< Vec > resVec
MoFEMErrorCode postProcess()
Post-processing function executed at loop completion.
boost::shared_ptr< PostProcFaceEle > skinPostProc
boost::shared_ptr< CommonData > commonDataPtr
MoFEMErrorCode preProcess()
Pre-processing function executed at loop initialization.
MoFEMErrorCode operator()()
Main operator function executed for each loop iteration.
MoFEM::Interface & mField
boost::shared_ptr< BoundaryEle > skinPostProcInteg
Monitor(SmartPetscObj< DM > dm, boost::shared_ptr< PostProcEle > post_proc, boost::shared_ptr< PostProcFaceEle > skin_post_proc, boost::shared_ptr< BoundaryEle > skin_post_proc_integ, boost::shared_ptr< CommonData > common_data_ptr, MoFEM::Interface &m_field)
boost::shared_ptr< PostProcEle > postProc
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
[Integral_calc]
boost::shared_ptr< CommonData > commonDataPtr
OpCameraInteg(boost::shared_ptr< CommonData > common_data_ptr)
OpError(boost::shared_ptr< CommonData > &common_data_ptr)
static double sourceFunction(const double x, const double y, const double z, double time)
boost::shared_ptr< CommonData > commonDataPtr
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
boost::shared_ptr< VolSideFe > sideOpFe
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
OpGetScalarFieldGradientValuesOnSkin(boost::shared_ptr< VolSideFe > side_fe)
MoFEMErrorCode assembleSystem()
boost::shared_ptr< FEMethod > boundaryRhsFEPtr
MoFEMErrorCode solveSystem()
MoFEM::Interface & mField
MoFEMErrorCode readMesh()
MoFEMErrorCode outputResults()
MoFEMErrorCode initialCondition()
PhotonDiffusion(MoFEM::Interface &m_field)
boost::shared_ptr< FEMethod > domainLhsFEPtr
MoFEMErrorCode checkResults()
MoFEMErrorCode runProgram()
MoFEMErrorCode createCommonData()
boost::shared_ptr< FEMethod > boundaryLhsFEPtr
MoFEMErrorCode boundaryCondition()
MoFEMErrorCode setIntegrationRules()
MoFEMErrorCode setupProblem()
boost::shared_ptr< CommonData > commonDataPtr
boost::shared_ptr< std::vector< unsigned char > > boundaryMarker