move ebos/eclgenericthresholdpressure[_impl].[hh|cc] to opm/simulators/flow

This commit is contained in:
Arne Morten Kvarving 2024-02-02 10:46:44 +01:00
parent e6eac2039b
commit f6475f8c1e
8 changed files with 104 additions and 107 deletions

View File

@ -25,7 +25,6 @@
list (APPEND MAIN_SOURCE_FILES
ebos/eclgenericcpgridvanguard.cc
ebos/eclgenericproblem.cc
ebos/eclgenericthresholdpressure.cc
ebos/eclgenericvanguard.cc
ebos/ecltransmissibility.cc
ebos/equil/equilibrationhelpers.cc
@ -42,6 +41,7 @@ list (APPEND MAIN_SOURCE_FILES
opm/simulators/flow/ExtraConvergenceOutputThread.cpp
opm/simulators/flow/FlowUtils.cpp
opm/simulators/flow/GenericOutputBlackoilModule.cpp
opm/simulators/flow/GenericThresholdPressure.cpp
opm/simulators/flow/GenericTracerModel.cpp
opm/simulators/flow/InterRegFlows.cpp
opm/simulators/flow/KeywordValidation.cpp
@ -417,8 +417,6 @@ list (APPEND PUBLIC_HEADER_FILES
ebos/eclgenericcpgridvanguard.hh
ebos/eclgenericproblem.hh
ebos/eclgenericproblem_impl.hh
ebos/eclgenericthresholdpressure.hh
ebos/eclgenericthresholdpressure_impl.hh
ebos/eclgenericvanguard.hh
ebos/eclnewtonmethod.hh
ebos/eclproblem.hh
@ -449,6 +447,8 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/flow/FlowUtils.hpp
opm/simulators/flow/FlowsData.hpp
opm/simulators/flow/GenericOutputBlackoilModule.hpp
opm/simulators/flow/GenericThresholdPressure.hpp
opm/simulators/flow/GenericThresholdPressure_impl.hpp
opm/simulators/flow/GenericTracerModel.hpp
opm/simulators/flow/GenericTracerModel_impl.hpp
opm/simulators/flow/InterRegFlows.hpp

View File

@ -1,64 +0,0 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
#include <config.h>
#include <limits>
#include <ebos/eclgenericthresholdpressure.hh>
#include <ebos/eclgenericthresholdpressure_impl.hh>
#include <opm/grid/CpGrid.hpp>
#if HAVE_DUNE_FEM
#include <dune/fem/gridpart/adaptiveleafgridpart.hh>
#include <dune/fem/gridpart/common/gridpart2gridview.hh>
#include <opm/simulators/flow/FemCpGridCompat.hpp>
#endif // HAVE_DUNE_FEM
namespace Opm {
template class EclGenericThresholdPressure<Dune::CpGrid,
Dune::GridView<Dune::DefaultLeafGridViewTraits<Dune::CpGrid>>,
Dune::MultipleCodimMultipleGeomTypeMapper<Dune::GridView<Dune::DefaultLeafGridViewTraits<Dune::CpGrid>>>,
double>;
#if HAVE_DUNE_FEM
template class EclGenericThresholdPressure<Dune::CpGrid,
Dune::GridView<Dune::Fem::GridPart2GridViewTraits<Dune::Fem::AdaptiveLeafGridPart<Dune::CpGrid, Dune::PartitionIteratorType(4), false>>>,
Dune::MultipleCodimMultipleGeomTypeMapper<Dune::GridView<Dune::Fem::GridPart2GridViewTraits<Dune::Fem::AdaptiveLeafGridPart<Dune::CpGrid, Dune::PartitionIteratorType(4), false>>>>,
double>;
template class EclGenericThresholdPressure<Dune::CpGrid,
Dune::Fem::GridPart2GridViewImpl<
Dune::Fem::AdaptiveLeafGridPart<
Dune::CpGrid,
Dune::PartitionIteratorType(4),
false> >,
Dune::MultipleCodimMultipleGeomTypeMapper<
Dune::Fem::GridPart2GridViewImpl<
Dune::Fem::AdaptiveLeafGridPart<
Dune::CpGrid,
Dune::PartitionIteratorType(4),
false>>>,
double>;
#endif // HAVE_DUNE_FEM
} // namespace Opm

View File

@ -28,8 +28,6 @@
#ifndef EWOMS_ECL_THRESHOLD_PRESSURE_HH
#define EWOMS_ECL_THRESHOLD_PRESSURE_HH
#include <ebos/eclgenericthresholdpressure.hh>
#include <opm/material/densead/Evaluation.hpp>
#include <opm/material/densead/Math.hpp>
@ -37,8 +35,9 @@
#include <opm/models/discretization/common/fvbaseproperties.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/simulators/flow/GenericThresholdPressure.hpp>
#include <algorithm>
#include <vector>
namespace Opm {
@ -53,15 +52,15 @@ namespace Opm {
* than the threshold pressure, it is reduced by the threshold pressure.
*/
template <class TypeTag>
class EclThresholdPressure : public EclGenericThresholdPressure<GetPropType<TypeTag, Properties::Grid>,
GetPropType<TypeTag, Properties::GridView>,
GetPropType<TypeTag, Properties::ElementMapper>,
GetPropType<TypeTag, Properties::Scalar>>
class EclThresholdPressure : public GenericThresholdPressure<GetPropType<TypeTag, Properties::Grid>,
GetPropType<TypeTag, Properties::GridView>,
GetPropType<TypeTag, Properties::ElementMapper>,
GetPropType<TypeTag, Properties::Scalar>>
{
using BaseType = EclGenericThresholdPressure<GetPropType<TypeTag, Properties::Grid>,
GetPropType<TypeTag, Properties::GridView>,
GetPropType<TypeTag, Properties::ElementMapper>,
GetPropType<TypeTag, Properties::Scalar>>;
using BaseType = GenericThresholdPressure<GetPropType<TypeTag, Properties::Grid>,
GetPropType<TypeTag, Properties::GridView>,
GetPropType<TypeTag, Properties::ElementMapper>,
GetPropType<TypeTag, Properties::Scalar>>;
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using Evaluation = GetPropType<TypeTag, Properties::Evaluation>;

View File

@ -28,12 +28,12 @@
// these are not explicitly instanced in library
#include <ebos/eclgenericproblem_impl.hh>
#include <ebos/eclgenericthresholdpressure_impl.hh>
#include <ebos/ecltransmissibility_impl.hh>
#include <ebos/equil/initstateequil_impl.hh>
#include <opm/simulators/flow/AluGridVanguard.hpp>
#include <opm/simulators/flow/CollectDataOnIORank_impl.hpp>
#include <opm/simulators/flow/EclGenericWriter_impl.hpp>
#include <opm/simulators/flow/GenericThresholdPressure_impl.hpp>
#include <opm/simulators/flow/GenericTracerModel_impl.hpp>
#include <opm/simulators/utils/GridDataOutput_impl.hpp>

View File

@ -28,11 +28,11 @@
// these are not explicitly instanced in library
#include <ebos/eclgenericproblem_impl.hh>
#include <ebos/eclgenericthresholdpressure_impl.hh>
#include <ebos/ecltransmissibility_impl.hh>
#include <ebos/equil/initstateequil_impl.hh>
#include <opm/simulators/flow/CollectDataOnIORank_impl.hpp>
#include <opm/simulators/flow/EclGenericWriter_impl.hpp>
#include <opm/simulators/flow/GenericThresholdPressure_impl.hpp>
#include <opm/simulators/flow/GenericTracerModel_impl.hpp>
#include <opm/simulators/utils/GridDataOutput_impl.hpp>

View File

@ -0,0 +1,63 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
#include <config.h>
#include <opm/grid/CpGrid.hpp>
#include <opm/simulators/flow/GenericThresholdPressure_impl.hpp>
#if HAVE_DUNE_FEM
#include <dune/fem/gridpart/adaptiveleafgridpart.hh>
#include <dune/fem/gridpart/common/gridpart2gridview.hh>
#include <opm/simulators/flow/FemCpGridCompat.hpp>
#endif // HAVE_DUNE_FEM
namespace Opm {
template class GenericThresholdPressure<Dune::CpGrid,
Dune::GridView<Dune::DefaultLeafGridViewTraits<Dune::CpGrid>>,
Dune::MultipleCodimMultipleGeomTypeMapper<Dune::GridView<Dune::DefaultLeafGridViewTraits<Dune::CpGrid>>>,
double>;
#if HAVE_DUNE_FEM
template class GenericThresholdPressure<Dune::CpGrid,
Dune::GridView<Dune::Fem::GridPart2GridViewTraits<Dune::Fem::AdaptiveLeafGridPart<Dune::CpGrid, Dune::PartitionIteratorType(4), false>>>,
Dune::MultipleCodimMultipleGeomTypeMapper<Dune::GridView<Dune::Fem::GridPart2GridViewTraits<Dune::Fem::AdaptiveLeafGridPart<Dune::CpGrid, Dune::PartitionIteratorType(4), false>>>>,
double>;
template class GenericThresholdPressure<Dune::CpGrid,
Dune::Fem::GridPart2GridViewImpl<
Dune::Fem::AdaptiveLeafGridPart<
Dune::CpGrid,
Dune::PartitionIteratorType(4),
false> >,
Dune::MultipleCodimMultipleGeomTypeMapper<
Dune::Fem::GridPart2GridViewImpl<
Dune::Fem::AdaptiveLeafGridPart<
Dune::CpGrid,
Dune::PartitionIteratorType(4),
false>>>,
double>;
#endif // HAVE_DUNE_FEM
} // namespace Opm

View File

@ -23,15 +23,14 @@
/*!
* \file
*
* \copydoc Opm::EclThresholdPressure
* \copydoc Opm::ThresholdPressure
*/
#ifndef EWOMS_ECL_GENERIC_THRESHOLD_PRESSURE_HH
#define EWOMS_ECL_GENERIC_THRESHOLD_PRESSURE_HH
#ifndef OPM_GENERIC_THRESHOLD_PRESSURE_HPP
#define OPM_GENERIC_THRESHOLD_PRESSURE_HPP
#include <opm/grid/common/CartesianIndexMapper.hpp>
#include <opm/grid/LookUpData.hh>
#include <vector>
namespace Opm {
@ -41,16 +40,16 @@ template<typename Grid, typename GridView> class LookUpData;
template<typename Grid, typename GridView> class LookUpCartesianData;
template<class Grid, class GridView, class ElementMapper, class Scalar>
class EclGenericThresholdPressure {
class GenericThresholdPressure {
public:
using CartesianIndexMapper = Dune::CartesianIndexMapper<Grid>;
using LookUpData = Opm::LookUpData<Grid,GridView>;
using LookUpCartesianData = Opm::LookUpCartesianData<Grid,GridView>;
EclGenericThresholdPressure(const CartesianIndexMapper& cartMapper,
const GridView& gridView,
const ElementMapper& elementMapper,
const EclipseState& eclState);
GenericThresholdPressure(const CartesianIndexMapper& cartMapper,
const GridView& gridView,
const ElementMapper& elementMapper,
const EclipseState& eclState);
/*!
* \brief Returns the theshold pressure [Pa] for the intersection between two elements.
@ -116,4 +115,4 @@ protected:
} // namespace Opm
#endif
#endif // OPM_GENERIC_THRESHOLD_PRESSURE_HPP

View File

@ -20,10 +20,8 @@
module for the precise wording of the license and the list of
copyright holders.
*/
#ifndef EWOMS_ECL_GENERIC_THRESHOLD_PRESSURE_IMPL_HH
#define EWOMS_ECL_GENERIC_THRESHOLD_PRESSURE_IMPL_HH
#include <ebos/eclgenericthresholdpressure.hh>
#ifndef OPM_GENERIC_THRESHOLD_PRESSURE_IMPL_HPP
#define OPM_GENERIC_THRESHOLD_PRESSURE_IMPL_HPP
#include <dune/grid/common/mcmgmapper.hh>
#include <dune/grid/common/rangegenerators.hh>
@ -36,10 +34,11 @@
#include <opm/input/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp>
#include <opm/input/eclipse/EclipseState/SimulationConfig/ThresholdPressure.hpp>
#include <opm/simulators/flow/GenericThresholdPressure.hpp>
#include <fmt/format.h>
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <limits>
#include <stdexcept>
@ -47,11 +46,11 @@
namespace Opm {
template<class Grid, class GridView, class ElementMapper, class Scalar>
EclGenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::
EclGenericThresholdPressure(const CartesianIndexMapper& cartMapper,
const GridView& gridView,
const ElementMapper& elementMapper,
const EclipseState& eclState)
GenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::
GenericThresholdPressure(const CartesianIndexMapper& cartMapper,
const GridView& gridView,
const ElementMapper& elementMapper,
const EclipseState& eclState)
: cartMapper_(cartMapper)
, gridView_(gridView)
, elementMapper_(elementMapper)
@ -62,7 +61,7 @@ EclGenericThresholdPressure(const CartesianIndexMapper& cartMapper,
}
template<class Grid, class GridView, class ElementMapper,class Scalar>
Scalar EclGenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::
Scalar GenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::
thresholdPressure(int elem1Idx, int elem2Idx) const
{
if (!enableThresholdPressure_)
@ -98,7 +97,7 @@ thresholdPressure(int elem1Idx, int elem2Idx) const
}
template<class Grid, class GridView, class ElementMapper, class Scalar>
void EclGenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::
void GenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::
finishInit()
{
const auto& simConfig = eclState_.getSimulationConfig();
@ -147,7 +146,7 @@ finishInit()
}
template<class Grid, class GridView, class ElementMapper, class Scalar>
void EclGenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::
void GenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::
applyExplicitThresholdPressures_()
{
const SimulationConfig& simConfig = eclState_.getSimulationConfig();
@ -195,7 +194,7 @@ applyExplicitThresholdPressures_()
}
template<class Grid, class GridView, class ElementMapper, class Scalar>
void EclGenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::
void GenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::
configureThpresft_()
{
// retrieve the faults collection.
@ -221,7 +220,7 @@ configureThpresft_()
template<class Grid, class GridView, class ElementMapper, class Scalar>
std::vector<Scalar>
EclGenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::
GenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::
getRestartVector() const
{
if (!enableThresholdPressure_)
@ -249,7 +248,7 @@ getRestartVector() const
template<class Grid, class GridView, class ElementMapper, class Scalar>
void
EclGenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::
GenericThresholdPressure<Grid,GridView,ElementMapper,Scalar>::
logPressures()
{
if (!enableThresholdPressure_)
@ -295,4 +294,5 @@ logPressures()
}
} // namespace Opm
#endif
#endif // OPM_GENERIC_THRESHOLD_PRESSURE_IMPL_HPP