| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #ifndef FEM_FEMMESH_H |
| | #define FEM_FEMMESH_H |
| |
|
| | #include <list> |
| | #include <memory> |
| | #include <vector> |
| |
|
| | #include <SMDSAbs_ElementType.hxx> |
| | #include <SMESH_Version.h> |
| |
|
| | #include <App/ComplexGeoData.h> |
| | #include <Base/Quantity.h> |
| | #include <Mod/Fem/FemGlobal.h> |
| |
|
| |
|
| | class SMESH_Gen; |
| | class SMESH_Mesh; |
| | class SMESH_Hypothesis; |
| | class TopoDS_Shape; |
| | class TopoDS_Face; |
| | class TopoDS_Edge; |
| | class TopoDS_Vertex; |
| | class TopoDS_Solid; |
| |
|
| | namespace Fem |
| | { |
| |
|
| | enum class ABAQUS_VolumeVariant |
| | { |
| | Standard, |
| | Reduced, |
| | Incompatible, |
| | Modified, |
| | Fluid |
| | }; |
| | enum class ABAQUS_FaceVariant |
| | { |
| | Shell, |
| | Shell_Reduced, |
| | Membrane, |
| | Membrane_Reduced, |
| | Stress, |
| | Stress_Reduced, |
| | Strain, |
| | Strain_Reduced, |
| | Axisymmetric, |
| | Axisymmetric_Reduced |
| | }; |
| | enum class ABAQUS_EdgeVariant |
| | { |
| | Beam, |
| | Beam_Reduced, |
| | Truss, |
| | Network |
| | }; |
| |
|
| | using SMESH_HypothesisPtr = std::shared_ptr<SMESH_Hypothesis>; |
| |
|
| | |
| | |
| | class FemExport FemMesh: public Data::ComplexGeoData |
| | { |
| | TYPESYSTEM_HEADER_WITH_OVERRIDE(); |
| |
|
| | public: |
| | FemMesh(); |
| | FemMesh(const FemMesh&); |
| | ~FemMesh() override; |
| |
|
| | FemMesh& operator=(const FemMesh&); |
| | const SMESH_Mesh* getSMesh() const; |
| | SMESH_Mesh* getSMesh(); |
| | static SMESH_Gen* getGenerator(); |
| | void addHypothesis(const TopoDS_Shape& aSubShape, SMESH_HypothesisPtr hyp); |
| | void setStandardHypotheses(); |
| | template<typename T> |
| | SMESH_HypothesisPtr createHypothesis(int hypId); |
| |
|
| | void compute(); |
| |
|
| | |
| | unsigned int getMemSize() const override; |
| | void Save(Base::Writer& ) const override; |
| | void Restore(Base::XMLReader& ) override; |
| | void SaveDocFile(Base::Writer& writer) const override; |
| | void RestoreDocFile(Base::Reader& reader) override; |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | std::vector<const char*> getElementTypes() const override; |
| | unsigned long countSubElements(const char* Type) const override; |
| | |
| | Data::Segment* getSubElement(const char* Type, unsigned long) const override; |
| | |
| | void getPoints( |
| | std::vector<Base::Vector3d>& Points, |
| | std::vector<Base::Vector3d>& Normals, |
| | double Accuracy, |
| | uint16_t flags = 0 |
| | ) const override; |
| | |
| |
|
| | |
| | |
| | |
| | std::set<long> getSurfaceNodes(long ElemId, short FaceId, float Angle = 360) const; |
| | |
| | std::set<int> getNodesBySolid(const TopoDS_Solid& solid) const; |
| | |
| | std::set<int> getNodesByFace(const TopoDS_Face& face) const; |
| | |
| | std::set<int> getNodesByEdge(const TopoDS_Edge& edge) const; |
| | |
| | std::set<int> getNodesByVertex(const TopoDS_Vertex& vertex) const; |
| | |
| | std::list<int> getElementNodes(int id) const; |
| | |
| | std::list<int> getNodeElements(int id, SMDSAbs_ElementType type = SMDSAbs_All) const; |
| | |
| | std::list<int> getFacesByFace(const TopoDS_Face& face) const; |
| | |
| | std::list<int> getEdgesByEdge(const TopoDS_Edge& edge) const; |
| | |
| | std::list<std::pair<int, int>> getVolumesByFace(const TopoDS_Face& face) const; |
| | |
| | std::map<int, int> getccxVolumesByFace(const TopoDS_Face& face) const; |
| | |
| | std::set<int> getEdgesOnly() const; |
| | |
| | std::set<int> getFacesOnly() const; |
| | |
| |
|
| | |
| | |
| | |
| | void setTransform(const Base::Matrix4D& rclTrf) override; |
| | |
| | Base::Matrix4D getTransform() const override; |
| | |
| | Base::BoundBox3d getBoundBox() const override; |
| | |
| | Base::Quantity getVolume() const; |
| | |
| |
|
| | |
| | |
| | |
| | void transformGeometry(const Base::Matrix4D& rclMat) override; |
| | |
| |
|
| | |
| | |
| | |
| | int addGroup(const std::string, const std::string, const int = -1); |
| | |
| | void addGroupElements(int, const std::set<int>&); |
| | |
| | bool removeGroup(int); |
| | |
| | void renameGroup(int id, const std::string& name); |
| | |
| |
|
| |
|
| | struct FemMeshInfo |
| | { |
| | int numFaces; |
| | int numNode; |
| | int numTria; |
| | int numQuad; |
| | int numPoly; |
| | int numVolu; |
| | int numTetr; |
| | int numHexa; |
| | int numPyrd; |
| | int numPris; |
| | int numHedr; |
| | }; |
| |
|
| | |
| | struct FemMeshInfo getInfo() const; |
| |
|
| | |
| | void read(const char* FileName); |
| | void write(const char* FileName) const; |
| | void writeABAQUS( |
| | const std::string& Filename, |
| | int elemParam, |
| | bool groupParam, |
| | ABAQUS_VolumeVariant volVariant = ABAQUS_VolumeVariant::Standard, |
| | ABAQUS_FaceVariant faceVariant = ABAQUS_FaceVariant::Shell, |
| | ABAQUS_EdgeVariant edgeVariant = ABAQUS_EdgeVariant::Beam |
| | ) const; |
| | void writeVTK(const std::string& FileName, bool highest = true) const; |
| | void writeZ88(const std::string& FileName) const; |
| |
|
| | private: |
| | void copyMeshData(const FemMesh&); |
| | void readNastran(const std::string& Filename); |
| | void readNastran95(const std::string& Filename); |
| | void readZ88(const std::string& Filename); |
| | void readAbaqus(const std::string& Filename); |
| |
|
| | private: |
| | |
| | Base::Matrix4D _Mtrx; |
| | SMESH_Mesh* myMesh; |
| | #if SMESH_VERSION_MAJOR < 9 |
| | const int myStudyId; |
| | #endif |
| |
|
| | std::list<SMESH_HypothesisPtr> hypoth; |
| | static SMESH_Gen* _mesh_gen; |
| | }; |
| |
|
| |
|
| | template<typename T> |
| | inline SMESH_HypothesisPtr FemMesh::createHypothesis(int hypId) |
| | { |
| | SMESH_Gen* myGen = getGenerator(); |
| | #if SMESH_VERSION_MAJOR >= 9 |
| | SMESH_HypothesisPtr hypo(new T(hypId, myGen)); |
| | #else |
| | |
| | SMESH_HypothesisPtr hypo(new T(hypId, myStudyId, myGen)); |
| | #endif |
| | return hypo; |
| | } |
| |
|
| | } |
| |
|
| |
|
| | #endif |
| |
|