Skip to content
Snippets Groups Projects
Commit 66eca434 authored by Timo Koch's avatar Timo Koch
Browse files

[io] Revert change from 26600833 because...

[io] Revert change from 26600833 because staggerd returns real num dofs from grid geometry
parent 24a1c604
No related branches found
No related tags found
1 merge request!1015Fix/vtkouput staggered
...@@ -85,6 +85,7 @@ class VtkOutputModule ...@@ -85,6 +85,7 @@ class VtkOutputModule
using VelocityVector = Dune::FieldVector<Scalar, dimWorld>; using VelocityVector = Dune::FieldVector<Scalar, dimWorld>;
static constexpr bool isBox = FVGridGeometry::discMethod == DiscretizationMethod::box; static constexpr bool isBox = FVGridGeometry::discMethod == DiscretizationMethod::box;
static constexpr int dofCodim = isBox ? dim : 0;
struct VolVarScalarDataInfo { std::function<Scalar(const VV&)> get; std::string name; }; struct VolVarScalarDataInfo { std::function<Scalar(const VV&)> get; std::string name; };
struct VolVarVectorDataInfo { std::function<VolVarsVector(const VV&)> get; std::string name; }; struct VolVarVectorDataInfo { std::function<VolVarsVector(const VV&)> get; std::string name; };
...@@ -270,7 +271,7 @@ private: ...@@ -270,7 +271,7 @@ private:
|| addProcessRank) || addProcessRank)
{ {
const auto numCells = gridGeom_.gridView().size(0); const auto numCells = gridGeom_.gridView().size(0);
const auto numDofs = gridGeom_.numDofs(); const auto numDofs = numDofs_();
// get fields for all volume variables // get fields for all volume variables
if (!volVarScalarDataInfo_.empty()) if (!volVarScalarDataInfo_.empty())
...@@ -443,7 +444,7 @@ private: ...@@ -443,7 +444,7 @@ private:
|| addProcessRank) || addProcessRank)
{ {
const auto numCells = gridGeom_.gridView().size(0); const auto numCells = gridGeom_.gridView().size(0);
const auto numDofs = gridGeom_.numDofs(); const auto numDofs = numDofs_();
// get fields for all volume variables // get fields for all volume variables
if (!volVarScalarDataInfo_.empty()) if (!volVarScalarDataInfo_.empty())
...@@ -585,6 +586,9 @@ private: ...@@ -585,6 +586,9 @@ private:
template<class Vector, typename std::enable_if_t<!IsIndexable<decltype(std::declval<Vector>()[0])>::value, int> = 0> template<class Vector, typename std::enable_if_t<!IsIndexable<decltype(std::declval<Vector>()[0])>::value, int> = 0>
std::size_t getNumberOfComponents_(const Vector& v) { return 1; } std::size_t getNumberOfComponents_(const Vector& v) { return 1; }
//! return the number of dofs
std::size_t numDofs_() const { return gridGeom_.gridView().size(dofCodim); }
  • Dennis Gläser @DennisGlaeser ·
    Maintainer

    Hm... This is still wrong though for customized & enriched mappers. We should find a way that works for all cases because in that case you get a segmentation fault without warning.

  • Author Owner

    yeah sry i forgot to tell you. I had to revert it on master to make the staggered tests pass again. So this is still an open issue. Does

    return dofCodim == 0 ? gridGeom_.elementMapper().size() : gridGeom_.vertexMapper().size();

    work?

  • Dennis Gläser @DennisGlaeser ·
    Maintainer

    Yes, this would work!

  • Please register or sign in to reply
const Problem& problem_; const Problem& problem_;
const FVGridGeometry& gridGeom_; const FVGridGeometry& gridGeom_;
const GridVariables& gridVariables_; const GridVariables& gridVariables_;
......
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