return ret;
}
+/*!
+ * Returns names of groups that partly or fully appear on the level \a meshDimRelToMaxExt.
+ * \param [in] meshDimRelToMaxExt - a relative dimension of interest.
+ * \return std::vector<std::string> - a sequence of group names at \a meshDimRelToMaxExt
+ * level.
+ */
+std::vector<std::string> MEDFileMesh::getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const
+{
+ std::vector<std::string> ret;
+ std::vector<std::string> allGrps(getGroupsNames());
+ for(std::vector<std::string>::const_iterator it=allGrps.begin();it!=allGrps.end();it++)
+ {
+ std::vector<int> levs(getGrpNonEmptyLevelsExt((*it)));
+ if(std::find(levs.begin(),levs.end(),meshDimRelToMaxExt)!=levs.end())
+ ret.push_back(*it);
+ }
+ return ret;
+}
+
+/*!
+ * Returns all relative mesh levels (including nodes) where a given group is defined.
+ * \param [in] grp - the name of the group of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
+std::vector<int> MEDFileMesh::getGrpNonEmptyLevelsExt(const std::string& grp) const
+{
+ std::vector<std::string> fams(getFamiliesOnGroup(grp));
+ return getFamsNonEmptyLevelsExt(fams);
+}
+
+/*!
+ * Returns all relative mesh levels (**excluding nodes**) where given groups are defined.
+ * To include nodes, call getGrpsNonEmptyLevelsExt() method.
+ * \param [in] grps - a sequence of names of the groups of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
+std::vector<int> MEDFileMesh::getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const
+{
+ std::vector<std::string> fams(getFamiliesOnGroups(grps));
+ return getFamsNonEmptyLevels(fams);
+}
+
+/*!
+ * Returns all relative mesh levels (including nodes) where given groups are defined.
+ * \param [in] grps - a sequence of names of the groups of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
+std::vector<int> MEDFileMesh::getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const
+{
+ std::vector<std::string> fams(getFamiliesOnGroups(grps));
+ return getFamsNonEmptyLevelsExt(fams);
+}
+
+/*!
+ * Returns all relative mesh levels (**excluding nodes**) where a given group is defined.
+ * To include nodes, call getGrpNonEmptyLevelsExt() method.
+ * \param [in] grp - the name of the group of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
+std::vector<int> MEDFileMesh::getGrpNonEmptyLevels(const std::string& grp) const
+{
+ std::vector<std::string> fams(getFamiliesOnGroup(grp));
+ return getFamsNonEmptyLevels(fams);
+}
+
+/*!
+ * Returns all relative mesh levels (**excluding nodes**) where a given family is defined.
+ * To include nodes, call getFamNonEmptyLevelsExt() method.
+ * \param [in] fam - the name of the family of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
+std::vector<int> MEDFileMesh::getFamNonEmptyLevels(const std::string& fam) const
+{
+ std::vector<std::string> fams(1,std::string(fam));
+ return getFamsNonEmptyLevels(fams);
+}
+
+/*!
+ * Returns all relative mesh levels (including nodes) where a given family is defined.
+ * \param [in] fam - the name of the family of interest.
+ * \return std::vector<int> - a sequence of the relative dimensions.
+ */
+std::vector<int> MEDFileMesh::getFamNonEmptyLevelsExt(const std::string& fam) const
+{
+ std::vector<std::string> fams(1,std::string(fam));
+ return getFamsNonEmptyLevelsExt(fams);
+}
+
std::string MEDFileMesh::GetMagicFamilyStr()
{
return std::string(MEDFileMeshL2::ZE_SEP_FOR_FAMILY_KILLERS);
return ret;
}
-/*!
- * Returns all relative mesh levels (**excluding nodes**) where a given group is defined.
- * To include nodes, call getGrpNonEmptyLevelsExt() method.
- * \param [in] grp - the name of the group of interest.
- * \return std::vector<int> - a sequence of the relative dimensions.
- */
-std::vector<int> MEDFileUMesh::getGrpNonEmptyLevels(const std::string& grp) const
-{
- std::vector<std::string> fams=getFamiliesOnGroup(grp);
- return getFamsNonEmptyLevels(fams);
-}
-
-/*!
- * Returns all relative mesh levels (including nodes) where a given group is defined.
- * \param [in] grp - the name of the group of interest.
- * \return std::vector<int> - a sequence of the relative dimensions.
- */
-std::vector<int> MEDFileUMesh::getGrpNonEmptyLevelsExt(const std::string& grp) const
-{
- std::vector<std::string> fams=getFamiliesOnGroup(grp);
- return getFamsNonEmptyLevelsExt(fams);
-}
-
-/*!
- * Returns all relative mesh levels (**excluding nodes**) where a given family is defined.
- * To include nodes, call getFamNonEmptyLevelsExt() method.
- * \param [in] fam - the name of the family of interest.
- * \return std::vector<int> - a sequence of the relative dimensions.
- */
-std::vector<int> MEDFileUMesh::getFamNonEmptyLevels(const std::string& fam) const
-{
- std::vector<std::string> fams(1,std::string(fam));
- return getFamsNonEmptyLevels(fams);
-}
-
-/*!
- * Returns all relative mesh levels (including nodes) where a given family is defined.
- * \param [in] fam - the name of the family of interest.
- * \return std::vector<int> - a sequence of the relative dimensions.
- */
-std::vector<int> MEDFileUMesh::getFamNonEmptyLevelsExt(const std::string& fam) const
-{
- std::vector<std::string> fams(1,std::string(fam));
- return getFamsNonEmptyLevelsExt(fams);
-}
-
-/*!
- * Returns all relative mesh levels (**excluding nodes**) where given groups are defined.
- * To include nodes, call getGrpsNonEmptyLevelsExt() method.
- * \param [in] grps - a sequence of names of the groups of interest.
- * \return std::vector<int> - a sequence of the relative dimensions.
- */
-std::vector<int> MEDFileUMesh::getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const
-{
- std::vector<std::string> fams=getFamiliesOnGroups(grps);
- return getFamsNonEmptyLevels(fams);
-}
-
-/*!
- * Returns all relative mesh levels (including nodes) where given groups are defined.
- * \param [in] grps - a sequence of names of the groups of interest.
- * \return std::vector<int> - a sequence of the relative dimensions.
- */
-std::vector<int> MEDFileUMesh::getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const
-{
- std::vector<std::string> fams=getFamiliesOnGroups(grps);
- return getFamsNonEmptyLevelsExt(fams);
-}
-
/*!
* Returns all relative mesh levels (**excluding nodes**) where given families are defined.
* To include nodes, call getFamsNonEmptyLevelsExt() method.
std::vector<int> MEDFileUMesh::getFamsNonEmptyLevels(const std::vector<std::string>& fams) const
{
std::vector<int> ret;
- std::vector<int> levs=getNonEmptyLevels();
- std::vector<int> famIds=getFamiliesIds(fams);
+ std::vector<int> levs(getNonEmptyLevels());
+ std::vector<int> famIds(getFamiliesIds(fams));
for(std::vector<int>::const_iterator it=levs.begin();it!=levs.end();it++)
if(_ms[-(*it)]->presenceOfOneFams(famIds))
ret.push_back(*it);
*/
std::vector<int> MEDFileUMesh::getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const
{
- std::vector<int> ret0=getFamsNonEmptyLevels(fams);
- const DataArrayInt *famCoords=_fam_coords;
+ std::vector<int> ret0(getFamsNonEmptyLevels(fams));
+ const DataArrayInt *famCoords(_fam_coords);
if(!famCoords)
return ret0;
- std::vector<int> famIds=getFamiliesIds(fams);
+ std::vector<int> famIds(getFamiliesIds(fams));
if(famCoords->presenceOfValue(famIds))
{
std::vector<int> ret(ret0.size()+1);
return ret0;
}
-/*!
- * Returns names of groups that partly or fully appear on the level \a meshDimRelToMaxExt.
- * \param [in] meshDimRelToMaxExt - a relative dimension of interest.
- * \return std::vector<std::string> - a sequence of group names at \a meshDimRelToMaxExt
- * level.
- */
-std::vector<std::string> MEDFileUMesh::getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const
-{
- std::vector<std::string> ret;
- std::vector<std::string> allGrps=getGroupsNames();
- for(std::vector<std::string>::const_iterator it=allGrps.begin();it!=allGrps.end();it++)
- {
- std::vector<int> levs=getGrpNonEmptyLevelsExt((*it));
- if(std::find(levs.begin(),levs.end(),meshDimRelToMaxExt)!=levs.end())
- ret.push_back(*it);
- }
- return ret;
-}
-
int MEDFileUMesh::getMaxAbsFamilyIdInArrays() const
{
int ret=-std::numeric_limits<int>::max(),tmp=-1;
}
}
+std::vector<int> MEDFileStructuredMesh::getFamsNonEmptyLevels(const std::vector<std::string>& fams) const
+{
+ std::vector<int> ret;
+ const DataArrayInt *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;
+}
+
+std::vector<int> MEDFileStructuredMesh::getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const
+{
+ std::vector<int> ret(getFamsNonEmptyLevels(fams));
+ const DataArrayInt *famNodes(_fam_nodes);
+ if(famNodes && famNodes->presenceOfValue(ret))
+ ret.push_back(1);
+ return ret;
+}
+
/*!
* Returns number of mesh entities of a given relative dimension in \a this mesh.
* \param [in] meshDimRelToMaxExt - the relative dimension of interest.
MEDLOADER_EXPORT void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps);
MEDLOADER_EXPORT std::vector<std::string> getGroupsNames() const;
MEDLOADER_EXPORT std::vector<std::string> getFamiliesNames() const;
+ MEDLOADER_EXPORT std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const;
+ MEDLOADER_EXPORT std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const;
+ MEDLOADER_EXPORT std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const;
+ MEDLOADER_EXPORT std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const;
+ MEDLOADER_EXPORT std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const;
+ MEDLOADER_EXPORT virtual std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const = 0;
+ MEDLOADER_EXPORT virtual std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const = 0;
+ MEDLOADER_EXPORT std::vector<int> getFamNonEmptyLevels(const std::string& fam) const;
+ MEDLOADER_EXPORT std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const;
MEDLOADER_EXPORT std::vector<std::string> getFamiliesNamesWithFilePointOfView() const;
MEDLOADER_EXPORT static std::string GetMagicFamilyStr();
MEDLOADER_EXPORT void assignFamilyNameWithGroupName();
MEDLOADER_EXPORT std::vector<int> getFamArrNonEmptyLevelsExt() const;
MEDLOADER_EXPORT std::vector<int> getNumArrNonEmptyLevelsExt() const;
MEDLOADER_EXPORT std::vector<int> getNameArrNonEmptyLevelsExt() const;
- MEDLOADER_EXPORT std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const;
- MEDLOADER_EXPORT std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const;
- MEDLOADER_EXPORT std::vector<int> getFamNonEmptyLevels(const std::string& fam) const;
- MEDLOADER_EXPORT std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const;
- MEDLOADER_EXPORT std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const;
- MEDLOADER_EXPORT std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const;
MEDLOADER_EXPORT std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const;
MEDLOADER_EXPORT std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const;
- MEDLOADER_EXPORT std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const;
MEDLOADER_EXPORT DataArrayDouble *getCoords() const;
MEDLOADER_EXPORT MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const;
MEDLOADER_EXPORT MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const;
MEDLOADER_EXPORT std::vector<int> getNumArrNonEmptyLevelsExt() const;
MEDLOADER_EXPORT std::vector<int> getNameArrNonEmptyLevelsExt() const;
MEDLOADER_EXPORT MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const;
+ MEDLOADER_EXPORT std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const;
+ MEDLOADER_EXPORT std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const;
MEDLOADER_EXPORT int getSizeAtLevel(int meshDimRelToMaxExt) const;
MEDLOADER_EXPORT int getNumberOfNodes() const;
MEDLOADER_EXPORT int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const;
void setGroupsOnFamily(const std::string& famName, const std::vector<std::string>& grps) throw(INTERP_KERNEL::Exception);
std::vector<std::string> getGroupsNames() const throw(INTERP_KERNEL::Exception);
std::vector<std::string> getFamiliesNames() const throw(INTERP_KERNEL::Exception);
+ std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
+ std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
+ std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
+ std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
+ std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
+ std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
+ std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
+ std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
+ std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
std::vector<std::string> getFamiliesNamesWithFilePointOfView() const throw(INTERP_KERNEL::Exception);
static std::string GetMagicFamilyStr();
void assignFamilyNameWithGroupName() throw(INTERP_KERNEL::Exception);
int getSpaceDimension() const throw(INTERP_KERNEL::Exception);
int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
//
- std::vector<int> getGrpNonEmptyLevels(const std::string& grp) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getGrpNonEmptyLevelsExt(const std::string& grp) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getFamNonEmptyLevels(const std::string& fam) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getFamNonEmptyLevelsExt(const std::string& fam) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getGrpsNonEmptyLevels(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getGrpsNonEmptyLevelsExt(const std::vector<std::string>& grps) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getFamsNonEmptyLevels(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
- std::vector<int> getFamsNonEmptyLevelsExt(const std::vector<std::string>& fams) const throw(INTERP_KERNEL::Exception);
- std::vector<std::string> getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception);
MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const throw(INTERP_KERNEL::Exception);
MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector<std::string>& grps, bool renum=false) const throw(INTERP_KERNEL::Exception);
MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception);