From f7622f0e71a4a1c06e5cbae88c65f862568e6865 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Mon, 12 Jan 2015 15:07:15 +0100 Subject: [PATCH] Avoid multiple symbol definitions for MinPvProcessor. The non-template class MinpvProcessor contains all function definitions inside of the header file without inlining. The results in the symbols being in the library of opm-core and in case of using CpGrid an addtional occurence in other libraries (opm-autodiff?). This commit changes this by simply inlining all these functions. Note that another (better?) option would be to move at least the bigger once into a cpp file. --- opm/core/grid/MinpvProcessor.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/opm/core/grid/MinpvProcessor.hpp b/opm/core/grid/MinpvProcessor.hpp index 90c7bd96..23ad72cd 100644 --- a/opm/core/grid/MinpvProcessor.hpp +++ b/opm/core/grid/MinpvProcessor.hpp @@ -53,7 +53,7 @@ namespace Opm std::array delta_; }; - MinpvProcessor::MinpvProcessor(const int nx, const int ny, const int nz) + inline MinpvProcessor::MinpvProcessor(const int nx, const int ny, const int nz) { // Not doing init-list init since bracket-init not available // for all compilers we support (gcc 4.4). @@ -67,7 +67,7 @@ namespace Opm - void MinpvProcessor::process(const std::vector& pv, const double minpv, double* zcorn) const + inline void MinpvProcessor::process(const std::vector& pv, const double minpv, double* zcorn) const { // Algorithm: // 1. Process each column of cells (with same i and j @@ -115,7 +115,7 @@ namespace Opm - std::array MinpvProcessor::cornerIndices(const int i, const int j, const int k) const + inline std::array MinpvProcessor::cornerIndices(const int i, const int j, const int k) const { const int ix = 2*(i*delta_[0] + j*delta_[1] + k*delta_[2]); std::array ixs = {{ ix, ix + delta_[0], @@ -132,7 +132,7 @@ namespace Opm // The ordering is such that i runs fastest. That is, with // L = low and H = high: // {LLL, HLL, LHL, HHL, LLH, HLH, LHH, HHH }. - std::array MinpvProcessor::getCellZcorn(const int i, const int j, const int k, const double* z) const + inline std::array MinpvProcessor::getCellZcorn(const int i, const int j, const int k, const double* z) const { const std::array ixs = cornerIndices(i, j, k); std::array cellz; @@ -144,7 +144,7 @@ namespace Opm - void MinpvProcessor::setCellZcorn(const int i, const int j, const int k, const std::array& cellz, double* z) const + inline void MinpvProcessor::setCellZcorn(const int i, const int j, const int k, const std::array& cellz, double* z) const { const std::array ixs = cornerIndices(i, j, k); for (int count = 0; count < 8; ++count) {