mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-29 19:00:35 +05:00
PR: temporary
This commit is contained in:
parent
4bd53ae404
commit
8f66923fb0
@ -8,7 +8,7 @@ n'utiliser que vtkUnstructuredGrid, ne pas avor d'objets SMDS_MeshElement mais s
|
||||
==> en dernier ressort, lourd
|
||||
================================================================================
|
||||
|
||||
Essai a API SMDS a peu près constante
|
||||
Essai a API SMDS a peu pres constante
|
||||
=====================================
|
||||
|
||||
SMDS_Mesh
|
||||
@ -36,14 +36,21 @@ SMDS_MeshCell: SMDS_MeshElement --> generique pour tous les elements
|
||||
|
||||
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.
|
||||
@ -60,3 +67,8 @@ in use bytes = 32843200
|
||||
/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
|
||||
|
@ -132,11 +132,6 @@ SMDS_VolumeOfNodes::~SMDS_VolumeOfNodes()
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Print
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void SMDS_VolumeOfNodes::Print(ostream & OS) const
|
||||
{
|
||||
OS << "volume <" << GetID() << "> : ";
|
||||
@ -176,12 +171,9 @@ int SMDS_VolumeOfNodes::NbEdges() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// ===================================================================
|
||||
/*!
|
||||
* \brief Iterator on node of volume
|
||||
*/
|
||||
/// ===================================================================
|
||||
|
||||
class SMDS_VolumeOfNodes_MyIterator:public SMDS_NodeArrayElemIterator
|
||||
{
|
||||
public:
|
||||
@ -189,12 +181,9 @@ class SMDS_VolumeOfNodes_MyIterator:public SMDS_NodeArrayElemIterator
|
||||
SMDS_NodeArrayElemIterator( s, & s[ l ]) {}
|
||||
};
|
||||
|
||||
/// ===================================================================
|
||||
/*!
|
||||
* \brief Iterator on faces or edges of volume
|
||||
*/
|
||||
/// ===================================================================
|
||||
|
||||
class _MySubIterator : public SMDS_ElemIterator
|
||||
{
|
||||
vector< const SMDS_MeshElement* > myElems;
|
||||
@ -260,3 +249,105 @@ SMDSAbs_EntityType SMDS_VolumeOfNodes::GetEntityType() const
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
@ -82,7 +82,37 @@ class SMDS_EXPORT SMDS_VolumeOfNodes:public SMDS_MeshVolume
|
||||
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
|
||||
|
@ -293,6 +293,17 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
|
||||
#include "utilities.h"
|
||||
#include "SMDS_SetIterator.hxx"
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -321,3 +322,17 @@ void SMESHDS_SubMesh::Clear()
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -63,6 +63,7 @@ class SMESHDS_EXPORT SMESHDS_SubMesh
|
||||
|
||||
// clear the contents
|
||||
void Clear();
|
||||
int getSize();
|
||||
|
||||
private:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user