v0.13.1
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] More...
 
using DomainEleOp = DomainEle::UserDataOperator
 
using BoundaryEle = FaceElementForcesAndSourcesCore
 
using BoundaryEleOp = BoundaryEle::UserDataOperator
 
using PostProcEle = PostProcBrokenMeshInMoab< VolumeElementForcesAndSourcesCore >
 
using PostProcFaceEle = PostProcBrokenMeshInMoab< FaceElementForcesAndSourcesCore >
 
using OpPPMap = OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM >
 
using VolSideFe = VolumeElementForcesAndSourcesCoreOnSide
 
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 >
 
using OpBoundaryMass = FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, 1 >
 
using OpBoundaryTimeScalarField = FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesScalar< 1 >
 
using OpBoundarySource = FormsIntegrators< BoundaryEleOp >::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...
 
const double inv_v = 1. / v
 
double mu_a
 absorption coefficient (cm^-1) More...
 
double mu_sp
 scattering coefficient (cm^-1) More...
 
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

using OpBoundaryMass = FormsIntegrators<BoundaryEleOp>::Assembly< PETSC>::BiLinearForm<GAUSS>::OpMass<1, 1>
Examples
photon_diffusion.cpp.

Definition at line 44 of file photon_diffusion.cpp.

◆ OpBoundarySource

using OpBoundarySource = FormsIntegrators<BoundaryEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpSource<1, 1>

Definition at line 48 of file photon_diffusion.cpp.

◆ OpBoundaryTimeScalarField

Examples
photon_diffusion.cpp.

Definition at line 46 of file photon_diffusion.cpp.

◆ OpDomainGradGrad

Examples
photon_diffusion.cpp.

Definition at line 35 of file photon_diffusion.cpp.

◆ OpDomainGradTimesVec

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

Definition at line 39 of file photon_diffusion.cpp.

◆ OpDomainMass

using OpDomainMass = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::BiLinearForm<GAUSS>::OpMass<1, 1>
Examples
photon_diffusion.cpp.

Definition at line 33 of file photon_diffusion.cpp.

◆ OpDomainSource

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

Definition at line 41 of file photon_diffusion.cpp.

◆ OpDomainTimesScalarField

Examples
photon_diffusion.cpp.

Definition at line 37 of file photon_diffusion.cpp.

◆ OpPPMap

◆ PostProcEle

Definition at line 25 of file photon_diffusion.cpp.

◆ PostProcFaceEle

Definition at line 26 of file photon_diffusion.cpp.

◆ 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.
Definition: definitions.h:372
#define CHKERR
Inline error check.
Definition: definitions.h:535
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMMoFEM.cpp:47
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
Definition: LogManager.cpp:364
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:332
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.
Definition: LogManager.cpp:279
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
Definition: LogManager.cpp:323

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.