X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingMultiFields.cxx;h=5980367e153646caaf8bc967e7adc99470af74c5;hb=6019ca890efd49236c32aeafbcb9e193878d5be8;hp=94856e43d37ae78583cc142d0242f9f9d0545fb0;hpb=aeb48974ed761c5e30d44a83149330153dc13d85;p=modules%2Fmed.git diff --git a/src/MEDCoupling/MEDCouplingMultiFields.cxx b/src/MEDCoupling/MEDCouplingMultiFields.cxx index 94856e43d..5980367e1 100644 --- a/src/MEDCoupling/MEDCouplingMultiFields.cxx +++ b/src/MEDCoupling/MEDCouplingMultiFields.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D +// Copyright (C) 2007-2013 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 @@ -29,7 +29,7 @@ using namespace ParaMEDMEM; -MEDCouplingMultiFields *MEDCouplingMultiFields::New(const std::vector& fs) throw(INTERP_KERNEL::Exception) +MEDCouplingMultiFields *MEDCouplingMultiFields::New(const std::vector& fs) { return new MEDCouplingMultiFields(fs); } @@ -105,7 +105,7 @@ std::string MEDCouplingMultiFields::getTimeUnit() const return std::string(); } -double MEDCouplingMultiFields::getTimeResolution() const throw(INTERP_KERNEL::Exception) +double MEDCouplingMultiFields::getTimeResolution() const { std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_fs.begin(); for(;it!=_fs.end();it++) @@ -128,7 +128,7 @@ std::string MEDCouplingMultiFields::simpleRepr() const ms=getDifferentMeshes(refms); ret << ms.size() << "\n"; } - catch(INTERP_KERNEL::Exception& e) + catch(INTERP_KERNEL::Exception& /*e*/) { ret << "Current instance is INVALID !\n"; } return ret.str(); } @@ -149,7 +149,7 @@ bool MEDCouplingMultiFields::isEqualWithoutConsideringStr(const MEDCouplingMulti return true; } -const MEDCouplingFieldDouble *MEDCouplingMultiFields::getFieldWithId(int id) const throw(INTERP_KERNEL::Exception) +const MEDCouplingFieldDouble *MEDCouplingMultiFields::getFieldWithId(int id) const { if(id>=(int)_fs.size() || id < 0) throw INTERP_KERNEL::Exception("MEDCouplingMultiFields::getFieldWithId : invalid id outside boundaries !"); @@ -168,7 +168,7 @@ int MEDCouplingMultiFields::getNumberOfFields() const return (int)_fs.size(); } -const MEDCouplingFieldDouble *MEDCouplingMultiFields::getFieldAtPos(int id) const throw(INTERP_KERNEL::Exception) +const MEDCouplingFieldDouble *MEDCouplingMultiFields::getFieldAtPos(int id) const { if(id<0 || id>=(int)_fs.size()) { @@ -190,7 +190,24 @@ void MEDCouplingMultiFields::updateTime() const updateTimeWith(*(*it)); } -std::vector MEDCouplingMultiFields::getMeshes() const throw(INTERP_KERNEL::Exception) +std::size_t MEDCouplingMultiFields::getHeapMemorySizeWithoutChildren() const +{ + return 0; +} + +std::vector MEDCouplingMultiFields::getDirectChildren() const +{ + std::vector ret; + for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_fs.begin();it!=_fs.end();it++) + { + const MEDCouplingFieldDouble *curF(*it); + if(curF) + ret.push_back(curF); + } + return ret; +} + +std::vector MEDCouplingMultiFields::getMeshes() const { std::vector ms; for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_fs.begin();it!=_fs.end();it++) @@ -203,7 +220,7 @@ std::vector MEDCouplingMultiFields::getMeshes() const throw(I return ms; } -std::vector MEDCouplingMultiFields::getDifferentMeshes(std::vector& refs) const throw(INTERP_KERNEL::Exception) +std::vector MEDCouplingMultiFields::getDifferentMeshes(std::vector& refs) const { refs.resize(_fs.size()); std::vector ms; @@ -230,7 +247,7 @@ std::vector MEDCouplingMultiFields::getDifferentMeshes(std::v return ms; } -std::vector MEDCouplingMultiFields::getArrays() const throw(INTERP_KERNEL::Exception) +std::vector MEDCouplingMultiFields::getArrays() const { std::vector tmp; for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_fs.begin();it!=_fs.end();it++) @@ -241,7 +258,7 @@ std::vector MEDCouplingMultiFields::getArrays() const throw(I return tmp; } -std::vector MEDCouplingMultiFields::getDifferentArrays(std::vector< std::vector >& refs) const throw(INTERP_KERNEL::Exception) +std::vector MEDCouplingMultiFields::getDifferentArrays(std::vector< std::vector >& refs) const { refs.resize(_fs.size()); int id=0; @@ -277,7 +294,7 @@ std::vector MEDCouplingMultiFields::getDifferentArrays(std::v return ret; } -void MEDCouplingMultiFields::checkCoherency() const throw(INTERP_KERNEL::Exception) +void MEDCouplingMultiFields::checkCoherency() const { std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_fs.begin(); for(;it!=_fs.end();it++) @@ -288,7 +305,7 @@ void MEDCouplingMultiFields::checkCoherency() const throw(INTERP_KERNEL::Excepti } } -MEDCouplingMultiFields::MEDCouplingMultiFields(const std::vector& fs) throw(INTERP_KERNEL::Exception):_fs(fs.size()) +MEDCouplingMultiFields::MEDCouplingMultiFields(const std::vector& fs):_fs(fs.size()) { int id=0; for(std::vector< MEDCouplingFieldDouble * >::const_iterator it=fs.begin();it!=fs.end();it++,id++) @@ -306,7 +323,7 @@ MEDCouplingMultiFields::MEDCouplingMultiFields(const std::vectorgetTimeDiscretization()); + MEDCouplingFieldTemplate *tmp=MEDCouplingFieldTemplate::New(*other._fs[i]); + _fs[i]=MEDCouplingFieldDouble::New(*tmp,other._fs[i]->getTimeDiscretization()); tmp->decrRef(); if(refs[i]!=-1) _fs[i]->setMesh(ms2[refs[i]]); @@ -421,7 +438,7 @@ void MEDCouplingMultiFields::finishUnserialization(const std::vector& tinyI int offD=0; for(int i=0;i tmp(sz3); for(int j=0;j