00001 #include "ref.h"
00002 #include "refine.decl.h"
00003 #include "node.h"
00004 #include "messages.h"
00005
00006 extern CProxy_chunk mesh;
00007
00008
00009 void edgeRef::update(elemRef& oldval, elemRef& newval, int b)
00010 {
00011 mesh[cid].updateElement(idx, oldval, newval, b);
00012 }
00013
00014 elemRef edgeRef::getNbr(elemRef m)
00015 {
00016 refMsg *rm2;
00017 rm2 = mesh[cid].getNbr(idx, m);
00018 elemRef result((elemRef&)rm2->aRef);
00019 CkFreeMsg(rm2);
00020 return result;
00021 }
00022
00023 void edgeRef::remove()
00024 {
00025 mesh[cid].removeEdge(idx);
00026 }
00027
00028 int edgeRef::split(int *m, edgeRef *e_prime, int oIdx, int fIdx,
00029 elemRef requester, int *local, int *first,
00030 int *nullNbr)
00031 {
00032 splitOutMsg *som;
00033 int result;
00034 som = mesh[cid].split(idx, requester, oIdx, fIdx);
00035 *m = som->n;
00036 *e_prime = som->e;
00037 *local = som->local;
00038 *first = som->first;
00039 *nullNbr = som->nullNbr;
00040 result = som->result;
00041 CkFreeMsg(som);
00042 return result;
00043 }
00044
00045 void edgeRef::collapse(elemRef requester, int kIdx, int dIdx, elemRef kNbr,
00046 elemRef dNbr, edgeRef kEdge, edgeRef dEdge, node newN,
00047 double frac)
00048 {
00049 mesh[cid].collapse(idx, requester, kIdx, dIdx, kNbr, dNbr, kEdge,
00050 dEdge, newN, frac);
00051 }
00052
00053 int edgeRef::flipPrevent(elemRef requester, int kIdx, int dIdx, elemRef kNbr,
00054 elemRef dNbr, edgeRef kEdge, edgeRef dEdge, node newN)
00055 {
00056 splitOutMsg *som;
00057 int result;
00058 som = mesh[cid].flipPreventE(idx, requester, kIdx, dIdx, kNbr, dNbr, kEdge,
00059 dEdge, newN);
00060 result = som->result;
00061 CkFreeMsg(som);
00062 return result;
00063 }
00064
00065 int edgeRef::isPending(elemRef e)
00066 {
00067 intMsg *im;
00068 int result;
00069 im = mesh[cid].isPending(idx, e);
00070 result = im->anInt;
00071 CkFreeMsg(im);
00072 return result;
00073 }
00074
00075 int edgeRef::getBoundary()
00076 {
00077 intMsg *im;
00078 int result;
00079 im = mesh[cid].getBoundary(idx);
00080 result = im->anInt;
00081 CkFreeMsg(im);
00082 return result;
00083 }
00084
00085 void edgeRef::resetEdge()
00086 {
00087 mesh[cid].resetEdge(idx);
00088 }
00089
00090 void edgeRef::checkPending(elemRef e)
00091 {
00092 mesh[cid].checkPending(idx, e);
00093 }
00094
00095 void edgeRef::checkPending(elemRef e, elemRef ne)
00096 {
00097 mesh[cid].checkPending(idx, e, ne);
00098 }
00099
00100
00101 double elemRef::getArea()
00102 {
00103 doubleMsg *dm;
00104 double result;
00105 dm = mesh[cid].getArea(idx);
00106 result = dm->aDouble;
00107 CkFreeMsg(dm);
00108 return result;
00109 }
00110
00111 void elemRef::update(edgeRef& oldval, edgeRef& newval)
00112 {
00113 mesh[cid].updateElementEdge(idx, oldval, newval);
00114 }
00115
00116 void elemRef::setTargetArea(double ta)
00117 {
00118 mesh[cid].setTargetArea(idx, ta);
00119 }
00120
00121 void elemRef::resetTargetArea(double ta)
00122 {
00123 mesh[cid].resetTargetArea(idx, ta);
00124 }
00125
00126 void elemRef::remove()
00127 {
00128 mesh[cid].removeElement(idx);
00129 }
00130
00131
00132
00133
00134