meshconstructor.h

Go to the documentation of this file.
00001 
00006 #ifndef MESHCONSTRUCTOR_H
00007 #define MESHCONSTRUCTOR_H
00008 
00009 #include "util.h"
00010 #include "cell.h"
00011 
00012 /* Predeclaration of Classes */
00013 class Simulation;
00014 class BezierMesh;
00015 class BoundaryMesh;
00016 class ConformalMesher;
00017 
00026 class MeshConstructor {
00027     private:
00028         BezierMesh *bezier;
00029         BoundaryMesh *bdry;
00030         ConformalMesher *mesher;
00031 
00032         /* This fucntion calculates deboor points and knot values
00033          * given a set of points on the geometry and an initial deboor
00034          */
00035         BoundaryEdge* create_edge(BoundaryVertex *v0,
00036                                   BoundaryVertex *v1,
00037                                   const std::vector<Point2D> &geometry_pts,
00038                                   const Point2D &initial);
00039 
00040 
00041         double spiral_derivative(Radians phi, double r0, Radians delta, Radians start);
00042     public:
00043         MeshConstructor(BezierMesh* _bezier_mesh, BoundaryMesh* _bdry_mesh);
00044         ~MeshConstructor();
00045 
00046         void add_remove_point(const Point2D &p);
00047         int mesh(bool refine); /* angle set on boundary facets */
00048         void remove_small_angles();
00049 
00050         BoundaryVertex* add_vertex();
00051         BoundaryVertex* add_vertex(const Point2D &p);
00052 
00053         BoundaryFace*
00054         add_face(const std::vector<BoundaryEdge*> &edges, const Point2D &point);
00055 
00056         /* uses v0->cp and v1->cp as endpoints */
00057         BoundaryEdge*
00058         add_line(BoundaryVertex* v0,
00059                  BoundaryVertex* v1,
00060                  int segments);
00061 
00062         /* uses v0->cp as first endpoint and p1 as second, moves v1 to p1 */
00063         BoundaryEdge*
00064         add_line(BoundaryVertex* v0,
00065                  BoundaryVertex* v1,
00066                  const Point2D &p1,
00067                  int segments);
00068 
00069         /* uses p0 and p1 as endpoints moves v0 to p0 and v1 to p1 */
00070         BoundaryEdge*
00071         add_line(BoundaryVertex* v0,
00072                  BoundaryVertex* v1,
00073                  const Point2D &p0,
00074                  const Point2D &p1,
00075                  int segments);
00076 
00077         /* Repositions v0 to be start radians around circle*/
00078         BoundaryEdge*
00079         add_circle(BoundaryVertex *v0,
00080                    const Point2D &center,
00081                    double radius,
00082                    Radians start,
00083                    int segments);
00084 
00085         /* Repositions both v0 and v1 to be start and stop radians
00086            around circle respectivly */
00087         BoundaryEdge*
00088         add_arc(BoundaryVertex *v0,
00089                 BoundaryVertex *v1,
00090                 const Point2D &center,
00091                 double radius,
00092                 Radians start,
00093                 Radians stop,
00094                 int segments);
00095 
00096         /* Repositions both v0 and v1 */
00097         BoundaryEdge*
00098         add_spiral( BoundaryVertex *v0,
00099                     BoundaryVertex *v1,
00100                     const Point2D &center,
00101                     double divergence,
00102                     double start_radius,
00103                     Radians start,
00104                     Radians stop,
00105                     int segments);
00106 
00107         /* Repositions both v0 and v1 */
00108         BoundaryEdge*
00109         add_bezier(BoundaryVertex *v0,
00110                    BoundaryVertex *v1,
00111                    const Point2D &p0,
00112                    const Point2D &p1,
00113                    const Point2D &p2 );
00114 
00115         /*
00116         BoundaryEdge*
00117         add_elipse(BoundaryVertex *v0,
00118                    const Point2D &center,
00119                    const Point2D &axis1,
00120                    const Point2D &axis2,
00121                    int segments);
00122         */
00123 
00124     void
00125         add_box_void(const Point2D &p0,
00126                 const Point2D &p1,
00127                 const Point2D &p2,
00128                 const Point2D &p3,
00129                 int segments);
00130  protected:
00131 
00132         std::vector<BoundaryEdge*>
00133         add_box(const Point2D &p0,
00134                 const Point2D &p1,
00135                 const Point2D &p2,
00136                 const Point2D &p3,
00137                 int segments);
00138 
00139 
00140         void
00141         add_red_blood_cells_box(int num,
00142                                 const Point2D &box_top,
00143                                 const Point2D &box_bot,
00144                                 int cell_type,
00145                                 double cell_size,
00146                                 std::vector<BoundaryVertex*> &verts,
00147                                 std::vector<BoundaryEdge*> &cells,
00148                                 std::vector<Point2D> &centers);
00149         void
00150         add_red_blood_cells_triangle(int num,
00151                                      const Point2D &p1,
00152                                      const Point2D &p2,
00153                                      const Point2D &p3,
00154                                      int cell_type,
00155                                      double cell_size,
00156                                      std::vector<BoundaryVertex*> &verts,
00157                                      std::vector<BoundaryEdge*> &cells,
00158                                      std::vector<Point2D> &centers);
00159         void
00160         insert_cells(int num,
00161                      std::vector<Point2D> initial_cells,
00162                      int cell_type,
00163                      double cell_size,
00164                      std::vector<BoundaryVertex*> &verts,
00165                      std::vector<BoundaryEdge*> &cells,
00166                      std::vector<Point2D> &centers);
00167 
00168 };
00169 
00170 #endif /* MESHCONSTRUCTOR_H */

Generated on Mon May 24 09:53:30 2010 for TUMBLE by  doxygen 1.5.2