]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Some usefull algos for 2DExtruded meshes.
authorageay <ageay>
Thu, 15 Apr 2010 06:27:30 +0000 (06:27 +0000)
committerageay <ageay>
Thu, 15 Apr 2010 06:27:30 +0000 (06:27 +0000)
src/MEDCoupling/MEDCouplingExtrudedMesh.hxx
src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx

index d0040a827c054dbd3c0e8079f5e1998828afaa2a..ee5f0d9ba92e0cd919b54f5a4a45b14814f3452a 100644 (file)
@@ -47,6 +47,7 @@ namespace ParaMEDMEM
     void checkCoherency() const throw (INTERP_KERNEL::Exception);
     void getBoundingBox(double *bbox) const;
     void updateTime();
+    MEDCouplingUMesh *getMesh2D() const { return _mesh2D; }
     MEDCouplingUMesh *getMesh1D() const { return _mesh1D; }
     DataArrayInt *getMesh3DIds() const { return _mesh3D_ids; }
     MEDCouplingFieldDouble *getMeasureField(bool) const;
index 7fc964dedecd84d86e617e0a137ba49711f2403f..37cb83d590a7afb2b8de7264fab2dc1781c33b2d 100644 (file)
@@ -1725,5 +1725,21 @@ void MEDCouplingBasicsTest::testTryToShareSameCoords()
 
 void MEDCouplingBasicsTest::testFindNodeOnPlane()
 {
-  
+  MEDCouplingUMesh *mesh=build3DTargetMesh_1();
+  std::vector<int> n;
+  double pt[3]={300.,300.,0.};
+  double v[3]={0.,0.,2.};
+  mesh->findNodesOnPlane(pt,v,1e-12,n);
+  CPPUNIT_ASSERT_EQUAL(9,(int)n.size());
+  MEDCouplingUMesh *m3dSurf=(MEDCouplingUMesh *)mesh->buildFacePartOfMySelfNode(&n[0],&n[0]+n.size(),true);
+  MEDCouplingExtrudedMesh *me=MEDCouplingExtrudedMesh::New(mesh,m3dSurf,0);
+  const DataArrayInt *da=me->getMesh3DIds();
+  CPPUNIT_ASSERT_EQUAL(8,me->getNumberOfCells());
+  const int expected[8]={0,1,2,3,4,5,6,7};
+  const int *val=da->getConstPointer();
+  for(int i=0;i<8;i++)
+    CPPUNIT_ASSERT_EQUAL(expected[i],val[i]);
+  me->decrRef();
+  m3dSurf->decrRef();
+  mesh->decrRef();
 }