Commit ec87706a authored by steffen.schotthoefer's avatar steffen.schotthoefer
Browse files

Merge branch 'develop' into 'master'

Develop into master

See merge request !32

Former-commit-id: 5ee9e9c7
parents 1b982cfd 225abf3b
......@@ -12,7 +12,7 @@ set( KITRT_DEBUG_OPTIONS -Wall -Wextra -Wpedantic )
### LIBRARIES ###################################
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
find_package( OpenMP REQUIRED )
......@@ -82,6 +82,8 @@ target_compile_options( ${CMAKE_PROJECT_NAME} PUBLIC "$<$<CONFIG:RELEASE>:${KITR
### BUILD UNIT TESTS ############################
include( CTest )
set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/ext/Catch2/contrib ${CMAKE_MODULE_PATH} )
include( Catch )
set( CATCH_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/ext/Catch2/single_include/catch2 )
add_compile_definitions( BUILD_TESTING )
add_compile_definitions( TESTS_PATH="${CMAKE_SOURCE_DIR}/tests/" )
......@@ -99,6 +101,6 @@ if( CMAKE_COMPILER_IS_GNUCXX )
endif()
target_compile_options( unit_tests PUBLIC "$<$<CONFIG:RELWITHDEBINFO>:${KITRT_RELWITHDEBINFO_OPTIONS}>" )
target_compile_options( unit_tests PUBLIC "$<$<CONFIG:RELEASE>:${KITRT_RELEASE_OPTIONS}>" )
add_test( NAME unit_tests COMMAND unit_tests )
catch_discover_tests( unit_tests )
enable_testing()
#################################################
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
**** Material composition, oscillator data and
stopping powers for electrons and positrons.
Material # 278, WATER, LIQUID
Mass density = 1.00000000E+00 g/cm**3
Number of elements in the molecule = 2
atomic number = 1, atoms/molecule = 2.00000000E+00
atomic number = 8, atoms/molecule = 1.00000000E+00
Mean excitation energy = 7.50000000E+01 eV
Number of oscillators = 3
Fi Ui (eV) Wi (eV)
---------------------------------------------------
1 6.00000000E+00 1.36133333E+01 3.13708109E+01
2 2.00000000E+00 2.84800000E+01 6.40292871E+01
3 2.00000000E+00 5.38000000E+02 1.20046753E+03
Stopping powers. mtu=g/cm**2
Energy Scol,e- Srad,e- Scol,e+ Srad,e+
(eV) (MeV/mtu) (MeV/mtu) (MeV/mtu) (MeV/mtu)
------------------------------------------------------------
5.00E+01 3.70852E+02 1.36585E-03 4.92645E+02 1.73951E-04
6.00E+01 3.69967E+02 1.42600E-03 5.11158E+02 1.95865E-04
7.00E+01 4.13339E+02 1.47902E-03 5.49996E+02 2.16318E-04
8.00E+01 4.27409E+02 1.52679E-03 5.58552E+02 2.35605E-04
9.00E+01 4.26017E+02 1.57017E-03 5.52407E+02 2.53874E-04
1.00E+02 4.18657E+02 1.61021E-03 5.40424E+02 2.71305E-04
1.25E+02 3.92215E+02 1.69862E-03 5.02921E+02 3.11773E-04
1.50E+02 3.68877E+02 1.77471E-03 4.65656E+02 3.48695E-04
1.75E+02 3.46353E+02 1.84203E-03 4.32255E+02 3.82856E-04
2.00E+02 3.25742E+02 1.90258E-03 4.03025E+02 4.14753E-04
2.50E+02 2.90852E+02 2.00847E-03 3.55191E+02 4.73136E-04
3.00E+02 2.63017E+02 2.09988E-03 3.18078E+02 5.25980E-04
3.50E+02 2.40447E+02 2.18058E-03 2.88540E+02 5.74506E-04
4.00E+02 2.21797E+02 2.25339E-03 2.64472E+02 6.19653E-04
4.50E+02 2.06121E+02 2.31960E-03 2.44465E+02 6.61928E-04
5.00E+02 1.92746E+02 2.38084E-03 2.27551E+02 7.01905E-04
6.00E+02 1.71091E+02 2.49090E-03 2.00463E+02 7.76038E-04
7.00E+02 1.54264E+02 2.58825E-03 1.79664E+02 8.43986E-04
8.00E+02 1.40771E+02 2.67599E-03 1.63141E+02 9.07065E-04
9.00E+02 1.29681E+02 2.75615E-03 1.49665E+02 9.66183E-04
1.00E+03 1.20387E+02 2.83015E-03 1.38442E+02 1.02199E-03
1.25E+03 1.03967E+02 2.99172E-03 1.18648E+02 1.14897E-03
1.50E+03 9.25403E+01 3.12146E-03 1.05352E+02 1.25919E-03
1.75E+03 8.31983E+01 3.22408E-03 9.45899E+01 1.35470E-03
2.00E+03 7.56610E+01 3.30698E-03 8.59347E+01 1.43866E-03
2.50E+03 6.43691E+01 3.43525E-03 7.29213E+01 1.58193E-03
3.00E+03 5.64172E+01 3.52937E-03 6.35888E+01 1.70068E-03
3.50E+03 5.03563E+01 3.60082E-03 5.65473E+01 1.80148E-03
4.00E+03 4.55809E+01 3.65660E-03 5.10302E+01 1.88866E-03
4.50E+03 4.17146E+01 3.70083E-03 4.65809E+01 1.96505E-03
5.00E+03 3.85149E+01 3.73660E-03 4.29102E+01 2.03283E-03
6.00E+03 3.35140E+01 3.79027E-03 3.71941E+01 2.14847E-03
7.00E+03 2.97717E+01 3.82778E-03 3.29339E+01 2.24410E-03
8.00E+03 2.68565E+01 3.85514E-03 2.96262E+01 2.32525E-03
9.00E+03 2.45157E+01 3.87499E-03 2.69777E+01 2.39498E-03
1.00E+04 2.25910E+01 3.89031E-03 2.48054E+01 2.45624E-03
1.25E+04 1.89924E+01 3.91535E-03 2.07574E+01 2.58175E-03
1.50E+04 1.64805E+01 3.92847E-03 1.79434E+01 2.67913E-03
1.75E+04 1.46201E+01 3.93520E-03 1.58660E+01 2.75763E-03
2.00E+04 1.31828E+01 3.94039E-03 1.42652E+01 2.82421E-03
2.50E+04 1.10997E+01 3.95251E-03 1.19524E+01 2.93548E-03
3.00E+04 9.65695E+00 3.96525E-03 1.03559E+01 3.02585E-03
3.50E+04 8.59518E+00 3.97694E-03 9.18408E+00 3.10082E-03
4.00E+04 7.77929E+00 3.98823E-03 8.28550E+00 3.16496E-03
4.50E+04 7.13175E+00 3.99954E-03 7.57359E+00 3.22120E-03
5.00E+04 6.60477E+00 4.01265E-03 6.99509E+00 3.27279E-03
6.00E+04 5.79786E+00 4.04514E-03 6.11088E+00 3.36762E-03
7.00E+04 5.20822E+00 4.08256E-03 5.46605E+00 3.45378E-03
8.00E+04 4.75809E+00 4.12356E-03 4.97457E+00 3.53407E-03
9.00E+04 4.40304E+00 4.16748E-03 4.58741E+00 3.61040E-03
1.00E+05 4.11580E+00 4.21392E-03 4.27453E+00 3.68405E-03
1.25E+05 3.59175E+00 4.33880E-03 3.70450E+00 3.86111E-03
1.50E+05 3.23794E+00 4.47486E-03 3.32024E+00 4.03432E-03
1.75E+05 2.98383E+00 4.62060E-03 3.04455E+00 4.20769E-03
2.00E+05 2.79321E+00 4.77605E-03 2.83788E+00 4.38423E-03
2.50E+05 2.52822E+00 5.11547E-03 2.55070E+00 4.75293E-03
3.00E+05 2.35500E+00 5.48815E-03 2.36296E+00 5.14416E-03
3.50E+05 2.23483E+00 5.89073E-03 2.23263E+00 5.55872E-03
4.00E+05 2.14799E+00 6.31882E-03 2.13830E+00 5.99460E-03
4.50E+05 2.08317E+00 6.76912E-03 2.06777E+00 6.44990E-03
5.00E+05 2.03313E+00 7.23911E-03 2.01324E+00 6.92297E-03
6.00E+05 1.96227E+00 8.23473E-03 1.93581E+00 7.92086E-03
7.00E+05 1.91608E+00 9.29369E-03 1.88507E+00 8.97908E-03
8.00E+05 1.88491E+00 1.04109E-02 1.85058E+00 1.00938E-02
9.00E+05 1.86341E+00 1.15735E-02 1.82656E+00 1.12532E-02
1.00E+06 1.84842E+00 1.27827E-02 1.80960E+00 1.24587E-02
1.25E+06 1.82807E+00 1.59725E-02 1.78578E+00 1.56392E-02
1.50E+06 1.82099E+00 1.93754E-02 1.77646E+00 1.90338E-02
1.75E+06 1.82040E+00 2.29647E-02 1.77430E+00 2.26164E-02
2.00E+06 1.82318E+00 2.67121E-02 1.77591E+00 2.63589E-02
2.50E+06 1.83327E+00 3.45981E-02 1.78439E+00 3.42405E-02
3.00E+06 1.84547E+00 4.29315E-02 1.79550E+00 4.25753E-02
3.50E+06 1.85788E+00 5.16306E-02 1.80712E+00 5.12801E-02
4.00E+06 1.86983E+00 6.06341E-02 1.81849E+00 6.02927E-02
4.50E+06 1.88112E+00 6.98826E-02 1.82931E+00 6.95527E-02
5.00E+06 1.89170E+00 7.93339E-02 1.83952E+00 7.90171E-02
6.00E+06 1.91083E+00 9.87446E-02 1.85807E+00 9.84566E-02
7.00E+06 1.92761E+00 1.18788E-01 1.87444E+00 1.18529E-01
8.00E+06 1.94245E+00 1.39368E-01 1.88896E+00 1.39138E-01
9.00E+06 1.95569E+00 1.60384E-01 1.90196E+00 1.60181E-01
1.00E+07 1.96762E+00 1.81765E-01 1.91369E+00 1.81586E-01
1.25E+07 1.99296E+00 2.36496E-01 1.93866E+00 2.36367E-01
1.50E+07 2.01357E+00 2.92656E-01 1.95902E+00 2.92565E-01
1.75E+07 2.03082E+00 3.49939E-01 1.97609E+00 3.49874E-01
2.00E+07 2.04556E+00 4.08148E-01 1.99069E+00 4.08103E-01
2.50E+07 2.06964E+00 5.26832E-01 2.01458E+00 5.26809E-01
3.00E+07 2.08871E+00 6.47665E-01 2.03353E+00 6.47653E-01
3.50E+07 2.10439E+00 7.70024E-01 2.04911E+00 7.70018E-01
4.00E+07 2.11764E+00 8.93826E-01 2.06229E+00 8.93823E-01
4.50E+07 2.12909E+00 1.01898E+00 2.07368E+00 1.01898E+00
5.00E+07 2.13915E+00 1.14502E+00 2.08370E+00 1.14502E+00
6.00E+07 2.15621E+00 1.39879E+00 2.10069E+00 1.39879E+00
7.00E+07 2.17034E+00 1.65536E+00 2.11478E+00 1.65536E+00
8.00E+07 2.18241E+00 1.91442E+00 2.12681E+00 1.91442E+00
9.00E+07 2.19294E+00 2.17525E+00 2.13731E+00 2.17525E+00
1.00E+08 2.20229E+00 2.43750E+00 2.14663E+00 2.43750E+00
1.25E+08 2.22190E+00 3.09741E+00 2.16620E+00 3.09741E+00
1.50E+08 2.23778E+00 3.76212E+00 2.18206E+00 3.76212E+00
1.75E+08 2.25114E+00 4.43048E+00 2.19540E+00 4.43048E+00
2.00E+08 2.26267E+00 5.10164E+00 2.20691E+00 5.10164E+00
2.50E+08 2.28188E+00 6.44895E+00 2.22610E+00 6.44895E+00
3.00E+08 2.29753E+00 7.80056E+00 2.24174E+00 7.80056E+00
3.50E+08 2.31074E+00 9.15441E+00 2.25494E+00 9.15441E+00
4.00E+08 2.32217E+00 1.05108E+01 2.26636E+00 1.05108E+01
4.50E+08 2.33224E+00 1.18697E+01 2.27643E+00 1.18697E+01
5.00E+08 2.34125E+00 1.32305E+01 2.28544E+00 1.32305E+01
6.00E+08 2.35683E+00 1.59560E+01 2.30101E+00 1.59560E+01
7.00E+08 2.37000E+00 1.86873E+01 2.31417E+00 1.86873E+01
8.00E+08 2.38140E+00 2.14227E+01 2.32556E+00 2.14227E+01
9.00E+08 2.39145E+00 2.41602E+01 2.33561E+00 2.41602E+01
1.00E+09 2.40044E+00 2.68990E+01 2.34460E+00 2.68990E+01
Subproject commit 0e9bae1cdb5d7bcd967bcab10539805cc3bccb32
Subproject commit ff349a50bfc6214b4081f4ca63c7de35e2162f60
blaze @ 0380370f
Subproject commit 69e2fe554e72d90efc39ceec72d8cbddf88802a8
Subproject commit 0380370f0626de2ad0ec7ea815803e22bbf6b42e
Subproject commit 83b9149930f392d7797b54fe97a66ab3f2120671
Subproject commit cbe9448650176797739dbab13961ef4c07f4290f
/*!
* @file CConfig.h
* @brief Classes for different Options in rtsn
* @file config.h
* @brief Class to handle all options and their pre and postprocessing.
* @author S. Schotthöfer
*
* Disclaimer: This class structure was copied and modifed with open source permission from SU2 v7.0.3 https://su2code.github.io/
......@@ -148,12 +148,10 @@ class Config
/*--- all_options is a map containing all of the options. This is used during config file parsing
to track the options which have not been set (so the default values can be used). Without this map
there would be no list of all the config file options. ---*/
std::map<std::string, bool> _allOptions;
/*--- brief param is a map from the option name (config file string) to its decoder (the specific child
class of COptionBase that turns the string into a value) ---*/
class of OptionBase that turns the string into a value) ---*/
std::map<std::string, OptionBase*> _optionMap;
// ---- Option Types ----
......
......@@ -9,11 +9,41 @@
#ifndef GLOBAL_CONSTANTS_H
#define GLOBAL_CONSTANTS_H
#include <cmath>
#include <map>
#include <string>
#include <vector>
// --- Definition for global constants goes here ---
static const long double PI = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679;
static const long double EULER = 2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664274;
static const long double INV_SQRT_2PI = 1.0 / std::sqrt( 2.0 * PI );
static const long double AVOGADRO_CONSTANT = 6.02214129e23; // 1/mol
static const long double ELECTRON_MASS = 9.10938291e-31; // kg
static const long double ELECTRON_ENERGY = 0.51099895; // MeV
static const long double ELECTRON_RADIUS = 2.8179403262e-15; // m
static const long double ELECTRON_MASS_ENERGY_EQUIVALENT = 8.18710506e-14; // J
static const long double ELECTRON_VOLT = 1.602176565e-19; // J
static const long double ELECTRIC_CONSTANT = 8.854187817e-12; // F/m
static const long double ELEMENTARY_CHARGE = 1.602176565e-19; // C
static const long double PLANCK_CONSTANT = 6.62606957e-34; // J s
static const long double BOHR_RADIUS = 5.2917721092e-11; // m
static const std::vector<long double> H2OMassFractions{ 0.111894, 0.888106 };
static const std::vector<long double> H2OAtomicNumbers{ 1.0, 8.0 };
static const std::vector<long double> H2OAtomicWeights{ 1.008, 15.999 };
static const long double H2OAtomicWeight = 2 * H2OAtomicWeights[0] + H2OAtomicWeights[1];
static const long double H2OElectronDensity = 3.3428847e23; // 1/cm3
static const long double H2OMassDensity = 1.0; // g/cm3
static const long double H2OMolecularDensity = AVOGADRO_CONSTANT * H2OMassDensity / H2OAtomicWeight; // 1/cm3
static const long double C1 = 2.0 * PI * std::pow( ELEMENTARY_CHARGE, 4u ) / std::pow( 4.0 * PI * ELECTRIC_CONSTANT, 2u );
static const long double C2 = C1 / 16.0;
static const long double SQRT05E = std::sqrt( 0.5 * EULER );
static const long double aH = PLANCK_CONSTANT * PLANCK_CONSTANT * ELECTRIC_CONSTANT / ( PI * ELECTRON_MASS * ELEMENTARY_CHARGE * ELEMENTARY_CHARGE );
const unsigned int MAX_STRING_SIZE = 200; /*!< @brief Maximum size for strings. */
// --- Definition of enums goes here ---
......@@ -25,12 +55,13 @@ enum BOUNDARY_TYPE { DIRICHLET, NEUMANN, NONE, INVALID };
/*! @brief Enum for all currently available quadratures in rtsn.
* Option enums are written in capital letters with underscores as spaces (e.g option "time integration" has option enum "TIME_INTEGRATION")
*/
enum QUAD_NAME { QUAD_MonteCarlo, QUAD_GaussLegendreTensorized, QUAD_GaussLegendre1D, QUAD_LevelSymmetric, QUAD_Lebedev, QUAD_LDFESA };
enum QUAD_NAME { QUAD_MonteCarlo, QUAD_GaussLegendreTensorized, QUAD_GaussLegendre1D, QUAD_LevelSymmetric, QUAD_Lebedev, QUAD_LDFESA, QUAD_Product };
/*! @brief Conversion Map String to enum
*/
inline std::map<std::string, QUAD_NAME> Quadrature_Map{ { "MONTE_CARLO", QUAD_MonteCarlo },
{ "GAUSS_LEGENDRE_TENSORIZED", QUAD_GaussLegendreTensorized },
{ "PRODUCT", QUAD_Product },
{ "GAUSS_LEGENDRE_1D", QUAD_GaussLegendre1D },
{ "LEVEL_SYMMETRIC", QUAD_LevelSymmetric },
{ "LEBEDEV", QUAD_Lebedev },
......@@ -43,13 +74,19 @@ enum PROBLEM_NAME {
PROBLEM_ElectronRT,
PROBLEM_WaterPhantom,
PROBLEM_LineSource_Pseudo_1D,
PROBLEM_LineSource_Pseudo_1D_Physics
PROBLEM_LineSource_Pseudo_1D_Physics,
PROBLEM_AirCavity,
PROBLEM_MuscleBoneLung,
PROBLEM_Phantom2D
};
inline std::map<std::string, PROBLEM_NAME> Problem_Map{ { "LINESOURCE", PROBLEM_LineSource },
{ "CHECKERBOARD", PROBLEM_Checkerboard },
{ "ELECTRONRT", PROBLEM_ElectronRT },
{ "WATERPHANTOM", PROBLEM_WaterPhantom },
{ "AIRCAVITY", PROBLEM_AirCavity },
{ "MUSCLEBONELUNG", PROBLEM_MuscleBoneLung },
{ "PHANTOM2D", PROBLEM_Phantom2D },
{ "LINESOURCE_PSEUDO_1D", PROBLEM_LineSource_Pseudo_1D },
{ "LINESOURCE_PSEUDO_1D_PHYSICS", PROBLEM_LineSource_Pseudo_1D_Physics } };
......@@ -59,10 +96,27 @@ enum KERNEL_NAME { KERNEL_Isotropic, KERNEL_Isotropic1D };
inline std::map<std::string, KERNEL_NAME> Kernel_Map{ { "ISOTROPIC", KERNEL_Isotropic }, { "ISOTROPIC_1D", KERNEL_Isotropic1D } };
// Solver name
enum SOLVER_NAME { SN_SOLVER, CSD_SN_SOLVER, PN_SOLVER, MN_SOLVER };
enum SOLVER_NAME {
SN_SOLVER,
CSD_SN_SOLVER,
CSD_SN_NOTRAFO_SOLVER,
CSD_SN_FOKKERPLANCK_SOLVER,
CSD_SN_FOKKERPLANCK_TRAFO_SOLVER,
CSD_SN_FOKKERPLANCK_TRAFO_SOLVER_2D,
CSD_SN_FOKKERPLANCK_TRAFO_SH_SOLVER_2D,
PN_SOLVER,
MN_SOLVER
};
inline std::map<std::string, SOLVER_NAME> Solver_Map{
{ "SN_SOLVER", SN_SOLVER }, { "CSD_SN_SOLVER", CSD_SN_SOLVER }, { "PN_SOLVER", PN_SOLVER }, { "MN_SOLVER", MN_SOLVER } };
inline std::map<std::string, SOLVER_NAME> Solver_Map{ { "SN_SOLVER", SN_SOLVER },
{ "CSD_SN_SOLVER", CSD_SN_SOLVER },
{ "CSD_SN_NOTRAFO_SOLVER", CSD_SN_NOTRAFO_SOLVER },
{ "CSD_SN_FOKKERPLANCK_SOLVER", CSD_SN_FOKKERPLANCK_SOLVER },
{ "CSD_SN_FOKKERPLANCK_TRAFO_SOLVER", CSD_SN_FOKKERPLANCK_TRAFO_SOLVER },
{ "CSD_SN_FOKKERPLANCK_TRAFO_SOLVER_2D", CSD_SN_FOKKERPLANCK_TRAFO_SOLVER_2D },
{ "CSD_SN_FOKKERPLANCK_TRAFO_SH_SOLVER_2D", CSD_SN_FOKKERPLANCK_TRAFO_SH_SOLVER_2D },
{ "PN_SOLVER", PN_SOLVER },
{ "MN_SOLVER", MN_SOLVER } };
// Entropy functional
enum ENTROPY_NAME { QUADRATIC, MAXWELL_BOLTZMANN, BOSE_EINSTEIN, FERMI_DIRAC };
......
......@@ -18,42 +18,55 @@
class Mesh
{
protected:
const unsigned _dim;
const unsigned _numCells;
const unsigned _numNodes;
const unsigned _numNodesPerCell;
const unsigned _numBoundaries;
const unsigned _ghostCellID; // equal to _numCells and therefore has the ID of the last cell + 1
const unsigned _dim; /*! @brief: spatial dimension of the mesh, i.e. 1D,2D,3D */
const unsigned _numCells; /*! @brief: number of cells in the mesh */
const unsigned _numNodes; /*! @brief: number of nodes in the mesh (for node centered view)*/
const unsigned _numNodesPerCell; /*! @brief: number of nodes per cell */
const unsigned _numBoundaries; /*! @brief: number of boundary cells in the mesh */
const unsigned _ghostCellID; /*! @brief: Id of the ghost cell. (we use only one ghost cell). equal to _numCells and therefore has the ID of the
last cell + 1 */
unsigned _numNodesPerBoundary;
std::vector<std::pair<double, double>> _bounds;
std::vector<Vector> _nodes; // dimension: numNodes<dim>
std::vector<std::vector<unsigned>> _cells; // dimension: numCells<numNodesPerCell>
std::vector<std::pair<BOUNDARY_TYPE, std::vector<unsigned>>> _boundaries; // dimension: numBoundaries<(1,numBoundaryNodes)>
std::vector<double> _cellAreas; // dimension: numCells
std::vector<Vector> _cellMidPoints; // dimension: numCells<dim>
std::vector<std::vector<unsigned>> _cellNeighbors; // dimension: numCells<numNodesPerCell>
std::vector<std::vector<Vector>> _cellNormals; // dimension: numCells<numNodesPerCell<dim>>, all normals are facing away from the cell center
// and scaled with the edge length
std::vector<BOUNDARY_TYPE> _cellBoundaryTypes; // dimension: numCells, default type is NONE
std::vector<unsigned> _colors; // dimension: numCells
blaze::CompressedMatrix<bool> _nodeNeighbors; // neighborshood relationship of nodes for (par-)metis
void ComputeCellAreas();
void ComputeCellMidpoints();
void ComputeConnectivity();
void ComputePartitioning();
Vector ComputeOutwardFacingNormal( const Vector& nodeA,
const Vector& nodeB,
const Vector& cellCenter ); // normals are scaled with their respective edge length
void ComputeBounds();
std::vector<std::pair<double, double>> _bounds; // ???
std::vector<Vector> _nodes; /*! @brief: nodes in the mesh. dimension:_numNodes<_dim> */
std::vector<std::vector<unsigned>> _cells; /*! @brief: cells in the mesh. dimension:_numCells<_numNodesPerCell> */
/*! @brief: boundary cells in the mesh. Pair defines boundary type of the boundary nodes of the cell. numBoundaries<(1,numBoundaryNodes)>*/
std::vector<std::pair<BOUNDARY_TYPE, std::vector<unsigned>>> _boundaries;
std::vector<double> _cellAreas; /*! @brief: cell areas of the mesh. dimension: numCells*/
std::vector<Vector> _cellMidPoints; /*! @brief: cell midpoints of the mesh. dimension: numCells<dim>*/
std::vector<std::vector<unsigned>> _cellNeighbors; /*! @brief: neighbors of each cell. dimension: numCells<numNodesPerCell>*/
/*! @brief: outward facing normals of each side of each cell. dimension: numCells<numNodesPerCell<dim>>, all
normals are facing away from the cell center, and scaled with the edge length */
std::vector<std::vector<Vector>> _cellNormals;
/*! @brief: Tags each cell with its boundary type. None means no boundary. dimension: numCells */
std::vector<BOUNDARY_TYPE> _cellBoundaryTypes;
std::vector<unsigned> _colors; /*! @brief: Color of each cell (for MPI mesh partitioning). dimension: numCells */
blaze::CompressedMatrix<bool> _nodeNeighbors; /*! @brief: neighborshood relationship of nodes for (par-)metis */
void ComputeCellAreas(); /*! @brief: Computes only the areas of the mesh cells. Write to _cellAreas. */
void ComputeCellMidpoints(); /*! @brief: Compute only the midpoints of the cells. Write to _cellMidPoints*/
void ComputeConnectivity(); /*! @brief: Computes _cellNeighbors and _nodeNeighbors, i.e. neighborship relation in mesh*/
void ComputePartitioning(); /*! @brief: Computes local partitioning for openMP */
/*! @brief: Computes outward facing normal of two neighboring nodes nodeA and nodeB with common cellCellcenter.
* Normals are scaled with their respective edge length
* @param: nodeA: first node
* @param: nodeB: neighboring node to nodeA
* @param: cellCenter: Center of the cell that has nodeA and nodeB as nodes.
* @return: outward facing normal */
Vector ComputeOutwardFacingNormal( const Vector& nodeA, const Vector& nodeB, const Vector& cellCenter );
void ComputeBounds(); /*! @brief: Computes the spatial bounds of a 2D domain. */
public:
Mesh() = delete;
Mesh() = delete; // no default constructor
/*! @brief: Constructor of mesh. Needs nodes, cells, and boundary descriptions as specified above.
* See LoadSU2MeshFromFile in io.cpp for setup information*/
Mesh( std::vector<Vector> nodes,
std::vector<std::vector<unsigned>> cells,
std::vector<std::pair<BOUNDARY_TYPE, std::vector<unsigned>>> boundaries ); // see LoadSU2MeshFromFile in io.cpp for setup information
std::vector<std::pair<BOUNDARY_TYPE, std::vector<unsigned>>> boundaries );
~Mesh();
inline unsigned GetDim() const { return _dim; }
......@@ -61,76 +74,65 @@ class Mesh
inline unsigned GetNumNodes() const { return _numNodes; }
inline unsigned GetNumNodesPerCell() const { return _numNodesPerCell; }
/**
* @brief Returns all node coordinates
* @return dimension: numNodes x dim
*/
/*! @brief: Returns all node coordinates
* @return: dimension: numNodes x dim */
const std::vector<Vector>& GetNodes() const;
/**
* @brief Returns the mid point coordinates of each cell
* @return dimension: numCells x dim
*/
/*! @brief Returns the mid point coordinates of each cell
* @return dimension: numCells x dim */
const std::vector<Vector>& GetCellMidPoints() const;
/**
* @brief Returns all node IDs that construct up each cell
* @return dimension: numCells x numNodes
*/
/*! @brief Returns all node IDs that construct up each cell
* @return dimension: numCells x numNodes */
const std::vector<std::vector<unsigned>>& GetCells() const;
/**
* @brief Returns the cell area of each cell
* @return dimension: numCells
*/
/*! @brief Returns the cell area of each cell
* @return dimension: numCells */
const std::vector<double>& GetCellAreas() const;
/**
* @brief Return the color/ID of the mesh partition
* @return dimension: numCells
*/
/*! @brief Return the color/ID of the mesh partition
* @return dimension: numCells */
const std::vector<unsigned>& GetPartitionIDs() const;
/**
* @brief Returns the neighbor cell IDs for every cell
* @return dimension: numCells x numNodes
*/
/*! @brief Returns the neighbor cell IDs for every cell
* @return dimension: numCells x numNodes */
const std::vector<std::vector<unsigned>>& GetNeighbours() const;
/**
* @brief Returns the edge length scaled normal vectors of each cell
* @return dimension: numCells x numNodes x dim
*/
/*! @brief Returns the edge length scaled normal vectors of each cell
* @return dimension: numCells x numNodes x dim */
const std::vector<std::vector<Vector>>& GetNormals() const;
/**
* @brief Returns the boundary enum for each cell. BOUNDARY_TYPE::NONE is the default.
* @return dimension: numCells
*/
/*! @brief Returns the boundary enum for each cell. BOUNDARY_TYPE::NONE is the default.
* @return dimension: numCells */
const std::vector<BOUNDARY_TYPE>& GetBoundaryTypes() const;
/**
* @brief Returns the minimal and maximal coordinates of all nodes for each dimension
* @return dimension: dim
*/
/*! @brief Returns the minimal and maximal coordinates of all nodes for each dimension
* @return dimension: dim */
const std::vector<std::pair<double, double>> GetBounds() const;
/**
* @brief Returns distance of a specified cells center to the coordinate systems origin
* @return dimension: scalar
*/
/*! @brief Returns distance of a specified cells center to the coordinate systems origin
* @return dimension: scalar */
double GetDistanceToOrigin( unsigned idx_cell ) const;
/**
* @brief ComputeSlopes calculates the slope in every cell into x and y direction
* @param nq is number of quadrature points
* @param psiDerX is slope in x direction
* @param psiDerY is slope in y direction
* @param psi is solution for which slope is computed
*/
/*! @brief ComputeSlopes calculates the slope in every cell into x and y direction using the divergence theorem.
* @param nq is number of quadrature points
* @param psiDerX is slope in x direction (gets computed. Slope is stored here)
* @param psiDerY is slope in y direction (gets computed. Slope is stored here)
* @param psi is solution for which slope is computed */
// Not used
void ComputeSlopes( unsigned nq, VectorVector& psiDerX, VectorVector& psiDerY, const VectorVector& psi ) const;
/*! @brief:Structured mesh slope reconstruction with flux limiters.
* @param nq is number of quadrature points
* @param psiDerX is slope in x direction (gets computed. Slope is stored here)
* @param psiDerY is slope in y direction (gets computed. Slope is stored here)
* @param psi is solution for which slope is computed */
void ReconstructSlopesS( unsigned nq, VectorVector& psiDerX, VectorVector& psiDerY, const VectorVector& psi ) const;
/*! @brief: Use gauss theorem and limiters. For unstructured mesh *
* @param nq is number of quadrature points
* @param psiDerX is slope in x direction (gets computed. Slope is stored here)
* @param psiDerY is slope in y direction (gets computed. Slope is stored here)
* @param psi is solution for which slope is computed */
void ReconstructSlopesU( unsigned nq, VectorVector& psiDerX, VectorVector& psiDerY, const VectorVector& psi ) const;
};
......
......@@ -19,34 +19,33 @@ class OptionBase
{
private:
std::vector<std::string> _value;
std::vector<std::string> _value; /*! @brief: String name of the option */
public:
OptionBase() {}
OptionBase(){};
virtual ~OptionBase() = 0;
virtual ~OptionBase() {}
virtual std::string SetValue( std::vector<std::string> value ); /*! @brief: Set string name of the option */
std::vector<std::string> GetValue();
std::vector<std::string> GetValue(); /*! @brief: Get string name of the option */
virtual std::string SetValue( std::vector<std::string> value );
virtual void SetDefault() = 0;
std::string optionCheckMultipleValues( std::vector<std::string>& option_value, std::string type_id, std::string option_name );
std::string badValue( std::vector<std::string>& option_value, std::string type_id, std::string option_name );
virtual void SetDefault() = 0; /*! @brief: Set default name for the option */
/*! @brief: Check if an option is defined multiple times in a config file, if yes, return a string stating this. */
std::string OptionCheckMultipleValues( std::vector<std::string>& option_value, std::string type_id, std::string option_name );
/*! @brief: If a bad value for an option is detected, this function creates the corresponding output string. */
std::string BadValue( std::vector<std::string>& option_value, std::string type_id, std::string option_name );
};
class OptionDouble : public OptionBase
{
double& _field; // Reference to the fieldname
double _def; // Default value
std::string _name; // identifier for the option
double& _field; /*! @brief: Reference to the double field value */
double _def; /*! @brief: Default value */
std::string _name; /*! @brief: String identifier for the option */
public:
OptionDouble( std::string option_field_name, double& option_field, double default_value );
~OptionDouble() override {}
~OptionDouble() override{};
std::string SetValue( std::vector<std::string> option_value ) override;
......@@ -55,14 +54,14 @@ class OptionDouble : public OptionBase
class OptionString : public OptionBase
{
std::string& _field; // Reference to the fieldname
std::string _def; // Default value
std::string _name; // identifier for the option
std::string& _field; /*! @brief: Reference to the string field value */
std::string _def; /*! @brief: Default value */
std::string _name; /*! @brief: string identifier for the option */
public:
OptionString( std::string option_field_name, std::string& option_field, std::string default_value );
~OptionString() override {}
~OptionString() override{};
std::string SetValue( std::vector<std::string> option_value ) override;
......@@ -71,14 +70,14 @@ class OptionString : public OptionBase
class OptionInt : public OptionBase
{
int& _field; // Reference to the feildname
int _def; // Default value
std::string _name; // identifier for the option
int& _field; /*! @brief: Reference to the int field value */
int _def; /*! @brief: Default value */
std::string _name; /*! @brief: string identifier for the option */
public:
OptionInt( std::string option_field_name, int& option_field, int default_value );
~OptionInt() override {}
~OptionInt() override{};
std::string SetValue( std::vector<std::string> option_value ) override;
......@@ -87,14 +86,14 @@ class OptionInt : public OptionBase
class OptionULong : public OptionBase
{
unsigned long& _field; // Reference to the feildname
unsigned long _def; // Default value
std::string _name; // identifier for the option
unsigned long& _field; /*! @brief: Reference to the unsigned long field value */
unsigned long _def; /*! @brief: Default value */
std::string _name;