Commit 0b1383e4 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

writeFile for WorldVector<DOFVector> and DOFVector<WorldVector> added

parent 235097de
...@@ -137,7 +137,7 @@ namespace AMDiS { ...@@ -137,7 +137,7 @@ namespace AMDiS {
DataCollector dc(values->getFESpace(), values); DataCollector dc(values->getFESpace(), values);
std::vector<DataCollector*> dcList(0); std::vector<DataCollector*> dcList(0);
dcList.push_back(&dc); dcList.push_back(&dc);
VtkWriter::writeFile(dcList,filename,writeParallel); writeFile(dcList,filename,writeParallel);
}; };
void VtkWriter::writeFile(std::vector<DOFVector<double>* > &values, void VtkWriter::writeFile(std::vector<DOFVector<double>* > &values,
...@@ -148,22 +148,50 @@ namespace AMDiS { ...@@ -148,22 +148,50 @@ namespace AMDiS {
for(unsigned i=0; i<values.size(); ++i) { for(unsigned i=0; i<values.size(); ++i) {
dcList.push_back(new DataCollector(values[i]->getFESpace(), values[i])); dcList.push_back(new DataCollector(values[i]->getFESpace(), values[i]));
} }
VtkWriter::writeFile(dcList,filename,writeParallel); writeFile(dcList,filename,writeParallel);
for(unsigned i=0; i<values.size(); ++i) { for(unsigned i=0; i<values.size(); ++i) {
delete dcList[i]; delete dcList[i];
} }
}; };
void VtkWriter::writeFile(WorldVector<DOFVector<double>* > &values,
std::string filename,
bool writeParallel)
{
std::vector<DataCollector*> dcList(0);
for(unsigned i=0; i<static_cast<unsigned>(values.getSize()); ++i) {
dcList.push_back(new DataCollector(values[i]->getFESpace(), values[i]));
}
writeFile(dcList,filename,writeParallel);
for(unsigned i=0; i<static_cast<unsigned>(values.getSize()); ++i) {
delete dcList[i];
}
};
void VtkWriter::writeFile(DOFVector<WorldVector<double> > *values,
std::string filename,
bool writeParallel)
{
WorldVector<DOFVector<double>*> valuesWV;
for(unsigned i=0; i<static_cast<unsigned>(valuesWV.getSize()); ++i)
valuesWV[i] = new DOFVector<double>(values->getFESpace(), "valuesWV_i");
transform(values, &valuesWV);
writeFile(valuesWV,filename,writeParallel);
for(unsigned i=0; i<static_cast<unsigned>(valuesWV.getSize()); ++i) {
delete valuesWV[i];
}
};
void VtkWriter::writeFile(SystemVector *values, void VtkWriter::writeFile(SystemVector *values,
std::string filename, std::string filename,
bool writeParallel) bool writeParallel)
{ {
std::vector<DataCollector*> dcList(0); std::vector<DataCollector*> dcList(0);
for(unsigned i=0; i<values->getSize(); ++i) { for(unsigned i=0; i<static_cast<unsigned>(values->getSize()); ++i) {
dcList.push_back(new DataCollector(values->getDOFVector(i)->getFESpace(), values->getDOFVector(i))); dcList.push_back(new DataCollector(values->getDOFVector(i)->getFESpace(), values->getDOFVector(i)));
} }
VtkWriter::writeFile(dcList,filename,writeParallel); writeFile(dcList,filename,writeParallel);
for(unsigned i=0; i<dcList.size(); ++i) { for(unsigned i=0; i<static_cast<unsigned>(dcList.size()); ++i) {
delete dcList[i]; delete dcList[i];
} }
}; };
......
...@@ -72,6 +72,17 @@ namespace AMDiS { ...@@ -72,6 +72,17 @@ namespace AMDiS {
static void writeFile(std::vector<DOFVector<double>*> &values, static void writeFile(std::vector<DOFVector<double>*> &values,
std::string filename, std::string filename,
bool writeParallel = true); bool writeParallel = true);
static void writeFile(WorldVector<DOFVector<double>*> &values,
std::string filename,
bool writeParallel = true);
static void writeFile(DOFVector<WorldVector<double> > *values,
std::string filename,
bool writeParallel = true);
static void writeFile(DOFVector<WorldVector<double> > &values,
std::string filename,
bool writeParallel = true) {
writeFile(&values, filename, writeParallel);
}
static void writeFile(SystemVector *values, static void writeFile(SystemVector *values,
std::string filename, std::string filename,
bool writeParallel = true); bool writeParallel = true);
......
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