Commit 3adb271a authored by Tom Fischer's avatar Tom Fischer
Browse files

Merge branch 'SmallFixes' into 'master'

A set of independent small changes.

See merge request !3657
parents 19e3e0bc 39728477
Pipeline #5090 passed with stages
in 41 minutes
......@@ -14,7 +14,6 @@ target_link_libraries(
MeshGeoToolsLib
ParameterLib
ProcessLib
spdlog::spdlog
$<$<BOOL:${OGS_USE_PYTHON}>:pybind11::pybind11>
$<$<BOOL:${OGS_USE_PETSC}>:petsc>
)
......
......@@ -129,7 +129,6 @@ target_link_libraries(
QtDiagramView
QtStratView
DataHolderLib
spdlog::spdlog
Qt5::Core
Qt5::Gui
)
......
......@@ -28,7 +28,6 @@ ogs_add_library(QtDiagramView ${SOURCES} ${HEADERS} ${UIS})
target_include_directories(QtDiagramView PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(
QtDiagramView PRIVATE BaseLib GeoLib QtBase DataHolderLib Qt5::Gui
spdlog::spdlog
)
add_autogen_include(QtDiagramView)
......
......@@ -161,7 +161,7 @@ endif() # GEOTIFF_FOUND
target_link_libraries(
VtkVis PUBLIC BaseLib GeoLib MeshLib DataHolderLib QtBase VtkVisFilter
PRIVATE MathLib ApplicationsFileIO Qt5::Gui spdlog::spdlog
PRIVATE MathLib ApplicationsFileIO Qt5::Gui
)
set_property(TARGET VtkVis PROPERTY FOLDER "DataExplorer")
......
......@@ -5,5 +5,5 @@ get_source_files(SOURCES_DataHolderLib)
ogs_add_library(DataHolderLib ${SOURCES_DataHolderLib})
target_link_libraries(
DataHolderLib PUBLIC GeoLib MeshLib PRIVATE BaseLib MathLib spdlog::spdlog
DataHolderLib PUBLIC GeoLib MeshLib PRIVATE BaseLib MathLib
)
......@@ -32,7 +32,7 @@ target_link_libraries(
$<$<BOOL:${OGS_BUILD_GUI}>:QtBase>
$<$<TARGET_EXISTS:shp>:shp>
$<$<TARGET_EXISTS:SwmmInterface>:SwmmInterface>
PRIVATE MeshLib GitInfoLib std::filesystem spdlog::spdlog
PRIVATE MeshLib GitInfoLib std::filesystem
)
configure_file(
......
......@@ -156,14 +156,17 @@ void patchStream(std::string patch_file, std::stringstream& prj_stream)
{
OGS_FATAL(
"Error while patching prj file with patch file {:}. Only "
"'add', 'replace' and 'remove' elements are allowed!",
patch_file);
"'add', 'replace' and 'remove' elements are allowed! Got an "
"element '{:s}' on line {:d}.",
patch_file, node->name, node->line);
}
if (rc)
{
OGS_FATAL("Error while patching prj file with patch file {:}.",
patch_file);
OGS_FATAL(
"Error while patching prj file with patch file {:}. Error in "
"element '{:s}' on line {:d}.",
patch_file, node->name, node->line);
}
}
......@@ -211,11 +214,18 @@ void readAndPatchPrj(std::stringstream& prj_stream, std::string& prj_file,
}
// read base prj file into stream
std::ifstream file(prj_file);
if (file)
if (std::ifstream file(prj_file); file)
{
prj_stream << file.rdbuf();
file.close();
}
else
{
if (!BaseLib::IsFileExisting(prj_file))
{
ERR("File {:s} does not exist.", prj_file);
}
DBUG("Stream state flags: {:b}.", file.rdstate());
OGS_FATAL("Could not open project file '{:s}' for reading.", prj_file);
}
// apply xml patches to stream
......
......@@ -8,7 +8,7 @@ append_source_files(SOURCES Common)
ogs_add_library(ChemistryLib ${SOURCES})
target_link_libraries(
ChemistryLib PUBLIC iphreeqc PRIVATE NumLib spdlog::spdlog
ChemistryLib PUBLIC iphreeqc PRIVATE NumLib
)
# See https://github.com/ufz/ogs/pull/2982#issuecomment-641086788
......
......@@ -17,7 +17,7 @@ target_link_libraries(
PUBLIC BaseLib MathLib $<$<BOOL:${OGS_BUILD_GUI}>:rapidxml>
$<$<BOOL:${OGS_BUILD_GUI}>:Qt5::Xml>
$<$<BOOL:${OGS_BUILD_GUI}>:Qt5::XmlPatterns>
PRIVATE tet spdlog::spdlog
PRIVATE tet
)
configure_file(
......
......@@ -40,5 +40,5 @@ ogs_add_library(MaterialLib ${SOURCES})
target_link_libraries(
MaterialLib PUBLIC MaterialLib_SolidModels MaterialLib_FractureModels
PRIVATE MathLib MeshLib ParameterLib exprtk spdlog::spdlog
PRIVATE MathLib MeshLib ParameterLib exprtk
)
......@@ -14,8 +14,8 @@
#include "CapillaryPressureSaturation/CreateCapillaryPressureRegularizedVanGenuchten.h"
#include "CapillaryPressureSaturation/CreateCapillaryPressureVanGenuchten.h"
#include "CapillaryPressureSaturation/CreateSaturationBrooksCorey.h"
#include "CapillaryPressureSaturation/CreateSaturationLiakopoulos.h"
#include "CapillaryPressureSaturation/CreateSaturationExponential.h"
#include "CapillaryPressureSaturation/CreateSaturationLiakopoulos.h"
#include "CapillaryPressureSaturation/CreateSaturationVanGenuchten.h"
#include "CreateAverageMolarMass.h"
#include "CreateBishopsPowerLaw.h"
......@@ -32,9 +32,9 @@
#include "CreateIdealGasLaw.h"
#include "CreateKozenyCarmanModel.h"
#include "CreateLinear.h"
#include "CreateOrthotropicEmbeddedFracturePermeability.h"
#include "CreateParameter.h"
#include "CreatePermeabilityMohrCoulombFailureIndexModel.h"
#include "CreateOrthotropicEmbeddedFracturePermeability.h"
#include "CreatePermeabilityOrthotropicPowerLaw.h"
#include "CreatePorosityFromMassBalance.h"
#include "CreateSaturationDependentThermalConductivity.h"
......
......@@ -15,8 +15,8 @@
#include "BishopsPowerLaw.h"
#include "BishopsSaturationCutoff.h"
#include "CapillaryPressureSaturation/SaturationBrooksCorey.h"
#include "CapillaryPressureSaturation/SaturationLiakopoulos.h"
#include "CapillaryPressureSaturation/SaturationExponential.h"
#include "CapillaryPressureSaturation/SaturationLiakopoulos.h"
#include "CapillaryPressureSaturation/SaturationVanGenuchten.h"
#include "ClausiusClapeyron.h"
#include "Constant.h"
......@@ -32,8 +32,8 @@
#include "GasPressureDependentPermeability.h"
#include "IdealGasLaw.h"
#include "Linear.h"
#include "Parameter.h"
#include "OrthotropicEmbeddedFracturePermeability.h"
#include "Parameter.h"
#include "PorosityFromMassBalance.h"
#include "RelativePermeability/RelPermBrooksCorey.h"
#include "RelativePermeability/RelPermBrooksCoreyNonwettingPhase.h"
......
......@@ -2,7 +2,7 @@ get_source_files(SOURCES)
ogs_add_library(MaterialLib_SolidModels ${SOURCES})
target_link_libraries(
MaterialLib_SolidModels PUBLIC MathLib PRIVATE spdlog::spdlog ParameterLib
MaterialLib_SolidModels PUBLIC MathLib PRIVATE ParameterLib
NumLib
)
......
......@@ -23,7 +23,7 @@ mfront_behaviours_check_library(
target_link_libraries(
MaterialLib_SolidModels_MFront PUBLIC BaseLib NumLib OgsMFrontBehaviour
PRIVATE MathLib MeshLib spdlog::spdlog
PRIVATE MathLib MeshLib
)
# Disable warnings for generated OgsMFrontBehaviour
......
......@@ -34,7 +34,6 @@ target_link_libraries(
$<$<BOOL:${OGS_USE_CVODE}>:CVODE::CVODE>
$<$<BOOL:${OGS_USE_PETSC}>:petsc>
Eigen3::Eigen
PRIVATE spdlog::spdlog
)
if(OGS_USE_LIS)
......
......@@ -6,5 +6,4 @@ ogs_add_library(MeshGeoToolsLib ${SOURCES})
target_link_libraries(
MeshGeoToolsLib PUBLIC GeoLib MathLib PRIVATE BaseLib MeshLib
spdlog::spdlog
)
......@@ -42,7 +42,6 @@ target_link_libraries(
$<$<TARGET_EXISTS:OgsXdmf>:OgsXdmf>
$<$<TARGET_EXISTS:MPI::MPI_CXX>:MPI::MPI_CXX>
$<$<TARGET_EXISTS:petsc>:petsc>
PRIVATE spdlog::spdlog
)
target_include_directories(MeshLib PUBLIC ${VTK_INCLUDE_DIRS})
......
......@@ -19,5 +19,5 @@ set_target_properties(NumLib PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(
NumLib PUBLIC BaseLib GeoLib MathLib MeshLib $<$<TARGET_EXISTS:petsc>:petsc>
PRIVATE MeshGeoToolsLib spdlog::spdlog
PRIVATE MeshGeoToolsLib
)
......@@ -2,5 +2,5 @@ get_source_files(SOURCES)
ogs_add_library(ParameterLib ${SOURCES})
target_link_libraries(
ParameterLib PUBLIC MathLib PRIVATE BaseLib exprtk MeshLib spdlog::spdlog
ParameterLib PUBLIC MathLib PRIVATE BaseLib exprtk MeshLib
)
......@@ -48,7 +48,6 @@ struct FunctionParameter final : public Parameter<T>
using symbol_table_t = exprtk::symbol_table<T>;
using expression_t = exprtk::expression<T>;
using parser_t = exprtk::parser<T>;
using error_t = exprtk::parser_error::type;
/**
* Constructing from a vector of expressions
......@@ -64,7 +63,7 @@ struct FunctionParameter final : public Parameter<T>
std::map<std::string,
std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> const&
curves)
: Parameter<T>(name, nullptr), _vec_expression_str(vec_expression_str)
: Parameter<T>(name, nullptr)
{
// Convert curves to function objects callable by the exprtk.
_curves.reserve(curves.size());
......@@ -86,16 +85,16 @@ struct FunctionParameter final : public Parameter<T>
}
// Compile expressions.
_vec_expression.resize(_vec_expression_str.size());
for (unsigned i = 0; i < _vec_expression_str.size(); i++)
_vec_expression.resize(vec_expression_str.size());
for (unsigned i = 0; i < vec_expression_str.size(); i++)
{
_vec_expression[i].register_symbol_table(_symbol_table);
parser_t parser;
if (!parser.compile(_vec_expression_str[i], _vec_expression[i]))
if (!parser.compile(vec_expression_str[i], _vec_expression[i]))
{
OGS_FATAL("Error: {:s}\tExpression: {:s}\n",
parser.error(),
_vec_expression_str[i]);
vec_expression_str[i]);
}
}
}
......@@ -141,7 +140,6 @@ struct FunctionParameter final : public Parameter<T>
}
private:
std::vector<std::string> const _vec_expression_str;
symbol_table_t _symbol_table;
std::vector<expression_t> _vec_expression;
std::vector<std::pair<std::string, CurveWrapper>> _curves;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment