Skip to content
Snippets Groups Projects
Commit ee0c1c39 authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

[decoupled]

Get rid of some continue statements.
Fix indention.
(corrected and reviewed by mwolff)


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@9586 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 7af6985b
No related branches found
No related tags found
No related merge requests found
...@@ -323,11 +323,9 @@ public: ...@@ -323,11 +323,9 @@ public:
(*j)[0][0] = 1; (*j)[0][0] = 1;
} }
f[i.index()] = 0; f[i.index()] = 0;
continue;
} }
// insert dirichlet and processor boundary conditions
// insert dirichlet ans processor boundary conditions else if (essential[i.index()][0]!=BoundaryConditions::neumann)
if (essential[i.index()][0]!=BoundaryConditions::neumann)
{ {
coliterator endj=(*i).end(); coliterator endj=(*i).end();
for (coliterator j=(*i).begin(); j!=endj; ++j) for (coliterator j=(*i).begin(); j!=endj; ++j)
......
...@@ -101,7 +101,7 @@ public: ...@@ -101,7 +101,7 @@ public:
{ {
case Sw: case Sw:
satI = problem_.variables().cellData(globalIdxI).saturation(wPhaseIdx); satI = problem_.variables().cellData(globalIdxI).saturation(wPhaseIdx);
break; break;
case Sn: case Sn:
satI = problem_.variables().cellData(globalIdxI).saturation(nPhaseIdx); satI = problem_.variables().cellData(globalIdxI).saturation(nPhaseIdx);
break; break;
...@@ -115,31 +115,31 @@ public: ...@@ -115,31 +115,31 @@ public:
for (IntersectionIterator isIt = problem_.gridView().ibegin(*eIt); isIt != isItend; ++isIt) for (IntersectionIterator isIt = problem_.gridView().ibegin(*eIt); isIt != isItend; ++isIt)
{ {
const typename IntersectionIterator::Intersection &intersection = *isIt; const typename IntersectionIterator::Intersection &intersection = *isIt;
// Steige aus, falls es sich nicht um einen Nachbarn handelt // Only consider internal intersections
if (!intersection.neighbor()) if (intersection.neighbor())
continue;
// Greife auf Nachbarn zu
ElementPointer outside = intersection.outside();
int globalIdxJ = problem_.variables().index(*outside);
// Jede Intersection nur von einer Seite betrachten
if (eIt->level() > outside->level() || (eIt->level() == outside->level() && globalIdxI < globalIdxJ))
{ {
Scalar satJ = 0.; // Access neighbor
switch (saturationType_) ElementPointer outside = intersection.outside();
int globalIdxJ = problem_.variables().index(*outside);
// Visit intersection only once
if (eIt->level() > outside->level() || (eIt->level() == outside->level() && globalIdxI < globalIdxJ))
{ {
case Sw: Scalar satJ = 0.;
satJ = problem_.variables().cellData(globalIdxJ).saturation(wPhaseIdx); switch (saturationType_)
break; {
case Sn: case Sw:
satJ = problem_.variables().cellData(globalIdxJ).saturation(nPhaseIdx); satJ = problem_.variables().cellData(globalIdxJ).saturation(wPhaseIdx);
break; break;
case Sn:
satJ = problem_.variables().cellData(globalIdxJ).saturation(nPhaseIdx);
break;
}
Scalar localdelta = std::abs(satI - satJ);
indicatorVector_[globalIdxI][0] = std::max(indicatorVector_[globalIdxI][0], localdelta);
indicatorVector_[globalIdxJ][0] = std::max(indicatorVector_[globalIdxJ][0], localdelta);
} }
Scalar localdelta = std::abs(satI - satJ);
indicatorVector_[globalIdxI][0] = std::max(indicatorVector_[globalIdxI][0], localdelta);
indicatorVector_[globalIdxJ][0] = std::max(indicatorVector_[globalIdxJ][0], localdelta);
} }
} }
} }
......
...@@ -213,29 +213,31 @@ public: ...@@ -213,29 +213,31 @@ public:
for (LeafIterator eIt = problem_.gridView().template begin<0>(); for (LeafIterator eIt = problem_.gridView().template begin<0>();
eIt!=problem_.gridView().template end<0>(); ++eIt) eIt!=problem_.gridView().template end<0>(); ++eIt)
{ {
if (indicator.coarsen(*eIt) && eIt->level() > levelMin_ && problem_.grid().getMark(*eIt) == 0) if (indicator.coarsen(*eIt)
&& eIt->level() > levelMin_
&& problem_.grid().getMark(*eIt) == 0
&& coarsenMarker[idSet.id(*(eIt->father()))] == eIt->geometry().corners())
{ {
if (coarsenMarker[idSet.id(*(eIt->father()))] == eIt->geometry().corners())
{
// check if coarsening is possible // check if coarsening is possible
bool coarsenPossible = true; bool coarsenPossible = true;
LeafIntersectionIterator isend = problem_.gridView().iend(*eIt); LeafIntersectionIterator isend = problem_.gridView().iend(*eIt);
for(LeafIntersectionIterator is = problem_.gridView().ibegin(*eIt); is != isend; ++is) for(LeafIntersectionIterator is = problem_.gridView().ibegin(*eIt); is != isend; ++is)
{ {
if(!is->neighbor()) if(is->neighbor())
continue; {
ElementPointer outside = is->outside();
ElementPointer outside = is->outside(); if ((problem_.grid().getMark(*outside) > 0)
if ((problem_.grid().getMark(*outside) > 0) || outside.level()>eIt.level()))
|| (outside.level()>eIt.level())) {
coarsenPossible = false; coarsenPossible = false;
}
}
} }
if(coarsenPossible) if(coarsenPossible)
{ {
problem_.grid().mark( -1, *eIt ); problem_.grid().mark( -1, *eIt );
++coarsened_; ++coarsened_;
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment