Commit 96d4410f authored by Christoph Grueninger's avatar Christoph Grueninger
Browse files

[cleanup] Whitespace cleanup in dumux/decoupled.

- remove trailing whitespace
- replace tabs by spaces
- remove pointless returns
- remove superfluous semicolons
- use an auto
(reviewed by fetzer)


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@14999 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 426a6713
......@@ -89,8 +89,8 @@ public:
template<class MultiWriter>
void addOutputVtkFields(MultiWriter &writer)
{
ParentType::addOutputVtkFields(writer);
velocity_.addOutputVtkFields(writer);
ParentType::addOutputVtkFields(writer);
velocity_.addOutputVtkFields(writer);
}
//! Constructs a FVPressure1P object
......
......@@ -91,7 +91,7 @@ namespace Dumux
* In the IMPES models the default setting is:
*
* - formulation: \f$ p_w-S_w \f$ (Property: \a Formulation defined as \a DecoupledTwoPCommonIndices::pwsw)
*
*
* - compressibility: disabled (Property: \a EnableCompressibility set to \a false)
*
* \tparam TypeTag The Type Tag
......@@ -285,8 +285,7 @@ public:
/*! \brief Velocity update
*
* Reset the velocities in the cellData
*
* Reset the velocities in the cellData
*/
void updateVelocity()
{
......@@ -301,9 +300,7 @@ public:
}
}
/*! \brief Globally stores the pressure solution
*
*/
//! \brief Globally stores the pressure solution
void storePressureSolution()
{
// iterate through leaf grid
......
......@@ -133,30 +133,30 @@ public:
// update RHS vector, matrix
if (problem_.gridAdapt().wasAdapted())
{
this->A_.setSize(gridSize, gridSize); //
this->f_.resize(gridSize);
this->pressure().resize(gridSize);
for (int i = 0; i < gridSize; i++)
{
CellData& cellData = problem_.variables().cellData(i);
switch (pressureType_)
{
case pw:
this->pressure()[i] = cellData.pressure(wPhaseIdx);
break;
case pn:
this->pressure()[i] = cellData.pressure(nPhaseIdx);
break;
case pGlobal:
this->pressure()[i] = cellData.globalPressure();
break;
}
}
ParentType::initializeMatrix();
this->A_.setSize(gridSize, gridSize); //
this->f_.resize(gridSize);
this->pressure().resize(gridSize);
for (int i = 0; i < gridSize; i++)
{
CellData& cellData = problem_.variables().cellData(i);
switch (pressureType_)
{
case pw:
this->pressure()[i] = cellData.pressure(wPhaseIdx);
break;
case pn:
this->pressure()[i] = cellData.pressure(nPhaseIdx);
break;
case pGlobal:
this->pressure()[i] = cellData.globalPressure();
break;
}
}
ParentType::initializeMatrix();
}
......@@ -172,7 +172,7 @@ public:
*/
void calculateVelocity()
{
velocity_.calculateVelocity();
velocity_.calculateVelocity();
}
/*! \brief Velocity update
......
......@@ -78,8 +78,8 @@ public:
template<class MultiWriter>
void addOutputVtkFields(MultiWriter &writer)
{
ParentType::addOutputVtkFields(writer);
velocity_.addOutputVtkFields(writer);
ParentType::addOutputVtkFields(writer);
velocity_.addOutputVtkFields(writer);
}
//! Constructs a FVPressure2P object
......
......@@ -293,7 +293,7 @@ public:
//switch velocities
if (velocityType_ == vt)
{
writer.attachCellData(velocity, "total velocity", dim);
writer.attachCellData(velocity, "total velocity", dim);
}
else
{
......
......@@ -843,7 +843,7 @@ void FvMpfaL2dPressure2p<TypeTag>::storeInteractionVolumeInfo()
// *((*eIt).template subEntity < dim > (localVertIdx12corner)));
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4)
int globalVertIdx12corner = problem_.variables().vertexMapper().subIndex(*eIt, localVertIdx12corner, dim);
#else
#else
int globalVertIdx12corner = problem_.variables().vertexMapper().map(*eIt, localVertIdx12corner, dim);
#endif
// std::cout<<"globalVertIdx12corner = "<<globalVertIdx12corner<<"\n";
......@@ -1934,7 +1934,7 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble()
{
if (eIt->partitionType() == Dune::InteriorEntity)
continue;
// get the global index of the cell
int eIdxGlobalI = problem_.variables().index(*eIt);
......@@ -1943,7 +1943,7 @@ void FvMpfaL2dPressure2p<TypeTag>::assemble()
this->f_[eIdxGlobalI] = this->pressure()[eIdxGlobalI];
}
}
return;
}
......
......@@ -464,7 +464,7 @@ public:
{
DUNE_THROW(Dune::NotImplemented, "Compressibility not supported!");
}
#endif
#endif
if (dim != 2)
{
DUNE_THROW(Dune::NotImplemented, "Dimension not supported!");
......@@ -2620,7 +2620,7 @@ void FvMpfaL2dPressure2pAdaptive<TypeTag>::assemble()
{
if (eIt->partitionType() == Dune::InteriorEntity)
continue;
// get the global index of the cell
int eIdxGlobalI = problem_.variables().index(*eIt);
......
......@@ -141,8 +141,8 @@ public:
}
//calculate velocities for flux faces of an interaction volume
void calculateInnerInteractionVolumeVelocity(InteractionVolume& interactionVolume,
CellData& cellData1, CellData& cellData2, CellData& cellData3, CellData& cellData4,
void calculateInnerInteractionVolumeVelocity(InteractionVolume& interactionVolume,
CellData& cellData1, CellData& cellData2, CellData& cellData3, CellData& cellData4,
InnerBoundaryVolumeFaces& innerBoundaryVolumeFaces);
void calculateBoundaryInteractionVolumeVelocity(InteractionVolume& interactionVolume,
CellData& cellData, int elemIdx);
......@@ -180,10 +180,10 @@ public:
{
if (vtkOutputLevel_ > 0)
{
Dune::BlockVector < DimVector > &velocityWetting
= *(writer.template allocateManagedBuffer<Scalar,dim>(problem_.gridView().size(0)));
Dune::BlockVector < DimVector > &velocityNonwetting
= *(writer.template allocateManagedBuffer<Scalar,dim>(problem_.gridView().size(0)));
Dune::BlockVector < DimVector > &velocityWetting
= *(writer.template allocateManagedBuffer<Scalar,dim>(problem_.gridView().size(0)));
Dune::BlockVector < DimVector > &velocityNonwetting
= *(writer.template allocateManagedBuffer<Scalar,dim>(problem_.gridView().size(0)));
// compute update vector
ElementIterator eEndIt = problem_.gridView().template end<0>();
......
......@@ -2006,7 +2006,7 @@ void FvMpfaO2dPressure2p<TypeTag>::assemble()
{
if (eIt->partitionType() == Dune::InteriorEntity)
continue;
// get the global index of the cell
int eIdxGlobalI = problem_.variables().index(*eIt);
......
......@@ -157,7 +157,7 @@ public:
// std::cout << "increment row " << index << std::endl;
}
A_.incrementrowsize(index, numFaces - 1);
// std::cout << "increment row " << index
// std::cout << "increment row " << index
// << " by " << numFaces - 1 << std::endl;
}
}
......@@ -329,7 +329,7 @@ public:
int alpha = faceMapper_.subIndex(*eIt, k, 1);
#else
int alpha = faceMapper_.map(*eIt, k, 1);
#endif
#endif
local2Global[k] = alpha;
}
loc.completeRHS(*eIt, local2Global, f);
......
......@@ -312,9 +312,9 @@ public:
vel += W_[eIdxGlobal][fIdx][j]*faceVol[j]*(press - pressTrace[j]);
}
void computeReconstructionMatrices(const Element& element,
const Dune::FieldMatrix<Scalar, 2 * dim, 2 * dim>& W,
Dune::FieldVector<Scalar, 2 * dim>& F, Scalar& dInv)
void computeReconstructionMatrices(const Element& element,
const Dune::FieldMatrix<Scalar, 2 * dim, 2 * dim>& W,
Dune::FieldVector<Scalar, 2 * dim>& F, Scalar& dInv)
{
Dune::FieldVector<Scalar, 2 * dim> c(0);
Dune::FieldMatrix<Scalar, 2 * dim, 2 * dim> Pi(0);
......
......@@ -597,7 +597,7 @@ public:
indicatorVectorSat_.resize(size, -1e100);
if (useFluxInd_)
indicatorVectorFlux_.resize(size, -1e100);
};
}
/*! \brief Function for changing the indicatorVector values for refinement
*
......
......@@ -48,7 +48,8 @@ private:
public:
//! For initialization
void initialize(){};
void initialize()
{}
/*! \brief Returns convective term for current element face
* \param intersection Intersection of two grid elements/global boundary
......@@ -70,8 +71,8 @@ public:
void getFlux(DimVector& flux, const Intersection& intersection, const Scalar satI, const Scalar satJ) const
{}
//! Constructs a ConvectivePart object
/*
/*! Constructs a ConvectivePart object
*
* \param problem A problem class object
*/
ConvectivePart(Problem& problem)
......
......@@ -47,7 +47,8 @@ private:
public:
//! For initialization
void initialize(){};
void initialize()
{}
/*! \brief Returns diffusive term for current element face
*
......@@ -87,9 +88,8 @@ public:
Scalar satI, Scalar satJ) const
{}
//! Constructs a DiffusivePart object
/*
/*! Constructs a DiffusivePart object
*
* \param A problem class object
*/
DiffusivePart(Problem& problem)
......
......@@ -59,7 +59,8 @@ private:
public:
//! For initialization
void initialize(){};
void initialize()
{}
/*! \brief adds a flux to the cfl-criterion evaluation
*
......
......@@ -25,7 +25,7 @@
*/
#include <dune/common/float_cmp.hh>
#include <dumux/decoupled/common/impetproperties.hh>
#include <dumux/decoupled/common/impetproperties.hh>
#include "evalcflflux.hh"
namespace Dumux
......@@ -127,10 +127,10 @@ public:
*/
Scalar getCflFluxFunction(const Element& element)
{
Scalar cflFluxDefault = getCflFluxFunctionDefault();
Scalar cflFluxDefault = getCflFluxFunctionDefault();
if (rejectForTimeStepping_)
return 0.99 / cflFluxDefault;
return 0.99 / cflFluxDefault;
if (std::isnan(cflFluxFunctionCoatsOut_) || std::isinf(cflFluxFunctionCoatsOut_)){cflFluxFunctionCoatsOut_ = 0.0;}
if (std::isnan(cflFluxFunctionCoatsIn_) || std::isinf(cflFluxFunctionCoatsIn_)){cflFluxFunctionCoatsIn_ = 0.0;}
......@@ -143,7 +143,7 @@ public:
}
else if (cflFluxDefault > cflFluxFunctionCoats)
{
return 0.99 / cflFluxDefault;
return 0.99 / cflFluxDefault;
}
else
{
......@@ -478,7 +478,7 @@ void EvalCflFluxCoats<TypeTag>::addCoatsFlux(Scalar& lambdaW, Scalar& lambdaNw,
}
else
{
cflFluxFunctionCoatsIn_ += cflFlux;
cflFluxFunctionCoatsIn_ += cflFlux;
}
}
else
......@@ -502,11 +502,11 @@ void EvalCflFluxCoats<TypeTag>::addCoatsFlux(Scalar& lambdaW, Scalar& lambdaNw,
Dune::FieldVector<Scalar, dim> permeability(0);
DimMatrix perm(0);
problem_.spatialParams().meanK(perm, problem_.spatialParams().intrinsicPermeability(*element));
perm.mv(unitOuterNormal, permeability);
Scalar faceArea = intersection.geometry().volume();
perm.mv(unitOuterNormal, permeability);
Scalar transmissibility = (unitOuterNormal * permeability) * faceArea / dist;
Scalar faceArea = intersection.geometry().volume();
Scalar transmissibility = (unitOuterNormal * permeability) * faceArea / dist;
Scalar satWBound = cellDataI.saturation(wPhaseIdx);
if (bcType.isDirichlet(eqIdxSat))
......@@ -515,90 +515,88 @@ void EvalCflFluxCoats<TypeTag>::addCoatsFlux(Scalar& lambdaW, Scalar& lambdaNw,
problem_.dirichlet(bcValues, intersection);
switch (saturationType_)
{
case sw:
case sw:
{
satWBound = bcValues[eqIdxSat];
break;
}
case sn:
case sn:
{
satWBound = 1 - bcValues[eqIdxSat];
break;
}
default:
default:
{
DUNE_THROW(Dune::RangeError, "saturation type not implemented");
break;
}
}
}
Scalar potWBound = cellDataI.potential(wPhaseIdx);
Scalar potNwBound = cellDataI.potential(nPhaseIdx);
Scalar gdeltaZ = (problem_.bBoxMax()-globalPosFace) * problem_.gravity();
if (bcType.isDirichlet(eqIdxPress))
{
PrimaryVariables bcValues;
problem_.dirichlet(bcValues, intersection);
switch (pressureType_)
{
case pw:
{
potWBound = bcValues[eqIdxPress] + density_[wPhaseIdx] * gdeltaZ;
potNwBound = bcValues[eqIdxPress] + MaterialLaw::pc(problem_.spatialParams().materialLawParams(*element), satWBound)
+ density_[nPhaseIdx] * gdeltaZ;
break;
}
case pn:
{
potWBound = bcValues[eqIdxPress] - MaterialLaw::pc(problem_.spatialParams().materialLawParams(*element),satWBound)
+ density_[wPhaseIdx] * gdeltaZ;
potNwBound = bcValues[eqIdxPress] + density_[nPhaseIdx] * gdeltaZ;
break;
}
default:
{
DUNE_THROW(Dune::RangeError, "pressure type not implemented");
break;
}
}
}
else if (bcType.isNeumann(eqIdxPress) && bcType.isDirichlet(eqIdxSat))
{
PrimaryVariables bcValues;
problem_.neumann(bcValues, intersection);
bcValues[wPhaseIdx] /= density_[wPhaseIdx];
bcValues[nPhaseIdx] /= density_[nPhaseIdx];
bcValues[wPhaseIdx] *= faceArea;
bcValues[nPhaseIdx] *= faceArea;
bool hasPotWBound = false;
if (Dune::FloatCmp::ne<Scalar, Dune::FloatCmp::absolute>(lambdaW, 0.0, 1.0e-30) && Dune::FloatCmp::ne<Scalar, Dune::FloatCmp::absolute>(bcValues[wPhaseIdx], 0.0, 1.0e-30))
{
potWBound -= bcValues[wPhaseIdx] / (transmissibility * lambdaW);
hasPotWBound = true;
}
bool hasPotNwBound = false;
if (Dune::FloatCmp::ne<Scalar, Dune::FloatCmp::absolute>(lambdaNw, 0.0, 1.0e-30) && Dune::FloatCmp::ne<Scalar, Dune::FloatCmp::absolute>(bcValues[nPhaseIdx], 0.0, 1.0e-30))
{
potNwBound -= bcValues[nPhaseIdx] / (transmissibility * lambdaNw);
hasPotNwBound = true;
}
if (hasPotWBound && !hasPotNwBound)
{
potNwBound = potWBound + MaterialLaw::pc(problem_.spatialParams().materialLawParams(*element),satWBound)
+ (density_[nPhaseIdx] - density_[wPhaseIdx]) * gdeltaZ;
}
else if (!hasPotWBound && hasPotNwBound)
{
Scalar potNwBound = cellDataI.potential(nPhaseIdx);
Scalar gdeltaZ = (problem_.bBoxMax()-globalPosFace) * problem_.gravity();
if (bcType.isDirichlet(eqIdxPress))
{
PrimaryVariables bcValues;
problem_.dirichlet(bcValues, intersection);
switch (pressureType_)
{
case pw:
{
potWBound = bcValues[eqIdxPress] + density_[wPhaseIdx] * gdeltaZ;
potNwBound = bcValues[eqIdxPress] + MaterialLaw::pc(problem_.spatialParams().materialLawParams(*element), satWBound)
+ density_[nPhaseIdx] * gdeltaZ;
break;
}
case pn:
{
potWBound = bcValues[eqIdxPress] - MaterialLaw::pc(problem_.spatialParams().materialLawParams(*element),satWBound)
+ density_[wPhaseIdx] * gdeltaZ;
potNwBound = bcValues[eqIdxPress] + density_[nPhaseIdx] * gdeltaZ;
break;
}
default:
{
DUNE_THROW(Dune::RangeError, "pressure type not implemented");
}
}
}
else if (bcType.isNeumann(eqIdxPress) && bcType.isDirichlet(eqIdxSat))
{
PrimaryVariables bcValues;
problem_.neumann(bcValues, intersection);
bcValues[wPhaseIdx] /= density_[wPhaseIdx];
bcValues[nPhaseIdx] /= density_[nPhaseIdx];
bcValues[wPhaseIdx] *= faceArea;
bcValues[nPhaseIdx] *= faceArea;
bool hasPotWBound = false;
if (Dune::FloatCmp::ne<Scalar, Dune::FloatCmp::absolute>(lambdaW, 0.0, 1.0e-30) && Dune::FloatCmp::ne<Scalar, Dune::FloatCmp::absolute>(bcValues[wPhaseIdx], 0.0, 1.0e-30))
{
potWBound -= bcValues[wPhaseIdx] / (transmissibility * lambdaW);
hasPotWBound = true;
}
bool hasPotNwBound = false;
if (Dune::FloatCmp::ne<Scalar, Dune::FloatCmp::absolute>(lambdaNw, 0.0, 1.0e-30) && Dune::FloatCmp::ne<Scalar, Dune::FloatCmp::absolute>(bcValues[nPhaseIdx], 0.0, 1.0e-30))
{
potNwBound -= bcValues[nPhaseIdx] / (transmissibility * lambdaNw);
hasPotNwBound = true;
}
if (hasPotWBound && !hasPotNwBound)
{
potNwBound = potWBound + MaterialLaw::pc(problem_.spatialParams().materialLawParams(*element),satWBound)
+ (density_[nPhaseIdx] - density_[wPhaseIdx]) * gdeltaZ;
}
else if (!hasPotWBound && hasPotNwBound)
{
potWBound = potNwBound - MaterialLaw::pc(problem_.spatialParams().materialLawParams(*element),satWBound)
+ (density_[nPhaseIdx] - density_[wPhaseIdx]) * gdeltaZ;
}
}
+ (density_[nPhaseIdx] - density_[wPhaseIdx]) * gdeltaZ;
}
}
else if (bcType.isNeumann(eqIdxPress))
{
PrimaryVariables bcValues;
......@@ -720,7 +718,7 @@ void EvalCflFluxCoats<TypeTag>::addCoatsFlux(Scalar& lambdaW, Scalar& lambdaNw,
}
else
{
cflFluxFunctionCoatsIn_ += cflFlux;
cflFluxFunctionCoatsIn_ += cflFlux;
}
}
}
......
......@@ -24,7 +24,7 @@
* @brief Fluxes to evaluate a CFL-Condition
*/
#include <dumux/decoupled/common/impetproperties.hh>
#include <dumux/decoupled/common/impetproperties.hh>
#include "evalcflflux.hh"
namespace Dumux
......
......@@ -64,7 +64,7 @@ namespace Dumux
* In the IMPES models the default setting is:
*
* formulation: \f$ p_w \f$ - \f$ S_w \f$ (Property: \a Formulation defined as \a DecoupledTwoPCommonIndices::pwsw)
*
*
* compressibility: disabled (Property: \a EnableCompressibility set to \a false)
*
* \tparam TypeTag The Type Tag
......@@ -251,7 +251,7 @@ public:
template<class DataEntry>
bool inPhysicalRange(DataEntry& entry)
{
return (entry > -1e-6 && entry < 1.0 + 1e-6);
return (entry > -1e-6 && entry < 1.0 + 1e-6);
}
/*! \brief Updates the primary transport variable.
......@@ -260,10 +260,10 @@ public:
*/
void updateTransportedQuantity(TransportSolutionType& updateVec)
{
if (this->enableLocalTimeStepping())
this->innerUpdate(updateVec);
else
updateSaturationSolution(updateVec);
if (this->enableLocalTimeStepping())
this->innerUpdate(updateVec);
else
updateSaturationSolution(updateVec);
}
/*! \brief Updates the primary transport variable.
......
......@@ -76,7 +76,7 @@ public:
return sw_;
else
return Scalar(1.0) - sw_;
};
}
/*!
* \brief Returns the mass fraction of a component in a phase.
......@@ -156,7 +156,7 @@ public:
* and the rock matrix exhibit the same temperature.
*/
Scalar temperature(int phaseIdx = 0) const
{ return temperature_; };
{ return temperature_; }
/*!
* \brief Return the average molar ma