From e08b8436f921083f1f4899aa2979342d9e31e7de Mon Sep 17 00:00:00 2001 From: ageay Date: Mon, 3 Jan 2011 11:54:10 +0000 Subject: [PATCH] Public static method renaming to follow prog coding rules. --- src/MEDCoupling/MEDCouplingCMesh.cxx | 10 +- src/MEDCoupling/MEDCouplingCMesh.hxx | 2 +- src/MEDCoupling/MEDCouplingExtrudedMesh.cxx | 8 +- src/MEDCoupling/MEDCouplingExtrudedMesh.hxx | 4 +- src/MEDCoupling/MEDCouplingFieldDouble.cxx | 50 ++++---- src/MEDCoupling/MEDCouplingFieldDouble.hxx | 38 +++--- src/MEDCoupling/MEDCouplingMemArray.cxx | 66 +++++----- src/MEDCoupling/MEDCouplingMemArray.hxx | 36 +++--- src/MEDCoupling/MEDCouplingMesh.cxx | 2 +- src/MEDCoupling/MEDCouplingMesh.hxx | 2 +- src/MEDCoupling/MEDCouplingPointSet.cxx | 26 ++-- src/MEDCoupling/MEDCouplingPointSet.hxx | 10 +- src/MEDCoupling/MEDCouplingRemapper.cxx | 2 +- .../MEDCouplingTimeDiscretization.cxx | 110 ++++++++--------- src/MEDCoupling/MEDCouplingUMesh.cxx | 62 +++++----- src/MEDCoupling/MEDCouplingUMesh.hxx | 16 +-- src/MEDCoupling/MEDCouplingUMeshDesc.cxx | 8 +- .../Test/MEDCouplingBasicsTest1.cxx | 18 +-- .../Test/MEDCouplingBasicsTest2.cxx | 18 +-- src/MEDCoupling_Swig/MEDCoupling.i | 113 ++++++++++-------- src/MEDCoupling_Swig/MEDCouplingBasicsTest.py | 40 +++---- src/MEDLoader/MEDFileMesh.cxx | 40 ++++++- src/MEDLoader/MEDFileMeshLL.cxx | 6 +- src/MEDLoader/MEDLoader.cxx | 6 +- src/ParaMEDMEM/ElementLocator.cxx | 2 +- 25 files changed, 368 insertions(+), 327 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingCMesh.cxx b/src/MEDCoupling/MEDCouplingCMesh.cxx index 9ec8bec95..17c5dfaf4 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCMesh.cxx @@ -275,7 +275,7 @@ int MEDCouplingCMesh::getNodeIdFromPos(int i, int j, int k) const return std::accumulate(tmp,tmp+spaceDim,0); } -void MEDCouplingCMesh::getPosFromId(int nodeId, int spaceDim, const int *split, int *res) +void MEDCouplingCMesh::GetPosFromId(int nodeId, int spaceDim, const int *split, int *res) { int work=nodeId; for(int i=spaceDim-1;i>=0;i--) @@ -351,7 +351,7 @@ void MEDCouplingCMesh::getCoordinatesOfNode(int nodeId, std::vector& coo getSplitNodeValues(tmp); const DataArrayDouble *tabs[3]={getCoordsAt(0),getCoordsAt(1),getCoordsAt(2)}; int tmp2[3]; - getPosFromId(nodeId,spaceDim,tmp,tmp2); + GetPosFromId(nodeId,spaceDim,tmp,tmp2); for(int j=0;jgetConstPointer()[tmp2[j]]); @@ -522,7 +522,7 @@ MEDCouplingFieldDouble *MEDCouplingCMesh::getMeasureField(bool isAbs) const for(int icell=0;icell& conn) const; diff --git a/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx b/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx index d386e340e..0005977fd 100644 --- a/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx +++ b/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx @@ -499,7 +499,7 @@ void MEDCouplingExtrudedMesh::computeBaryCenterOfFace(const std::vector& no std::transform(zoneToUpdate,zoneToUpdate+3,zoneToUpdate,std::bind2nd(std::multiplies(),(double)(1./nodalConnec.size()))); } -int MEDCouplingExtrudedMesh::findCorrespCellByNodalConn(const std::vector& nodalConnec, const int *revNodalPtr, const int *revNodalIndxPtr) throw(INTERP_KERNEL::Exception) +int MEDCouplingExtrudedMesh::FindCorrespCellByNodalConn(const std::vector& nodalConnec, const int *revNodalPtr, const int *revNodalIndxPtr) throw(INTERP_KERNEL::Exception) { std::vector::const_iterator iter=nodalConnec.begin(); std::set s1(revNodalPtr+revNodalIndxPtr[*iter],revNodalPtr+revNodalIndxPtr[*iter+1]); @@ -533,11 +533,11 @@ int MEDCouplingExtrudedMesh::findCorrespCellByNodalConn(const std::vector& * @param v is the output normalized vector of the common direction of 'm1' and 'm2' * @throw in case that m1 and m2 are not compatible each other. */ -void MEDCouplingExtrudedMesh::project1DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps, +void MEDCouplingExtrudedMesh::Project1DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps, MEDCouplingUMesh *&m1r, MEDCouplingUMesh *&m2r, double *v) throw(INTERP_KERNEL::Exception) { if(m1->getSpaceDimension()!=3 || m1->getSpaceDimension()!=3) - throw INTERP_KERNEL::Exception("Input meshes are expected to have a spaceDim==3 for projec1D !"); + throw INTERP_KERNEL::Exception("Input meshes are expected to have a spaceDim==3 for Projec1D !"); m1r=m1->clone(true); m2r=m2->clone(true); m1r->changeSpaceDimension(1); @@ -665,7 +665,7 @@ void MEDCouplingExtrudedMesh::computeExtrusionAlg(const MEDCouplingUMesh *mesh3D std::vector nodalConnec(nodal2D+nodal2DIndx[i]+1,nodal2D+nodal2DIndx[i+1]); try { - idInSubMesh=findCorrespCellByNodalConn(nodalConnec,revNodal2DPtr,revNodalIndx2DPtr); + idInSubMesh=FindCorrespCellByNodalConn(nodalConnec,revNodal2DPtr,revNodalIndx2DPtr); } catch(INTERP_KERNEL::Exception& e) { diff --git a/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx b/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx index d5025341e..91c5a80ca 100644 --- a/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx +++ b/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx @@ -70,9 +70,9 @@ namespace ParaMEDMEM MEDCouplingFieldDouble *getMeasureFieldOnNode(bool) const; MEDCouplingFieldDouble *buildOrthogonalField() const; int getCellContainingPoint(const double *pos, double eps) const; - static int findCorrespCellByNodalConn(const std::vector& nodalConnec, + static int FindCorrespCellByNodalConn(const std::vector& nodalConnec, const int *revNodalPtr, const int *revNodalIndxPtr) throw(INTERP_KERNEL::Exception); - static void project1DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps, + static void Project1DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps, MEDCouplingUMesh *&m1r, MEDCouplingUMesh *&m2r, double *v) throw(INTERP_KERNEL::Exception); void rotate(const double *center, const double *vector, double angle); void translate(const double *vector); diff --git a/src/MEDCoupling/MEDCouplingFieldDouble.cxx b/src/MEDCoupling/MEDCouplingFieldDouble.cxx index d24f36c12..7edb7fbb9 100644 --- a/src/MEDCoupling/MEDCouplingFieldDouble.cxx +++ b/src/MEDCoupling/MEDCouplingFieldDouble.cxx @@ -1282,10 +1282,10 @@ void MEDCouplingFieldDouble::sortPerTuple(bool asc) throw(INTERP_KERNEL::Excepti _time_discr->sortPerTuple(asc); } -MEDCouplingFieldDouble *MEDCouplingFieldDouble::mergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) +MEDCouplingFieldDouble *MEDCouplingFieldDouble::MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) { if(!f1->areCompatibleForMerge(f2)) - throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply mergeFields on them !"); + throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply MergeFields on them !"); const MEDCouplingMesh *m1=f1->getMesh(); const MEDCouplingMesh *m2=f2->getMesh(); MEDCouplingMesh *m=m1->mergeMyselfWith(m2); @@ -1299,10 +1299,10 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::mergeFields(const MEDCouplingFie return ret; } -MEDCouplingFieldDouble *MEDCouplingFieldDouble::mergeFields(const std::vector& a) throw(INTERP_KERNEL::Exception) +MEDCouplingFieldDouble *MEDCouplingFieldDouble::MergeFields(const std::vector& a) throw(INTERP_KERNEL::Exception) { if(a.size()<=1) - throw INTERP_KERNEL::Exception("FieldDouble::mergeFields : size of array must be > 1 !"); + throw INTERP_KERNEL::Exception("FieldDouble::MergeFields : size of array must be > 1 !"); std::vector< MEDCouplingAutoRefCountObjectPtr > ms(a.size()); std::vector< const MEDCouplingUMesh *> ms2(a.size()); std::vector< const MEDCouplingTimeDiscretization *> tds(a.size()); @@ -1310,16 +1310,16 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::mergeFields(const std::vectorareCompatibleForMerge(*it)) - throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply mergeFields on them !"); + throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply MergeFields on them !"); for(int i=0;i<(int)a.size();i++) { if(!a[i]->getMesh()) - throw INTERP_KERNEL::Exception("mergeFields : A field as no underlying mesh !"); + throw INTERP_KERNEL::Exception("MergeFields : A field as no underlying mesh !"); ms[i]=a[i]->getMesh()->buildUnstructured(); ms2[i]=ms[i]; tds[i]=a[i]->_time_discr; } - MEDCouplingAutoRefCountObjectPtr m=MEDCouplingUMesh::mergeUMeshes(ms2); + MEDCouplingAutoRefCountObjectPtr m=MEDCouplingUMesh::MergeUMeshes(ms2); MEDCouplingTimeDiscretization *td=tds[0]->aggregate(tds); td->copyTinyAttrFrom(*(a[0]->_time_discr)); MEDCouplingFieldDouble *ret=new MEDCouplingFieldDouble(a[0]->getNature(),td,a[0]->_type->clone()); @@ -1329,10 +1329,10 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::mergeFields(const std::vectorareCompatibleForMeld(f2)) - throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply meldFields on them !"); + throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply MeldFields on them !"); MEDCouplingTimeDiscretization *td=f1->_time_discr->meld(f2->_time_discr); td->copyTinyAttrFrom(*f1->_time_discr); MEDCouplingFieldDouble *ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone()); @@ -1340,10 +1340,10 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::meldFields(const MEDCouplingFiel return ret; } -MEDCouplingFieldDouble *MEDCouplingFieldDouble::dotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) +MEDCouplingFieldDouble *MEDCouplingFieldDouble::DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) { if(!f1->areStrictlyCompatible(f2)) - throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply dotFields on them !"); + throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply DotFields on them !"); MEDCouplingTimeDiscretization *td=f1->_time_discr->dot(f2->_time_discr); td->copyTinyAttrFrom(*f1->_time_discr); MEDCouplingFieldDouble *ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone()); @@ -1351,10 +1351,10 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::dotFields(const MEDCouplingField return ret; } -MEDCouplingFieldDouble *MEDCouplingFieldDouble::crossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) +MEDCouplingFieldDouble *MEDCouplingFieldDouble::CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) { if(!f1->areStrictlyCompatible(f2)) - throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply crossProductFields on them !"); + throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply CrossProductFields on them !"); MEDCouplingTimeDiscretization *td=f1->_time_discr->crossProduct(f2->_time_discr); td->copyTinyAttrFrom(*f1->_time_discr); MEDCouplingFieldDouble *ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone()); @@ -1362,10 +1362,10 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::crossProductFields(const MEDCoup return ret; } -MEDCouplingFieldDouble *MEDCouplingFieldDouble::maxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) +MEDCouplingFieldDouble *MEDCouplingFieldDouble::MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) { if(!f1->areStrictlyCompatible(f2)) - throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply maxFields on them !"); + throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply MaxFields on them !"); MEDCouplingTimeDiscretization *td=f1->_time_discr->max(f2->_time_discr); td->copyTinyAttrFrom(*f1->_time_discr); MEDCouplingFieldDouble *ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone()); @@ -1373,10 +1373,10 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::maxFields(const MEDCouplingField return ret; } -MEDCouplingFieldDouble *MEDCouplingFieldDouble::minFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) +MEDCouplingFieldDouble *MEDCouplingFieldDouble::MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) { if(!f1->areStrictlyCompatible(f2)) - throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply minFields on them !"); + throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply MinFields on them !"); MEDCouplingTimeDiscretization *td=f1->_time_discr->min(f2->_time_discr); td->copyTinyAttrFrom(*f1->_time_discr); MEDCouplingFieldDouble *ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone()); @@ -1384,10 +1384,10 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::minFields(const MEDCouplingField return ret; } -MEDCouplingFieldDouble *MEDCouplingFieldDouble::addFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) +MEDCouplingFieldDouble *MEDCouplingFieldDouble::AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) { if(!f1->areStrictlyCompatible(f2)) - throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply addFields on them !"); + throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply AddFields on them !"); MEDCouplingTimeDiscretization *td=f1->_time_discr->add(f2->_time_discr); td->copyTinyAttrFrom(*f1->_time_discr); MEDCouplingFieldDouble *ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone()); @@ -1403,10 +1403,10 @@ const MEDCouplingFieldDouble &MEDCouplingFieldDouble::operator+=(const MEDCoupli return *this; } -MEDCouplingFieldDouble *MEDCouplingFieldDouble::substractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) +MEDCouplingFieldDouble *MEDCouplingFieldDouble::SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) { if(!f1->areStrictlyCompatible(f2)) - throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply substractFields on them !"); + throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply SubstractFields on them !"); MEDCouplingTimeDiscretization *td=f1->_time_discr->substract(f2->_time_discr); td->copyTinyAttrFrom(*f1->_time_discr); MEDCouplingFieldDouble *ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone()); @@ -1422,10 +1422,10 @@ const MEDCouplingFieldDouble &MEDCouplingFieldDouble::operator-=(const MEDCoupli return *this; } -MEDCouplingFieldDouble *MEDCouplingFieldDouble::multiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) +MEDCouplingFieldDouble *MEDCouplingFieldDouble::MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) { if(!f1->areCompatibleForMul(f2)) - throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply multiplyFields on them !"); + throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply MultiplyFields on them !"); MEDCouplingTimeDiscretization *td=f1->_time_discr->multiply(f2->_time_discr); td->copyTinyAttrFrom(*f1->_time_discr); MEDCouplingFieldDouble *ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone()); @@ -1441,10 +1441,10 @@ const MEDCouplingFieldDouble &MEDCouplingFieldDouble::operator*=(const MEDCoupli return *this; } -MEDCouplingFieldDouble *MEDCouplingFieldDouble::divideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) +MEDCouplingFieldDouble *MEDCouplingFieldDouble::DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception) { if(!f1->areCompatibleForDiv(f2)) - throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply divideFields on them !"); + throw INTERP_KERNEL::Exception("Fields are not compatible ; unable to apply DivideFields on them !"); MEDCouplingTimeDiscretization *td=f1->_time_discr->divide(f2->_time_discr); td->copyTinyAttrFrom(*f1->_time_discr); MEDCouplingFieldDouble *ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone()); diff --git a/src/MEDCoupling/MEDCouplingFieldDouble.hxx b/src/MEDCoupling/MEDCouplingFieldDouble.hxx index 719bc41c8..e647a2af4 100644 --- a/src/MEDCoupling/MEDCouplingFieldDouble.hxx +++ b/src/MEDCoupling/MEDCouplingFieldDouble.hxx @@ -132,29 +132,29 @@ namespace ParaMEDMEM MEDCouplingFieldDouble *keepSelectedComponents(const std::vector& compoIds) const throw(INTERP_KERNEL::Exception); void setSelectedComponents(const MEDCouplingFieldDouble *f, const std::vector& compoIds) throw(INTERP_KERNEL::Exception); void sortPerTuple(bool asc) throw(INTERP_KERNEL::Exception); - static MEDCouplingFieldDouble *mergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); - static MEDCouplingFieldDouble *mergeFields(const std::vector& a) throw(INTERP_KERNEL::Exception); - static MEDCouplingFieldDouble *meldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); - static MEDCouplingFieldDouble *dotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); - MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return dotFields(this,&other); } - static MEDCouplingFieldDouble *crossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); - MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return crossProductFields(this,&other); } - static MEDCouplingFieldDouble *maxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); - MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return maxFields(this,&other); } - static MEDCouplingFieldDouble *minFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); - MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return minFields(this,&other); } - MEDCouplingFieldDouble *operator+(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return addFields(this,&other); } + static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + static MEDCouplingFieldDouble *MergeFields(const std::vector& a) throw(INTERP_KERNEL::Exception); + static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return DotFields(this,&other); } + static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return CrossProductFields(this,&other); } + static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return MaxFields(this,&other); } + static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return MinFields(this,&other); } + MEDCouplingFieldDouble *operator+(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return AddFields(this,&other); } const MEDCouplingFieldDouble &operator+=(const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception); - static MEDCouplingFieldDouble *addFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); - MEDCouplingFieldDouble *operator-(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return substractFields(this,&other); } + static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + MEDCouplingFieldDouble *operator-(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return SubstractFields(this,&other); } const MEDCouplingFieldDouble &operator-=(const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception); - static MEDCouplingFieldDouble *substractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); - MEDCouplingFieldDouble *operator*(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return multiplyFields(this,&other); } + static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + MEDCouplingFieldDouble *operator*(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return MultiplyFields(this,&other); } const MEDCouplingFieldDouble &operator*=(const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception); - static MEDCouplingFieldDouble *multiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); - MEDCouplingFieldDouble *operator/(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return divideFields(this,&other); } + static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + MEDCouplingFieldDouble *operator/(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception) { return DivideFields(this,&other); } const MEDCouplingFieldDouble &operator/=(const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception); - static MEDCouplingFieldDouble *divideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); private: MEDCouplingFieldDouble(TypeOfField type, TypeOfTimeDiscretization td); MEDCouplingFieldDouble(const MEDCouplingFieldDouble& other, bool deepCpy); diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index d0596e339..0761e66da 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -565,7 +565,7 @@ void DataArrayDouble::setSelectedComponents(const DataArrayDouble *a, const std: nc[nbOfCompo*i+compoIds[j]]=*ac; } -void DataArrayDouble::setArrayIn(DataArrayDouble *newArray, DataArrayDouble* &arrayToSet) +void DataArrayDouble::SetArrayIn(DataArrayDouble *newArray, DataArrayDouble* &arrayToSet) { if(newArray!=arrayToSet) { @@ -1106,24 +1106,24 @@ DataArrayInt *DataArrayDouble::getIdsInRange(double vmin, double vmax) const thr return ret; } -DataArrayDouble *DataArrayDouble::aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception) +DataArrayDouble *DataArrayDouble::Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception) { std::vector tmp(2); tmp[0]=a1; tmp[1]=a2; - return aggregate(tmp); + return Aggregate(tmp); } -DataArrayDouble *DataArrayDouble::aggregate(const std::vector& a) throw(INTERP_KERNEL::Exception) +DataArrayDouble *DataArrayDouble::Aggregate(const std::vector& a) throw(INTERP_KERNEL::Exception) { if(a.empty()) - throw INTERP_KERNEL::Exception("DataArrayDouble::aggregate : input list must be NON EMPTY !"); + throw INTERP_KERNEL::Exception("DataArrayDouble::Aggregate : input list must be NON EMPTY !"); std::vector::const_iterator it=a.begin(); int nbOfComp=(*it)->getNumberOfComponents(); int nbt=(*it++)->getNumberOfTuples(); for(int i=1;it!=a.end();it++,i++) { if((*it)->getNumberOfComponents()!=nbOfComp) - throw INTERP_KERNEL::Exception("DataArrayDouble::aggregate : Nb of components mismatch for array aggregation !"); + throw INTERP_KERNEL::Exception("DataArrayDouble::Aggregate : Nb of components mismatch for array aggregation !"); nbt+=(*it)->getNumberOfTuples(); } DataArrayDouble *ret=DataArrayDouble::New(); @@ -1135,17 +1135,17 @@ DataArrayDouble *DataArrayDouble::aggregate(const std::vector arr(2); arr[0]=a1; arr[1]=a2; - return meld(arr); + return Meld(arr); } -DataArrayDouble *DataArrayDouble::meld(const std::vector& a) throw(INTERP_KERNEL::Exception) +DataArrayDouble *DataArrayDouble::Meld(const std::vector& a) throw(INTERP_KERNEL::Exception) { if(a.empty()) - throw INTERP_KERNEL::Exception("DataArrayDouble::meld : array must be NON empty !"); + throw INTERP_KERNEL::Exception("DataArrayDouble::Meld : array must be NON empty !"); std::vector::const_iterator it; for(it=a.begin();it!=a.end();it++) (*it)->checkAllocated(); @@ -1158,7 +1158,7 @@ DataArrayDouble *DataArrayDouble::meld(const std::vectorgetNumberOfTuples()) - throw INTERP_KERNEL::Exception("DataArrayDouble::meld : mismatch of number of tuples !"); + throw INTERP_KERNEL::Exception("DataArrayDouble::Meld : mismatch of number of tuples !"); nbc[i]=(*it)->getNumberOfComponents(); pts[i]=(*it)->getConstPointer(); } @@ -1179,16 +1179,16 @@ DataArrayDouble *DataArrayDouble::meld(const std::vectorcheckAllocated(); a2->checkAllocated(); int nbOfComp=a1->getNumberOfComponents(); if(nbOfComp!=a2->getNumberOfComponents()) - throw INTERP_KERNEL::Exception("Nb of components mismatch for array dot !"); + throw INTERP_KERNEL::Exception("Nb of components mismatch for array Dot !"); int nbOfTuple=a1->getNumberOfTuples(); if(nbOfTuple!=a2->getNumberOfTuples()) - throw INTERP_KERNEL::Exception("Nb of tuples mismatch for array dot !"); + throw INTERP_KERNEL::Exception("Nb of tuples mismatch for array Dot !"); DataArrayDouble *ret=DataArrayDouble::New(); ret->alloc(nbOfTuple,1); double *retPtr=ret->getPointer(); @@ -1206,7 +1206,7 @@ DataArrayDouble *DataArrayDouble::dot(const DataArrayDouble *a1, const DataArray return ret; } -DataArrayDouble *DataArrayDouble::crossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception) +DataArrayDouble *DataArrayDouble::CrossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception) { int nbOfComp=a1->getNumberOfComponents(); if(nbOfComp!=a2->getNumberOfComponents()) @@ -1231,14 +1231,14 @@ DataArrayDouble *DataArrayDouble::crossProduct(const DataArrayDouble *a1, const return ret; } -DataArrayDouble *DataArrayDouble::max(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception) +DataArrayDouble *DataArrayDouble::Max(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception) { int nbOfComp=a1->getNumberOfComponents(); if(nbOfComp!=a2->getNumberOfComponents()) - throw INTERP_KERNEL::Exception("Nb of components mismatch for array max !"); + throw INTERP_KERNEL::Exception("Nb of components mismatch for array Max !"); int nbOfTuple=a1->getNumberOfTuples(); if(nbOfTuple!=a2->getNumberOfTuples()) - throw INTERP_KERNEL::Exception("Nb of tuples mismatch for array max !"); + throw INTERP_KERNEL::Exception("Nb of tuples mismatch for array Max !"); DataArrayDouble *ret=DataArrayDouble::New(); ret->alloc(nbOfTuple,nbOfComp); double *retPtr=ret->getPointer(); @@ -1251,7 +1251,7 @@ DataArrayDouble *DataArrayDouble::max(const DataArrayDouble *a1, const DataArray return ret; } -DataArrayDouble *DataArrayDouble::min(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception) +DataArrayDouble *DataArrayDouble::Min(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception) { int nbOfComp=a1->getNumberOfComponents(); if(nbOfComp!=a2->getNumberOfComponents()) @@ -1271,7 +1271,7 @@ DataArrayDouble *DataArrayDouble::min(const DataArrayDouble *a1, const DataArray return ret; } -DataArrayDouble *DataArrayDouble::add(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception) +DataArrayDouble *DataArrayDouble::Add(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception) { int nbOfComp=a1->getNumberOfComponents(); if(nbOfComp!=a2->getNumberOfComponents()) @@ -1298,14 +1298,14 @@ void DataArrayDouble::addEqual(const DataArrayDouble *other) throw(INTERP_KERNEL declareAsNew(); } -DataArrayDouble *DataArrayDouble::substract(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception) +DataArrayDouble *DataArrayDouble::Substract(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception) { int nbOfComp=a1->getNumberOfComponents(); if(nbOfComp!=a2->getNumberOfComponents()) - throw INTERP_KERNEL::Exception("Nb of components mismatch for array substract !"); + throw INTERP_KERNEL::Exception("Nb of components mismatch for array Substract !"); int nbOfTuple=a1->getNumberOfTuples(); if(nbOfTuple!=a2->getNumberOfTuples()) - throw INTERP_KERNEL::Exception("Nb of tuples mismatch for array substract !"); + throw INTERP_KERNEL::Exception("Nb of tuples mismatch for array Substract !"); DataArrayDouble *ret=DataArrayDouble::New(); ret->alloc(nbOfTuple,nbOfComp); std::transform(a1->getConstPointer(),a1->getConstPointer()+nbOfTuple*nbOfComp,a2->getConstPointer(),ret->getPointer(),std::minus()); @@ -1325,7 +1325,7 @@ void DataArrayDouble::substractEqual(const DataArrayDouble *other) throw(INTERP_ declareAsNew(); } -DataArrayDouble *DataArrayDouble::multiply(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception) +DataArrayDouble *DataArrayDouble::Multiply(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception) { int nbOfTuple=a1->getNumberOfTuples(); int nbOfTuple2=a2->getNumberOfTuples(); @@ -1399,7 +1399,7 @@ void DataArrayDouble::multiplyEqual(const DataArrayDouble *other) throw(INTERP_K declareAsNew(); } -DataArrayDouble *DataArrayDouble::divide(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception) +DataArrayDouble *DataArrayDouble::Divide(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception) { int nbOfTuple=a1->getNumberOfTuples(); int nbOfTuple2=a2->getNumberOfTuples(); @@ -1957,7 +1957,7 @@ void DataArrayInt::setSelectedComponents(const DataArrayInt *a, const std::vecto nc[nbOfCompo*i+compoIds[j]]=*ac; } -void DataArrayInt::setArrayIn(DataArrayInt *newArray, DataArrayInt* &arrayToSet) +void DataArrayInt::SetArrayIn(DataArrayInt *newArray, DataArrayInt* &arrayToSet) { if(newArray!=arrayToSet) { @@ -2002,11 +2002,11 @@ DataArrayInt *DataArrayInt::getIdsEqualList(const std::vector& vals) const return ret; } -DataArrayInt *DataArrayInt::aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2) +DataArrayInt *DataArrayInt::Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2) { int nbOfComp=a1->getNumberOfComponents(); if(nbOfComp!=a2->getNumberOfComponents()) - throw INTERP_KERNEL::Exception("Nb of components mismatch for array aggregation !"); + throw INTERP_KERNEL::Exception("Nb of components mismatch for array Aggregation !"); int nbOfTuple1=a1->getNumberOfTuples(); int nbOfTuple2=a2->getNumberOfTuples(); DataArrayInt *ret=DataArrayInt::New(); @@ -2043,17 +2043,17 @@ int DataArrayInt::getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception return *loc; } -DataArrayInt *DataArrayInt::meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception) +DataArrayInt *DataArrayInt::Meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception) { std::vector arr(2); arr[0]=a1; arr[1]=a2; - return meld(arr); + return Meld(arr); } -DataArrayInt *DataArrayInt::meld(const std::vector& a) throw(INTERP_KERNEL::Exception) +DataArrayInt *DataArrayInt::Meld(const std::vector& a) throw(INTERP_KERNEL::Exception) { if(a.empty()) - throw INTERP_KERNEL::Exception("DataArrayInt::meld : array must be NON empty !"); + throw INTERP_KERNEL::Exception("DataArrayInt::Meld : array must be NON empty !"); std::vector::const_iterator it; for(it=a.begin();it!=a.end();it++) (*it)->checkAllocated(); @@ -2096,7 +2096,7 @@ DataArrayInt *DataArrayInt::meld(const std::vector& a) thr * @param newNb specifies size of whole set. Must be at least equal to max eltid in 'groups'. * @return an array of size newNb specifying fid of each item. */ -DataArrayInt *DataArrayInt::makePartition(const std::vector& groups, int newNb, std::vector< std::vector >& fidsOfGroups) +DataArrayInt *DataArrayInt::MakePartition(const std::vector& groups, int newNb, std::vector< std::vector >& fidsOfGroups) { DataArrayInt *ret=DataArrayInt::New(); ret->alloc(newNb,1); diff --git a/src/MEDCoupling/MEDCouplingMemArray.hxx b/src/MEDCoupling/MEDCouplingMemArray.hxx index c3259e03b..9194cc88e 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.hxx +++ b/src/MEDCoupling/MEDCouplingMemArray.hxx @@ -157,7 +157,7 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void setIJ(int tupleId, int compoId, double newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; declareAsNew(); } MEDCOUPLING_EXPORT void setIJSilent(int tupleId, int compoId, double newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; } MEDCOUPLING_EXPORT double *getPointer() const { return _mem.getPointer(); } - MEDCOUPLING_EXPORT static void setArrayIn(DataArrayDouble *newArray, DataArrayDouble* &arrayToSet); + MEDCOUPLING_EXPORT static void SetArrayIn(DataArrayDouble *newArray, DataArrayDouble* &arrayToSet); MEDCOUPLING_EXPORT const double *getConstPointer() const { return _mem.getConstPointer(); } MEDCOUPLING_EXPORT void useArray(const double *array, bool ownership, DeallocType type, int nbOfTuple, int nbOfCompo); MEDCOUPLING_EXPORT void writeOnPlace(int id, double element0, const double *others, int sizeOfOthers) { _mem.writeOnPlace(id,element0,others,sizeOfOthers); } @@ -189,21 +189,21 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void applyFuncFast32(const char *func) throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT void applyFuncFast64(const char *func) throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static DataArrayDouble *aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static DataArrayDouble *aggregate(const std::vector& a) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static DataArrayDouble *meld(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static DataArrayDouble *meld(const std::vector& a) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static DataArrayDouble *dot(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static DataArrayDouble *crossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static DataArrayDouble *max(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static DataArrayDouble *min(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static DataArrayDouble *add(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static DataArrayDouble *Aggregate(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static DataArrayDouble *Aggregate(const std::vector& a) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static DataArrayDouble *Meld(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static DataArrayDouble *Meld(const std::vector& a) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static DataArrayDouble *Dot(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static DataArrayDouble *CrossProduct(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static DataArrayDouble *Max(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static DataArrayDouble *Min(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static DataArrayDouble *Add(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT void addEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static DataArrayDouble *substract(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static DataArrayDouble *Substract(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT void substractEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static DataArrayDouble *multiply(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static DataArrayDouble *Multiply(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT void multiplyEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static DataArrayDouble *divide(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static DataArrayDouble *Divide(const DataArrayDouble *a1, const DataArrayDouble *a2) throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT void divideEqual(const DataArrayDouble *other) throw(INTERP_KERNEL::Exception); //! nothing to do here because this class does not aggregate any TimeLabel instance. MEDCOUPLING_EXPORT void updateTime() { } @@ -261,16 +261,16 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void setIJ(int tupleId, int compoId, int newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; declareAsNew(); } MEDCOUPLING_EXPORT void setIJSilent(int tupleId, int compoId, int newVal) { _mem[tupleId*_info_on_compo.size()+compoId]=newVal; } MEDCOUPLING_EXPORT int *getPointer() const { return _mem.getPointer(); } - MEDCOUPLING_EXPORT static void setArrayIn(DataArrayInt *newArray, DataArrayInt* &arrayToSet); + MEDCOUPLING_EXPORT static void SetArrayIn(DataArrayInt *newArray, DataArrayInt* &arrayToSet); MEDCOUPLING_EXPORT const int *getConstPointer() const { return _mem.getConstPointer(); } MEDCOUPLING_EXPORT DataArrayInt *getIdsEqual(int val) const throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT DataArrayInt *getIdsEqualList(const std::vector& vals) const throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT int getMaxValue(int& tupleId) const throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT int getMinValue(int& tupleId) const throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static DataArrayInt *aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2); - MEDCOUPLING_EXPORT static DataArrayInt *meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static DataArrayInt *meld(const std::vector& a) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static DataArrayInt *makePartition(const std::vector& groups, int newNb, std::vector< std::vector >& fidsOfGroups); + MEDCOUPLING_EXPORT static DataArrayInt *Aggregate(const DataArrayInt *a1, const DataArrayInt *a2, int offsetA2); + MEDCOUPLING_EXPORT static DataArrayInt *Meld(const DataArrayInt *a1, const DataArrayInt *a2) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static DataArrayInt *Meld(const std::vector& a) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static DataArrayInt *MakePartition(const std::vector& groups, int newNb, std::vector< std::vector >& fidsOfGroups); MEDCOUPLING_EXPORT DataArrayInt *buildComplement(int nbOfElement) const throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT DataArrayInt *buildSubstraction(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT DataArrayInt *buildUnion(const DataArrayInt *other) const throw(INTERP_KERNEL::Exception); diff --git a/src/MEDCoupling/MEDCouplingMesh.cxx b/src/MEDCoupling/MEDCouplingMesh.cxx index cd3157568..81ccda0b7 100644 --- a/src/MEDCoupling/MEDCouplingMesh.cxx +++ b/src/MEDCoupling/MEDCouplingMesh.cxx @@ -208,7 +208,7 @@ MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic(TypeOfField t, int nbO * retruns a newly created mesh with counter=1 * that is the union of mesh1 and mesh2 if possible. The cells of mesh2 will appear after cells of 'mesh1'. Idem for nodes. */ -MEDCouplingMesh *MEDCouplingMesh::mergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) +MEDCouplingMesh *MEDCouplingMesh::MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) { return mesh1->mergeMyselfWith(mesh2); } diff --git a/src/MEDCoupling/MEDCouplingMesh.hxx b/src/MEDCoupling/MEDCouplingMesh.hxx index d5b828676..27c5cb6ad 100644 --- a/src/MEDCoupling/MEDCouplingMesh.hxx +++ b/src/MEDCoupling/MEDCouplingMesh.hxx @@ -95,7 +95,7 @@ namespace ParaMEDMEM virtual MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception) = 0; virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception) = 0; virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const; - static MEDCouplingMesh *mergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2); + static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2); //serialisation-unserialization virtual void getTinySerializationInformation(std::vector& tinyInfo, std::vector& littleStrings) const = 0; virtual void resizeForUnserialization(const std::vector& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector& littleStrings) const = 0; diff --git a/src/MEDCoupling/MEDCouplingPointSet.cxx b/src/MEDCoupling/MEDCouplingPointSet.cxx index d4812d83a..4fa44dc4f 100644 --- a/src/MEDCoupling/MEDCouplingPointSet.cxx +++ b/src/MEDCoupling/MEDCouplingPointSet.cxx @@ -545,18 +545,18 @@ void MEDCouplingPointSet::findNodesOnPlane(const double *pt, const double *vec, /*! * merge _coords arrays of m1 and m2 and returns the union. The returned instance is newly created with ref count == 1. */ -DataArrayDouble *MEDCouplingPointSet::mergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception) +DataArrayDouble *MEDCouplingPointSet::MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception) { int spaceDim=m1->getSpaceDimension(); if(spaceDim!=m2->getSpaceDimension()) - throw INTERP_KERNEL::Exception("Mismatch in SpaceDim during call of mergeNodesArray !"); - return DataArrayDouble::aggregate(m1->getCoords(),m2->getCoords()); + throw INTERP_KERNEL::Exception("Mismatch in SpaceDim during call of MergeNodesArray !"); + return DataArrayDouble::Aggregate(m1->getCoords(),m2->getCoords()); } -DataArrayDouble *MEDCouplingPointSet::mergeNodesArray(const std::vector& ms) throw(INTERP_KERNEL::Exception) +DataArrayDouble *MEDCouplingPointSet::MergeNodesArray(const std::vector& ms) throw(INTERP_KERNEL::Exception) { if(ms.empty()) - throw INTERP_KERNEL::Exception("MEDCouplingPointSet::mergeNodesArray : input array must be NON EMPTY !"); + throw INTERP_KERNEL::Exception("MEDCouplingPointSet::MergeNodesArray : input array must be NON EMPTY !"); std::vector::const_iterator it=ms.begin(); std::vector coo(ms.size()); int spaceDim=(*it)->getSpaceDimension(); @@ -569,19 +569,19 @@ DataArrayDouble *MEDCouplingPointSet::mergeNodesArray(const std::vectorgetSpaceDimension()==spaceDim) coo[i]=tmp; else - throw INTERP_KERNEL::Exception("Mismatch in SpaceDim during call of mergeNodesArray !"); + throw INTERP_KERNEL::Exception("Mismatch in SpaceDim during call of MergeNodesArray !"); } else - throw INTERP_KERNEL::Exception("Empty coords detected during call of mergeNodesArray !"); + throw INTERP_KERNEL::Exception("Empty coords detected during call of MergeNodesArray !"); } - return DataArrayDouble::aggregate(coo); + return DataArrayDouble::Aggregate(coo); } /*! * Factory to build new instance of instanciable subclasses of MEDCouplingPointSet. * This method is used during unserialization process. */ -MEDCouplingPointSet *MEDCouplingPointSet::buildInstanceFromMeshType(MEDCouplingMeshType type) +MEDCouplingPointSet *MEDCouplingPointSet::BuildInstanceFromMeshType(MEDCouplingMeshType type) { switch(type) { @@ -740,14 +740,14 @@ void MEDCouplingPointSet::rotate3D(const double *center, const double *vect, dou { double *coords=_coords->getPointer(); int nbNodes=getNumberOfNodes(); - rotate3DAlg(center,vect,angle,nbNodes,coords); + Rotate3DAlg(center,vect,angle,nbNodes,coords); } /*! * Low static method that operates 3D rotation of 'nbNodes' 3D nodes whose coordinates are arranged in 'coords' * around an axe ('center','vect') and with angle 'angle'. */ -void MEDCouplingPointSet::rotate3DAlg(const double *center, const double *vect, double angle, int nbNodes, double *coords) +void MEDCouplingPointSet::Rotate3DAlg(const double *center, const double *vect, double angle, int nbNodes, double *coords) { double sina=sin(angle); double cosa=cos(angle); @@ -813,14 +813,14 @@ void MEDCouplingPointSet::rotate2D(const double *center, double angle) { double *coords=_coords->getPointer(); int nbNodes=getNumberOfNodes(); - rotate2DAlg(center,angle,nbNodes,coords); + Rotate2DAlg(center,angle,nbNodes,coords); } /*! * Low static method that operates 3D rotation of 'nbNodes' 3D nodes whose coordinates are arranged in 'coords' * around the center point 'center' and with angle 'angle'. */ -void MEDCouplingPointSet::rotate2DAlg(const double *center, double angle, int nbNodes, double *coords) +void MEDCouplingPointSet::Rotate2DAlg(const double *center, double angle, int nbNodes, double *coords) { double cosa=cos(angle); double sina=sin(angle); diff --git a/src/MEDCoupling/MEDCouplingPointSet.hxx b/src/MEDCoupling/MEDCouplingPointSet.hxx index 4a51adf5b..0085f7f40 100644 --- a/src/MEDCoupling/MEDCouplingPointSet.hxx +++ b/src/MEDCoupling/MEDCouplingPointSet.hxx @@ -71,11 +71,11 @@ namespace ParaMEDMEM void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception); virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception) = 0; void findNodesOnPlane(const double *pt, const double *vec, double eps, std::vector& nodes) const throw(INTERP_KERNEL::Exception); - static DataArrayDouble *mergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception); - static DataArrayDouble *mergeNodesArray(const std::vector& ms) throw(INTERP_KERNEL::Exception); - static MEDCouplingPointSet *buildInstanceFromMeshType(MEDCouplingMeshType type); - static void rotate2DAlg(const double *center, double angle, int nbNodes, double *coords); - static void rotate3DAlg(const double *center, const double *vect, double angle, int nbNodes, double *coords); + static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception); + static DataArrayDouble *MergeNodesArray(const std::vector& ms) throw(INTERP_KERNEL::Exception); + static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type); + static void Rotate2DAlg(const double *center, double angle, int nbNodes, double *coords); + static void Rotate3DAlg(const double *center, const double *vect, double angle, int nbNodes, double *coords); MEDCouplingMesh *buildPart(const int *start, const int *end) const; MEDCouplingMesh *buildPartAndReduceNodes(const int *start, const int *end, DataArrayInt*& arr) const; virtual MEDCouplingPointSet *buildPartOfMySelf(const int *start, const int *end, bool keepCoords) const = 0; diff --git a/src/MEDCoupling/MEDCouplingRemapper.cxx b/src/MEDCoupling/MEDCouplingRemapper.cxx index bb494899b..76026ff8c 100644 --- a/src/MEDCoupling/MEDCouplingRemapper.cxx +++ b/src/MEDCoupling/MEDCouplingRemapper.cxx @@ -316,7 +316,7 @@ int MEDCouplingRemapper::prepareEE(const char *method) throw(INTERP_KERNEL::Exce int nbCols2D=interpolation2D.interpolateMeshes(source_mesh_wrapper,target_mesh_wrapper,matrix2D,method); MEDCouplingUMesh *s1D,*t1D; double v[3]; - MEDCouplingExtrudedMesh::project1DMeshes(src_mesh->getMesh1D(),target_mesh->getMesh1D(),getPrecision(),s1D,t1D,v); + MEDCouplingExtrudedMesh::Project1DMeshes(src_mesh->getMesh1D(),target_mesh->getMesh1D(),getPrecision(),s1D,t1D,v); MEDCouplingNormalizedUnstructuredMesh<1,1> s1DWrapper(s1D); MEDCouplingNormalizedUnstructuredMesh<1,1> t1DWrapper(t1D); std::vector > matrix1D; diff --git a/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx b/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx index 8757e8c10..ca03fa009 100644 --- a/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx +++ b/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx @@ -773,7 +773,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::aggregate(const MEDCoupli const MEDCouplingNoTimeLabel *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("NoTimeLabel::aggregation on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::aggregate(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Aggregate(getArray(),other->getArray()); MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel; ret->setArray(arr,0); arr->decrRef(); @@ -791,7 +791,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::aggregate(const std::vect throw INTERP_KERNEL::Exception("NoTimeLabel::aggregate on mismatched time discretization !"); a[i]=itC->getArray(); } - DataArrayDouble *arr=DataArrayDouble::aggregate(a); + DataArrayDouble *arr=DataArrayDouble::Aggregate(a); MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel; ret->setArray(arr,0); arr->decrRef(); @@ -803,7 +803,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::meld(const MEDCouplingTim const MEDCouplingNoTimeLabel *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("NoTimeLabel::meld on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::meld(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Meld(getArray(),other->getArray()); MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel; ret->setTimeTolerance(getTimeTolerance()); ret->setArray(arr,0); @@ -816,7 +816,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::dot(const MEDCouplingTime const MEDCouplingNoTimeLabel *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("NoTimeLabel::dot on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::dot(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Dot(getArray(),other->getArray()); MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel; ret->setArray(arr,0); arr->decrRef(); @@ -828,7 +828,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::crossProduct(const MEDCou const MEDCouplingNoTimeLabel *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("NoTimeLabel::crossProduct on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::crossProduct(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::CrossProduct(getArray(),other->getArray()); MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel; ret->setArray(arr,0); arr->decrRef(); @@ -840,7 +840,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::max(const MEDCouplingTime const MEDCouplingNoTimeLabel *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("NoTimeLabel::max on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::max(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Max(getArray(),other->getArray()); MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel; ret->setArray(arr,0); arr->decrRef(); @@ -852,7 +852,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::min(const MEDCouplingTime const MEDCouplingNoTimeLabel *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("NoTimeLabel::max on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::min(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Min(getArray(),other->getArray()); MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel; ret->setArray(arr,0); arr->decrRef(); @@ -864,7 +864,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::add(const MEDCouplingTime const MEDCouplingNoTimeLabel *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("NoTimeLabel::add on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::add(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Add(getArray(),other->getArray()); MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel; ret->setArray(arr,0); arr->decrRef(); @@ -884,7 +884,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::substract(const MEDCoupli const MEDCouplingNoTimeLabel *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("NoTimeLabel::substract on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::substract(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Substract(getArray(),other->getArray()); MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel; ret->setArray(arr,0); arr->decrRef(); @@ -904,7 +904,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::multiply(const MEDCouplin const MEDCouplingNoTimeLabel *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("NoTimeLabel::multiply on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::multiply(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Multiply(getArray(),other->getArray()); MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel; ret->setArray(arr,0); arr->decrRef(); @@ -924,7 +924,7 @@ MEDCouplingTimeDiscretization *MEDCouplingNoTimeLabel::divide(const MEDCouplingT const MEDCouplingNoTimeLabel *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("divide on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::divide(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Divide(getArray(),other->getArray()); MEDCouplingNoTimeLabel *ret=new MEDCouplingNoTimeLabel; ret->setArray(arr,0); arr->decrRef(); @@ -1118,7 +1118,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::aggregate(const MEDCoupl const MEDCouplingWithTimeStep *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("WithTimeStep::aggregation on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::aggregate(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Aggregate(getArray(),other->getArray()); MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep; ret->setArray(arr,0); arr->decrRef(); @@ -1136,7 +1136,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::aggregate(const std::vec throw INTERP_KERNEL::Exception("WithTimeStep::aggregate on mismatched time discretization !"); a[i]=itC->getArray(); } - DataArrayDouble *arr=DataArrayDouble::aggregate(a); + DataArrayDouble *arr=DataArrayDouble::Aggregate(a); MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep; ret->setArray(arr,0); arr->decrRef(); @@ -1148,7 +1148,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::meld(const MEDCouplingTi const MEDCouplingWithTimeStep *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("WithTimeStep::meld on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::meld(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Meld(getArray(),other->getArray()); MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep; ret->setArray(arr,0); arr->decrRef(); @@ -1161,7 +1161,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::dot(const MEDCouplingTim if(!otherC) throw INTERP_KERNEL::Exception("WithTimeStep::dot on mismatched time discretization !"); MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep; - DataArrayDouble *arr=DataArrayDouble::dot(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Dot(getArray(),other->getArray()); ret->setArray(arr,0); arr->decrRef(); return ret; @@ -1172,7 +1172,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::crossProduct(const MEDCo const MEDCouplingWithTimeStep *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("WithTimeStep::crossProduct on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::crossProduct(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::CrossProduct(getArray(),other->getArray()); MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep; ret->setArray(arr,0); arr->decrRef(); @@ -1184,7 +1184,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::max(const MEDCouplingTim const MEDCouplingWithTimeStep *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("WithTimeStep::max on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::max(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Max(getArray(),other->getArray()); MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep; ret->setArray(arr,0); arr->decrRef(); @@ -1196,7 +1196,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::min(const MEDCouplingTim const MEDCouplingWithTimeStep *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("WithTimeStep::min on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::min(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Min(getArray(),other->getArray()); MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep; ret->setArray(arr,0); arr->decrRef(); @@ -1208,7 +1208,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::add(const MEDCouplingTim const MEDCouplingWithTimeStep *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("WithTimeStep::add on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::add(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Add(getArray(),other->getArray()); MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep; ret->setArray(arr,0); arr->decrRef(); @@ -1231,7 +1231,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::substract(const MEDCoupl const MEDCouplingWithTimeStep *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("WithTimeStep::substract on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::substract(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Substract(getArray(),other->getArray()); MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep; ret->setArray(arr,0); arr->decrRef(); @@ -1254,7 +1254,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::multiply(const MEDCoupli const MEDCouplingWithTimeStep *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("WithTimeStep::multiply on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::multiply(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Multiply(getArray(),other->getArray()); MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep; ret->setArray(arr,0); arr->decrRef(); @@ -1277,7 +1277,7 @@ MEDCouplingTimeDiscretization *MEDCouplingWithTimeStep::divide(const MEDCoupling const MEDCouplingWithTimeStep *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("WithTimeStep::divide on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::divide(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Divide(getArray(),other->getArray()); MEDCouplingWithTimeStep *ret=new MEDCouplingWithTimeStep; ret->setArray(arr,0); arr->decrRef(); @@ -1556,7 +1556,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::aggregate(const M const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("ConstOnTimeInterval::aggregation on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::aggregate(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Aggregate(getArray(),other->getArray()); MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval; ret->setArray(arr,0); arr->decrRef(); @@ -1574,7 +1574,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::aggregate(const s throw INTERP_KERNEL::Exception("ConstOnTimeInterval::aggregate on mismatched time discretization !"); a[i]=itC->getArray(); } - DataArrayDouble *arr=DataArrayDouble::aggregate(a); + DataArrayDouble *arr=DataArrayDouble::Aggregate(a); MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval; ret->setArray(arr,0); arr->decrRef(); @@ -1586,7 +1586,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::meld(const MEDCou const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("ConstOnTimeInterval::meld on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::meld(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Meld(getArray(),other->getArray()); MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval; ret->setTimeTolerance(getTimeTolerance()); ret->setArray(arr,0); @@ -1599,7 +1599,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::dot(const MEDCoup const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("ConstOnTimeInterval::dot on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::dot(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Dot(getArray(),other->getArray()); MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval; ret->setArray(arr,0); arr->decrRef(); @@ -1611,7 +1611,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::crossProduct(cons const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("ConstOnTimeInterval::crossProduct on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::crossProduct(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::CrossProduct(getArray(),other->getArray()); MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval; ret->setArray(arr,0); arr->decrRef(); @@ -1623,7 +1623,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::max(const MEDCoup const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("ConstOnTimeInterval::max on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::max(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Max(getArray(),other->getArray()); MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval; ret->setArray(arr,0); arr->decrRef(); @@ -1635,7 +1635,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::min(const MEDCoup const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("ConstOnTimeInterval::min on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::min(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Min(getArray(),other->getArray()); MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval; ret->setArray(arr,0); arr->decrRef(); @@ -1647,7 +1647,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::add(const MEDCoup const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("ConstOnTimeInterval::add on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::add(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Add(getArray(),other->getArray()); MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval; ret->setArray(arr,0); arr->decrRef(); @@ -1672,7 +1672,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::substract(const M const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("ConstOnTimeInterval::substract on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::substract(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Substract(getArray(),other->getArray()); MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval; ret->setArray(arr,0); arr->decrRef(); @@ -1697,7 +1697,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::multiply(const ME const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("multiply on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::multiply(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Multiply(getArray(),other->getArray()); MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval; ret->setArray(arr,0); arr->decrRef(); @@ -1722,7 +1722,7 @@ MEDCouplingTimeDiscretization *MEDCouplingConstOnTimeInterval::divide(const MEDC const MEDCouplingConstOnTimeInterval *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("divide on mismatched time discretization !"); - DataArrayDouble *arr=DataArrayDouble::divide(getArray(),other->getArray()); + DataArrayDouble *arr=DataArrayDouble::Divide(getArray(),other->getArray()); MEDCouplingConstOnTimeInterval *ret=new MEDCouplingConstOnTimeInterval; ret->setArray(arr,0); arr->decrRef(); @@ -2126,8 +2126,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::aggregate(const MEDCouplin const MEDCouplingLinearTime *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("LinearTime::aggregation on mismatched time discretization !"); - DataArrayDouble *arr1=DataArrayDouble::aggregate(getArray(),other->getArray()); - DataArrayDouble *arr2=DataArrayDouble::aggregate(getEndArray(),other->getEndArray()); + DataArrayDouble *arr1=DataArrayDouble::Aggregate(getArray(),other->getArray()); + DataArrayDouble *arr2=DataArrayDouble::Aggregate(getEndArray(),other->getEndArray()); MEDCouplingLinearTime *ret=new MEDCouplingLinearTime; ret->setArray(arr1,0); arr1->decrRef(); @@ -2149,8 +2149,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::aggregate(const std::vecto a[i]=itC->getArray(); b[i]=itC->getEndArray(); } - DataArrayDouble *arr=DataArrayDouble::aggregate(a); - DataArrayDouble *arr2=DataArrayDouble::aggregate(b); + DataArrayDouble *arr=DataArrayDouble::Aggregate(a); + DataArrayDouble *arr2=DataArrayDouble::Aggregate(b); MEDCouplingLinearTime *ret=new MEDCouplingLinearTime; ret->setArray(arr,0); arr->decrRef(); @@ -2164,8 +2164,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::meld(const MEDCouplingTime const MEDCouplingLinearTime *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("LinearTime::meld on mismatched time discretization !"); - DataArrayDouble *arr1=DataArrayDouble::meld(getArray(),other->getArray()); - DataArrayDouble *arr2=DataArrayDouble::meld(getEndArray(),other->getEndArray()); + DataArrayDouble *arr1=DataArrayDouble::Meld(getArray(),other->getArray()); + DataArrayDouble *arr2=DataArrayDouble::Meld(getEndArray(),other->getEndArray()); MEDCouplingLinearTime *ret=new MEDCouplingLinearTime; ret->setTimeTolerance(getTimeTolerance()); ret->setArray(arr1,0); @@ -2180,8 +2180,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::dot(const MEDCouplingTimeD const MEDCouplingLinearTime *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("LinearTime::dot on mismatched time discretization !"); - DataArrayDouble *arr1=DataArrayDouble::dot(getArray(),other->getArray()); - DataArrayDouble *arr2=DataArrayDouble::dot(getEndArray(),other->getEndArray()); + DataArrayDouble *arr1=DataArrayDouble::Dot(getArray(),other->getArray()); + DataArrayDouble *arr2=DataArrayDouble::Dot(getEndArray(),other->getEndArray()); MEDCouplingLinearTime *ret=new MEDCouplingLinearTime; ret->setArray(arr1,0); arr1->decrRef(); @@ -2195,8 +2195,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::crossProduct(const MEDCoup const MEDCouplingLinearTime *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("LinearTime::crossProduct on mismatched time discretization !"); - DataArrayDouble *arr1=DataArrayDouble::crossProduct(getArray(),other->getArray()); - DataArrayDouble *arr2=DataArrayDouble::crossProduct(getEndArray(),other->getEndArray()); + DataArrayDouble *arr1=DataArrayDouble::CrossProduct(getArray(),other->getArray()); + DataArrayDouble *arr2=DataArrayDouble::CrossProduct(getEndArray(),other->getEndArray()); MEDCouplingLinearTime *ret=new MEDCouplingLinearTime; ret->setArray(arr1,0); arr1->decrRef(); @@ -2211,10 +2211,10 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::max(const MEDCouplingTimeD if(!otherC) throw INTERP_KERNEL::Exception("LinearTime::max on mismatched time discretization !"); MEDCouplingLinearTime *ret=new MEDCouplingLinearTime; - DataArrayDouble *arr1=DataArrayDouble::max(getArray(),other->getArray()); + DataArrayDouble *arr1=DataArrayDouble::Max(getArray(),other->getArray()); ret->setArray(arr1,0); arr1->decrRef(); - DataArrayDouble *arr2=DataArrayDouble::max(getEndArray(),other->getEndArray()); + DataArrayDouble *arr2=DataArrayDouble::Max(getEndArray(),other->getEndArray()); ret->setEndArray(arr2,0); arr2->decrRef(); return ret; @@ -2225,8 +2225,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::min(const MEDCouplingTimeD const MEDCouplingLinearTime *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("LinearTime::min on mismatched time discretization !"); - DataArrayDouble *arr1=DataArrayDouble::min(getArray(),other->getArray()); - DataArrayDouble *arr2=DataArrayDouble::min(getEndArray(),other->getEndArray()); + DataArrayDouble *arr1=DataArrayDouble::Min(getArray(),other->getArray()); + DataArrayDouble *arr2=DataArrayDouble::Min(getEndArray(),other->getEndArray()); MEDCouplingLinearTime *ret=new MEDCouplingLinearTime; ret->setArray(arr1,0); arr1->decrRef(); @@ -2240,8 +2240,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::add(const MEDCouplingTimeD const MEDCouplingLinearTime *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("LinearTime::add on mismatched time discretization !"); - DataArrayDouble *arr1=DataArrayDouble::add(getArray(),other->getArray()); - DataArrayDouble *arr2=DataArrayDouble::add(getEndArray(),other->getEndArray()); + DataArrayDouble *arr1=DataArrayDouble::Add(getArray(),other->getArray()); + DataArrayDouble *arr2=DataArrayDouble::Add(getEndArray(),other->getEndArray()); MEDCouplingLinearTime *ret=new MEDCouplingLinearTime; ret->setArray(arr1,0); arr1->decrRef(); @@ -2264,8 +2264,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::substract(const MEDCouplin const MEDCouplingLinearTime *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("LinearTime::substract on mismatched time discretization !"); - DataArrayDouble *arr1=DataArrayDouble::substract(getArray(),other->getArray()); - DataArrayDouble *arr2=DataArrayDouble::substract(getEndArray(),other->getEndArray()); + DataArrayDouble *arr1=DataArrayDouble::Substract(getArray(),other->getArray()); + DataArrayDouble *arr2=DataArrayDouble::Substract(getEndArray(),other->getEndArray()); MEDCouplingLinearTime *ret=new MEDCouplingLinearTime; ret->setArray(arr1,0); arr1->decrRef(); @@ -2288,8 +2288,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::multiply(const MEDCoupling const MEDCouplingLinearTime *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("LinearTime::multiply on mismatched time discretization !"); - DataArrayDouble *arr1=DataArrayDouble::multiply(getArray(),other->getArray()); - DataArrayDouble *arr2=DataArrayDouble::multiply(getEndArray(),other->getEndArray()); + DataArrayDouble *arr1=DataArrayDouble::Multiply(getArray(),other->getArray()); + DataArrayDouble *arr2=DataArrayDouble::Multiply(getEndArray(),other->getEndArray()); MEDCouplingLinearTime *ret=new MEDCouplingLinearTime; ret->setArray(arr1,0); arr1->decrRef(); @@ -2312,8 +2312,8 @@ MEDCouplingTimeDiscretization *MEDCouplingLinearTime::divide(const MEDCouplingTi const MEDCouplingLinearTime *otherC=dynamic_cast(other); if(!otherC) throw INTERP_KERNEL::Exception("LinearTime::divide on mismatched time discretization !"); - DataArrayDouble *arr1=DataArrayDouble::divide(getArray(),other->getArray()); - DataArrayDouble *arr2=DataArrayDouble::divide(getEndArray(),other->getEndArray()); + DataArrayDouble *arr1=DataArrayDouble::Divide(getArray(),other->getArray()); + DataArrayDouble *arr2=DataArrayDouble::Divide(getEndArray(),other->getEndArray()); MEDCouplingLinearTime *ret=new MEDCouplingLinearTime; ret->setArray(arr1,0); arr1->decrRef(); diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index 02a5a5871..338d7140a 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -265,7 +265,7 @@ void MEDCouplingUMesh::checkDeepEquivalWith(const MEDCouplingMesh *other, int ce MEDCouplingMesh::checkFastEquivalWith(other,prec); if(_types!=otherC->_types) throw INTERP_KERNEL::Exception("checkDeepEquivalWith : Types are not equal !"); - MEDCouplingAutoRefCountObjectPtr m=mergeUMeshes(this,otherC); + MEDCouplingAutoRefCountObjectPtr m=MergeUMeshes(this,otherC); bool areNodesMerged; int newNbOfNodes; int oldNbOfNodes=getNumberOfNodes(); @@ -327,7 +327,7 @@ void MEDCouplingUMesh::checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *ot std::vector ms(2); ms[0]=const_cast(this); ms[1]=const_cast(otherC); - MEDCouplingAutoRefCountObjectPtr m=mergeUMeshesOnSameCoords(ms); + MEDCouplingAutoRefCountObjectPtr m=MergeUMeshesOnSameCoords(ms); MEDCouplingAutoRefCountObjectPtr da=m->zipConnectivityTraducer(cellCompPol); int maxId=*std::max_element(da->getConstPointer(),da->getConstPointer()+getNumberOfCells()); const int *pt=std::find_if(da->getConstPointer()+getNumberOfCells(),da->getConstPointer()+da->getNbOfElems(),std::bind2nd(std::greater(),maxId)); @@ -917,7 +917,7 @@ DataArrayInt *MEDCouplingUMesh::zipConnectivityTraducer(int compType) throw(INTE */ bool MEDCouplingUMesh::areCellsIncludedIn(const MEDCouplingUMesh *other, int compType, DataArrayInt *& arr) const throw(INTERP_KERNEL::Exception) { - MEDCouplingAutoRefCountObjectPtr mesh=mergeUMeshesOnSameCoords(this,other); + MEDCouplingAutoRefCountObjectPtr mesh=MergeUMeshesOnSameCoords(this,other); MEDCouplingAutoRefCountObjectPtr o2n=mesh->zipConnectivityTraducer(compType); int nbOfCells=getNumberOfCells(); arr=o2n->substr(nbOfCells); @@ -950,7 +950,9 @@ DataArrayInt *MEDCouplingUMesh::mergeNodes2(double precision, bool& areNodesMerg /*! * This method tries to use 'other' coords and use it for 'this'. If no exception was thrown after the call of this method : - * this->_coords==other->_coords. If not a exception is thrown this remains unchanged. + * this->_coords==other->_coords. If an exception is thrown 'this' remains unchanged. + * Contrary to MEDCouplingUMesh::tryToShareSameCoords method this method makes a deeper analyze of coordinates (and so more expensive) than simple equality. + * Two nodes one in 'this' and other in 'other' are considered equal if the distance between the two is lower than epsilon. */ void MEDCouplingUMesh::tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception) { @@ -960,7 +962,7 @@ void MEDCouplingUMesh::tryToShareSameCoordsPermute(const MEDCouplingPointSet& ot if(!_coords) throw INTERP_KERNEL::Exception("tryToShareSameCoordsPermute : No coords specified in this whereas there is any in other !"); int otherNbOfNodes=other.getNumberOfNodes(); - MEDCouplingAutoRefCountObjectPtr newCoords=mergeNodesArray(&other,this); + MEDCouplingAutoRefCountObjectPtr newCoords=MergeNodesArray(&other,this); _coords->incrRef(); MEDCouplingAutoRefCountObjectPtr oldCoords=_coords; setCoords(newCoords); @@ -1496,8 +1498,8 @@ int MEDCouplingUMesh::getNumberOfNodesInCell(int cellId) const */ void MEDCouplingUMesh::setConnectivity(DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes) { - DataArrayInt::setArrayIn(conn,_nodal_connec); - DataArrayInt::setArrayIn(connIndex,_nodal_connec_index); + DataArrayInt::SetArrayIn(conn,_nodal_connec); + DataArrayInt::SetArrayIn(connIndex,_nodal_connec_index); if(isComputingTypes) computeTypes(); declareAsNew(); @@ -2670,7 +2672,7 @@ void MEDCouplingUMesh::are2DCellsNotCorrectlyOriented(const double *vec, bool po INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[connI[i]]; if(!polyOnly || type==INTERP_KERNEL::NORM_POLYGON) { - if(!isPolygonWellOriented(vec,conn+connI[i]+1,conn+connI[i+1],coordsPtr)) + if(!IsPolygonWellOriented(vec,conn+connI[i]+1,conn+connI[i+1],coordsPtr)) cells.push_back(i); } } @@ -2694,7 +2696,7 @@ void MEDCouplingUMesh::orientCorrectly2DCells(const double *vec, bool polyOnly) { INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[connI[i]]; if(!polyOnly || type==INTERP_KERNEL::NORM_POLYGON) - if(!isPolygonWellOriented(vec,conn+connI[i]+1,conn+connI[i+1],coordsPtr)) + if(!IsPolygonWellOriented(vec,conn+connI[i]+1,conn+connI[i+1],coordsPtr)) { isModified=true; std::vector tmp(connI[i+1]-connI[i]-2); @@ -2725,7 +2727,7 @@ void MEDCouplingUMesh::arePolyhedronsNotCorrectlyOriented(std::vector& cell INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[connI[i]]; if(type==INTERP_KERNEL::NORM_POLYHED) { - if(!isPolyhedronWellOriented(conn+connI[i]+1,conn+connI[i+1],coordsPtr)) + if(!IsPolyhedronWellOriented(conn+connI[i]+1,conn+connI[i+1],coordsPtr)) cells.push_back(i); } } @@ -2748,9 +2750,9 @@ void MEDCouplingUMesh::orientCorrectlyPolyhedrons() throw(INTERP_KERNEL::Excepti { INTERP_KERNEL::NormalizedCellType type=(INTERP_KERNEL::NormalizedCellType)conn[connI[i]]; if(type==INTERP_KERNEL::NORM_POLYHED) - if(!isPolyhedronWellOriented(conn+connI[i]+1,conn+connI[i+1],coordsPtr)) + if(!IsPolyhedronWellOriented(conn+connI[i]+1,conn+connI[i+1],coordsPtr)) { - tryToCorrectPolyhedronOrientation(conn+connI[i]+1,conn+connI[i+1],coordsPtr); + TryToCorrectPolyhedronOrientation(conn+connI[i]+1,conn+connI[i+1],coordsPtr); isModified=true; } } @@ -3262,7 +3264,7 @@ MEDCouplingMesh *MEDCouplingUMesh::mergeMyselfWith(const MEDCouplingMesh *other) if(other->getType()!=UNSTRUCTURED) throw INTERP_KERNEL::Exception("Merge of umesh only available with umesh each other !"); const MEDCouplingUMesh *otherC=static_cast(other); - return mergeUMeshes(this,otherC); + return MergeUMeshes(this,otherC); } /*! @@ -3295,17 +3297,17 @@ DataArrayDouble *MEDCouplingUMesh::getBarycenterAndOwner() const * Returns a newly created mesh (with ref count ==1) that contains merge of 'mesh1' and 'other'. * The coords of 'mesh2' are added at the end of coords of 'mesh1'. */ -MEDCouplingUMesh *MEDCouplingUMesh::mergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception) +MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception) { std::vector tmp(2); tmp[0]=const_cast(mesh1); tmp[1]=const_cast(mesh2); - return mergeUMeshes(tmp); + return MergeUMeshes(tmp); } -MEDCouplingUMesh *MEDCouplingUMesh::mergeUMeshes(std::vector& a) throw(INTERP_KERNEL::Exception) +MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshes(std::vector& a) throw(INTERP_KERNEL::Exception) { if(a.empty()) - throw INTERP_KERNEL::Exception("MEDCouplingUMesh::mergeUMeshes : input array must be NON EMPTY !"); + throw INTERP_KERNEL::Exception("MEDCouplingUMesh::MergeUMeshes : input array must be NON EMPTY !"); std::vector::const_iterator it=a.begin(); int meshDim=(*it)->getMeshDimension(); int nbOfCells=(*it)->getNumberOfCells(); @@ -3313,13 +3315,13 @@ MEDCouplingUMesh *MEDCouplingUMesh::mergeUMeshes(std::vectorgetMeshDimension()) - throw INTERP_KERNEL::Exception("Mesh dimensions mismatches, mergeMeshes impossible !"); + throw INTERP_KERNEL::Exception("Mesh dimensions mismatches, MergeUMeshes impossible !"); nbOfCells+=(*it)->getNumberOfCells(); meshLgth+=(*it)->getMeshLength(); } std::vector aps(a.size()); std::copy(a.begin(),a.end(),aps.begin()); - DataArrayDouble *pts=mergeNodesArray(aps); + DataArrayDouble *pts=MergeNodesArray(aps); MEDCouplingAutoRefCountObjectPtr ret=MEDCouplingUMesh::New("merge",meshDim); ret->setCoords(pts); pts->decrRef(); @@ -3362,21 +3364,21 @@ MEDCouplingUMesh *MEDCouplingUMesh::mergeUMeshes(std::vector tmp(2); tmp[0]=const_cast(mesh1); tmp[1]=const_cast(mesh2); - return mergeUMeshesOnSameCoords(tmp); + return MergeUMeshesOnSameCoords(tmp); } /*! - * Idem mergeUMeshes except that 'meshes' are expected to lyie on the same coords and 'meshes' have the same meshdim. + * Idem MergeUMeshes except that 'meshes' are expected to lyie on the same coords and 'meshes' have the same meshdim. * 'meshes' must be a non empty vector. */ -MEDCouplingUMesh *MEDCouplingUMesh::mergeUMeshesOnSameCoords(const std::vector& meshes) +MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshesOnSameCoords(const std::vector& meshes) { if(meshes.empty()) throw INTERP_KERNEL::Exception("meshes input parameter is expected to be non empty."); @@ -3436,10 +3438,10 @@ MEDCouplingUMesh *MEDCouplingUMesh::mergeUMeshesOnSameCoords(const std::vector& meshes, int compType, std::vector& corr) +MEDCouplingUMesh *MEDCouplingUMesh::FuseUMeshesOnSameCoords(const std::vector& meshes, int compType, std::vector& corr) { - //All checks are delegated to mergeUMeshesOnSameCoords - MEDCouplingUMesh *ret=mergeUMeshesOnSameCoords(meshes); + //All checks are delegated to MergeUMeshesOnSameCoords + MEDCouplingUMesh *ret=MergeUMeshesOnSameCoords(meshes); DataArrayInt *o2n=ret->zipConnectivityTraducer(compType); corr.resize(meshes.size()); int nbOfMeshes=meshes.size(); @@ -3544,7 +3546,7 @@ void MEDCouplingUMesh::appendExtrudedCell(const int *connBg, const int *connEnd, /*! * This static operates only for coords in 3D. The polygon is specfied by its connectivity nodes in [begin,end). */ -bool MEDCouplingUMesh::isPolygonWellOriented(const double *vec, const int *begin, const int *end, const double *coords) +bool MEDCouplingUMesh::IsPolygonWellOriented(const double *vec, const int *begin, const int *end, const double *coords) { double v[3]={0.,0.,0.}; int sz=std::distance(begin,end); @@ -3560,7 +3562,7 @@ bool MEDCouplingUMesh::isPolygonWellOriented(const double *vec, const int *begin /*! * The polyhedron is specfied by its connectivity nodes in [begin,end). */ -bool MEDCouplingUMesh::isPolyhedronWellOriented(const int *begin, const int *end, const double *coords) +bool MEDCouplingUMesh::IsPolyhedronWellOriented(const int *begin, const int *end, const double *coords) { std::vector > edges; int nbOfFaces=std::count(begin,end,-1)+1; @@ -3585,7 +3587,7 @@ bool MEDCouplingUMesh::isPolyhedronWellOriented(const int *begin, const int *end * This method tries to obtain a well oriented polyhedron. * If the algorithm fails, an exception will be thrown. */ -void MEDCouplingUMesh::tryToCorrectPolyhedronOrientation(int *begin, int *end, const double *coords) throw(INTERP_KERNEL::Exception) +void MEDCouplingUMesh::TryToCorrectPolyhedronOrientation(int *begin, int *end, const double *coords) throw(INTERP_KERNEL::Exception) { std::vector > edges; int nbOfFaces=std::count(begin,end,-1)+1; diff --git a/src/MEDCoupling/MEDCouplingUMesh.hxx b/src/MEDCoupling/MEDCouplingUMesh.hxx index 3594338ea..95b32260c 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.hxx +++ b/src/MEDCoupling/MEDCouplingUMesh.hxx @@ -138,14 +138,14 @@ namespace ParaMEDMEM // MEDCOUPLING_EXPORT MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const; MEDCOUPLING_EXPORT DataArrayDouble *getBarycenterAndOwner() const; - MEDCOUPLING_EXPORT static MEDCouplingUMesh *mergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static MEDCouplingUMesh *mergeUMeshes(std::vector& a) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static MEDCouplingUMesh *mergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception); - MEDCOUPLING_EXPORT static MEDCouplingUMesh *mergeUMeshesOnSameCoords(const std::vector& meshes); - MEDCOUPLING_EXPORT static MEDCouplingUMesh *fuseUMeshesOnSameCoords(const std::vector& meshes, int compType, std::vector& corr); - MEDCOUPLING_EXPORT static bool isPolygonWellOriented(const double *vec, const int *begin, const int *end, const double *coords); - MEDCOUPLING_EXPORT static bool isPolyhedronWellOriented(const int *begin, const int *end, const double *coords); - MEDCOUPLING_EXPORT static void tryToCorrectPolyhedronOrientation(int *begin, int *end, const double *coords) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static MEDCouplingUMesh *MergeUMeshes(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static MEDCouplingUMesh *MergeUMeshes(std::vector& a) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw(INTERP_KERNEL::Exception); + MEDCOUPLING_EXPORT static MEDCouplingUMesh *MergeUMeshesOnSameCoords(const std::vector& meshes); + MEDCOUPLING_EXPORT static MEDCouplingUMesh *FuseUMeshesOnSameCoords(const std::vector& meshes, int compType, std::vector& corr); + MEDCOUPLING_EXPORT static bool IsPolygonWellOriented(const double *vec, const int *begin, const int *end, const double *coords); + MEDCOUPLING_EXPORT static bool IsPolyhedronWellOriented(const int *begin, const int *end, const double *coords); + MEDCOUPLING_EXPORT static void TryToCorrectPolyhedronOrientation(int *begin, int *end, const double *coords) throw(INTERP_KERNEL::Exception); private: MEDCouplingUMesh(); MEDCouplingUMesh(const MEDCouplingUMesh& other, bool deepCpy); diff --git a/src/MEDCoupling/MEDCouplingUMeshDesc.cxx b/src/MEDCoupling/MEDCouplingUMeshDesc.cxx index e0cff180d..3a68c1536 100644 --- a/src/MEDCoupling/MEDCouplingUMeshDesc.cxx +++ b/src/MEDCoupling/MEDCouplingUMeshDesc.cxx @@ -167,10 +167,10 @@ std::string MEDCouplingUMeshDesc::advancedRepr() const void MEDCouplingUMeshDesc::setConnectivity(DataArrayInt *descConn, DataArrayInt *descConnIndex, DataArrayInt *nodalFaceConn, DataArrayInt *nodalFaceConnIndx) { - DataArrayInt::setArrayIn(descConn,_desc_connec); - DataArrayInt::setArrayIn(descConnIndex,_desc_connec_index); - DataArrayInt::setArrayIn(nodalFaceConn,_nodal_connec_face); - DataArrayInt::setArrayIn(nodalFaceConnIndx,_nodal_connec_face_index); + DataArrayInt::SetArrayIn(descConn,_desc_connec); + DataArrayInt::SetArrayIn(descConnIndex,_desc_connec_index); + DataArrayInt::SetArrayIn(nodalFaceConn,_nodal_connec_face); + DataArrayInt::SetArrayIn(nodalFaceConnIndx,_nodal_connec_face_index); computeTypes(); } diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx index 98f0f6b72..eb1ebb9dc 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx @@ -730,10 +730,10 @@ void MEDCouplingBasicsTest::testZipConnectivity() CPPUNIT_ASSERT(m3); m2->decrRef(); MEDCouplingUMesh *m4=build2DSourceMesh_1(); - MEDCouplingUMesh *m5=MEDCouplingUMesh::mergeUMeshes(m1,m3); + MEDCouplingUMesh *m5=MEDCouplingUMesh::MergeUMeshes(m1,m3); m1->decrRef(); m3->decrRef(); - MEDCouplingUMesh *m6=MEDCouplingUMesh::mergeUMeshes(m5,m4); + MEDCouplingUMesh *m6=MEDCouplingUMesh::MergeUMeshes(m5,m4); m4->decrRef(); m5->decrRef(); // @@ -1321,7 +1321,7 @@ void MEDCouplingBasicsTest::testMergeMeshOnSameCoords1() m3->tryToShareSameCoords(*m2,1e-12); std::vector meshes; meshes.push_back(m1); meshes.push_back(m2); meshes.push_back(m3); - MEDCouplingUMesh *m4=MEDCouplingUMesh::mergeUMeshesOnSameCoords(meshes); + MEDCouplingUMesh *m4=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes); m4->checkCoherency(); CPPUNIT_ASSERT(m4->getCoords()==m1->getCoords()); CPPUNIT_ASSERT_EQUAL(15,m4->getNumberOfCells()); @@ -1353,7 +1353,7 @@ void MEDCouplingBasicsTest::testMergeField1() m2->translate(vec); MEDCouplingFieldDouble *f1=m1->getMeasureField(true); MEDCouplingFieldDouble *f2=m2->getMeasureField(true); - MEDCouplingFieldDouble *f3=MEDCouplingFieldDouble::mergeFields(f1,f2); + MEDCouplingFieldDouble *f3=MEDCouplingFieldDouble::MergeFields(f1,f2); f3->checkCoherency(); MEDCouplingUMesh *m4=build2DTargetMeshMerged_1(); CPPUNIT_ASSERT(f3->getMesh()->isEqual(m4,1.e-12)); @@ -1978,7 +1978,7 @@ void MEDCouplingBasicsTest::testSplitByType() MEDCouplingUMesh *m1=build3DSurfTargetMesh_1(); std::vector v=m1->splitByType(); CPPUNIT_ASSERT_EQUAL(3,(int)v.size()); - MEDCouplingUMesh *m2=MEDCouplingUMesh::mergeUMeshesOnSameCoords(v); + MEDCouplingUMesh *m2=MEDCouplingUMesh::MergeUMeshesOnSameCoords(v); m2->setName(m1->getName()); CPPUNIT_ASSERT(m1->isEqual(m2,1.e-12)); for(std::vector::const_iterator iter=v.begin();iter!=v.end();iter++) @@ -2009,7 +2009,7 @@ void MEDCouplingBasicsTest::testFuseUMeshesOnSameCoords() m2->decrRef(); // std::vector corr; - MEDCouplingUMesh *m7=MEDCouplingUMesh::fuseUMeshesOnSameCoords(meshes,0,corr); + MEDCouplingUMesh *m7=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,0,corr); CPPUNIT_ASSERT_EQUAL(4,m7->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(3,(int)corr.size()); const int expectedVals1[3]={3,3,2}; @@ -2025,7 +2025,7 @@ void MEDCouplingBasicsTest::testFuseUMeshesOnSameCoords() CPPUNIT_ASSERT_EQUAL(expectedVals2[i][j],vals[j]); } std::vector< std::vector > fidsOfGroups; - DataArrayInt *arr2=DataArrayInt::makePartition(corr,m7->getNumberOfCells(),fidsOfGroups); + DataArrayInt *arr2=DataArrayInt::MakePartition(corr,m7->getNumberOfCells(),fidsOfGroups); const int fidExp[4]={5,1,3,4}; const int fidsGrp[3][3]={{1,3,5},{3,4,5},{4,5,23344}}; CPPUNIT_ASSERT_EQUAL(3,(int)fidsOfGroups.size()); @@ -2063,7 +2063,7 @@ void MEDCouplingBasicsTest::testFuseUMeshesOnSameCoords2() meshes.push_back(m3); meshes.push_back(m4); std::vector corr; - MEDCouplingUMesh *m5=MEDCouplingUMesh::fuseUMeshesOnSameCoords(meshes,0,corr); + MEDCouplingUMesh *m5=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,0,corr); CPPUNIT_ASSERT_EQUAL(18,m5->getNumberOfCells()); std::vector::iterator it=corr.begin(); const int exp1[4]={18,5,5,4}; @@ -2139,7 +2139,7 @@ void MEDCouplingBasicsTest::testGetCellsContainingPoint() CPPUNIT_ASSERT(std::equal(t2.begin(),t2.end(),expectedValues2)); //2D with no help of bounding box. double center[2]={0.2,0.2}; - MEDCouplingPointSet::rotate2DAlg(center,0.78539816339744830962,6,pos); + MEDCouplingPointSet::Rotate2DAlg(center,0.78539816339744830962,6,pos); targetMesh->rotate(center,0,0.78539816339744830962); t1.clear(); t2.clear(); targetMesh->getCellsContainingPoints(pos,6,1e-12,t1,t2); diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx index 6bbc8b209..27c797f0a 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx @@ -2367,10 +2367,10 @@ void MEDCouplingBasicsTest::testFieldDoubleZipConnectivity1() CPPUNIT_ASSERT(m3); m2->decrRef(); MEDCouplingUMesh *m4=build2DSourceMesh_1(); - MEDCouplingUMesh *m5=MEDCouplingUMesh::mergeUMeshes(m1,m3); + MEDCouplingUMesh *m5=MEDCouplingUMesh::MergeUMeshes(m1,m3); m1->decrRef(); m3->decrRef(); - MEDCouplingUMesh *m6=MEDCouplingUMesh::mergeUMeshes(m5,m4); + MEDCouplingUMesh *m6=MEDCouplingUMesh::MergeUMeshes(m5,m4); m4->decrRef(); m5->decrRef(); // @@ -3233,7 +3233,7 @@ void MEDCouplingBasicsTest::testGetNodeIdsNearPoints1() tmp->alloc(3,2); const double vals[6]={0.2,0.2,0.1,0.2,0.2,0.2}; std::copy(vals,vals+6,tmp->getPointer()); - DataArrayDouble *tmp2=DataArrayDouble::aggregate(coords,tmp); + DataArrayDouble *tmp2=DataArrayDouble::Aggregate(coords,tmp); tmp->decrRef(); mesh->setCoords(tmp2); tmp2->decrRef(); @@ -3663,7 +3663,7 @@ void MEDCouplingBasicsTest::testDAMeld1() for(int i=0;i<35;i++) CPPUNIT_ASSERT_EQUAL((int)expected1[i],dai1->getIJ(0,i)); // test of static method DataArrayDouble::meld - DataArrayDouble *da4=DataArrayDouble::meld(da1C,da3); + DataArrayDouble *da4=DataArrayDouble::Meld(da1C,da3); CPPUNIT_ASSERT_EQUAL(5,da4->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(7,da4->getNumberOfTuples()); CPPUNIT_ASSERT(da4->getInfoOnComponent(0)=="c0da1"); @@ -3676,7 +3676,7 @@ void MEDCouplingBasicsTest::testDAMeld1() // test of static method DataArrayInt::meld dai1->decrRef(); dai1=da1C->convertToIntArr(); - DataArrayInt *dai4=DataArrayInt::meld(dai1,dai3); + DataArrayInt *dai4=DataArrayInt::Meld(dai1,dai3); CPPUNIT_ASSERT_EQUAL(5,dai4->getNumberOfComponents()); CPPUNIT_ASSERT_EQUAL(7,dai4->getNumberOfTuples()); CPPUNIT_ASSERT(dai4->getInfoOnComponent(0)=="c0da1"); @@ -3720,7 +3720,7 @@ void MEDCouplingBasicsTest::testFieldMeld1() f2->getArray()->setInfoOnComponent(1,"ccc"); f2->checkCoherency(); // - MEDCouplingFieldDouble *f3=MEDCouplingFieldDouble::meldFields(f2,f1); + MEDCouplingFieldDouble *f3=MEDCouplingFieldDouble::MeldFields(f2,f1); f3->checkCoherency(); CPPUNIT_ASSERT_EQUAL(5,f3->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(3,f3->getNumberOfComponents()); @@ -3738,7 +3738,7 @@ void MEDCouplingBasicsTest::testFieldMeld1() // MEDCouplingFieldDouble *f4=f2->buildNewTimeReprFromThis(NO_TIME,false); MEDCouplingFieldDouble *f5=f1->buildNewTimeReprFromThis(NO_TIME,false); - MEDCouplingFieldDouble *f6=MEDCouplingFieldDouble::meldFields(f4,f5); + MEDCouplingFieldDouble *f6=MEDCouplingFieldDouble::MeldFields(f4,f5); f6->checkCoherency(); CPPUNIT_ASSERT_EQUAL(5,f6->getNumberOfTuples()); CPPUNIT_ASSERT_EQUAL(3,f6->getNumberOfComponents()); @@ -3768,7 +3768,7 @@ void MEDCouplingBasicsTest::testMergeNodes2() std::vector tmp(2); tmp[0]=m1; tmp[1]=m2; - MEDCouplingUMesh *m3=MEDCouplingUMesh::mergeUMeshes(tmp); + MEDCouplingUMesh *m3=MEDCouplingUMesh::MergeUMeshes(tmp); bool b; int newNbOfNodes; DataArrayInt *da=m3->mergeNodes2(0.01,b,newNbOfNodes); @@ -3810,7 +3810,7 @@ void MEDCouplingBasicsTest::testMergeField2() // std::vector tmp(3); tmp[0]=f1; tmp[1]=f2; tmp[2]=f3; - MEDCouplingFieldDouble *f4=MEDCouplingFieldDouble::mergeFields(tmp); + MEDCouplingFieldDouble *f4=MEDCouplingFieldDouble::MergeFields(tmp); CPPUNIT_ASSERT_EQUAL(15,f4->getMesh()->getNumberOfCells()); const double expected1[30]={2.,2.,2.,2.,2.,2.,2.,2.,2.,2., 5.,5.,5.,5.,5.,5.,5.,5.,5.,5., 7.,7.,7.,7.,7.,7.,7.,7.,7.,7.}; for(int i=0;i<30;i++) diff --git a/src/MEDCoupling_Swig/MEDCoupling.i b/src/MEDCoupling_Swig/MEDCoupling.i index 57fd23951..3d676e08b 100644 --- a/src/MEDCoupling_Swig/MEDCoupling.i +++ b/src/MEDCoupling_Swig/MEDCoupling.i @@ -66,8 +66,8 @@ using namespace INTERP_KERNEL; %newobject ParaMEDMEM::MEDCouplingFieldDouble::New; %newobject ParaMEDMEM::MEDCouplingFieldDouble::getArray; %newobject ParaMEDMEM::MEDCouplingFieldDouble::getEndArray; -%newobject ParaMEDMEM::MEDCouplingFieldDouble::mergeFields; -%newobject ParaMEDMEM::MEDCouplingFieldDouble::meldFields; +%newobject ParaMEDMEM::MEDCouplingFieldDouble::MergeFields; +%newobject ParaMEDMEM::MEDCouplingFieldDouble::MeldFields; %newobject ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct; %newobject ParaMEDMEM::MEDCouplingFieldDouble::determinant; %newobject ParaMEDMEM::MEDCouplingFieldDouble::eigenValues; @@ -78,13 +78,17 @@ using namespace INTERP_KERNEL; %newobject ParaMEDMEM::MEDCouplingFieldDouble::magnitude; %newobject ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple; %newobject ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents; -%newobject ParaMEDMEM::MEDCouplingFieldDouble::dotFields; +%newobject ParaMEDMEM::MEDCouplingFieldDouble::DotFields; %newobject ParaMEDMEM::MEDCouplingFieldDouble::dot; -%newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProductFields; +%newobject ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields; %newobject ParaMEDMEM::MEDCouplingFieldDouble::crossProduct; -%newobject ParaMEDMEM::MEDCouplingFieldDouble::maxFields; +%newobject ParaMEDMEM::MEDCouplingFieldDouble::MaxFields; %newobject ParaMEDMEM::MEDCouplingFieldDouble::max; -%newobject ParaMEDMEM::MEDCouplingFieldDouble::minFields; +%newobject ParaMEDMEM::MEDCouplingFieldDouble::MinFields; +%newobject ParaMEDMEM::MEDCouplingFieldDouble::AddFields; +%newobject ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields; +%newobject ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields; +%newobject ParaMEDMEM::MEDCouplingFieldDouble::DivideFields; %newobject ParaMEDMEM::MEDCouplingFieldDouble::min; %newobject ParaMEDMEM::MEDCouplingFieldDouble::getIdsInRange; %newobject ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart; @@ -112,8 +116,8 @@ using namespace INTERP_KERNEL; %newobject ParaMEDMEM::DataArrayInt::invertArrayN2O2O2N; %newobject ParaMEDMEM::DataArrayInt::getIdsEqual; %newobject ParaMEDMEM::DataArrayInt::getIdsEqualList; -%newobject ParaMEDMEM::DataArrayInt::aggregate; -%newobject ParaMEDMEM::DataArrayInt::meld; +%newobject ParaMEDMEM::DataArrayInt::Aggregate; +%newobject ParaMEDMEM::DataArrayInt::Meld; %newobject ParaMEDMEM::DataArrayInt::fromNoInterlace; %newobject ParaMEDMEM::DataArrayInt::toNoInterlace; %newobject ParaMEDMEM::DataArrayInt::buildComplement; @@ -125,14 +129,14 @@ using namespace INTERP_KERNEL; %newobject ParaMEDMEM::DataArrayDouble::convertToIntArr; %newobject ParaMEDMEM::DataArrayDouble::deepCpy; %newobject ParaMEDMEM::DataArrayDouble::performCpy; -%newobject ParaMEDMEM::DataArrayDouble::aggregate; -%newobject ParaMEDMEM::DataArrayDouble::meld; -%newobject ParaMEDMEM::DataArrayDouble::dot; -%newobject ParaMEDMEM::DataArrayDouble::crossProduct; -%newobject ParaMEDMEM::DataArrayDouble::add; -%newobject ParaMEDMEM::DataArrayDouble::substract; -%newobject ParaMEDMEM::DataArrayDouble::multiply; -%newobject ParaMEDMEM::DataArrayDouble::divide; +%newobject ParaMEDMEM::DataArrayDouble::Aggregate; +%newobject ParaMEDMEM::DataArrayDouble::Meld; +%newobject ParaMEDMEM::DataArrayDouble::Dot; +%newobject ParaMEDMEM::DataArrayDouble::CrossProduct; +%newobject ParaMEDMEM::DataArrayDouble::Add; +%newobject ParaMEDMEM::DataArrayDouble::Substract; +%newobject ParaMEDMEM::DataArrayDouble::Multiply; +%newobject ParaMEDMEM::DataArrayDouble::Divide; %newobject ParaMEDMEM::DataArrayDouble::substr; %newobject ParaMEDMEM::DataArrayDouble::changeNbOfComponents; %newobject ParaMEDMEM::DataArrayDouble::keepSelectedComponents; @@ -166,10 +170,11 @@ using namespace INTERP_KERNEL; %newobject ParaMEDMEM::MEDCouplingMesh::getMeasureField; %newobject ParaMEDMEM::MEDCouplingMesh::simplexize; %newobject ParaMEDMEM::MEDCouplingMesh::buildUnstructured; +%newobject ParaMEDMEM::MEDCouplingMesh::MergeMeshes; %newobject ParaMEDMEM::MEDCouplingPointSet::zipCoordsTraducer; %newobject ParaMEDMEM::MEDCouplingPointSet::buildBoundaryMesh; -%newobject ParaMEDMEM::MEDCouplingPointSet::mergeNodesArray; -%newobject ParaMEDMEM::MEDCouplingPointSet::buildInstanceFromMeshType; +%newobject ParaMEDMEM::MEDCouplingPointSet::MergeNodesArray; +%newobject ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType; %newobject ParaMEDMEM::MEDCouplingUMesh::New; %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity; %newobject ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex; @@ -177,8 +182,8 @@ using namespace INTERP_KERNEL; %newobject ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer; %newobject ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity; %newobject ParaMEDMEM::MEDCouplingUMesh::buildExtrudedMesh; -%newobject ParaMEDMEM::MEDCouplingUMesh::mergeUMeshes; -%newobject ParaMEDMEM::MEDCouplingUMesh::mergeUMeshesOnSameCoords; +%newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes; +%newobject ParaMEDMEM::MEDCouplingUMesh::MergeUMeshesOnSameCoords; %newobject ParaMEDMEM::MEDCouplingUMesh::buildNewNumberingFromCommNodesFrmt; %newobject ParaMEDMEM::MEDCouplingUMesh::rearrange2ConsecutiveCellTypes; %newobject ParaMEDMEM::MEDCouplingUMesh::convertCellArrayPerGeoType; @@ -273,7 +278,7 @@ namespace ParaMEDMEM virtual MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception) = 0; virtual bool areCompatibleForMerge(const MEDCouplingMesh *other) const throw(INTERP_KERNEL::Exception); virtual DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception); - static MEDCouplingMesh *mergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception); + static MEDCouplingMesh *MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception); %extend { std::string __str__() const @@ -409,8 +414,8 @@ namespace ParaMEDMEM void changeSpaceDimension(int newSpaceDim, double dftVal=0.) throw(INTERP_KERNEL::Exception); void tryToShareSameCoords(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception); virtual void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception) = 0; - static DataArrayDouble *mergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception); - static MEDCouplingPointSet *buildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception); + static DataArrayDouble *MergeNodesArray(const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw(INTERP_KERNEL::Exception); + static MEDCouplingPointSet *BuildInstanceFromMeshType(MEDCouplingMeshType type) throw(INTERP_KERNEL::Exception); virtual MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const throw(INTERP_KERNEL::Exception) = 0; virtual bool isEmptyMesh(const std::vector& tinyInfo) const throw(INTERP_KERNEL::Exception) = 0; //! size of returned tinyInfo must be always the same. @@ -563,24 +568,24 @@ namespace ParaMEDMEM return convertIntArrToPyList2(elems); } - static void rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception) + static void Rotate2DAlg(PyObject *center, double angle, int nbNodes, PyObject *coords) throw(INTERP_KERNEL::Exception) { int sz; double *c=convertPyToNewDblArr2(center,&sz); double *coo=convertPyToNewDblArr2(coords,&sz); - ParaMEDMEM::MEDCouplingPointSet::rotate2DAlg(c,angle,nbNodes,coo); + ParaMEDMEM::MEDCouplingPointSet::Rotate2DAlg(c,angle,nbNodes,coo); for(int i=0;i meshes; if(PyList_Check(ms)) @@ -763,21 +768,21 @@ namespace ParaMEDMEM } else { - PyErr_SetString(PyExc_TypeError,"mergeUMeshesOnSameCoords : not a list as first parameter"); + PyErr_SetString(PyExc_TypeError,"MergeUMeshesOnSameCoords : not a list as first parameter"); PyErr_Print(); return 0; } - MEDCouplingUMesh *ret=MEDCouplingUMesh::mergeUMeshesOnSameCoords(meshes); + MEDCouplingUMesh *ret=MEDCouplingUMesh::MergeUMeshesOnSameCoords(meshes); return convertMesh(ret, SWIG_POINTER_OWN | 0 ); } - static PyObject *fuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception) + static PyObject *FuseUMeshesOnSameCoords(PyObject *ms, int compType) throw(INTERP_KERNEL::Exception) { int sz; std::vector meshes; convertPyObjToVecUMeshes(ms,meshes); std::vector corr; - MEDCouplingUMesh *um=MEDCouplingUMesh::fuseUMeshesOnSameCoords(meshes,compType,corr); + MEDCouplingUMesh *um=MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,compType,corr); sz=corr.size(); PyObject *ret1=PyList_New(sz); for(int i=0;i tmp; convertPyObjToVecUMeshesCst(li,tmp); - return MEDCouplingUMesh::mergeUMeshes(tmp); + return MEDCouplingUMesh::MergeUMeshes(tmp); } PyObject *areCellsIncludedIn(const MEDCouplingUMesh *other, int compType) const throw(INTERP_KERNEL::Exception) @@ -1146,18 +1151,18 @@ namespace ParaMEDMEM return convertDblArrToPyList(tmp,sz); } - static DataArrayDouble *aggregate(PyObject *li) throw(INTERP_KERNEL::Exception) + static DataArrayDouble *Aggregate(PyObject *li) throw(INTERP_KERNEL::Exception) { std::vector tmp; convertPyObjToVecDataArrayDblCst(li,tmp); - return DataArrayDouble::aggregate(tmp); + return DataArrayDouble::Aggregate(tmp); } - static DataArrayDouble *meld(PyObject *li) throw(INTERP_KERNEL::Exception) + static DataArrayDouble *Meld(PyObject *li) throw(INTERP_KERNEL::Exception) { std::vector tmp; convertPyObjToVecDataArrayDblCst(li,tmp); - return DataArrayDouble::meld(tmp); + return DataArrayDouble::Meld(tmp); } }; @@ -1203,12 +1208,12 @@ namespace ParaMEDMEM return convertIntArrToPyListOfTuple(vals,nbOfComp,nbOfTuples); } - static PyObject *makePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception) + static PyObject *MakePartition(PyObject *gps, int newNb) throw(INTERP_KERNEL::Exception) { std::vector groups; std::vector< std::vector > fidsOfGroups; convertPyObjToVecDataArrayInt(gps,groups); - ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::makePartition(groups,newNb,fidsOfGroups); + ParaMEDMEM::DataArrayInt *ret0=ParaMEDMEM::DataArrayInt::MakePartition(groups,newNb,fidsOfGroups); PyObject *ret = PyList_New(2); PyList_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 )); int sz=fidsOfGroups.size(); @@ -1315,11 +1320,11 @@ namespace ParaMEDMEM return convertIntArrToPyList(tmp,sz); } - static DataArrayInt *meld(PyObject *li) throw(INTERP_KERNEL::Exception) + static DataArrayInt *Meld(PyObject *li) throw(INTERP_KERNEL::Exception) { std::vector tmp; convertPyObjToVecDataArrayIntCst(li,tmp); - return DataArrayInt::meld(tmp); + return DataArrayInt::Meld(tmp); } PyObject *getMaxValue() const throw(INTERP_KERNEL::Exception) @@ -1475,15 +1480,19 @@ namespace ParaMEDMEM double normL2(int compId) const throw(INTERP_KERNEL::Exception); DataArrayInt *getIdsInRange(double vmin, double vmax) const throw(INTERP_KERNEL::Exception); MEDCouplingFieldDouble *buildSubPart(const DataArrayInt *part) const throw(INTERP_KERNEL::Exception); - static MEDCouplingFieldDouble *mergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); - static MEDCouplingFieldDouble *meldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); - static MEDCouplingFieldDouble *dotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + static MEDCouplingFieldDouble *MergeFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + static MEDCouplingFieldDouble *MeldFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + static MEDCouplingFieldDouble *DotFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); MEDCouplingFieldDouble *dot(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception); - static MEDCouplingFieldDouble *crossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + static MEDCouplingFieldDouble *CrossProductFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); MEDCouplingFieldDouble *crossProduct(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception); - static MEDCouplingFieldDouble *maxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + static MEDCouplingFieldDouble *MaxFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); MEDCouplingFieldDouble *max(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception); - static MEDCouplingFieldDouble *minFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + static MEDCouplingFieldDouble *MinFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + static MEDCouplingFieldDouble *AddFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + static MEDCouplingFieldDouble *SubstractFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + static MEDCouplingFieldDouble *MultiplyFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); + static MEDCouplingFieldDouble *DivideFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2) throw(INTERP_KERNEL::Exception); MEDCouplingFieldDouble *min(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception); MEDCouplingFieldDouble *operator+(const MEDCouplingFieldDouble& other) const throw(INTERP_KERNEL::Exception); const MEDCouplingFieldDouble &operator+=(const MEDCouplingFieldDouble& other) throw(INTERP_KERNEL::Exception); @@ -1716,11 +1725,11 @@ namespace ParaMEDMEM self->setSelectedComponents(f,tmp); } - static MEDCouplingFieldDouble *mergeFields(PyObject *li) throw(INTERP_KERNEL::Exception) + static MEDCouplingFieldDouble *MergeFields(PyObject *li) throw(INTERP_KERNEL::Exception) { std::vector tmp; convertPyObjToVecFieldDblCst(li,tmp); - return MEDCouplingFieldDouble::mergeFields(tmp); + return MEDCouplingFieldDouble::MergeFields(tmp); } } }; diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py index 0139b3836..a989f582d 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py @@ -477,8 +477,8 @@ class MEDCouplingBasicsTest(unittest.TestCase): m3=m2.buildPartOfMySelf(cells1,True); self.assertTrue(isinstance(m3,MEDCouplingUMesh)) m4=MEDCouplingDataForTest.build2DSourceMesh_1(); - m5=MEDCouplingUMesh.mergeUMeshes(m1,m3); - m6=MEDCouplingUMesh.mergeUMeshes(m5,m4); + m5=MEDCouplingUMesh.MergeUMeshes(m1,m3); + m6=MEDCouplingUMesh.MergeUMeshes(m5,m4); # self.assertEqual(10,m6.getNumberOfCells()); self.assertEqual(22,m6.getNumberOfNodes()); @@ -899,7 +899,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): m3=MEDCouplingDataForTest.build2DTargetMesh_1(); m3.tryToShareSameCoords(m2,1e-12); meshes=[m1,m2,m3] - m4=MEDCouplingUMesh.mergeUMeshesOnSameCoords(meshes); + m4=MEDCouplingUMesh.MergeUMeshesOnSameCoords(meshes); m4.checkCoherency(); self.assertEqual(15,m4.getNumberOfCells()); cells1=[0,1,2,3,4] @@ -923,7 +923,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): m2.translate(vec); f1=m1.getMeasureField(True); f2=m2.getMeasureField(True); - f3=MEDCouplingFieldDouble.mergeFields(f1,f2); + f3=MEDCouplingFieldDouble.MergeFields(f1,f2); f3.checkCoherency(); m4=MEDCouplingDataForTest.build2DTargetMeshMerged_1(); self.assertTrue(f3.getMesh().isEqual(m4,1.e-12)); @@ -1415,7 +1415,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): m1=MEDCouplingDataForTest.build3DSurfTargetMesh_1(); v=m1.splitByType(); self.assertEqual(3,len(v)); - m2=MEDCouplingUMesh.mergeUMeshesOnSameCoords(v); + m2=MEDCouplingUMesh.MergeUMeshesOnSameCoords(v); m2.setName(m1.getName()); self.assertTrue(m1.isEqual(m2,1.e-12)); pass @@ -1433,7 +1433,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): self.assertTrue(isinstance(m5,MEDCouplingUMesh)) meshes=[m3,m4,m5] # - m7,corr=MEDCouplingUMesh.fuseUMeshesOnSameCoords(meshes,0); + m7,corr=MEDCouplingUMesh.FuseUMeshesOnSameCoords(meshes,0); self.assertEqual(4,m7.getNumberOfCells()); self.assertEqual(3,len(corr)); expectedVals1=[3,3,2] @@ -1446,7 +1446,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): vals=arr.getValues(); self.assertEqual(expectedVals2[i],list(vals)); pass - arr2,fidsOfGroups=DataArrayInt.makePartition(corr,m7.getNumberOfCells()); + arr2,fidsOfGroups=DataArrayInt.MakePartition(corr,m7.getNumberOfCells()); fidExp=[5,1,3,4] fidsGrp=[[1,3,5],[3,4,5],[4,5]] self.assertEqual(3,len(fidsOfGroups)); @@ -1466,7 +1466,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): part2=[5,6,4,7] m4=m1.buildPartOfMySelf(part2,True); meshes=[m1,m3,m3,m4] - m5,corr=MEDCouplingUMesh.fuseUMeshesOnSameCoords(meshes,0); + m5,corr=MEDCouplingUMesh.FuseUMeshesOnSameCoords(meshes,0); self.assertEqual(18,m5.getNumberOfCells()); exp2=[ [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17], @@ -1522,7 +1522,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): self.assertEqual(list(t2),expectedValues2); #2D with no help of bounding box. center=[0.2,0.2] - MEDCouplingPointSet.rotate2DAlg(center,0.78539816339744830962,6,pos); + MEDCouplingPointSet.Rotate2DAlg(center,0.78539816339744830962,6,pos); targetMesh.rotate(center,[],0.78539816339744830962); t1=None t2=None @@ -3727,8 +3727,8 @@ class MEDCouplingBasicsTest(unittest.TestCase): m3_1=m2.buildPartOfMySelf(cells1,True); m3=m3_1; m4=MEDCouplingDataForTest.build2DSourceMesh_1(); - m5=MEDCouplingUMesh.mergeUMeshes(m1,m3); - m6=MEDCouplingUMesh.mergeUMeshes(m5,m4); + m5=MEDCouplingUMesh.MergeUMeshes(m1,m3); + m6=MEDCouplingUMesh.MergeUMeshes(m5,m4); # self.assertEqual(10,m6.getNumberOfCells()); self.assertEqual(22,m6.getNumberOfNodes()); @@ -4874,7 +4874,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): tmp=DataArrayDouble.New(); vals=[0.2,0.2,0.1,0.2,0.2,0.2] tmp.setValues(vals,3,2); - tmp2=DataArrayDouble.aggregate(coords,tmp); + tmp2=DataArrayDouble.Aggregate(coords,tmp); mesh.setCoords(tmp2); pts=[0.2,0.2,0.1,0.3,-0.3,0.7] c=mesh.getNodeIdsNearPoint(pts,1e-7); @@ -5217,8 +5217,8 @@ class MEDCouplingBasicsTest(unittest.TestCase): self.assertEqual(int(expected1[i]),dai1.getIJ(0,i)); pass # test of static method DataArrayDouble::meld - da4=DataArrayDouble.meld(da1C,da3); - tmp=DataArrayDouble.meld([da1C,da3]); + da4=DataArrayDouble.Meld(da1C,da3); + tmp=DataArrayDouble.Meld([da1C,da3]); self.assertTrue(da4.isEqual(tmp,1e-10)) self.assertEqual(5,da4.getNumberOfComponents()); self.assertEqual(7,da4.getNumberOfTuples()); @@ -5232,8 +5232,8 @@ class MEDCouplingBasicsTest(unittest.TestCase): pass # test of static method DataArrayInt::meld dai1=da1C.convertToIntArr(); - dai4=DataArrayInt.meld(dai1,dai3); - tmp=DataArrayInt.meld([dai1,dai3]); + dai4=DataArrayInt.Meld(dai1,dai3); + tmp=DataArrayInt.Meld([dai1,dai3]); self.assertTrue(dai4.isEqual(tmp)) self.assertEqual(5,dai4.getNumberOfComponents()); self.assertEqual(7,dai4.getNumberOfTuples()); @@ -5268,7 +5268,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): f2.getArray().setInfoOnComponent(1,"ccc"); f2.checkCoherency(); # - f3=MEDCouplingFieldDouble.meldFields(f2,f1); + f3=MEDCouplingFieldDouble.MeldFields(f2,f1); f3.checkCoherency(); self.assertEqual(5,f3.getNumberOfTuples()); self.assertEqual(3,f3.getNumberOfComponents()); @@ -5286,7 +5286,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): # f4=f2.buildNewTimeReprFromThis(NO_TIME,False); f5=f1.buildNewTimeReprFromThis(NO_TIME,False); - f6=MEDCouplingFieldDouble.meldFields(f4,f5); + f6=MEDCouplingFieldDouble.MeldFields(f4,f5); f6.checkCoherency(); self.assertEqual(5,f6.getNumberOfTuples()); self.assertEqual(3,f6.getNumberOfComponents()); @@ -5305,7 +5305,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): vec=[0.002,0.] m2.translate(vec); # - m3=MEDCouplingUMesh.mergeUMeshes([m1,m2]); + m3=MEDCouplingUMesh.MergeUMeshes([m1,m2]); da,b,newNbOfNodes=m3.mergeNodes2(0.01); self.assertEqual(9,m3.getNumberOfNodes()); expected1=[-0.299,-0.3, 0.201,-0.3, 0.701,-0.3, -0.299,0.2, 0.201,0.2, 0.701,0.2, -0.299,0.7, 0.201,0.7, 0.701,0.7] @@ -5336,7 +5336,7 @@ class MEDCouplingBasicsTest(unittest.TestCase): arr.fillWithValue(7.); f3.setArray(arr); # - f4=MEDCouplingFieldDouble.mergeFields([f1,f2,f3]); + f4=MEDCouplingFieldDouble.MergeFields([f1,f2,f3]); self.assertEqual(15,f4.getMesh().getNumberOfCells()); expected1=[2.,2.,2.,2.,2.,2.,2.,2.,2.,2., 5.,5.,5.,5.,5.,5.,5.,5.,5.,5., 7.,7.,7.,7.,7.,7.,7.,7.,7.,7.] for i in xrange(30): diff --git a/src/MEDLoader/MEDFileMesh.cxx b/src/MEDLoader/MEDFileMesh.cxx index 5e336bb1c..fb62b711c 100644 --- a/src/MEDLoader/MEDFileMesh.cxx +++ b/src/MEDLoader/MEDFileMesh.cxx @@ -546,17 +546,23 @@ void MEDFileUMesh::setGroupsAtLevel(int meshDimRelToMaxExt, const std::vector grpsName; - for(std::vector::const_iterator it=grps.begin();it!=grps.end();it++) - grpsName.insert((*it)->getName()); + std::vector grpsName2(grps.size()); + int i=0; + for(std::vector::const_iterator it=grps.begin();it!=grps.end();it++,i++) + { + grpsName.insert((*it)->getName()); + grpsName2[i]=(*it)->getName(); + } if(grpsName.size()!=grps.size()) throw INTERP_KERNEL::Exception("MEDFileUMesh::setGroupsAtLevel : groups name must be different each other !"); if(grpsName.find(std::string(""))!=grpsName.end()) throw INTERP_KERNEL::Exception("MEDFileUMesh::setGroupsAtLevel : groups name must be different empty string !"); - /* int sz=getSizeAtLevel(meshDimRelToMaxExt); + int sz=getSizeAtLevel(meshDimRelToMaxExt); if(!renum) { - - }*/ + std::vector< std::vector > fidsOfGroups; + DataArrayInt *fam=DataArrayInt::MakePartition(grps,sz,fidsOfGroups); + } } void MEDFileUMesh::eraseGroupsAtLevel(int meshDimRelToMaxExt) throw(INTERP_KERNEL::Exception) @@ -584,6 +590,30 @@ void MEDFileUMesh::optimizeFamilies() throw(INTERP_KERNEL::Exception) std::set_union(ids.begin(),ids.end(),allFamsIds.begin(),allFamsIds.end(),std::inserter(res,res.begin())); allFamsIds=res; } + std::set famNamesToKill; + for(std::map::const_iterator it=_families.begin();it!=_families.end();it++) + { + if(allFamsIds.find((*it).second)!=allFamsIds.end()) + famNamesToKill.insert((*it).first); + } + for(std::set::const_iterator it=famNamesToKill.begin();it!=famNamesToKill.end();it++) + _families.erase(*it); + std::vector grpNamesToKill; + for(std::map >::iterator it=_groups.begin();it!=_groups.end();it++) + { + std::vector tmp; + for(std::vector::const_iterator it2=(*it).second.begin();it2!=(*it).second.end();it2++) + { + if(famNamesToKill.find(*it2)==famNamesToKill.end()) + tmp.push_back(*it2); + } + if(!tmp.empty()) + (*it).second=tmp; + else + tmp.push_back((*it).first); + } + for(std::vector::const_iterator it=grpNamesToKill.begin();it!=grpNamesToKill.end();it++) + _groups.erase(*it); } void MEDFileUMesh::setFamilyField(DataArrayInt *arr, const std::vector< std::vector< int > > &userfids, const std::vector& grpNames) throw(INTERP_KERNEL::Exception) diff --git a/src/MEDLoader/MEDFileMeshLL.cxx b/src/MEDLoader/MEDFileMeshLL.cxx index 15992005f..2ca4fb7d7 100644 --- a/src/MEDLoader/MEDFileMeshLL.cxx +++ b/src/MEDLoader/MEDFileMeshLL.cxx @@ -247,7 +247,7 @@ MEDFileUMeshSplitL1::MEDFileUMeshSplitL1(const MEDFileUMeshL2& l2, const char *m tmp->setConnectivity(const_cast(v[i]->getNodal()),const_cast(v[i]->getNodalIndex())); ms[i]=tmp; } - _m_by_types=MEDCouplingUMesh::mergeUMeshesOnSameCoords(ms); + _m_by_types=MEDCouplingUMesh::MergeUMeshesOnSameCoords(ms); _m_by_types->setName(mName); if(l2.isFamDefinedOnLev(id)) { @@ -344,9 +344,9 @@ void MEDFileUMeshSplitL1::setGroupsFromScratch(const std::vector corr; - _m=MEDCouplingUMesh::fuseUMeshesOnSameCoords(ms,0,corr); + _m=MEDCouplingUMesh::FuseUMeshesOnSameCoords(ms,0,corr); std::vector< std::vector > fidsOfGroups; - _fam=DataArrayInt::makePartition(corr,_m->getNumberOfCells(),fidsOfGroups); + _fam=DataArrayInt::MakePartition(corr,_m->getNumberOfCells(),fidsOfGroups); int nbOfCells=_m->getNumberOfCells(); std::map newfams; std::map famIdTrad; diff --git a/src/MEDLoader/MEDLoader.cxx b/src/MEDLoader/MEDLoader.cxx index 15f179b3b..ecd95ef43 100644 --- a/src/MEDLoader/MEDLoader.cxx +++ b/src/MEDLoader/MEDLoader.cxx @@ -2222,10 +2222,10 @@ void MEDLoaderNS::writeUMeshesPartitionDirectly(const char *fileName, const char if(meshNameCpp=="") throw INTERP_KERNEL::Exception("writeUMeshesPartitionDirectly : Invalid meshName : Must be different from \"\" !"); std::vector< DataArrayInt * > corr; - MEDCouplingUMesh *m=ParaMEDMEM::MEDCouplingUMesh::fuseUMeshesOnSameCoords(meshes,0,corr); + MEDCouplingUMesh *m=ParaMEDMEM::MEDCouplingUMesh::FuseUMeshesOnSameCoords(meshes,0,corr); m->setName(meshName); std::vector< std::vector > fidsOfGroups; - DataArrayInt *arr2=DataArrayInt::makePartition(corr,m->getNumberOfCells(),fidsOfGroups); + DataArrayInt *arr2=DataArrayInt::MakePartition(corr,m->getNumberOfCells(),fidsOfGroups); for(std::vector< DataArrayInt * >::iterator it=corr.begin();it!=corr.end();it++) (*it)->decrRef(); bool isRenumbering; @@ -2547,7 +2547,7 @@ void MEDLoaderNS::writeFieldTryingToFitExistingMesh(const char *fileName, const throw INTERP_KERNEL::Exception(oss.str().c_str()); } MEDCouplingUMesh *m=MEDLoader::ReadUMeshFromFile(fileName,f->getMesh()->getName(),f2); - MEDCouplingUMesh *m2=MEDCouplingUMesh::mergeUMeshes(m,(MEDCouplingUMesh *)f->getMesh()); + MEDCouplingUMesh *m2=MEDCouplingUMesh::MergeUMeshes(m,(MEDCouplingUMesh *)f->getMesh()); bool areNodesMerged; int newNbOfNodes; DataArrayInt *da=m2->mergeNodes(MEDLoader::_EPS_FOR_NODE_COMP,areNodesMerged,newNbOfNodes); diff --git a/src/ParaMEDMEM/ElementLocator.cxx b/src/ParaMEDMEM/ElementLocator.cxx index 3252279cd..e14cf117c 100644 --- a/src/ParaMEDMEM/ElementLocator.cxx +++ b/src/ParaMEDMEM/ElementLocator.cxx @@ -258,7 +258,7 @@ namespace ParaMEDMEM //serialization of local mesh to send data to distant proc. local_mesh->serialize(v1Local,v2Local); //Building the right instance of copy of distant mesh. - MEDCouplingPointSet *distant_mesh_tmp=MEDCouplingPointSet::buildInstanceFromMeshType((MEDCouplingMeshType)tinyInfoDistant[0]); + MEDCouplingPointSet *distant_mesh_tmp=MEDCouplingPointSet::BuildInstanceFromMeshType((MEDCouplingMeshType)tinyInfoDistant[0]); std::vector unusedTinyDistantSts; distant_mesh_tmp->resizeForUnserialization(tinyInfoDistant,v1Distant,v2Distant,unusedTinyDistantSts); int nbLocalElems=0; -- 2.39.2