00001 00007 #ifndef CHARM_TRANSFER_H 00008 #define CHARM_TRANSFER_H 00009 00010 #include "GenericElement.h" 00011 00012 #include "tetmesh.h" 00013 #include "prismMesh.h" 00014 #include "triSurfMesh.h" 00015 00017 double getSharedVolumeTets(const ConcreteElement &A,const ConcreteElement &B); 00018 00020 double getSharedArea(const ConcreteElement &A,const ConcreteElement &B); 00021 00024 double getSharedVolume(int s,const TetMesh &srcMesh, 00025 int d,const TetMesh &destMesh); 00026 00034 void transferCells(int valsPerTet, 00035 double *srcVals,const TetMesh &srcMesh, 00036 double *destVals,const TetMesh &destMesh); 00037 00041 class TetMeshElement : public ConcreteElement { 00042 int s; const TetMesh &srcMesh; 00043 const int *conn; 00044 public: 00045 TetMeshElement(int s_,const TetMesh &srcMesh_) 00046 :s(s_), srcMesh(srcMesh_) { conn=srcMesh.getTet(s); } 00047 00049 virtual CPoint getNodeLocation(int i) const { 00050 return srcMesh.getPoint(conn[i]); 00051 } 00052 }; 00053 00057 class Triangle3DElement : public ConcreteElement { 00058 int s; const TriangleSurfaceMesh &srcMesh; 00059 const int *conn; 00060 public: 00061 Triangle3DElement(int s_,const TriangleSurfaceMesh &srcMesh_) 00062 :s(s_), srcMesh(srcMesh_) { conn=srcMesh.getTriangle(s); } 00063 00065 virtual CPoint getNodeLocation(int i) const { 00066 return srcMesh.getPoint(conn[i]); 00067 } 00068 }; 00069 00070 #endif