mirror of
https://git.gfz-potsdam.de/naaice/tug.git
synced 2025-12-15 18:38:23 +01:00
add solver to template
This commit is contained in:
parent
47ad909a9c
commit
30d2099d8a
@ -20,7 +20,7 @@ using namespace tug;
|
||||
constexpr int row = 11;
|
||||
constexpr int col = 11;
|
||||
|
||||
template <tug::APPROACH approach>
|
||||
template <tug::APPROACH approach, tug::SOLVER solver>
|
||||
Diffusion<double, approach> setupSimulation(RowMajMat<double> &concentrations,
|
||||
double timestep, int iterations) {
|
||||
int domain_row = 10;
|
||||
@ -30,7 +30,7 @@ Diffusion<double, approach> setupSimulation(RowMajMat<double> &concentrations,
|
||||
// RowMajMat<double> concentrations = MatrixXd::Constant(row, col, 0);
|
||||
concentrations(5, 5) = 1;
|
||||
|
||||
Diffusion<double, approach> diffusiongrid(concentrations);
|
||||
Diffusion<double, approach, solver> diffusiongrid(concentrations);
|
||||
|
||||
diffusiongrid.getConcentrationMatrix() = concentrations;
|
||||
diffusiongrid.setDomain(domain_row, domain_col);
|
||||
@ -72,7 +72,7 @@ DIFFUSION_TEST(EqualityFTCS) {
|
||||
|
||||
RowMajMat<double> concentrations = MatrixXd::Constant(row, col, 0);
|
||||
|
||||
Diffusion<double, tug::FTCS_APPROACH> sim =
|
||||
Diffusion<double, tug::FTCS_APPROACH, tug::THOMAS_ALGORITHM_SOLVER> sim =
|
||||
setupSimulation<tug::FTCS_APPROACH>(concentrations, timestep, iterations);
|
||||
|
||||
// Boundary bc = Boundary(grid);
|
||||
@ -97,7 +97,7 @@ DIFFUSION_TEST(EqualityBTCS) {
|
||||
|
||||
RowMajMat<double> concentrations = MatrixXd::Constant(row, col, 0);
|
||||
|
||||
Diffusion<double, tug::BTCS_APPROACH> sim =
|
||||
Diffusion<double, tug::BTCS_APPROACH, tug::THOMAS_ALGORITHM_SOLVER> sim =
|
||||
setupSimulation<tug::BTCS_APPROACH>(concentrations, timestep,
|
||||
iterations); // Boundary
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user