00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef FIELD_BLOCK_H
00012 #define FIELD_BLOCK_H
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #define MAX_FNAME_SIZE 30
00028
00029
00030
00031 template<class T, unsigned Dim> class LField;
00032 template<class T, unsigned Dim, class Mesh, class Centering> class Field;
00033 template<unsigned Dim, class T> class UniformCartesian;
00034 template<unsigned Dim> class FieldLayout;
00035
00036
00037 template<class T, unsigned Dim,
00038 class Mesh=UniformCartesian<Dim,double>,
00039 class Centering=typename Mesh::DefaultCentering>
00040 class FieldBlock {
00041
00042 public:
00043
00044
00045 FieldBlock(char* fname, FieldLayout<Dim>& layout, unsigned numFields);
00046
00047
00048 FieldBlock(char* fname, FieldLayout<Dim>& layout);
00049
00050 ~FieldBlock(void) { }
00051
00052 int get_NumRecords(void) { return NumRecords; };
00053 int get_NumFields(void) { return NumFields; };
00054 void write(Field<T,Dim,Mesh,Centering>&f,
00055 unsigned varID, unsigned record = 0);
00056 void read (Field<T,Dim,Mesh,Centering>&f,
00057 unsigned varID, unsigned record = 0);
00058
00059 private:
00060
00061 char FName[MAX_FNAME_SIZE];
00062 FieldLayout<Dim>& Layout;
00063 unsigned NumFields;
00064 unsigned NumRecords;
00065
00066
00067 FieldBlock(const FieldBlock&) { };
00068 FieldBlock& operator=(const FieldBlock&) { return *this; }
00069
00070 };
00071
00072
00073 #include "Utility/FieldBlock.cpp"
00074
00075 #endif // FIELD_BLOCK_H
00076
00077
00078
00079
00080
00081