mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
countGlobalCells: put non-template code in separate compile unit
This commit is contained in:
parent
541ebdde13
commit
cf06a322ec
@ -26,6 +26,7 @@ list (APPEND MAIN_SOURCE_FILES
|
||||
opm/core/props/phaseUsageFromDeck.cpp
|
||||
opm/core/props/satfunc/RelpermDiagnostics.cpp
|
||||
opm/simulators/timestepping/SimulatorReport.cpp
|
||||
opm/simulators/flow/countGlobalCells.cpp
|
||||
opm/simulators/flow/KeywordValidation.cpp
|
||||
opm/simulators/linalg/ExtractParallelGridInformationToISTL.cpp
|
||||
opm/simulators/linalg/FlexibleSolver1.cpp
|
||||
|
50
opm/simulators/flow/countGlobalCells.cpp
Normal file
50
opm/simulators/flow/countGlobalCells.cpp
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
Copyright 2013, 2015 SINTEF ICT, Applied Mathematics.
|
||||
Copyright 2014, 2015 Dr. Blatt - HPC-Simulation-Software & Services
|
||||
Copyright 2014, 2015 Statoil ASA.
|
||||
Copyright 2015 NTNU
|
||||
Copyright 2015 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 "countGlobalCells.hpp"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
namespace Opm {
|
||||
namespace detail {
|
||||
|
||||
std::vector<int> buildAllCells(const int nc) {
|
||||
std::vector<int> all_cells(nc);
|
||||
std::iota(all_cells.begin(), all_cells.end(), 0);
|
||||
return all_cells;
|
||||
}
|
||||
|
||||
double getGravity(const double* g, const int dim) {
|
||||
double grav = 0.0;
|
||||
if (g) {
|
||||
// Guard against gravity in anything but last dimension.
|
||||
for (int dd = 0; dd < dim - 1; ++dd) {
|
||||
assert(g[dd] == 0.0);
|
||||
}
|
||||
grav = g[dim - 1];
|
||||
}
|
||||
return grav;
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
} // namespace Opm
|
@ -21,28 +21,24 @@
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef OPM_BLACKOILDETAILS_HEADER_INCLUDED
|
||||
#define OPM_BLACKOILDETAILS_HEADER_INCLUDED
|
||||
#ifndef OPM_COUNTGLOBALCELLS_HEADER_INCLUDED
|
||||
#define OPM_COUNTGLOBALCELLS_HEADER_INCLUDED
|
||||
|
||||
#include <opm/simulators/linalg/ParallelIstlInformation.hpp>
|
||||
#include <opm/core/props/BlackoilPhases.hpp>
|
||||
|
||||
#include <dune/grid/common/gridview.hh>
|
||||
|
||||
#include <boost/range/iterator_range.hpp>
|
||||
|
||||
#include <any>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm {
|
||||
namespace detail {
|
||||
|
||||
|
||||
inline
|
||||
std::vector<int>
|
||||
buildAllCells(const int nc)
|
||||
{
|
||||
std::vector<int> all_cells(nc);
|
||||
|
||||
for (int c = 0; c < nc; ++c) { all_cells[c] = c; }
|
||||
|
||||
return all_cells;
|
||||
}
|
||||
std::vector<int> buildAllCells(const int nc);
|
||||
|
||||
|
||||
|
||||
@ -80,18 +76,7 @@ namespace detail {
|
||||
|
||||
|
||||
|
||||
inline
|
||||
double getGravity(const double* g, const int dim) {
|
||||
double grav = 0.0;
|
||||
if (g) {
|
||||
// Guard against gravity in anything but last dimension.
|
||||
for (int dd = 0; dd < dim - 1; ++dd) {
|
||||
assert(g[dd] == 0.0);
|
||||
}
|
||||
grav = g[dim - 1];
|
||||
}
|
||||
return grav;
|
||||
}
|
||||
double getGravity(const double* g, const int dim);
|
||||
|
||||
|
||||
/// \brief Compute the Euclidian norm of a vector
|
||||
|
Loading…
Reference in New Issue
Block a user