X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingGaussLocalization.cxx;h=990722c3d702b8b1aab4de6cb98a989b27a2094f;hb=90b7c9c73054965b8085ab0ecd2646a3d59f475a;hp=ebf9cc4a0a44a53167824d4b241fbcafe108f184;hpb=e0c843a1fe827a90af91ada8d2033ffb3a7dd1d8;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingGaussLocalization.cxx b/src/MEDCoupling/MEDCouplingGaussLocalization.cxx index ebf9cc4a0..990722c3d 100644 --- a/src/MEDCoupling/MEDCouplingGaussLocalization.cxx +++ b/src/MEDCoupling/MEDCouplingGaussLocalization.cxx @@ -34,29 +34,18 @@ using namespace MEDCoupling; MEDCouplingGaussLocalization::MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType type, const std::vector& refCoo, const std::vector& gsCoo, const std::vector& w) -try:_type(type),_ref_coord(refCoo),_gauss_coord(gsCoo),_weight(w) +:_type(type),_ref_coord(refCoo),_gauss_coord(gsCoo),_weight(w) { + // Will potentially throw (and then release memory for above objects _ref_coord etc ...) checkConsistencyLight(); } -catch(INTERP_KERNEL::Exception& e) -{ - _type=INTERP_KERNEL::NORM_ERROR; - _ref_coord.clear(); - _gauss_coord.clear(); - _weight.clear(); - throw e; -} MEDCouplingGaussLocalization::MEDCouplingGaussLocalization(INTERP_KERNEL::NormalizedCellType typ) -try:_type(typ) +:_type(typ) { + // Will potentially throw INTERP_KERNEL::CellModel::GetCellModel(_type); } -catch(INTERP_KERNEL::Exception& e) -{ - _type=INTERP_KERNEL::NORM_ERROR; - throw e; -} void MEDCouplingGaussLocalization::setType(INTERP_KERNEL::NormalizedCellType typ) { @@ -224,7 +213,6 @@ MCAuto MEDCouplingGaussLocalization::localizePtsInRefCooForEach double *retPtr(ret->getPointer()); if(dim!=ToIdType(ptsInRefCoo->getNumberOfComponents())) throw INTERP_KERNEL::Exception("MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell : number of components of input coo is not equal to dim of element !"); - const std::vector& wg(getWeights()); INTERP_KERNEL::GaussCoords calculator; calculator.addGaussInfo(typ,dim, ptsInRefCoo->begin(),nbPts,&_ref_coord[0],getNumberOfPtsInRefCell()); //