Commit 1153b376 authored by Andreas Lauser's avatar Andreas Lauser
Browse files

box models: move the status output message for partial reassembly to the jacobianassembler

also, the "real" work which needs to be done, i.e. the elements to be
reassembled is printed instead of the "red" vertices

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@4065 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 177c9fce
......@@ -221,6 +221,11 @@ SET_TYPE_PROP(BoxTwoP, FluidSystem, FluidSystem2P<TypeTag>);
SET_TYPE_PROP(BoxTwoP, FluidState, TwoPFluidState<TypeTag>);
// enable jacobian matrix recycling by default
SET_BOOL_PROP(BoxTwoP, EnableJacobianRecycling, true);
// enable partial reassembling by default
SET_BOOL_PROP(BoxTwoP, EnablePartialReassemble, true);
// \}
}
......
......@@ -270,6 +270,11 @@ public:
typedef TwoPTwoCIndices<TypeTag, Formulation, 0> type;
};
// enable jacobian matrix recycling by default
SET_BOOL_PROP(BoxTwoPTwoC, EnableJacobianRecycling, true);
// enable partial reassembling by default
SET_BOOL_PROP(BoxTwoPTwoC, EnablePartialReassemble, true);
// \}
}
......
......@@ -161,6 +161,18 @@ public:
<< timeManager().timeStepSize());
}
/*!
* \brief Returns the newton contoller object
*/
NewtonController &newtonController()
{ return newtonCtl_; }
/*!
* \copydoc newtonController()
*/
const NewtonController &newtonController() const
{ return newtonCtl_; }
/*!
* \brief Called by Dumux::TimeManager whenever a solution for a
* timestep has been computed and the simulation time has
......
......@@ -368,9 +368,9 @@ public:
SET_PROP(BoxModel, LocalOperator)
{ typedef typename GET_PROP(TypeTag, PTAG(GridOperatorSpace))::LocalOperator type; };
// enable jacobian matrix recycling by default
SET_BOOL_PROP(BoxModel, EnableJacobianRecycling, true);
// enable partial reassembling by default
// disable jacobian matrix recycling by default
SET_BOOL_PROP(BoxModel, EnableJacobianRecycling, false);
// disable partial reassembling by default
SET_BOOL_PROP(BoxModel, EnablePartialReassemble, false);
// \}
......
......@@ -255,13 +255,11 @@ public:
}
// Mark all yellow elements
int numReassemble = 0;
int numGreen = 0;
elemIt = gridView_().template begin<0>();
for (; elemIt != elemEndIt; ++elemIt) {
int elemIdx = this->elementMapper_().map(*elemIt);
if (elementColor_[elemIdx] == Red) {
++ numReassemble;
continue; // element is red already!
}
......@@ -270,22 +268,24 @@ public:
for (int i=0; i < numVerts; ++i) {
int globalI = vertexMapper_().map(*elemIt, i, dim);
if (vertexColor_[globalI] == Yellow) {
++ numReassemble;
isYellow = true;
break;
}
};
if (isYellow) {
++ isYellow;
elementColor_[elemIdx] = Yellow;
}
if (elementColor_[elemIdx] == Green)
else // elementColor_[elemIdx] == Green
++ numGreen;
}
}
int numTot = gridView_().size(0);
problem_().newtonController().endIterMsg()
<< ", reassemble "
<< numTot - numGreen << "/" << numTot
<< " (" << 100*Scalar(numTot - numGreen)/numTot << "%) elems";
};
int vertexColor(const Element &element, int vertIdx) const
{
......
......@@ -234,7 +234,7 @@ public:
return true; // we always do at least two iterations
else if (numSteps_ >= maxSteps_) {
// we have exceeded the allowed number of steps. if the
// relative error was reduced by a factor of at least 5,
// relative error was reduced by a factor of at least 4,
// we proceed even if we are above the maximum number of
// steps
return error_*4.0 < lastError_ && !asImp_().newtonConverged();
......@@ -293,7 +293,6 @@ public:
int idxI = -1;
int idxJ = -1;
int numReassemble = 0;
for (int i = 0; i < int(uOld.size()); ++i) {
bool needReassemble = false;
for (int j = 0; j < FV::size; ++j) {
......@@ -312,17 +311,11 @@ public:
}
}
if (needReassemble) {
++ numReassemble;
}
model_().jacobianAssembler().markVertexRed(i,
needReassemble);
}
model_().jacobianAssembler().computeColors();
endIterMsg() << ", red vertices: " << numReassemble << "/" << uOld.size();
error_ = gridView_().comm().max(error_);
}
......
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