Back to index

salome-smesh  6.5.0
Defines | Functions
SMDS_Mesh.cxx File Reference
#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 Documentation

#define CHECKMEMORY_INTERVAL   100000

Definition at line 61 of file SMDS_Mesh.cxx.


Function Documentation

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 3050 of file SMDS_Mesh.cxx.

{
        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 3015 of file SMDS_Mesh.cxx.

{
        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;
}

Here is the call graph for this function:

static set<const SMDS_MeshElement*>* intersectionOfSets ( set< const SMDS_MeshElement * >  vs[],
int  numberOfSets 
) [static]

Do intersection of sets (more than 2) ////////////////////////////////////////////////////////////////////////////.

Definition at line 2991 of file SMDS_Mesh.cxx.

{
        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;
}

Here is the caller graph for this function: