FieldWalker2(const MEDFileFieldPerMeshPerTypePerDisc *pmptpd);
std::string getLoc() const { return _loc; }
std::string getPfl() const { return _pfl; }
+ INTERP_KERNEL::NormalizedCellType getGeoType() const { return _ct; }
bool isClassic() const { return _is_classic; }
bool operator!=(const FieldWalker2& other) const;
bool operator==(const FieldWalker2& other) const;
private:
std::string _loc;
std::string _pfl;
+ INTERP_KERNEL::NormalizedCellType _ct;
bool _is_classic;
MCAuto<SlicePartDefinition> _pd;
};
private:
std::vector<std::string> _locs;
std::vector<std::string> _pfl;
+ std::vector<INTERP_KERNEL::NormalizedCellType> _cts;
MCAuto<PartDefinition> _pd;
};
LocInfo::LocInfo(const std::vector<FieldWalker2>& fw)
{
std::size_t sz(fw.size());
- _locs.resize(sz); _pfl.resize(sz);
+ _locs.resize(sz); _pfl.resize(sz); _cts.resize(sz);
if(sz>0)
_pd=fw[0].getPartDef()->deepCopy();
for(std::size_t i=0;i<sz;i++)
{
_locs[i]=fw[i].getLoc();
_pfl[i]=fw[i].getPfl();
+ _cts[i]=fw[i].getGeoType();
if(i>0)
_pd=(*_pd)+(*(fw[i].getPartDef()));
}
throw INTERP_KERNEL::Exception("LocInfo::generateNonClassicalData : internal error !");
const MEDFileUMesh *meshLoc(gtk2->getMesh()),*section(gtk2->getSection());
const MEDFileStructureElement *se(gtk2->getSE());
- INTERP_KERNEL::NormalizedCellType gt;
+ MCAuto<MEDCouplingUMesh> um(meshLoc->getMeshAtLevel(0));
+ INTERP_KERNEL::NormalizedCellType gt(_cts[i]);
{
std::vector<int> nel(meshLoc->getNonEmptyLevels());
if(nel.size()!=1)
throw INTERP_KERNEL::Exception(MSG1);
if(nel[0]!=0)
throw INTERP_KERNEL::Exception(MSG1);
- MCAuto<MEDCouplingUMesh> um(meshLoc->getMeshAtLevel(0));
- if(um->getNumberOfCells()!=1)
+ mcIdType zePos(-1);
+ for(mcIdType icell = 0 ; icell < um->getNumberOfCells() ; ++icell)
+ if( gt == um->getTypeOfCell(icell) )
+ zePos = icell;
+ if(zePos == -1)
throw INTERP_KERNEL::Exception(MSG1);
- gt=um->getTypeOfCell(0);
std::vector<mcIdType> v;
- um->getNodeIdsOfCell(0,v);
+ um->getNodeIdsOfCell(zePos,v);
std::size_t sz2(v.size());
for(std::size_t j=0;j<sz2;j++)
if(v[j]!=ToIdType(j))
{
_loc=pmptpd->getLocalization();
_pfl=pmptpd->getProfile();
+ _ct=pmptpd->getGeoTypeStatic();
_is_classic=pmptpd->getType()!=ON_GAUSS_PT;
_pd=SlicePartDefinition::New(pmptpd->getStart(),pmptpd->getEnd(),1);
}
return _father->getGeoType();
}
+INTERP_KERNEL::NormalizedCellType MEDFileFieldPerMeshPerTypePerDisc::getGeoTypeStatic() const
+{
+ return _father->getGeoTypeStatic();
+}
+
void MEDFileFieldPerMeshPerTypePerDisc::fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const
{
types.insert(_type);
return _geo_type;
}
+INTERP_KERNEL::NormalizedCellType MEDFileFieldPerMeshPerType::getGeoTypeStatic() const
+{
+ return _geo_type;
+}
+
void MEDFileFieldPerMeshPerType::entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const
{
ent=MEDFileFieldPerMeshPerTypeCommon::ConvertIntoMEDFileType(mct,_geo_type,gt);
throw INTERP_KERNEL::Exception("not implemented yet !");
}
+INTERP_KERNEL::NormalizedCellType MEDFileFieldPerMeshPerTypeDyn::getGeoTypeStatic() const
+{
+ return _se->getGeoType();
+}
+
void MEDFileFieldPerMeshPerTypeDyn::simpleRepr(int bkOffset, std::ostream& oss, int id) const
{
const char startLine[]=" ## ";
void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
void setType(TypeOfField newType);
INTERP_KERNEL::NormalizedCellType getGeoType() const;
+ INTERP_KERNEL::NormalizedCellType getGeoTypeStatic() const;
std::size_t getNumberOfComponents() const;
mcIdType getNumberOfTuples() const;
mcIdType getStart() const { return _start; }
virtual ~MEDFileFieldPerMeshPerTypeCommon();
virtual void getDimension(int& dim) const = 0;
virtual INTERP_KERNEL::NormalizedCellType getGeoType() const = 0;
+ virtual INTERP_KERNEL::NormalizedCellType getGeoTypeStatic() const = 0;
virtual void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const = 0;
virtual void simpleRepr(int bkOffset, std::ostream& oss, int id) const = 0;
virtual std::string getGeoTypeRepr() const = 0;
static MCAuto<MEDFileFieldPerMeshPerType> Aggregate(mcIdType &start, const std::vector< std::pair<int,const MEDFileFieldPerMeshPerType *> >& pms, const std::vector< std::vector< std::pair<int,mcIdType> > >& dts, INTERP_KERNEL::NormalizedCellType gt, MEDFileFieldPerMesh *father, std::vector<std::pair< int, std::pair<mcIdType,mcIdType> > >& extractInfo);
public:// overload of abstract methods
void getDimension(int& dim) const;
- INTERP_KERNEL::NormalizedCellType getGeoType() const;
+ INTERP_KERNEL::NormalizedCellType getGeoType() const override;
+ INTERP_KERNEL::NormalizedCellType getGeoTypeStatic() const override;
void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const;
void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
std::string getGeoTypeRepr() const;
std::string getModelName() const;
public:
void getDimension(int& dim) const;
- INTERP_KERNEL::NormalizedCellType getGeoType() const;
+ INTERP_KERNEL::NormalizedCellType getGeoType() const override;
+ INTERP_KERNEL::NormalizedCellType getGeoTypeStatic() const override;
void entriesForMEDfile(TypeOfField mct, med_geometry_type& gt, med_entity_type& ent) const;
void simpleRepr(int bkOffset, std::ostream& oss, int id) const;
std::string getGeoTypeRepr() const;