Commit 319ca5cc authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

removed experimental namespace and geometrygrid example added

parent 6411139a
......@@ -2,7 +2,7 @@
#include "unstructureddatacollector.hh"
namespace Dune { namespace experimental
namespace Dune
{
/// Implementation of \ref DataCollector for linear cells, with continuous data.
......@@ -101,4 +101,4 @@ protected:
using Super::gridView_;
};
}} // end namespace Dune::experimental
} // end namespace Dune
......@@ -2,7 +2,7 @@
#include <dune/vtk/vtktypes.hh>
namespace Dune { namespace experimental {
namespace Dune {
template <class GridView, class Derived>
class DataCollectorInterface
......@@ -98,10 +98,10 @@ public: // default implementations
auto localFct = localFunction(fct);
for (auto const& e : elements(gridView_, Partitions::all)) {
localFct.bind(e);
auto geometry = e.geometry();
auto refElem = referenceElement<T,GridView::dimension>(e.type());
std::size_t idx = fct.ncomps() * indexSet.index(e);
for (int comp = 0; comp < fct.ncomps(); ++comp)
data[idx + comp] = T(localFct.evaluate(comp, geometry.center()));
data[idx + comp] = T(localFct.evaluate(comp, refElem.position(0,0)));
localFct.unbind();
}
return data;
......@@ -111,4 +111,4 @@ protected:
GridView gridView_;
};
}} // end namespace Dune::experimental
} // end namespace Dune
......@@ -2,7 +2,7 @@
#include "unstructureddatacollector.hh"
namespace Dune { namespace experimental
namespace Dune
{
/// Implementation of \ref DataCollector for linear cells, with discontinuous data.
......@@ -115,4 +115,4 @@ protected:
std::vector<std::int64_t> indexMap_;
};
}} // end namespace Dune::experimental
} // end namespace Dune
......@@ -2,7 +2,7 @@
#include "unstructureddatacollector.hh"
namespace Dune { namespace experimental
namespace Dune
{
/// Implementation of \ref DataCollector for quadratic cells, with continuous data.
......@@ -132,4 +132,4 @@ protected:
using Super::gridView_;
};
}} // end namespace Dune::extensions
} // end namespace Dune
......@@ -6,7 +6,7 @@
#include "structureddatacollector.hh"
namespace Dune { namespace experimental
namespace Dune
{
#if HAVE_DUNE_SPGRID
......@@ -88,4 +88,4 @@ namespace Impl
}
#endif // HAVE_DUNE_SPGRID
}} // end namespace Dune::experimental
} // end namespace Dune
#pragma once
#include <array>
#include <dune/common/filledarray.hh>
#include <dune/common/fvector.hh>
#include "continuousdatacollector.hh"
namespace Dune { namespace experimental
namespace Dune
{
namespace Impl
......@@ -228,4 +229,4 @@ protected:
#endif
};
}} // end namespace Dune::experimental
} // end namespace Dune
......@@ -5,7 +5,7 @@
#include "datacollectorinterface.hh"
namespace Dune { namespace experimental {
namespace Dune {
struct Cells
{
......@@ -41,4 +41,4 @@ protected:
using Super::gridView_;
};
}} // end namespace Dune::experimental
} // end namespace Dune
......@@ -4,7 +4,7 @@
#include "structureddatacollector.hh"
namespace Dune { namespace experimental
namespace Dune
{
// Specialization for YaspGrid
template <class GridView>
......@@ -53,10 +53,10 @@ public:
for (int i = 0; i < dim; ++i) {
wholeExtent_[2*i] = 0;
wholeExtent_[2*i+1] = gridView_.grid().levelSize(level_,i);
wholeExtent_[2*i+1] = grid(gridView_).levelSize(level_,i);
}
auto const& gl = *gridView_.grid().begin(level_);
auto const& gl = *grid(gridView_).begin(level_);
auto const& g = gl.interior[0];
auto const& gc = *g.dataBegin();
for (int i = 0; i < dim; ++i) {
......@@ -64,7 +64,7 @@ public:
extent_[2*i+1] = gc.max(i)+1;
}
auto it = gridView_.grid().begin(level_);
auto it = grid(gridView_).begin(level_);
initGeometry(it->coords);
}
......@@ -97,7 +97,7 @@ public:
template <class T>
std::array<std::vector<T>, 3> coordinatesImpl () const
{
auto it = gridView_.grid().begin(level_);
auto it = grid(gridView_).begin(level_);
auto const& coords = it->coords;
std::array<std::vector<T>, 3> ordinates{};
......@@ -114,6 +114,26 @@ public:
return ordinates;
}
private:
template <class G>
using HostGrid = decltype(std::declval<G>().hostGrid());
template <class GV,
std::enable_if_t<Std::is_detected<HostGrid, typename GV::Grid>::value, int> = 0>
auto const& grid (GV const& gridView) const
{
return gridView.grid().hostGrid();
}
template <class GV,
std::enable_if_t<not Std::is_detected<HostGrid, typename GV::Grid>::value, int> = 0>
auto const& grid (GV const& gridView) const
{
return gridView.grid();
}
protected:
using Super::gridView_;
std::array<int, 6> wholeExtent_;
......@@ -132,4 +152,4 @@ namespace Impl
};
}
}} // end namespace Dune::experimental
} // end namespace Dune
......@@ -2,7 +2,7 @@
#include "vtklocalfunctioninterface.hh"
namespace Dune { namespace experimental
namespace Dune
{
/// Type erasure for dune-functions LocalFunction interface
template <class GridView, class LocalFunction>
......@@ -60,4 +60,4 @@ namespace Dune { namespace experimental
LocalFunction localFct_;
};
}} // end namespace Dune::experimental
} // end namespace Dune
......@@ -4,7 +4,7 @@
#include <string>
#include <utility>
namespace Dune { namespace experimental
namespace Dune
{
template <class Grid, class FilerReaderImp>
class FileReader
......@@ -68,4 +68,4 @@ namespace Dune { namespace experimental
}
};
}} // end namespace Dune::experimental
} // end namespace Dune
......@@ -2,7 +2,7 @@
#include <string>
namespace Dune { namespace experimental
namespace Dune
{
class FileWriter
{
......@@ -14,4 +14,4 @@ namespace Dune { namespace experimental
virtual void write (std::string const& filename) = 0;
};
}} // end namespace Dune::experimental
} // end namespace Dune
......@@ -10,7 +10,7 @@
#include "vtktypes.hh"
namespace Dune { namespace experimental
namespace Dune
{
// Create a grid where the input points and connectivity is already
// connected correctly.
......@@ -116,4 +116,4 @@ namespace Dune { namespace experimental
}
};
}} // end namespace Dune::experimental
} // end namespace Dune
......@@ -6,7 +6,7 @@
#include "vtklocalfunctioninterface.hh"
namespace Dune { namespace experimental
namespace Dune
{
/// Type erasure for Legacy VTKFunction
template <class GridView>
......@@ -42,4 +42,4 @@ namespace Dune { namespace experimental
Entity const* entity_;
};
}} // end namespace Dune::experimental
} // end namespace Dune
......@@ -8,7 +8,7 @@
#include "vtklocalfunction.hh"
#include "vtktypes.hh"
namespace Dune { namespace experimental
namespace Dune
{
template <class GridView>
class VtkFunction
......@@ -86,4 +86,4 @@ namespace Dune { namespace experimental
Vtk::DataTypes type_ = Vtk::FLOAT32;
};
}} // end namespace Dune::experimental
} // end namespace Dune
......@@ -9,7 +9,7 @@
#include "legacyvtkfunction.hh"
#include "defaultvtkfunction.hh"
namespace Dune { namespace experimental
namespace Dune
{
template <class GridView>
class VtkLocalFunction
......@@ -56,4 +56,4 @@ namespace Dune { namespace experimental
std::shared_ptr<VtkLocalFunctionInterface<GridView>> localFct_;
};
}} // end namespace Dune::experimental
} // end namespace Dune
#pragma once
namespace Dune { namespace experimental
namespace Dune
{
/// An abstract base class for LocalFunctions
template <class GridView>
......@@ -23,4 +23,4 @@ namespace Dune { namespace experimental
virtual ~VtkLocalFunctionInterface () = default;
};
}} // end namespace Dune::experimental
} // end namespace Dune
......@@ -7,7 +7,7 @@
#include "gridcreator.hh"
#include "vtktypes.hh"
namespace Dune { namespace experimental
namespace Dune
{
/// File-Reader for Vtk .vtu files
/**
......@@ -129,6 +129,6 @@ namespace Dune { namespace experimental
std::uint64_t offset0_;
};
}} // end namespace Dune::experimental
} // end namespace Dune
#include "vtkreader.impl.hh"
......@@ -12,7 +12,7 @@
#include "utility/filesystem.hh"
#include "utility/string.hh"
namespace Dune { namespace experimental {
namespace Dune {
template <class Grid, class Creator>
void VtkReader<Grid,Creator>::readFromFile (std::string const& filename)
......@@ -512,4 +512,4 @@ std::map<std::string, std::string> VtkReader<Grid,Creator>::parseXml (std::strin
return attr;
}
}} // end namespace Dune::experimental
} // end namespace Dune
......@@ -2,7 +2,7 @@
#include <iostream>
namespace Dune { namespace experimental {
namespace Dune {
namespace Vtk {
std::string to_string (FormatTypes type)
......@@ -154,4 +154,4 @@ CellType::CellType (GeometryType const& t, CellParametrization parametrization)
}
}
}}} // end namespace Dune::experimental::Vtk
}} // end namespace Dune::Vtk
......@@ -7,7 +7,7 @@
#include <dune/geometry/type.hh>
namespace Dune { namespace experimental
namespace Dune
{
namespace Vtk
{
......@@ -113,4 +113,4 @@ namespace Dune { namespace experimental
};
} // end namespace Vtk
}} // end namespace Dune::experimental
} // end namespace Dune
Supports Markdown
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