00001 00006 class StencilWeightFunc 00007 00008 { 00009 public: 00010 virtual NUMT userfunc(const Ptv(int)& index, 00011 const Ptv(int)& offset, int node_dof=0)=0; 00012 00013 }; 00014 00015 00030 class StencilWeight : public HandleId 00031 00032 { 00033 friend class Stencil; 00034 00035 protected: 00036 00037 00038 00039 00040 00041 00042 NUMT w; 00043 bool use_wf; 00044 bool activated_weight; 00045 00046 StencilWeightFunc* usrf; 00047 00048 Ptv(int) offset; 00049 int off1; 00050 int off2; 00051 int off3; 00052 00053 void setOffset (Ptv(int)& of); 00054 00055 00056 public: 00057 00058 StencilWeight (); 00059 StencilWeight (const StencilWeight& p); 00060 ~StencilWeight () { } 00061 00062 void getOffset (int& offset1) const { offset1 =off1;} 00063 void getOffset (int& offset1, int& offset2) const; 00064 void getOffset (int& offset1, int& offset2, int& offset3) const; 00065 void getOffset (Ptv(int)& off) const { off=offset; } 00066 00067 00068 void fill (NUMT val); 00069 void operator = (NUMT val) { fill(val); } 00070 00071 virtual void fill (StencilWeightFunc& f); 00072 virtual void operator = (StencilWeightFunc& f) { fill(f); } 00073 00074 void operator = (const StencilWeight& p); 00075 00076 NUMT eval (const Ptv(int)& index, int node_dof=0) const; 00077 00078 void activate () { activated_weight = true; } 00079 void deactivate () { activated_weight = false; } 00080 00081 bool empty () const; 00082 00083 friend Os& operator << (Os& os, const StencilWeight& ptd); 00084 friend Is& operator >> (Is& is, StencilWeight& ptd); 00085 00086 }; 00087 00088