Commit 1f023756 authored by Praetorius, Simon's avatar Praetorius, Simon

coupling-baseproblem made a base-problem

parent 23323668
...@@ -103,27 +103,28 @@ namespace extensions { ...@@ -103,27 +103,28 @@ namespace extensions {
* *
* \brief Structur to couple BaseProblems of variouse types * \brief Structur to couple BaseProblems of variouse types
*/ */
template<typename ProblemType=ProblemStat, typename... BaseProblemTypes > template <typename ProblemType=ProblemStat, typename... BaseProblemTypes>
class CouplingBaseProblem : public CouplingIterationInterface, class CouplingBaseProblem
public CouplingTimeInterface, : public CouplingIterationInterface
public AMDiS::detail::CouplingProblemStat<ProblemType> , public CouplingTimeInterface
, public AMDiS::detail::CouplingProblemStat<ProblemType>
{ {
public:
typedef AMDiS::detail::CouplingProblemStat<ProblemType> CProblemStat; typedef AMDiS::detail::CouplingProblemStat<ProblemType> CProblemStat;
typedef std::tuple<BaseProblemTypes&...> BaseProblemsTupleType; typedef std::tuple<BaseProblemTypes&...> BaseProblemsTupleType;
template<typename... BaseProblemTypes_> public:
CouplingBaseProblem(std::string name_, BaseProblemTypes_&&... baseProblems_) CouplingBaseProblem(std::string name_, BaseProblemTypes&... baseProblems_)
: ProblemIterationInterface(), // virtual base class constructor : ProblemIterationInterface() // virtual base class constructor
ProblemTimeInterface(), // virtual base class constructor , ProblemTimeInterface() // virtual base class constructor
CProblemStat(name_), , CProblemStat(name_)
baseProblems(baseProblems_...), , baseProblems(baseProblems_...)
name(name_) , name(name_)
{ {
dow = Global::getGeo(WORLD); dow = Global::getGeo(WORLD);
Parameters::get(name_ + "->dim", dim);
} }
~CouplingBaseProblem() { } virtual ~CouplingBaseProblem() { }
/** /**
* Add the problems to the iterationInterface, timeInterface and couplingProblemStat. * Add the problems to the iterationInterface, timeInterface and couplingProblemStat.
...@@ -144,13 +145,17 @@ public: ...@@ -144,13 +145,17 @@ public:
// initialize all ProblemStat // initialize all ProblemStat
CProblemStat::initialize(initFlag, adoptProblem, adoptFlag); CProblemStat::initialize(initFlag, adoptProblem, adoptFlag);
}
// set mesh dimension virtual void initData()
dim = CProblemStat::getMesh(0)->getDim(); {
tools::FOR_EACH< detail::InitData >::loop(baseProblems);
} }
virtual void initData() {} virtual void finalizeData()
virtual void finalizeData() {} {
tools::FOR_EACH< detail::FinalizeData >::loop(baseProblems);
}
/** /**
* At first the initData method is called for all baseProblems, then * At first the initData method is called for all baseProblems, then
...@@ -159,16 +164,9 @@ public: ...@@ -159,16 +164,9 @@ public:
**/ **/
virtual void initTimeInterface() virtual void initTimeInterface()
{ {
tools::FOR_EACH< detail::InitData >::loop(baseProblems);
initData(); initData();
fillOperators();
tools::FOR_EACH< detail::FillOperators >::loop(baseProblems); fillBoundaryConditions();
fillCouplingOperators();
tools::FOR_EACH< detail::FillBoundaryConditions >::loop(baseProblems);
fillCouplingBoundaryConditions();
tools::FOR_EACH< detail::FinalizeData >::loop(baseProblems);
finalizeData(); finalizeData();
} }
...@@ -176,6 +174,17 @@ public: ...@@ -176,6 +174,17 @@ public:
virtual void fillCouplingOperators() {} virtual void fillCouplingOperators() {}
virtual void fillCouplingBoundaryConditions() {} virtual void fillCouplingBoundaryConditions() {}
virtual void fillOperators()
{
tools::FOR_EACH< detail::FillOperators >::loop(baseProblems);
fillCouplingOperators();
}
virtual void fillBoundaryConditions()
{
tools::FOR_EACH< detail::FillBoundaryConditions >::loop(baseProblems);
fillCouplingBoundaryConditions();
}
/// get the j-th solution-vector of the i-th problem /// get the j-th solution-vector of the i-th problem
template<int i> template<int i>
......
Markdown is supported
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