mirror of
https://git.gfz-potsdam.de/naaice/poet.git
synced 2025-12-16 12:54:50 +01:00
Add option to toggle tug numerical solver approach
This commit is contained in:
parent
8b7e3e983e
commit
85e93955bc
@ -18,6 +18,15 @@ target_sources(POETLib
|
|||||||
Chemistry/SurrogateModels/ProximityHashTable.cpp
|
Chemistry/SurrogateModels/ProximityHashTable.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set(POET_TUG_APPROACH "Implicit" CACHE STRING "tug numerical approach to use")
|
||||||
|
set_property(CACHE POET_TUG_APPROACH PROPERTY STRINGS "Implicit" "Explicit")
|
||||||
|
|
||||||
|
if (POET_TUG_APPROACH STREQUAL "Implicit")
|
||||||
|
target_compile_definitions(POETLib PRIVATE POET_TUG_BTCS)
|
||||||
|
elseif (POET_TUG_APPROACH STREQUAL "Explicit")
|
||||||
|
target_compile_definitions(POETLib PRIVATE POET_TUG_FTCS)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_include_directories(POETLib PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
target_include_directories(POETLib PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
POETLib
|
POETLib
|
||||||
|
|||||||
@ -81,7 +81,14 @@ void DiffusionModule::simulate(double requested_dt) {
|
|||||||
|
|
||||||
grid.setDomain(param_list.s_rows, param_list.s_cols);
|
grid.setDomain(param_list.s_rows, param_list.s_cols);
|
||||||
|
|
||||||
|
#if defined(POET_TUG_BTCS)
|
||||||
tug::Simulation<TugType> sim(grid, boundary);
|
tug::Simulation<TugType> sim(grid, boundary);
|
||||||
|
#elif defined(POET_TUG_FTCS)
|
||||||
|
tug::Simulation<TugType, tug::FTCS_APPROACH> sim(grid, boundary);
|
||||||
|
#else
|
||||||
|
#error "No valid approach defined"
|
||||||
|
#endif
|
||||||
|
|
||||||
sim.setIterations(1);
|
sim.setIterations(1);
|
||||||
|
|
||||||
for (const auto &sol_name : this->param_list.transport_names) {
|
for (const auto &sol_name : this->param_list.transport_names) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user