//
+class FieldWalker2
+{
+public:
+ FieldWalker2(const MEDFileFieldPerMeshPerTypePerDisc *pmptpd);
+ std::string getLoc() const { return _loc; }
+ std::string getPfl() const { return _pfl; }
+ 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;
+ bool _is_classic;
+};
+
class LocInfo
{
public:
LocInfo() { }
+ LocInfo(const std::vector<FieldWalker2>& fw);
bool operator==(const LocInfo& other) const { return _locs==other._locs && _pfl==other._pfl; }
void push(const std::string& loc, const std::string& pfl) { checkUniqueLoc(loc); _locs.push_back(loc); _pfl.push_back(pfl); }
private:
std::vector<std::string> _pfl;
};
+LocInfo::LocInfo(const std::vector<FieldWalker2>& fw)
+{
+ std::size_t sz(fw.size());
+ _locs.resize(sz); _pfl.resize(sz);
+ for(std::size_t i=0;i<sz;i++)
+ {
+ _locs[i]=fw[i].getLoc();
+ _pfl[i]=fw[i].getPfl();
+ }
+}
+
void LocInfo::checkUniqueLoc(const std::string& loc) const
{
if(std::find(_locs.begin(),_locs.end(),loc)!=_locs.end())
}
}
-class FieldWalker2
-{
-public:
- FieldWalker2(const MEDFileFieldPerMeshPerTypePerDisc *pmptpd);
- bool isClassic() const { return _is_classic; }
- bool operator!=(const FieldWalker2& other) const;
-private:
- std::string _loc;
- std::string _pfl;
- bool _is_classic;
-};
-
FieldWalker2::FieldWalker2(const MEDFileFieldPerMeshPerTypePerDisc *pmptpd)
{
_loc=pmptpd->getLocalization();
_pfl=pmptpd->getProfile();
- _is_classic=pmptpd->getType()==ON_GAUSS_PT;
+ _is_classic=pmptpd->getType()!=ON_GAUSS_PT;
}
bool FieldWalker2::operator!=(const FieldWalker2& other) const
return !ret;
}
+bool FieldWalker2::operator==(const FieldWalker2& other) const
+{
+ bool ret(_loc==other._loc && _pfl==other._pfl && _is_classic==other._is_classic);
+ return ret;
+}
+
class FieldWalker1
{
public:
void newPerMeshPerTypePerDisc(const MEDFileFieldPerMeshPerTypePerDisc *pmptpd);
void checkOK(const FieldWalker1& other) const;
bool isClassical() const;
+ std::vector<FieldWalker2> getNonClassicalData() const { return _fw; }
private:
const MEDFileAnyTypeField1TSWithoutSDA *_ts;
const MEDFileFieldPerMeshPerTypeDyn *_pm_pt;
public:
bool isEmpty() const;
bool isClassical() const;
+ const MEDFileAnyTypeFieldMultiTSWithoutSDA *field() const { return _f; }
+ std::vector<FieldWalker2> getNonClassicalData() const { return _fw_prev->getNonClassicalData(); }
private:
const MEDFileAnyTypeFieldMultiTSWithoutSDA *_f;
mutable INTERP_KERNEL::AutoCppPtr<FieldWalker1> _fw;
{
public:
LocSpliter(const MEDFileFieldGlobsReal *globs):_globs(globs),_fw(0) { }
+ MCAuto<MEDFileFields> getClassical() const { return _classical; }
private:
void newFieldEntry(const MEDFileAnyTypeFieldMultiTSWithoutSDA *field);
void endFieldEntry(const MEDFileAnyTypeFieldMultiTSWithoutSDA *field);
_classical=MEDFileFields::New();
_classical->shallowCpyGlobs(*_globs);
}
+ MCAuto<MEDFileAnyTypeFieldMultiTS> f(MEDFileAnyTypeFieldMultiTS::BuildNewInstanceFromContent(const_cast<MEDFileAnyTypeFieldMultiTSWithoutSDA *>(field)));
+ _classical->pushField(f);
+ }
+ else
+ {
+ std::vector<FieldWalker2> fw2(_fw->getNonClassicalData());
+ LocInfo elt(fw2);
+ std::vector< LocInfo >::iterator it(std::find(_locs.begin(),_locs.end(),elt));
+ if(it==_locs.end())
+ {
+ _locs.push_back(elt);
+ }
+ else
+ {
+ }
+ std::cerr << "lkk " << _locs.size() << std::endl;
}
}
{
LocSpliter ls(fields);
fields->accept(ls);
+ return ls.getClassical();
}
MEDFileAnyTypeFieldMultiTS(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
MEDFileAnyTypeFieldMultiTS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0);
MEDFileAnyTypeFieldMultiTS(const MEDFileAnyTypeFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent);
- static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c);
static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c, med_idt fid);
static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, bool loadAll, const MEDFileMeshes *ms);
static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(med_idt fid, bool loadAll=true);
MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, const std::string& fieldName, bool loadAll=true);
MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(med_idt fid, const std::string& fieldName, bool loadAll=true);
+ MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c);
MEDLOADER_EXPORT void loadArrays();
MEDLOADER_EXPORT void loadArraysIfNecessary();
MEDLOADER_EXPORT void unloadArrays();