Skip to content
Snippets Groups Projects
Commit 3ed5d3d7 authored by Robert Klöfkorn's avatar Robert Klöfkorn
Browse files

NewGeometryType --> GeometryType

NewGeometryType is still existent as a typedef.

[[Imported from SVN: r4106]]
parent 6862f069
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ namespace Dune {
This class has to be extended if a grid implementation with new entity types
is added to DUNE.
*/
class NewGeometryType
class GeometryType
{
public:
/** \brief Each entity can be tagged by one of these basic types
......@@ -32,19 +32,18 @@ namespace Dune {
short dim_;
public:
/** \brief Default constructor, not initializing anything */
NewGeometryType () {}
GeometryType () {}
/** \brief Constructor */
NewGeometryType(BasicType basicType, unsigned int dim)
GeometryType(BasicType basicType, unsigned int dim)
: basicType_(basicType), dim_(dim)
{}
/** \brief Constructor for vertices and segments
\todo Add check for dim={0,1} when compiled with a suitable flag
*/
explicit NewGeometryType(unsigned int dim)
explicit GeometryType(unsigned int dim)
: basicType_(cube), dim_(dim)
{}
......@@ -125,18 +124,18 @@ namespace Dune {
/*@}*/
/** \brief Check for equality */
bool operator==(const NewGeometryType& other) const {
bool operator==(const GeometryType& other) const {
return ( (dim()==0 && other.dim()==0)
|| (dim()==1 && other.dim()==1)
|| (dim()==other.dim() && basicType_==other.basicType_) );
}
/** \brief Check for inequality */
bool operator!=(const NewGeometryType& other) const {
bool operator!=(const GeometryType& other) const {
return ! ((*this)==other);
}
bool operator<(const NewGeometryType& other) const {
bool operator<(const GeometryType& other) const {
if (dim() != other.dim())
return dim() < other.dim();
else if (dim()==0 || dim()==1)
......@@ -146,7 +145,7 @@ namespace Dune {
}
/** \brief Prints the type to an output stream */
friend std::ostream& operator<< (std::ostream& s, const NewGeometryType& a)
friend std::ostream& operator<< (std::ostream& s, const GeometryType& a)
{
switch (a.basicType_) {
case simplex :
......@@ -167,8 +166,11 @@ namespace Dune {
};
/** \brief Prints a NewGeometryType::BasicType to an output stream */
inline std::ostream& operator<< (std::ostream& s, NewGeometryType::BasicType type)
//! to be removed soon
typedef GeometryType NewGeometryType;
/** \brief Prints a GeometryType::BasicType to an output stream */
inline std::ostream& operator<< (std::ostream& s, GeometryType::BasicType type)
{
switch (type) {
case NewGeometryType::simplex : s << "simplex"; break;
......@@ -177,7 +179,6 @@ namespace Dune {
case NewGeometryType::prism : s << "prism"; break;
default : s << "[unknown NewGeometryType::BasicType: " << int(type) << "]";
}
return s;
}
}
......
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