00001 /* File: interpolate.h 00002 * Authors: Terry Wilmarth, Nilesh Choudhury 00003 * 00004 */ 00005 00006 #ifndef __ParFUM_INTERPOLATE_H 00007 #define __ParFUM_INTERPOLATE_H 00008 00009 class femMeshModify; 00010 00012 00018 class FEM_Interpolate { 00020 FEM_Mesh *theMesh; 00022 femMeshModify *theMod; 00023 00024 public: 00026 typedef struct { 00027 int n; 00028 int nodes[8]; 00029 int dim; 00030 int nNbrs; 00031 double coord[3]; 00032 double frac; 00033 bool addNode; 00034 } NodalArgs; 00036 typedef struct { 00037 int e; 00038 int oldElement; 00039 int elType; 00040 } ElementArgs; 00042 typedef void (* FEM_InterpolateNodeFn)(NodalArgs, FEM_Mesh *); 00044 typedef void (* FEM_InterpolateElementFn)(ElementArgs); 00045 00047 FEM_InterpolateNodeFn nodeEdgeFnPtr, nodeFaceFnPtr, nodeElementFnPtr, nodeCopyFnPtr; 00049 FEM_InterpolateElementFn elemCopyFnPtr, elemNodeFnPtr; 00050 00051 public: 00053 FEM_Interpolate() { 00054 nodeEdgeFnPtr = nodeFaceFnPtr = nodeElementFnPtr = nodeCopyFnPtr = NULL; 00055 elemCopyFnPtr = elemNodeFnPtr = NULL; 00056 theMesh = NULL; 00057 theMod = NULL; 00058 } 00060 FEM_Interpolate(FEM_Mesh *m) { 00061 nodeEdgeFnPtr = nodeFaceFnPtr = nodeElementFnPtr = nodeCopyFnPtr = NULL; 00062 elemCopyFnPtr = elemNodeFnPtr = NULL; 00063 theMesh = m; 00064 theMod = NULL; 00065 } 00067 FEM_Interpolate(FEM_Mesh *m, femMeshModify *fm) { 00068 nodeEdgeFnPtr = nodeFaceFnPtr = nodeElementFnPtr = nodeCopyFnPtr = NULL; 00069 elemCopyFnPtr = elemNodeFnPtr = NULL; 00070 theMesh = m; 00071 theMod = fm; 00072 } 00074 FEM_Interpolate(femMeshModify *fm) { 00075 nodeEdgeFnPtr = nodeFaceFnPtr = nodeElementFnPtr = nodeCopyFnPtr = NULL; 00076 elemCopyFnPtr = elemNodeFnPtr = NULL; 00077 theMesh = NULL; 00078 theMod = fm; 00079 } 00081 void pup(PUP::er &p) { 00082 //p|theMesh; 00083 //p|theMod; 00084 } 00086 void FEM_InterpolateSetMesh(FEM_Mesh *m) { theMesh = m; } 00087 00091 00092 void FEM_SetInterpolateNodeEdgeFnPtr(FEM_InterpolateNodeFn fnPtr) { 00093 nodeEdgeFnPtr = fnPtr; 00094 } 00096 void FEM_SetInterpolateNodeFaceFnPtr(FEM_InterpolateNodeFn fnPtr) { 00097 nodeFaceFnPtr = fnPtr; 00098 } 00100 void FEM_SetInterpolateNodeElementFnPtr(FEM_InterpolateNodeFn fnPtr) { 00101 nodeElementFnPtr = fnPtr; 00102 } 00104 void FEM_SetInterpolateCopyAttributesFnPtr(FEM_InterpolateNodeFn fnPtr) { 00105 nodeCopyFnPtr = fnPtr; 00106 } 00108 void FEM_SetInterpolateElementCopyFnPtr(FEM_InterpolateElementFn fnPtr) { 00109 elemCopyFnPtr = fnPtr; 00110 } 00112 void FEM_SetInterpolateElementNodeFnPtr(FEM_InterpolateElementFn fnPtr) { 00113 elemNodeFnPtr = fnPtr; 00114 } 00116 void FEM_ResetInterpolateNodeEdgeFnPtr() { nodeEdgeFnPtr = NULL; } 00118 void FEM_ResetInterpolateNodeFaceFnPtr() { nodeFaceFnPtr = NULL; } 00120 void FEM_ResetInterpolateNodeElementFnPtr() { nodeElementFnPtr = NULL; } 00122 void FEM_ResetInterpolateElementCopyFnPtr() { elemCopyFnPtr = NULL; } 00124 void FEM_ResetInterpolateElementNodeFnPtr() { elemNodeFnPtr = NULL; } 00126 void FEM_ReetInterpolateCopyAttributesFnPtr() { nodeCopyFnPtr = NULL; } 00127 00128 // Nodal data 00130 virtual void FEM_InterpolateNodeOnEdge(NodalArgs args); 00132 virtual void FEM_InterpolateNodeOnFace(NodalArgs args); 00134 virtual void FEM_InterpolateNodeInElement(NodalArgs args); 00135 00137 virtual void FEM_InterpolateElementCopy(ElementArgs args); 00139 virtual void FEM_InterpolateElementFromNodes(ElementArgs args); 00141 virtual void FEM_InterpolateElementToNodes(int e); 00142 00144 virtual void FEM_InterpolateCopyAttributes(int oldnode, int newnode); 00145 }; 00146 00147 // End interpolate.h 00148 00149 #endif