#include "MEDCouplingRefCountObject.hxx"
#include "MEDCouplingFieldInt.hxx"
#include "MEDCouplingMemArray.hxx"
+#include "MEDCouplingPartDefinition.hxx"
#include "NormalizedUnstructuredMesh.hxx"
#include "InterpKernelException.hxx"
class MEDCouplingMesh;
class MEDCouplingFieldDouble;
class MEDFileMesh;
+ class MEDFileFieldVisitor;
+ class MEDFileGTKeeper
+ {
+ public:
+ virtual MEDFileGTKeeper *deepCopy() const = 0;
+ virtual INTERP_KERNEL::NormalizedCellType getGeoType() const = 0;
+ virtual std::string getRepr() const = 0;
+ virtual bool isEqual(const MEDFileGTKeeper *other) const = 0;
+ virtual ~MEDFileGTKeeper();
+ };
+
+ class MEDFileGTKeeperSta : public MEDFileGTKeeper
+ {
+ public:
+ MEDFileGTKeeperSta(INTERP_KERNEL::NormalizedCellType gt):_geo_type(gt) { }
+ MEDFileGTKeeper *deepCopy() const;
+ INTERP_KERNEL::NormalizedCellType getGeoType() const;
+ std::string getRepr() const;
+ bool isEqual(const MEDFileGTKeeper *other) const;
+ private:
+ INTERP_KERNEL::NormalizedCellType _geo_type;
+ };
+
+
+ class MEDFileGTKeeperDyn : public MEDFileGTKeeper
+ {
+ public:
+ MEDFileGTKeeperDyn(const MEDFileUMesh *mesh, const MEDFileUMesh *section, const MEDFileStructureElement *se);
+ MEDFileGTKeeper *deepCopy() const;
+ INTERP_KERNEL::NormalizedCellType getGeoType() const;
+ std::string getRepr() const;
+ bool isEqual(const MEDFileGTKeeper *other) const;
+ const MEDFileUMesh *getMesh() const { return _mesh; }
+ const MEDFileUMesh *getSection() const { return _section; }
+ const MEDFileStructureElement *getSE() const { return _se; }
+ private:
+ MCConstAuto<MEDFileUMesh> _mesh;
+ MCConstAuto<MEDFileUMesh> _section;
+ MCConstAuto<MEDFileStructureElement> _se;
+ };
+
class MEDFileFieldLoc : public RefCountObject
{
public:
MEDLOADER_EXPORT std::string getName() const { return _name; }
MEDLOADER_EXPORT void setName(const std::string& name);
static MEDFileFieldLoc *New(med_idt fid, const std::string& locName);
- static MEDFileFieldLoc *New(med_idt fid, int id);
+ static MEDFileFieldLoc *New(med_idt fid, int i, const MEDFileEntities *entities);
static MEDFileFieldLoc *New(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
std::size_t getHeapMemorySizeWithoutChildren() const;
std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDFileFieldLoc *deepCopy() const;
+ bool isOnStructureElement() const;
+ const MEDFileGTKeeper *getUndergroundGTKeeper() const { return _gt; }
MEDLOADER_EXPORT int getNbOfGaussPtPerCell() const { return _nb_gauss_pt; }
MEDLOADER_EXPORT void writeLL(med_idt fid) const;
MEDLOADER_EXPORT std::string repr() const;
MEDLOADER_EXPORT const std::vector<double>& getRefCoords() const { return _ref_coo; }
MEDLOADER_EXPORT const std::vector<double>& getGaussCoords() const { return _gs_coo; }
MEDLOADER_EXPORT const std::vector<double>& getGaussWeights() const { return _w; }
- MEDLOADER_EXPORT INTERP_KERNEL::NormalizedCellType getGeoType() const { return _geo_type; }
+ MEDLOADER_EXPORT INTERP_KERNEL::NormalizedCellType getGeoType() const { return _gt->getGeoType(); }
MEDLOADER_EXPORT bool isEqual(const MEDFileFieldLoc& other, double eps) const;
private:
+ MEDFileFieldLoc(const MEDFileFieldLoc& other);
MEDFileFieldLoc(med_idt fid, const std::string& locName);
- MEDFileFieldLoc(med_idt fid, int id);
+ MEDFileFieldLoc(med_idt fid, int id, const MEDFileEntities *entities);
MEDFileFieldLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
private:
int _dim;
int _nb_gauss_pt;
+ INTERP_KERNEL::AutoCppPtr<MEDFileGTKeeper> _gt;
int _nb_node_per_cell;
std::string _name;
- INTERP_KERNEL::NormalizedCellType _geo_type;
std::vector<double> _ref_coo;
std::vector<double> _gs_coo;
std::vector<double> _w;
class MEDFileFieldNameScope;
class MEDFileFieldGlobsReal;
class MEDFileFieldPerMesh;
- class PartDefinition;
class MEDFileFieldPerMeshPerTypePerDisc : public RefCountObject, public MEDFileWritable
{
int getNumberOfTuples() const;
int getStart() const { return _start; }
int getEnd() const { return _end; }
+ void setEnd(int endd) { _end=endd; }
int getNumberOfVals() const { return _nval; }
DataArray *getOrCreateAndGetArray();
const DataArray *getOrCreateAndGetArray() const;
void getSizes(int& globalSz, int& nbOfEntries) const;
int getNumberOfComponents() const;
bool presenceOfMultiDiscPerGeoType() const;
+ void pushDiscretization(MEDFileFieldPerMeshPerTypePerDisc *disc);
DataArray *getOrCreateAndGetArray();
const DataArray *getOrCreateAndGetArray() const;
const std::vector<std::string>& getInfo() const;
bool keepOnlyGaussDiscretization(std::size_t idOfDisc, int &globalNum, std::vector< std::pair<int,int> >& its);
static med_entity_type ConvertIntoMEDFileType(TypeOfField ikType, INTERP_KERNEL::NormalizedCellType ikGeoType, med_geometry_type& medfGeoType);
MEDFileFieldPerMeshPerTypeCommon(MEDFileFieldPerMesh *father):_father(father) { }
+ void setFather(MEDFileFieldPerMesh *father);
+ void accept(MEDFileFieldVisitor& visitor) const;
public:
virtual ~MEDFileFieldPerMeshPerTypeCommon();
virtual void getDimension(int& dim) const = 0;
virtual MEDFileFieldPerMeshPerTypeCommon *deepCopy(MEDFileFieldPerMesh *father) const = 0;
virtual void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair<int,int> >& dads, std::vector<const DataArrayInt *>& pfls, std::vector<int>& locs, std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes) const = 0;
protected:
- void setFather(MEDFileFieldPerMesh *father);
void deepCopyElements();
std::vector<int> addNewEntryIfNecessary(const MEDCouplingFieldDouble *field, int offset, int nbOfCells);
std::vector<int> addNewEntryIfNecessaryGauss(const MEDCouplingFieldDouble *field, int offset, int nbOfCells);
void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
void fillTypesOfFieldAvailable(std::set<TypeOfField>& types) const;
std::vector< std::vector< std::pair<int,int> > > getFieldSplitedByType(std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
+ void accept(MEDFileFieldVisitor& visitor) const;
void getDimension(int& dim) const;
bool isUniqueLevel(int& dim) const;
double getTime() const;
std::vector<std::string> getLocsReallyUsed() const;
std::vector<std::string> getPflsReallyUsedMulti() const;
std::vector<std::string> getLocsReallyUsedMulti() const;
+ void convertMedBallIntoClassic();
bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
void keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair<int,int> >& its);
void loadProfileInFile(med_idt fid, int id, const std::string& pflName);
void loadProfileInFile(med_idt fid, int id);
void loadGlobals(med_idt fid, const MEDFileFieldGlobsReal& real);
- void loadAllGlobals(med_idt fid);
+ void loadAllGlobals(med_idt fid, const MEDFileEntities *entities);
void writeGlobals(med_idt fid, const MEDFileWritable& opt) const;
std::vector<std::string> getPfls() const;
std::vector<std::string> getLocs() const;
DataArrayInt *getProfileFromId(int pflId);
void killProfileIds(const std::vector<int>& pflIds);
void killLocalizationIds(const std::vector<int>& locIds);
+ void killStructureElementsInGlobs();
//
void appendProfile(DataArrayInt *pfl);
void appendLoc(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDLOADER_EXPORT void simpleReprGlobs(std::ostream& oss) const;
MEDLOADER_EXPORT void resetContent();
+ MEDLOADER_EXPORT void killStructureElementsInGlobs();
MEDLOADER_EXPORT void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
MEDLOADER_EXPORT void deepCpyGlobs(const MEDFileFieldGlobsReal& other);
MEDLOADER_EXPORT void shallowCpyOnlyUsedGlobs(const MEDFileFieldGlobsReal& other);
MEDLOADER_EXPORT void loadProfileInFile(med_idt fid, int id, const std::string& pflName);
MEDLOADER_EXPORT void loadProfileInFile(med_idt fid, int id);
MEDLOADER_EXPORT void loadGlobals(med_idt fid);
- MEDLOADER_EXPORT void loadAllGlobals(med_idt fid);
+ MEDLOADER_EXPORT void loadAllGlobals(med_idt fid, const MEDFileEntities *entities=0);
MEDLOADER_EXPORT void writeGlobals(med_idt fid, const MEDFileWritable& opt) const;
MEDLOADER_EXPORT std::vector<std::string> getPfls() const;
MEDLOADER_EXPORT std::vector<std::string> getLocs() const;
MEDLOADER_EXPORT void changeLocsRefsNamesGen2(const std::vector< std::pair<std::vector<std::string>, std::string > >& mapOfModif);
//
MEDLOADER_EXPORT int getNonEmptyLevels(const std::string& mname, std::vector<int>& levs) const;
+ MEDLOADER_EXPORT void convertMedBallIntoClassic();
+ MEDLOADER_EXPORT void makeReduction(INTERP_KERNEL::NormalizedCellType ct, TypeOfField tof, const DataArrayInt *pfl);
MEDLOADER_EXPORT std::vector< std::vector<std::pair<int,int> > > getFieldSplitedByType(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF, std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
//
MEDLOADER_EXPORT MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId);
MEDLOADER_EXPORT const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const;
MEDLOADER_EXPORT void deepCpyLeavesFrom(const MEDFileAnyTypeField1TSWithoutSDA& other);
+ MEDLOADER_EXPORT void accept(MEDFileFieldVisitor& visitor) const;
public:
MEDLOADER_EXPORT int getNumberOfComponents() const;
MEDLOADER_EXPORT const std::vector<std::string>& getInfo() const;
MEDLOADER_EXPORT MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId);
MEDLOADER_EXPORT const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const;
MEDLOADER_EXPORT int getNonEmptyLevels(const std::string& mname, std::vector<int>& levs) const;
+ MEDLOADER_EXPORT void convertMedBallIntoClassic();
+ MEDLOADER_EXPORT void makeReduction(INTERP_KERNEL::NormalizedCellType ct, TypeOfField tof, const DataArrayInt *pfl);
public:
MEDLOADER_EXPORT void loadArrays();
MEDLOADER_EXPORT void loadArraysIfNecessary();
MEDLOADER_EXPORT DataArray *getUndergroundDataArray(int iteration, int order) const;
MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob);
+ MEDLOADER_EXPORT void accept(MEDFileFieldVisitor& visitor) const;
MEDLOADER_EXPORT void loadStructureOrStructureAndBigArraysRecursively(med_idt fid, int nbPdt, med_field_type fieldTyp, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities);
MEDLOADER_EXPORT void writeLL(med_idt fid, const MEDFileWritable& opts) const;
MEDLOADER_EXPORT void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc);
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();
MEDLOADER_EXPORT void keepOnlyStructureElements();
MEDLOADER_EXPORT void keepOnlyOnMeshSE(const std::string& meshName, const std::string& seName);
MEDLOADER_EXPORT void getMeshSENames(std::vector< std::pair<std::string,std::string> >& ps) const;
+ MEDLOADER_EXPORT void blowUpSE(MEDFileMeshes *ms, const MEDFileStructureElements *ses);
MEDLOADER_EXPORT MCAuto<MEDFileFields> partOfThisOnStructureElements() const;
MEDLOADER_EXPORT MCAuto<MEDFileFields> partOfThisLyingOnSpecifiedMeshSEName(const std::string& meshName, const std::string& seName) const;
MEDLOADER_EXPORT void aggregate(const MEDFileFields& other);
MEDLOADER_EXPORT void destroyFieldsAtPos2(int bg, int end, int step);
MEDLOADER_EXPORT bool changeMeshNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
MEDLOADER_EXPORT bool renumberEntitiesLyingOnMesh(const std::string& meshName, const std::vector<int>& oldCode, const std::vector<int>& newCode, const DataArrayInt *renumO2N);
+ MEDLOADER_EXPORT void accept(MEDFileFieldVisitor& visitor) const;
public:
MEDLOADER_EXPORT MEDFileFields *extractPart(const std::map<int, MCAuto<DataArrayInt> >& extractDef, MEDFileMesh *mm) const;
public: