Skip to content
Snippets Groups Projects

Feature/interpolation

Merged Praetorius, Simon requested to merge feature/interpolation into master
Files
19
+ 50
10
@@ -19,20 +19,21 @@ namespace Dune
private:
using ctype = typename HostGrid::ctype;
/// Entity in the host grid
using HostGridEntity = typename HostGrid::Traits::template Codim<0>::Entity;
public:
enum { dimension = HostGrid::dimension };
enum { codimension = 0 };
enum { dimension = HostGridEntity::dimension };
enum { mydimension = HostGridEntity::mydimension };
/// The type of a local geometry
using LocalGeometry = MultiMeshLocalGeometry<dimension, dimension, HostGrid>;
using EntitySeed = MultiMeshEntitySeed<0, HostGrid>;
/// Entity in the host grid
using HostGridEntity = typename HostGrid::Traits::template Codim<0>::Entity;
/// Containertype
using Super = std::vector<HostGridEntity>;
/// Seed representing the vector of entities in the MultiMesh
using EntitySeed = MultiEntitySeed<0, HostGrid>;
public:
/// Constructor from std::vector
using std::vector<HostGridEntity>::vector;
@@ -62,6 +63,39 @@ namespace Dune
return localGeometry(source, target).global(sourceLocal);
}
/// Return the partitionType of any entity in the multiEntity
// [[ expects: all partitionType are the same ]]
PartitionType partitionType () const
{
return max().partitionType();
}
/// Return the geometry of the entity with maximal level
typename HostGridEntity::Geometry geometry () const
{
return max().geometry();
}
/// Return the type of the entity with maximal level
GeometryType type () const
{
return max().type();
}
/// The entities are always regular, since irregular entities are not allowed in multimesh
bool isRegular() const { return true; }
/// Return the maximal level
int level () const
{
return max().level();
}
/// Return whether the entity with minimal level has boundary intersections
bool hasBoundaryIntersections () const
{
return min().hasBoundaryIntersections();
}
/// \brief Return the entity seed which contains sufficient information
/// to generate the entity again and uses as little memory as possible.
@@ -69,9 +103,15 @@ namespace Dune
* The MultiMeshEntitySeed contains the HostGridEntitySeed and the index of
* the grid it is extracted from.
**/
EntitySeed seed (std::size_t entity_i) const
MultiMeshEntitySeed<0,HostGrid> seed (std::size_t idx) const
{
return {(*this)[idx], idx};
}
/// Return an entity seed to restore the multi-entity.
EntitySeed seed () const
{
return {(*this)[entity_i], entity_i};
return {*this};
}
/// Return the entity with maximal level
Loading