Commit b295fec5 authored by Praetorius, Simon's avatar Praetorius, Simon

coupling-baseproblem made a base-problem

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