X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FMEDCoupling%2FMEDCouplingField.cxx;h=1c9ca16a391915284d051778106786f006afed11;hb=5dcdc2b6a915a809dd2d7831e4b2e85ae286328a;hp=2931cac0a67037e3e9c2908c5e73a03ab0d42fa1;hpb=a23c622fadddf57290253debb129d9008226cdb9;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingField.cxx b/src/MEDCoupling/MEDCouplingField.cxx index 2931cac0a..1c9ca16a3 100644 --- a/src/MEDCoupling/MEDCouplingField.cxx +++ b/src/MEDCoupling/MEDCouplingField.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D +// Copyright (C) 2007-2014 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -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(); } @@ -297,7 +300,7 @@ void MEDCouplingField::setMesh(const MEDCouplingMesh *mesh) * \throw If size of any vector do not match the \a type. */ void MEDCouplingField::setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellType type, const std::vector& refCoo, - const std::vector& gsCoo, const std::vector& wg) throw(INTERP_KERNEL::Exception) + const std::vector& gsCoo, const std::vector& wg) { if(!_mesh) throw INTERP_KERNEL::Exception("Mesh has to be set before calling setGaussLocalizationOnType method !"); @@ -323,7 +326,7 @@ void MEDCouplingField::setGaussLocalizationOnType(INTERP_KERNEL::NormalizedCellT * \throw If the range [_begin_,_end_) is empty. */ void MEDCouplingField::setGaussLocalizationOnCells(const int *begin, const int *end, const std::vector& refCoo, - const std::vector& gsCoo, const std::vector& wg) throw(INTERP_KERNEL::Exception) + const std::vector& gsCoo, const std::vector& wg) { if(!_mesh) throw INTERP_KERNEL::Exception("Mesh has to be set before calling setGaussLocalizationOnCells method !"); @@ -471,7 +474,7 @@ MEDCouplingField::MEDCouplingField(TypeOfField type):_nature(NoNature),_mesh(0), } MEDCouplingField::MEDCouplingField(const MEDCouplingField& other, bool deepCopy):RefCountObject(other),_name(other._name),_desc(other._desc),_nature(other._nature), - _mesh(0),_type(0) + _mesh(0),_type(0) { if(other._mesh) { @@ -538,7 +541,7 @@ DataArrayInt *MEDCouplingField::computeTupleIdsToSelectFromCellIds(const int *st /*! * Returns number of tuples expected regarding the spatial discretization of \a this - * field and number of entities in the underlying mesh. + * field and number of entities in the underlying mesh. This method behaves exactly as MEDCouplingFieldDouble::getNumberOfTuples. * \return int - the number of expected tuples. * \throw If the spatial discretization of \a this field is NULL. * \throw If the mesh is not set. @@ -587,8 +590,8 @@ void MEDCouplingField::copyTinyStringsFrom(const MEDCouplingField *other) { if(other) { - setName(other->_name.c_str()); - setDescription(other->_desc.c_str()); + setName(other->_name); + setDescription(other->_desc); } } @@ -614,5 +617,5 @@ int MEDCouplingField::getNumberOfTuplesExpectedRegardingCode(const std::vectorgetNumberOfTuplesExpectedRegardingCode(_mesh,code,idsPerType); + return t->getNumberOfTuplesExpectedRegardingCode(code,idsPerType); }