==> en dernier ressort, lourd
================================================================================
-Essai a API SMDS a peu près constante
+Essai a API SMDS a peu pres constante
=====================================
SMDS_Mesh
SMDS_MeshVolume: SMDS_MeshCell
-SMDS_VolumeOfNodes: SMDS_MeshVolume
- const SMDS_MeshNode **myNodes; --> A SUPPRIMER, utiliser myID
- int myNbNodes; --> A SUPPRIMER
+SMDS_VolumeOfNodes: SMDS_MeshVolume --> Garder temporairement, utilisation dans StdMesher et SMDS_VolumeTool
+ const SMDS_MeshNode **myNodes; --> Couteux
+ int myNbNodes; --> ""
+
+SMDS_VolumeVtkNodes: SMDS_MeshVolume --> Utiliser systematiquement dans SMDS,
+ --> IMPLEMENTER.
+
SMDS_MeshElementIDFactory: SMDS_MeshNodeIDFactory
vector<int> myIDElements; // index = ID client, value = ID vtk --> A SUPPRIMER, ne sert que dans SMDS_MeshElementIDFactory
vector<int> myVtkIndex; // index = ID vtk, value = ID client --> A REPORTER dans SMDS_Mesh
+
+
+
========= TODO ============
enlever vtkId de SMDS_MeshCell, utiliser SMDS_MeshElementIDFactory.
/home/prascle/projets/SALOME/SMESH/BR_SMDS_MEMIMP/SMESH_SRC/src/SMESH/SMESH_Gen.cxx [294] : VSR - SMESH_Gen::Compute() finished, OK = 1
in use bytes = 498773760
delta = 460 Mo (45 Mo de plus que sur Sarge 64 bits ?)
+
+Debian Sarge 64 bits
+in use bytes = 17076352
+in use bytes = 431600032
+delta = 415 Mo
}
}
-//=======================================================================
-//function : Print
-//purpose :
-//=======================================================================
-
void SMDS_VolumeOfNodes::Print(ostream & OS) const
{
OS << "volume <" << GetID() << "> : ";
return 0;
}
-/// ===================================================================
/*!
* \brief Iterator on node of volume
*/
-/// ===================================================================
-
class SMDS_VolumeOfNodes_MyIterator:public SMDS_NodeArrayElemIterator
{
public:
SMDS_NodeArrayElemIterator( s, & s[ l ]) {}
};
-/// ===================================================================
/*!
* \brief Iterator on faces or edges of volume
*/
-/// ===================================================================
-
class _MySubIterator : public SMDS_ElemIterator
{
vector< const SMDS_MeshElement* > myElems;
}
return aType;
}
+
+
+// *************************************************************************************
+//
+
+SMDS_VolumeVtkNodes::SMDS_VolumeVtkNodes()
+{
+}
+
+bool SMDS_VolumeVtkNodes::ChangeNodes(const SMDS_MeshNode* nodes[],
+ const int nbNodes)
+{
+ // utilise dans SMDS_Mesh
+ return true;
+}
+
+SMDS_VolumeVtkNodes::~SMDS_VolumeVtkNodes()
+{
+}
+
+void SMDS_VolumeVtkNodes::Print(ostream & OS) const
+{
+ OS << "volume <" << GetID() << "> : ";
+}
+
+int SMDS_VolumeVtkNodes::NbFaces() const
+{
+ switch(NbNodes())
+ {
+ case 4: return 4;
+ case 5: return 5;
+ case 6: return 5;
+ case 8: return 6;
+ default: MESSAGE("invalid number of nodes");
+ }
+ return 0;
+}
+
+int SMDS_VolumeVtkNodes::NbNodes() const
+{
+ return 0;
+}
+
+int SMDS_VolumeVtkNodes::NbEdges() const
+{
+ switch(NbNodes())
+ {
+ case 4: return 6;
+ case 5: return 8;
+ case 6: return 9;
+ case 8: return 12;
+ default: MESSAGE("invalid number of nodes");
+ }
+ return 0;
+}
+
+SMDS_ElemIteratorPtr SMDS_VolumeVtkNodes::elementsIterator(SMDSAbs_ElementType type) const
+{
+ switch(type)
+ {
+// case SMDSAbs_Volume:
+// return SMDS_MeshElement::elementsIterator(SMDSAbs_Volume);
+// case SMDSAbs_Node:
+// return SMDS_ElemIteratorPtr(new SMDS_VolumeVtkNodes_MyIterator(myNodes,myNbNodes));
+// case SMDSAbs_Face:
+// return SMDS_ElemIteratorPtr(new _MySubWNIterator(this,SMDSAbs_Face));
+// case SMDSAbs_Edge:
+// return SMDS_ElemIteratorPtr(new _MySubWNIterator(this,SMDSAbs_Edge));
+ default:
+ MESSAGE("ERROR : Iterator not implemented");
+ return SMDS_ElemIteratorPtr((SMDS_ElemIterator*)NULL);
+ }
+}
+
+SMDSAbs_ElementType SMDS_VolumeVtkNodes::GetType() const
+{
+ return SMDSAbs_Volume;
+}
+
+/*!
+ * \brief Return node by its index
+ * \param ind - node index
+ * \retval const SMDS_MeshNode* - the node
+ */
+const SMDS_MeshNode* SMDS_VolumeVtkNodes::GetNode(const int ind) const
+{
+ return 0;
+}
+
+SMDSAbs_EntityType SMDS_VolumeVtkNodes::GetEntityType() const
+{
+ SMDSAbs_EntityType aType = SMDSEntity_Tetra;
+ switch(NbNodes())
+ {
+ case 4: aType = SMDSEntity_Tetra; break;
+ case 5: aType = SMDSEntity_Pyramid; break;
+ case 6: aType = SMDSEntity_Penta; break;
+ case 8:
+ default: aType = SMDSEntity_Hexa; break;
+ }
+ return aType;
+}
protected:
SMDS_ElemIteratorPtr
elementsIterator(SMDSAbs_ElementType type) const;
- const SMDS_MeshNode** myNodes;
- int myNbNodes;
+ const SMDS_MeshNode** myNodes;
+ int myNbNodes;
+
+};
+
+class SMDS_EXPORT SMDS_VolumeVtkNodes:public SMDS_MeshVolume
+{
+public:
+ SMDS_VolumeVtkNodes();
+ bool ChangeNodes(const SMDS_MeshNode* nodes[],
+ const int nbNodes);
+ ~SMDS_VolumeVtkNodes();
+
+ void Print(std::ostream & OS) const;
+ int NbFaces() const;
+ int NbNodes() const;
+ int NbEdges() const;
+ virtual SMDSAbs_ElementType GetType() const;
+ virtual SMDSAbs_EntityType GetEntityType() const;
+
+ /*!
+ * \brief Return node by its index
+ * \param ind - node index
+ * \retval const SMDS_MeshNode* - the node
+ */
+ virtual const SMDS_MeshNode* GetNode(const int ind) const;
+
+ protected:
+ SMDS_ElemIteratorPtr
+ elementsIterator(SMDSAbs_ElementType type) const;
};
+
+
#endif
MESSAGE( "VSR - SMESH_Gen::Compute() finished, OK = " << ret);
MEMOSTAT;
+
+ SMESHDS_Mesh *myMesh = aMesh.GetMeshDS();
+ list<int> listind = myMesh->SubMeshIndices();
+ list<int>::iterator it = listind.begin();
+ int total = 0;
+ for(; it != listind.end(); ++it)
+ {
+ ::SMESHDS_SubMesh *subMesh = myMesh->MeshElements(*it);
+ total += subMesh->getSize();
+ }
+ cerr << "total elements and nodes in submesh sets:" << total << endl;
return ret;
}
#include "utilities.h"
#include "SMDS_SetIterator.hxx"
+#include <iostream>
using namespace std;
sm->Clear();
}
}
+
+int SMESHDS_SubMesh::getSize()
+{
+ int a = sizeof(myElements);
+ int b = sizeof(myNodes);
+ int c = NbNodes();
+ int d = NbElements();
+ cerr << "SMESHDS_SubMesh::NbNodes " << c << endl;
+ cerr << "SMESHDS_SubMesh::NbElements " << d << endl;
+ cerr << "SMESHDS_SubMesh::myNodes " << b << endl;
+ cerr << "SMESHDS_SubMesh::myElements " << a << endl;
+ return c+d;
+}
+
// clear the contents
void Clear();
+ int getSize();
private: