mirror of
https://git.gfz-potsdam.de/naaice/poet.git
synced 2025-12-15 20:38:23 +01:00
Merge branch 'ml/add-tug-solver-option' into 'main'
Add option to toggle tug numerical solver approach See merge request naaice/poet!50
This commit is contained in:
commit
a4bf2a13f9
@ -18,6 +18,15 @@ target_sources(POETLib
|
||||
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_link_libraries(
|
||||
POETLib
|
||||
|
||||
@ -81,7 +81,14 @@ void DiffusionModule::simulate(double requested_dt) {
|
||||
|
||||
grid.setDomain(param_list.s_rows, param_list.s_cols);
|
||||
|
||||
#if defined(POET_TUG_BTCS)
|
||||
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);
|
||||
|
||||
for (const auto &sol_name : this->param_list.transport_names) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user