v0.14.0
Classes | Typedefs | Functions | Variables
photon_diffusion.cpp File Reference
#include <stdlib.h>
#include <cmath>
#include <MoFEM.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 45 of file photon_diffusion.cpp.

◆ OpBoundarySource

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

Definition at line 49 of file photon_diffusion.cpp.

◆ OpBoundaryTimeScalarField

using OpBoundaryTimeScalarField = FormsIntegrators<BoundaryEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpBaseTimesScalar<1>
Examples
photon_diffusion.cpp.

Definition at line 47 of file photon_diffusion.cpp.

◆ OpDomainGradGrad

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

Definition at line 36 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 40 of file photon_diffusion.cpp.

◆ OpDomainMass

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

Definition at line 34 of file photon_diffusion.cpp.

◆ OpDomainSource

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

Definition at line 42 of file photon_diffusion.cpp.

◆ OpDomainTimesScalarField

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

Definition at line 38 of file photon_diffusion.cpp.

◆ OpPPMap

◆ PostProcEle

Definition at line 25 of file photon_diffusion.cpp.

◆ PostProcFaceEle

Definition at line 27 of file photon_diffusion.cpp.

◆ VolSideFe

Definition at line 31 of file photon_diffusion.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)
Examples
photon_diffusion.cpp.

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";
662  MoFEM::Core::Initialize(&argc, &argv, param_file, help);
663 
664  // Add logging channel for example
665  auto core_log = logging::core::get();
666  core_log->add_sink(
667  LogManager::createSink(LogManager::getStrmWorld(), "PHOTON"));
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  }
689  CATCH_ERRORS;
690 
691  // Finish work: cleaning memory, getting statistics, etc.
693 
694  return 0;
695 }

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
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
Examples
photon_diffusion.cpp.

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]

Examples
photon_diffusion.cpp.

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.

MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
help
static char help[]
Definition: photon_diffusion.cpp:13
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:2010
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
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
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:385
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1148