Skip to content

Commit

Permalink
Merge pull request OPM#5612 from akva2/more_tus
Browse files Browse the repository at this point in the history
Split out vtk module parameters to separate translation units
  • Loading branch information
bska authored Sep 16, 2024
2 parents 2f47f41 + 3ee3dc2 commit 32886f6
Show file tree
Hide file tree
Showing 77 changed files with 3,431 additions and 2,013 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ macro (sources_hook)
get_target_property(qm_defs QuadMath::QuadMath INTERFACE_COMPILE_DEFINITIONS)
list(APPEND qm_defs HAVE_QUAD=1)
get_target_property(qm_options QuadMath::QuadMath INTERFACE_COMPILE_OPTIONS)
set_source_files_properties(opm/models/utils/parametersystem.cpp
set_source_files_properties(opm/models/nonlinear/newtonmethodparams.cpp
opm/models/utils/parametersystem.cpp
opm/models/utils/simulatorutils.cpp
PROPERTIES COMPILE_DEFINITIONS "${qm_defs}"
COMPILE_OPTIONS "${qm_options}")
Expand Down
64 changes: 47 additions & 17 deletions CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,25 @@ list (APPEND MAIN_SOURCE_FILES
opm/models/blackoil/blackoilextboparams.cpp
opm/models/blackoil/blackoilfoamparams.cpp
opm/models/blackoil/blackoilmicpparams.cpp
opm/models/blackoil/blackoilnewtonmethodparams.cpp
opm/models/blackoil/blackoilpolymerparams.cpp
opm/models/blackoil/blackoilsolventparams.cpp
opm/models/io/vtkblackoilenergyparams.cpp
opm/models/io/vtkblackoilmicpparams.cpp
opm/models/io/vtkblackoilpolymerparams.cpp
opm/models/io/vtkblackoilparams.cpp
opm/models/io/vtkblackoilsolventparams.cpp
opm/models/io/vtkcompositionparams.cpp
opm/models/io/vtkdiffusionparams.cpp
opm/models/io/vtkdiscretefractureparams.cpp
opm/models/io/vtkenergyparams.cpp
opm/models/io/vtkmultiphaseparams.cpp
opm/models/io/vtkphasepresenceparams.cpp
opm/models/io/vtkprimaryvarsparams.cpp
opm/models/io/vtkptflashparams.cpp
opm/models/io/vtktemperatureparams.cpp
opm/models/io/restart.cpp
opm/models/nonlinear/newtonmethodparams.cpp
opm/models/parallel/mpiutil.cpp
opm/models/parallel/tasklets.cpp
opm/models/parallel/threadmanager.cpp
Expand Down Expand Up @@ -553,8 +569,8 @@ list (APPEND PUBLIC_HEADER_FILES
opm/models/blackoil/blackoilmicpmodules.hh
opm/models/blackoil/blackoilmicpparams.hpp
opm/models/blackoil/blackoilmodel.hh
opm/models/blackoil/blackoilnewtonmethod.hh
opm/models/blackoil/blackoilnewtonmethodparameters.hh
opm/models/blackoil/blackoilnewtonmethod.hpp
opm/models/blackoil/blackoilnewtonmethodparams.hpp
opm/models/blackoil/blackoilonephaseindices.hh
opm/models/blackoil/blackoilpolymermodules.hh
opm/models/blackoil/blackoilpolymerparams.hpp
Expand Down Expand Up @@ -648,22 +664,36 @@ list (APPEND PUBLIC_HEADER_FILES
opm/models/io/simplexvanguard.hh
opm/models/io/structuredgridvanguard.hh
opm/models/io/unstructuredgridvanguard.hh
opm/models/io/vtkblackoilenergymodule.hh
opm/models/io/vtkblackoilmicpmodule.hh
opm/models/io/vtkblackoilmodule.hh
opm/models/io/vtkblackoilpolymermodule.hh
opm/models/io/vtkblackoilsolventmodule.hh
opm/models/io/vtkcompositionmodule.hh
opm/models/io/vtkdiffusionmodule.hh
opm/models/io/vtkdiscretefracturemodule.hh
opm/models/io/vtkenergymodule.hh
opm/models/io/vtkmultiphasemodule.hh
opm/models/io/vtkblackoilenergymodule.hpp
opm/models/io/vtkblackoilenergyparams.hpp
opm/models/io/vtkblackoilmicpmodule.hpp
opm/models/io/vtkblackoilmicpparams.hpp
opm/models/io/vtkblackoilmodule.hpp
opm/models/io/vtkblackoilparams.hpp
opm/models/io/vtkblackoilpolymermodule.hpp
opm/models/io/vtkblackoilpolymerparams.hpp
opm/models/io/vtkblackoilsolventmodule.hpp
opm/models/io/vtkblackoilsolventparams.hpp
opm/models/io/vtkcompositionmodule.hpp
opm/models/io/vtkcompositionparams.hpp
opm/models/io/vtkdiffusionmodule.hpp
opm/models/io/vtkdiffusionparams.hpp
opm/models/io/vtkdiscretefracturemodule.hpp
opm/models/io/vtkdiscretefractureparams.hpp
opm/models/io/vtkenergymodule.hpp
opm/models/io/vtkenergyparams.hpp
opm/models/io/vtkmultiphasemodule.hpp
opm/models/io/vtkmultiphaseparams.hpp
opm/models/io/vtkmultiwriter.hh
opm/models/io/vtkphasepresencemodule.hh
opm/models/io/vtkprimaryvarsmodule.hh
opm/models/io/vtkptflashmodule.hh
opm/models/io/vtkphasepresencemodule.hpp
opm/models/io/vtkphasepresenceparams.hpp
opm/models/io/vtkprimaryvarsmodule.hpp
opm/models/io/vtkprimaryvarsparams.hpp
opm/models/io/vtkptflashmodule.hpp
opm/models/io/vtkptflashparams.hpp
opm/models/io/vtkscalarfunction.hh
opm/models/io/vtktemperaturemodule.hh
opm/models/io/vtktemperaturemodule.hpp
opm/models/io/vtktemperatureparams.hpp
opm/models/io/vtktensorfunction.hh
opm/models/io/vtkvectorfunction.hh
opm/models/ncp/ncpboundaryratevector.hh
Expand All @@ -677,7 +707,7 @@ list (APPEND PUBLIC_HEADER_FILES
opm/models/ncp/ncpproperties.hh
opm/models/ncp/ncpratevector.hh
opm/models/nonlinear/newtonmethod.hh
opm/models/nonlinear/newtonmethodparameters.hh
opm/models/nonlinear/newtonmethodparams.hpp
opm/models/nonlinear/newtonmethodproperties.hh
opm/models/nonlinear/nullconvergencewriter.hh
opm/models/parallel/gridcommhandles.hh
Expand Down
2 changes: 1 addition & 1 deletion examples/problems/lensproblem.hh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include <opm/models/immiscible/immiscibleproperties.hh>

#include <opm/models/io/structuredgridvanguard.hh>
#include <opm/models/io/vtkmultiphasemodule.hh>
#include <opm/models/io/vtkmultiphasemodule.hpp>

#include <iostream>
#include <sstream>
Expand Down
2 changes: 1 addition & 1 deletion examples/problems/reservoirproblem.hh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#include <opm/models/discretization/common/fvbaseparameters.hh>
#include <opm/models/discretization/common/fvbaseproperties.hh>

#include <opm/models/nonlinear/newtonmethodparameters.hh>
#include <opm/models/nonlinear/newtonmethodparams.hpp>

#include <opm/models/utils/basicproperties.hh>

Expand Down
8 changes: 4 additions & 4 deletions flowexperimental/FlowExpNewtonMethod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <opm/common/Exceptions.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>

#include <opm/models/blackoil/blackoilnewtonmethod.hh>
#include <opm/models/blackoil/blackoilnewtonmethod.hpp>
#include <opm/models/utils/signum.hh>

namespace Opm::Parameters {
Expand Down Expand Up @@ -149,7 +149,7 @@ class FlowExpNewtonMethod : public BlackOilNewtonMethod<TypeTag>
{
const auto& constraintsMap = this->model().linearizer().constraintsMap();
this->lastError_ = this->error_;
Scalar newtonMaxError = Parameters::Get<Parameters::NewtonMaxError<Scalar>>();
Scalar newtonMaxError = this->params_.maxError_;

// calculate the error as the maximum weighted tolerance of
// the solution's residual
Expand Down Expand Up @@ -198,7 +198,7 @@ class FlowExpNewtonMethod : public BlackOilNewtonMethod<TypeTag>

this->error_ = max(std::abs(tmpError), this->error_);

if (std::abs(tmpError) > this->tolerance_) {
if (std::abs(tmpError) > this->params_.tolerance_) {
cnvViolated = true;
}

Expand Down Expand Up @@ -231,7 +231,7 @@ class FlowExpNewtonMethod : public BlackOilNewtonMethod<TypeTag>
Scalar y = Parameters::Get<Parameters::EclNewtonSumToleranceExponent<Scalar>>();
sumTolerance_ = x*std::pow(sumPv, y);

this->endIterMsg() << " (max: " << this->tolerance_
this->endIterMsg() << " (max: " << this->params_.tolerance_
<< ", violated for " << errorPvFraction_ * 100
<< "% of the pore volume), aggegate error: "
<< errorSum_ << " (max: " << sumTolerance_ << ")";
Expand Down
2 changes: 1 addition & 1 deletion opm/models/blackoil/blackoilenergymodules.hh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#define EWOMS_BLACK_OIL_ENERGY_MODULE_HH

#include "blackoilproperties.hh"
#include <opm/models/io/vtkblackoilenergymodule.hh>
#include <opm/models/io/vtkblackoilenergymodule.hpp>
#include <opm/models/common/quantitycallbacks.hh>
#include <opm/models/discretization/common/linearizationtype.hh>

Expand Down
2 changes: 1 addition & 1 deletion opm/models/blackoil/blackoilmicpmodules.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <opm/models/blackoil/blackoilmicpparams.hpp>
#include <opm/models/blackoil/blackoilproperties.hh>

#include <opm/models/io/vtkblackoilmicpmodule.hh>
#include <opm/models/io/vtkblackoilmicpmodule.hpp>

#include <cstddef>
#include <stdexcept>
Expand Down
16 changes: 8 additions & 8 deletions opm/models/blackoil/blackoilmodel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
*
* \copydoc Opm::BlackOilModel
*/
#ifndef EWOMS_BLACK_OIL_MODEL_HH
#define EWOMS_BLACK_OIL_MODEL_HH
#ifndef OPM_BLACK_OIL_MODEL_HPP
#define OPM_BLACK_OIL_MODEL_HPP

#include <opm/material/densead/Math.hpp>

Expand All @@ -44,7 +44,7 @@
#include <opm/models/blackoil/blackoilintensivequantities.hh>
#include <opm/models/blackoil/blackoillocalresidual.hh>
#include <opm/models/blackoil/blackoilmicpmodules.hh>
#include <opm/models/blackoil/blackoilnewtonmethod.hh>
#include <opm/models/blackoil/blackoilnewtonmethod.hpp>
#include <opm/models/blackoil/blackoilpolymermodules.hh>
#include <opm/models/blackoil/blackoilprimaryvariables.hh>
#include <opm/models/blackoil/blackoilproblem.hh>
Expand All @@ -55,9 +55,9 @@

#include <opm/models/common/multiphasebasemodel.hh>

#include <opm/models/io/vtkblackoilmodule.hh>
#include <opm/models/io/vtkcompositionmodule.hh>
#include <opm/models/io/vtkdiffusionmodule.hh>
#include <opm/models/io/vtkblackoilmodule.hpp>
#include <opm/models/io/vtkcompositionmodule.hpp>
#include <opm/models/io/vtkdiffusionmodule.hpp>

#include <sstream>
#include <string>
Expand Down Expand Up @@ -606,7 +606,6 @@ protected:
}

private:

std::vector<Scalar> eqWeights_;
Implementation& asImp_()
{ return *static_cast<Implementation*>(this); }
Expand All @@ -623,6 +622,7 @@ private:
priVars.setPvtRegionIndex(regionIdx);
}
};

} // namespace Opm

#endif
#endif // OPM_BLACK_OIL_MODEL_HPP
Loading

0 comments on commit 32886f6

Please sign in to comment.