Commit 535ca95d authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

* VtkWriter::writeFiles readded :)

parent 1859605c
......@@ -64,9 +64,9 @@ namespace AMDiS {
class BasFctType
{
public:
BasFctType() {};
BasFctType() {}
virtual ~BasFctType() {};
virtual ~BasFctType() {}
virtual double operator()(const DimVec<double>&) const = 0;
};
......@@ -78,9 +78,9 @@ namespace AMDiS {
class GrdBasFctType
{
public:
GrdBasFctType() {};
GrdBasFctType() {}
virtual ~GrdBasFctType() {};
virtual ~GrdBasFctType() {}
virtual void operator()(const DimVec<double>&,
DimVec<double>&) const = 0;
......@@ -93,9 +93,9 @@ namespace AMDiS {
class D2BasFctType
{
public:
D2BasFctType() {};
D2BasFctType() {}
virtual ~D2BasFctType() {};
virtual ~D2BasFctType() {}
virtual void operator()(const DimVec<double>&,
DimMat<double>&) const = 0;
......@@ -131,7 +131,7 @@ namespace AMDiS {
/** \brief
* Creates a BasisFunction object of given dim and degree
*/
BasisFunction(const std::string& name_, int dim_, int degree_);
BasisFunction(const std::string& name, int dim, int degree);
/** \brief
* destructor
......@@ -144,14 +144,14 @@ namespace AMDiS {
*/
virtual bool operator==(const BasisFunction& a) const {
return a.getName() == name;
};
}
/** \brief
* Returns !(*this == b)
*/
inline bool operator!=(const BasisFunction& b) const {
return !(operator == (b));
};
}
/** \brief
* Used by \ref getDOFIndices and \ref getVec
......@@ -194,28 +194,28 @@ namespace AMDiS {
*/
inline const int getDegree() const {
return degree;
};
}
/** \brief
* Returns \ref dim of BasisFunction
*/
inline const int getDim() const {
return dim;
};
}
/** \brief
* Returns \ref nBasFcts which is the number of local basis functions
*/
inline const int getNumber() const {
return nBasFcts;
};
}
/** \brief
* Returns \ref name of BasisFunction
*/
inline const std::string& getName() const {
return name;
};
}
/** \brief
* Returns \ref nDOF[i]
......@@ -227,7 +227,7 @@ namespace AMDiS {
*/
inline DimVec<int>* getNumberOfDOFs() const {
return nDOF;
};
}
/** \brief
* Initialisation of the \ref nDOF vector. Must be implemented by sub classes
......
......@@ -53,9 +53,10 @@ namespace AMDiS {
usedCount = src.usedCount;
holeCount = src.holeCount;
sizeUsed = src.sizeUsed;
for (int i = 0; i < 4; nrDOF[i] = src.nrDOF[i++]) {
for (int i = 0; i < mesh->getDim(); i++) {
nrDOF[i] = src.nrDOF[i];
nr0DOF[i] = src.nr0DOF[i];
};
}
dofIndexedList = src.dofIndexedList;
dofContainerList = src.dofContainerList;
}
......
......@@ -55,12 +55,12 @@ namespace AMDiS {
if (&feSpace == this)
return *this;
if (feSpace.admin == &(feSpace.mesh->getDOFAdmin(0))) {
std::cout << "JA, SIND GLEICH\n";
} else {
std::cout << "NO, NICHT WIRKLICH\n";
}
ERROR_EXIT("\n");
mesh = NEW Mesh(feSpace.mesh->getName(), feSpace.mesh->getDim());
*mesh = *(feSpace.mesh);
admin = &(const_cast<DOFAdmin&>(mesh->getDOFAdmin(0)));
TEST_EXIT(feSpace.admin == &(feSpace.mesh->getDOFAdmin(0)))
("Gut, dass muss ich mir noch mal ueberlegen!\n");
return *this;
}
......
......@@ -153,7 +153,7 @@ namespace AMDiS {
admin.resize(m.admin.size());
for (int i = 0; i < static_cast<int>(admin.size()); i++) {
admin[i] = NEW DOFAdmin(this);
*admin[i] = *(m.admin[i]);
*(admin[i]) = *(m.admin[i]);
admin[i]->setMesh(this);
}
......
......@@ -59,9 +59,13 @@ namespace AMDiS {
bool pop(T **solution,
double *timestep);
/** \brief
*
*/
bool pop(T **solution,
double *timestep,
typename SolutionHelper<T>::type feSpace);
typename SolutionHelper<T>::type feSpace,
double *timestep);
/** \brief
* Returns for a given solution number the corresponding fe Space. If the
......
......@@ -92,8 +92,9 @@ namespace AMDiS {
template<typename T>
bool SolutionDataStorage<T>::pop(T **solution,
double *timestep,
typename SolutionHelper<T>::type feSpace)
typename SolutionHelper<T>::type feSpace,
double *timestep)
{
if (!pop(solution, timestep))
return false;
......
......@@ -75,5 +75,18 @@ namespace AMDiS {
return 0;
}
void VtkWriter::writeFile(DOFVector<double> *values,
const char *filename)
{
DataCollector *dc = NEW DataCollector(values->getFESpace(), values);
std::vector<DataCollector*> dcList(0);
dcList.push_back(dc);
VtkWriter *writer = NEW VtkWriter(&dcList);
writer->writeFile(filename);
DELETE writer;
DELETE dc;
}
}
......@@ -45,7 +45,7 @@ namespace AMDiS {
{
degree = (*dataCollector)[0]->getFeSpace()->getBasisFcts()->getDegree();
dim = (*dataCollector)[0]->getMesh()->getDim();
};
}
/** \brief
......@@ -53,6 +53,11 @@ namespace AMDiS {
*/
int writeFile(const char *name);
/** \brief
* May be used to simply write ParaView files.
*/
static void writeFile(DOFVector<double> *values,
const char *filename);
/** \brief
* Set a compressing method for file output.
......
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