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

necessary changes for the modelcoupling ff+pm

set outflow boundary conditions for single equations
function evalPDELab does update of residual with solution vector from
PDELab at the interface


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@4696 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 2f8829a7
......@@ -145,6 +145,40 @@ public:
asImp_().eval(element, fvElemGeom_(), volVarsPrev, volVarsCur, bcTypes);
}
/*!
* \brief Compute the local residual, i.e. the deviation of the
* equations from zero. Gets a solution vector computed by PDELab
*
* \param element The DUNE Codim<0> entity for which the residual
* ought to be calculated
* \param elementSolVector The local solution for the element using PDELab ordering
*/
template<typename ElemSolVectorType>
void evalPDELab(const Element &element, const ElemSolVectorType& elementSolVector)
{
FVElementGeometry fvGeom;
fvGeom.update(gridView_(), element);
ElementVolumeVariables volVarsPrev, volVarsCur;
volVarsPrev.update(problem_(),
element,
fvGeom,
true /* oldSol? */);
volVarsCur.updatePDELab(problem_(),
element,
fvGeom,
elementSolVector);
ElementBoundaryTypes bcTypes;
bcTypes.update(problem_(), element, fvGeom);
// this is pretty much a HACK because the internal state of
// the problem is not supposed to be changed during the
// evaluation of the residual. (Reasons: It is a violation of
// abstraction, makes everything more prone to errors and is
// not thread save.) The real solution are context objects!
problem_().updateCouplingParams(element);
asImp_().eval(element, fvGeom, volVarsPrev, volVarsCur, bcTypes);
}
/*!
* \brief Compute the storage term for the current solution.
......
......@@ -234,6 +234,36 @@ public:
Valgrind::SetDefined(boundaryInfo_[eqIdx]);
}
/*!
* \brief Set a boundary condition for a single equation to coupling inflow.
*/
void setCouplingInflow(int eqIdx)
{
boundaryInfo_[eqIdx].visited = 1;
boundaryInfo_[eqIdx].isDirichlet = 0;
boundaryInfo_[eqIdx].isNeumann = 0;
boundaryInfo_[eqIdx].isOutflow = 0;
boundaryInfo_[eqIdx].isCouplingInflow = 1;
boundaryInfo_[eqIdx].isCouplingOutflow = 0;
Valgrind::SetDefined(boundaryInfo_[eqIdx]);
}
/*!
* \brief Set a boundary condition for a single equation to coupling outflow.
*/
void setCouplingOutflow(int eqIdx)
{
boundaryInfo_[eqIdx].visited = 1;
boundaryInfo_[eqIdx].isDirichlet = 0;
boundaryInfo_[eqIdx].isNeumann = 0;
boundaryInfo_[eqIdx].isOutflow = 0;
boundaryInfo_[eqIdx].isCouplingInflow = 1;
boundaryInfo_[eqIdx].isCouplingOutflow = 0;
Valgrind::SetDefined(boundaryInfo_[eqIdx]);
}
/*!
* \brief Set a dirichlet boundary condition for a single primary
* variable.
......
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