Salome HOME
4th dimension of DataArrayDouble::findCommonTuples
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingField.cxx
index 2931cac0a67037e3e9c2908c5e73a03ab0d42fa1..3f50f4c57471fce86ec20de44f749434dd9182fd 100644 (file)
@@ -174,10 +174,13 @@ std::vector<const BigMemoryObject *> MEDCouplingField::getDirectChildren() const
 /*!
  * Returns a type of \ref MEDCouplingSpatialDisc "spatial discretization" of \a this
  * field in terms of enum ParaMEDMEM::TypeOfField. 
- *  \return ParaMEDMEM::TypeOfField - the type of \a this field.
+ * \return ParaMEDMEM::TypeOfField - the type of \a this field.
+ * \throw If the geometric type is empty.
  */
 TypeOfField MEDCouplingField::getTypeOfField() const
 {
+  if(!((const MEDCouplingFieldDiscretization *)_type))
+    throw INTERP_KERNEL::Exception("MEDCouplingField::getTypeOfField : spatial discretization is null !");
   return _type->getEnum();
 }
 
@@ -614,5 +617,5 @@ int MEDCouplingField::getNumberOfTuplesExpectedRegardingCode(const std::vector<i
   const MEDCouplingFieldDiscretization *t(_type);
   if(!t)
     throw INTERP_KERNEL::Exception("MEDCouplingField::getNumberOfTuplesExpectedRegardingCode : no spatial discretization set !");
-  return t->getNumberOfTuplesExpectedRegardingCode(_mesh,code,idsPerType);
+  return t->getNumberOfTuplesExpectedRegardingCode(code,idsPerType);
 }