Skip to content
Snippets Groups Projects
Commit 790e2ce4 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MeL] Simple Element::operator<<() for debugging.

parent 76e0d75d
No related branches found
No related tags found
No related merge requests found
...@@ -186,4 +186,20 @@ bool Element::isBoundaryElement() const ...@@ -186,4 +186,20 @@ bool Element::isBoundaryElement() const
[](MeshLib::Element const*const e){ return e == nullptr; }); [](MeshLib::Element const*const e){ return e == nullptr; });
} }
#ifndef NDEBUG
std::ostream& operator<<(std::ostream& os, Element const& e)
{
os << "Element " << e._id << " @ " << &e
<< " with " << e.getNNeighbors() << " neighbours\n";
unsigned const nnodes = e.getNNodes();
MeshLib::Node* const* const nodes = e.getNodes();
os << nnodes << " nodes: { ";
for (unsigned n = 0; n < nnodes; ++n)
os << nodes[n]->getID() << " @ " << nodes[n] << " ";
os << "}\n";
return os;
}
#endif // NDEBUG
} }
...@@ -207,6 +207,9 @@ public: ...@@ -207,6 +207,9 @@ public:
*/ */
virtual bool testElementNodeOrder() const = 0; virtual bool testElementNodeOrder() const = 0;
#ifndef NDEBUG
friend std::ostream& operator<<(std::ostream& os, Element const& e);
#endif // NDEBUG
protected: protected:
/// Constructor for a generic mesh element without an array of mesh nodes. /// Constructor for a generic mesh element without an array of mesh nodes.
......
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