00001
00002
00003
00004
00005
00006
00007 #ifndef __CHARM_FEM_MUTIL_H
00008 #define __CHARM_FEM_MUTIL_H
00009
00010 #include "charm-api.h"
00011 #include "ckvector3d.h"
00012 #include "fem.h"
00013 #include "fem_mesh.h"
00014
00015 class femMeshModify;
00016 class chunkListMsg;
00017
00018 class FEM_MUtil {
00019 int idx;
00020 femMeshModify *mmod;
00021
00022 public:
00023 FEM_MUtil() {}
00024 FEM_MUtil(int i, femMeshModify *m);
00025 ~FEM_MUtil();
00026
00027 int getIdx() { return idx; }
00028
00029
00030
00031
00032 void getChunkNos(int entType, int entNo, int *numChunks, IDXL_Share ***chunks, int elemType=0);
00033 bool isShared(int index);
00034 void splitEntityAll(FEM_Mesh *m, int localIdx, int nBetween, int *between);
00035 void splitEntitySharing(FEM_Mesh *m, int localIdx, int nBetween, int *between, int numChunks, int *chunks);
00036 void splitEntityRemote(FEM_Mesh *m, int chk, int localIdx, int nBetween, int *between);
00037 void removeNodeAll(FEM_Mesh *m, int localIdx);
00038 void removeNodeRemote(FEM_Mesh *m, int chk, int sharedIdx);
00039 int exists_in_IDXL(FEM_Mesh *m, int localIdx, int chk, int type, int elemType=0);
00040
00041 int lookup_in_IDXL(FEM_Mesh *m, int sharedIdx, int fromChk, int type, int elemType=0);
00042 int getRemoteIdx(FEM_Mesh *m, int elementid, int elemtype);
00043
00044 void addGhostElementRemote(FEM_Mesh *m, int chk, int elemType, int numGhostIndices, int *ghostIndices, int numSharedIndices, int *sharedIndices, int connSize);
00045 chunkListMsg *getChunksSharingGhostNodeRemote(FEM_Mesh *m, int chk, int sharedIdx);
00046 void buildChunkToNodeTable(int *nodetype, int sharedcount, int ghostcount, int localcount, int *conn, int connSize, CkVec<int> ***allShared, int *numSharedChunks, CkVec<int> **allChunks, int ***sharedConn);
00047 void addElemRemote(FEM_Mesh *m, int chk, int elemtype, int connSize, int *conn, int numGhostIndex, int *ghostIndices);
00048 void removeGhostElementRemote(FEM_Mesh *m, int chk, int elementid, int elemtype, int numGhostIndex, int *ghostIndices, int numGhostRNIndex, int *ghostRNIndices, int numGhostREIndex, int *ghostREIndices, int numSharedIndex, int *sharedIndices);
00049 void removeElemRemote(FEM_Mesh *m, int chk, int elementid, int elemtype, int permanent);
00050 void removeGhostNodeRemote(FEM_Mesh *m, int fromChk, int sharedIdx);
00051 int Replace_node_local(FEM_Mesh *m, int oldIdx, int newIdx);
00052 void addToSharedList(FEM_Mesh *m, int fromChk, int sharedIdx);
00053 int eatIntoElement(int localIdx);
00054 int getLockOwner(int nodeId);
00055 bool knowsAbtNode(int chk, int nodeId);
00056 void UpdateGhostSend(int nodeId, int *chunkl, int numchunkl);
00057 void findGhostSend(int nodeId, int **chunkl, int *numchunkl);
00058
00059 void StructureTest(FEM_Mesh *m);
00060 int AreaTest(FEM_Mesh *m);
00061 int IdxlListTest(FEM_Mesh *m);
00062 void verifyIdxlListRemote(FEM_Mesh *m, int fromChk, int fsize, int type);
00063 int residualLockTest(FEM_Mesh *m);
00064
00065 void FEM_Print_n2n(FEM_Mesh *m, int nodeid);
00066 void FEM_Print_n2e(FEM_Mesh *m, int nodeid);
00067 void FEM_Print_e2n(FEM_Mesh *m, int eid);
00068 void FEM_Print_e2e(FEM_Mesh *m, int eid);
00069 void FEM_Print_coords(FEM_Mesh *m, int nodeid);
00070
00071 void idxllock(FEM_Mesh *m, int chk, int type);
00072 void idxlunlock(FEM_Mesh *m, int chk, int type);
00073 void idxllockLocal(FEM_Mesh *m, int toChk, int type);
00074 void idxlunlockLocal(FEM_Mesh *m, int toChk, int type);
00075
00076 void copyElemData(int etype, int elemid, int newEl);
00077 };
00078
00079 #endif