MEDUMeshMultiLev::MEDUMeshMultiLev(const MEDFileUMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities):MEDMeshMultiLev(m->getNumberOfNodes(),gts,pfls,nbEntities)
{
std::size_t sz(gts.size());
+ if(sz<1)
+ throw INTERP_KERNEL::Exception("constructor of MEDUMeshMultiLev : number of different geo type must be >= 1 !");
+ unsigned dim(INTERP_KERNEL::CellModel::GetCellModel(gts[0]).getDimension());
_parts.resize(sz);
+ bool isSameDim(true),isNoPfl(true);
for(std::size_t i=0;i<sz;i++)
{
MEDCoupling1GTUMesh *elt(m->getDirectUndergroundSingleGeoTypeMesh(gts[i]));
+ if(INTERP_KERNEL::CellModel::GetCellModel(gts[i]).getDimension()!=dim)
+ isSameDim=false;
+ if(pfls[i])
+ isNoPfl=false;
if(elt)
elt->incrRef();
_parts[i]=elt;
}
// ids fields management
+ int lev(m->getMeshDimension()-(int)dim);
+ if(isSameDim && isNoPfl && m->getGeoTypesAtLevel(lev)==gts)//optimized part
+ {
+ _cell_fam_ids_nocpy=true;
+ const DataArrayInt *famIds(m->getFamilyFieldAtLevel(lev));
+ if(famIds)
+ { _cell_fam_ids=const_cast<DataArrayInt*>(famIds); famIds->incrRef(); }
+ _cell_num_ids_nocpy=true;
+ const DataArrayInt *numIds(m->getNumberFieldAtLevel(lev));
+ if(numIds)
+ { _cell_num_ids=const_cast<DataArrayInt*>(numIds); numIds->incrRef(); }
+ return ;
+ }
+ //
_cell_fam_ids_nocpy=false;
std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > famIdsSafe(sz);
std::vector<const DataArrayInt *> famIds(sz);
return sp->getDirectUndergroundSingleGeoTypeMesh(gt);
}
+/*!
+ * Given a relative level \a meshDimRelToMax it returns the sorted vector of geometric types present in \a this.
+ * \throw if the reqsuested \a meshDimRelToMax does not exist.
+ */
+std::vector<INTERP_KERNEL::NormalizedCellType> MEDFileUMesh::getGeoTypesAtLevel(int meshDimRelToMax) const
+{
+ const MEDFileUMeshSplitL1 *sp(getMeshAtLevSafe(meshDimRelToMax));
+ return sp->getGeoTypes();
+}
+
/*!
* This method extracts from whole family field ids the part relative to the input parameter \a gt.
* \param [in] gt - the geometric type for which the family field is asked.
MEDLOADER_EXPORT const DataArrayInt *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const;
MEDLOADER_EXPORT const DataArrayAsciiChar *getNameFieldAtLevel(int meshDimRelToMaxExt) const;
MEDLOADER_EXPORT int getNumberOfNodes() const;
+ MEDLOADER_EXPORT std::vector<INTERP_KERNEL::NormalizedCellType> getGeoTypesAtLevel(int meshDimRelToMax) const;
MEDLOADER_EXPORT void whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobsReal *globs, std::vector<bool>& nodesFetched) const;
MEDLOADER_EXPORT std::vector<int> getNonEmptyLevels() const;
MEDLOADER_EXPORT std::vector<int> getNonEmptyLevelsExt() const;
return da.retn();
}
+std::vector<INTERP_KERNEL::NormalizedCellType> MEDFileUMeshSplitL1::getGeoTypes() const
+{
+ return _m_by_types.getGeoTypes();
+}
+
MEDCouplingUMesh *MEDFileUMeshSplitL1::getWholeMesh(bool renum) const
{
MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> tmp;
return _m;
}
+std::vector<INTERP_KERNEL::NormalizedCellType> MEDFileUMeshAggregateCompute::getGeoTypes() const
+{
+ if(_mp_time>=_m_time)
+ {
+ std::size_t sz(_m_parts.size());
+ std::vector<INTERP_KERNEL::NormalizedCellType> ret(sz);
+ for(std::size_t i=0;i<sz;i++)
+ ret[i]=_m_parts[i]->getCellModelEnum();
+ return ret;
+ }
+ else
+ return _m->getAllGeoTypesSorted();
+}
+
std::vector<MEDCoupling1GTUMesh *> MEDFileUMeshAggregateCompute::getPartsWithoutComputation() const
{
if(_mp_time<_m_time)
void assignUMesh(MEDCouplingUMesh *m);
MEDCouplingUMesh *getUmesh() const;
std::vector<MEDCoupling1GTUMesh *> getParts() const;
+ std::vector<INTERP_KERNEL::NormalizedCellType> getGeoTypes() const;
std::vector<MEDCoupling1GTUMesh *> getPartsWithoutComputation() const;
MEDCoupling1GTUMesh *getPartWithoutComputation(INTERP_KERNEL::NormalizedCellType gt) const;
void getStartStopOfGeoTypeWithoutComputation(INTERP_KERNEL::NormalizedCellType gt, int& start, int& stop) const;
MEDCouplingUMesh *getFamilyPart(const int *idsBg, const int *idsEnd, bool renum) const;
DataArrayInt *getFamilyPartArr(const int *idsBg, const int *idsEnd, bool renum) const;
MEDCouplingUMesh *getWholeMesh(bool renum) const;
+ std::vector<INTERP_KERNEL::NormalizedCellType> getGeoTypes() const;
std::vector<MEDCoupling1GTUMesh *> getDirectUndergroundSingleGeoTypeMeshes() const { return _m_by_types.getPartsWithoutComputation(); }
MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const { return _m_by_types.getPartWithoutComputation(gt); }
DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;