Commit 1a043288 authored by Thomas Witkowski's avatar Thomas Witkowski

DOFVector are named by init file, and VTK writer uses this information to name...

DOFVector are named by init file, and VTK writer uses this information to name components of vtu files.
parent ef9e1c0f
......@@ -94,6 +94,12 @@ namespace AMDiS {
return pos;
}
/// Returns \ref node0
inline int getCurrentNode0()
{
return node0;
}
/// Returns \ref elementPos, the number of vertex, edge or face that
/// is traversed.
inline int getCurrentElementPos()
......
......@@ -44,6 +44,57 @@ namespace AMDiS {
using namespace std;
using boost::lexical_cast;
ProblemStatSeq::ProblemStatSeq(string nameStr,
ProblemIterationInterface *problemIteration)
: StandardProblemIteration(this),
name(nameStr),
nComponents(-1),
nMeshes(0),
traverseInfo(0),
solver(NULL),
solution(NULL),
rhs(NULL),
systemMatrix(NULL),
useGetBound(true),
refinementManager(NULL),
coarseningManager(NULL),
info(10),
deserialized(false),
computeExactError(false),
boundaryConditionSet(false),
writeAsmInfo(false)
{
Parameters::get(name + "->components", nComponents);
TEST_EXIT(nComponents > 0)("components not set!\n");
estimator.resize(nComponents, NULL);
marker.resize(nComponents, NULL);
assembleMatrixOnlyOnce.resize(nComponents);
assembledMatrix.resize(nComponents);
for (int i = 0; i < nComponents; i++) {
assembleMatrixOnlyOnce[i].resize(nComponents);
assembledMatrix[i].resize(nComponents);
for (int j = 0; j < nComponents; j++) {
assembleMatrixOnlyOnce[i][j] = false;
assembledMatrix[i][j] = false;
}
}
exactSolutionFcts.resize(nComponents);
// === Initialize name of components. ===
componentNames.resize(nComponents, "");
for (int i = 0; i < nComponents; i++)
componentNames[i] = "solution[" + lexical_cast<string>(i) + "]";
Parameters::get(name + "->name", componentNames);
for (int i = 0; i < nComponents; i++)
Parameters::get(name + "->name[" + lexical_cast<string>(i) + "]",
componentNames[i]);
}
void ProblemStatSeq::initialize(Flag initFlag,
ProblemStatSeq *adoptProblem,
Flag adoptFlag)
......@@ -391,12 +442,11 @@ namespace AMDiS {
componentSpaces[i], "A_ii");
(*systemMatrix)[i][i]->setCoupleMatrix(false);
string numberedName = "rhs[" + boost::lexical_cast<string>(i) + "]";
rhs->setDOFVector(i, new DOFVector<double>(componentSpaces[i], numberedName));
rhs->setDOFVector(i, new DOFVector<double>(componentSpaces[i],
"rhs[" + lexical_cast<string>(i) + "]"));
numberedName = "solution[" + boost::lexical_cast<string>(i) + "]";
solution->setDOFVector(i, new DOFVector<double>(componentSpaces[i],
numberedName));
componentNames[i]));
solution->getDOFVector(i)->setCoarsenOperation(COARSE_INTERPOL);
solution->getDOFVector(i)->set(0.0);
}
......
......@@ -67,43 +67,7 @@ namespace AMDiS {
public:
/// Constructor
ProblemStatSeq(string nameStr,
ProblemIterationInterface *problemIteration = NULL)
: StandardProblemIteration(this),
name(nameStr),
nComponents(-1),
nMeshes(0),
traverseInfo(0),
solver(NULL),
solution(NULL),
rhs(NULL),
systemMatrix(NULL),
useGetBound(true),
refinementManager(NULL),
coarseningManager(NULL),
info(10),
deserialized(false),
computeExactError(false),
boundaryConditionSet(false),
writeAsmInfo(false)
{
Parameters::get(name + "->components", nComponents);
TEST_EXIT(nComponents > 0)("components not set!\n");
estimator.resize(nComponents, NULL);
marker.resize(nComponents, NULL);
assembleMatrixOnlyOnce.resize(nComponents);
assembledMatrix.resize(nComponents);
for (int i = 0; i < nComponents; i++) {
assembleMatrixOnlyOnce[i].resize(nComponents);
assembledMatrix[i].resize(nComponents);
for (int j = 0; j < nComponents; j++) {
assembleMatrixOnlyOnce[i][j] = false;
assembledMatrix[i][j] = false;
}
}
exactSolutionFcts.resize(nComponents);
}
ProblemIterationInterface *problemIteration = NULL);
/// Destructor
virtual ~ProblemStatSeq() {}
......@@ -137,61 +101,43 @@ namespace AMDiS {
/// Used in \ref initialize().
virtual void createFileWriter();
/** \brief
* Used in \ref initialize(). This function is deprecated and should not be used
* anymore. There is no guarantee that it will work in the future.
*/
/// Used in \ref initialize(). This function is deprecated and should not
/// be used anymore. There is no guarantee that it will work in the future.
virtual void doOtherStuff();
/** \brief
* Implementation of ProblemStatBase::solve(). Deligates the solving
* of problems system to \ref solver.
*/
/// Implementation of ProblemStatBase::solve(). Deligates the solving
/// of problems system to \ref solver.
void solve(AdaptInfo *adaptInfo,
bool createMatrixData = true,
bool storeMatrixData = false);
/** \brief
* Implementation of ProblemStatBase::estimate(). Deligates the estimation
* to \ref estimator.
*/
/// Implementation of ProblemStatBase::estimate(). Deligates the estimation
/// to \ref estimator.
virtual void estimate(AdaptInfo *adaptInfo);
/** \brief
* Implementation of ProblemStatBase::markElements().
* Deligated to \ref adapt.
*/
/// Implementation of ProblemStatBase::markElements().
/// Deligated to \ref adapt.
virtual Flag markElements(AdaptInfo *adaptInfo);
/** \brief
* Implementation of ProblemStatBase::refineMesh(). Deligated to the
* RefinementManager of \ref adapt.
*/
/// Implementation of ProblemStatBase::refineMesh(). Deligated to the
/// RefinementManager of \ref adapt.
virtual Flag refineMesh(AdaptInfo *adaptInfo);
/** \brief
* Implementation of ProblemStatBase::coarsenMesh(). Deligated to the
* CoarseningManager of \ref adapt.
*/
/// Implementation of ProblemStatBase::coarsenMesh(). Deligated to the
/// CoarseningManager of \ref adapt.
virtual Flag coarsenMesh(AdaptInfo *adaptInfo);
/** \brief
* Implementation of ProblemStatBase::buildBeforeRefine().
* Does nothing here.
*/
/// Implementation of ProblemStatBase::buildBeforeRefine().
/// Does nothing here.
virtual void buildBeforeRefine(AdaptInfo *adaptInfo, Flag) {}
/** \brief
* Implementation of ProblemStatBase::buildBeforeCoarsen().
* Does nothing here.
*/
/// Implementation of ProblemStatBase::buildBeforeCoarsen().
/// Does nothing here.
virtual void buildBeforeCoarsen(AdaptInfo *adaptInfo, Flag) {}
/** \brief
* Implementation of ProblemStatBase::buildAfterCoarsen().
* Assembles \ref A and \ref rhs. With the last two parameters, assembling
* can be restricted to matrices or vectors only.
*/
/// Implementation of ProblemStatBase::buildAfterCoarsen().
/// Assembles \ref A and \ref rhs. With the last two parameters, assembling
/// can be restricted to matrices or vectors only.
virtual void buildAfterCoarsen(AdaptInfo *adaptInfo, Flag flag,
bool assembleMatrix = true,
bool assembleVector = true);
......@@ -603,6 +549,10 @@ namespace AMDiS {
/// Number of problem components
int nComponents;
/// Stores the names for all components. Is used for naming the solution
/// vectors, \ref solution.
vector<string> componentNames;
/** \brief
* Number of problem meshes. If all components are defined on the same mesh,
* this number is 1. Otherwise, this variable is the number of different meshes
......
......@@ -59,7 +59,7 @@ namespace AMDiS {
std::list<ElementInfo>* getElementInfos();
/// Returns vector with vertex information.
DOFVector< std::list<VertexInfo> >* getVertexInfos();
DOFVector<std::list<VertexInfo> >* getVertexInfos();
/// Returns the finite element space of the problem.
const FiniteElemSpace* getFeSpace()
......
......@@ -82,7 +82,8 @@ namespace AMDiS {
file << " <PointData>\n";
for (int i = 0; i < static_cast<int>(dataCollector->size()); i++) {
file << " <DataArray type=\"Float32\" Name=\"value" << i
file << " <DataArray type=\"Float32\" Name=\""
<< (*dataCollector)[i]->getValues()->getName()
<< "\" format=\"ascii\">\n";
writeVertexValues(file, 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