Commit db832afb authored by Katherina Baber's avatar Katherina Baber
Browse files

timemanager: minor changes necessary to run models with long double

pdelabpreconditionner: usse LoopSolver with Pardiso
boxfvelementgeometry: change vert into scvIdx


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@4213 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 78e74e2f
......@@ -303,6 +303,7 @@ class BoxFVElementGeometry
enum{maxBF = (dim < 3 ? 8 : 24)};
typedef typename GET_PROP_TYPE(TypeTag, PTAG(Scalar)) Scalar;
typedef typename Grid::ctype CoordScalar;
//typedef Scalar CoordScalar;
typedef typename GridView::Traits::template Codim<0>::Entity Element;
typedef typename Element::Geometry Geometry;
typedef Dune::FieldVector<CoordScalar,dim> FV;
......@@ -768,62 +769,59 @@ public:
}
if (computeGradientAtScvCenters)
{
// calculate gradients at the center of the scv
for (int vert = 0; vert < numVertices; vert++)
for (int scvIdx = 0; scvIdx < numVertices; scvIdx++)
if (dim == 2)
{
if (!subContVol[vert].inner)
// if (!subContVol[scvIdx].inner)
{
switch (vert)
switch (scvIdx)
{
case 0:
if (numVertices == 4) {
subContVol[vert].localCenter[0] = 0.25;
subContVol[vert].localCenter[1] = 0.25;
subContVol[scvIdx].localCenter[0] = 0.25;
subContVol[scvIdx].localCenter[1] = 0.25;
}
else {
subContVol[vert].localCenter[0] = 1.0/6.0;
subContVol[vert].localCenter[1] = 1.0/6.0;
subContVol[scvIdx].localCenter[0] = 1.0/6.0;
subContVol[scvIdx].localCenter[1] = 1.0/6.0;
}
break;
case 1:
if (numVertices == 4) {
subContVol[vert].localCenter[0] = 0.75;
subContVol[vert].localCenter[1] = 0.25;
subContVol[scvIdx].localCenter[0] = 0.75;
subContVol[scvIdx].localCenter[1] = 0.25;
}
else {
subContVol[vert].localCenter[0] = 4.0/6.0;
subContVol[vert].localCenter[1] = 1.0/6.0;
subContVol[scvIdx].localCenter[0] = 4.0/6.0;
subContVol[scvIdx].localCenter[1] = 1.0/6.0;
}
break;
case 2:
if (numVertices == 4) {
subContVol[vert].localCenter[0] = 0.25;
subContVol[vert].localCenter[1] = 0.75;
subContVol[scvIdx].localCenter[0] = 0.25;
subContVol[scvIdx].localCenter[1] = 0.75;
}
else {
subContVol[vert].localCenter[0] = 1.0/6.0;
subContVol[vert].localCenter[1] = 4.0/6.0;
subContVol[scvIdx].localCenter[0] = 1.0/6.0;
subContVol[scvIdx].localCenter[1] = 4.0/6.0;
}
break;
case 3:
subContVol[vert].localCenter[0] = 0.75;
subContVol[vert].localCenter[1] = 0.75;
subContVol[scvIdx].localCenter[0] = 0.75;
subContVol[scvIdx].localCenter[1] = 0.75;
break;
}
}
std::vector<ShapeJacobian> localJac;
localFiniteElement.localBasis().evaluateJacobian(subContVol[vert].localCenter, localJac);
localFiniteElement.localBasis().evaluateJacobian(subContVol[scvIdx].localCenter, localJac);
Dune::FieldMatrix<CoordScalar,dim,dim> jacInvT =
geometry.jacobianInverseTransposed(subContVol[vert].localCenter);
geometry.jacobianInverseTransposed(subContVol[scvIdx].localCenter);
for (int vert = 0; vert < numVertices; vert++)
jacInvT.mv(localJac[vert][0], subContVol[vert].gradCenter[vert]);
jacInvT.mv(localJac[vert][0], subContVol[scvIdx].gradCenter[vert]);
}
}
}
};
......
......@@ -459,7 +459,8 @@ public:
// PRICH prich(gfs,phelper);
int verb=0;
if (gfs.gridview().comm().rank()==0) verb=verbose;
Dune::BiCGSTABSolver<SolVector> solver(pop,psp,parPreCond,reduction,maxiter,verb);
Dune::LoopSolver<SolVector> solver(pop,psp,parPreCond,reduction,maxiter,verb);
// Dune::BiCGSTABSolver<SolVector> solver(pop,psp,parPreCond,reduction,maxiter,verb);
Dune::InverseOperatorResult stat;
solver.apply(z,r,stat);
res.converged = stat.converged;
......
......@@ -209,7 +209,7 @@ public:
return
std::min(episodeMaxTimeStepSize(),
std::max(0.0, endTime() - time()));
std::max<Scalar>(0.0, endTime() - time()));
};
/*
......@@ -301,8 +301,8 @@ public:
// make sure that we don't exceed the end of the
// current episode.
return
std::max(0.0,
episodeLength() - (time() - episodeStartTime()));
std::max<Scalar>(0.0,
episodeLength() - (time() - episodeStartTime()));
};
/*
......
Supports Markdown
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