}
/*!
- * This method reserve nbOfElems elements in memory ( nbOfElems*8 bytes ) \b without impacting the number of tuples in \a this.
+ * This method reserve nbOfElems elements in memory ( nbOfElems*sizeof(T) ) \b without impacting the number of tuples in \a this.
* If \a this has already been allocated, this method checks that \a this has only one component. If not an INTERP_KERNEL::Exception will be thrown.
* If \a this has not already been allocated, number of components is set to one.
* This method allows to reduce number of reallocations on invocation of DataArrayDouble::pushBackSilent and DataArrayDouble::pushBackValsSilent on \a this.
}
}
+/*!
+ * Returns all relative mesh levels (**excluding nodes**) where given families are defined.
+ * To include nodes, call getFamsNonEmptyLevelsExt() method.
+ * \param [in] fams - the name of the family of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
std::vector<mcIdType> MEDFileStructuredMesh::getFamsNonEmptyLevels(const std::vector<std::string>& fams) const
{
- std::vector<mcIdType> ret;
+ std::vector<mcIdType> lvls;
+ std::vector<mcIdType> famIds(getFamiliesIds(fams));
const DataArrayIdType *famCells(_fam_cells),*famFaces(_fam_faces);
- if(famCells && famCells->presenceOfValue(ret))
- ret.push_back(0);
- if(famFaces && famFaces->presenceOfValue(ret))
- ret.push_back(-1);
- return ret;
+ if(famCells && famCells->presenceOfValue(famIds))
+ lvls.push_back(0);
+ if(famFaces && famFaces->presenceOfValue(famIds))
+ lvls.push_back(-1);
+ return lvls;
}
+/*!
+ * Returns all relative mesh levels (including nodes) where given families are defined.
+ * \param [in] fams - the names of the families of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
std::vector<mcIdType> MEDFileStructuredMesh::getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const
{
- std::vector<mcIdType> ret(getFamsNonEmptyLevels(fams));
+ std::vector<mcIdType> lvls(getFamsNonEmptyLevels(fams));
+ std::vector<mcIdType> famIds(getFamiliesIds(fams));
const DataArrayIdType *famNodes(_fam_nodes);
- if(famNodes && famNodes->presenceOfValue(ret))
- ret.push_back(1);
- return ret;
+ if(famNodes && famNodes->presenceOfValue(famIds))
+ lvls.push_back(1);
+ return lvls;
}
/*!