Commit 63917c5d authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

CouplingProblems extended

parent f2548627
......@@ -63,10 +63,10 @@ public:
/// Initialisation of DOFVectors and AbstractFunctions,
/// is called in \ref initTimeInteface after feSpace and mesh are initialized
virtual void initData() {};
virtual void initData() {}
/// Method is called at the end of \ref initTimeInteface
virtual void finalizeData() {};
virtual void finalizeData() {}
/// calls \ref initData, \ref fillOperators and \ref fillBoundaryConditions in this ordering
virtual void initTimeInterface()
......
......@@ -34,7 +34,7 @@ public:
BaseProblemType *prob2_=NULL,
BaseProblemType *prob3_=NULL,
BaseProblemType *prob4_=NULL)
: CProblemStat(name_)
: CProblemStat(name_), name(name_)
{
dow = Global::getGeo(WORLD);
baseProblems.push_back(prob0_);
......@@ -66,6 +66,7 @@ public:
}
virtual void initData() {}
virtual void finalizeData() {}
virtual void initTimeInterface()
{
......@@ -80,6 +81,10 @@ public:
for (size_t i = 0; i < baseProblems.size(); i++)
baseProblems[i]->fillBoundaryConditions();
fillCouplingBoundaryConditions();
for (size_t i = 0; i < baseProblems.size(); i++)
baseProblems[i]->initData();
finalizeData();
}
......@@ -103,12 +108,16 @@ public:
("Indices out of range!\n");
return baseProblems[i]->getFeSpace(j);
}
std::string getName() { return name; }
protected:
std::vector<BaseProblemType*> baseProblems;
unsigned dim; // dimension of the meshes
unsigned dow; // dimension of the world
std::string name;
};
......
......@@ -57,6 +57,9 @@ namespace detail {
/// Functor for generic loops. Method initData() is called for each element in a sequence.
struct InitData { template<typename B> static void call(B& b) { b.initData(); } };
/// Functor for generic loops. Method initData() is called for each element in a sequence.
struct FinalizeData { template<typename B> static void call(B& b) { b.finalizeData(); } };
/// Functor for generic loops. Method fillOperators() is called for each element in a sequence.
struct FillOperators { template<typename B> static void call(B& b) { b.fillOperators(); } };
......@@ -126,7 +129,8 @@ public:
dim = CProblemStat::getMesh(0)->getDim();
}
virtual void initData() {}
virtual void initData() {}
virtual void finalizeData() {}
virtual void initTimeInterface()
{
......@@ -138,6 +142,9 @@ public:
tools::FOR_EACH< detail::FillBoundaryConditions >::loop(baseProblems);
fillCouplingBoundaryConditions();
tools::FOR_EACH< detail::FinalizeData >::loop(baseProblems);
finalizeData();
}
......
......@@ -50,6 +50,12 @@ namespace detail {
static void call(BaseProblemType& baseProblem) { baseProblem.initData(); }
};
/// Functor for generic loops. Method initData() is called for each element in a sequence.
struct FinalizeData {
template<typename BaseProblemType>
static void call(BaseProblemType& baseProblem) { baseProblem.finalizeData(); }
};
/// Functor for generic loops. Method fillOperators() is called for each element in a sequence.
struct FillOperators {
template<typename BaseProblemType>
......@@ -114,7 +120,7 @@ public:
}
virtual void initData() {}
virtual void finalizeData() {}
/**
* At first the initData method is called for all baseProblems, then
......@@ -131,6 +137,9 @@ public:
tools::FOR_EACH< detail::FillBoundaryConditions >::loop(baseProblems);
fillCouplingBoundaryConditions();
tools::FOR_EACH< detail::FinalizeData >::loop(baseProblems);
finalizeData();
}
......
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