Commit 09169d36 authored by Andreas Lauser's avatar Andreas Lauser
Browse files

make it compile on gcc 4.1 and 4.3, fix a severe bug in the decoupled models

the saturation argument for the initSomething class was an int instead
of a Scalar. probably nobody noticed so far because the saturation was
always initialized to 1.0 in the decoupled tests

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@5148 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 0c9addbe
......@@ -77,8 +77,8 @@ int main(int argc, char** argv)
Dune::FieldVector<Scalar, dim> upperRight(300);
upperRight[1] = 75;
int cellNumberX = 300/discretizationLength;
int cellNumberY = 75/discretizationLength;
int cellNumberX = static_cast<int>(300/discretizationLength);
int cellNumberY = static_cast<int>(75/discretizationLength);
Dune::FieldVector<int, dim> cellNumbers(cellNumberX);
cellNumbers[1] = cellNumberY;
......
......@@ -40,7 +40,7 @@ int main(int argc, char** argv)
//load interface-file
Dumux::InterfaceProblemProperties interfaceProbProps("interface_MW.xml");
double discretizationLength = interfaceProbProps.IPP_DiscretizationLength;
int cellNumber = 2/discretizationLength;
int cellNumber = static_cast<int>(2/discretizationLength);
// define the problem dimensions
Dune::FieldVector<Scalar, dim> lowerLeft(0);
......
......@@ -132,7 +132,7 @@ SET_TYPE_PROP(BoxRichards, FluidSystem, FluidSystem2P<TypeTag>);
SET_PROP(BoxRichards, NonwettingPhase)
{
typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar;
typedef GasPhase<Scalar, N2<Scalar>> type;
typedef GasPhase<Scalar, N2<Scalar> > type;
};
//! The fluid state class
......
......@@ -590,7 +590,7 @@ protected:
/*!
* \brief Returns the number of sampling points.
*/
Scalar numSamples_() const
int numSamples_() const
{ return asImp_().numSamples(); }
};
......
......@@ -30,6 +30,25 @@
#define HAVE_VALGRIND 0
#endif
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)
// do not do static_asserts for gcc < 4.4 (semantics changed, so old
// GCCs will complain when using static_assert)
#define static_assert(a, b)
// do not do valgrind client requests for gcc < 4.4 (old GCCs do not
// support anonymous template arguments which results in errors inside
// the BoundaryTypes class)
#define SetUndefined(a) foo();
#define SetDefined(a) foo();
#define CheckDefined(a) foo();
#define SetNoAccess(a) foo();
namespace Valgrind
{
inline void foo() {}; // dummy function
}
#else
#if HAVE_VALGRIND
#include <valgrind/memcheck.h>
#endif // HAVE_VALGRIND
......@@ -103,3 +122,5 @@ inline void SetNoAccess(const T &value)
}
#endif
#endif
......@@ -173,7 +173,7 @@ private:
//initialise variables
velocitySecondPhase_ = initialVel;
}
void initializeGlobalVariablesTransPart(int initialSat)
void initializeGlobalVariablesTransPart(Scalar initialSat)
{
//resize to grid size
saturation_.resize(this->gridSize());
......
......@@ -25,7 +25,6 @@
*
* \brief Defines the properties required for the decoupled 2p2c models.
*/
#ifndef DUMUX_2P2CPROPERTIES_HH
#define DUMUX_2P2CPROPERTIES_HH
......@@ -99,7 +98,6 @@ NEW_PROP_TAG(RelaxationPreconditioner);
//////////////////////////////////////////////////////////////////
// Properties
//////////////////////////////////////////////////////////////////
SET_PROP(DecoupledTwoPTwoC, TwoPIndices)
{
typedef TwoPCommonIndices<TypeTag> type;
......
......@@ -167,7 +167,8 @@ private:
*\param initialVel Vector containing the initial velocity
*\param initialSat Initial value for the saturation
*/
void initialize2p2cVariables(Dune::FieldVector<Scalar, dim>& initialVel, int initialSat)
void initialize2p2cVariables(Dune::FieldVector<Scalar, dim>& initialVel,
Scalar initialSat)
{
//resize to grid size
int size_ = this->gridSize();
......
......@@ -218,23 +218,23 @@ private:
public:
//! Return pressure vector
ScalarSolutionType& pressure()
const ScalarSolutionType& pressure() const
{
return pressure_;
}
const ScalarSolutionType& pressure() const
ScalarSolutionType& pressure()
{
return pressure_;
}
//! Return velocity vector
DimVecElemFaceType& velocity()
const DimVecElemFaceType& velocity() const
{
return velocity_;
}
const DimVecElemFaceType& velocity() const
DimVecElemFaceType& velocity()
{
return velocity_;
}
......@@ -250,11 +250,6 @@ public:
* @param element codim 0 entity
* \return element index
*/
int index(const Element& element)
{
return elementMapper_.map(element);
}
int index(const Element& element) const
{
return elementMapper_.map(element);
......@@ -265,38 +260,23 @@ public:
* @param vertex codim dim entity
* \return vertex index
*/
int index(const Vertex& vertex)
{
return vertexMapper_.map(vertex);
}
int index(const Vertex& vertex) const
{
return vertexMapper_.map(vertex);
}
//!Return the number of data elements
const int gridSize()
{
return gridSize_;
}
const int gridSize() const
int gridSize() const
{
return gridSize_;
}
//!Return gridView
const GridView& gridView()
const GridView& gridView() const
{
return gridView_;
}
const ElementMapper& elementMapper()
{
return elementMapper_;
}
const ElementMapper& elementMapper() const
{
return elementMapper_;
......@@ -307,11 +287,6 @@ public:
@param element entity of codim 0
\return value of pressure
*/
Dune::FieldVector<Scalar, 1>& pressElement(const Element& element)
{
return pressure_[elementMapper_.map(element)];
}
const Dune::FieldVector<Scalar, 1>& pressElement(const Element& element) const
{
return pressure_[elementMapper_.map(element)];
......
......@@ -125,9 +125,9 @@ public:
* \param K1 intrinsic permeability of the first node
* \param K2 intrinsic permeability of the second node
*/
const void meanK(Tensor &result,
Scalar K1,
Scalar K2) const
void meanK(Tensor &result,
Scalar K1,
Scalar K2) const
{
const Scalar K = Dumux::harmonicMean(K1, K2);
for (int i = 0; i < dimWorld; ++i) {
......@@ -143,9 +143,9 @@ public:
* \param K1 intrinsic permeability of the first node
* \param K2 intrinsic permeability of the second node
*/
const void meanK(Tensor &result,
const Tensor &K1,
const Tensor &K2) const
void meanK(Tensor &result,
const Tensor &K1,
const Tensor &K2) const
{
// entry-wise harmonic mean. this is almost certainly wrong if
// you have off-main diagonal entries in your permeabilities!
......
......@@ -2,9 +2,11 @@
# Dune module information file #
################################
#Name of the module
Module: dumux
Version: 2.0
Maintainer: bernd@iws.uni-stuttgart.de
#depending on
Depends: dune-pdelab
# if no it is desired not to use pdelab, use the following
# dependencies. parallel computations will not work then though
#Depends: dune-grid (>= 2.0) dune-localfunctions (>= 2.0) dune-istl (>= 2.0)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment