X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingMesh.cxx;h=181288b4bf3190809ef665a52266f65c02a909b3;hb=0c9d48870957c4a9f6f82fc8e2c569780a5f886b;hp=4e26cff4249d7483b6ed98ddf8a33b05c48f78be;hpb=4a6e7a006356d4ae12af6d9d7c58caff65f9c894;p=modules%2Fmed.git diff --git a/src/MEDCoupling/MEDCouplingMesh.cxx b/src/MEDCoupling/MEDCouplingMesh.cxx index 4e26cff42..181288b4b 100644 --- a/src/MEDCoupling/MEDCouplingMesh.cxx +++ b/src/MEDCoupling/MEDCouplingMesh.cxx @@ -37,7 +37,7 @@ MEDCouplingMesh::MEDCouplingMesh():_time(0.),_iteration(-1),_order(-1) { } -MEDCouplingMesh::MEDCouplingMesh(const MEDCouplingMesh& other):_name(other._name),_description(other._description), +MEDCouplingMesh::MEDCouplingMesh(const MEDCouplingMesh& other):RefCountObject(other),_name(other._name),_description(other._description), _time(other._time),_iteration(other._iteration), _order(other._order),_time_unit(other._time_unit) { @@ -56,7 +56,7 @@ bool MEDCouplingMesh::isStructured() const return getType()==CARTESIAN; } -bool MEDCouplingMesh::isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const throw(INTERP_KERNEL::Exception) +bool MEDCouplingMesh::isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const { if(!other) throw INTERP_KERNEL::Exception("MEDCouplingMesh::isEqualIfNotWhy : other instance is NULL !"); @@ -106,7 +106,7 @@ bool MEDCouplingMesh::isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, * \param [in] prec - precision value used to compare node coordinates. * \return bool - \c true if the two meshes are equal, \c false else. */ -bool MEDCouplingMesh::isEqual(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception) +bool MEDCouplingMesh::isEqual(const MEDCouplingMesh *other, double prec) const { std::string tmp; return isEqualIfNotWhy(other,prec,tmp); @@ -224,7 +224,7 @@ DataArrayInt *MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds(const int *partB /*! * This method checks fastly that \a this and \a other are equal. All common checks are done here. */ -void MEDCouplingMesh::checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const throw(INTERP_KERNEL::Exception) +void MEDCouplingMesh::checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const { if(!other) throw INTERP_KERNEL::Exception("MEDCouplingMesh::checkFastEquivalWith : input mesh is null !"); @@ -259,7 +259,7 @@ bool MEDCouplingMesh::areCompatibleForMerge(const MEDCouplingMesh *other) const * * \sa MEDCouplingMesh::buildPart */ -MEDCouplingMesh *MEDCouplingMesh::buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const throw(INTERP_KERNEL::Exception) +MEDCouplingMesh *MEDCouplingMesh::buildPartRange(int beginCellIds, int endCellIds, int stepCellIds) const { if(beginCellIds==0 && endCellIds==getNumberOfCells() && stepCellIds==1) { @@ -279,7 +279,7 @@ MEDCouplingMesh *MEDCouplingMesh::buildPartRange(int beginCellIds, int endCellId * * \sa MEDCouplingMesh::buildPartAndReduceNodes */ -MEDCouplingMesh *MEDCouplingMesh::buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt*& arr) const throw(INTERP_KERNEL::Exception) +MEDCouplingMesh *MEDCouplingMesh::buildPartRangeAndReduceNodes(int beginCellIds, int endCellIds, int stepCellIds, int& beginOut, int& endOut, int& stepOut, DataArrayInt*& arr) const { MEDCouplingAutoRefCountObjectPtr cellIds=DataArrayInt::Range(beginCellIds,endCellIds,stepCellIds); return buildPartAndReduceNodes(cellIds->begin(),cellIds->end(),arr); @@ -314,7 +314,7 @@ MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic(TypeOfField t, int nbO * This method copyies all tiny strings from other (name and components name). * @throw if other and this have not same mesh type. */ -void MEDCouplingMesh::copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception) +void MEDCouplingMesh::copyTinyStringsFrom(const MEDCouplingMesh *other) { if(!other) throw INTERP_KERNEL::Exception("MEDCouplingMesh::copyTinyStringsFrom : input mesh is null !"); @@ -327,7 +327,7 @@ void MEDCouplingMesh::copyTinyStringsFrom(const MEDCouplingMesh *other) throw(IN * This method copies all attributes that are \b NOT arrays in this. * All tiny attributes not usefully for state of \a this are ignored. */ -void MEDCouplingMesh::copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception) +void MEDCouplingMesh::copyTinyInfoFrom(const MEDCouplingMesh *other) { copyTinyStringsFrom(other); _time=other->_time; @@ -374,7 +374,7 @@ void MEDCouplingMesh::copyTinyInfoFrom(const MEDCouplingMesh *other) throw(INTER * \ref cpp_mcmesh_fillFromAnalytic "Here is a C++ example".
* \ref py_mcmesh_fillFromAnalytic "Here is a Python example". */ -MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const +MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const { MEDCouplingAutoRefCountObjectPtr ret=MEDCouplingFieldDouble::New(t,ONE_TIME); ret->setMesh(this); @@ -389,7 +389,7 @@ MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic(TypeOfField t, int nbO * function to coordinates of field location points (defined by the given field type). * For example, if \a t == ParaMEDMEM::ON_CELLS, the function is applied to cell * barycenters. This method differs from - * \ref MEDCouplingMesh::fillFromAnalytic(TypeOfField t, int nbOfComp, const char *func) const "fillFromAnalytic()" + * \ref MEDCouplingMesh::fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const "fillFromAnalytic()" * by the way how variable * names, used in the function, are associated with components of coordinates of field * location points; here, a variable name corresponding to a component is retrieved from @@ -424,7 +424,7 @@ MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic(TypeOfField t, int nbO * \ref cpp_mcmesh_fillFromAnalytic2 "Here is a C++ example".
* \ref py_mcmesh_fillFromAnalytic2 "Here is a Python example". */ -MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic2(TypeOfField t, int nbOfComp, const char *func) const +MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic2(TypeOfField t, int nbOfComp, const std::string& func) const { MEDCouplingAutoRefCountObjectPtr ret=MEDCouplingFieldDouble::New(t,ONE_TIME); ret->setMesh(this); @@ -475,7 +475,7 @@ MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic2(TypeOfField t, int nb * \ref cpp_mcmesh_fillFromAnalytic3 "Here is a C++ example".
* \ref py_mcmesh_fillFromAnalytic3 "Here is a Python example". */ -MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector& varsOrder, const char *func) const +MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic3(TypeOfField t, int nbOfComp, const std::vector& varsOrder, const std::string& func) const { MEDCouplingAutoRefCountObjectPtr ret=MEDCouplingFieldDouble::New(t,ONE_TIME); ret->setMesh(this); @@ -497,7 +497,7 @@ MEDCouplingFieldDouble *MEDCouplingMesh::fillFromAnalytic3(TypeOfField t, int nb * is no more needed. * \throw If the meshes are of different mesh type. */ -MEDCouplingMesh *MEDCouplingMesh::MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw(INTERP_KERNEL::Exception) +MEDCouplingMesh *MEDCouplingMesh::MergeMeshes(const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) { if(!mesh1) throw INTERP_KERNEL::Exception("MEDCouplingMesh::MergeMeshes : first parameter is an empty mesh !"); @@ -524,7 +524,7 @@ MEDCouplingMesh *MEDCouplingMesh::MergeMeshes(const MEDCouplingMesh *mesh1, cons * \throw If \a meshes[ *i* ]->getMeshDimension() < 0. * \throw If the \a meshes are of different dimension (getMeshDimension()). */ -MEDCouplingMesh *MEDCouplingMesh::MergeMeshes(std::vector& meshes) throw(INTERP_KERNEL::Exception) +MEDCouplingMesh *MEDCouplingMesh::MergeMeshes(std::vector& meshes) { std::vector< MEDCouplingAutoRefCountObjectPtr > ms1(meshes.size()); std::vector< const MEDCouplingUMesh * > ms2(meshes.size()); @@ -553,7 +553,7 @@ MEDCouplingMesh *MEDCouplingMesh::MergeMeshes(std::vector byteArr; @@ -691,18 +691,18 @@ void MEDCouplingMesh::writeVTK(const char *fileName, bool isBinary) const throw( writeVTKAdvanced(fileName,cda,pda,byteArr); } -void MEDCouplingMesh::writeVTKAdvanced(const char *fileName, const std::string& cda, const std::string& pda, DataArrayByte *byteData) const throw(INTERP_KERNEL::Exception) +void MEDCouplingMesh::writeVTKAdvanced(const std::string& fileName, const std::string& cda, const std::string& pda, DataArrayByte *byteData) const { - std::ofstream ofs(fileName); + std::ofstream ofs(fileName.c_str()); ofs << "\n"; writeVTKLL(ofs,cda,pda,byteData); if(byteData) { ofs << "\n_1234"; ofs << std::flush; ofs.close(); - std::ofstream ofs2(fileName,std::ios_base::binary | std::ios_base::app); + std::ofstream ofs2(fileName.c_str(),std::ios_base::binary | std::ios_base::app); ofs2.write(byteData->begin(),byteData->getNbOfElems()); ofs2 << std::flush; ofs2.close(); - std::ofstream ofs3(fileName,std::ios_base::app); ofs3 << "\n\n\n"; ofs3.close(); + std::ofstream ofs3(fileName.c_str(),std::ios_base::app); ofs3 << "\n\n\n"; ofs3.close(); } else {