v0.14.0
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
photon_diffusion.cpp File Reference
#include <stdlib.h>
#include <cmath>
#include <BasicFiniteElements.hpp>

Go to the source code of this file.

Classes

struct  ElementsAndOps< DIM >
 
struct  PhotonDiffusion
 
struct  PhotonDiffusion::CommonData
 
struct  PhotonDiffusion::OpCameraInteg
 
struct  PhotonDiffusion::OpGetScalarFieldGradientValuesOnSkin
 
struct  PhotonDiffusion::Monitor
 

Typedefs

using DomainEle = VolumeElementForcesAndSourcesCore
 [Define dimension]
 
using DomainEleOp = DomainEle::UserDataOperator
 
using BoundaryEle = FaceElementForcesAndSourcesCore
 
using BoundaryEleOp = BoundaryEle::UserDataOperator
 
using PostProcEle = PostProcBrokenMeshInMoab<VolumeElementForcesAndSourcesCore>
 
using PostProcFaceEle
 
using OpPPMap = OpPostProcMapInMoab<SPACE_DIM, SPACE_DIM>
 
using VolSideFe = VolumeElementForcesAndSourcesCoreOnSide
 
using OpDomainMass
 
using OpDomainGradGrad
 
using OpDomainTimesScalarField
 
using OpDomainGradTimesVec
 
using OpDomainSource
 
using OpBoundaryMass
 
using OpBoundaryTimeScalarField
 
using OpBoundarySource
 

Functions

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

Variables

static char help [] = "...\n\n"
 
constexpr int SPACE_DIM = 3
 [Define dimension]
 
const double n = 1.44
 refractive index of diffusive medium
 
const double c = 30.
 speed of light (cm/ns)
 
const double v = c / n
 phase velocity of light in medium (cm/ns)
 
const double inv_v = 1. / v
 
double mu_a
 absorption coefficient (cm^-1)
 
double mu_sp
 scattering coefficient (cm^-1)
 
double D
 
double A
 
double h
 
PetscBool from_initial = PETSC_TRUE
 
PetscBool output_volume = PETSC_FALSE
 
PetscBool output_camera = PETSC_FALSE
 
int order = 2
 
int save_every_nth_step = 1
 
char init_data_file_name [255] = "init_file.dat"
 
int numHoLevels = 1
 

Typedef Documentation

◆ BoundaryEle

Definition at line 23 of file photon_diffusion.cpp.

◆ BoundaryEleOp

Definition at line 24 of file photon_diffusion.cpp.

◆ DomainEle

[Define dimension]

Definition at line 21 of file photon_diffusion.cpp.

◆ DomainEleOp

Definition at line 22 of file photon_diffusion.cpp.

◆ OpBoundaryMass

◆ OpBoundarySource

◆ OpBoundaryTimeScalarField

◆ OpDomainGradGrad

Initial value:
Examples
photon_diffusion.cpp.

Definition at line 35 of file photon_diffusion.cpp.

◆ OpDomainGradTimesVec

◆ OpDomainMass

using OpDomainMass

◆ OpDomainSource

◆ OpDomainTimesScalarField

◆ OpPPMap

◆ PostProcEle

Definition at line 25 of file photon_diffusion.cpp.

◆ PostProcFaceEle

◆ VolSideFe

Definition at line 31 of file photon_diffusion.cpp.

Function Documentation

◆ main()

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

Definition at line 658 of file photon_diffusion.cpp.

658 {
659
660 // Initialisation of MoFEM/PETSc and MOAB data structures
661 const char param_file[] = "param_file.petsc";
663
664 // Add logging channel for example
665 auto core_log = logging::core::get();
666 core_log->add_sink(
668 LogManager::setLog("PHOTON");
669 MOFEM_LOG_TAG("PHOTON", "photon_diffusion")
670
671 // Error handling
672 try {
673 // Register MoFEM discrete manager in PETSc
674 DMType dm_name = "DMMOFEM";
675 CHKERR DMRegister_MoFEM(dm_name);
676
677 // Create MOAB instance
678 moab::Core mb_instance; // mesh database
679 moab::Interface &moab = mb_instance; // mesh database interface
680
681 // Create MoFEM instance
682 MoFEM::Core core(moab); // finite element database
683 MoFEM::Interface &m_field = core; // finite element interface
684
685 // Run the main analysis
686 PhotonDiffusion heat_problem(m_field);
687 CHKERR heat_problem.runProgram();
688 }
690
691 // Finish work: cleaning memory, getting statistics, etc.
693
694 return 0;
695}
std::string param_file
#define CATCH_ERRORS
Catch errors.
#define CHKERR
Inline error check.
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition DMMoFEM.cpp:47
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
static char help[]
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.
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.

Variable Documentation

◆ A

double A
Examples
photon_diffusion.cpp.

Definition at line 59 of file photon_diffusion.cpp.

◆ c

const double c = 30.

speed of light (cm/ns)

Examples
photon_diffusion.cpp.

Definition at line 52 of file photon_diffusion.cpp.

◆ D

double D
Examples
photon_diffusion.cpp.

Definition at line 58 of file photon_diffusion.cpp.

◆ from_initial

PetscBool from_initial = PETSC_TRUE
Examples
photon_diffusion.cpp.

Definition at line 62 of file photon_diffusion.cpp.

◆ h

double h
Examples
free_surface.cpp, and photon_diffusion.cpp.

Definition at line 60 of file photon_diffusion.cpp.

◆ help

char help[] = "...\n\n"
static
Examples
photon_diffusion.cpp.

Definition at line 13 of file photon_diffusion.cpp.

◆ init_data_file_name

char init_data_file_name[255] = "init_file.dat"
Examples
photon_diffusion.cpp.

Definition at line 69 of file photon_diffusion.cpp.

◆ inv_v

const double inv_v = 1. / v
Examples
photon_diffusion.cpp.

Definition at line 54 of file photon_diffusion.cpp.

◆ mu_a

double mu_a

absorption coefficient (cm^-1)

Examples
photon_diffusion.cpp.

Definition at line 56 of file photon_diffusion.cpp.

◆ mu_sp

double mu_sp

scattering coefficient (cm^-1)

Examples
photon_diffusion.cpp.

Definition at line 57 of file photon_diffusion.cpp.

◆ n

const double n = 1.44

refractive index of diffusive medium

Examples
photon_diffusion.cpp.

Definition at line 51 of file photon_diffusion.cpp.

◆ numHoLevels

int numHoLevels = 1

Definition at line 70 of file photon_diffusion.cpp.

◆ order

int order = 2
Examples
photon_diffusion.cpp.

Definition at line 66 of file photon_diffusion.cpp.

◆ output_camera

PetscBool output_camera = PETSC_FALSE
Examples
photon_diffusion.cpp.

Definition at line 64 of file photon_diffusion.cpp.

◆ output_volume

PetscBool output_volume = PETSC_FALSE
Examples
photon_diffusion.cpp.

Definition at line 63 of file photon_diffusion.cpp.

◆ save_every_nth_step

int save_every_nth_step = 1

◆ SPACE_DIM

constexpr int SPACE_DIM = 3
constexpr

[Define dimension]

Definition at line 18 of file photon_diffusion.cpp.

◆ v

const double v = c / n

phase velocity of light in medium (cm/ns)

Examples
photon_diffusion.cpp.

Definition at line 53 of file photon_diffusion.cpp.