make most indices unsigned

(instead of using 'int'.) This triggered quite a few compiler warnings
which are also dealt-with by this patch.
This commit is contained in:
Andreas Lauser 2015-11-18 11:54:35 +01:00
parent a26a4ec880
commit 2c97e90a79
19 changed files with 262 additions and 262 deletions

View File

@ -375,7 +375,7 @@ public:
* \copydoc FvBaseMultiPhaseProblem::temperature
*/
template <class Context>
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{
const auto &pos = context.pos(spaceIdx, timeIdx);
if (inHighTemperatureRegion_(pos))
@ -387,8 +387,8 @@ public:
* \copydoc FvBaseMultiPhaseProblem::intrinsicPermeability
*/
template <class Context>
const DimMatrix &intrinsicPermeability(const Context &context, int spaceIdx,
int timeIdx) const
const DimMatrix &intrinsicPermeability(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -400,7 +400,7 @@ public:
* \copydoc FvBaseMultiPhaseProblem::porosity
*/
template <class Context>
Scalar porosity(const Context &context, int spaceIdx, int timeIdx) const
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -413,7 +413,7 @@ public:
*/
template <class Context>
const MaterialLawParams &materialLawParams(const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -427,8 +427,8 @@ public:
* In this case, we assume the rock-matrix to be granite.
*/
template <class Context>
Scalar heatCapacitySolid(const Context &context, int spaceIdx,
int timeIdx) const
Scalar heatCapacitySolid(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
return 790 // specific heat capacity of granite [J / (kg K)]
* 2700; // density of granite [kg/m^3]
@ -439,7 +439,7 @@ public:
*/
template <class Context>
const HeatConductionLawParams &
heatConductionParams(const Context &context, int spaceIdx, int timeIdx) const
heatConductionParams(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -459,7 +459,7 @@ public:
*/
template <class Context>
void boundary(BoundaryRateVector &values, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const auto &pos = context.pos(spaceIdx, timeIdx);
@ -505,8 +505,8 @@ public:
* \copydoc FvBaseProblem::initial
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx,
int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
Opm::CompositionalFluidState<Scalar, FluidSystem> fs;
initialFluidState_(fs, context, spaceIdx, timeIdx);
@ -524,8 +524,8 @@ public:
* everywhere.
*/
template <class Context>
void source(RateVector &rate, const Context &context, int spaceIdx,
int timeIdx) const
void source(RateVector &rate, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ rate = Scalar(0.0); }
//! \}
@ -533,7 +533,7 @@ public:
private:
template <class Context, class FluidState>
void initialFluidState_(FluidState &fs, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);

View File

@ -316,15 +316,15 @@ public:
* \copydoc FvBaseMultiPhaseProblem::temperature
*/
template <class Context>
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return 293.15; /* [K] */ }
/*!
* \copydoc FvBaseMultiPhaseProblem::intrinsicPermeability
*/
template <class Context>
const DimMatrix &intrinsicPermeability(const Context &context, int spaceIdx,
int timeIdx) const
const DimMatrix &intrinsicPermeability(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -336,7 +336,7 @@ public:
* \copydoc FvBaseMultiPhaseProblem::porosity
*/
template <class Context>
Scalar porosity(const Context &context, int spaceIdx, int timeIdx) const
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -350,7 +350,7 @@ public:
*/
template <class Context>
const MaterialLawParams &materialLawParams(const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -364,15 +364,15 @@ public:
*/
template <class Context>
const HeatConductionLawParams &
heatConductionParams(const Context &context, int spaceIdx, int timeIdx) const
heatConductionParams(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return heatCondParams_; }
/*!
* \copydoc FvBaseMultiPhaseProblem::heatCapacitySolid
*/
template <class Context>
Scalar heatCapacitySolid(const Context &context, int spaceIdx,
int timeIdx) const
Scalar heatCapacitySolid(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
return 850 // specific heat capacity [J / (kg K)]
* 2650; // density of sand [kg/m^3]
@ -390,7 +390,7 @@ public:
*/
template <class Context>
void boundary(BoundaryRateVector &values, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const auto &pos = context.pos(spaceIdx, timeIdx);
@ -409,7 +409,7 @@ public:
// inject with the same composition as the gas phase of
// the injection fluid state
Scalar molarInjectionRate = 0.3435; // [mol/(m^2 s)]
for (int compIdx = 0; compIdx < numComponents; ++compIdx)
for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx)
molarRate[conti0EqIdx + compIdx] =
-molarInjectionRate
* injectFluidState_.moleFraction(gasPhaseIdx, compIdx);
@ -438,8 +438,8 @@ public:
* \copydoc FvBaseProblem::initial
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx,
int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
Opm::CompositionalFluidState<Scalar, FluidSystem> fs;
@ -456,8 +456,8 @@ public:
* everywhere.
*/
template <class Context>
void source(RateVector &rate, const Context &context, int spaceIdx,
int timeIdx) const
void source(RateVector &rate, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ rate = Scalar(0.0); }
//! \}
@ -493,7 +493,7 @@ private:
template <class FluidState, class Context>
void initialFluidState_(FluidState &fs, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
@ -510,7 +510,7 @@ private:
const auto &matParams = materialLawParams(context, spaceIdx, timeIdx);
Scalar pc[numPhases];
MaterialLaw::capillaryPressures(pc, matParams, fs);
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
fs.setPressure(phaseIdx, pw + (pc[phaseIdx] - pc[waterPhaseIdx]));
// compute the phase compositions
@ -528,7 +528,7 @@ private:
const auto &matParams = materialLawParams(context, spaceIdx, timeIdx);
Scalar pc[numPhases];
MaterialLaw::capillaryPressures(pc, matParams, fs);
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
fs.setPressure(phaseIdx, pw + (pc[phaseIdx] - pc[waterPhaseIdx]));
// compute the phase compositions
@ -539,17 +539,17 @@ private:
// set the contaminant mole fractions to zero. this is a
// little bit hacky...
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
fs.setMoleFraction(phaseIdx, NAPLIdx, 0.0);
if (phaseIdx == naplPhaseIdx)
continue;
Scalar sumx = 0;
for (int compIdx = 0; compIdx < numComponents; ++compIdx)
for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx)
sumx += fs.moleFraction(phaseIdx, compIdx);
for (int compIdx = 0; compIdx < numComponents; ++compIdx)
for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx)
fs.setMoleFraction(phaseIdx, compIdx,
fs.moleFraction(phaseIdx, compIdx) / sumx);
}
@ -563,18 +563,18 @@ private:
// create a Fluid state which has all phases present
Opm::ImmiscibleFluidState<Scalar, FluidSystem> fs;
fs.setTemperature(293.15);
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
fs.setPressure(phaseIdx, 1.0135e5);
}
typename FluidSystem::ParameterCache paramCache;
paramCache.updateAll(fs);
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
Scalar rho = FluidSystem::density(fs, paramCache, phaseIdx);
fs.setDensity(phaseIdx, rho);
}
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
Scalar lambdaSaturated;
if (FluidSystem::isLiquid(phaseIdx)) {
Scalar lambdaFluid = FluidSystem::thermalConductivity(fs, paramCache, phaseIdx);

View File

@ -235,15 +235,15 @@ public:
* \copydoc FvBaseMultiPhaseProblem::intrinsicPermeability
*/
template <class Context>
const DimMatrix &intrinsicPermeability(const Context &context, int spaceIdx,
int timeIdx) const
const DimMatrix &intrinsicPermeability(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ return K_; }
/*!
* \copydoc FvBaseMultiPhaseProblem::porosity
*/
template <class Context>
Scalar porosity(const Context &context, int spaceIdx, int timeIdx) const
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return 0.35; }
/*!
@ -251,14 +251,14 @@ public:
*/
template <class Context>
const MaterialLawParams &materialLawParams(const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{ return materialParams_; }
/*!
* \copydoc FvBaseMultiPhaseProblem::temperature
*/
template <class Context>
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return temperature_; }
//! \}
@ -275,7 +275,7 @@ public:
*/
template <class Context>
void boundary(BoundaryRateVector &values, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{ values.setNoFlow(); }
//! \}
@ -289,8 +289,8 @@ public:
* \copydoc FvBaseProblem::initial
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx,
int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
const auto &pos = context.pos(spaceIdx, timeIdx);
if (onLeftSide_(pos))
@ -306,8 +306,8 @@ public:
* everywhere.
*/
template <class Context>
void source(RateVector &rate, const Context &context, int spaceIdx,
int timeIdx) const
void source(RateVector &rate, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ rate = Scalar(0.0); }
//! \}

View File

@ -242,9 +242,9 @@ public:
// initialize the material parameter objects of the individual
// finite volumes
int n = this->model().numGridDof();
unsigned n = this->model().numGridDof();
materialParams_.resize(n);
for (int i = 0; i < n; ++i) {
for (unsigned i = 0; i < n; ++i) {
materialParams_[i].setMicParams(&micParams_);
materialParams_[i].setMdcParams(&mdcParams_);
materialParams_[i].setSwr(0.0);
@ -285,8 +285,8 @@ public:
const auto &elemEndIt = this->gridView().template end<0>();
for (; elemIt != elemEndIt; ++elemIt) {
elemCtx.updateAll(*elemIt);
for (int scvIdx = 0; scvIdx < elemCtx.numDof(/*timeIdx=*/0); ++scvIdx) {
int globalIdx = elemCtx.globalSpaceIndex(scvIdx, /*timeIdx=*/0);
for (unsigned scvIdx = 0; scvIdx < elemCtx.numDof(/*timeIdx=*/0); ++scvIdx) {
unsigned globalIdx = elemCtx.globalSpaceIndex(scvIdx, /*timeIdx=*/0);
const auto &fs = elemCtx.intensiveQuantities(scvIdx, /*timeIdx=*/0).fluidState();
ParkerLenhard::update(materialParams_[globalIdx], fs);
}
@ -304,22 +304,22 @@ public:
* \copydoc FvBaseMultiPhaseProblem::temperature
*/
template <class Context>
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return temperature_; }
/*!
* \copydoc FvBaseMultiPhaseProblem::intrinsicPermeability
*/
template <class Context>
const DimMatrix &intrinsicPermeability(const Context &context, int spaceIdx,
int timeIdx) const
const DimMatrix &intrinsicPermeability(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ return K_; }
/*!
* \copydoc FvBaseMultiPhaseProblem::porosity
*/
template <class Context>
Scalar porosity(const Context &context, int spaceIdx, int timeIdx) const
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return 0.4; }
/*!
@ -327,9 +327,9 @@ public:
*/
template <class Context>
const MaterialLawParams &materialLawParams(const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
int globalSpaceIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
unsigned globalSpaceIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
return materialParams_[globalSpaceIdx];
}
@ -345,7 +345,7 @@ public:
*/
template <class Context>
void boundary(BoundaryRateVector &values, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.cvCenter(spaceIdx, timeIdx);
@ -377,8 +377,8 @@ public:
* \copydoc FvBaseProblem::initial
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx,
int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
// assign the primary variables
values.assignNaive(initialFluidState_);
@ -389,7 +389,7 @@ public:
*/
template <class Context>
void constraints(Constraints &constraints, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
@ -410,8 +410,8 @@ public:
* everywhere.
*/
template <class Context>
void source(RateVector &rate, const Context &context, int spaceIdx,
int timeIdx) const
void source(RateVector &rate, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ rate = Scalar(0.0); }
//! \}

View File

@ -317,7 +317,7 @@ public:
* \copydoc FvBaseMultiPhaseProblem::temperature
*/
template <class Context>
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return temperature_; }
// \}
@ -331,8 +331,8 @@ public:
* \copydoc FvBaseMultiPhaseProblem::intrinsicPermeability
*/
template <class Context>
const DimMatrix &intrinsicPermeability(const Context &context, int spaceIdx,
int timeIdx) const
const DimMatrix &intrinsicPermeability(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ return matrixK_; }
/*!
@ -342,15 +342,15 @@ public:
*/
template <class Context>
const DimMatrix &fractureIntrinsicPermeability(const Context &context,
int spaceIdx,
int timeIdx) const
unsigned spaceIdx,
unsigned timeIdx) const
{ return fractureK_; }
/*!
* \copydoc FvBaseMultiPhaseProblem::porosity
*/
template <class Context>
Scalar porosity(const Context &context, int spaceIdx, int timeIdx) const
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return matrixPorosity_; }
/*!
@ -359,8 +359,8 @@ public:
* \copydoc Doxygen::contextParams
*/
template <class Context>
Scalar fracturePorosity(const Context &context, int spaceIdx,
int timeIdx) const
Scalar fracturePorosity(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ return fracturePorosity_; }
/*!
@ -368,7 +368,7 @@ public:
*/
template <class Context>
const MaterialLawParams &materialLawParams(const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{ return matrixMaterialParams_; }
/*!
@ -378,8 +378,8 @@ public:
*/
template <class Context>
const MaterialLawParams &fractureMaterialLawParams(const Context &context,
int spaceIdx,
int timeIdx) const
unsigned spaceIdx,
unsigned timeIdx) const
{ return fractureMaterialParams_; }
/*!
@ -401,8 +401,8 @@ public:
* \param timeIdx The index used by the time discretization.
*/
template <class Context>
Scalar fractureWidth(const Context &context, int spaceIdx1, int spaceIdx2,
int timeIdx) const
Scalar fractureWidth(const Context &context, unsigned spaceIdx1, unsigned spaceIdx2,
unsigned timeIdx) const
{ return fractureWidth_; }
/*!
@ -410,7 +410,7 @@ public:
*/
template <class Context>
const HeatConductionLawParams &
heatConductionParams(const Context &context, int spaceIdx, int timeIdx) const
heatConductionParams(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return heatCondParams_; }
/*!
@ -419,8 +419,8 @@ public:
* In this case, we assume the rock-matrix to be granite.
*/
template <class Context>
Scalar heatCapacitySolid(const Context &context, int spaceIdx,
int timeIdx) const
Scalar heatCapacitySolid(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
return 790 // specific heat capacity of granite [J / (kg K)]
* 2700; // density of granite [kg/m^3]
@ -438,7 +438,7 @@ public:
*/
template <class Context>
void boundary(BoundaryRateVector &values, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
@ -476,7 +476,7 @@ public:
*/
template <class Context>
void constraints(Constraints &constraints, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
@ -484,7 +484,7 @@ public:
// only impose constraints adjacent to the left boundary
return;
int globalIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
unsigned globalIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
if (!fractureMapper().isFractureVertex(globalIdx)) {
// do not impose constraints if the finite volume does
// not contain fractures.
@ -521,8 +521,8 @@ public:
* \copydoc FvBaseProblem::initial
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx,
int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
FluidState fluidState;
fluidState.setTemperature(temperature_);
@ -543,8 +543,8 @@ public:
* everywhere.
*/
template <class Context>
void source(RateVector &rate, const Context &context, int spaceIdx,
int timeIdx) const
void source(RateVector &rate, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ rate = Scalar(0.0); }
// \}
@ -569,18 +569,18 @@ private:
// create a Fluid state which has all phases present
Opm::ImmiscibleFluidState<Scalar, FluidSystem> fs;
fs.setTemperature(293.15);
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
fs.setPressure(phaseIdx, 1.0135e5);
}
typename FluidSystem::ParameterCache paramCache;
paramCache.updateAll(fs);
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
Scalar rho = FluidSystem::density(fs, paramCache, phaseIdx);
fs.setDensity(phaseIdx, rho);
}
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
Scalar lambdaSaturated;
if (FluidSystem::isLiquid(phaseIdx)) {
Scalar lambdaFluid = FluidSystem::thermalConductivity(fs, paramCache, phaseIdx);

View File

@ -261,22 +261,22 @@ public:
* \copydoc FvBaseMultiPhaseProblem::temperature
*/
template <class Context>
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return 273.15 + 10; } // 10C
/*!
* \copydoc FvBaseMultiPhaseProblem::porosity
*/
template <class Context>
Scalar porosity(const Context &context, int spaceIdx, int timeIdx) const
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return 0.4; }
/*!
* \copydoc FvBaseMultiPhaseProblem::intrinsicPermeability
*/
template <class Context>
const DimMatrix &intrinsicPermeability(const Context &context, int spaceIdx,
int timeIdx) const
const DimMatrix &intrinsicPermeability(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
return isInLens_(context.pos(spaceIdx, timeIdx)) ? intrinsicPermLens_
: intrinsicPerm_;
@ -293,7 +293,7 @@ public:
*/
template <class Context>
void boundary(BoundaryRateVector &values, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &globalPos = context.pos(spaceIdx, timeIdx);
@ -331,8 +331,8 @@ public:
* \copydoc FvBaseProblem::initial
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx,
int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
// const GlobalPosition &globalPos = context.pos(spaceIdx, timeIdx);
values[pressure0Idx] = 1.0e+5; // + 9.81*1.23*(20-globalPos[dim-1]);
@ -342,8 +342,8 @@ public:
* \copydoc FvBaseProblem::source
*/
template <class Context>
void source(RateVector &rate, const Context &context, int spaceIdx,
int timeIdx) const
void source(RateVector &rate, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ rate = Scalar(0.0); }
//! \}

View File

@ -275,15 +275,15 @@ public:
* \copydoc FvBaseMultiPhaseProblem::temperature
*/
template <class Context>
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return temperature_; }
/*!
* \copydoc FvBaseMultiPhaseProblem::intrinsicPermeability
*/
template <class Context>
const DimMatrix &intrinsicPermeability(const Context &context, int spaceIdx,
int timeIdx) const
const DimMatrix &intrinsicPermeability(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -295,7 +295,7 @@ public:
* \copydoc FvBaseMultiPhaseProblem::porosity
*/
template <class Context>
Scalar porosity(const Context &context, int spaceIdx, int timeIdx) const
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return porosity_; }
/*!
@ -303,7 +303,7 @@ public:
*/
template <class Context>
const MaterialLawParams &materialLawParams(const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{ return materialParams_; }
/*!
@ -312,8 +312,8 @@ public:
* In this case, we assume the rock-matrix to be quartz.
*/
template <class Context>
Scalar heatCapacitySolid(const Context &context, int spaceIdx,
int timeIdx) const
Scalar heatCapacitySolid(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
return 850. // specific heat capacity [J / (kg K)]
* 2650.; // density of sand [kg/m^3]
@ -331,7 +331,7 @@ public:
*/
template <class Context>
void boundary(BoundaryRateVector &values, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const auto &pos = context.pos(spaceIdx, timeIdx);
@ -364,8 +364,8 @@ public:
* \copydoc FvBaseProblem::initial
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx,
int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
Opm::CompositionalFluidState<Scalar, FluidSystem> fs;
@ -383,8 +383,8 @@ public:
* everywhere.
*/
template <class Context>
void source(RateVector &rate, const Context &context, int spaceIdx,
int timeIdx) const
void source(RateVector &rate, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ rate = Scalar(0.0); }
//! \}
@ -407,7 +407,7 @@ private:
template <class FluidState, class Context>
void initialFluidState_(FluidState &fs, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition pos = context.pos(spaceIdx, timeIdx);
Scalar y = pos[1];
@ -445,7 +445,7 @@ private:
if (onLeftBoundary_(pos))
pg += 10e3;
MaterialLaw::capillaryPressures(pcAll, matParams, fs);
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
fs.setPressure(phaseIdx, pg + (pcAll[phaseIdx] - pcAll[gasPhaseIdx]));
// set composition of gas phase

View File

@ -309,8 +309,8 @@ public:
* \copydoc FvBaseMultiPhaseProblem::intrinsicPermeability
*/
template <class Context>
const DimMatrix &intrinsicPermeability(const Context &context, int spaceIdx,
int timeIdx) const
const DimMatrix &intrinsicPermeability(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
const GlobalPosition &globalPos = context.pos(spaceIdx, timeIdx);
@ -323,7 +323,7 @@ public:
* \copydoc FvBaseMultiPhaseProblem::porosity
*/
template <class Context>
Scalar porosity(const Context &context, int spaceIdx, int timeIdx) const
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return 0.4; }
/*!
@ -331,7 +331,7 @@ public:
*/
template <class Context>
const MaterialLawParams &materialLawParams(const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &globalPos = context.pos(spaceIdx, timeIdx);
@ -344,7 +344,7 @@ public:
* \copydoc FvBaseMultiPhaseProblem::temperature
*/
template <class Context>
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return temperature_; }
//! \}
@ -408,7 +408,7 @@ public:
*/
template <class Context>
void boundary(BoundaryRateVector &values,
const Context &context, int spaceIdx, int timeIdx) const
const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
@ -479,7 +479,7 @@ public:
* \copydoc FvBaseProblem::initial
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx, int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
Scalar depth = this->boundingBoxMax()[1] - pos[1];
@ -520,8 +520,8 @@ public:
* everywhere.
*/
template <class Context>
void source(RateVector &rate, const Context &context, int spaceIdx,
int timeIdx) const
void source(RateVector &rate, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ rate = Scalar(0.0); }
//! \}
@ -529,7 +529,7 @@ public:
private:
bool isInLens_(const GlobalPosition &pos) const
{
for (int i = 0; i < dim; ++i) {
for (unsigned i = 0; i < dim; ++i) {
if (pos[i] < lensLowerLeft_[i] - eps_ || pos[i] > lensUpperRight_[i]
+ eps_)
return false;

View File

@ -179,7 +179,7 @@ public:
* This problem assumes a constant temperature of 10 degrees Celsius.
*/
template <class Context>
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return 273.15 + 10; }
//! \}
@ -194,7 +194,7 @@ public:
*/
template <class Context>
void boundary(BoundaryRateVector &values, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
/* const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
@ -220,8 +220,8 @@ public:
* \copydoc FvBaseProblem::initial
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx,
int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ initial_(values); }
/*!
@ -231,7 +231,7 @@ public:
*/
template <class Context>
void constraints(Constraints &constraints, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const auto &pos = context.pos(spaceIdx, timeIdx);
@ -249,8 +249,8 @@ public:
* \copydoc FvBaseProblem::source
*/
template <class Context>
void source(RateVector &rate, const Context &context, int spaceIdx,
int timeIdx) const
void source(RateVector &rate, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ rate = Scalar(0.0); }
//! \}

View File

@ -251,7 +251,7 @@ public:
this->model().checkConservativeness();
// Calculate storage terms of the individual phases
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
PrimaryVariables phaseStorage;
this->model().globalPhaseStorage(phaseStorage, phaseIdx);
@ -296,15 +296,15 @@ public:
* This problem simply assumes a constant temperature.
*/
template <class Context>
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return temperature_; }
/*!
* \copydoc FvBaseMultiPhaseProblem::intrinsicPermeability
*/
template <class Context>
const DimMatrix &intrinsicPermeability(const Context &context, int spaceIdx,
int timeIdx) const
const DimMatrix &intrinsicPermeability(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
if (isFineMaterial_(context.pos(spaceIdx, timeIdx)))
return fineK_;
@ -315,7 +315,7 @@ public:
* \copydoc FvBaseMultiPhaseProblem::porosity
*/
template <class Context>
Scalar porosity(const Context &context, int spaceIdx, int timeIdx) const
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -329,7 +329,7 @@ public:
*/
template <class Context>
const MaterialLawParams &materialLawParams(const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -345,8 +345,8 @@ public:
* medium is granite.
*/
template <class Context>
Scalar heatCapacitySolid(const Context &context, int spaceIdx,
int timeIdx) const
Scalar heatCapacitySolid(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
return 790 // specific heat capacity of granite [J / (kg K)]
* 2700; // density of granite [kg/m^3]
@ -357,7 +357,7 @@ public:
*/
template <class Context>
const HeatConductionLawParams &
heatConductionParams(const Context &context, int spaceIdx, int timeIdx) const
heatConductionParams(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -377,7 +377,7 @@ public:
*/
template <class Context>
void boundary(BoundaryRateVector &values, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const auto &pos = context.pos(spaceIdx, timeIdx);
@ -400,8 +400,8 @@ public:
* \copydoc FvBaseProblem::initial
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx,
int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
const auto &matParams = materialLawParams(context, spaceIdx, timeIdx);
values.assignMassConservative(outletFluidState_, matParams);
@ -414,8 +414,8 @@ public:
* everywhere.
*/
template <class Context>
void source(RateVector &rate, const Context &context, int spaceIdx,
int timeIdx) const
void source(RateVector &rate, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ rate = 0.0; }
//! \}
@ -454,8 +454,8 @@ private:
void initFluidState_(FluidState &fs, const MaterialLawParams &matParams,
bool isInlet)
{
int refPhaseIdx;
int otherPhaseIdx;
unsigned refPhaseIdx;
unsigned otherPhaseIdx;
// set the fluid temperatures
fs.setTemperature(temperature_);

View File

@ -192,7 +192,7 @@ public:
* This problem assumes a temperature.
*/
template <class Context>
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return temperature_; } // in [K]
/*!
@ -201,8 +201,8 @@ public:
* This problem uses a constant intrinsic permeability.
*/
template <class Context>
const DimMatrix &intrinsicPermeability(const Context &context, int spaceIdx,
int timeIdx) const
const DimMatrix &intrinsicPermeability(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ return perm_; }
/*!
@ -211,7 +211,7 @@ public:
* This problem uses a constant porosity.
*/
template <class Context>
Scalar porosity(const Context &context, int spaceIdx, int timeIdx) const
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return porosity_; }
#if 0
@ -220,7 +220,7 @@ public:
*
*/
template <class Context>
Scalar tortuosity(const Context &context, int spaceIdx, int timeIdx) const
Scalar tortuosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return tortuosity_; }
/*!
@ -229,7 +229,7 @@ public:
*/
template <class Context>
Scalar dispersivity(const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{ return 0; }
#endif
@ -245,7 +245,7 @@ public:
*/
template <class Context>
void boundary(BoundaryRateVector &values, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &globalPos = context.pos(spaceIdx, timeIdx);
@ -286,8 +286,8 @@ public:
* \copydoc FvBaseProblem::initial
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx,
int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
Opm::CompositionalFluidState<Scalar, FluidSystem, /*storeEnthalpy=*/false> fs;
initialFluidState_(fs, context, spaceIdx, timeIdx);
@ -302,8 +302,8 @@ public:
* everywhere.
*/
template <class Context>
void source(RateVector &rate, const Context &context, int spaceIdx,
int timeIdx) const
void source(RateVector &rate, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ rate = Scalar(0.0); }
//! \}
@ -317,7 +317,7 @@ private:
template <class FluidState, class Context>
void initialFluidState_(FluidState &fs, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
Scalar T = temperature(context, spaceIdx, timeIdx);
// Scalar rho = FluidSystem::H2O::liquidDensity(T, /*pressure=*/1.5e5);

View File

@ -268,23 +268,23 @@ public:
* \copydoc FvBaseMultiPhaseProblem::intrinsicPermeability
*/
template <class Context>
const DimMatrix &intrinsicPermeability(const Context &context, int spaceIdx,
int timeIdx) const
const DimMatrix &intrinsicPermeability(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ return K_; }
/*!
* \copydoc ForchheimerBaseProblem::ergunCoefficient
*/
template <class Context>
Scalar ergunCoefficient(const Context &context, int spaceIdx,
int timeIdx) const
Scalar ergunCoefficient(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ return 0.3866; }
/*!
* \copydoc FvBaseMultiPhaseProblem::porosity
*/
template <class Context>
Scalar porosity(const Context &context, int spaceIdx, int timeIdx) const
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return 0.558; }
/*!
@ -292,14 +292,14 @@ public:
*/
template <class Context>
const MaterialLawParams &materialLawParams(const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{ return materialParams_; }
/*!
* \copydoc FvBaseMultiPhaseProblem::temperature
*/
template <class Context>
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return temperature_; }
//! \}
@ -317,7 +317,7 @@ public:
*/
template <class Context>
void boundary(BoundaryRateVector &values, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
@ -347,8 +347,8 @@ public:
* \copydoc FvBaseProblem::initial
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx,
int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
// assign the primary variables
values.assignNaive(initialFluidState_);
@ -361,8 +361,8 @@ public:
* everywhere.
*/
template <class Context>
void source(RateVector &rate, const Context &context, int spaceIdx,
int timeIdx) const
void source(RateVector &rate, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ rate = Scalar(0.0); }
//! \}

View File

@ -314,7 +314,7 @@ public:
finePorosity_ = 0.2;
coarsePorosity_ = 0.3;
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
fineMaterialParams_.setPcMinSat(phaseIdx, 0.0);
fineMaterialParams_.setPcMaxSat(phaseIdx, 0.0);
@ -379,8 +379,8 @@ public:
* above one with low permeability.
*/
template <class Context>
const DimMatrix &intrinsicPermeability(const Context &context, int spaceIdx,
int timeIdx) const
const DimMatrix &intrinsicPermeability(const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -392,7 +392,7 @@ public:
* \copydoc FvBaseMultiPhaseProblem::porosity
*/
template <class Context>
Scalar porosity(const Context &context, int spaceIdx, int timeIdx) const
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -405,7 +405,7 @@ public:
*/
template <class Context>
const MaterialLawParams &materialLawParams(const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -428,7 +428,7 @@ public:
* will need it one day?
*/
template <class Context>
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return temperature_; }
// \}
@ -446,7 +446,7 @@ public:
*/
template <class Context>
void boundary(BoundaryRateVector &values, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
// no flow on top and bottom
values.setNoFlow();
@ -466,7 +466,7 @@ public:
* the whole domain.
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx, int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{
values.assignNaive(initialFluidState_);
@ -488,7 +488,7 @@ public:
*/
template <class Context>
void constraints(Constraints &constraints, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const auto &pos = context.pos(spaceIdx, timeIdx);
Scalar x = pos[0] - this->boundingBoxMin()[0];
@ -508,13 +508,13 @@ public:
fs.setSaturation(gasPhaseIdx, 0.0);
// set the compositions to only water
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
for (int compIdx = 0; compIdx < numComponents; ++compIdx)
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx)
fs.setMoleFraction(phaseIdx, compIdx, 0.0);
// set the composition of the oil phase to the initial
// composition
for (int compIdx = 0; compIdx < numComponents; ++compIdx)
for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx)
fs.setMoleFraction(oilPhaseIdx, compIdx,
initialFluidState_.moleFraction(oilPhaseIdx,
compIdx));
@ -537,8 +537,8 @@ public:
fs.setSaturation(gasPhaseIdx, 0.0);
// set the compositions to the initial composition
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
for (int compIdx = 0; compIdx < numComponents; ++compIdx)
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx)
fs.setMoleFraction(phaseIdx, compIdx,
initialFluidState_.moleFraction(phaseIdx,
compIdx));
@ -554,8 +554,8 @@ public:
* For this problem, the source term of all components is 0 everywhere.
*/
template <class Context>
void source(RateVector &rate, const Context &context, int spaceIdx,
int timeIdx) const
void source(RateVector &rate, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ rate = Scalar(0.0); }
//! \}
@ -591,8 +591,8 @@ private:
fs.setPressure(gasPhaseIdx, pw + (pC[gasPhaseIdx] - pC[waterPhaseIdx]));
// reset all mole fractions to 0
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
for (int compIdx = 0; compIdx < numComponents; ++compIdx)
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx)
fs.setMoleFraction(phaseIdx, compIdx, 0.0);
//////

View File

@ -228,8 +228,8 @@ public:
auto elemEndIt = this->gridView().template end</*codim=*/0>();
for (; elemIt != elemEndIt; ++elemIt) {
stencil.update(*elemIt);
for (int dofIdx = 0; dofIdx < stencil.numPrimaryDof(); ++ dofIdx) {
int globalDofIdx = stencil.globalSpaceIndex(dofIdx);
for (unsigned dofIdx = 0; dofIdx < stencil.numPrimaryDof(); ++ dofIdx) {
unsigned globalDofIdx = stencil.globalSpaceIndex(dofIdx);
const auto& dofPos = stencil.subControlVolume(dofIdx).center();
dofIsInLens_[globalDofIdx] = isInLens_(dofPos);
}
@ -275,10 +275,10 @@ public:
* \copydoc FvBaseMultiPhaseProblem::temperature
*/
template <class Context>
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return temperature(context.globalSpaceIndex(spaceIdx, timeIdx), timeIdx); }
Scalar temperature(int globalSpaceIdx, int timeIdx) const
Scalar temperature(unsigned globalSpaceIdx, unsigned timeIdx) const
{ return 273.15 + 10; } // -> 10°C
/*!
@ -286,8 +286,8 @@ public:
*/
template <class Context>
const DimMatrix &intrinsicPermeability(const Context &context,
int spaceIdx,
int timeIdx) const
unsigned spaceIdx,
unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isInLens_(pos))
@ -299,7 +299,7 @@ public:
* \copydoc FvBaseMultiPhaseProblem::porosity
*/
template <class Context>
Scalar porosity(const Context &context, int spaceIdx, int timeIdx) const
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return 0.4; }
/*!
@ -307,14 +307,14 @@ public:
*/
template <class Context>
const MaterialLawParams &materialLawParams(const Context &context,
int spaceIdx,
int timeIdx) const
unsigned spaceIdx,
unsigned timeIdx) const
{
int globalSpaceIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
unsigned globalSpaceIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
return materialLawParams(globalSpaceIdx, timeIdx);
}
const MaterialLawParams& materialLawParams(int globalSpaceIdx, int timeIdx) const
const MaterialLawParams& materialLawParams(unsigned globalSpaceIdx, unsigned timeIdx) const
{
if (dofIsInLens_[globalSpaceIdx])
return lensMaterialParams_;
@ -328,13 +328,13 @@ public:
*/
template <class Context>
Scalar referencePressure(const Context &context,
int spaceIdx,
int timeIdx) const
unsigned spaceIdx,
unsigned timeIdx) const
{ return referencePressure(context.globalSpaceIndex(spaceIdx, timeIdx), timeIdx); }
// the Richards model does not have an element context available at all places
// where the reference pressure is required...
Scalar referencePressure(int globalSpaceIdx, int timeIdx) const
Scalar referencePressure(unsigned globalSpaceIdx, unsigned timeIdx) const
{ return pnRef_; }
//! \}
@ -350,8 +350,8 @@ public:
template <class Context>
void boundary(BoundaryRateVector &values,
const Context &context,
int spaceIdx,
int timeIdx) const
unsigned spaceIdx,
unsigned timeIdx) const
{
const auto &pos = context.pos(spaceIdx, timeIdx);
@ -395,8 +395,8 @@ public:
template <class Context>
void initial(PrimaryVariables &values,
const Context &context,
int spaceIdx,
int timeIdx) const
unsigned spaceIdx,
unsigned timeIdx) const
{
const auto &materialParams = this->materialLawParams(context, spaceIdx, timeIdx);
@ -419,8 +419,8 @@ public:
template <class Context>
void source(RateVector &rate,
const Context &context,
int spaceIdx,
int timeIdx) const
unsigned spaceIdx,
unsigned timeIdx) const
{ rate = Scalar(0.0); }
//! \}
@ -447,7 +447,7 @@ private:
bool isInLens_(const GlobalPosition &pos) const
{
for (int i = 0; i < dimWorld; ++i) {
for (unsigned i = 0; i < dimWorld; ++i) {
if (pos[i] < lensLowerLeft_[i] || pos[i] > lensUpperRight_[i])
return false;
}

View File

@ -179,7 +179,7 @@ public:
* This problem assumes a temperature of 10 degrees Celsius.
*/
template <class Context>
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return 273.15 + 10; /* -> 10 deg C */ }
// \}
@ -198,7 +198,7 @@ public:
*/
template <class Context>
void boundary(BoundaryRateVector &values, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
@ -229,8 +229,8 @@ public:
* 0.5% is set.
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx,
int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
const GlobalPosition &globalPos = context.pos(spaceIdx, timeIdx);
values = 0.0;
@ -264,8 +264,8 @@ public:
* is 0 everywhere.
*/
template <class Context>
void source(RateVector &rate, const Context &context, int spaceIdx,
int timeIdx) const
void source(RateVector &rate, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ rate = Scalar(0.0); }
/*!
@ -276,7 +276,7 @@ public:
*/
template <class Context>
void constraints(Constraints &constraints, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const auto &pos = context.pos(spaceIdx, timeIdx);
@ -289,7 +289,7 @@ public:
;
constraints.setConstraint(moleFrac1Idx, conti0EqIdx + 1,
initCond[moleFrac1Idx]);
for (int axisIdx = 0; axisIdx < dimWorld; ++axisIdx)
for (unsigned axisIdx = 0; axisIdx < dimWorld; ++axisIdx)
constraints.setConstraint(velocity0Idx + axisIdx,
momentum0EqIdx + axisIdx,
initCond[velocity0Idx + axisIdx]);

View File

@ -198,7 +198,7 @@ public:
*/
template <class Context>
void boundary(BoundaryRateVector &values, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
@ -225,8 +225,8 @@ public:
* \copydoc FvBaseProblem::initial
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx,
int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
@ -259,7 +259,7 @@ public:
Scalar rho = 1.189;
Scalar pressure = 1e5 - rho * this->gravity()[1] * y;
for (int axisIdx = 0; axisIdx < dimWorld; ++axisIdx)
for (unsigned axisIdx = 0; axisIdx < dimWorld; ++axisIdx)
values[velocity0Idx + axisIdx] = velocity[axisIdx];
values[pressureIdx] = pressure;
@ -274,8 +274,8 @@ public:
* is 0 everywhere.
*/
template <class Context>
void source(RateVector &rate, const Context &context, int spaceIdx,
int timeIdx) const
void source(RateVector &rate, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ rate = Scalar(0.0); }
/*!
@ -286,7 +286,7 @@ public:
*/
template <class Context>
void constraints(Constraints &constraints, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const auto &pos = context.pos(spaceIdx, timeIdx);
@ -302,7 +302,7 @@ public:
constraints.setConstraint(moleFrac1Idx, conti0EqIdx + 1,
initCond[moleFrac1Idx]);
;
for (int axisIdx = 0; axisIdx < dimWorld; ++axisIdx)
for (unsigned axisIdx = 0; axisIdx < dimWorld; ++axisIdx)
constraints.setConstraint(velocity0Idx + axisIdx,
momentum0EqIdx + axisIdx,
initCond[momentum0EqIdx + axisIdx]);

View File

@ -174,7 +174,7 @@ public:
* This problem assumes a constant temperature of 10 degrees Celsius.
*/
template <class Context>
Scalar temperature(const Context &context, int spaceIdx, int timeIdx) const
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ return 273.15 + 10; } // -> 10 deg C
//! \}
@ -193,7 +193,7 @@ public:
*/
template <class Context>
void boundary(BoundaryRateVector &values, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
@ -233,8 +233,8 @@ public:
* \copydoc FvBaseProblem::initial
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx,
int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{
const auto &pos = context.pos(spaceIdx, timeIdx);
@ -251,7 +251,7 @@ public:
DimVector velocity(0.0);
velocity[0] = a * y * y + b * y + c;
for (int axisIdx = 0; axisIdx < dimWorld; ++axisIdx)
for (unsigned axisIdx = 0; axisIdx < dimWorld; ++axisIdx)
values[velocity0Idx + axisIdx] = velocity[axisIdx];
values[pressureIdx] = 1e5;
}
@ -263,8 +263,8 @@ public:
* is 0 everywhere.
*/
template <class Context>
void source(RateVector &rate, const Context &context, int spaceIdx,
int timeIdx) const
void source(RateVector &rate, const Context &context, unsigned spaceIdx,
unsigned timeIdx) const
{ rate = Scalar(0.0); }
/*!
@ -275,7 +275,7 @@ public:
*/
template <class Context>
void constraints(Constraints &constraints, const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const auto &pos = context.pos(spaceIdx, timeIdx);
@ -286,7 +286,7 @@ public:
constraints.setConstraint(pressureIdx, conti0EqIdx,
initCond[pressureIdx]);
;
for (int axisIdx = 0; axisIdx < dimWorld; ++axisIdx)
for (unsigned axisIdx = 0; axisIdx < dimWorld; ++axisIdx)
constraints.setConstraint(velocity0Idx + axisIdx,
momentum0EqIdx + axisIdx,
initCond[velocity0Idx + axisIdx]);

View File

@ -302,7 +302,7 @@ public:
* permeable than the lower one.
*/
template <class Context>
const DimMatrix &intrinsicPermeability(const Context &context, int spaceIdx, int timeIdx) const
const DimMatrix &intrinsicPermeability(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -314,7 +314,7 @@ public:
* \copydoc FvBaseMultiPhaseProblem::porosity
*/
template <class Context>
Scalar porosity(const Context &context, int spaceIdx, int timeIdx) const
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -328,8 +328,8 @@ public:
*/
template <class Context>
const MaterialLawParams& materialLawParams(const Context &context,
int spaceIdx,
int timeIdx) const
unsigned spaceIdx,
unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -344,7 +344,7 @@ public:
* In this case, we assume the rock-matrix to be granite.
*/
template <class Context>
Scalar heatCapacitySolid(const Context &context, int spaceIdx, int timeIdx) const
Scalar heatCapacitySolid(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{
return
790 // specific heat capacity of granite [J / (kg K)]
@ -356,7 +356,7 @@ public:
*/
template <class Context>
const HeatConductionLawParams&
heatConductionParams(const Context &context, int spaceIdx, int timeIdx) const
heatConductionParams(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
if (isFineMaterial_(pos))
@ -382,7 +382,7 @@ public:
template <class Context>
void boundary(BoundaryRateVector &values,
const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const auto &pos = context.cvCenter(spaceIdx, timeIdx);
assert(onLeftBoundary_(pos) ||
@ -433,7 +433,7 @@ public:
* liquid water and assume hydrostatic pressure.
*/
template <class Context>
void initial(PrimaryVariables &values, const Context &context, int spaceIdx, int timeIdx) const
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{
Opm::CompositionalFluidState<Scalar, FluidSystem> fs;
initialFluidState_(fs, context, spaceIdx, timeIdx);
@ -451,7 +451,7 @@ public:
template <class Context>
void constraints(Constraints &constraints,
const Context &context,
int spaceIdx, int timeIdx) const
unsigned spaceIdx, unsigned timeIdx) const
{
const auto &pos = context.pos(spaceIdx, timeIdx);
@ -468,7 +468,7 @@ public:
*/
template <class Context>
void source(RateVector &rate,
const Context &context, int spaceIdx, int timeIdx) const
const Context &context, unsigned spaceIdx, unsigned timeIdx) const
{ rate = 0; }
//! \}
@ -495,8 +495,8 @@ private:
template <class Context, class FluidState>
void initialFluidState_(FluidState &fs,
const Context &context,
int spaceIdx,
int timeIdx) const
unsigned spaceIdx,
unsigned timeIdx) const
{
const GlobalPosition &pos = context.pos(spaceIdx, timeIdx);
@ -530,18 +530,18 @@ private:
// create a Fluid state which has all phases present
Opm::ImmiscibleFluidState<Scalar, FluidSystem> fs;
fs.setTemperature(293.15);
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
fs.setPressure(phaseIdx, 1.0135e5);
}
typename FluidSystem::ParameterCache paramCache;
paramCache.updateAll(fs);
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
Scalar rho = FluidSystem::density(fs, paramCache, phaseIdx);
fs.setDensity(phaseIdx, rho);
}
for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
Scalar lambdaSaturated;
if (FluidSystem::isLiquid(phaseIdx)) {
Scalar lambdaFluid =

View File

@ -60,7 +60,7 @@ void testQuadrature();
GlobalPosition::field_type f(const GlobalPosition &pos)
{
GlobalPosition::field_type result = 1;
for (int i = 0; i < GlobalPosition::dimension; ++i)
for (unsigned i = 0; i < GlobalPosition::dimension; ++i)
result *= pos[i];
return result;
}
@ -80,10 +80,10 @@ void testIdenityMapping()
foo.setCorners(corners, 8);
std::cout << "testing identity mapping...\n";
int n = 100;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < n; ++j) {
for (int k = 0; k < n; ++k) {
unsigned n = 100;
for (unsigned i = 0; i < n; ++i) {
for (unsigned j = 0; j < n; ++j) {
for (unsigned k = 0; k < n; ++k) {
LocalPosition localPos;
localPos[0] = Scalar(i) / (n - 1);
@ -119,10 +119,10 @@ void writeTetrahedronSubControlVolumes(const Grid &grid)
const auto &eEndIt = gridView.template end<0>();
for (; eIt != eEndIt; ++eIt) {
stencil.update(*eIt);
for (int scvIdx = 0; scvIdx < stencil.numDof(); ++scvIdx) {
for (unsigned scvIdx = 0; scvIdx < stencil.numDof(); ++scvIdx) {
const auto &scvLocalGeom = stencil.subControlVolume(scvIdx).localGeometry();
for (int i = 0; i < scvLocalGeom.numCorners; ++i) {
for (unsigned i = 0; i < scvLocalGeom.numCorners; ++i) {
GlobalPosition pos(
eIt->geometry().global(scvLocalGeom.corner(i)));
gf2.insertVertex(pos);
@ -134,11 +134,11 @@ void writeTetrahedronSubControlVolumes(const Grid &grid)
eIt = gridView.template begin<0>();
for (; eIt != eEndIt; ++eIt) {
stencil.update(*eIt);
for (int scvIdx = 0; scvIdx < stencil.numDof(); ++scvIdx) {
for (unsigned scvIdx = 0; scvIdx < stencil.numDof(); ++scvIdx) {
const auto &scvLocalGeom = stencil.subControlVolume(scvIdx).localGeometry();
std::vector<unsigned int> vertexIndices;
for (int i = 0; i < scvLocalGeom.numCorners; ++i) {
for (unsigned i = 0; i < scvLocalGeom.numCorners; ++i) {
vertexIndices.push_back(cornerOffset);
++cornerOffset;
}
@ -198,10 +198,10 @@ void writeCubeSubControlVolumes(const Grid &grid)
const auto &eEndIt = gridView.template end<0>();
for (; eIt != eEndIt; ++eIt) {
stencil.update(*eIt);
for (int scvIdx = 0; scvIdx < stencil.numDof(); ++scvIdx) {
for (unsigned scvIdx = 0; scvIdx < stencil.numDof(); ++scvIdx) {
const auto &scvLocalGeom = stencil.subControlVolume(scvIdx).localGeometry();
for (int i = 0; i < scvLocalGeom.numCorners; ++i) {
for (unsigned i = 0; i < scvLocalGeom.numCorners; ++i) {
GlobalPosition pos(
eIt->geometry().global(scvLocalGeom.corner(i)));
gf2.insertVertex(pos);
@ -213,11 +213,11 @@ void writeCubeSubControlVolumes(const Grid &grid)
eIt = gridView.template begin<0>();
for (; eIt != eEndIt; ++eIt) {
stencil.update(*eIt);
for (int scvIdx = 0; scvIdx < stencil.numDof(); ++scvIdx) {
for (unsigned scvIdx = 0; scvIdx < stencil.numDof(); ++scvIdx) {
const auto &scvLocalGeom = stencil.subControlVolume(scvIdx).localGeometry();
std::vector<unsigned int> vertexIndices;
for (int i = 0; i < scvLocalGeom.numCorners; ++i) {
for (unsigned i = 0; i < scvLocalGeom.numCorners; ++i) {
vertexIndices.push_back(cornerOffset);
++cornerOffset;
}
@ -313,7 +313,7 @@ void testQuadrature()
stencil.update(*eIt);
// loop over all sub-control volumes
for (int scvIdx = 0; scvIdx < stencil.numDof(); ++scvIdx) {
for (unsigned scvIdx = 0; scvIdx < stencil.numDof(); ++scvIdx) {
const auto &scvLocalGeom = stencil.subControlVolume(scvIdx).localGeometry();
Dune::GeometryType geomType = scvLocalGeom.type();