From e5bd6547ae5fd04d174b44cba9141558431046d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Thu, 23 May 2013 14:48:34 +0200 Subject: [PATCH] Add gravity() method. --- opm/autodiff/GeoProps.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/opm/autodiff/GeoProps.hpp b/opm/autodiff/GeoProps.hpp index ed62d3e97..7020d529a 100644 --- a/opm/autodiff/GeoProps.hpp +++ b/opm/autodiff/GeoProps.hpp @@ -54,6 +54,8 @@ namespace Opm tpfa_htrans_compute(ug, props.permeability(), htrans.data()); tpfa_trans_compute (ug, htrans.data() , trans_.data()); + // Gravity potential + std::fill(gravity_, gravity_ + 3, 0.0); if (grav != 0) { const typename Vector::Index nd = grid.dimensions; @@ -71,17 +73,20 @@ namespace Opm } } } + std::copy(grav, grav + nd, gravity_); } } const Vector& poreVolume() const { return pvol_ ; } const Vector& transmissibility() const { return trans_; } const Vector& gravityPotential() const { return gpot_ ; } + const double* gravity() const { return gravity_; } private: Vector pvol_ ; Vector trans_; Vector gpot_ ; + double gravity_[3]; // Size 3 even if grid is 2-dim. }; }