00001 00005 class FieldBob : public FieldWithPtValues 00006 00007 { 00008 int nx, ny, nz; 00009 unsigned char* data; 00010 00011 real min; 00012 real max; 00013 00014 real xmin, ymin, zmin; 00015 real dx, dy, dz; 00016 00017 void allocate (); 00018 void deallocate (); 00019 unsigned char real2char (real value, int numval); 00020 00021 public: 00022 00023 FieldBob (); 00024 ~FieldBob (); 00025 00026 bool redim (const FieldBob& f); 00027 bool redim 00028 ( 00029 int nx, 00030 int ny, 00031 int nz, 00032 real min, 00033 real max, 00034 real xmin, 00035 real ymin, 00036 real zmin, 00037 real dx, 00038 real dy, 00039 real dz 00040 ); 00041 00042 virtual bool ok () const; 00043 virtual void minmax (NUMT& min, NUMT& max, GridWithPts* grid =NULL) const; 00044 00045 virtual NUMT valuePt (const Ptv(real)& x, real t = DUMMY); 00046 00047 void operator = (const FieldLattice& fdfield); 00048 void operator = (const FieldFE& fdfield); 00049 00050 void writeToBobFile (const String& filename); 00051 00052 void put (real value, int i, int j, int k); 00053 00054 virtual NUMT& valuePoint (int point_no); 00055 virtual NUMT valuePoint (int point_no) const; 00056 virtual Ptv(real) getPt (int point_no) const; 00057 virtual int getNoPoints () const; 00058 virtual int getNoValues () const; 00059 virtual GridWithPts& getGridWithPts (); 00060 virtual const GridWithPts& getGridWithPts () const; 00061 virtual Vec(NUMT)& valuesVec(); 00062 virtual const Vec(NUMT)& valuesVec() const 00063 { return *(new Vec(NUMT) ((NUMT*) data, nx*ny*nz)); } 00064 00065 CLASS_INFO 00066 00067 VIRTUAL_CAST(FieldBob) 00068 }; 00069 00070 00071 00072 class FieldsBob : public virtual HandleId 00073 00074 { 00075 protected: 00076 00077 VecSimplest(Handle(FieldBob)) fesfvec; 00078 00079 public: 00080 00081 FieldsBob () {} 00082 00083 void redim (int nsf) 00084 { fesfvec.redim (nsf); } 00085 00086 FieldsBob (int nsf) 00087 { fesfvec.redim (nsf); } 00088 00089 FieldsBob (int nx, int ny, int nz, int nsf = 1); 00090 FieldsBob (const FieldBob& field); 00091 00092 ~FieldsBob () {} 00093 00094 FieldBob& operator () (int i) 00095 { return fesfvec(i ();) } 00096 00097 const FieldBob& operator () (int i) const 00098 { return fesfvec(i ();) } 00099 00100 void attach (const FieldBob& field, int i = 1) 00101 { fesfvec(i).rebind (field); } 00102 00103 int getNoFields () const { return fesfvec.size(); } 00104 00105 bool ok () const; 00106 00107 CLASS_INFO 00108 }; 00109 00110