From 73189fd2d39420593df8a665787e6856a3a7dd5f Mon Sep 17 00:00:00 2001 From: Andreas Lauser <and@poware.org> Date: Fri, 2 Sep 2011 11:54:48 +0000 Subject: [PATCH] 1p box model: make it compile with Scalar != double git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@6570 2fb0f335-1f38-0410-981e-8018bf24f1b0 --- dumux/boxmodels/1p/1plocalresidual.hh | 5 ++++- dumux/boxmodels/1p/1pmodel.hh | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dumux/boxmodels/1p/1plocalresidual.hh b/dumux/boxmodels/1p/1plocalresidual.hh index cbac28aed2..502f0d5123 100644 --- a/dumux/boxmodels/1p/1plocalresidual.hh +++ b/dumux/boxmodels/1p/1plocalresidual.hh @@ -135,7 +135,10 @@ public: Vector tmpVec; fluxVars.intrinsicPermeability().mv(fluxVars.potentialGrad(), tmpVec); - Scalar normalFlux = - (tmpVec*fluxVars.face().normal); + Scalar normalFlux = 0; + for (int i = 0; i < Vector::size; ++i) + normalFlux += tmpVec[i]*fluxVars.face().normal[i]; + normalFlux *= -1; const VolumeVariables &up = this->curVolVars_(fluxVars.upstreamIdx(normalFlux)); const VolumeVariables &dn = this->curVolVars_(fluxVars.downstreamIdx(normalFlux)); diff --git a/dumux/boxmodels/1p/1pmodel.hh b/dumux/boxmodels/1p/1pmodel.hh index 21a8cabcd3..f49799f193 100644 --- a/dumux/boxmodels/1p/1pmodel.hh +++ b/dumux/boxmodels/1p/1pmodel.hh @@ -93,14 +93,14 @@ public: void addOutputVtkFields(const SolutionVector &sol, MultiWriter &writer) { - typedef Dune::BlockVector<Dune::FieldVector<Scalar, 1> > ScalarField; + typedef Dune::BlockVector<Dune::FieldVector<double, 1> > ScalarField; // create the required scalar fields unsigned numVertices = this->problem_().gridView().size(dim); - ScalarField *p = writer.allocateManagedBuffer (numVertices); + ScalarField *p = writer.allocateManagedBuffer(numVertices); unsigned numElements = this->gridView_().size(0); - ScalarField *rank = writer.allocateManagedBuffer (numElements); + ScalarField *rank = writer.allocateManagedBuffer(numElements); FVElementGeometry fvElemGeom; VolumeVariables volVars; -- GitLab