X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FMEDFileFieldOverView.cxx;h=105508eb1ea93fcedea87a968d5ef6ff8e0850be;hb=c483b6a8c2165f64d507dbab661c933a605097e9;hp=bd1ac3fa1f5d5a5943d55b8146c8c81bdc66294d;hpb=dc38876322e171a65c4807afcb9597f4c6dfdbb6;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/MEDFileFieldOverView.cxx b/src/MEDLoader/MEDFileFieldOverView.cxx index bd1ac3fa1..105508eb1 100644 --- a/src/MEDLoader/MEDFileFieldOverView.cxx +++ b/src/MEDLoader/MEDFileFieldOverView.cxx @@ -22,6 +22,7 @@ #include "MEDFileField.hxx" #include "MEDFileMesh.hxx" +#include "MEDCouplingFieldDiscretization.hxx" #include "CellModel.hxx" using namespace ParaMEDMEM; @@ -1664,7 +1665,7 @@ void MEDFileField1TSStructItem2::checkInRange(int nbOfEntity, int nip, const MED if(_pfl->getName().empty()) { if(nbOfEntity!=(_start_end.second-_start_end.first)/nip) - throw INTERP_KERNEL::Exception("MEDFileField1TSStructItem2::checkInRange : Mismatch between number of entities and size of node field !"); + throw INTERP_KERNEL::Exception("MEDFileField1TSStructItem2::checkInRange : Mismatch between number of entities and size of field !"); return ; } else @@ -1756,7 +1757,7 @@ MEDFileField1TSStructItem2 MEDFileField1TSStructItem2::BuildAggregationOf(const } else { - arr->setName(arrs[0]->getName()); + arr->setName(NEWLY_CREATED_PFL_NAME); std::pair p(0,oldNbTuples); std::string a,b; MEDFileField1TSStructItem2 ret(gt,p,a,b); @@ -2037,7 +2038,6 @@ std::vector MEDFileField1TSStructItem::getGeo MEDFileField1TSStructItem MEDFileField1TSStructItem::BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt) { - TypeOfField atype; std::vector< MEDFileField1TSStructItem2 > anItems; // std::vector< std::vector > pfls,locs; @@ -2047,17 +2047,15 @@ MEDFileField1TSStructItem MEDFileField1TSStructItem::BuildItemFrom(const MEDFile std::size_t nbOfGeoTypes(geoTypes.size()); if(nbOfGeoTypes==0) throw INTERP_KERNEL::Exception("MEDFileField1TSStruct : not null by empty ref !"); - bool isFirst=true; + if(typesF[0].empty()) + throw INTERP_KERNEL::Exception("MEDFileField1TSStruct : internal error #1 bis !"); + TypeOfField atype(typesF[0][0]); for(std::size_t i=0;i elt=ref->getTimeStepAtPos(i); - _f1ts_cmps[i]=MEDFileField1TSStruct::New(elt,_mesh_comp); - _f1ts_cmps[i]->checkWithMeshStruct(_mesh_comp,elt); + try + { + _f1ts_cmps[i]=MEDFileField1TSStruct::New(elt,_mesh_comp); + _f1ts_cmps[i]->checkWithMeshStruct(_mesh_comp,elt); + } + catch(INTERP_KERNEL::Exception& e) + { + std::ostringstream oss; oss << "Problem in field with name \"" << ref->getName() << "\"" << std::endl; + oss << "More Details : " << e.what(); + throw INTERP_KERNEL::Exception(oss.str().c_str()); + } } }