- static const char MSG[]="MEDCouplingCMesh::getSpaceDimension : mesh is invalid ! null vectors (X, Y or Z) must be put contiguously at the end !";
- int ret(0);
- bool isOK(true);
- if(_x_array)
- ret++;
- else
- isOK=false;
- if(_y_array)
- {
- if(!isOK)
- throw INTERP_KERNEL::Exception(MSG);
- ret++;
- }
- else
- isOK=false;
- if(_z_array)
- {
- if(!isOK)
- throw INTERP_KERNEL::Exception(MSG);
- ret++;
- }
- return ret;
-}
-
-/*!
- * This method returns the mesh dimension of \a this. It can be different from space dimension in case of a not null dimension contains only one node.
- */
-int MEDCouplingCMesh::getMeshDimension() const
-{
- int ret(getSpaceDimension());
- if(_x_array)
- {
- if(_x_array->isAllocated())
- if(_x_array->getNumberOfTuples()==1)
- ret--;
- }
- if(_y_array)
- {
- if(_y_array->isAllocated())
- if(_y_array->getNumberOfTuples()==1)
- ret--;
- }
- if(_z_array)
- {
- if(_z_array->isAllocated())
- if(_z_array->getNumberOfTuples()==1)
- ret--;
- }
- return ret;