]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
[bos #42217][EDF 28921] Horseshoe with bodyfitting.
authorKonstantin Leontev <Konstantin.LEONTEV@opencascade.com>
Tue, 6 Aug 2024 11:24:46 +0000 (12:24 +0100)
committerKonstantin Leontev <Konstantin.LEONTEV@opencascade.com>
Tue, 6 Aug 2024 11:24:46 +0000 (12:24 +0100)
Added operators << for nodes and links debug output.

src/SMDS/SMDS_FaceOfNodes.hxx
src/SMDS/SMDS_MeshElement.hxx
src/SMDS/SMDS_MeshNode.hxx
src/SMDS/SMDS_PolygonalFaceOfNodes.hxx
src/SMDS/SMDS_VolumeOfNodes.hxx
src/StdMeshers/StdMeshers_Cartesian_3D_Grid.hxx
src/StdMeshers/StdMeshers_Cartesian_3D_Hexahedron.hxx

index 1ccd14f6a4cf7c417edd785252a65ef5594e6485..225e620ab8002cde268245556b5d0ddcc513c220 100644 (file)
@@ -32,7 +32,7 @@
 class SMDS_EXPORT SMDS_FaceOfNodes: public SMDS_CellOfNodes
 {
  public:
-  void Print(std::ostream & OS) const;
+  virtual void Print(std::ostream & OS) const override;
   SMDS_FaceOfNodes(const SMDS_MeshNode* node1,
                    const SMDS_MeshNode* node2,
                    const SMDS_MeshNode* node3);
index eeec4a1f7073fbb192397c7fcd9858bc323d026e..1d44ecf757b3ce4091ef010ff51e292baa032545 100644 (file)
@@ -142,7 +142,7 @@ public:
 
   SMDS_Mesh* GetMesh() const;
 
-  void Print(std::ostream & OS) const;
+  virtual void Print(std::ostream & OS) const;
 
   friend SMDS_EXPORT std::ostream & operator <<(std::ostream & OS, const SMDS_MeshElement *);
   friend class SMDS_ElementFactory;
index 99549e937ac82351651ac68882625c19e62cba14..e2aa112707a5047b939eeea72fc56a3cfca6c027 100644 (file)
@@ -65,7 +65,7 @@ class SMDS_EXPORT SMDS_MeshNode: public SMDS_MeshElement
   virtual bool IsMediumNode(const SMDS_MeshNode* /*node*/) const  { return false; }
   virtual int  NbCornerNodes() const { return 1; }
 
-  void Print(std::ostream & OS) const;
+  virtual void Print(std::ostream & OS) const override;
 
  private:
 
index 7dbff12111138adf448cbce3465218d5db14e488..8b3d4fa5dfee6e95147941dcbbbe69e12f5f3c1c 100644 (file)
@@ -47,7 +47,7 @@ class SMDS_EXPORT SMDS_PolygonalFaceOfNodes : public SMDS_CellOfNodes
   virtual int NbEdges() const;
   virtual int NbFaces() const;
 
-  virtual void Print (std::ostream & OS) const;
+  virtual void Print (std::ostream & OS) const override;
 
   virtual const SMDS_MeshNode* GetNode(const int ind) const;
 
index 36a515c5d215b1552675233e3c461b52ddeebc52..7098cd623efe24af82dd54b58eef3e980af0ce3a 100644 (file)
@@ -62,7 +62,7 @@ class SMDS_EXPORT SMDS_VolumeOfNodes: public SMDS_CellOfNodes
                    const int            nbNodes);
   ~SMDS_VolumeOfNodes();
 
-  void Print(std::ostream & OS) const;
+  virtual void Print(std::ostream & OS) const override;
   int NbFaces() const;
   int NbNodes() const;
   int NbEdges() const;
index 8ac347c524cfbafd12b198070a674a8b11ec14ce..7177bbd372474e3a116bcb45e20934dffbd5cc59 100644 (file)
@@ -539,6 +539,9 @@ namespace Cartesian3D
       {
         threads.emplace_back(f, std::ref(*it));
       }
+
+      // This line for debug in sequential mode
+      // std::for_each(it, last, f);
     }
     else
     {
index ade329d8de36a793267a9cb950ca5a45124399d0..dbaa7cf52ef343d63c568f478b2bbeaf07ec6bd9 100644 (file)
@@ -157,6 +157,24 @@ namespace Cartesian3D
 
       void Add( const StdMeshers::Cartesian3D::E_IntersectPoint* ip );
       void clear();
+
+      friend std::ostream& operator<<(std::ostream& os, const _Node& node)
+      {
+        if (node._node)
+        {
+          os << "Node at hexahedron corner: ";
+          node._node->Print(os); 
+        }
+        else if (node._intPoint && node._intPoint->_node)
+        {
+          os << "Node at intersection point: ";
+          node._intPoint->_node->Print(os); // intersection point
+        }
+        else
+          os << "mesh node is null\n";
+
+        return os;
+      }
     };
 
     // --------------------------------------------------------------------------------
@@ -172,6 +190,25 @@ namespace Cartesian3D
       _Link(): _nodes{ 0, 0 }, _faces{ 0, 0 } {}
 
       void clear();
+
+      friend std::ostream& operator<<(std::ostream& os, const _Link& link)
+      {
+        os << "Link:\n";
+
+        for (std::size_t i = 0; i < nodesNum; ++i)
+        {
+          if (link._nodes[i])
+            os << *link._nodes[i];
+          else
+            os << "link node with index " << i << " is null\n";
+        }
+
+        os << "_fIntPoints: " << link._fIntPoints.size() << '\n';
+        os << "_fIntNodes: " << link._fIntNodes.size() << '\n';
+        os << "_splits: " << link._splits.size() << '\n';
+
+        return os;
+      }
     };
 
     // --------------------------------------------------------------------------------
@@ -241,6 +278,16 @@ namespace Cartesian3D
           }
         }
       }
+
+      friend std::ostream& operator<<(std::ostream& os, const _OrientedLink& link)
+      {
+        if (link._link)
+          os << "Oriented " << *link._link;
+        else
+          os << "Oriented link is null\n";
+
+        return os;
+      }
     };
 
     // --------------------------------------------------------------------------------
@@ -314,6 +361,34 @@ namespace Cartesian3D
         _polyLinks.push_back( l );
         _links.push_back( _OrientedLink( &_polyLinks.back() ));
       }
+
+      friend std::ostream& operator<<(std::ostream& os, const _Face& face)
+      {
+        os << "Face " << face._name << '\n';
+
+        os << "Links on GridLines: \n";
+        for (const auto& link : face._links)
+        {
+          os << link;
+        }
+
+        os << "Links added to close a polygonal face: \n";
+        for (const auto& link : face._polyLinks)
+        {
+          os << link;
+        }
+
+        os << "Nodes at intersection with EDGEs: \n";
+        for (const auto node : face._eIntNodes)
+        {
+          if (node)
+          {
+            os << *node;
+          }
+        }
+
+        return os;
+      }
     };
 
     // --------------------------------------------------------------------------------