void MEDFileEquivalenceCell::setArray(int meshDimRelToMax, DataArrayInt *da)
{
MEDFileEquivalences::CheckDataArray(da);
- //TODO
+ MEDFileMesh *mm(getMesh());
+ std::vector<INTERP_KERNEL::NormalizedCellType> gts(mm->getGeoTypesAtLevel(meshDimRelToMax));
+ for(std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator it=gts.begin();it!=gts.end();it++)
+ {
+ mm->getNumberOfCellsWithType(*it);
+ //TODO
+ }
}
void MEDFileEquivalenceCell::load(med_idt fid)
return sp->getGeoTypes();
}
+int MEDFileUMesh::getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const
+{
+ const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(ct);
+ const MEDFileUMeshSplitL1 *sp(getMeshAtLevSafe( ((int)cm.getDimension())-getMeshDimension() ));
+ return sp->getNumberOfCellsWithType(ct);
+}
+
/*!
* 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.
}
}
+int MEDFileStructuredMesh::getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const
+{
+ if(ct!=MEDCouplingStructuredMesh::GetGeoTypeGivenMeshDimension(getMeshDimension()))
+ return 0;
+ else
+ return getNumberOfCellsAtLevel(0);
+}
+
void MEDFileStructuredMesh::whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobsReal *globs, std::vector<bool>& nodesFetched) const
{
if(st.getNumberOfItems()!=1)
MEDLOADER_EXPORT virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const = 0;
MEDLOADER_EXPORT virtual void releaseImplicitPartIfAny() const = 0;
MEDLOADER_EXPORT virtual std::vector<INTERP_KERNEL::NormalizedCellType> getGeoTypesAtLevel(int meshDimRelToMax) const = 0;
+ MEDLOADER_EXPORT virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const = 0;
MEDLOADER_EXPORT virtual std::vector<int> getNonEmptyLevels() const = 0;
MEDLOADER_EXPORT virtual std::vector<int> getNonEmptyLevelsExt() const = 0;
MEDLOADER_EXPORT virtual std::vector<int> getFamArrNonEmptyLevelsExt() const = 0;
MEDLOADER_EXPORT int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const;
MEDLOADER_EXPORT void releaseImplicitPartIfAny() const;
MEDLOADER_EXPORT std::vector<INTERP_KERNEL::NormalizedCellType> getGeoTypesAtLevel(int meshDimRelToMax) const;
+ MEDLOADER_EXPORT int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) 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;
MEDLOADER_EXPORT void releaseImplicitPartIfAny() const;
MEDLOADER_EXPORT MEDCoupling1SGTUMesh *getImplicitFaceMesh() const;
MEDLOADER_EXPORT std::vector<INTERP_KERNEL::NormalizedCellType> getGeoTypesAtLevel(int meshDimRelToMax) const;
+ MEDLOADER_EXPORT int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const;
MEDLOADER_EXPORT void whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobsReal *globs, std::vector<bool>& nodesFetched) const;
MEDLOADER_EXPORT virtual const MEDCouplingStructuredMesh *getStructuredMesh() const = 0;
// tools
return _m_by_types.getGeoTypes();
}
+int MEDFileUMeshSplitL1::getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const
+{
+ return _m_by_types.getNumberOfCellsWithType(ct);
+}
+
MEDCouplingUMesh *MEDFileUMeshSplitL1::getWholeMesh(bool renum) const
{
MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> tmp;
return _m->getAllGeoTypesSorted();
}
+int MEDFileUMeshAggregateCompute::getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const
+{
+ if(_mp_time>=_m_time)
+ {
+ for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
+ {
+ const MEDCoupling1GTUMesh *elt(*it);
+ if(elt && elt->getCellModelEnum()==ct)
+ return elt->getNumberOfCells();
+ }
+ return 0;
+ }
+ else
+ return _m->getNumberOfCellsWithType(ct);
+}
+
std::vector<MEDCoupling1GTUMesh *> MEDFileUMeshAggregateCompute::retrievePartsWithoutComputation() const
{
if(_mp_time<_m_time)
int getNumberOfCells() const;
std::vector<MEDCoupling1GTUMesh *> getParts() const;
std::vector<INTERP_KERNEL::NormalizedCellType> getGeoTypes() const;
+ int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const;
std::vector<MEDCoupling1GTUMesh *> retrievePartsWithoutComputation() const;
MEDCoupling1GTUMesh *retrievePartWithoutComputation(INTERP_KERNEL::NormalizedCellType gt) const;
void getStartStopOfGeoTypeWithoutComputation(INTERP_KERNEL::NormalizedCellType gt, int& start, int& stop) const;
int getNumberOfCells() const;
bool isMeshStoredSplitByType() const { return _m_by_types.isStoredSplitByType(); }
std::vector<INTERP_KERNEL::NormalizedCellType> getGeoTypes() const;
+ int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const;
std::vector<MEDCoupling1GTUMesh *> getDirectUndergroundSingleGeoTypeMeshes() const { return _m_by_types.retrievePartsWithoutComputation(); }
MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const { return _m_by_types.retrievePartWithoutComputation(gt); }
DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
virtual bool hasImplicitPart() const throw(INTERP_KERNEL::Exception);
virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
virtual void releaseImplicitPartIfAny() const throw(INTERP_KERNEL::Exception);
+ virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const throw(INTERP_KERNEL::Exception);
virtual std::vector<int> getFamArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
virtual std::vector<int> getNumArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);
virtual std::vector<int> getNameArrNonEmptyLevelsExt() const throw(INTERP_KERNEL::Exception);