Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

MeshRefinement.h

Go to the documentation of this file.
00001 // Copyright (C) 2003 Johan Hoffman and Anders Logg.
00002 // Licensed under the GNU GPL Version
00003 
00004 #ifndef __MESH_REFINEMENT_H
00005 #define __MESH_REFINEMENT_H
00006 
00007 #include <dolfin/List.h>
00008 
00009 namespace dolfin {
00010 
00011   class Mesh;
00012   class Cell;
00013   class MeshHierarchy;
00014 
00016   
00017   class MeshRefinement {
00018   public:
00019 
00021     static void refine(MeshHierarchy& meshes);
00022     
00023   protected:
00024     
00025     //--- Algorithms working on the whole mesh hierarchy ---
00026 
00027     // Propagate markers for leaf elements
00028     static void propagateLeafMarks(MeshHierarchy& meshes);
00029     
00031     static void updateEdgeMarks(MeshHierarchy& meshes);
00032 
00033     // The global algorithm
00034     static void globalRefinement(MeshHierarchy& meshes);
00035 
00036     // Check consistency of markers before refinement
00037     static void checkPreCondition(MeshHierarchy& meshes);
00038 
00039     // Check consistency of markers after refinement
00040     static void checkPostCondition(MeshHierarchy& meshes);
00041 
00042     // Check object numbering
00043     static void checkNumbering(MeshHierarchy& meshes);
00044 
00045     //--- Algorithms working on the mesh on a given level ---
00046     
00048     static void updateEdgeMarks(Mesh& mesh);
00049 
00050     // Evaluate and adjust marks for a mesh
00051     static void evaluateMarks(Mesh& mesh);
00052 
00053     // Perform the green closer on a mesh
00054     static void closeMesh(Mesh& mesh);
00055 
00056     // Refine a mesh according to marks
00057     static void refineMesh(Mesh& mesh);
00058 
00059     // Unrefine a mesh according to marks
00060     static void unrefineMesh(Mesh& mesh, const MeshHierarchy& meshes);
00061 
00063     
00064     // Close a cell
00065     static void closeCell(Cell& cell, List<Cell*>& cells, Array<bool>& closed);
00066 
00068     static bool checkRule(Cell& cell, int no_marked_edges);
00069     
00070     // Refine cell according to refinement rule
00071     static void refine(Cell& cell, Mesh& mesh);
00072     
00074 
00076     static void updateEdgeMarks(Cell& cell);
00077     
00079     static bool childrenMarkedForCoarsening(Cell& cell);
00080 
00082     static bool edgeOfChildMarkedForRefinement(Cell& cell);
00083 
00085     static bool edgeMarkedByOther(Cell& cell);
00086 
00088     static void sortNodes(const Cell& cell, Array<Node*>& nodes);
00089     
00091     static int noMarkedEdges(const Cell& cell);
00092 
00094     static int nodeNumber(const Node& node, const Cell& cell);
00095 
00097     static bool leaf(Cell& cell);
00098     
00100     static bool okToRefine(Cell& cell);
00101 
00103     static Node& createNode(Node& node, Mesh& mesh, const Cell& cell);
00104     
00106     static Node& createNode(const Point& p, Mesh& mesh, const Cell& cell);
00107     
00109     static void removeNode(Node& node, Mesh& mesh);
00110 
00112     static void removeCell(Cell& cell, Mesh& mesh);
00113 
00115     static Cell& createChildCopy(Cell& cell, Mesh& mesh);
00116 
00117   };
00118 
00119 }
00120 
00121 #endif


Documentation automatically generated with Doxygen on 10 Sep 2004.