Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/common/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ Common
:maxdepth: 1

config
io
mesh
8 changes: 2 additions & 6 deletions doc/common/io.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
IO
====

.. doxygenclass:: IO
:members:
:protected-members:
:private-members:
==

.. doxygenfile:: io.hpp
237 changes: 141 additions & 96 deletions doc/configFiles.rst
Original file line number Diff line number Diff line change
@@ -1,96 +1,141 @@
Configuration files
-----------------------

Configuration files are written in `TOML-style <https://github.com/toml-lang/toml>`_
. A number of examples (link examples) can be found in the ``./code/input`` folder. Users can also handover their own files, which should follow the following specifications:

********************
Parameters
********************

Below you can see the possible parameters that can be specified in a config file. Which of these parameters are required depends on the chosen application and solver



.. code-block:: c++

// --- Options ---
// File Structure
std::string _inputDir; // Directory for input files
std::string _outputDir; // Directory for output files
std::string _outputFile; // Name of output file
std::string _logDir; // Directory of log file
std::string _logFileName; // Name of log file
std::string _meshFile; // Name of mesh file
std::string _ctFile; // Name of CT file

// Quadrature
QUAD_NAME _quadName; // Quadrature Name
unsigned short _quadOrder; // Quadrature Order
unsigned _nQuadPoints;

// Mesh
unsigned _nCells;

// Solver
double _CFL; // CFL Number for Solver
double _tEnd; // Final Time for Simulation
PROBLEM_NAME _problemName; // Name of predefined Problem
SOLVER_NAME _solverName; // Name of the used Solver
ENTROPY_NAME _entropyName; // Name of the used Entropy Functional
unsigned short _maxMomentDegree; // Maximal Order of Moments for PN and MN Solver
unsigned short _reconsOrder; // Spatial Order of Accuracy for Solver

// Linesource
double _sigmaS; // Scattering coeffient for Linesource test case

/*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;

/*If true, the SN Solver uses all Gauss pts in the quadrature */
bool _allGaussPts;

/*If true, continuous slowing down approximation will be used */
bool _csd;

std::string _hydrogenFile; // Name of hydrogen cross section file
std::string _oxygenFile; // Name of oxygen cross section file

