Moved all remaining files out of opm/autodiff.

This commit is contained in:
Atgeirr Flø Rasmussen 2019-06-20 10:15:51 +02:00
parent a33cfbf0bc
commit fa016a6008
14 changed files with 22 additions and 355 deletions

View File

@ -24,7 +24,6 @@
# find opm -name '*.c*' -printf '\t%p\n' | sort
list (APPEND MAIN_SOURCE_FILES
ebos/nncsorter.cpp
opm/autodiff/MPIUtilities.cpp
opm/core/props/rock/RockFromDeck.cpp
opm/core/props/satfunc/RelpermDiagnostics.cpp
opm/core/simulator/SimulatorReport.cpp
@ -123,16 +122,11 @@ list (APPEND TEST_DATA_FILES
# originally generated with the command:
# find opm -name '*.h*' -a ! -name '*-pch.hpp' -printf '\t%p\n' | sort
list (APPEND PUBLIC_HEADER_FILES
opm/autodiff/BlackoilDetails.hpp
opm/simulators/flow/countGlobalCells.hpp
opm/simulators/flow/BlackoilModelEbos.hpp
opm/simulators/flow/BlackoilModelParametersEbos.hpp
opm/autodiff/createGlobalCellArray.hpp
opm/simulators/flow/FlowMainEbos.hpp
opm/autodiff/GridInit.hpp
opm/autodiff/IterationReport.hpp
opm/autodiff/MPIUtilities.hpp
opm/simulators/flow/NonlinearSolverEbos.hpp
opm/autodiff/SimFIBODetails.hpp
opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp
opm/simulators/flow/MissingFeatures.hpp
opm/core/props/BlackoilPhases.hpp
@ -194,6 +188,7 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/utils/gatherDeferredLogger.hpp
opm/simulators/utils/moduleVersion.hpp
opm/simulators/wells/RateConverter.hpp
opm/simulators/wells/SimFIBODetails.hpp
opm/simulators/wells/WellConnectionAuxiliaryModule.hpp
opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp
opm/simulators/wells/VFPProperties.hpp

View File

@ -1,143 +0,0 @@
/*
Copyright 2015 SINTEF ICT, Applied Mathematics.
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 3 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/>.
*/
#ifndef OPM_GRIDINIT_HEADER_INCLUDED
#define OPM_GRIDINIT_HEADER_INCLUDED
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/grid/GridManager.hpp>
#if HAVE_OPM_GRID
#include <opm/grid/polyhedralgrid.hh>
#include <opm/grid/CpGrid.hpp>
#endif
namespace Opm
{
/// A class intended to give a generic interface to
/// initializing and accessing UnstructuredGrid and CpGrid,
/// using specialized templates to accomplish this.
template <class Grid>
class GridInit
{
public:
/// Initialize from a deck and/or an eclipse state and (logical cartesian) specified pore volumes.
GridInit(const EclipseState&, const std::vector<double>&)
{
OPM_THROW(std::logic_error, "Found no specialization for GridInit for the requested Grid class.");
}
};
/// Specialization for UnstructuredGrid.
template <>
class GridInit<UnstructuredGrid>
{
public:
/// Initialize from a deck and/or an eclipse state and (logical cartesian) specified pore volumes.
GridInit(const EclipseState& eclipse_state, const std::vector<double>& porv)
: grid_manager_(eclipse_state.getInputGrid(), porv)
{
}
/// Access the created grid.
const UnstructuredGrid& grid()
{
return *grid_manager_.c_grid();
}
private:
GridManager grid_manager_;
};
#if HAVE_OPM_GRID
/// Specialization for PolyhedralGrid.
template < int dim, int dimworld >
class GridInit< Dune::PolyhedralGrid< dim, dimworld > >
{
public:
typedef Dune::PolyhedralGrid< dim, dimworld > Grid;
/// Initialize from a deck and/or an eclipse state and (logical cartesian) specified pore volumes.
GridInit(const EclipseState& eclipse_state, const std::vector<double>& porv)
: grid_manager_(eclipse_state.getInputGrid(), porv),
grid_( *grid_manager_.c_grid() )
{
}
/// Access the created grid.
const Grid& grid()
{
return grid_;
}
private:
GridManager grid_manager_;
Grid grid_;
};
/// Specialization for CpGrid.
template <>
class GridInit<Dune::CpGrid>
{
public:
GridInit()
{
gridSelfManaged_ = false;
}
/// Initialize from a deck and/or an eclipse state and (logical cartesian) specified pore volumes.
GridInit(const EclipseState& eclipse_state, const std::vector<double>& porv)
{
gridSelfManaged_ = true;
grid_ = new Dune::CpGrid;
grid_->processEclipseFormat(eclipse_state.getInputGrid(), false, false, false, porv);
}
~GridInit()
{
if (gridSelfManaged_)
delete grid_;
}
/// Access the created grid. Note that mutable access may be required for load balancing.
Dune::CpGrid& grid()
{
return *grid_;
}
/// set the grid from the outside
void setGrid(Dune::CpGrid& newGrid)
{
gridSelfManaged_ = false;
grid_ = &newGrid;
}
private:
Dune::CpGrid* grid_;
bool gridSelfManaged_;
};
#endif // HAVE_OPM_GRID
} // namespace Opm
#endif // OPM_GRIDINIT_HEADER_INCLUDED

View File

@ -1,37 +0,0 @@
/*
Copyright 2013, 2015 SINTEF ICT, Applied Mathematics.
Copyright 2014, 2015 Statoil ASA.
Copyright 2014, 2015 Dr. Markus Blatt - HPC-Simulation-Software & Services
Copyright 2015 NTNU
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 3 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/>.
*/
#ifndef OPM_ITERATION_REPORT_HEADER_INCLUDED
#define OPM_ITERATION_REPORT_HEADER_INCLUDED
namespace Opm {
/// Class used for reporting the outcome of a nonlinearIteration() call.
struct IterationReport
{
bool failed;
bool converged;
int linear_iterations;
int well_iterations;
};
} // namespace Opm
#endif // OPM_ITERATION_REPORT_HEADER_INCLUDED

View File

@ -1,44 +0,0 @@
/*
Copyright 2014 SINTEF ICT, Applied Mathematics.
Copyright 2014 IRIS AS
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 3 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/>.
*/
#include <config.h>
#include <boost/any.hpp>
#include <opm/simulators/linalg/ParallelIstlInformation.hpp>
namespace Opm
{
/// Return true if this is a serial run, or rank zero on an MPI run.
bool isIORank(const boost::any& parallel_info)
{
#if HAVE_MPI
if (parallel_info.type() == typeid(ParallelISTLInformation)) {
const ParallelISTLInformation& info =
boost::any_cast<const ParallelISTLInformation&>(parallel_info);
return info.communicator().rank() == 0;
} else {
return true;
}
#else
static_cast<void>(parallel_info); // Suppress unused argument warning.
return true;
#endif
}
} // namespace Opm

View File

@ -1,49 +0,0 @@
/*
Copyright 2015 Andreas Lauser
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 3 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/>.
*/
#ifndef OPM_CREATE_GLOBAL_CELL_ARRAY_HPP
#define OPM_CREATE_GLOBAL_CELL_ARRAY_HPP
#include <opm/grid/GridHelpers.hpp>
namespace Opm
{
/*!
* \brief Create a mapping from a global cell index of a grid to the logically
* Cartesian index of the ECL deck.
*/
template <class Grid>
void createGlobalCellArray(const Grid &grid, std::vector<int>& dest)
{
int numCells = Opm::UgGridHelpers::numCells(grid);
dest.resize(numCells);
const auto& globalCell = Opm::UgGridHelpers::globalCell(grid);
std::vector<int> compressedToCartesianIdx(numCells);
for (int cellIdx = 0; cellIdx < numCells; ++cellIdx) {
if (globalCell) {
dest[cellIdx] = globalCell[cellIdx];
}
else {
dest[cellIdx] = cellIdx;
}
}
}
}
#endif

View File

@ -1,51 +0,0 @@
/*
Copyright 2013, 2016 SINTEF ICT, Applied Mathematics.
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 3 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/>.
*/
#ifndef OPM_OPM-SIMULATORS_DOXYGEN_MAIN_HEADER_INCLUDED
#define OPM_OPM-SIMULATORS_DOXYGEN_MAIN_HEADER_INCLUDED
/** \mainpage Documentation for the opm-simulators library.
<h3>Solvers and simulators</h3>
The opm-simulators module contains a diverse set of simulator programs.
Notable simulator programs include
- examples/flow.cpp, a fully implicit black-oil simulator.
- examples/flow_polymer.cpp, a version of Flow that supports polymer EOR simulation
- examples/flow_solvent.cpp, a version of Flow that supports solvent EOR simulation
- examples/sim_2p_incomp_ad.cpp, a sequential incompressible 2-phase simulator.
<h3>Automatic differentiation</h3>
This library implements automatic differentiation for vector data with
multiple blocks of sparse jacobians. This is contained in the class
Opm::AutoDiffBlock. Also available is Opm::AutoDiff, a much simpler
single-value single-derivative AD class.
There are also some helper classes and functions that are intended to
aid in the development of solvers and simulators with AD, these
include Opm::HelperOps, Opm::UpwindSelector, Opm::subset,
Opm::superset, Opm::Selector, Opm::collapseJacs, Opm::vertcat,
Opm::Span and Opm::sign.
*/
#endif // OPM_OPM-SIMULATORS_DOXYGEN_MAIN_HEADER_INCLUDED

View File

@ -34,7 +34,7 @@
#include <opm/simulators/wells/BlackoilWellModel.hpp>
#include <opm/simulators/aquifers/BlackoilAquiferModel.hpp>
#include <opm/simulators/wells/WellConnectionAuxiliaryModule.hpp>
#include <opm/autodiff/BlackoilDetails.hpp>
#include <opm/simulators/flow/countGlobalCells.hpp>
#include <opm/grid/UnstructuredGrid.h>
#include <opm/core/simulator/SimulatorReport.hpp>
@ -64,7 +64,6 @@
#include <limits>
#include <vector>
#include <algorithm>
//#include <fstream>
BEGIN_PROPERTIES

View File

@ -24,7 +24,6 @@
#include <opm/simulators/linalg/MatrixBlock.hpp>
#include <opm/simulators/linalg/BlackoilAmg.hpp>
#include <opm/simulators/linalg/CPRPreconditioner.hpp>
#include <opm/autodiff/MPIUtilities.hpp>
#include <opm/simulators/linalg/ParallelRestrictedAdditiveSchwarz.hpp>
#include <opm/simulators/linalg/ParallelOverlappingILU0.hpp>
#include <opm/simulators/linalg/ExtractParallelGridInformationToISTL.hpp>

View File

@ -1,5 +1,5 @@
/*
Copyright 2015 SINTEF ICT, Applied Mathematics.
Copyright 2013, 2016 SINTEF ICT, Applied Mathematics.
This file is part of the Open Porous Media project (OPM).
@ -17,16 +17,19 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_MPIUTILITIES_HEADER_INCLUDED
#define OPM_MPIUTILITIES_HEADER_INCLUDED
#ifndef OPM_OPM-SIMULATORS_DOXYGEN_MAIN_HEADER_INCLUDED
#define OPM_OPM-SIMULATORS_DOXYGEN_MAIN_HEADER_INCLUDED
#include <boost/any.hpp>
namespace Opm
{
/// Return true if this is a serial run, or rank zero on an MPI run.
bool isIORank(const boost::any& parallel_info);
/** \mainpage Documentation for the opm-simulators library.
} // namespace Opm
#endif // OPM_MPIUTILITIES_HEADER_INCLUDED
<h3>Solvers and simulators</h3>
The opm-simulators module is the home for the Flow reservoir
simulator, the Ebos experimental simulator and library functionality
on which they both depend.
*/
#endif // OPM_OPM-SIMULATORS_DOXYGEN_MAIN_HEADER_INCLUDED

View File

@ -41,14 +41,13 @@
#include <opm/core/simulator/SimulatorReport.hpp>
#include <opm/simulators/wells/VFPInjProperties.hpp>
#include <opm/simulators/wells/VFPProdProperties.hpp>
#include <opm/autodiff/BlackoilDetails.hpp>
#include <opm/simulators/flow/countGlobalCells.hpp>
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp>
#include <opm/simulators/wells/RateConverter.hpp>
#include <opm/simulators/wells/WellInterface.hpp>
#include <opm/simulators/wells/StandardWell.hpp>
#include <opm/simulators/wells/MultisegmentWell.hpp>
#include <opm/simulators/timestepping/gatherConvergenceReport.hpp>
#include <opm/autodiff/SimFIBODetails.hpp>
#include <dune/common/fmatrix.hh>
#include <dune/istl/bcrsmatrix.hh>
#include <dune/istl/matrixmatrix.hh>

View File

@ -21,6 +21,7 @@
*/
#include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp>
#include <opm/simulators/wells/SimFIBODetails.hpp>
namespace Opm {
template<typename TypeTag>

View File

@ -43,8 +43,6 @@
#include <opm/grid/GridHelpers.hpp>
#include <opm/simulators/flow/FlowMainEbos.hpp>
#include <opm/simulators/flow/BlackoilModelEbos.hpp>
#include <opm/autodiff/createGlobalCellArray.hpp>
#include <opm/autodiff/GridInit.hpp>
#include <ebos/eclproblem.hh>
#include <ewoms/common/start.hh>
@ -58,12 +56,13 @@
#include <dune/common/parallel/mpihelper.hh>
#endif
using StandardWell = Opm::StandardWell<TTAG(EclFlowProblem)>;
struct SetupTest {
using Grid = UnstructuredGrid;
using GridInit = Opm::GridInit<Grid>;
SetupTest ()
{
@ -81,12 +80,8 @@ struct SetupTest {
const std::vector<double>& porv =
ecl_state->get3DProperties().getDoubleGridProperty("PORV").getData();
std::unique_ptr<GridInit> grid_init(new GridInit(*ecl_state, porv));
const Grid& grid = grid_init->grid();
// Create material law manager.
std::vector<int> compressed_to_cartesianIdx;
Opm::createGlobalCellArray(grid, compressed_to_cartesianIdx);
Opm::GridManager gm(ecl_state->getInputGrid(), porv);
const Grid& grid = *(gm.c_grid());
current_timestep = 0;