FemMesh.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) Jürgen Riegel          (juergen.riegel@web.de) 2009     *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This library is free software; you can redistribute it and/or         *
00007  *   modify it under the terms of the GNU Library General Public           *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2 of the License, or (at your option) any later version.      *
00010  *                                                                         *
00011  *   This library  is distributed in the hope that it will be useful,      *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Library General Public License for more details.                  *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Library General Public     *
00017  *   License along with this library; see the file COPYING.LIB. If not,    *
00018  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00019  *   Suite 330, Boston, MA  02111-1307, USA                                *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 
00024 #ifndef FEM_FEMMESH_H
00025 #define FEM_FEMMESH_H
00026 
00027 #include <App/ComplexGeoData.h>
00028 #include <Base/Placement.h>
00029 
00030 #include <vector>
00031 #include <list>
00032 #include <boost/shared_ptr.hpp>
00033 
00034 class SMESH_Gen;
00035 class SMESH_Mesh;
00036 class SMESH_Hypothesis;
00037 class TopoDS_Shape;
00038 
00039 namespace Fem
00040 {
00041 
00042 typedef boost::shared_ptr<SMESH_Hypothesis> SMESH_HypothesisPtr;
00043 
00046 class AppFemExport FemMesh : public Data::ComplexGeoData
00047 {
00048     TYPESYSTEM_HEADER();
00049 
00050 public:
00051     FemMesh();
00052     FemMesh(const FemMesh&);
00053     ~FemMesh();
00054 
00055     FemMesh &operator=(const FemMesh&);
00056     const SMESH_Mesh* getSMesh() const;
00057     SMESH_Mesh* getSMesh();
00058     SMESH_Gen * getGenerator();
00059     void addHypothesis(const TopoDS_Shape & aSubShape, SMESH_HypothesisPtr hyp);
00060     void setStanardHypotheses();
00061     void compute();
00062 
00063     // from base class
00064     virtual unsigned int getMemSize (void) const;
00065     virtual void Save (Base::Writer &/*writer*/) const;
00066     virtual void Restore(Base::XMLReader &/*reader*/);
00067     void SaveDocFile (Base::Writer &writer) const;
00068     void RestoreDocFile(Base::Reader &reader);
00069 
00076     virtual std::vector<const char*> getElementTypes(void) const;
00077     virtual unsigned long countSubElements(const char* Type) const;
00079     virtual Data::Segment* getSubElement(const char* Type, unsigned long) const;
00081 
00084 
00085     void setTransform(const Base::Matrix4D& rclTrf);
00087     Base::Matrix4D getTransform(void) const;
00089     Base::BoundBox3d getBoundBox(void)const;
00091 
00094 
00095     void transformGeometry(const Base::Matrix4D &rclMat);
00097 
00099     void read(const char *FileName);
00100     void write(const char *FileName) const;
00101     void writeABAQUS(const std::string &Filename, Base::Placement* = 0) const;
00102 
00103 private:
00104     void copyMeshData(const FemMesh&);
00105     void readNastran(const std::string &Filename);
00106 
00107 private:
00108     SMESH_Gen  *myGen;
00109     SMESH_Mesh *myMesh;
00110 
00111     std::list<SMESH_HypothesisPtr> hypoth;
00112 };
00113 
00114 } //namespace Part
00115 
00116 
00117 #endif // FEM_FEMMESH_H

Generated on Wed Nov 23 19:00:13 2011 for FreeCAD by  doxygen 1.6.1