Skip to content
Snippets Groups Projects
Verified Commit f55aae77 authored by Lars Bilke's avatar Lars Bilke
Browse files

[AppL] Fixed OGS_USE_INSITU.

parent 3fbbccfc
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ endif() ...@@ -29,6 +29,7 @@ endif()
target_compile_definitions( target_compile_definitions(
ApplicationsLib PUBLIC $<$<BOOL:${USE_LIS}>:USE_LIS> ApplicationsLib PUBLIC $<$<BOOL:${USE_LIS}>:USE_LIS>
$<$<BOOL:${OGS_USE_PYTHON}>:OGS_USE_PYTHON> $<$<BOOL:${OGS_USE_PYTHON}>:OGS_USE_PYTHON>
PRIVATE $<$<BOOL:${OGS_USE_INSITU}>:OGS_USE_INSITU>
) )
# Set cpp definitions if the cmake option is enabled for the given process. # Set cpp definitions if the cmake option is enabled for the given process.
......
...@@ -79,15 +79,14 @@ void Simulation::initializeDataStructures( ...@@ -79,15 +79,14 @@ void Simulation::initializeDataStructures(
INFO("Cleanup possible output files before running ogs."); INFO("Cleanup possible output files before running ogs.");
BaseLib::removeFiles(test_definition->getOutputFiles()); BaseLib::removeFiles(test_definition->getOutputFiles());
} }
#ifdef USE_INSITU #ifdef OGS_USE_INSITU
auto isInsituConfigured = false;
//! \ogs_file_param{prj__insitu} //! \ogs_file_param{prj__insitu}
if (auto t = project_config.getConfigSubtreeOptional("insitu")) if (auto t = project_config.getConfigSubtreeOptional("insitu"))
{ {
InSituLib::Initialize( InSituLib::Initialize(
//! \ogs_file_param{prj__insitu__scripts} //! \ogs_file_param{prj__insitu__scripts}
t->getConfigSubtree("scripts"), t->getConfigSubtree("scripts"),
BaseLib::extractPath(project_arg.getValue())); BaseLib::extractPath(project));
isInsituConfigured = true; isInsituConfigured = true;
} }
#else #else
...@@ -163,7 +162,7 @@ std::optional<ApplicationsLib::TestDefinition> Simulation::getTestDefinition() ...@@ -163,7 +162,7 @@ std::optional<ApplicationsLib::TestDefinition> Simulation::getTestDefinition()
Simulation::~Simulation() Simulation::~Simulation()
{ {
#ifdef USE_INSITU #ifdef OGS_USE_INSITU
if (isInsituConfigured) if (isInsituConfigured)
{ {
InSituLib::Finalize(); InSituLib::Finalize();
......
...@@ -49,4 +49,7 @@ private: ...@@ -49,4 +49,7 @@ private:
#endif #endif
std::unique_ptr<ProjectData> project_data; std::unique_ptr<ProjectData> project_data;
std::optional<ApplicationsLib::TestDefinition> test_definition; std::optional<ApplicationsLib::TestDefinition> test_definition;
#if defined(OGS_USE_INSITU)
bool isInsituConfigured = false;
#endif
}; };
...@@ -90,8 +90,6 @@ target_link_libraries( ...@@ -90,8 +90,6 @@ target_link_libraries(
tclap tclap
) )
target_compile_definitions(ogs PRIVATE $<$<BOOL:${USE_INSITU}>:USE_INSITU>)
# ---- Tests ---- # ---- Tests ----
add_test(NAME ogs_no_args COMMAND ogs) add_test(NAME ogs_no_args COMMAND ogs)
set_tests_properties(ogs_no_args PROPERTIES WILL_FAIL TRUE LABELS "default") set_tests_properties(ogs_no_args PROPERTIES WILL_FAIL TRUE LABELS "default")
......
...@@ -16,6 +16,6 @@ if(OGS_BUILD_CLI) ...@@ -16,6 +16,6 @@ if(OGS_BUILD_CLI)
add_subdirectory(CLI) add_subdirectory(CLI)
endif() # OGS_BUILD_CLI endif() # OGS_BUILD_CLI
if(OGS_INSITU) if(OGS_USE_INSITU)
add_subdirectory(InSituLib) add_subdirectory(InSituLib)
endif() endif()
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include <vtkNew.h> #include <vtkNew.h>
#include <vtkUnstructuredGrid.h> #include <vtkUnstructuredGrid.h>
#include <filesystem>
#include "MeshLib/Mesh.h" #include "MeshLib/Mesh.h"
#include "MeshLib/Vtk/VtkMappedMeshSource.h" #include "MeshLib/Vtk/VtkMappedMeshSource.h"
......
...@@ -2,10 +2,6 @@ ...@@ -2,10 +2,6 @@
## Getting started ## Getting started
Requirements:
- ParaView insitu-build, at least commit [056de649](https://gitlab.kitware.com/paraview/paraview/commit/056de649320f52c8a14668ffa383d7361313a133), and therefore Conan is not supported
### Build ParaView ### Build ParaView
```bash ```bash
...@@ -21,21 +17,21 @@ ninja install ...@@ -21,21 +17,21 @@ ninja install
### Build OGS ### Build OGS
```bash ```bash
cmake -DCMAKE_BUILD_TYPE=Release -DOGS_INSITU=ON -DOGS_USE_CONAN=OFF \ cmake -DCMAKE_BUILD_TYPE=Release -DOGS_USE_INSITU=ON \
-DParaView_DIR=~/path/to/paraview_install/lib/cmake/paraview-5.8 \ -DParaView_DIR=~/path/to/paraview_install/lib/cmake/paraview-5.10 \
-DOGS_BUILD_PROCESSES=GroundwaterFlow ../ogs -DOGS_BUILD_PROCESSES=SteadyStateDiffusion ../ogs
``` ```
**OR:** Build with [ogs-container-maker](https://github.com/ufz/ogs-container-maker): **OR:** Build with [ogs-container-maker](https://github.com/ufz/ogs-container-maker):
```bash ```bash
python ogscm/cli.py --compiler_version 9 --ogs bilke/ogs@insitu-refactor --cmake_args ' -DOGS_BUILD_PROCESSES=GroundwaterFlow' --pm system --insitu -B -C -R ogscm compiler.py ogs.py --cmake_args ' -DOGS_BUILD_PROCESSES=SteadyStateDiffusion' --insitu -B -C -R
``` ```
### Run benchmark ### Run benchmark
``` ```bash
bin/ogs -o _out ../ogs/Tests/Data/Elliptic/cube_1x1x1_GroundWaterFlow/cube_1e1.prj bin/ogs -o _out ../ogs/Tests/Data/EllipticPETSc/square_1e1_neumann.prj
``` ```
Open generated `cube_1e1_*.pvtp` in ParaView. Open generated `cube_1e1_*.pvtp` in ParaView.
...@@ -55,11 +51,3 @@ These python scripts can be generated with ParaView: ...@@ -55,11 +51,3 @@ These python scripts can be generated with ParaView:
- Choose the data format, e.g. *XMLPPolyDataWriter* - Choose the data format, e.g. *XMLPPolyDataWriter*
- Click the check-box next to the data format drop-down - Click the check-box next to the data format drop-down
- In the menu click *Catalyst / Export Catalyst Script* - In the menu click *Catalyst / Export Catalyst Script*
----
TODO:
- Test parallel benchmark
- Live connection not working: https://gitlab.kitware.com/paraview/paraview/issues/19613
- Check https://gitlab.kitware.com/paraview/paraview/tree/master/Examples/Catalyst/CxxMappedDataArrayExample for more syntax changes
...@@ -107,7 +107,7 @@ if((CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC) AND GPROF_PATH) ...@@ -107,7 +107,7 @@ if((CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC) AND GPROF_PATH)
endif() # GCC AND GPROF_PATH endif() # GCC AND GPROF_PATH
option(OGS_BUILD_GUI "Should the Data Explorer be built?" OFF) option(OGS_BUILD_GUI "Should the Data Explorer be built?" OFF)
option(OGS_INSITU "Builds OGS with insitu visualization capabilities." OFF) option(OGS_USE_INSITU "Builds OGS with insitu visualization capabilities." OFF)
option(OGS_USE_LIS "Use Lis" OFF) option(OGS_USE_LIS "Use Lis" OFF)
option(OGS_USE_NETCDF "Add NetCDF support." OFF) option(OGS_USE_NETCDF "Add NetCDF support." OFF)
......
...@@ -45,6 +45,6 @@ target_compile_definitions( ...@@ -45,6 +45,6 @@ target_compile_definitions(
$<$<BOOL:${OGS_ENABLE_ELEMENT_CUBOID}>:OGS_ENABLE_ELEMENT_CUBOID> $<$<BOOL:${OGS_ENABLE_ELEMENT_CUBOID}>:OGS_ENABLE_ELEMENT_CUBOID>
$<$<BOOL:${OGS_ENABLE_ELEMENT_PRISM}>:OGS_ENABLE_ELEMENT_PRISM> $<$<BOOL:${OGS_ENABLE_ELEMENT_PRISM}>:OGS_ENABLE_ELEMENT_PRISM>
$<$<BOOL:${OGS_ENABLE_ELEMENT_PYRAMID}>:OGS_ENABLE_ELEMENT_PYRAMID> $<$<BOOL:${OGS_ENABLE_ELEMENT_PYRAMID}>:OGS_ENABLE_ELEMENT_PYRAMID>
PRIVATE $<$<BOOL:${USE_INSITU}>:USE_INSITU> PRIVATE $<$<BOOL:${OGS_USE_INSITU}>:OGS_USE_INSITU>
$<$<BOOL:${OGS_USE_PYTHON}>:OGS_USE_PYTHON> $<$<BOOL:${OGS_USE_PYTHON}>:OGS_USE_PYTHON>
) )
...@@ -232,7 +232,7 @@ void Output::doOutput(Process const& process, ...@@ -232,7 +232,7 @@ void Output::doOutput(Process const& process,
{ {
doOutputAlways(process, process_id, timestep, t, iteration, xs); doOutputAlways(process, process_id, timestep, t, iteration, xs);
} }
#ifdef USE_INSITU #ifdef OGS_USE_INSITU
// Note: last time step may be output twice: here and in // Note: last time step may be output twice: here and in
// doOutputLastTimestep() which throws a warning. // doOutputLastTimestep() which throws a warning.
InSituLib::CoProcess(process.getMesh(), t, timestep, false, InSituLib::CoProcess(process.getMesh(), t, timestep, false,
...@@ -251,7 +251,7 @@ void Output::doOutputLastTimestep(Process const& process, ...@@ -251,7 +251,7 @@ void Output::doOutputLastTimestep(Process const& process,
{ {
doOutputAlways(process, process_id, timestep, t, iteration, xs); doOutputAlways(process, process_id, timestep, t, iteration, xs);
} }
#ifdef USE_INSITU #ifdef OGS_USE_INSITU
InSituLib::CoProcess(process.getMesh(), t, timestep, true, InSituLib::CoProcess(process.getMesh(), t, timestep, true,
output_file->directory); output_file->directory);
#endif #endif
......
...@@ -269,16 +269,20 @@ foreach(option_index ${ogs.libraries.vtk.options}) ...@@ -269,16 +269,20 @@ foreach(option_index ${ogs.libraries.vtk.options})
endforeach() endforeach()
list(REMOVE_DUPLICATES VTK_OPTIONS) list(REMOVE_DUPLICATES VTK_OPTIONS)
# TODO: if(OGS_INSITU) find_package(ParaView REQUIRED) end() if(OGS_USE_INSITU)
unset(VTK_COMPONENTS) find_package(ParaView REQUIRED)
foreach(opt ${VTK_OPTIONS}) else()
if("${opt}" MATCHES "^VTK_MODULE_ENABLE_VTK_(.*) YES") unset(VTK_COMPONENTS)
list(APPEND VTK_COMPONENTS ${CMAKE_MATCH_1}) foreach(opt ${VTK_OPTIONS})
endif() if("${opt}" MATCHES "^VTK_MODULE_ENABLE_VTK_(.*) YES")
endforeach() list(APPEND VTK_COMPONENTS ${CMAKE_MATCH_1})
find_package(VTK ${ogs.minimum_version.vtk} QUIET COMPONENTS ${VTK_COMPONENTS}) endif()
endforeach()
message(STATUS "FINDING VTK: ${VTK_COMPONENTS}")
find_package(VTK ${ogs.minimum_version.vtk} COMPONENTS ${VTK_COMPONENTS})
endif()
if(NOT VTK_FOUND) if(NOT VTK_FOUND AND NOT OGS_USE_INSITU)
# Setting shared libs on PETSc, otherwise pvtu files only contain one # Setting shared libs on PETSc, otherwise pvtu files only contain one
# <Piece>-element (one subdomain). # <Piece>-element (one subdomain).
list(APPEND VTK_OPTIONS "BUILD_SHARED_LIBS ${OGS_USE_PETSC}") list(APPEND VTK_OPTIONS "BUILD_SHARED_LIBS ${OGS_USE_PETSC}")
...@@ -314,10 +318,6 @@ if(VTK_ADDED) ...@@ -314,10 +318,6 @@ if(VTK_ADDED)
# Also suppress warnings # Also suppress warnings
list(APPEND DISABLE_WARNINGS_TARGETS loguru) list(APPEND DISABLE_WARNINGS_TARGETS loguru)
endif() endif()
endif()
# end VTK ###
if(VTK_ADDED)
# VTK already comes with exprtk, reusing it. # VTK already comes with exprtk, reusing it.
target_include_directories( target_include_directories(
exprtk SYSTEM exprtk SYSTEM
......
...@@ -3,9 +3,12 @@ if(NOT DOXYGEN_FOUND) ...@@ -3,9 +3,12 @@ if(NOT DOXYGEN_FOUND)
endif() endif()
set(DOXYGEN_EXCLUDE set(DOXYGEN_EXCLUDE
${PROJECT_SOURCE_DIR}/ThirdParty ${PROJECT_SOURCE_DIR}/scripts ${PROJECT_SOURCE_DIR}/ThirdParty
${PROJECT_SOURCE_DIR}/Tests ${PROJECT_SOURCE_DIR}/Documentation/ProjectFile ${PROJECT_SOURCE_DIR}/scripts
${PROJECT_SOURCE_DIR}/web ${PROJECT_BINARY_DIR}/_deps ${PROJECT_SOURCE_DIR}/Tests
${PROJECT_SOURCE_DIR}/Documentation/ProjectFile
${PROJECT_SOURCE_DIR}/web
${PROJECT_BINARY_DIR}/_deps
${PROJECT_BINARY_DIR}/_ext ${PROJECT_BINARY_DIR}/_ext
) )
set(DOXYGEN_FILE_PATTERNS *.h *.cpp *.tpp *.dox) set(DOXYGEN_FILE_PATTERNS *.h *.cpp *.tpp *.dox)
...@@ -62,7 +65,7 @@ set(DOXYGEN_PREDEFINED ...@@ -62,7 +65,7 @@ set(DOXYGEN_PREDEFINED
OGS_USE_MFRONT OGS_USE_MFRONT
OGS_USE_NETCDF OGS_USE_NETCDF
OGS_USE_PYTHON OGS_USE_PYTHON
USE_INSITU OGS_USE_INSITU
USE_LIS USE_LIS
USE_MKL USE_MKL
USE_PETSC USE_PETSC
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment