Commit b728a4ee authored by Thomas Witkowski's avatar Thomas Witkowski

Parallelization of instationary problems.

parent a1b5b1b9
......@@ -13,13 +13,17 @@
#include "Mesh.h"
#include "OpenMP.h"
#if HAVE_PARALLEL_DOMAIN_AMDIS
#include "mpi.h"
#endif
namespace AMDiS {
FileWriter::FileWriter(const std::string &name_,
Mesh *mesh_,
FileWriter::FileWriter(const std::string &str,
Mesh *m,
DOFVector<double> *vec)
: name(name_),
mesh(mesh_)
: name(str),
mesh(m)
{
FUNCNAME("FileWriter::FileWriter()");
......@@ -42,10 +46,9 @@ namespace AMDiS {
initialize();
for (int i = 0; i < static_cast<int>(vecs.size()); i++) {
for (int i = 0; i < static_cast<int>(vecs.size()); i++)
TEST_EXIT(vecs[0]->getFESpace() == vecs[i]->getFESpace())
("All FESpace have to be equal!\n");
}
feSpace = vecs[0]->getFESpace();
solutionVecs_ = vecs;
......@@ -87,11 +90,9 @@ namespace AMDiS {
{
// Do not forget to delete temporal solution vector, if there have been
// some created in the constructor.
if (nTmpSolutions_ > 0) {
for (int i = 0; i < nTmpSolutions_; i++) {
if (nTmpSolutions_ > 0)
for (int i = 0; i < nTmpSolutions_; i++)
delete solutionVecs_[i];
}
}
}
......@@ -166,21 +167,25 @@ namespace AMDiS {
std::vector< DataCollector* > dataCollectors(solutionVecs_.size());
if (writeElem) {
for (int i = 0; i < static_cast<int>(dataCollectors.size()); i++) {
for (int i = 0; i < static_cast<int>(dataCollectors.size()); i++)
dataCollectors[i] = new DataCollector(feSpace, solutionVecs_[i],
level, flag, writeElem);
}
} else {
for (int i = 0; i < static_cast<int>(dataCollectors.size()); i++) {
for (int i = 0; i < static_cast<int>(dataCollectors.size()); i++)
dataCollectors[i] = new DataCollector(feSpace, solutionVecs_[i],
traverseLevel,
flag | traverseFlag,
writeElement);
}
}
std::string fn = filename;
#if HAVE_PARALLEL_DOMAIN_AMDIS
char f[10];
sprintf(f, "-p%d-", MPI::COMM_WORLD.Get_rank());
fn += f;
#endif
if (appendIndex) {
TEST_EXIT(indexLength <= 99)("index lenght > 99\n");
TEST_EXIT(indexDecimals <= 97)("index decimals > 97\n");
......
......@@ -105,15 +105,35 @@ namespace AMDiS {
void partitionMesh(AdaptInfo *adaptInfo);
virtual void setTime(AdaptInfo *adaptInfo) {}
virtual void setTime(AdaptInfo *adaptInfo)
{
if (timeIF)
timeIF->setTime(adaptInfo);
}
virtual void initTimestep(AdaptInfo *adaptInfo) {}
virtual void initTimestep(AdaptInfo *adaptInfo)
{
if (timeIF)
timeIF->initTimestep(adaptInfo);
}
virtual void closeTimestep(AdaptInfo *adaptInfo) {}
virtual void closeTimestep(AdaptInfo *adaptInfo)
{
if (timeIF)
timeIF->closeTimestep(adaptInfo);
}
virtual void solveInitialProblem(AdaptInfo *adaptInfo) {}
virtual void solveInitialProblem(AdaptInfo *adaptInfo)
{
if (timeIF)
timeIF->solveInitialProblem(adaptInfo);
}
virtual void transferInitialSolution(AdaptInfo *adaptInfo) {}
virtual void transferInitialSolution(AdaptInfo *adaptInfo)
{
if (timeIF)
timeIF->transferInitialSolution(adaptInfo);
}
virtual void beginIteration(AdaptInfo *adaptInfo)
{
......
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