Skip to content
Snippets Groups Projects
Commit 45d74a9e authored by Oliver Sander's avatar Oliver Sander
Browse files

Added two new methods:

- operator<< for screen output of new geometry types
- A cast operator to the old GeometryType.  This way we can
  switch the grid interface methods to the new implementation
  of GeometryType without having to change any other code.

[[Imported from SVN: r3740]]
parent 5f6df8b2
No related branches found
No related tags found
No related merge requests found
......@@ -89,6 +89,18 @@ namespace Dune {
: basicType_(basicType), dim_(dim)
{}
/** \brief Cast to old-style GeometryType
\deprecated Only here for backward compatibility
*/
operator GeometryType() const /*DUNE_DEPRECATED*/ {
switch (basicType_) {
case simplex : return Dune::simplex;
case cube : return Dune::cube;
case pyramid : return Dune::pyramid;
case prism : return Dune::prism;
}
}
/** @name Setup Methods */
/*@{*/
......@@ -162,6 +174,26 @@ namespace Dune {
/*@}*/
/** \brief Prints the type to an output stream */
friend std::ostream& operator<< (std::ostream& s, const NewGeometryType& a)
{
switch (a.basicType_) {
case simplex :
s << "(simplex, " << a.dim_ << ")";
break;
case cube :
s << "(cube, " << a.dim_ << ")";
break;
case pyramid :
s << "pyramid";
break;
case prism :
s << "prims";
}
return s;
}
};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment