Skip to content
Snippets Groups Projects
Commit 4211adc2 authored by Peter Bastian's avatar Peter Bastian
Browse files

added geometry types simplex and hypercube.

These triangle, hexahedron, ... should be replaced from now on
because this simplifies the writing of dimension independent code.
The old types are still supported in appropriate places though.

added three new size methods. I implemented dummy versions (throwing
exceptions) in onedgrid, uggrid.
Working versions are implemented in yaspgrid and sgrid

throw exception for LeafIterator depending on PartitionIteratorType which
is not standard

[[Imported from SVN: r1954]]
parent 75f3d90d
Branches
Tags
No related merge requests found
......@@ -50,7 +50,8 @@ namespace Dune {
enum GeometryType {vertex=0,line=1, triangle=2, quadrilateral=3, tetrahedron=4,
pyramid=5, prism=6, hexahedron=7,
iso_triangle=8, iso_quadrilateral=9, unknown=127};
iso_triangle=8, iso_quadrilateral=9,
simplex=64, hypercube=65, unknown=127};
/*!
Specify the format to store grid and vector data
......@@ -147,6 +148,10 @@ namespace Dune {
return "iso_triangle";
case iso_quadrilateral :
return "iso_quadrilateral";
case simplex :
return "simplex";
case hypercube :
return "hypercube";
case unknown :
return "unknown";
}
......@@ -333,6 +338,24 @@ namespace Dune {
return asImp().size(level,codim);
}
//! number of leaf entities per codim in this process
int size (int codim) const
{
return asImp().size(codim);
}
//! number of entities per level, codim and geometry type in this process
int size (int level, int codim, GeometryType type) const
{
return asImp().size(level,codim,type);
}
//! number of leaf entities per codim and geometry type in this process
int size (int codim, GeometryType type) const
{
return asImp().size(codim,type);
}
//! return size (= distance in graph) of overlap region
int overlapSize (int level, int codim) const
{
......@@ -424,6 +447,7 @@ namespace Dune {
template<PartitionIteratorType pitype>
LeafIterator leafbegin(int maxLevel) const
{
DUNE_THROW(Dune::NotImplemented, "PartitionIteratorType for leafbegin is ignored");
return GenericLeafIterator< const GridImp >(asImp(),maxLevel,false);
};
......@@ -431,6 +455,7 @@ namespace Dune {
template<PartitionIteratorType pitype>
LeafIterator leafend(int maxLevel) const
{
DUNE_THROW(Dune::NotImplemented, "PartitionIteratorType for leafend is ignored");
return GenericLeafIterator< const GridImp >(asImp(),maxLevel,true);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment