-// 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
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+// Author : Anthony Geay (CEA/DEN)
#include "MEDCouplingMultiFields.hxx"
#include "MEDCouplingFieldTemplate.hxx"
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();
}
updateTimeWith(*(*it));
}
+std::size_t MEDCouplingMultiFields::getHeapMemorySize() const
+{
+ std::vector<int> tmp;
+ std::vector< std::vector<int> > tmp2;
+ std::vector<MEDCouplingMesh *> ms=getDifferentMeshes(tmp);
+ std::vector<DataArrayDouble *> arrs=getDifferentArrays(tmp2);
+ std::size_t ret=0;
+ for(std::vector<MEDCouplingMesh *>::const_iterator it=ms.begin();it!=ms.end();it++)
+ if(*it)
+ ret+=(*it)->getHeapMemorySize();
+ for(std::vector<DataArrayDouble *>::const_iterator it=arrs.begin();it!=arrs.end();it++)
+ if(*it)
+ ret+=(*it)->getHeapMemorySize();
+ return ret;
+}
+
std::vector<MEDCouplingMesh *> MEDCouplingMultiFields::getMeshes() const throw(INTERP_KERNEL::Exception)
{
std::vector<MEDCouplingMesh *> ms;
{
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++)