00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 #ifndef __ParFUM_Adapt_H
00010 #define __ParFUM_Adapt_H
00011 
00012 class femMeshModify;
00013 
00015 
00018 class FEM_Adapt {
00019  protected:
00021   FEM_Mesh *theMesh;
00023   femMeshModify *theMod;
00024   
00026   int check_orientation(int e1, int e3, int n, int n1, int n2);
00027 
00028  public:
00030   FEM_Adapt() {
00031     theMesh = NULL; theMod = NULL;
00032   }
00034   FEM_Adapt(FEM_Mesh *m, femMeshModify *fm) { 
00035     theMesh = m; theMod = fm; 
00036   }
00038   FEM_Adapt(femMeshModify *fm) { theMesh = NULL; theMod = fm; }
00040   void FEM_AdaptSetMesh(FEM_Mesh *m) {theMesh = m;}
00042   void pup(PUP::er &p) {
00043   }
00044 
00046   int get_edge_index(int local_node1, int local_node2);
00048   int find_local_node_index(int e, int n);
00049 
00051   int findAdjData(int n1, int n2, int *e1, int *e2, int *e1n1, int *e1n2, 
00052            int *e1n3, int *e2n1, int *e2n2, int *e2n3, int *n3, 
00053            int *n4);
00055   int e2n_getNot(int e, int n1, int n2);
00057   int n2e_exists(int n, int e);
00059   int findElementWithNodes(int n1, int n2, int n3);
00060 
00062   int getSharedNodeIdxl(int n, int chk);
00064   int getGhostNodeIdxl(int n, int chk);
00066   int getGhostElementIdxl(int e, int chk);
00067 
00069   void printAdjacencies(int *nodes, int numNodes, int *elems, int numElems);
00070 
00072   bool isFixedNode(int n1);
00074   bool isCorner(int n1);
00076   bool isEdgeBoundary(int n1, int n2);
00077 
00079 
00084   int edge_flip_help(int e1, int e2, int n1, int n2, int e1_n1, 
00085                  int e1_n2, int e1_n3, int n3, int n4,int *locknodes);
00086   
00088 
00091   int edge_bisect_help(int e1, int e2, int n1, int n2, int e1_n1, 
00092                    int e1_n2, int e1_n3, int e2_n1, int e2_n2, 
00093                    int e2_n3, int n3, int n4);
00094 
00096 
00101   int vertex_remove_help(int e1, int e2, int n1, int n2, int e1_n1, 
00102                  int e1_n2, int e1_n3, int e2_n1, int e2_n2, 
00103                  int e2_n3, int n3, int n4, int n5);
00104 
00106 
00111   int vertex_split(int n, int n1, int n2);
00113   int vertex_split_help(int n, int n1, int n2, int e1, int e3);
00114 };
00115 
00116 
00118 
00123 class FEM_AdaptL : public FEM_Adapt {
00124  public:
00126   FEM_AdaptL() {
00127     theMesh = NULL; theMod = NULL;
00128   }
00130   FEM_AdaptL(FEM_Mesh *m, femMeshModify *fm) { theMesh = m; theMod = fm; }
00132   FEM_AdaptL(femMeshModify *fm) { theMesh = NULL; theMod = fm; }
00134   void FEM_AdaptLSetMesh(FEM_Mesh *m) {theMesh = m;}
00136   void pup(PUP::er &p) {
00137   }
00138 
00140   int lockNodes(int *gotlocks, int *lockrnodes, int numRNodes, int *lockwnodes, int numWNodes);
00142   int unlockNodes(int *gotlocks, int *lockrnodes, int numRNodes, int *lockwnodes, int numWNodes);
00143 
00145   int edge_flip(int n1, int n2);
00147   int edge_bisect(int n1, int n2);
00149   int vertex_remove(int n1, int n2);
00151 
00156   int edge_contraction(int n1, int n2);
00158   int edge_contraction_help(int *e1P, int *e2P, int n1, int n2, int e1_n1, 
00159                     int e1_n2, int e1_n3, int e2_n1, int e2_n2,
00160                     int e2_n3, int n3, int n4);
00161 
00163   int eatIntoElement(int e, bool aggressive_node_removal=false);
00165   void residualLockTest();
00167   void unlockAll();
00169   void structureTest();
00170 };
00171 
00172 #endif
00173