MeshKit
1.0
|
00001 #ifndef QPATCHREMESH_H 00002 #define QPATCHREMESH_H 00003 00004 #include "meshkit/Mesh.hpp" 00005 00006 namespace Jaal { 00007 struct RemeshTemplate { 00008 NodeSequence newnodes; 00009 FaceSequence newfaces; 00010 00011 void addNewElements( const NodeSequence &nnodes, const FaceSequence &nfaces) { 00012 size_t nSize; 00013 nSize = nnodes.size(); 00014 for (size_t i = 0; i < nSize; i++) 00015 newnodes.push_back(nnodes[i]); 00016 00017 nSize = nfaces.size(); 00018 for (size_t i = 0; i < nSize; i++) 00019 newfaces.push_back(nfaces[i]); 00020 } 00021 00022 void discard() { 00023 size_t nSize = newfaces.size(); 00024 for (size_t i = 0; i < nSize; i++) 00025 mesh->remove(newfaces[i]); 00026 00027 nSize = newnodes.size(); 00028 for (size_t i = 0; i < nSize; i++) 00029 mesh->remove(newnodes[i]); 00030 } 00031 00032 Mesh *mesh; 00033 }; 00034 00036 00037 struct QuadRemeshTemplate : public RemeshTemplate { 00038 int remesh(Mesh *mesh, 00039 NodeSequence &anodes, 00040 NodeSequence &bnodes, 00041 NodeSequence &cnodes, 00042 NodeSequence &dnodes); 00043 private: 00044 int remesh(); 00045 int nx, ny; 00046 NodeSequence boundnodes, qnodes; 00047 }; 00048 00050 00051 struct TriRemeshTemplate : public RemeshTemplate { 00052 int remesh(Mesh *mesh, NodeSequence &anodes, 00053 NodeSequence &bnodes, 00054 NodeSequence &cnodes, int *partition); 00055 private: 00056 QuadRemeshTemplate quadtemplate; 00057 int segments[3], partSegments[6]; 00058 00059 NodeSequence a1nodes, b1nodes; 00060 NodeSequence a2nodes, b2nodes; 00061 NodeSequence a3nodes, b3nodes; 00062 NodeSequence oa_nodes, ob_nodes, oc_nodes; 00063 }; 00064 00066 00067 struct PentaRemeshTemplate : public RemeshTemplate { 00068 int remesh(Mesh *mesh, 00069 NodeSequence &anodes, 00070 NodeSequence &bnodes, 00071 NodeSequence &cnodes, 00072 NodeSequence &dnodes, 00073 NodeSequence &enodes, 00074 int *partition); 00075 private: 00076 QuadRemeshTemplate quadtemplate; 00077 00078 int segments[5], partSegments[10]; 00079 NodeSequence a1nodes, b1nodes; 00080 NodeSequence a2nodes, b2nodes; 00081 NodeSequence a3nodes, b3nodes; 00082 NodeSequence a4nodes, b4nodes; 00083 NodeSequence a5nodes, b5nodes; 00084 NodeSequence oa_nodes, ob_nodes, oc_nodes, od_nodes, oe_nodes; 00085 }; 00086 00088 00089 struct CircleRemeshTemplate : public RemeshTemplate { 00090 int remesh(Mesh *mesh, NodeSequence &anodes); 00091 00092 }; 00093 } 00094 00095 #endif 00096