#include "utilities.h"#include "SMDS_Mesh.hxx"#include "SMDS_VolumeOfNodes.hxx"#include "SMDS_VolumeOfFaces.hxx"#include "SMDS_FaceOfNodes.hxx"#include "SMDS_FaceOfEdges.hxx"#include "SMDS_PolyhedralVolumeOfNodes.hxx"#include "SMDS_PolygonalFaceOfNodes.hxx"#include "SMDS_QuadraticEdge.hxx"#include "SMDS_QuadraticFaceOfNodes.hxx"#include "SMDS_QuadraticVolumeOfNodes.hxx"#include "SMDS_SpacePosition.hxx"#include "SMDS_UnstructuredGrid.hxx"#include <vtkUnstructuredGrid.h>#include <vtkUnstructuredGridWriter.h>#include <vtkUnsignedCharArray.h>#include <vtkCell.h>#include <vtkCellLinks.h>#include <vtkIdList.h>#include <algorithm>#include <map>#include <iostream>#include <fstream>#include <sys/sysinfo.h>
Go to the source code of this file.
Defines | |
| #define | CHECKMEMORY_INTERVAL 100000 |
Functions | |
| static set< const SMDS_MeshElement * > * | intersectionOfSets (set< const SMDS_MeshElement * > vs[], int numberOfSets) |
| Do intersection of sets (more than 2) | |
| static set< const SMDS_MeshElement * > * | getFinitElements (const SMDS_MeshElement *element) |
| Return the list of finite elements owning the given element: elements containing all the nodes of the given element, for instance faces and volumes containing a given edge. | |
| static set< const SMDS_MeshElement * > * | getExclusiveNodes (set< const SMDS_MeshElement * > &elements) |
| Return the list of nodes used only by the given elements. | |
| #define CHECKMEMORY_INTERVAL 100000 |
Definition at line 61 of file SMDS_Mesh.cxx.
Referenced by SMDS_Mesh.Add0DElementWithID(), SMDS_Mesh.AddFaceWithID(), SMDS_Mesh.AddPolygonalFaceWithID(), SMDS_Mesh.AddPolyhedralVolumeWithID(), SMDS_Mesh.AddVolumeWithID(), SMDS_Mesh.createQuadrangle(), SMDS_Mesh.createTriangle(), and SMDS_Mesh.FindEdgeOrCreate().
| static set<const SMDS_MeshElement*>* getExclusiveNodes | ( | set< const SMDS_MeshElement * > & | elements | ) | [static] |
Return the list of nodes used only by the given elements.
Definition at line 2883 of file SMDS_Mesh.cxx.
References SMDS_MeshNode.GetInverseElementIterator().
Referenced by SMDS_Mesh.RemoveElement().
{
set<const SMDS_MeshElement*> * toReturn=new set<const SMDS_MeshElement*>();
set<const SMDS_MeshElement*>::iterator itElements=elements.begin();
while(itElements!=elements.end())
{
SMDS_ElemIteratorPtr itNodes = (*itElements)->nodesIterator();
itElements++;
while(itNodes->more())
{
const SMDS_MeshNode * n=static_cast<const SMDS_MeshNode*>(itNodes->next());
SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator();
set<const SMDS_MeshElement*> s;
while(itFe->more())
s.insert(itFe->next());
if(s==elements) toReturn->insert(n);
}
}
return toReturn;
}
| static set<const SMDS_MeshElement*>* getFinitElements | ( | const SMDS_MeshElement * | element | ) | [static] |
Return the list of finite elements owning the given element: elements containing all the nodes of the given element, for instance faces and volumes containing a given edge.
Definition at line 2848 of file SMDS_Mesh.cxx.
References SMDS_MeshNode.GetInverseElementIterator(), intersectionOfSets(), MESSAGE, MYASSERT, SMDS_MeshElement.NbNodes(), ex29_refine.node(), and SMDS_MeshElement.nodesIterator().
Referenced by SMDS_Mesh.RemoveElement().
{
int numberOfSets=element->NbNodes();
set<const SMDS_MeshElement*> *initSet = new set<const SMDS_MeshElement*>[numberOfSets];
SMDS_ElemIteratorPtr itNodes=element->nodesIterator();
int i=0;
while(itNodes->more())
{
const SMDS_MeshElement* node = itNodes->next();
MYASSERT(node);
const SMDS_MeshNode * n=static_cast<const SMDS_MeshNode*>(node);
SMDS_ElemIteratorPtr itFe = n->GetInverseElementIterator();
//initSet[i]=set<const SMDS_MeshElement*>();
while(itFe->more())
{
const SMDS_MeshElement* elem = itFe->next();
MYASSERT(elem);
initSet[i].insert(elem);
}
i++;
}
set<const SMDS_MeshElement*> *retSet=intersectionOfSets(initSet, numberOfSets);
MESSAGE("nb elems " << i << " intersection " << retSet->size());
delete [] initSet;
return retSet;
}
| static set<const SMDS_MeshElement*>* intersectionOfSets | ( | set< const SMDS_MeshElement * > | vs[], |
| int | numberOfSets | ||
| ) | [static] |
Do intersection of sets (more than 2)
Definition at line 2824 of file SMDS_Mesh.cxx.
Referenced by getFinitElements().
{
set<const SMDS_MeshElement*>* rsetA=new set<const SMDS_MeshElement*>(vs[0]);
set<const SMDS_MeshElement*>* rsetB;
for(int i=0; i<numberOfSets-1; i++)
{
rsetB=new set<const SMDS_MeshElement*>();
set_intersection(
rsetA->begin(), rsetA->end(),
vs[i+1].begin(), vs[i+1].end(),
inserter(*rsetB, rsetB->begin()));
delete rsetA;
rsetA=rsetB;
}
return rsetA;
}