-// Copyright (C) 2007-2014 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2015 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "MEDLoaderDefines.hxx"
#include "MEDFileMeshLL.hxx"
#include "MEDFileUtilities.hxx"
+#include "MEDCouplingPartDefinition.hxx"
#include "MEDFileMeshReadSelector.hxx"
#include <map>
MEDLOADER_EXPORT static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
MEDLOADER_EXPORT static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
MEDLOADER_EXPORT static MEDFileUMesh *New();
+ MEDLOADER_EXPORT static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, const std::vector<INTERP_KERNEL::NormalizedCellType>& types, const std::vector<int>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
+ MEDLOADER_EXPORT static MEDFileUMesh *LoadPartOf(med_idt fid, const std::string& mName, const std::vector<INTERP_KERNEL::NormalizedCellType>& types, const std::vector<int>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const;
MEDLOADER_EXPORT bool isEqual(const MEDFileMesh *other, double eps, std::string& what) const;
MEDLOADER_EXPORT void clearNonDiscrAttributes() const;
MEDLOADER_EXPORT void setName(const std::string& name);
- MEDLOADER_EXPORT ~MEDFileUMesh();
//
MEDLOADER_EXPORT int getMaxAbsFamilyIdInArrays() const;
MEDLOADER_EXPORT int getMaxFamilyIdInArrays() const;
MEDLOADER_EXPORT const DataArrayInt *getNumberFieldAtLevel(int meshDimRelToMaxExt) const;
MEDLOADER_EXPORT const DataArrayInt *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const;
MEDLOADER_EXPORT const DataArrayAsciiChar *getNameFieldAtLevel(int meshDimRelToMaxExt) const;
+ MEDLOADER_EXPORT const PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const;
MEDLOADER_EXPORT int getNumberOfNodes() const;
+ MEDLOADER_EXPORT int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const;
MEDLOADER_EXPORT bool hasImplicitPart() const;
MEDLOADER_EXPORT int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const;
MEDLOADER_EXPORT void releaseImplicitPartIfAny() const;
MEDLOADER_EXPORT MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const;
MEDLOADER_EXPORT DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
MEDLOADER_EXPORT DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
+ MEDLOADER_EXPORT int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const;
//
MEDLOADER_EXPORT void setFamilyNameAttachedOnId(int id, const std::string& newFamName);
MEDLOADER_EXPORT void setCoords(DataArrayDouble *coords);
MEDLOADER_EXPORT void duplicateNodesOnM1Group(const std::string& grpNameM1, DataArrayInt *&nodesDuplicated, DataArrayInt *&cellsModified, DataArrayInt *&cellsNotModified);
MEDLOADER_EXPORT bool unPolyze(std::vector<int>& oldCode, std::vector<int>& newCode, DataArrayInt *& o2nRenumCell);
MEDLOADER_EXPORT DataArrayInt *zipCoords();
+ MEDLOADER_EXPORT MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const;
+ // serialization
+ MEDLOADER_EXPORT void serialize(std::vector<double>& tinyDouble, std::vector<int>& tinyInt, std::vector<std::string>& tinyStr,
+ std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI, MEDCouplingAutoRefCountObjectPtr<DataArrayDouble>& bigArrayD);
+ MEDLOADER_EXPORT void unserialize(std::vector<double>& tinyDouble, std::vector<int>& tinyInt, std::vector<std::string>& tinyStr,
+ std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >& bigArraysI, MEDCouplingAutoRefCountObjectPtr<DataArrayDouble>& bigArrayD);
private:
+ MEDLOADER_EXPORT ~MEDFileUMesh();
void writeLL(med_idt fid) const;
MEDFileUMesh();
MEDFileUMesh(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);
+ void loadPartUMeshFromFile(med_idt fid, const std::string& mName, const std::vector<INTERP_KERNEL::NormalizedCellType>& types, const std::vector<int>& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
void loadUMeshFromFile(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);
+ void dispatchLoadedPart(med_idt fid, const MEDFileUMeshL2& loaderl2, const std::string& mName, MEDFileMeshReadSelector *mrs);
const MEDFileUMeshSplitL1 *getMeshAtLevSafe(int meshDimRelToMaxExt) const;
MEDFileUMeshSplitL1 *getMeshAtLevSafe(int meshDimRelToMaxExt);
void checkMeshDimCoherency(int meshDim, int meshDimRelToMax) const;
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _num_coords;
MEDCouplingAutoRefCountObjectPtr<DataArrayAsciiChar> _name_coords;
mutable MEDCouplingAutoRefCountObjectPtr<DataArrayInt> _rev_num_coords;
+ MEDCouplingAutoRefCountObjectPtr<PartDefinition> _part_coords;
};
class MEDFileStructuredMesh : public MEDFileMesh
// tools
MEDLOADER_EXPORT bool unPolyze(std::vector<int>& oldCode, std::vector<int>& newCode, DataArrayInt *& o2nRenumCell);
protected:
+ ~MEDFileStructuredMesh() { }
void changeFamilyIdArr(int oldId, int newId);
void deepCpyAttributes();
void loadStrMeshFromFile(MEDFileStrMeshL2 *strm, med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);
MEDLOADER_EXPORT const MEDCouplingCMesh *getMesh() const;
MEDLOADER_EXPORT void setMesh(MEDCouplingCMesh *m);
private:
+ ~MEDFileCMesh() { }
const MEDCouplingStructuredMesh *getStructuredMesh() const;
void writeLL(med_idt fid) const;
MEDFileCMesh();
MEDLOADER_EXPORT const MEDCouplingCurveLinearMesh *getMesh() const;
MEDLOADER_EXPORT void setMesh(MEDCouplingCurveLinearMesh *m);
private:
+ ~MEDFileCurveLinearMesh() { }
MEDFileCurveLinearMesh();
MEDFileCurveLinearMesh(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);
const MEDCouplingStructuredMesh *getStructuredMesh() const;
MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
MEDLOADER_EXPORT void setOneTimeStep(MEDFileMesh *mesh1TimeStep);
private:
+ ~MEDFileMeshMultiTS() { }
void loadFromFile(const std::string& fileName, const std::string& mName);
MEDFileMeshMultiTS();
MEDFileMeshMultiTS(const std::string& fileName);
MEDLOADER_EXPORT void setMeshAtPos(int i, MEDFileMesh *mesh);
MEDLOADER_EXPORT void destroyMeshAtPos(int i);
private:
+ ~MEDFileMeshes() { }
void checkCoherency() const;
void loadFromFile(const std::string& fileName);
MEDFileMeshes();