X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FMEDLoader.hxx;h=a2e832f5896bd0ce8f5ab9d052e1cf921b5de8c9;hb=b607ffc713080a567fb90595118069ac18181e99;hp=b1bc30080ec39d43adefe432c2591d8e9277e0d1;hpb=1123dccd6613b2e8abba35182759d5c4a11ecc8d;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/MEDLoader.hxx b/src/MEDLoader/MEDLoader.hxx index b1bc30080..a2e832f58 100644 --- a/src/MEDLoader/MEDLoader.hxx +++ b/src/MEDLoader/MEDLoader.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D +// Copyright (C) 2007-2020 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 @@ -18,94 +18,90 @@ // // Author : Anthony Geay (CEA/DEN) -#ifndef __MEDLOADER_HXX__ -#define __MEDLOADER_HXX__ +#pragma once #include "MEDLoaderDefines.hxx" #include "InterpKernelException.hxx" #include "MEDCouplingRefCountObject.hxx" #include "NormalizedUnstructuredMesh.hxx" +#include "MCAuto.hxx" +#include "MCIdType.hxx" #include #include -namespace ParaMEDMEM +namespace MEDCoupling { class DataArrayInt; class MEDCouplingMesh; class MEDCouplingUMesh; + class MEDCouplingField; class MEDCouplingFieldDouble; class MEDFileWritable; -} -class MEDLOADER_EXPORT MEDLoader -{ - public: - static void SetEpsilonForNodeComp(double val); - static void SetCompPolicyForCell(int val); - static void SetTooLongStrPolicy(int val); - static bool HasXDR(); - static std::string MEDFileVersionStr(); - static void MEDFileVersion(int& major, int& minor, int& release); - static void CheckFileForRead(const std::string& fileName); - static std::vector GetMeshNames(const std::string& fileName); - static std::vector< std::vector< std::pair > > GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName, int &meshDim, int& spaceDim, int& numberOfNodes); - static std::vector< std::pair > GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName); - static std::vector GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName); - static std::vector GetMeshGroupsNames(const std::string& fileName, const std::string& meshName); - static std::vector GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName); - static std::vector GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName); - static std::vector GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName); - static std::vector GetAllFieldNames(const std::string& fileName); - static std::vector GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName); - static std::vector GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName); - static std::vector GetFieldNamesOnMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName); - static std::vector GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName); - static std::vector GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName); - static std::vector< std::pair > GetFieldIterations(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName); - static std::vector< std::pair > GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName); - static std::vector< std::pair > GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName); - static std::vector< std::pair< std::pair, double> > GetAllFieldIterations(const std::string& fileName, const std::string& fieldName); - static double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order); - static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::vector& fams); - static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::vector& grps); - static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0); - static ParaMEDMEM::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0); - static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0); - static ParaMEDMEM::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0); - static int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName); - static ParaMEDMEM::MEDCouplingFieldDouble *ReadField(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order); - static std::vector ReadFieldsOnSameMesh(ParaMEDMEM::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, - const std::vector >& its) throw(INTERP_KERNEL::Exception); - static std::vector ReadFieldsCellOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, - const std::vector >& its) throw(INTERP_KERNEL::Exception); - static std::vector ReadFieldsNodeOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, - const std::vector >& its) throw(INTERP_KERNEL::Exception); - static std::vector ReadFieldsGaussOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, - const std::vector >& its) throw(INTERP_KERNEL::Exception); - static std::vector ReadFieldsGaussNEOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, - const std::vector >& its) throw(INTERP_KERNEL::Exception); - static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order); - static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order); - static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order); - static ParaMEDMEM::MEDCouplingFieldDouble *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order); - static void WriteMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingMesh *mesh, bool writeFromScratch); - static void WriteUMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch); - static void WriteUMeshDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingUMesh *mesh, bool writeFromScratch); - static void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, const std::vector& meshes, bool writeFromScratch); - static void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, const std::vector& meshes, bool writeFromScratch); - static void WriteUMeshes(const std::string& fileName, const std::vector& meshes, bool writeFromScratch); - static void WriteField(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch); - static void WriteFieldDep(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f, bool writeFromScratch); - static void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const ParaMEDMEM::MEDCouplingFieldDouble *f); - public: - static void AssignStaticWritePropertiesTo(ParaMEDMEM::MEDFileWritable& obj); - private: - MEDLoader(); - public: - static double _EPS_FOR_NODE_COMP; - static int _COMP_FOR_CELL; - static int _TOO_LONG_STR; -}; + MEDLOADER_EXPORT void SetEpsilonForNodeComp(double val); + MEDLOADER_EXPORT void SetCompPolicyForCell(int val); + MEDLOADER_EXPORT void SetTooLongStrPolicy(int val); + MEDLOADER_EXPORT bool HasXDR(); + MEDLOADER_EXPORT std::string MEDFileVersionStr(); + MEDLOADER_EXPORT std::string MEDFileVersionOfFileStr(const std::string& fileName); + MEDLOADER_EXPORT void MEDFileVersion(int& major, int& minor, int& release); + MEDLOADER_EXPORT void CheckFileForRead(const std::string& fileName); + MEDLOADER_EXPORT std::vector GetMeshNames(const std::string& fileName); + MEDLOADER_EXPORT std::vector< std::vector< std::pair > > GetUMeshGlobalInfo(const std::string& fileName, const std::string& meshName, int &meshDim, int& spaceDim, mcIdType& numberOfNodes); + MEDLOADER_EXPORT std::vector< std::pair > GetComponentsNamesOfField(const std::string& fileName, const std::string& fieldName); + MEDLOADER_EXPORT std::vector GetMeshNamesOnField(const std::string& fileName, const std::string& fieldName); + MEDLOADER_EXPORT void GetFamiliesGroupsInfo(const std::string& fileName, const std::string& meshName, std::map& families, std::map>& groupsOnFam); + MEDLOADER_EXPORT std::vector GetMeshGroupsNames(const std::string& fileName, const std::string& meshName); + MEDLOADER_EXPORT std::vector GetMeshFamiliesNames(const std::string& fileName, const std::string& meshName); + MEDLOADER_EXPORT std::vector GetMeshFamiliesNamesOnGroup(const std::string& fileName, const std::string& meshName, const std::string& grpName); + MEDLOADER_EXPORT std::vector GetMeshGroupsNamesOnFamily(const std::string& fileName, const std::string& meshName, const std::string& famName); + MEDLOADER_EXPORT std::vector GetAllFieldNames(const std::string& fileName); + MEDLOADER_EXPORT std::vector GetAllFieldNamesOnMesh(const std::string& fileName, const std::string& meshName); + MEDLOADER_EXPORT std::vector GetTypesOfField(const std::string& fileName, const std::string& meshName, const std::string& fieldName); + MEDLOADER_EXPORT std::vector GetFieldNamesOnMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName); + MEDLOADER_EXPORT std::vector GetCellFieldNamesOnMesh(const std::string& fileName, const std::string& meshName); + MEDLOADER_EXPORT std::vector GetNodeFieldNamesOnMesh(const std::string& fileName, const std::string& meshName); + MEDLOADER_EXPORT std::vector< std::pair > GetFieldIterations(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, const std::string& fieldName); + MEDLOADER_EXPORT std::vector< std::pair > GetCellFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName); + MEDLOADER_EXPORT std::vector< std::pair > GetNodeFieldIterations(const std::string& fileName, const std::string& meshName, const std::string& fieldName); + MEDLOADER_EXPORT std::vector< std::pair< std::pair, double> > GetAllFieldIterations(const std::string& fileName, const std::string& fieldName); + MEDLOADER_EXPORT double GetTimeAttachedOnFieldIteration(const std::string& fileName, const std::string& fieldName, int iteration, int order); + MEDLOADER_EXPORT MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFamilies(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::vector& fams); + MEDLOADER_EXPORT MEDCoupling::MEDCouplingUMesh *ReadUMeshFromGroups(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::vector& grps); + MEDLOADER_EXPORT MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0); + MEDLOADER_EXPORT MEDCoupling::MEDCouplingMesh *ReadMeshFromFile(const std::string& fileName, int meshDimRelToMax=0); + MEDLOADER_EXPORT MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, const std::string& meshName, int meshDimRelToMax=0); + MEDLOADER_EXPORT MEDCoupling::MEDCouplingUMesh *ReadUMeshFromFile(const std::string& fileName, int meshDimRelToMax=0); + MEDLOADER_EXPORT int ReadUMeshDimFromFile(const std::string& fileName, const std::string& meshName); + MEDLOADER_EXPORT MCAuto ReadField(const std::string& fileName); + MEDLOADER_EXPORT MCAuto ReadField(const std::string& fileName, const std::string& fieldName); + MEDLOADER_EXPORT MCAuto ReadField(const std::string& fileName, const std::string& fieldName, int iteration, int order); + MEDLOADER_EXPORT MCAuto ReadField(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order); + MEDLOADER_EXPORT std::vector ReadFieldsOnSameMesh(MEDCoupling::TypeOfField type, const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, + const std::vector >& its); + MEDLOADER_EXPORT std::vector ReadFieldsCellOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, + const std::vector >& its); + MEDLOADER_EXPORT std::vector ReadFieldsNodeOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, + const std::vector >& its); + MEDLOADER_EXPORT std::vector ReadFieldsGaussOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, + const std::vector >& its); + MEDLOADER_EXPORT std::vector ReadFieldsGaussNEOnSameMesh(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, + const std::vector >& its); + MEDLOADER_EXPORT MEDCoupling::MEDCouplingField *ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order); + MEDLOADER_EXPORT MEDCoupling::MEDCouplingField *ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order); + MEDLOADER_EXPORT MEDCoupling::MEDCouplingField *ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order); + MEDLOADER_EXPORT MEDCoupling::MEDCouplingField *ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order); + MEDLOADER_EXPORT void WriteMesh(const std::string& fileName, const MEDCoupling::MEDCouplingMesh *mesh, bool writeFromScratch); + MEDLOADER_EXPORT void WriteUMesh(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch); + MEDLOADER_EXPORT void WriteUMeshDep(const std::string& fileName, const MEDCoupling::MEDCouplingUMesh *mesh, bool writeFromScratch); + MEDLOADER_EXPORT void WriteUMeshesPartition(const std::string& fileName, const std::string& meshName, const std::vector& meshes, bool writeFromScratch); + MEDLOADER_EXPORT void WriteUMeshesPartitionDep(const std::string& fileName, const std::string& meshName, const std::vector& meshes, bool writeFromScratch); + MEDLOADER_EXPORT void WriteUMeshes(const std::string& fileName, const std::vector& meshes, bool writeFromScratch); + MEDLOADER_EXPORT void WriteField(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch); + MEDLOADER_EXPORT void WriteFieldDep(const std::string& fileName, const MEDCoupling::MEDCouplingField *f, bool writeFromScratch); + MEDLOADER_EXPORT void WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName, const MEDCoupling::MEDCouplingField *f); + + MEDLOADER_EXPORT void AssignStaticWritePropertiesTo(MEDCoupling::MEDFileWritable& obj); +} -#endif