// Boundary Conditions
/*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; // Number of Dirichlet BC markers. Enum entry: DIRICHLET
unsigned short _nMarkerNeumann; // Number of Neumann BC markers. Enum entry: Neumann
std::vector<std::string> _MarkerDirichlet; // Dirichlet BC markers.
std::vector<std::string> _MarkerNeumann; // Neumann BC markers.

// Scattering Kernel
KERNEL_NAME _kernelName; // Scattering Kernel Name

// Optimizer
OPTIMIZER_NAME _entropyOptimizerName; // Choice of optimizer
double _optimizerEpsilon; // termination criterion epsilon for Newton Optmizer
unsigned short _newtonIter; // Maximal Number of newton iterations
double _newtonStepSize; // Stepsize factor for newton optimizer
unsigned short _newtonLineSearchIter; // Maximal Number of line search iterations for newton optimizer
bool _newtonFastMode; // If true, we skip the NewtonOptimizer for quadratic entropy and assign alpha = u

// Output Options
unsigned short _nVolumeOutput; // Number of volume outputs
std::vector<VOLUME_OUTPUT> _volumeOutput; // Output groups for volume output
unsigned short _volumeOutputFrequency; // Frequency of vtk write of volume output

unsigned short _nScreenOutput; // Number of screen outputs
std::vector<SCALAR_OUTPUT> _screenOutput; // Output groups for screen output
unsigned short _screenOutputFrequency; // Frequency of screen output

unsigned short _nHistoryOutput; // Number of screen outputs
std::vector<SCALAR_OUTPUT> _historyOutput; // Output groups for screen output
unsigned short _historyOutputFrequency; // Frequency of screen output




Configuration files
===================

KiT-RT uses a simple key-value format parsed by `Config` (see
`src/common/config.cpp`). It is not strict TOML.

Syntax
------

- One option per line: `KEY = VALUE`
- Lists use parentheses: `SCREEN_OUTPUT = (ITER, MASS, RMS_FLUX)`
- Comments often use `%` in existing examples
- Boolean values use `YES/NO`
- Relative paths are resolved from the config file directory

Minimal example
---------------

.. code-block:: cfg

OUTPUT_DIR = ../../../result
OUTPUT_FILE = checkerboard_SN
LOG_DIR = ../../../result/logs
MESH_FILE = ../../mesh_files/checkerboard.su2

PROBLEM = CHECKERBOARD
SOLVER = SN_SOLVER
CFL_NUMBER = 0.5
TIME_FINAL = 0.4

BC_DIRICHLET = ( void )

QUAD_TYPE = GAUSS_LEGENDRE_TENSORIZED_2D
QUAD_ORDER = 4

VOLUME_OUTPUT = (MINIMAL)

Core options
------------

File and paths:

- `OUTPUT_DIR`, `OUTPUT_FILE`, `LOG_DIR`, `LOG_FILE`
- `MESH_FILE`, `CT_FILE`, `DATA_DIR`
- `LOAD_RESTART_SOLUTION`, `SAVE_RESTART_SOLUTION_FREQUENCY`

Solver setup:

- `SOLVER`, `PROBLEM`, `HPC_SOLVER`
- `CFL_NUMBER`, `TIME_FINAL`, `RECONS_ORDER`, `TIME_INTEGRATION_ORDER`
- `MAX_MOMENT_SOLVER`, `SPATIAL_DIM`, `SN_ALL_GAUSS_PTS`

Physics and closures:

- `KERNEL`, `SPHERICAL_BASIS`
- `ENTROPY_FUNCTIONAL`, `ENTROPY_OPTIMIZER`
- `REGULARIZER_GAMMA`, `NEWTON_*`, `NEURAL_MODEL_*`

Boundary and quadrature:

- `BC_DIRICHLET`, `BC_NEUMANN`
- `QUAD_TYPE`, `QUAD_ORDER`

Output control:

- `VOLUME_OUTPUT`, `VOLUME_OUTPUT_FREQUENCY`
- `SCREEN_OUTPUT`, `SCREEN_OUTPUT_FREQUENCY`
- `HISTORY_OUTPUT`, `HISTORY_OUTPUT_FREQUENCY`

Current enum values (from code)
--------------------------------

`SOLVER`:

- `SN_SOLVER`
- `PN_SOLVER`
- `MN_SOLVER`
- `MN_SOLVER_NORMALIZED`
- `CSD_SN_SOLVER`
- `CSD_PN`
- `CSD_MN`

`PROBLEM`:

- `LINESOURCE`, `LINESOURCE_1D`
- `CHECKERBOARD`, `CHECKERBOARD_1D`
- `AIRCAVITY_1D`, `WATERPHANTOM`, `RADIATIONCT`
- `MELTINGCUBE`, `MELTINGCUBE_1D`
- `STARMAP_VALIDATION`
- `HOHLRAUM`, `SYMMETRIC_HOHLRAUM`, `QUARTER_HOHLRAUM`
- `LATTICE`, `HALF_LATTICE`

`QUAD_TYPE`:

- `MONTE_CARLO`
- `GAUSS_LEGENDRE_TENSORIZED`, `GAUSS_LEGENDRE_TENSORIZED_2D`, `GAUSS_LEGENDRE_1D`
- `LEVEL_SYMMETRIC`, `LEBEDEV`, `LDFESA`, `TESSALATION`, `PRODUCT`
- `MIDPOINT_1D`, `MIDPOINT_2D`, `MIDPOINT_3D`
- `RECTANGULAR_1D`, `RECTANGULAR_2D`, `RECTANGULAR_3D`

`KERNEL`:

- `ISOTROPIC`, `ISOTROPIC_1D`

`SPHERICAL_BASIS`:

- `SPHERICAL_HARMONICS`
- `SPHERICAL_MONOMIALS`
- `SPHERICAL_MONOMIALS_ROTATED`

HPC SN config pattern
---------------------

The HPC path is selected with:

- `SOLVER = SN_SOLVER`
- `HPC_SOLVER = YES`

Example (from validation inputs):

.. code-block:: cfg

PROBLEM = LATTICE
SOLVER = SN_SOLVER
HPC_SOLVER = YES
RECONS_ORDER = 2
TIME_INTEGRATION_ORDER = 2
QUAD_TYPE = GAUSS_LEGENDRE_TENSORIZED_2D
QUAD_ORDER = 4

Reference configs
-----------------

Validated examples are under:

- `tests/input/validation_tests/SN_solver`
- `tests/input/validation_tests/PN_solver`
- `tests/input/validation_tests/MN_solver`
- `tests/input/validation_tests/CSD_PN_solver`
- `tests/input/validation_tests/CSD_MN_solver`
- `tests/input/validation_tests/SN_solver_hpc`
3 changes: 2 additions & 1 deletion doc/cpp_doc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ C++ Documentation

.. toctree::
:maxdepth: 2

common/index
datagenerator/index
entropies/index
fluxes/index
kernels/index
Expand Down
11 changes: 8 additions & 3 deletions doc/datagenerator/datagenerator1D.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
DataGeneratorBase
=============
Data Generators 1D
==================

.. doxygenclass:: DataGeneratorBase
.. doxygenclass:: DataGeneratorClassification1D
:members:
:protected-members:
:private-members:

.. doxygenclass:: DataGeneratorRegression1D
:members:
:protected-members:
:private-members:
11 changes: 8 additions & 3 deletions doc/datagenerator/datagenerator2D.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
DataGeneratorBase
=============
Data Generators 2D
==================

.. doxygenclass:: DataGeneratorBase
.. doxygenclass:: DataGeneratorClassification2D
:members:
:protected-members:
:private-members:

.. doxygenclass:: DataGeneratorRegression2D
:members:
:protected-members:
:private-members:
6 changes: 3 additions & 3 deletions doc/datagenerator/datagenerator3D.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DataGeneratorBase
=============
Data Generators 3D
==================

.. doxygenclass:: DataGeneratorBase
.. doxygenclass:: DataGeneratorRegression3D
:members:
:protected-members:
:private-members:
2 changes: 1 addition & 1 deletion doc/datagenerator/datageneratorbase.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DataGeneratorBase
=============
=================

.. doxygenclass:: DataGeneratorBase
:members:
Expand Down
6 changes: 3 additions & 3 deletions doc/datagenerator/datageneratorclassification.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DataGeneratorBase
=============
DataGeneratorClassification
===========================

.. doxygenclass:: DataGeneratorBase
.. doxygenclass:: DataGeneratorClassification
:members:
:protected-members:
:private-members:
6 changes: 3 additions & 3 deletions doc/datagenerator/datageneratorregression.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DataGeneratorBase
=============
DataGeneratorRegression
=======================

.. doxygenclass:: DataGeneratorBase
.. doxygenclass:: DataGeneratorRegression
:members:
:protected-members:
:private-members:
10 changes: 5 additions & 5 deletions doc/datagenerator/index.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
datagenerator
=========
Data Generators
===============

.. toctree::
:maxdepth: 1

datageneratorbase
datageneratorclassification
datageneratorregression
datagenerator1D
datagenerator2D
datagenerator3D
datageneratorbase
datageneratorregression
datageneratorclassification
Loading