mirror of
https://git.gfz-potsdam.de/naaice/tug.git
synced 2025-12-13 09:28:23 +01:00
updated documentation
This commit is contained in:
parent
ad67980baa
commit
d24b65db63
@ -98,8 +98,6 @@ class BoundaryElement {
|
||||
|
||||
|
||||
/**
|
||||
* This class implements the functionality and management of the boundary
|
||||
* conditions in the grid to be simulated.
|
||||
* This class implements the functionality and management of the boundary
|
||||
* conditions in the grid to be simulated.
|
||||
*/
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
|
||||
using namespace Eigen;
|
||||
|
||||
// TODO document default values and perhaps adjust them
|
||||
class Grid {
|
||||
public:
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@ using namespace std;
|
||||
enum APPROACH {
|
||||
FTCS_APPROACH, // Forward Time-Centered Space
|
||||
BTCS_APPROACH, // Backward Time-Centered Space solved with EigenLU solver
|
||||
CRANK_NICOLSON_APPROACH
|
||||
};
|
||||
|
||||
/**
|
||||
@ -67,8 +68,10 @@ enum TIME_MEASURE {
|
||||
class Simulation {
|
||||
public:
|
||||
/**
|
||||
* @brief Set up a runnable simulation environment with the largest stable
|
||||
* time step and 1000 iterations by passing the required parameters.
|
||||
* @brief Set up a simulation environment. The timestep and number of iterations
|
||||
* must be set. For the BTCS approach, the Thomas algorithm is used as
|
||||
* the default linear equation solver as this is faster for tridiagonal
|
||||
* matrices. CSV output, console output and time measure are off by default.
|
||||
*
|
||||
* @param grid Valid grid object
|
||||
* @param bc Valid boundary condition object
|
||||
@ -77,7 +80,7 @@ class Simulation {
|
||||
Simulation(Grid &grid, Boundary &bc, APPROACH approach);
|
||||
|
||||
/**
|
||||
* @brief Set the option to output the results to a CSV file.
|
||||
* @brief Set the option to output the results to a CSV file. Off by default.
|
||||
*
|
||||
*
|
||||
* @param csv_output Valid output option. The following options can be set
|
||||
@ -93,7 +96,7 @@ class Simulation {
|
||||
void setOutputCSV(CSV_OUTPUT csv_output);
|
||||
|
||||
/**
|
||||
* @brief Set the options for outputting information to the console.
|
||||
* @brief Set the options for outputting information to the console. Off by default.
|
||||
*
|
||||
* @param console_output Valid output option. The following options can be set
|
||||
* here:
|
||||
@ -103,16 +106,17 @@ class Simulation {
|
||||
*/
|
||||
void setOutputConsole(CONSOLE_OUTPUT console_output);
|
||||
|
||||
// TODO document method
|
||||
/**
|
||||
* @brief Set the Time Measure object
|
||||
* @brief Set the Time Measure object. Off by default.
|
||||
*
|
||||
* @param time_measure
|
||||
* @param time_measure
|
||||
*/
|
||||
void setTimeMeasure(TIME_MEASURE time_measure);
|
||||
|
||||
/**
|
||||
* @brief Setting the time step for each iteration step. Time step must be
|
||||
* greater than zero.
|
||||
* greater than zero. Setting the timestep is required.
|
||||
*
|
||||
* @param timestep Valid timestep greater than zero.
|
||||
*/
|
||||
@ -127,7 +131,7 @@ class Simulation {
|
||||
|
||||
/**
|
||||
* @brief Set the desired iterations to be calculated. A value greater
|
||||
* than zero must be specified here.
|
||||
* than zero must be specified here. Setting iterations is required.
|
||||
*
|
||||
* @param iterations Number of iterations to be simulated.
|
||||
*/
|
||||
@ -142,6 +146,7 @@ class Simulation {
|
||||
*/
|
||||
void setSolver(SOLVER solver);
|
||||
|
||||
// TODO document method
|
||||
void setNumberThreads(int num_threads);
|
||||
|
||||
/**
|
||||
@ -157,6 +162,7 @@ class Simulation {
|
||||
*/
|
||||
void printConcentrationsConsole();
|
||||
|
||||
// TODO move create CSVfile to TugUtils
|
||||
/**
|
||||
* @brief Creates a CSV file with a name containing the current simulation
|
||||
* parameters. If the data name already exists, an additional counter is
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
/**
|
||||
* @file BTCSv2.cpp
|
||||
* @brief Implementation of heterogenous BTCS (backward time-centered space) solution
|
||||
* of diffusion equation in 1D and 2D space.
|
||||
* of diffusion equation in 1D and 2D space. Internally the alternating-direction
|
||||
* implicit (ADI) method is used. Version 2, because Version 1 was an
|
||||
* implementation for the homogeneous BTCS solution.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@ -232,6 +232,7 @@ void Simulation::run() {
|
||||
auto begin = std::chrono::high_resolution_clock::now();
|
||||
|
||||
if (approach == FTCS_APPROACH) { // FTCS case
|
||||
|
||||
for (int i = 0; i < iterations * innerIterations; i++) {
|
||||
if (console_output == CONSOLE_OUTPUT_VERBOSE && i > 0) {
|
||||
printConcentrationsConsole();
|
||||
@ -278,6 +279,10 @@ void Simulation::run() {
|
||||
}
|
||||
}
|
||||
|
||||
} else if (approach == CRANK_NICOLSON_APPROACH) { // Crank-Nicolson case
|
||||
|
||||
// TODO
|
||||
|
||||
}
|
||||
|
||||
auto end = std::chrono::high_resolution_clock::now();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user