X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingField.cxx;h=55b6e0b98a0a3d0cce69cd73f53268173194686e;hb=0c9d48870957c4a9f6f82fc8e2c569780a5f886b;hp=f96321bb1adc41ffb88f1e80c8b2494b821c1e74;hpb=89ffd6be1633e2ab70ac3298a8a10a635a3f4df3;p=modules%2Fmed.git diff --git a/src/MEDCoupling/MEDCouplingField.cxx b/src/MEDCoupling/MEDCouplingField.cxx index f96321bb1..55b6e0b98 100644 --- a/src/MEDCoupling/MEDCouplingField.cxx +++ b/src/MEDCoupling/MEDCouplingField.cxx @@ -26,7 +26,7 @@ using namespace ParaMEDMEM; -bool MEDCouplingField::isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec, std::string& reason) const throw(INTERP_KERNEL::Exception) +bool MEDCouplingField::isEqualIfNotWhy(const MEDCouplingField *other, double meshPrec, double valsPrec, std::string& reason) const { if(!other) throw INTERP_KERNEL::Exception("MEDCouplingField::isEqualIfNotWhy : other instance is NULL !"); @@ -174,10 +174,13 @@ std::vector MEDCouplingField::getDirectChildren() const /*! * Returns a type of \ref MEDCouplingSpatialDisc "spatial discretization" of \a this * field in terms of enum ParaMEDMEM::TypeOfField. - * \return ParaMEDMEM::TypeOfField - the type of \a this field. + * \return ParaMEDMEM::TypeOfField - the type of \a this field. + * \throw If the geometric type is empty. */ TypeOfField MEDCouplingField::getTypeOfField() const { + if(!((const MEDCouplingFieldDiscretization *)_type)) + throw INTERP_KERNEL::Exception("MEDCouplingField::getTypeOfField : spatial discretization is null !"); return _type->getEnum(); } @@ -209,7 +212,7 @@ NatureOfField MEDCouplingField::getNature() const * \param [in] nat - the nature of \a this field. * \throw If \a nat has an invalid value. */ -void MEDCouplingField::setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception) +void MEDCouplingField::setNature(NatureOfField nat) { MEDCouplingNatureOfField::GetRepr(nat);//generate a throw if nat not recognized _nature=nat; @@ -227,7 +230,7 @@ void MEDCouplingField::setNature(NatureOfField nat) throw(INTERP_KERNEL::Excepti * \throw If the spatial discretization of \a this field is NULL. * \throw If the mesh is not set. */ -DataArrayDouble *MEDCouplingField::getLocalizationOfDiscr() const throw(INTERP_KERNEL::Exception) +DataArrayDouble *MEDCouplingField::getLocalizationOfDiscr() const { if(!_mesh) throw INTERP_KERNEL::Exception("MEDCouplingField::getLocalizationOfDiscr : No mesh set !"); @@ -253,7 +256,7 @@ DataArrayDouble *MEDCouplingField::getLocalizationOfDiscr() const throw(INTERP_K * \throw If the spatial discretization of \a this field is not well defined. */ -MEDCouplingFieldDouble *MEDCouplingField::buildMeasureField(bool isAbs) const throw(INTERP_KERNEL::Exception) +MEDCouplingFieldDouble *MEDCouplingField::buildMeasureField(bool isAbs) const { if(!_mesh) throw INTERP_KERNEL::Exception("MEDCouplingField::buildMeasureField : no mesh defined !"); @@ -355,7 +358,7 @@ void MEDCouplingField::clearGaussLocalizations() * \throw If \a locId is not within the valid range. * \throw If the spatial discretization of \a this field is NULL. */ -MEDCouplingGaussLocalization& MEDCouplingField::getGaussLocalization(int locId) throw(INTERP_KERNEL::Exception) +MEDCouplingGaussLocalization& MEDCouplingField::getGaussLocalization(int locId) { if(!((const MEDCouplingFieldDiscretization *)_type)) throw INTERP_KERNEL::Exception("Spatial discretization not set ! Impossible to call getGaussLocalization method !"); @@ -371,7 +374,7 @@ MEDCouplingGaussLocalization& MEDCouplingField::getGaussLocalization(int locId) * \throw If no Gauss localization object found for the given cell \a type. * \throw If more than one Gauss localization object found for the given cell \a type. */ -int MEDCouplingField::getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception) +int MEDCouplingField::getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedCellType type) const { if(!((const MEDCouplingFieldDiscretization *)_type)) throw INTERP_KERNEL::Exception("Spatial discretization not set ! Impossible to call getGaussLocalizationIdOfOneType method !"); @@ -385,7 +388,7 @@ int MEDCouplingField::getGaussLocalizationIdOfOneType(INTERP_KERNEL::NormalizedC * \throw If \a this field is not on Gauss points. * \throw If the spatial discretization of \a this field is NULL */ -std::set MEDCouplingField::getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const throw(INTERP_KERNEL::Exception) +std::set MEDCouplingField::getGaussLocalizationIdsOfOneType(INTERP_KERNEL::NormalizedCellType type) const { if(!((const MEDCouplingFieldDiscretization *)_type)) throw INTERP_KERNEL::Exception("Spatial discretization not set ! Impossible to call getGaussLocalizationIdsOfOneType method !"); @@ -399,7 +402,7 @@ std::set MEDCouplingField::getGaussLocalizationIdsOfOneType(INTERP_KERNEL:: * \throw If \a this field is not on Gauss points. * \throw If the spatial discretization of \a this field is NULL. */ -int MEDCouplingField::getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exception) +int MEDCouplingField::getNbOfGaussLocalization() const { if(!((const MEDCouplingFieldDiscretization *)_type)) throw INTERP_KERNEL::Exception("Spatial discretization not set ! Impossible to call getNbOfGaussLocalization method !"); @@ -414,7 +417,7 @@ int MEDCouplingField::getNbOfGaussLocalization() const throw(INTERP_KERNEL::Exce * \throw If the spatial discretization of \a this field is NULL. * \throw If no Gauss localization object found for the given cell. */ -int MEDCouplingField::getGaussLocalizationIdOfOneCell(int cellId) const throw(INTERP_KERNEL::Exception) +int MEDCouplingField::getGaussLocalizationIdOfOneCell(int cellId) const { if(!((const MEDCouplingFieldDiscretization *)_type)) throw INTERP_KERNEL::Exception("Spatial discretization not set ! Impossible to call getGaussLocalizationIdOfOneCell method !"); @@ -431,7 +434,7 @@ int MEDCouplingField::getGaussLocalizationIdOfOneCell(int cellId) const throw(IN * \throw If \a locId is not within the valid range. * \throw If the spatial discretization of \a this field is NULL. */ -void MEDCouplingField::getCellIdsHavingGaussLocalization(int locId, std::vector& cellIds) const throw(INTERP_KERNEL::Exception) +void MEDCouplingField::getCellIdsHavingGaussLocalization(int locId, std::vector& cellIds) const { cellIds.clear(); if(!((const MEDCouplingFieldDiscretization *)_type)) @@ -449,7 +452,7 @@ void MEDCouplingField::getCellIdsHavingGaussLocalization(int locId, std::vector< * \throw If \a locId is not within the valid range. * \throw If the spatial discretization of \a this field is NULL. */ -const MEDCouplingGaussLocalization& MEDCouplingField::getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception) +const MEDCouplingGaussLocalization& MEDCouplingField::getGaussLocalization(int locId) const { if(!((const MEDCouplingFieldDiscretization *)_type)) throw INTERP_KERNEL::Exception("Spatial discretization not set ! Impossible to call getGaussLocalization method !"); @@ -543,7 +546,7 @@ DataArrayInt *MEDCouplingField::computeTupleIdsToSelectFromCellIds(const int *st * \throw If the spatial discretization of \a this field is NULL. * \throw If the mesh is not set. */ -int MEDCouplingField::getNumberOfTuplesExpected() const throw(INTERP_KERNEL::Exception) +int MEDCouplingField::getNumberOfTuplesExpected() const { if(!((const MEDCouplingFieldDiscretization *)_type)) throw INTERP_KERNEL::Exception("Spatial discretization not set ! Impossible to call getNumberOfTuplesExpected method !"); @@ -570,7 +573,7 @@ void MEDCouplingField::setDiscretization(MEDCouplingFieldDiscretization *newDisc * \throw If the spatial discretization of \a this field is NULL. * \throw If the mesh is not set. */ -int MEDCouplingField::getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL::Exception) +int MEDCouplingField::getNumberOfMeshPlacesExpected() const { if(!((const MEDCouplingFieldDiscretization *)_type)) throw INTERP_KERNEL::Exception("Spatial discretization not set ! Impossible to call getNumberOfMeshPlacesExpected method !"); @@ -583,12 +586,12 @@ int MEDCouplingField::getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL: /*! * Copy tiny info (component names, name, description) but warning the underlying mesh is not renamed (for safety reason). */ -void MEDCouplingField::copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception) +void MEDCouplingField::copyTinyStringsFrom(const MEDCouplingField *other) { if(other) { - setName(other->_name.c_str()); - setDescription(other->_desc.c_str()); + setName(other->_name); + setDescription(other->_desc); } } @@ -609,10 +612,10 @@ void MEDCouplingField::copyTinyStringsFrom(const MEDCouplingField *other) throw( * \throw If input code point to invalid zones in spatial discretization. * \throw If spatial discretization in \a this requires a mesh and those mesh is invalid (null,...) */ -int MEDCouplingField::getNumberOfTuplesExpectedRegardingCode(const std::vector& code, const std::vector& idsPerType) const throw(INTERP_KERNEL::Exception) +int MEDCouplingField::getNumberOfTuplesExpectedRegardingCode(const std::vector& code, const std::vector& idsPerType) const { const MEDCouplingFieldDiscretization *t(_type); if(!t) throw INTERP_KERNEL::Exception("MEDCouplingField::getNumberOfTuplesExpectedRegardingCode : no spatial discretization set !"); - return t->getNumberOfTuplesExpectedRegardingCode(_mesh,code,idsPerType); + return t->getNumberOfTuplesExpectedRegardingCode(code,idsPerType); }