00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // This library is free software; you can redistribute it and/or 00004 // modify it under the terms of the GNU Lesser General Public 00005 // License as published by the Free Software Foundation; either 00006 // version 2.1 of the License. 00007 // 00008 // This library is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 // Lesser General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU Lesser General Public 00014 // License along with this library; if not, write to the Free Software 00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00016 // 00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00018 // 00019 00020 // File : StdMeshers_ViscousLayers.hxx 00021 // Created : Wed Dec 1 15:15:34 2010 00022 // Author : Edward AGAPOV (eap) 00023 00024 #ifndef __StdMeshers_ViscousLayers_HXX__ 00025 #define __StdMeshers_ViscousLayers_HXX__ 00026 00027 #include "SMESH_StdMeshers.hxx" 00028 00029 #include "SMESH_Hypothesis.hxx" 00030 #include "SMESH_ProxyMesh.hxx" 00031 00032 #include <vector> 00033 00037 class STDMESHERS_EXPORT StdMeshers_ViscousLayers : public SMESH_Hypothesis 00038 { 00039 public: 00040 StdMeshers_ViscousLayers(int hypId, int studyId, SMESH_Gen* gen); 00041 00042 // Set faces to exclude from treatment 00043 void SetIgnoreFaces(const std::vector<int>& faceIds); 00044 std::vector<int> GetIgnoreFaces() const { return _ignoreFaceIds; } 00045 00046 // Set total thickness of layers of prisms 00047 void SetTotalThickness(double thickness); 00048 double GetTotalThickness() const { return _thickness; } 00049 00050 // Set number of layers of prisms 00051 void SetNumberLayers(int nb); 00052 int GetNumberLayers() const { return _nbLayers; } 00053 00054 // Set factor (>1.0) of growth of layer thickness towards inside of mesh 00055 void SetStretchFactor(double factor); 00056 double GetStretchFactor() const { return _stretchFactor; } 00057 00058 // Computes temporary 2D mesh to be used by 3D algorithm. 00059 // Return SMESH_ProxyMesh for each SOLID in theShape 00060 SMESH_ProxyMesh::Ptr Compute(SMESH_Mesh& theMesh, 00061 const TopoDS_Shape& theShape, 00062 const bool toMakeN2NMap=false) const; 00063 00064 virtual std::ostream & SaveTo(std::ostream & save); 00065 virtual std::istream & LoadFrom(std::istream & load); 00066 00075 virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); 00076 00081 virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0) 00082 { return false; } 00083 00084 static const char* GetHypType() { return "ViscousLayers"; } 00085 00086 private: 00087 00088 std::vector<int> _ignoreFaceIds; 00089 int _nbLayers; 00090 double _thickness; 00091 double _stretchFactor; 00092 }; 00093 00094 #endif