Commit c29d9e1b authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

[multidomain] introduce a property for SplitAndMerge

The routines for splitting and merging multidomain and subdomain
solution vectors have been hardcoded. Introducing a property enhances
the flexibility. For example, if one of the subdomain models is itself a
PDELab model, a different SplitAndMerge mechanism is required.

Reviewed by Dennis.



git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@14201 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent 35b5f9e6
......@@ -44,6 +44,7 @@ struct MultiDomainConvergenceWriter
typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem;
typedef typename GET_PROP_TYPE(TypeTag, SolutionVector) SolutionVector;
typedef typename GET_PROP_TYPE(TypeTag, SplitAndMerge) SplitAndMerge;
typedef typename GET_PROP_TYPE(TypeTag, SubDomain1TypeTag) SubDomain1TypeTag;
typedef typename GET_PROP_TYPE(TypeTag, SubDomain2TypeTag) SubDomain2TypeTag;
......@@ -121,8 +122,8 @@ struct MultiDomainConvergenceWriter
SolutionVector1 deltaU1(uLastIter1);
SolutionVector2 deltaU2(uLastIter2);
SplitAndMerge<TypeTag>::splitSolVector(uLastIter, uLastIter1, uLastIter2);
SplitAndMerge<TypeTag>::splitSolVector(deltaU, deltaU1, deltaU2);
SplitAndMerge::splitSolVector(uLastIter, uLastIter1, uLastIter2);
SplitAndMerge::splitSolVector(deltaU, deltaU1, deltaU2);
std::cout << "\n writing convergence file of current Newton iteration \n";
ctl_.method().model().sdModel1().addConvergenceVtkFields(*vtkMultiWriter1_, uLastIter1, deltaU1);
......
......@@ -58,7 +58,7 @@ class MultiDomainModel
typedef typename GET_PROP_TYPE(SubDomain1TypeTag, Model) SubDomainModel1;
typedef typename GET_PROP_TYPE(SubDomain2TypeTag, Model) SubDomainModel2;
typedef Dumux::SplitAndMerge<TypeTag> SplitAndMerge;
typedef typename GET_PROP_TYPE(TypeTag, SplitAndMerge) SplitAndMerge;
enum {
numEq1 = GET_PROP_VALUE(TypeTag, NumEq1),
......
......@@ -63,6 +63,7 @@ class MultiDomainNewtonController : public NewtonController<TypeTag>
typedef typename GET_PROP_TYPE(TypeTag, NewtonMethod) NewtonMethod;
typedef typename GET_PROP_TYPE(TypeTag, SolutionVector) SolutionVector;
typedef typename GET_PROP_TYPE(TypeTag, SplitAndMerge) SplitAndMerge;
typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem;
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
......@@ -241,11 +242,9 @@ public:
*/
void newtonEndStep(SolutionVector &uCurrentIter, SolutionVector &uLastIter)
{
typedef Dumux::SplitAndMerge<TypeTag> Common;
Common::splitSolVector(this->model_().curSol(),
this->model_().sdModel1().curSol(),
this->model_().sdModel2().curSol());
SplitAndMerge::splitSolVector(this->model_().curSol(),
this->model_().sdModel1().curSol(),
this->model_().sdModel2().curSol());
ParentType::newtonEndStep(uCurrentIter, uLastIter);
}
......
......@@ -120,6 +120,9 @@ NEW_PROP_TAG(ConstraintsTrafo);
//! Specifies the type of the jacobian matrix as used for the linear solver
NEW_PROP_TAG(JacobianMatrix);
//! the routines that are used to split and merge solution vectors
NEW_PROP_TAG(SplitAndMerge);
} // namespace Properties
} // namespace Dumux
......
......@@ -240,6 +240,9 @@ SET_INT_PROP(MultiDomain, LinearSolverMaxIterations, 250);
// set the maximum time step divisions
SET_INT_PROP(MultiDomain, NewtonMaxTimeStepDivisions, 10);
// set the routines for splitting and merging solution vectors
SET_TYPE_PROP(MultiDomain, SplitAndMerge, SplitAndMerge<TypeTag>);
} // namespace Properties
} // namespace Dumux
......
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