diff --git a/DataTypes.h b/DataTypes.h index 0fd15a83aa8b0ce7f10f6c0ebe764cadd1a6f540..2ea1e9f512884d16f15164cc3da2f595bf9e3631 100644 --- a/DataTypes.h +++ b/DataTypes.h @@ -28,15 +28,16 @@ struct FiniteElement { FiniteElement() = default; FiniteElement(unsigned int p_ID, unsigned int p_areaID, - std::vector p_nodesID) : ID(p_ID), - areaID(p_areaID), nodesID(std::move(p_nodesID)) {} + std::vector &p_nodesID) : ID(p_ID), + areaID(p_areaID), nodesID(p_nodesID) {} friend std::ostream &operator<<(std::ostream &ost, const FiniteElement &element) { ost << "ID: " << element.ID << ", area ID: " << element.areaID << ", nodes ID: {"; for (unsigned int nodeID: element.nodesID) { ost << nodeID << " "; } - ost << "}"; + ost << "\b" << "}"; + return ost; } }; @@ -50,4 +51,13 @@ struct BoundaryElement { BoundaryElement(unsigned int p_ID, unsigned int p_boundaryID, std::vector p_nodesID) : ID(p_ID), boundaryID(p_boundaryID), nodesID(std::move(p_nodesID)) {} + + friend std::ostream &operator<<(std::ostream &ost, const BoundaryElement &element) { + ost << "ID: " << element.ID << ", boundary ID: " << element.boundaryID << ", nodes ID: {"; + for (unsigned int nodeID: element.nodesID) { + ost << nodeID << " "; + } + ost << "\b" << "}"; + return ost; + } }; \ No newline at end of file