MEDCouplingUMesh *MEDCouplingExtrudedMesh::build3DUnstructuredMesh() const
{
- MEDCouplingUMesh *ret=_mesh2D->buildExtrudedMeshFromThis(_mesh1D,0);
+ MEDCouplingUMesh *ret=_mesh2D->buildExtrudedMesh(_mesh1D,0);
const int *renum=_mesh3D_ids->getConstPointer();
ret->renumberCells(renum,false);
ret->setName(getName());
* \b 1 for translation and rotation around point of 'mesh1D'.
* @return an unstructured mesh with meshDim==3 and spaceDim==3. The returned mesh has the same coords than 'this'.
*/
-MEDCouplingUMesh *MEDCouplingUMesh::buildExtrudedMeshFromThis(const MEDCouplingUMesh *mesh1D, int policy)
+MEDCouplingUMesh *MEDCouplingUMesh::buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy)
{
checkFullyDefined();
mesh1D->checkFullyDefined();
if(!mesh1D->isContiguous1D())
- throw INTERP_KERNEL::Exception("buildExtrudedMeshFromThis : 1D mesh passed in parameter is not contiguous !");
+ throw INTERP_KERNEL::Exception("buildExtrudedMesh : 1D mesh passed in parameter is not contiguous !");
if(getSpaceDimension()!=mesh1D->getSpaceDimension())
- throw INTERP_KERNEL::Exception("Invalid call to buildExtrudedMeshFromThis this and mesh1D must have same dimension !");
+ throw INTERP_KERNEL::Exception("Invalid call to buildExtrudedMesh this and mesh1D must have same dimension !");
if((getMeshDimension()!=2 || getSpaceDimension()!=3) && (getMeshDimension()!=1 || getSpaceDimension()!=2))
- throw INTERP_KERNEL::Exception("Invalid 'this' for buildExtrudedMeshFromThis method : must be (meshDim==2 and spaceDim==3) or (meshDim==1 and spaceDim==2) !");
+ throw INTERP_KERNEL::Exception("Invalid 'this' for buildExtrudedMesh method : must be (meshDim==2 and spaceDim==3) or (meshDim==1 and spaceDim==2) !");
if(mesh1D->getMeshDimension()!=1)
- throw INTERP_KERNEL::Exception("Invalid 'mesh1D' for buildExtrudedMeshFromThis method : must be meshDim==1 !");
+ throw INTERP_KERNEL::Exception("Invalid 'mesh1D' for buildExtrudedMesh method : must be meshDim==1 !");
bool isQuad=false;
if(isPresenceOfQuadratic())
{
}
/*!
- * This method incarnates the policy 0 for MEDCouplingUMesh::buildExtrudedMeshFromThis method.
+ * This method incarnates the policy 0 for MEDCouplingUMesh::buildExtrudedMesh method.
* @param mesh1D is the input 1D mesh used for translation computation.
* @return newCoords new coords filled by this method.
*/
}
/*!
- * This method incarnates the policy 1 for MEDCouplingUMesh::buildExtrudedMeshFromThis method.
+ * This method incarnates the policy 1 for MEDCouplingUMesh::buildExtrudedMesh method.
* @param mesh1D is the input 1D mesh used for translation and automatic rotation computation.
* @return newCoords new coords filled by this method.
*/
}
/*!
- * This method incarnates the policy 1 for MEDCouplingUMesh::buildExtrudedMeshFromThis method.
+ * This method incarnates the policy 1 for MEDCouplingUMesh::buildExtrudedMesh method.
* @param mesh1D is the input 1D mesh used for translation and automatic rotation computation.
* @return newCoords new coords filled by this method.
*/
}
/*!
- * This method incarnates the policy 1 for MEDCouplingUMesh::buildExtrudedMeshFromThis method.
+ * This method incarnates the policy 1 for MEDCouplingUMesh::buildExtrudedMesh method.
* @param mesh1D is the input 1D mesh used for translation and automatic rotation computation.
* @return newCoords new coords filled by this method.
*/
/*!
* This method is private because not easy to use for end user. This method is const contrary to
- * MEDCouplingUMesh::buildExtrudedMeshFromThis method because this->_coords are expected to contain
+ * MEDCouplingUMesh::buildExtrudedMesh method because this->_coords are expected to contain
* the coords sorted slice by slice.
* @param isQuad specifies presence of quadratic cells.
*/
MEDCOUPLING_EXPORT void getCellsContainingPoints(const double *pos, int nbOfPoints, double eps, std::vector<int>& elts, std::vector<int>& eltsIndex) const;
MEDCOUPLING_EXPORT void checkButterflyCells(std::vector<int>& cells) const;
MEDCOUPLING_EXPORT void getBoundingBoxForBBTree(std::vector<double>& bbox) const;
- MEDCOUPLING_EXPORT MEDCouplingUMesh *buildExtrudedMeshFromThis(const MEDCouplingUMesh *mesh1D, int policy);
+ MEDCOUPLING_EXPORT MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy);
MEDCOUPLING_EXPORT bool isFullyQuadratic() const;
MEDCOUPLING_EXPORT bool isPresenceOfQuadratic() const;
MEDCOUPLING_EXPORT void convertQuadraticCellsToLinear() throw(INTERP_KERNEL::Exception);
double center[3]={0.,0.,0.};
double vector[3]={0,1,0};
m2->rotate(center,vector,-M_PI/2.);
- MEDCouplingUMesh *m3=m1->buildExtrudedMeshFromThis(m2,0);
+ MEDCouplingUMesh *m3=m1->buildExtrudedMesh(m2,0);
//
MEDCouplingExtrudedMesh *m4=MEDCouplingExtrudedMesh::New(m3,m1,0);
CPPUNIT_ASSERT_EQUAL(15,m4->getNumberOfCells());
//play with polygons and polyedrons
std::vector<int> cells(2); cells[0]=2; cells[1]=3;
m1->convertToPolyTypes(cells);
- m3=m1->buildExtrudedMeshFromThis(m2,0);
+ m3=m1->buildExtrudedMesh(m2,0);
CPPUNIT_ASSERT_EQUAL((int)INTERP_KERNEL::NORM_HEXA8,(int)m3->getTypeOfCell(0));
CPPUNIT_ASSERT_EQUAL((int)INTERP_KERNEL::NORM_PENTA6,(int)m3->getTypeOfCell(1));
CPPUNIT_ASSERT_EQUAL((int)INTERP_KERNEL::NORM_POLYHED,(int)m3->getTypeOfCell(2));
}
/*!
- * This test check MEDCouplingUMesh::buildExtrudedMeshFromThis method, but also, MEDCouplingExtrudedMesh following methods :
+ * This test check MEDCouplingUMesh::buildExtrudedMesh method, but also, MEDCouplingExtrudedMesh following methods :
* getCellContainingPoint getMeasureField getNodeIdsOfCell getCoordinateOfNode getTypeOfCell build3DUnstructuredMesh.
*/
void MEDCouplingBasicsTest::testExtrudedMesh4()
double center[3]={0.,0.,0.};
double vector[3]={0.,1.,0.};
m2->rotate(center,vector,-M_PI/2.);
- MEDCouplingUMesh *m3=m1->buildExtrudedMeshFromThis(m2,0);
+ MEDCouplingUMesh *m3=m1->buildExtrudedMesh(m2,0);
const int expected1[15]= {1,3,2,0,6,5,7,10,11,8,12,9,14,13,4};
const int rexpected1[15]={3, 0, 2, 1, 14, 5, 4, 6, 9, 11, 7, 8, 10, 13, 12};
m3->renumberCells(expected1,false);
double center[3]={0.,0.,0.};
double vector[3]={0.,1.,0.};
m4->rotate(center,vector,-M_PI/2.);
- MEDCouplingUMesh *m5=m3->buildExtrudedMeshFromThis(m4,0);
+ MEDCouplingUMesh *m5=m3->buildExtrudedMesh(m4,0);
res1.clear();
m5->arePolyhedronsNotCorrectlyOriented(res1);
CPPUNIT_ASSERT_EQUAL(15,(int)res1.size());
DataArrayDouble *g=f->getCoords()->applyFunc(2,"3.5*IVec+x/6*3.14159265359*JVec");
DataArrayDouble *h=g->fromPolarToCart();
f->setCoords(h);
- MEDCouplingUMesh *i=c->buildExtrudedMeshFromThis(f,1);
+ MEDCouplingUMesh *i=c->buildExtrudedMesh(f,1);
CPPUNIT_ASSERT_EQUAL(52,i->getNumberOfNodes());
bool tmp2;
int tmp3;
//
const double center[2]={0.,0.};
f->rotate(center,0,M_PI/3);
- MEDCouplingUMesh *g=c->buildExtrudedMeshFromThis(f,0);
+ MEDCouplingUMesh *g=c->buildExtrudedMesh(f,0);
g->checkCoherency();
const double expected1[]={ 0.4330127018922193, 0.4330127018922193, 0.649519052838329, 1.2990381056766578, 1.299038105676658, 1.948557158514987, 2.1650635094610955, 2.1650635094610964, 3.2475952641916446, 3.031088913245533, 3.0310889132455352, 4.546633369868303 };
MEDCouplingFieldDouble *f1=g->getMeasureField(true);
DataArrayDouble *g=f->getCoords()->applyFunc(2,"3.5*IVec+x/6*3.14159265359*JVec");
DataArrayDouble *h=g->fromPolarToCart();
f->setCoords(h);
- MEDCouplingUMesh *i=c->buildExtrudedMeshFromThis(f,1);
+ MEDCouplingUMesh *i=c->buildExtrudedMesh(f,1);
CPPUNIT_ASSERT_EQUAL(52,i->getNumberOfNodes());
bool tmp2;
int tmp3;
DataArrayDouble *g2=h->applyFunc(3,"13.5/3.5*x*IVec+0*JVec+13.5/3.5*y*KVec");
f->setCoords(g2);
i->changeSpaceDimension(3);
- MEDCouplingUMesh *i3=i->buildExtrudedMeshFromThis(f,1);
+ MEDCouplingUMesh *i3=i->buildExtrudedMesh(f,1);
MEDCouplingFieldDouble *f2=i3->getMeasureField(true);
tmp=i->mergeNodes(1e-9,tmp2,tmp3);
CPPUNIT_ASSERT(tmp2);
%newobject ParaMEDMEM::MEDCouplingUMesh::clone;
%newobject ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer;
%newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity;
-%newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMeshFromThis;
+%newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh;
%newobject ParaMEDMEM::MEDCouplingUMesh::mergeUMeshes;
%newobject ParaMEDMEM::MEDCouplingUMesh::mergeUMeshesOnSameCoords;
%newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt;
}
void convertToPolyTypes(const std::vector<int>& cellIdsToConvert) throw(INTERP_KERNEL::Exception);
void unPolyze() throw(INTERP_KERNEL::Exception);
- MEDCouplingUMesh *buildExtrudedMeshFromThis(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
+ MEDCouplingUMesh *buildExtrudedMesh(const MEDCouplingUMesh *mesh1D, int policy) throw(INTERP_KERNEL::Exception);
};
class MEDCouplingExtrudedMesh : public ParaMEDMEM::MEDCouplingMesh
center=[0.,0.,0.]
vector=[0.,1.,0.]
m2.rotate(center,vector,-pi/2.);
- m3=m1.buildExtrudedMeshFromThis(m2,0);
+ m3=m1.buildExtrudedMesh(m2,0);
#
m4=MEDCouplingExtrudedMesh.New(m3,m1,0);
self.assertEqual(15,m4.getNumberOfCells());
#play with polygons and polyedrons
cells=[2,3]
m1.convertToPolyTypes(cells);
- m3=m1.buildExtrudedMeshFromThis(m2,0);
+ m3=m1.buildExtrudedMesh(m2,0);
self.assertEqual(NORM_HEXA8,m3.getTypeOfCell(0));
self.assertEqual(NORM_PENTA6,m3.getTypeOfCell(1));
self.assertEqual(NORM_POLYHED,m3.getTypeOfCell(2));
center=[0.,0.,0.]
vector=[0.,1.,0.]
m2.rotate(center,vector,-pi/2.);
- m3=m1.buildExtrudedMeshFromThis(m2,0);
+ m3=m1.buildExtrudedMesh(m2,0);
expected1=[1,3,2,0,6,5,7,10,11,8,12,9,14,13,4]
rexpected1=[3, 0, 2, 1, 14, 5, 4, 6, 9, 11, 7, 8, 10, 13, 12]
m3.renumberCells(expected1,False);
center=[0.,0.,0.]
vector=[0.,1.,0.]
m4.rotate(center,vector,-pi/2.);
- m5=m3.buildExtrudedMeshFromThis(m4,0);
+ m5=m3.buildExtrudedMesh(m4,0);
res1=m5.arePolyhedronsNotCorrectlyOriented();
self.assertEqual(15,len(res1));
m5.orientCorrectlyPolyhedrons();
g=f.getCoords().applyFunc(2,"3.5*IVec+x/6*3.14159265359*JVec");
h=g.fromPolarToCart();
f.setCoords(h);
- i=c.buildExtrudedMeshFromThis(f,1);
+ i=c.buildExtrudedMesh(f,1);
self.assertEqual(52,i.getNumberOfNodes());
tmp,tmp2,tmp3=i.mergeNodes(1e-9);
self.assertTrue(tmp2);
#
center=[0.,0.]
f.rotate(center,[],pi/3);
- g=c.buildExtrudedMeshFromThis(f,0);
+ g=c.buildExtrudedMesh(f,0);
g.checkCoherency();
expected1=[ 0.4330127018922193, 0.4330127018922193, 0.649519052838329, 1.2990381056766578, 1.299038105676658, 1.948557158514987, 2.1650635094610955, 2.1650635094610964, 3.2475952641916446, 3.031088913245533, 3.0310889132455352, 4.546633369868303 ]
f1=g.getMeasureField(True);
g=f.getCoords().applyFunc(2,"3.5*IVec+x/6*3.14159265359*JVec");
h=g.fromPolarToCart();
f.setCoords(h);
- i=c.buildExtrudedMeshFromThis(f,1);
+ i=c.buildExtrudedMesh(f,1);
self.assertEqual(52,i.getNumberOfNodes());
tmp,tmp2,tmp3=i.mergeNodes(1e-9);
self.assertTrue(tmp2);
g2=h.applyFunc(3,"13.5/3.5*x*IVec+0*JVec+13.5/3.5*y*KVec");
f.setCoords(g2);
i.changeSpaceDimension(3);
- i3=i.buildExtrudedMeshFromThis(f,1);
+ i3=i.buildExtrudedMesh(f,1);
f2=i3.getMeasureField(True);
tmp,tmp2,tmp3=i.mergeNodes(1e-9);
self.assertTrue(tmp2);