Skip to content
Snippets Groups Projects
Commit 1b6083dc authored by Kilian Weishaupt's avatar Kilian Weishaupt Committed by Timo Koch
Browse files

[staggeredGrid][model] Comment-out vtk output

* Does not work yet and yields valgrind errors
parent 5ea11d96
No related branches found
No related tags found
2 merge requests!617[WIP] Next,!370Feature/staggered grid
...@@ -89,56 +89,57 @@ public: ...@@ -89,56 +89,57 @@ public:
void addOutputVtkFields(const SolutionVector &sol, void addOutputVtkFields(const SolutionVector &sol,
MultiWriter &writer) MultiWriter &writer)
{ {
// typedef Dune::BlockVector<Dune::FieldVector<double, dimWorld> > VectorField; // TODO: implement vtk output
// // typedef Dune::BlockVector<Dune::FieldVector<double, dimWorld> > VectorField;
// create the required scalar fields //
unsigned numDofs = this->numDofs(); // // create the required scalar fields
auto *p = writer.allocateManagedBuffer(numDofs); // unsigned numDofs = this->numDofs();
// VectorField *velocity = writer.template allocateManagedBuffer<double, dimWorld>(numDofs); // auto *p = writer.allocateManagedBuffer(numDofs);
// ImplicitVelocityOutput<TypeTag> velocityOutput(this->problem_()); // // VectorField *velocity = writer.template allocateManagedBuffer<double, dimWorld>(numDofs);
// // ImplicitVelocityOutput<TypeTag> velocityOutput(this->problem_());
// if (velocityOutput.enableOutput()) //
// { // // if (velocityOutput.enableOutput())
// // initialize velocity field // // {
// for (unsigned int i = 0; i < numDofs; ++i) // // // initialize velocity field
// { // // for (unsigned int i = 0; i < numDofs; ++i)
// (*velocity)[i] = double(0); // // {
// } // // (*velocity)[i] = double(0);
// } // // }
// // }
unsigned numElements = this->gridView_().size(0); //
auto *rank = writer.allocateManagedBuffer(numElements); // unsigned numElements = this->gridView_().size(0);
// auto *rank = writer.allocateManagedBuffer(numElements);
for (const auto& element : elements(this->gridView_(), Dune::Partitions::interior)) //
{ // for (const auto& element : elements(this->gridView_(), Dune::Partitions::interior))
auto eIdx = this->elementMapper().index(element); // {
(*rank)[eIdx] = this->gridView_().comm().rank(); // auto eIdx = this->elementMapper().index(element);
// (*rank)[eIdx] = this->gridView_().comm().rank();
// get the local fv geometry //
auto fvGeometry = localView(this->globalFvGeometry()); // // get the local fv geometry
fvGeometry.bindElement(element); // auto fvGeometry = localView(this->globalFvGeometry());
// fvGeometry.bindElement(element);
auto elemVolVars = localView(this->curGlobalVolVars()); //
elemVolVars.bindElement(element, fvGeometry, this->curSol()); // auto elemVolVars = localView(this->curGlobalVolVars());
// elemVolVars.bindElement(element, fvGeometry, this->curSol());
for (auto&& scv : scvs(fvGeometry)) //
{ // for (auto&& scv : scvs(fvGeometry))
const auto& volVars = elemVolVars[scv]; // {
auto dofIdxGlobal = scv.dofIndex(); // const auto& volVars = elemVolVars[scv];
// auto dofIdxGlobal = scv.dofIndex();
(*p)[dofIdxGlobal] = volVars.pressure(); //
} // (*p)[dofIdxGlobal] = volVars.pressure();
// }
// velocity output //
//velocityOutput.calculateVelocity(*velocity, elemVolVars, fvGeometry, element, /*phaseIdx=*/0); // // velocity output
} // //velocityOutput.calculateVelocity(*velocity, elemVolVars, fvGeometry, element, /*phaseIdx=*/0);
// }
writer.attachDofData(*p, "p", isBox); //
// if (velocityOutput.enableOutput()) // writer.attachDofData(*p, "p", isBox);
// { // // if (velocityOutput.enableOutput())
// writer.attachDofData(*velocity, "velocity", isBox, dim); // // {
// } // // writer.attachDofData(*velocity, "velocity", isBox, dim);
writer.attachCellData(*rank, "process rank"); // // }
// writer.attachCellData(*rank, "process rank");
} }
......
...@@ -337,56 +337,57 @@ public: ...@@ -337,56 +337,57 @@ public:
void addOutputVtkFields(const SolutionVector &sol, void addOutputVtkFields(const SolutionVector &sol,
MultiWriter &writer) MultiWriter &writer)
{ {
// typedef Dune::BlockVector<Dune::FieldVector<double, dimWorld> > VectorField; // TODO: implement vtk output
// // typedef Dune::BlockVector<Dune::FieldVector<double, dimWorld> > VectorField;
// create the required scalar fields //
unsigned numDofs = this->numDofs(); // // create the required scalar fields
auto *p = writer.allocateManagedBuffer(numDofs); // unsigned numDofs = this->numDofs();
// VectorField *velocity = writer.template allocateManagedBuffer<double, dimWorld>(numDofs); // auto *p = writer.allocateManagedBuffer(numDofs);
// ImplicitVelocityOutput<TypeTag> velocityOutput(this->problem_()); // // VectorField *velocity = writer.template allocateManagedBuffer<double, dimWorld>(numDofs);
// // ImplicitVelocityOutput<TypeTag> velocityOutput(this->problem_());
// if (velocityOutput.enableOutput()) //
// { // // if (velocityOutput.enableOutput())
// // initialize velocity field // // {
// for (unsigned int i = 0; i < numDofs; ++i) // // // initialize velocity field
// { // // for (unsigned int i = 0; i < numDofs; ++i)
// (*velocity)[i] = double(0); // // {
// } // // (*velocity)[i] = double(0);
// } // // }
// // }
unsigned numElements = this->gridView_().size(0); //
auto *rank = writer.allocateManagedBuffer(numElements); // unsigned numElements = this->gridView_().size(0);
// auto *rank = writer.allocateManagedBuffer(numElements);
for (const auto& element : elements(this->gridView_(), Dune::Partitions::interior)) //
{ // for (const auto& element : elements(this->gridView_(), Dune::Partitions::interior))
auto eIdx = this->elementMapper().index(element); // {
(*rank)[eIdx] = this->gridView_().comm().rank(); // auto eIdx = this->elementMapper().index(element);
// (*rank)[eIdx] = this->gridView_().comm().rank();
// get the local fv geometry //
auto fvGeometry = localView(this->globalFvGeometry()); // // get the local fv geometry
fvGeometry.bindElement(element); // auto fvGeometry = localView(this->globalFvGeometry());
// fvGeometry.bindElement(element);
auto elemVolVars = localView(this->curGlobalVolVars()); //
elemVolVars.bindElement(element, fvGeometry, this->curSol()); // auto elemVolVars = localView(this->curGlobalVolVars());
// elemVolVars.bindElement(element, fvGeometry, this->curSol());
for (auto&& scv : scvs(fvGeometry)) //
{ // for (auto&& scv : scvs(fvGeometry))
const auto& volVars = elemVolVars[scv]; // {
auto dofIdxGlobal = scv.dofIndex(); // const auto& volVars = elemVolVars[scv];
// auto dofIdxGlobal = scv.dofIndex();
(*p)[dofIdxGlobal] = volVars.pressure(); //
} // (*p)[dofIdxGlobal] = volVars.pressure();
// }
// velocity output //
//velocityOutput.calculateVelocity(*velocity, elemVolVars, fvGeometry, element, /*phaseIdx=*/0); // // velocity output
} // //velocityOutput.calculateVelocity(*velocity, elemVolVars, fvGeometry, element, /*phaseIdx=*/0);
// }
writer.attachDofData(*p, "p", isBox); //
// if (velocityOutput.enableOutput()) // writer.attachDofData(*p, "p", isBox);
// { // // if (velocityOutput.enableOutput())
// writer.attachDofData(*velocity, "velocity", isBox, dim); // // {
// } // // writer.attachDofData(*velocity, "velocity", isBox, dim);
writer.attachCellData(*rank, "process rank"); // // }
// writer.attachCellData(*rank, "process rank");
} }
/*! /*!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment