MeshKit
1.0
|
00001 #ifndef MESHKIT_PostBL_HPP 00002 #define MESHKIT_PostBL_HPP 00003 00004 #include <cassert> 00005 #include <string> 00006 #include <vector> 00007 #include <set> 00008 #include <math.h> 00009 #include <iomanip> 00010 00011 #include "meshkit/Types.hpp" 00012 #include "meshkit/Error.hpp" 00013 #include "meshkit/MeshScheme.hpp" 00014 #include "meshkit/ModelEnt.hpp" 00015 #include "meshkit/MKCore.hpp" 00016 #include "meshkit/SizingFunction.hpp" 00017 #include "meshkit/RegisterMeshOp.hpp" 00018 00019 #include "meshkit/LocalSet.hpp" 00020 #include "meshkit/LocalTag.hpp" 00021 #include "meshkit/Matrix.hpp" 00022 00023 #include "meshkit/iMesh.hpp" 00024 #include "meshkit/iGeom.hpp" 00025 #include "MBCN.h" 00026 00027 #include "meshkit/SimpleArray.hpp" 00028 #include "meshkit/parser.hpp" 00029 #include "meshkit/clock.hpp" 00030 #include "meshkit/mstream.hpp" 00031 00032 #include "MBiMesh.hpp" 00033 #include "moab/Interface.hpp" 00034 #include "moab/Range.hpp" 00035 #include "moab/CartVect.hpp" 00036 00037 00038 #include "moab/Skinner.hpp" 00039 #include "moab/AdaptiveKDTree.hpp" 00040 #include "moab/Matrix3.hpp" 00041 00060 namespace MeshKit { 00061 00062 #define DEFAULT_TEST_POSTBL "test_postbl.inp" 00063 00064 class MKCore; 00065 00066 class PostBL : public MeshScheme 00067 { 00068 public: 00069 /* \brief Constructor 00070 * 00071 * Create a new PostBL instance 00072 * \param impl the iGeom instance handle for the Geom 00073 */ 00074 PostBL(MKCore *mk, const MEntVector &me_vec); 00075 00076 /* \brief Destructor 00077 */ 00078 virtual ~PostBL(); 00079 00081 static const char* name(); 00082 00087 static bool can_mesh(iBase_EntityType dim); 00088 00095 static bool can_mesh(ModelEnt *me); 00096 00100 static const moab::EntityType* output_types(); 00101 00105 virtual const moab::EntityType* mesh_types_arr() const; 00106 00110 virtual bool add_modelent(ModelEnt *model_ent); 00111 00113 virtual void setup_this(); 00114 00116 virtual void execute_this(); 00117 00118 00121 void Algo2 (); 00122 00127 void PrepareIO (int argc, char *argv[], std::string TestDir); 00128 00133 void get_normal_quad (std::vector<moab::EntityHandle>conn, moab::CartVect &v) ; 00134 00139 void get_normal_edge (std::vector<moab::EntityHandle>conn, moab::CartVect AB, moab::CartVect &v); 00140 00146 void get_det_jacobian (std::vector<moab::EntityHandle> conn, int offset, double &detJ); 00147 00153 void find_min_edge_length (moab::Range, moab::EntityHandle, moab::Range, double &e_len); 00154 00155 private: 00157 iGeom *igeom; 00158 00160 iMesh *imesh; 00161 00163 moab::Interface *mb; 00164 00165 // ! parser related 00166 bool debug, hybrid, check_bl_edge_length; 00167 // !! file Input 00168 std::ifstream m_FileInput; 00169 mstream m_LogFile; 00170 std::string szInputString; 00171 std::string szComment; 00172 int MAXCHARS, m_nLineNumber; 00173 00174 // ! variables to parse 00175 std::string m_InputFile, m_MeshFile, m_OutFile, m_LogName, m_MeshType; 00176 int m_SurfId, m_NeumannSet, m_Material, m_HConn; 00177 double m_Thickness, m_MinEdgeLength; 00178 int m_Intervals, m_JacCalls, tri_sch, fixmat; 00179 double m_Bias, m_JLo, m_JHi; 00180 // ! variable for hex and tet meshes 00181 int m_Conn, m_BElemNodes; 00182 int m_GD, m_BLDim; 00183 std::string m_Card; 00184 int err; 00185 00186 // ! error handlers 00187 enum ErrorStates { INVALIDINPUT}; 00188 void IOErrorHandler (ErrorStates) const; 00189 }; 00190 00191 inline const char* PostBL::name() 00192 { 00193 return "PostBL"; 00194 } 00195 00196 inline bool PostBL::can_mesh(iBase_EntityType) 00197 { 00198 return false; 00199 } 00200 00201 inline bool PostBL::can_mesh(ModelEnt *) 00202 { 00203 return true; 00204 } 00205 00206 inline const moab::EntityType* PostBL::mesh_types_arr() const 00207 { 00208 return output_types(); 00209 } 00210 00211 } // namespace MeshKit 00212 #endif