mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-29 02:40:35 +05:00
PR: debug triangles
This commit is contained in:
parent
faf44b9356
commit
3c1d19eebf
@ -31,5 +31,8 @@ find doc -name Makefile.in | xargs rm -f
|
|||||||
find idl -name Makefile.in | xargs rm -f
|
find idl -name Makefile.in | xargs rm -f
|
||||||
find resources -name Makefile.in | xargs rm -f
|
find resources -name Makefile.in | xargs rm -f
|
||||||
find salome_adm -name Makefile.in | xargs rm -f
|
find salome_adm -name Makefile.in | xargs rm -f
|
||||||
|
find adm_local -name Makefile.in | xargs rm -f
|
||||||
find src -name Makefile.in | xargs rm -f
|
find src -name Makefile.in | xargs rm -f
|
||||||
rm -f Makefile.in
|
rm -f Makefile.in
|
||||||
|
cd adm_local/unix/config_files
|
||||||
|
rm -f config.* depcomp install-sh l*.m4 ltmain.sh missing py-compile
|
||||||
|
@ -39,10 +39,16 @@
|
|||||||
#include "SMDS_SpacePosition.hxx"
|
#include "SMDS_SpacePosition.hxx"
|
||||||
|
|
||||||
#include <vtkUnstructuredGrid.h>
|
#include <vtkUnstructuredGrid.h>
|
||||||
|
#include <vtkUnstructuredGridWriter.h>
|
||||||
#include <vtkUnsignedCharArray.h>
|
#include <vtkUnsignedCharArray.h>
|
||||||
|
#include <vtkCell.h>
|
||||||
|
#include <vtkCellLinks.h>
|
||||||
|
#include <vtkIdList.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
@ -358,7 +364,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
|
|||||||
int ID)
|
int ID)
|
||||||
{
|
{
|
||||||
//MESSAGE("AddFaceWithID " << ID)
|
//MESSAGE("AddFaceWithID " << ID)
|
||||||
SMDS_MeshFace * face=createTriangle(n1, n2, n3, myElementIDFactory->GetFreeID());
|
SMDS_MeshFace * face=createTriangle(n1, n2, n3, ID);
|
||||||
|
|
||||||
if (face && !registerElement(ID, face)) {
|
if (face && !registerElement(ID, face)) {
|
||||||
RemoveElement(face, false);
|
RemoveElement(face, false);
|
||||||
@ -1208,7 +1214,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddPolyhedralVolume
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
bool SMDS_Mesh::registerElement(int ID, SMDS_MeshElement* element)
|
bool SMDS_Mesh::registerElement(int ID, SMDS_MeshElement* element)
|
||||||
{
|
{
|
||||||
//MESSAGE("registerElement " << ID)
|
//MESSAGE("registerElement " << ID);
|
||||||
if ((ID < myIDElements.size()) && myIDElements[ID] >= 0) // --- already bound
|
if ((ID < myIDElements.size()) && myIDElements[ID] >= 0) // --- already bound
|
||||||
{
|
{
|
||||||
MESSAGE(" --------------------------------- already bound "<< ID << " " << myIDElements[ID]);
|
MESSAGE(" --------------------------------- already bound "<< ID << " " << myIDElements[ID]);
|
||||||
@ -1231,7 +1237,7 @@ bool SMDS_Mesh::registerElement(int ID, SMDS_MeshElement* element)
|
|||||||
}
|
}
|
||||||
|
|
||||||
myIDElements[ID] = vtkId;
|
myIDElements[ID] = vtkId;
|
||||||
//MESSAGE("smds:" << ID << " vtk:" << cellId );
|
//MESSAGE("smds:" << ID << " vtk:" << vtkId );
|
||||||
|
|
||||||
if (vtkId >= myVtkIndex.size()) // --- resize local vector
|
if (vtkId >= myVtkIndex.size()) // --- resize local vector
|
||||||
{
|
{
|
||||||
@ -1297,6 +1303,7 @@ SMDS_MeshFace * SMDS_Mesh::createTriangle(const SMDS_MeshNode * node1,
|
|||||||
face = facevtk;
|
face = facevtk;
|
||||||
adjustmyCellsCapacity(ID);
|
adjustmyCellsCapacity(ID);
|
||||||
myCells[ID] = face;
|
myCells[ID] = face;
|
||||||
|
//MESSAGE("createTriangle " << ID << " " << face);
|
||||||
myInfo.myNbTriangles++;
|
myInfo.myNbTriangles++;
|
||||||
return face;
|
return face;
|
||||||
}
|
}
|
||||||
@ -2129,7 +2136,10 @@ void SMDS_Mesh::DebugStats() const
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
int SMDS_Mesh::NbNodes() const
|
int SMDS_Mesh::NbNodes() const
|
||||||
{
|
{
|
||||||
return myNodes.size();
|
//MESSAGE(myGrid->GetNumberOfPoints());
|
||||||
|
//MESSAGE(myInfo.NbNodes());
|
||||||
|
//MESSAGE(myNodeMax);
|
||||||
|
return myInfo.NbNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -3562,6 +3572,11 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
|||||||
void SMDS_Mesh::updateNodeMinMax()
|
void SMDS_Mesh::updateNodeMinMax()
|
||||||
{
|
{
|
||||||
myNodeMin = 0;
|
myNodeMin = 0;
|
||||||
|
if (myNodes.size() == 0)
|
||||||
|
{
|
||||||
|
myNodeMax=0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
while (!myNodes[myNodeMin] && (myNodeMin<myNodes.size()))
|
while (!myNodes[myNodeMin] && (myNodeMin<myNodes.size()))
|
||||||
myNodeMin++;
|
myNodeMin++;
|
||||||
myNodeMax=myNodes.size()-1;
|
myNodeMax=myNodes.size()-1;
|
||||||
@ -3594,3 +3609,51 @@ void SMDS_Mesh::adjustStructure()
|
|||||||
myGrid->GetPoints()->GetData()->SetNumberOfTuples(myNodeIDFactory->GetMaxID()+1);
|
myGrid->GetPoints()->GetData()->SetNumberOfTuples(myNodeIDFactory->GetMaxID()+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SMDS_Mesh::dumpGrid(string ficdump)
|
||||||
|
{
|
||||||
|
MESSAGE("SMDS_Mesh::dumpGrid " << ficdump);
|
||||||
|
vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New();
|
||||||
|
aWriter->SetFileName(ficdump.c_str());
|
||||||
|
aWriter->SetInput(myGrid);
|
||||||
|
if(myGrid->GetNumberOfCells())
|
||||||
|
{
|
||||||
|
aWriter->Write();
|
||||||
|
}
|
||||||
|
aWriter->Delete();
|
||||||
|
ficdump = ficdump + "_connectivity";
|
||||||
|
ofstream ficcon(ficdump.c_str(), ios::out);
|
||||||
|
int nbPoints = myGrid->GetNumberOfPoints();
|
||||||
|
ficcon << "-------------------------------- points " << nbPoints << endl;
|
||||||
|
for (int i=0; i<nbPoints; i++)
|
||||||
|
{
|
||||||
|
ficcon << i << " " << *(myGrid->GetPoint(i)) << " " << *(myGrid->GetPoint(i)+1) << " " << " " << *(myGrid->GetPoint(i)+2) << endl;
|
||||||
|
}
|
||||||
|
int nbCells = myGrid->GetNumberOfCells();
|
||||||
|
ficcon << "-------------------------------- cells " << nbCells << endl;
|
||||||
|
for (int i=0; i<nbCells; i++)
|
||||||
|
{
|
||||||
|
ficcon << i << " - " << myGrid->GetCell(i)->GetCellType() << " -";
|
||||||
|
int nbptcell = myGrid->GetCell(i)->GetNumberOfPoints();
|
||||||
|
vtkIdList *listid = myGrid->GetCell(i)->GetPointIds();
|
||||||
|
for (int j=0; j<nbptcell; j++)
|
||||||
|
{
|
||||||
|
ficcon << " " << listid->GetId(j);
|
||||||
|
}
|
||||||
|
ficcon << endl;
|
||||||
|
}
|
||||||
|
ficcon << "-------------------------------- connectivity " << nbPoints << endl;
|
||||||
|
vtkCellLinks *links = myGrid->GetCellLinks();
|
||||||
|
for (int i=0; i<nbPoints; i++)
|
||||||
|
{
|
||||||
|
int ncells = links->GetNcells(i);
|
||||||
|
vtkIdType *cells = links->GetCells(i);
|
||||||
|
ficcon << i << " - " << ncells << " -";
|
||||||
|
for (int j=0; j<ncells; j++)
|
||||||
|
{
|
||||||
|
ficcon << " " << cells[j];
|
||||||
|
}
|
||||||
|
ficcon << endl;
|
||||||
|
}
|
||||||
|
ficcon.close();
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -569,6 +569,7 @@ public:
|
|||||||
void incrementNodesCapacity(int nbNodes);
|
void incrementNodesCapacity(int nbNodes);
|
||||||
void incrementCellsCapacity(int nbCells);
|
void incrementCellsCapacity(int nbCells);
|
||||||
void adjustStructure();
|
void adjustStructure();
|
||||||
|
void dumpGrid(string ficdump="dumpGrid");
|
||||||
|
|
||||||
int myCellLinksSize;
|
int myCellLinksSize;
|
||||||
|
|
||||||
|
@ -36,6 +36,8 @@
|
|||||||
#define protected protected
|
#define protected protected
|
||||||
|
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
|
#include "Utils_SALOME_Exception.hxx"
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -191,6 +193,12 @@ private:
|
|||||||
int vtkId = myCells[iter];
|
int vtkId = myCells[iter];
|
||||||
int smdsId = myMesh->fromVtkToSmds(vtkId);
|
int smdsId = myMesh->fromVtkToSmds(vtkId);
|
||||||
const SMDS_MeshElement* elem = myMesh->FindElement(smdsId);
|
const SMDS_MeshElement* elem = myMesh->FindElement(smdsId);
|
||||||
|
if (!elem)
|
||||||
|
{
|
||||||
|
assert(0);
|
||||||
|
throw SALOME_Exception("SMDS_MeshNode_MyInvIterator problem Null element");
|
||||||
|
}
|
||||||
|
//MESSAGE("vtkId " << vtkId << " smdsId " << smdsId << " " << (elem!=0));
|
||||||
iter++;
|
iter++;
|
||||||
return elem;
|
return elem;
|
||||||
}
|
}
|
||||||
@ -200,7 +208,7 @@ SMDS_ElemIteratorPtr SMDS_MeshNode::
|
|||||||
GetInverseElementIterator(SMDSAbs_ElementType type) const
|
GetInverseElementIterator(SMDSAbs_ElementType type) const
|
||||||
{
|
{
|
||||||
vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myID);
|
vtkCellLinks::Link l = SMDS_Mesh::_meshList[myMeshId]->getGrid()->GetCellLinks()->GetLink(myID);
|
||||||
//MESSAGE("ncells " << l.ncells);
|
//MESSAGE("myID " << myID << " ncells " << l.ncells);
|
||||||
return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyInvIterator(SMDS_Mesh::_meshList[myMeshId], l.cells, l.ncells, type));
|
return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyInvIterator(SMDS_Mesh::_meshList[myMeshId], l.cells, l.ncells, type));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,16 +231,19 @@ private:
|
|||||||
SMDSAbs_ElementType type):
|
SMDSAbs_ElementType type):
|
||||||
myMesh(mesh), myCells(cells), myNcells(ncells), myType(type), iter(0)
|
myMesh(mesh), myCells(cells), myNcells(ncells), myType(type), iter(0)
|
||||||
{
|
{
|
||||||
for (; iter<ncells; iter++)
|
//MESSAGE("myNcells " << myNcells);
|
||||||
|
for (; iter<ncells; iter++)
|
||||||
{
|
{
|
||||||
int vtkId = myCells[iter];
|
int vtkId = myCells[iter];
|
||||||
int smdsId = myMesh->fromVtkToSmds(vtkId);
|
int smdsId = myMesh->fromVtkToSmds(vtkId);
|
||||||
|
//MESSAGE("vtkId " << vtkId << " smdsId " << smdsId);
|
||||||
const SMDS_MeshElement* elem = myMesh->FindElement(smdsId);
|
const SMDS_MeshElement* elem = myMesh->FindElement(smdsId);
|
||||||
if (elem->GetType() == type)
|
if (elem->GetType() == type)
|
||||||
myFiltCells.push_back((SMDS_MeshElement*)elem);
|
myFiltCells.push_back((SMDS_MeshElement*)elem);
|
||||||
}
|
}
|
||||||
myNcells = myFiltCells.size();
|
myNcells = myFiltCells.size();
|
||||||
iter = 0;
|
//MESSAGE("myNcells " << myNcells);
|
||||||
|
iter = 0;
|
||||||
//MESSAGE("SMDS_MeshNode_MyIterator (filter) " << ncells << " " << myNcells);
|
//MESSAGE("SMDS_MeshNode_MyIterator (filter) " << ncells << " " << myNcells);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,6 +307,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
|
|||||||
cerr << "total elements and nodes in submesh sets:" << total << endl;
|
cerr << "total elements and nodes in submesh sets:" << total << endl;
|
||||||
cerr << "Number of node objects " << SMDS_MeshNode::nbNodes << endl;
|
cerr << "Number of node objects " << SMDS_MeshNode::nbNodes << endl;
|
||||||
cerr << "Number of cell objects " << SMDS_MeshCell::nbCells << endl;
|
cerr << "Number of cell objects " << SMDS_MeshCell::nbCells << endl;
|
||||||
|
//myMesh->dumpGrid();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user