v0.14.0
Classes | Macros | Typedefs | Functions | Variables
initial_diffusion.cpp File Reference
#include <stdlib.h>
#include <cmath>
#include <BasicFiniteElements.hpp>
#include <boost/math/quadrature/gauss_kronrod.hpp>

Go to the source code of this file.

Classes

struct  ElementsAndOps< DIM >
 
struct  OpError
 
struct  PhotonDiffusion
 

Macros

#define BOOST_MATH_GAUSS_NO_COMPUTE_ON_DEMAND
 

Typedefs

using DomainEle = VolumeElementForcesAndSourcesCore
 [Define dimension] More...
 
using DomainEleOp = DomainEle::UserDataOperator
 
using PostProcEle = PostProcBrokenMeshInMoab< DomainEle >
 
using OpDomainMass = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, 1 >
 
using OpDomainGradGrad = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGrad< 1, 1, SPACE_DIM >
 
using OpDomainTimesScalarField = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesScalar< 1 >
 
using OpDomainGradTimesVec = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesTensor< 1, 1, SPACE_DIM >
 
using OpDomainSource = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, 1 >
 

Functions

int main (int argc, char *argv[])
 

Variables

static char help [] = "...\n\n"
 
constexpr int SPACE_DIM = 3
 [Define dimension] More...
 
const double n = 1.44
 refractive index of diffusive medium More...
 
const double c = 30.
 speed of light (cm/ns) More...
 
const double v = c / n
 phase velocity of light in medium (cm/ns) More...
 
double mu_a
 absorption coefficient (cm^-1) More...
 
double mu_sp
 scattering coefficient (cm^-1) More...
 
double D
 
double slab_thickness
 
double beam_radius
 
double beam_centre_x
 
double beam_centre_y
 
double flux_magnitude = 1e3
 impulse magnitude More...
 
double initial_time
 
char out_file_name [255] = "init_file.dat"
 
int numHoLevels = 1
 
PetscBool output_volume = PETSC_FALSE
 

Macro Definition Documentation

◆ BOOST_MATH_GAUSS_NO_COMPUTE_ON_DEMAND

#define BOOST_MATH_GAUSS_NO_COMPUTE_ON_DEMAND

Definition at line 11 of file initial_diffusion.cpp.

Typedef Documentation

◆ DomainEle

[Define dimension]

Definition at line 23 of file initial_diffusion.cpp.

◆ DomainEleOp

Definition at line 24 of file initial_diffusion.cpp.

◆ OpDomainGradGrad

using OpDomainGradGrad = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::BiLinearForm<GAUSS>::OpGradGrad<1, 1, SPACE_DIM>

Definition at line 30 of file initial_diffusion.cpp.

◆ OpDomainGradTimesVec

using OpDomainGradTimesVec = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpGradTimesTensor<1, 1, SPACE_DIM>

Definition at line 34 of file initial_diffusion.cpp.

◆ OpDomainMass

using OpDomainMass = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::BiLinearForm<GAUSS>::OpMass<1, 1>

Definition at line 28 of file initial_diffusion.cpp.

◆ OpDomainSource

using OpDomainSource = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpSource<1, 1>

Definition at line 36 of file initial_diffusion.cpp.

◆ OpDomainTimesScalarField

using OpDomainTimesScalarField = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpBaseTimesScalar<1>
Examples
child_and_parent.cpp.

Definition at line 32 of file initial_diffusion.cpp.

◆ PostProcEle

Definition at line 25 of file initial_diffusion.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 399 of file initial_diffusion.cpp.

399  {
400 
401  // Initialisation of MoFEM/PETSc and MOAB data structures
402  const char param_file[] = "param_file.petsc";
403  MoFEM::Core::Initialize(&argc, &argv, param_file, help);
404 
405  // Add logging channel for example
406  auto core_log = logging::core::get();
407  core_log->add_sink(
408  LogManager::createSink(LogManager::getStrmWorld(), "INITIAL"));
409  LogManager::setLog("INITIAL");
410  MOFEM_LOG_TAG("INITIAL", "initial_diffusion")
411 
412  // Error handling
413  try {
414  // Register MoFEM discrete manager in PETSc
415  DMType dm_name = "DMMOFEM";
416  CHKERR DMRegister_MoFEM(dm_name);
417 
418  // Create MOAB instance
419  moab::Core mb_instance; // mesh database
420  moab::Interface &moab = mb_instance; // mesh database interface
421 
422  // Create MoFEM instance
423  MoFEM::Core core(moab); // finite element database
424  MoFEM::Interface &m_field = core; // finite element interface
425 
426  // Run the main analysis
427  PhotonDiffusion heat_problem(m_field);
428  CHKERR heat_problem.runProgram();
429  }
430  CATCH_ERRORS;
431 
432  // Finish work: cleaning memory, getting statistics, etc.
434 
435  return 0;
436 }

Variable Documentation

◆ beam_centre_x

double beam_centre_x

Definition at line 48 of file initial_diffusion.cpp.

◆ beam_centre_y

double beam_centre_y

Definition at line 49 of file initial_diffusion.cpp.

◆ beam_radius

double beam_radius

Definition at line 47 of file initial_diffusion.cpp.

◆ c

const double c = 30.

◆ D

double D

Definition at line 44 of file initial_diffusion.cpp.

◆ flux_magnitude

double flux_magnitude = 1e3

impulse magnitude

Definition at line 50 of file initial_diffusion.cpp.

◆ help

char help[] = "...\n\n"
static

Definition at line 15 of file initial_diffusion.cpp.

◆ initial_time

double initial_time

Definition at line 51 of file initial_diffusion.cpp.

◆ mu_a

double mu_a

absorption coefficient (cm^-1)

Definition at line 42 of file initial_diffusion.cpp.

◆ mu_sp

double mu_sp

scattering coefficient (cm^-1)

Definition at line 43 of file initial_diffusion.cpp.

◆ n

const double n = 1.44

refractive index of diffusive medium

Definition at line 38 of file initial_diffusion.cpp.

◆ numHoLevels

int numHoLevels = 1
Examples
navier_stokes.cpp.

Definition at line 54 of file initial_diffusion.cpp.

◆ out_file_name

char out_file_name[255] = "init_file.dat"

◆ output_volume

PetscBool output_volume = PETSC_FALSE

Definition at line 56 of file initial_diffusion.cpp.

◆ slab_thickness

double slab_thickness

Definition at line 46 of file initial_diffusion.cpp.

◆ SPACE_DIM

constexpr int SPACE_DIM = 3
constexpr

[Define dimension]

Definition at line 20 of file initial_diffusion.cpp.

◆ v

const double v = c / n
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
PhotonDiffusion
Definition: initial_diffusion.cpp:74
MoFEM::CoreTmp< 0 >::Finalize
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1975
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
MoFEM::DMRegister_MoFEM
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:43
MOFEM_LOG_TAG
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
help
static char help[]
Definition: initial_diffusion.cpp:15
MoFEM::CoreTmp< 0 >::Initialize
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
CATCH_ERRORS
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:372
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1102