From: ageay Date: Thu, 15 Apr 2010 06:27:30 +0000 (+0000) Subject: Some usefull algos for 2DExtruded meshes. X-Git-Tag: V5_1_main_FINAL~131 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cbfee109e141e2f8b6ddc1f581a7004ae2961687;p=tools%2Fmedcoupling.git Some usefull algos for 2DExtruded meshes. --- diff --git a/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx b/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx index d0040a827..ee5f0d9ba 100644 --- a/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx +++ b/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx @@ -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; diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx index 7fc964ded..37cb83d59 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx @@ -1725,5 +1725,21 @@ void MEDCouplingBasicsTest::testTryToShareSameCoords() void MEDCouplingBasicsTest::testFindNodeOnPlane() { - + MEDCouplingUMesh *mesh=build3DTargetMesh_1(); + std::vector 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(); }