Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KiT-RT
KiT-RT
Commits
3a22f62d
Commit
3a22f62d
authored
Feb 10, 2021
by
steffen.schotthoefer
Browse files
Merge branch 'miniSprint' into 'develop'
Mini sprint See merge request
!35
parents
13a93f43
95321051
Pipeline
#133823
passed with stage
in 18 minutes and 8 seconds
Changes
171
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
3a22f62d
...
...
@@ -7,17 +7,17 @@ unit_tests:
stage
:
unit_tests
script
:
-
git submodule update --init --recursive
-
cd code/build/
release
-
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ../../
-
cd code/build/
debug
-
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug
-DBUILD_TESTS=ON
../../
-
ninja
-
OMP_NUM_THREADS=1 ./unit_tests -r junit > unit_tests_report.xml
-
gcovr -e ../../ext/ -e ../../tests/ -r ../../
artifacts
:
when
:
always
paths
:
-
code/build/
release
/unit_tests_report.xml
-
code/build/
debug
/unit_tests_report.xml
reports
:
junit
:
code/build/
release
/unit_tests_report.xml
junit
:
code/build/
debug
/unit_tests_report.xml
timeout
:
4h
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "develop"
...
...
.gitmodules
View file @
3a22f62d
...
...
@@ -10,3 +10,6 @@
[submodule "code/ext/parmetis"]
path = code/ext/parmetis
url = https://github.com/slydex/parmetis.git
[submodule "code/ext/neuralEntropy"]
path = code/ext/neuralEntropy
url = https://github.com/ScSteffen/neuralEntropy.git
Dockerfile
0 → 100644
View file @
3a22f62d
FROM
ubuntu:20.04
ENV
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" \
PYTHONPATH=/usr/local/gmsh/lib:$PYTHONPATH \
PATH=/opt/conda/bin:/usr/local/gmsh/bin:$PATH
RUN
apt-get update
\
&&
DEBIAN_FRONTEND
=
noninteractive apt-get
install
-qq
\
gcc
\
g++
\
libopenmpi-dev
\
openmpi-bin
\
libblas-dev
\
liblapack-dev
\
git
\
make
\
ninja-build
\
cmake
\
wget
\
ssh
\
libssl-dev
\
libxt-dev
\
libgl1-mesa-dev
\
libglu1
\
libxrender1
\
libxcursor-dev
\
libxft-dev
\
libxinerama-dev
\
python3
\
python3-pip
\
vim
RUN
pip3
install
tensorflow
==
2.2.2
\
pygmsh
==
6.1.1 Pillow pydicom gcovr
\
matplotlib
\
scipy
RUN
cd
/usr/local
\
&&
wget
-nc
--quiet
http://gmsh.info/bin/Linux/gmsh-4.7.0-Linux64-sdk.tgz
\
&&
tar
xzf gmsh-4.7.0-Linux64-sdk.tgz
\
&&
mv
gmsh-4.7.0-Linux64-sdk gmsh
\
&&
rm
gmsh-4.7.0-Linux64-sdk.tgz
RUN
wget
-nc
--no-check-certificate
--quiet
https://www.vtk.org/files/release/8.2/VTK-8.2.0.tar.gz
\
&&
tar
xzf VTK-8.2.0.tar.gz
\
&&
mkdir
VTK-8.2.0/build
\
&&
cd
VTK-8.2.0/build
\
&&
cmake
-G
Ninja
-DCMAKE_BUILD_TYPE
=
Release
-DBUILD_DOCUMENTATION
=
OFF
-DBUILD_TESTING
=
OFF ../
\
&&
ninja
\
&&
ninja
install
>
/dev/null
\
&&
cd
-
\
&&
rm
-rf
VTK-
*
RUN
apt-get clean
\
&&
apt-get autoremove
--purge
\
&&
rm
-rf
/var/lib/apt/lists/
*
WORKDIR
/home
README.md
View file @
3a22f62d
...
...
@@ -20,6 +20,11 @@ TBD
-
VTK
-
git
-
ninja or make
-
gmsh
### Python dependencies
-
pygmsh version 6.1.1 'pip install pygmsh==6.1.1' (note that newer versions are not yet supported)
### Obtain submodules
Note that an
**active internet connection is required for the first build**
in order to download the latest versions of the required submodules!
...
...
@@ -98,7 +103,7 @@ Append `HINTS VTK_INSTALL_DIR` to the `find_package( VTK ... )` line in the CMak
find_package
(
VTK REQUIRED COMPONENTS vtkIOGeometry vtkFiltersCore HINTS ~/VTK-install
)
```
Compile it
Compile it
(make sure you use GCC as compiler: module load compiler/gnu/10.2)
```
bash
module load devel/cmake/3.16
module load compiler/gnu/9.2
...
...
@@ -164,6 +169,8 @@ Please stick to the following coding style for easier code readability:
-
class variables start with an underscore and lowercase letters e.g.
`_foo`
-
functions start with a capital letter e.g.
`GetSettings()`
-
any variable/function names have capital letters at each individual word e.g.
`GetAllCellsAdjacentTo(Cell i)`
-
Abstract base classes for inheritance structures end with the suffix "Base" e.g. QuadratureBase, whith child classes
QGaussLegendre or QProduct
Please also use the provided
`code/.clang-format`
style format to format your code before pushing your latest commits.
Some editors offer to automatically apply the style format upon saving a file (e.g.
`Qtcreator`
).
code/CMakeLists.txt
View file @
3a22f62d
cmake_minimum_required
(
VERSION 3.12.4
)
project
(
KiT-RT VERSION 0.1.0 LANGUAGES CXX
)
### OPTIONS #####################################
option
(
BUILD_TESTS
"builds all available unit tests"
OFF
)
option
(
BUILD_GUI
"additionally builds a user interface"
OFF
)
#################################################
### COMPILER ####################################
set
(
CMAKE_CXX_STANDARD 17
)
...
...
@@ -24,7 +28,7 @@ include_directories( ${LAPACK_INCLUDE_DIR} )
find_package
(
BLAS
)
find_package
(
VTK
REQUIRED
COMPONENTS vtkIOGeometry vtkFiltersCore
)
find_package
(
VTK COMPONENTS vtkIOGeometry vtkFiltersCore
REQUIRED
)
find_package
(
Python3 COMPONENTS Interpreter Development NumPy REQUIRED
)
include_directories
(
${
Python3_INCLUDE_DIRS
}
${
Python3_NumPy_INCLUDE_DIRS
}
)
...
...
@@ -70,6 +74,13 @@ add_compile_definitions( GIT_HASH="${GIT_HASH}" )
### BUILD KIT-RT ################################
file
(
GLOB_RECURSE SRCS RELATIVE
${
CMAKE_SOURCE_DIR
}
"src/*.cpp"
"include/*.h"
)
set
(
EXCLUDE_DIR
"/gui/"
)
foreach
(
TMP_PATH
${
SRCS
}
)
string
(
FIND
${
TMP_PATH
}
${
EXCLUDE_DIR
}
EXCLUDE_DIR_FOUND
)
if
(
NOT
${
EXCLUDE_DIR_FOUND
}
EQUAL -1
)
list
(
REMOVE_ITEM SRCS
${
TMP_PATH
}
)
endif
()
endforeach
(
TMP_PATH
)
include_directories
(
${
CMAKE_SOURCE_DIR
}
/include
)
add_executable
(
${
CMAKE_PROJECT_NAME
}
${
SRCS
}
${
EXT_SRCS
}
)
target_link_libraries
(
${
CMAKE_PROJECT_NAME
}
${
CORE_LIBRARIES
}
)
...
...
@@ -81,26 +92,49 @@ 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/"
)
add_library
(
Catch INTERFACE
)
target_include_directories
(
Catch INTERFACE
${
CATCH_INCLUDE_DIR
}
)
file
(
GLOB_RECURSE TEST_SRCS RELATIVE
${
CMAKE_SOURCE_DIR
}
"tests/*.cpp"
)
list
(
REMOVE_ITEM SRCS
"src/main.cpp"
)
add_executable
(
unit_tests
${
TEST_SRCS
}
${
SRCS
}
${
EXT_SRCS
}
)
target_link_libraries
(
unit_tests Catch
${
CORE_LIBRARIES
}
)
target_compile_options
(
unit_tests PUBLIC
"$<$<CONFIG:DEBUG>:
${
KITRT_DEBUG_OPTIONS
}
>"
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
set
(
CODE_COVERAGE_OPTIONS --coverage -g -O0 -w
)
target_compile_options
(
unit_tests PUBLIC
"$<$<CONFIG:DEBUG>:
${
CODE_COVERAGE_OPTIONS
}
>"
)
target_link_libraries
(
unit_tests Catch gcov
)
if
(
BUILD_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_library
(
Catch INTERFACE
)
target_include_directories
(
Catch INTERFACE
${
CATCH_INCLUDE_DIR
}
)
file
(
GLOB_RECURSE TEST_SRCS RELATIVE
${
CMAKE_SOURCE_DIR
}
"tests/*.cpp"
)
list
(
REMOVE_ITEM SRCS
"src/main.cpp"
)
add_executable
(
unit_tests
${
TEST_SRCS
}
${
SRCS
}
${
EXT_SRCS
}
)
target_compile_definitions
(
unit_tests PUBLIC BUILD_TESTING
)
target_compile_definitions
(
unit_tests PUBLIC TESTS_PATH=
"
${
CMAKE_SOURCE_DIR
}
/tests/"
)
target_link_libraries
(
unit_tests Catch
${
CORE_LIBRARIES
}
)
target_compile_options
(
unit_tests PUBLIC
"$<$<CONFIG:DEBUG>:
${
KITRT_DEBUG_OPTIONS
}
>"
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
set
(
CODE_COVERAGE_OPTIONS --coverage -g -O0 -w
)
target_compile_options
(
unit_tests PUBLIC
"$<$<CONFIG:DEBUG>:
${
CODE_COVERAGE_OPTIONS
}
>"
)
target_link_libraries
(
unit_tests Catch gcov
)
endif
()
target_compile_options
(
unit_tests PUBLIC
"$<$<CONFIG:RELWITHDEBINFO>:
${
KITRT_RELWITHDEBINFO_OPTIONS
}
>"
)
target_compile_options
(
unit_tests PUBLIC
"$<$<CONFIG:RELEASE>:
${
KITRT_RELEASE_OPTIONS
}
>"
)
catch_discover_tests
(
unit_tests
)
endif
()
#################################################
### BUILD GUI ###################################
if
(
BUILD_GUI
)
find_package
(
Qt5 COMPONENTS Core Widgets Gui OpenGL REQUIRED
)
find_package
(
VTK COMPONENTS vtkGUISupportQt vtkInteractionStyle vtkInteractionWidgets vtkRenderingAnnotation vtkRenderingCore vtkRenderingFreeType vtkRenderingOpenGL2 REQUIRED
)
include_directories
(
${
CMAKE_SOURCE_DIR
}
/include/gui
)
file
(
GLOB_RECURSE GUI_SRCS RELATIVE
${
CMAKE_SOURCE_DIR
}
"src/gui/*"
)
file
(
GLOB_RECURSE GUI_INCL RELATIVE
${
CMAKE_SOURCE_DIR
}
"include/gui/*"
)
add_executable
(
${
CMAKE_PROJECT_NAME
}
_gui
${
SRCS
}
${
EXT_SRCS
}
${
GUI_SRCS
}
${
GUI_INCL
}
)
target_compile_definitions
(
${
CMAKE_PROJECT_NAME
}
_gui PUBLIC BUILD_GUI
)
set_target_properties
(
${
CMAKE_PROJECT_NAME
}
_gui PROPERTIES AUTOMOC ON
)
set_target_properties
(
${
CMAKE_PROJECT_NAME
}
_gui PROPERTIES AUTOUIC ON
)
set_target_properties
(
${
CMAKE_PROJECT_NAME
}
_gui PROPERTIES AUTORCC ON
)
set
(
GUI_LIBRARIES Qt5::Core Qt5::Widgets Qt5::Gui Qt5::OpenGL
${
VTK_LIBRARIES
}
)
target_link_libraries
(
${
CMAKE_PROJECT_NAME
}
_gui
${
CORE_LIBRARIES
}
${
GUI_LIBRARIES
}
)
set_target_properties
(
${
CMAKE_PROJECT_NAME
}
_gui PROPERTIES RUNTIME_OUTPUT_DIRECTORY
"
${
CMAKE_SOURCE_DIR
}
/bin"
)
target_compile_options
(
${
CMAKE_PROJECT_NAME
}
_gui PUBLIC
"$<$<CONFIG:DEBUG>:
${
KITRT_DEBUG_OPTIONS
}
>"
)
target_compile_options
(
${
CMAKE_PROJECT_NAME
}
_gui PUBLIC
"$<$<CONFIG:RELWITHDEBINFO>:
${
KITRT_RELWITHDEBINFO_OPTIONS
}
>"
)
target_compile_options
(
${
CMAKE_PROJECT_NAME
}
_gui PUBLIC
"$<$<CONFIG:RELEASE>:
${
KITRT_RELEASE_OPTIONS
}
>"
)
endif
()
target_compile_options
(
unit_tests PUBLIC
"$<$<CONFIG:RELWITHDEBINFO>:
${
KITRT_RELWITHDEBINFO_OPTIONS
}
>"
)
target_compile_options
(
unit_tests PUBLIC
"$<$<CONFIG:RELEASE>:
${
KITRT_RELEASE_OPTIONS
}
>"
)
catch_discover_tests
(
unit_tests
)
enable_testing
()
#################################################
code/build/debug_tests/.gitkeep
deleted
100644 → 0
View file @
13a93f43
code/build/release_tests/.gitkeep
deleted
100644 → 0
View file @
13a93f43
Catch2
@
0e9bae1c
Compare
ff349a50
...
0e9bae1c
Subproject commit
ff349a50bfc6214b4081f4ca63c7de35e2162f60
Subproject commit
0e9bae1cdb5d7bcd967bcab10539805cc3bccb32
blaze
@
69e2fe55
Subproject commit
0380370f0626de2ad0ec7ea815803e22bbf6b42e
Subproject commit
69e2fe554e72d90efc39ceec72d8cbddf88802a8
neuralEntropy
@
54f38c0a
Subproject commit 54f38c0a6154004efa2f8cad4737d127f6dcde59
spdlog
@
83b91499
Compare
cbe94486
...
83b91499
Subproject commit
cbe9448650176797739dbab13961ef4c07f4290f
Subproject commit
83b9149930f392d7797b54fe97a66ab3f2120671
code/include/common/config.h
View file @
3a22f62d
/*!
* @file config.h
* @brief Class to handle all options and their pre and postprocessing.
* @brief: Class to handle all options and their pre and postprocessing.
* DO NOT CREATE SETTERS FOR THIS CLASS! ALL OPTIONS ARE CONSTANT (after SetPostprocessing).
*
* @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/
* Disclaimer: This class structure was copied and
(heavily)
modifed with open source permission from SU2 v7.0.3 https://su2code.github.io/
*/
#ifndef CONFIG_H
...
...
@@ -48,7 +50,17 @@ class Config
unsigned
_nQuadPoints
;
// Mesh
unsigned
_nCells
;
unsigned
_nCells
;
/*!< @brief: Number of cells in the mesh */
unsigned
short
_dim
;
/*!< @brief: spatial dimensionality of the mesh/test case */
// Boundary Conditions
/*!< @brief List of all Pairs (marker, BOUNDARY_TYPE), e.g. (farfield,DIRICHLET).
Each Boundary Conditions must have an entry in enum BOUNDARY_TYPE*/
std
::
vector
<
std
::
pair
<
std
::
string
,
BOUNDARY_TYPE
>>
_boundaries
;
unsigned
short
_nMarkerDirichlet
;
/*!< @brief Number of Dirichlet BC markers. Enum entry: DIRICHLET */
unsigned
short
_nMarkerNeumann
;
/*!< @brief Number of Neumann BC markers. Enum entry: Neumann */
std
::
vector
<
std
::
string
>
_MarkerDirichlet
;
/*!< @brief Dirichlet BC markers. */
std
::
vector
<
std
::
string
>
_MarkerNeumann
;
/*!< @brief Neumann BC markers. */
// Solver
double
_CFL
;
/*!< @brief CFL Number for Solver*/
...
...
@@ -59,38 +71,40 @@ class Config
unsigned
short
_maxMomentDegree
;
/*!< @brief Maximal Order of Moments for PN and MN Solver */
unsigned
short
_reconsOrder
;
/*!< @brief Spatial Order of Accuracy for Solver */
// Linesource
double
_sigmaS
;
/*!< @brief Scattering coeffient for Linesource test case */
/*!< @brief If true, very low entries (10^-10 or smaller) of the flux matrices will be set to zero,
* to improve floating point accuracy */
bool
_cleanFluxMat
;
bool
_allGaussPts
;
/*!< @brief If true, the SN Solver uses all Gauss pts in the quadrature */
bool
_csd
;
/*!< @brief If true, continuous slowing down approximation will be used */
bool
_csd
;
/*!< @brief If true, continuous slowing down approximation will be used */
std
::
string
_hydrogenFile
;
/*!< @brief Name of hydrogen cross section file */
std
::
string
_oxygenFile
;
/*!< @brief Name of oxygen cross section file */
// --- Problems ---
// Boundary Conditions
/*!< @brief List of all Pairs (marker, BOUNDARY_TYPE), e.g. (farfield,DIRICHLET).
Each Boundary Conditions must have an entry in enum BOUNDARY_TYPE*/
std
::
vector
<
std
::
pair
<
std
::
string
,
BOUNDARY_TYPE
>>
_boundaries
;
unsigned
short
_nMarkerDirichlet
;
/*!< @brief Number of Dirichlet BC markers. Enum entry: DIRICHLET */
unsigned
short
_nMarkerNeumann
;
/*!< @brief Number of Neumann BC markers. Enum entry: Neumann */
std
::
vector
<
std
::
string
>
_MarkerDirichlet
;
/*!< @brief Dirichlet BC markers. */
std
::
vector
<
std
::
string
>
_MarkerNeumann
;
/*!< @brief Neumann BC markers. */
// Linesource
double
_sigmaS
;
/*!< @brief Scattering coeffient for Linesource test case */
// Database ICRU
std
::
string
_dataDir
;
/*!< @brief material directory */
// ElectronRT
std
::
string
_hydrogenFile
;
/*!< @brief Name of hydrogen cross section file path*/
std
::
string
_oxygenFile
;
/*!< @brief Name of oxygen cross section file path */
std
::
string
_stoppingPowerFile
;
/*!< @brief Name of stopping power file path */
// Scattering Kernel
KERNEL_NAME
_kernelName
;
/*!< @brief Scattering Kernel Name*/
// Spherical Basis
SPHERICAL_BASIS_NAME
_sphericalBasisName
;
/*!< @brief: Name of the basis on the unit sphere */
// Optimizer
OPTIMIZER_NAME
_entropyOptimizerName
;
/*!< @brief Choice of optimizer */
double
_optimizerEpsilon
;
/*!< @brief termination criterion epsilon for Newton Optmizer */
unsigned
short
_newtonIter
;
/*!< @brief Maximal Number of newton iterations */
unsigned
long
_newtonIter
;
/*!< @brief Maximal Number of newton iterations */
double
_newtonStepSize
;
/*!< @brief Stepsize factor for newton optimizer */
unsigned
short
_newtonLineSearchIter
;
/*!< @brief Maximal Number of line search iterations for newton optimizer */
unsigned
long
_newtonLineSearchIter
;
/*!< @brief Maximal Number of line search iterations for newton optimizer */
bool
_newtonFastMode
;
/*!< @brief If true, we skip the NewtonOptimizer for quadratic entropy and assign alpha = u */
// NeuralModel
unsigned
short
_neuralModel
;
/*!< @brief: Version number of the employed neural model */
// Output Options
unsigned
short
_nVolumeOutput
;
/*!< @brief Number of volume outputs */
std
::
vector
<
VOLUME_OUTPUT
>
_volumeOutput
;
/*!< @brief Output groups for volume output*/
...
...
@@ -104,6 +118,13 @@ class Config
std
::
vector
<
SCALAR_OUTPUT
>
_historyOutput
;
/*!< @brief Output groups for screen output*/
unsigned
short
_historyOutputFrequency
;
/*!< @brief Frequency of screen output*/
// Data Generator Settings
/*!< @brief Check, if data generator mode is active. If yes, no solver is called, but instead the data generator is executed */
bool
_dataGeneratorMode
;
unsigned
long
_tainingSetSize
;
/*!< @brief Size of training data set for data generator */
unsigned
long
_maxValFirstMoment
;
/*!< @brief Size of training data set for data generator */
double
_boundaryDistanceRealizableSet
;
/*! @brief Distance of the sampled moments to the boundary of the realizable set */
// --- Parsing Functionality and Initializing of Options ---
/*!
* @brief Set default values for all options not yet set.
...
...
@@ -223,13 +244,18 @@ class Config
*/
// File structure
std
::
string
inline
GetCTFile
()
const
{
return
std
::
filesystem
::
path
(
_ctFile
).
lexically_normal
();
}
std
::
string
inline
GetHydrogenFile
()
const
{
return
std
::
filesystem
::
path
(
_hydrogenFile
).
lexically_normal
();
}
std
::
string
inline
GetLogDir
()
const
{
return
std
::
filesystem
::
path
(
_logDir
).
lexically_normal
();
}
std
::
string
inline
GetLogFile
()
const
{
return
std
::
filesystem
::
path
(
_logFileName
).
lexically_normal
();
}
std
::
string
inline
GetMeshFile
()
const
{
return
std
::
filesystem
::
path
(
_meshFile
).
lexically_normal
();
}
std
::
string
inline
GetOutputDir
()
const
{
return
std
::
filesystem
::
path
(
_outputDir
).
lexically_normal
();
}
std
::
string
inline
GetOutputFile
()
const
{
return
std
::
filesystem
::
path
(
_outputFile
).
lexically_normal
();
}
// Problem Files
std
::
string
inline
GetHydrogenFile
()
const
{
return
std
::
filesystem
::
path
(
_hydrogenFile
).
lexically_normal
();
}
std
::
string
inline
GetOxygenFile
()
const
{
return
std
::
filesystem
::
path
(
_oxygenFile
).
lexically_normal
();
}
std
::
string
inline
GetStoppingPowerFile
()
const
{
return
std
::
filesystem
::
path
(
_stoppingPowerFile
).
lexically_normal
();
}
std
::
string
inline
GetDataDir
()
const
{
return
std
::
filesystem
::
path
(
_dataDir
).
lexically_normal
();
}
// Quadrature Structure
unsigned
GetNQuadPoints
()
{
return
_nQuadPoints
;
}
...
...
@@ -238,6 +264,7 @@ class Config
// Mesh Structure
unsigned
GetNCells
()
{
return
_nCells
;
}
unsigned
short
GetDim
()
{
return
_dim
;
}
// Solver Structure
double
inline
GetCFL
()
const
{
return
_CFL
;
}
...
...
@@ -256,18 +283,23 @@ class Config
// Optimizer
double
inline
GetNewtonOptimizerEpsilon
()
const
{
return
_optimizerEpsilon
;
}
unsigned
inline
GetNewtonIter
()
const
{
return
_newtonIter
;
}
unsigned
long
inline
GetNewtonIter
()
const
{
return
_newtonIter
;
}
double
inline
GetNewtonStepSize
()
const
{
return
_newtonStepSize
;
}
unsigned
inline
GetNewtonMaxLineSearches
()
const
{
return
_newtonLineSearchIter
;
}
unsigned
long
inline
GetNewtonMaxLineSearches
()
const
{
return
_newtonLineSearchIter
;
}
bool
inline
GetNewtonFastMode
()
const
{
return
_newtonFastMode
;
}
OPTIMIZER_NAME
inline
GetOptimizerName
()
const
{
return
_entropyOptimizerName
;
}
// Neural Closure
unsigned
short
inline
GetNeuralModel
()
{
return
_neuralModel
;
}
// Boundary Conditions
BOUNDARY_TYPE
GetBoundaryType
(
std
::
string
nameMarker
)
const
;
/*! @brief Get Boundary Type of given marker */
// Scattering Kernel
KERNEL_NAME
inline
GetKernelName
()
const
{
return
_kernelName
;
}
// Basis name
SPHERICAL_BASIS_NAME
inline
GetSphericalBasisName
()
const
{
return
_sphericalBasisName
;
}
// Output Structure
std
::
vector
<
VOLUME_OUTPUT
>
inline
GetVolumeOutput
()
{
return
_volumeOutput
;
}
unsigned
short
inline
GetNVolumeOutput
()
{
return
_nVolumeOutput
;
}
...
...
@@ -280,10 +312,17 @@ class Config
std
::
vector
<
SCALAR_OUTPUT
>
inline
GetHistoryOutput
()
{
return
_historyOutput
;
}
unsigned
short
inline
GetNHistoryOutput
()
{
return
_nHistoryOutput
;
}
unsigned
short
inline
GetHistoryOutputFrequency
()
{
return
_historyOutputFrequency
;
}
// ---- Setters for option structure
// Data generator
bool
inline
GetDataGeneratorMode
()
{
return
_dataGeneratorMode
;
}
unsigned
long
inline
GetTrainingDataSetSize
()
{
return
_tainingSetSize
;
}
unsigned
long
inline
GetMaxValFirstMoment
()
{
return
_maxValFirstMoment
;
}
double
GetBoundaryDistanceRealizableSet
()
{
return
_boundaryDistanceRealizableSet
;
}
// ---- Setters for option structure
// This section is dangerous
// Quadrature Structure
void
SetNQuadPoints
(
unsigned
nq
)
{
_nQuadPoints
=
nq
;
}
void
SetNQuadPoints
(
unsigned
nq
)
{
_nQuadPoints
=
nq
;
}
/*! @brief Never change the nq! This is only for the test framework. */
void
SetQuadName
(
QUAD_NAME
quadName
)
{
_quadName
=
quadName
;
}
/*! @brief Never change the quadName! This is only for the test framework. */
void
SetQuadOrder
(
unsigned
quadOrder
)
{
_quadOrder
=
quadOrder
;
}
/*! @brief Never change the quadOrder! This is only for the test framework. */
void
SetSNAllGaussPts
(
bool
useall
)
{
_allGaussPts
=
useall
;
}
/*! @brief Never change the this! This is only for the test framework. */
...
...
code/include/common/globalconstants.h
View file @
3a22f62d
/*!
/*!
* \file GlobalConstants.h
* \brief All global defined (physical) constants, enums etc
* \author <blank>
...
...
@@ -55,7 +55,16 @@ 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
,
QUAD_Product
};
enum
QUAD_NAME
{
QUAD_MonteCarlo
,
QUAD_GaussLegendreTensorized
,
QUAD_GaussLegendre1D
,
QUAD_LevelSymmetric
,
QUAD_Lebedev
,
QUAD_LDFESA
,
QUAD_Product
,
QUAD_GaussChebyshev1D
};
/*! @brief Conversion Map String to enum
*/
...
...
@@ -77,7 +86,8 @@ enum PROBLEM_NAME {
PROBLEM_LineSource_Pseudo_1D_Physics
,
PROBLEM_AirCavity
,
PROBLEM_MuscleBoneLung
,
PROBLEM_Phantom2D
PROBLEM_Phantom2D
,
PROBLEM_IsotropicSource_2D
};
inline
std
::
map
<
std
::
string
,
PROBLEM_NAME
>
Problem_Map
{
{
"LINESOURCE"
,
PROBLEM_LineSource
},
...
...
@@ -87,6 +97,7 @@ inline std::map<std::string, PROBLEM_NAME> Problem_Map{ { "LINESOURCE", PROBLEM_
{
"AIRCAVITY"
,
PROBLEM_AirCavity
},
{
"MUSCLEBONELUNG"
,
PROBLEM_MuscleBoneLung
},
{
"PHANTOM2D"
,
PROBLEM_Phantom2D
},
{
"ISOTROPICPOINTSOURCE2D"
,
PROBLEM_IsotropicSource_2D
},
{
"LINESOURCE_PSEUDO_1D"
,
PROBLEM_LineSource_Pseudo_1D
},
{
"LINESOURCE_PSEUDO_1D_PHYSICS"
,
PROBLEM_LineSource_Pseudo_1D_Physics
}
};
...
...
@@ -130,10 +141,10 @@ enum OPTIMIZER_NAME { NEWTON, ML };
inline
std
::
map
<
std
::
string
,
OPTIMIZER_NAME
>
Optimizer_Map
{
{
"NEWTON"
,
NEWTON
},
{
"ML"
,
ML
}
};
// Volume output
enum
VOLUME_OUTPUT
{
ANALYTIC
,
MINIMAL
,
MOMENTS
,
DUAL_MOMENTS
,
DOSE
};
enum
VOLUME_OUTPUT
{
ANALYTIC
,
MINIMAL
,
MOMENTS
,
DUAL_MOMENTS
,
MEDICAL
};
inline
std
::
map
<
std
::
string
,
VOLUME_OUTPUT
>
VolOutput_Map
{
{
"ANALYTIC"
,
ANALYTIC
},
{
"MINIMAL"
,
MINIMAL
},
{
"MOMENTS"
,
MOMENTS
},
{
"DUAL_MOMENTS"
,
DUAL_MOMENTS
},
{
"
DOSE"
,
DOSE
}
};
{
"ANALYTIC"
,
ANALYTIC
},
{
"MINIMAL"
,
MINIMAL
},
{
"MOMENTS"
,
MOMENTS
},
{
"DUAL_MOMENTS"
,
DUAL_MOMENTS
},
{
"
MEDICAL"
,
MEDICAL
}
};
// Scalar output
enum
SCALAR_OUTPUT
{
ITER
,
MASS
,
RMS_FLUX
,
VTK_OUTPUT
,
CSV_OUTPUT
};
...
...
@@ -141,4 +152,10 @@ enum SCALAR_OUTPUT { ITER, MASS, RMS_FLUX, VTK_OUTPUT, CSV_OUTPUT };
inline
std
::
map
<
std
::
string
,
SCALAR_OUTPUT
>
ScalarOutput_Map
{
{
"ITER"
,
ITER
},
{
"MASS"
,
MASS
},
{
"RMS_FLUX"
,
RMS_FLUX
},
{
"VTK_OUTPUT"
,
VTK_OUTPUT
},
{
"CSV_OUTPUT"
,
CSV_OUTPUT
}
};
// Spherical Basis Name
enum
SPHERICAL_BASIS_NAME
{
SPHERICAL_HARMONICS
,
SPHERICAL_MONOMIALS
};
inline
std
::
map
<
std
::
string
,
SPHERICAL_BASIS_NAME
>
SphericalBasis_Map
{
{
"SPHERICAL_HARMONICS"
,
SPHERICAL_HARMONICS
},
{
"SPHERICAL_MONOMIALS"
,
SPHERICAL_MONOMIALS
}
};
#endif // GLOBAL_CONSTANTS_H
code/include/common/optionstructure.h
View file @
3a22f62d
...
...
@@ -22,7 +22,7 @@ class OptionBase
std
::
vector
<
std
::
string
>
_value
;
/*! @brief: String name of the option */
public:
OptionBase
(){}
;
OptionBase
()
{}
virtual
~
OptionBase
()
=
0
;
virtual
std
::
string
SetValue
(
std
::
vector
<
std
::
string
>
value
);
/*! @brief: Set string name of the option */
...
...
@@ -45,7 +45,7 @@ class OptionDouble : public OptionBase
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
;
...
...
@@ -61,7 +61,7 @@ class OptionString : public OptionBase
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
;
...
...
@@ -77,7 +77,7 @@ class OptionInt : public OptionBase
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
;
...
...
@@ -93,7 +93,7 @@ class OptionULong : public OptionBase
public:
OptionULong
(
std
::
string
option_field_name
,
unsigned
long
&
option_field
,
unsigned
long
default_value
);
~
OptionULong
()
override
{}
;
~
OptionULong
()
override
{}
std
::
string
SetValue
(
std
::
vector
<
std
::
string
>
option_value
)
override
;
...
...
@@ -109,7 +109,7 @@ class OptionUShort : public OptionBase
public:
OptionUShort
(
std
::
string
option_field_name
,
unsigned
short
&
option_field
,
unsigned
short
default_value
);
~
OptionUShort
()
override
{}
;
~
OptionUShort
()
override
{}
std
::
string
SetValue
(
std
::
vector
<
std
::
string
>
option_value
)
override
;
...
...
@@ -125,7 +125,7 @@ class OptionLong : public OptionBase
public:
OptionLong
(
std
::
string
option_field_name
,
long
&
option_field
,
long
default_value
);
~
OptionLong
()
override
{}
;
~
OptionLong
()
override
{}
std
::
string
SetValue
(
std
::
vector
<
std
::
string
>
option_value
)
override
;
...
...
@@ -141,7 +141,7 @@ class OptionBool : public OptionBase
public:
OptionBool
(
std
::
string
option_field_name
,
bool
&
option_field
,
bool
default_value
);
~
OptionBool
()
override
{}
;
~
OptionBool
()
override
{}
std
::
string
SetValue
(
std
::
vector
<
std
::
string
>
option_value
)
override
;
...
...
@@ -157,7 +157,7 @@ class OptionStringList : public OptionBase
public:
OptionStringList
(
std
::
string
option_field_name
,
unsigned
short
&
list_size
,
std
::
vector
<
std
::
string
>&
option_field
);
~
OptionStringList
()
override
{}
;
~
OptionStringList
()
override
{}
std
::
string
SetValue
(
std
::
vector
<
std
::
string
>
option_value
)
override
;
...
...
code/include/gui/cmap.h
0 → 100644
View file @
3a22f62d
#ifndef CMAP_H
#define CMAP_H
#include
"common/typedef.h"
const
Matrix
viridis
{
{
0
.
0
,
0
.
267004
,
0
.
004
874
,
0
.
329415
},
{
0
.
003
92156862745098
,
0
.
26851
,
0
.
00
9605
,
0
.
335427
},
{
0
.
007
84313725490196
,
0
.
269944
,
0
.
014625
,
0
.
341379
},
{
0
.
011764705
882352941
,
0
.
271305
,
0
.
01
9942
,
0
.
347269
},
{
0
.
0156
8627450980392
,
0
.
272594
,
0
.
025563
,
0
.
353093
},
{
0
.
01
96078431372549
,
0
.
273809
,
0
.
0314
97
,
0
.
358853
},
{
0
.
02352
9411764705882
,
0
.
274952
,
0
.
037752
,
0
.
364543
},
{
0
.
027450
980392156862
,
0
.
276022
,
0
.
044167
,
0
.
370164
},
{
0
.
03137254
901960784
,
0
.
277018
,
0
.
050344
,
0
.
375715
},
{
0
.
0352
9411764705882
,
0
.
277941
,
0
.
056324
,
0
.
381191
},
{
0
.
03
92156862745098
,
0
.
278791
,
0
.
062145
,
0
.
386592
},
{
0
.
043137254
901960784
,
0
.
279566
,
0
.
067
836
,
0
.
391917
},
{
0
.
04705
8823529411764
,
0
.
280267
,
0
.
073417
,
0
.
397163
},
{
0
.
050
980392156862744
,
0
.
280894
,
0
.
07
8907
,
0
.
402329
},
{
0
.
054
901960784313725
,
0
.
281446
,
0
.
08432
,
0
.
407414
},
{
0
.
05
8823529411764705
,
0
.
281924
,
0
.
089666
,
0
.
412415
},
{
0
.
0627450
9803921569
,
0
.
282327
,
0
.
094955
,
0
.
417331
},
{
0
.
06666666666666667
,
0
.
282656
,
0
.
100196
,
0
.
42216
},
{
0
.
0705
8823529411765
,
0
.
28291
,
0
.
105393
,
0
.
426902
},
{
0
.
07450
980392156863
,
0
.
283091
,
0
.
110553
,
0
.
431554
},
{
0
.
07
84313725490196
,
0
.
283197
,
0
.
11568
,
0
.
436115
},
{
0
.
08235294117647059
,
0
.
283229
,
0
.
120777
,
0
.
440584
},
{
0
.
08627450980392157
,
0
.
283187
,
0
.
125848
,
0
.
44496
},
{
0
.
09019607843137255
,
0
.
283072
,
0
.
130895
,
0
.
449241
},
{
0
.
09411764705882353
,
0
.
282884
,
0
.
13592
,
0
.
453427
},
{
0
.
09803921568627451
,
0
.
282623
,
0
.
140926
,
0
.
457517
},
{
0
.
10196078431372549
,
0
.
28229
,
0
.
145912
,
0
.
46151
},
{
0
.
10588235294117647
,
0
.
281887
,
0
.
150881
,
0
.
465405
},
{
0
.
10980392156862745
,
0
.
281412
,
0
.
155834
,
0
.
469201
},
{
0
.
11372549019607843
,
0
.
280868
,
0
.
160771
,
0
.
472899
},
{
0
.
11764705882352941
,
0
.
280255
,
0
.
165693
,
0
.
476498
},
{
0
.
12156862745098039
,
0
.
279574
,
0
.
170599
,
0
.
479997
},
{
0
.
12549019607843137
,
0
.
278826
,
0
.
17549
,
0
.
483397
},
{
0
.
12941176470588237
,
0
.
278012
,
0
.
180367
,
0
.
486697
},
{
0
.
13333333333333333
,
0
.
277134
,
0
.
185228
,
0
.
489898
},
{
0
.
13725490196078433
,
0
.
276194
,
0
.
190074
,
0
.
493001
},
{
0
.
1411764705882353
,
0
.
275191
,
0
.
194905
,
0
.
496005
},
{
0
.
1450980392156863
,
0
.
274128
,
0
.
199721
,
0
.
498911
},
{
0
.
14901960784313725
,
0
.
273006
,
0
.
20452
,
0
.
501721
},