Back to index

salome-med  6.5.0
Functions
MEDPARTITIONER_MeshCollection.cxx File Reference
#include "MEDPARTITIONER_MeshCollection.hxx"
#include "MEDPARTITIONER_MeshCollectionDriver.hxx"
#include "MEDPARTITIONER_MeshCollectionMedXmlDriver.hxx"
#include "MEDPARTITIONER_MeshCollectionMedAsciiDriver.hxx"
#include "MEDPARTITIONER_ParaDomainSelector.hxx"
#include "MEDPARTITIONER_Topology.hxx"
#include "MEDPARTITIONER_ParallelTopology.hxx"
#include "MEDPARTITIONER_Graph.hxx"
#include "MEDPARTITIONER_UserGraph.hxx"
#include "MEDPARTITIONER_Utils.hxx"
#include "MEDLoader.hxx"
#include "MEDCouplingMemArray.hxx"
#include "MEDCouplingUMesh.hxx"
#include "MEDCouplingNormalizedUnstructuredMesh.hxx"
#include "MEDCouplingFieldDouble.hxx"
#include "PointLocator3DIntersectorP0P0.hxx"
#include "BBTree.txx"
#include <set>
#include <vector>
#include <string>
#include <limits>
#include <iostream>
#include <fstream>

Go to the source code of this file.

Functions

void getNodeIds (ParaMEDMEM::MEDCouplingUMesh &meshOne, ParaMEDMEM::MEDCouplingUMesh &meshTwo, std::vector< int > &nodeIds)
bool isFaceOncell (std::vector< int > &inodesFace, std::vector< int > &inodesCell)

Function Documentation

void getNodeIds ( ParaMEDMEM::MEDCouplingUMesh meshOne,
ParaMEDMEM::MEDCouplingUMesh meshTwo,
std::vector< int > &  nodeIds 
)

Definition at line 372 of file MEDPARTITIONER_MeshCollection.cxx.

{
  using std::vector;
  if (!&meshOne || !&meshTwo) return;  //empty or not existing
  double* bbox;
  BBTree<3>* tree;
  int nv1=meshOne.getNumberOfNodes();
  bbox=new double[nv1*6];
  ParaMEDMEM::DataArrayDouble* coords=meshOne.getCoords();
  double* coordsPtr=coords->getPointer();
  for (int i=0; i<nv1*3; i++)
    {
      bbox[i*2]=coordsPtr[i]-1e-6;
      bbox[i*2+1]=coordsPtr[i]+1e-6;
    }
  tree=new BBTree<3>(bbox,0,0,nv1,1e-9);
  
  int nv2=meshTwo.getNumberOfNodes();
  nodeIds.resize(nv2,-1);
  coords=meshTwo.getCoords();
  for (int inode=0; inode<nv2; inode++)
    {
      double* coordsPtr2=coords->getPointer()+inode*3;
      vector<int> elems;
      tree->getElementsAroundPoint(coordsPtr2,elems);
      if (elems.size()==0) continue;
      nodeIds[inode]=elems[0];
    }
  delete tree;
  delete[] bbox;
}

Here is the call graph for this function:

bool isFaceOncell ( std::vector< int > &  inodesFace,
std::vector< int > &  inodesCell 
)

Definition at line 1653 of file MEDPARTITIONER_MeshCollection.cxx.

{
  int ires=0;
  int nbok=inodesFace.size();
  for (int i=0; i<nbok; i++)
    {
      int ii=inodesFace[i];
      if (ii<0)
        std::cout << "isFaceOncell problem inodeface<0" << std::endl;
      for (int j=0; j<(int)inodesCell.size(); j++)
        {
          if (ii==inodesCell[j])
            {
              ires=ires+1;
              break; //inode of face found
            }
        }
      if (ires<i+1)
        break; //inode of face not found do not continue...
    }
  return (ires==nbok);
}