X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingFieldOverTime.cxx;h=a7ae939400f66d15921cf40a21d41b42233c2b7a;hb=0ba3453939dda0697b09ed7e728a01d4f33e3ce2;hp=eed9db85b54872ce5ae1db1a358c63b98a57681c;hpb=10f37bf6f33a762626d7f1093b2f5450c1688667;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingFieldOverTime.cxx b/src/MEDCoupling/MEDCouplingFieldOverTime.cxx index eed9db85b..a7ae93940 100644 --- a/src/MEDCoupling/MEDCouplingFieldOverTime.cxx +++ b/src/MEDCoupling/MEDCouplingFieldOverTime.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D +// Copyright (C) 2007-2023 CEA, EDF // // 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 @@ -16,22 +16,23 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Author : Anthony Geay (CEA/DEN) #include "MEDCouplingFieldOverTime.hxx" #include "MEDCouplingMesh.hxx" #include -using namespace ParaMEDMEM; +using namespace MEDCoupling; -MEDCouplingFieldOverTime *MEDCouplingFieldOverTime::New(const std::vector& fs) throw(INTERP_KERNEL::Exception) +MEDCouplingFieldOverTime *MEDCouplingFieldOverTime::New(const std::vector& fs) { return new MEDCouplingFieldOverTime(fs); } -double MEDCouplingFieldOverTime::getTimeTolerance() const throw(INTERP_KERNEL::Exception) +double MEDCouplingFieldOverTime::getTimeTolerance() const { - std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_fs.begin(); + std::vector< MCAuto >::const_iterator it=_fs.begin(); if(_fs.empty()) throw INTERP_KERNEL::Exception("MEDCouplingFieldOverTime::getTimeTolerance : empty set !"); for(;it!=_fs.end();it++) @@ -40,14 +41,14 @@ double MEDCouplingFieldOverTime::getTimeTolerance() const throw(INTERP_KERNEL::E throw INTERP_KERNEL::Exception("MEDCouplingFieldOverTime::getTimeTolerance : only empty fields in this !"); } -void MEDCouplingFieldOverTime::checkCoherency() const throw(INTERP_KERNEL::Exception) +void MEDCouplingFieldOverTime::checkConsistencyLight() const { - MEDCouplingMultiFields::checkCoherency(); - std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_fs.begin(); + MEDCouplingMultiFields::checkConsistencyLight(); + std::vector< MCAuto >::const_iterator it=_fs.begin(); for(;it!=_fs.end();it++) if((*it)->getTimeDiscretization()==NO_TIME) { - std::ostringstream oss; oss << "MEDCouplingFieldOverTime::checkCoherency : At rank #" << std::distance(_fs.begin(),it) << " the field has no time !"; + std::ostringstream oss; oss << "MEDCouplingFieldOverTime::checkConsistencyLight : At rank #" << std::distance(_fs.begin(),it) << " the field has no time !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); } if(_fs.empty()) @@ -67,7 +68,7 @@ void MEDCouplingFieldOverTime::checkCoherency() const throw(INTERP_KERNEL::Excep } double curt=(*it)->getStartTime(tt1,tt2); if(curtgetEndTime(tt1,tt2); } } @@ -82,19 +83,19 @@ std::string MEDCouplingFieldOverTime::simpleRepr() const std::vector ms; std::vector refms; try - { + { ms=getDifferentMeshes(refms); ret << ms.size() << "\n"; - } - catch(INTERP_KERNEL::Exception& e) - { ret << "Current instance is INVALID !\n"; } + } + catch(INTERP_KERNEL::Exception& /*e*/) + { ret << "Current instance is INVALID !\n"; } try - { + { MEDCouplingDefinitionTime dt=getDefinitionTimeZone(); dt.appendRepr(ret); - } - catch(INTERP_KERNEL::Exception& e) - { ret << "Definition zone is INVALID !\n"; } + } + catch(INTERP_KERNEL::Exception& /*e*/) + { ret << "Definition zone is INVALID !\n"; } return ret.str(); } @@ -120,27 +121,27 @@ bool MEDCouplingFieldOverTime::isEqualWithoutConsideringStr(const MEDCouplingMul return true; } -std::vector MEDCouplingFieldOverTime::getMeshes() const throw(INTERP_KERNEL::Exception) +std::vector MEDCouplingFieldOverTime::getMeshes() const { - checkCoherency(); + checkConsistencyLight(); return MEDCouplingMultiFields::getMeshes(); } -std::vector MEDCouplingFieldOverTime::getDifferentMeshes(std::vector& refs) const throw(INTERP_KERNEL::Exception) +std::vector MEDCouplingFieldOverTime::getDifferentMeshes(std::vector& refs) const { - checkCoherency(); + checkConsistencyLight(); return MEDCouplingMultiFields::getDifferentMeshes(refs); } -std::vector MEDCouplingFieldOverTime::getArrays() const throw(INTERP_KERNEL::Exception) +std::vector MEDCouplingFieldOverTime::getArrays() const { - checkCoherency(); + checkConsistencyLight(); return MEDCouplingMultiFields::getArrays(); } -std::vector MEDCouplingFieldOverTime::getDifferentArrays(std::vector< std::vector >& refs) const throw(INTERP_KERNEL::Exception) +std::vector MEDCouplingFieldOverTime::getDifferentArrays(std::vector< std::vector >& refs) const { - checkCoherency(); + checkConsistencyLight(); return MEDCouplingMultiFields::getDifferentArrays(refs); } @@ -154,9 +155,9 @@ MEDCouplingDefinitionTime MEDCouplingFieldOverTime::getDefinitionTimeZone() cons return MEDCouplingDefinitionTime(tmp2,tmp3,tmp); } -MEDCouplingFieldOverTime::MEDCouplingFieldOverTime(const std::vector& fs) throw(INTERP_KERNEL::Exception):MEDCouplingMultiFields(fs) +MEDCouplingFieldOverTime::MEDCouplingFieldOverTime(const std::vector& fs):MEDCouplingMultiFields(fs) { - checkCoherency(); + checkConsistencyLight(); } MEDCouplingFieldOverTime::MEDCouplingFieldOverTime()