-// Copyright (C) 2007-2012 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
using namespace ParaMEDMEM;
-MEDCouplingMultiFields *MEDCouplingMultiFields::New(const std::vector<MEDCouplingFieldDouble *>& fs) throw(INTERP_KERNEL::Exception)
+MEDCouplingMultiFields *MEDCouplingMultiFields::New(const std::vector<MEDCouplingFieldDouble *>& fs)
{
return new MEDCouplingMultiFields(fs);
}
return std::string();
}
-double MEDCouplingMultiFields::getTimeResolution() const throw(INTERP_KERNEL::Exception)
+double MEDCouplingMultiFields::getTimeResolution() const
{
std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
for(;it!=_fs.end();it++)
std::vector<MEDCouplingMesh *> ms;
std::vector<int> 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"; }
return ret.str();
}
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 !");
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())
{
updateTimeWith(*(*it));
}
-std::vector<MEDCouplingMesh *> MEDCouplingMultiFields::getMeshes() const throw(INTERP_KERNEL::Exception)
+std::size_t MEDCouplingMultiFields::getHeapMemorySizeWithoutChildren() const
+{
+ return 0;
+}
+
+std::vector<const BigMemoryObject *> MEDCouplingMultiFields::getDirectChildren() const
+{
+ std::vector<const BigMemoryObject *> ret;
+ for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();it!=_fs.end();it++)
+ {
+ const MEDCouplingFieldDouble *curF(*it);
+ if(curF)
+ ret.push_back(curF);
+ }
+ return ret;
+}
+
+std::vector<MEDCouplingMesh *> MEDCouplingMultiFields::getMeshes() const
{
std::vector<MEDCouplingMesh *> ms;
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();it!=_fs.end();it++)
return ms;
}
-std::vector<MEDCouplingMesh *> MEDCouplingMultiFields::getDifferentMeshes(std::vector<int>& refs) const throw(INTERP_KERNEL::Exception)
+std::vector<MEDCouplingMesh *> MEDCouplingMultiFields::getDifferentMeshes(std::vector<int>& refs) const
{
refs.resize(_fs.size());
std::vector<MEDCouplingMesh *> ms;
return ms;
}
-std::vector<DataArrayDouble *> MEDCouplingMultiFields::getArrays() const throw(INTERP_KERNEL::Exception)
+std::vector<DataArrayDouble *> MEDCouplingMultiFields::getArrays() const
{
std::vector<DataArrayDouble *> tmp;
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();it!=_fs.end();it++)
return tmp;
}
-std::vector<DataArrayDouble *> MEDCouplingMultiFields::getDifferentArrays(std::vector< std::vector<int> >& refs) const throw(INTERP_KERNEL::Exception)
+std::vector<DataArrayDouble *> MEDCouplingMultiFields::getDifferentArrays(std::vector< std::vector<int> >& refs) const
{
refs.resize(_fs.size());
int id=0;
return ret;
}
-void MEDCouplingMultiFields::checkCoherency() const throw(INTERP_KERNEL::Exception)
+void MEDCouplingMultiFields::checkCoherency() const
{
std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();
for(;it!=_fs.end();it++)
}
}
-MEDCouplingMultiFields::MEDCouplingMultiFields(const std::vector<MEDCouplingFieldDouble *>& fs) throw(INTERP_KERNEL::Exception):_fs(fs.size())
+MEDCouplingMultiFields::MEDCouplingMultiFields(const std::vector<MEDCouplingFieldDouble *>& fs):_fs(fs.size())
{
int id=0;
for(std::vector< MEDCouplingFieldDouble * >::const_iterator it=fs.begin();it!=fs.end();it++,id++)
/*!
* Performs deepCpy.
*/
-MEDCouplingMultiFields::MEDCouplingMultiFields(const MEDCouplingMultiFields& other)
+MEDCouplingMultiFields::MEDCouplingMultiFields(const MEDCouplingMultiFields& other):RefCountObject(other)
{
std::size_t sz=other._fs.size();
_fs.resize(sz);
{
if((const MEDCouplingFieldDouble *)other._fs[i])
{
- MEDCouplingFieldTemplate *tmp=MEDCouplingFieldTemplate::New(other._fs[i]);
- _fs[i]=MEDCouplingFieldDouble::New(tmp,other._fs[i]->getTimeDiscretization());
+ 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]]);
int offD=0;
for(int i=0;i<sz;i++)
{
- _fs[i]=MEDCouplingFieldDouble::New(ft[i],(TypeOfTimeDiscretization)tinyInfoI[2*sz+3+i]);
+ _fs[i]=MEDCouplingFieldDouble::New(*ft[i],(TypeOfTimeDiscretization)tinyInfoI[2*sz+3+i]);
int sz3=tinyInfoI[sz+i+3];
std::vector<DataArrayDouble *> tmp(sz3);
for(int j=0;j<sz3;j++,k++)