Salome HOME
Merge from V6_main 28/02/2013
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingField.cxx
index 805b4a7c595cadaf29bb122ea82bf394f2829c4a..7a11d759def74c3c7a530d7ad37a5a0c42e8656b 100644 (file)
@@ -127,6 +127,18 @@ void MEDCouplingField::updateTime() const
     updateTimeWith(*_type);
 }
 
+std::size_t MEDCouplingField::getHeapMemorySize() const
+{
+  std::size_t ret=0;
+  ret+=_name.capacity();
+  ret+=_desc.capacity();
+  if(_mesh)
+    ret+=_mesh->getHeapMemorySize();
+  if((const MEDCouplingFieldDiscretization *)_type)
+    ret+=_type->getHeapMemorySize();
+  return ret;
+}
+
 TypeOfField MEDCouplingField::getTypeOfField() const
 {
   return _type->getEnum();
@@ -383,3 +395,15 @@ int MEDCouplingField::getNumberOfMeshPlacesExpected() const throw(INTERP_KERNEL:
   else
     throw INTERP_KERNEL::Exception("MEDCouplingField::getNumberOfMeshPlacesExpected : Empty mesh !");
 }
+
+/*!
+ * Copy tiny info (component names, name, description) but warning the underlying mesh is not renamed (for safety reason).
+ */
+void MEDCouplingField::copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception)
+{
+  if(other)
+    {
+      setName(other->_name.c_str());
+      setDescription(other->_desc.c_str());    
+    }
+}