OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
FieldBlock.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /***************************************************************************
3  *
4  * The IPPL Framework
5  *
6  *
7  * Visit http://people.web.psi.ch/adelmann/ for more details
8  *
9  ***************************************************************************/
10 
11 #ifndef FIELD_BLOCK_H
12 #define FIELD_BLOCK_H
13 
14 // class FieldBlock
15 //
16 // The FieldBlock object is used to store the data from several Field
17 // variables in a single netcdf file. A record dimension is available to
18 // allow storage of field histories in the same netCDF file. Fields read
19 // and write to a netcdf file attached to the FieldBlock object. The write
20 // and read member functions take a single Field and require a Field
21 // Variable ID and record number to access data from the netCDF file. The
22 // record number is defaulted to zero for the case where there is only a
23 // single record.
24 //
25 // J.V.W. Reynders - ACL/LANL July 28, 1996
26 
27 #define MAX_FNAME_SIZE 30
28 
29 
30 // forward declarations
31 template<class T, unsigned Dim> class LField;
32 template<class T, unsigned Dim, class Mesh, class Centering> class Field;
33 template<unsigned Dim, class T> class UniformCartesian;
34 template<unsigned Dim> class FieldLayout;
35 
36 //----------------------------------------------------------------------
37 template<class T, unsigned Dim,
39  class Centering=typename Mesh::DefaultCentering>
40 class FieldBlock {
41 
42 public:
43 
44  // make a FieldBlock for writing
45  FieldBlock(char* fname, FieldLayout<Dim>& layout, unsigned numFields);
46 
47  // make a FieldBlock for reading
48  FieldBlock(char* fname, FieldLayout<Dim>& layout);
49 
50  ~FieldBlock(void) { }
51 
52  int get_NumRecords(void) { return NumRecords; };
53  int get_NumFields(void) { return NumFields; };
55  unsigned varID, unsigned record = 0);
57  unsigned varID, unsigned record = 0);
58 
59 private:
60 
63  unsigned NumFields;
64  unsigned NumRecords;
65 
66  // don't allow copy or assign
67  FieldBlock(const FieldBlock&) { };
68  FieldBlock& operator=(const FieldBlock&) { return *this; }
69 
70 };
71 //----------------------------------------------------------------------
72 
73 #include "Utility/FieldBlock.hpp"
74 
75 #endif // FIELD_BLOCK_H
76 
77 /***************************************************************************
78  * $RCSfile: FieldBlock.h,v $ $Author: adelmann $
79  * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:33 $
80  * IPPL_VERSION_ID: $Id: FieldBlock.h,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $
81  ***************************************************************************/
FieldBlock(char *fname, FieldLayout< Dim > &layout, unsigned numFields)
Definition: FieldBlock.hpp:52
int get_NumFields(void)
Definition: FieldBlock.h:53
Definition: Mesh.h:35
~FieldBlock(void)
Definition: FieldBlock.h:50
Definition: rbendmap.h:8
Definition: FFT.h:31
char FName[30]
Definition: FieldBlock.h:61
#define MAX_FNAME_SIZE
Definition: FieldBlock.h:27
FieldBlock(const FieldBlock &)
Definition: FieldBlock.h:67
FieldLayout< Dim > & Layout
Definition: FieldBlock.h:62
unsigned NumRecords
Definition: FieldBlock.h:64
unsigned NumFields
Definition: FieldBlock.h:63
void read(Field< T, Dim, Mesh, Centering > &f, unsigned varID, unsigned record=0)
Definition: FieldBlock.hpp:312
void write(Field< T, Dim, Mesh, Centering > &f, unsigned varID, unsigned record=0)
Definition: FieldBlock.hpp:168
FieldBlock & operator=(const FieldBlock &)
Definition: FieldBlock.h:68
const unsigned Dim
int get_NumRecords(void)
Definition: FieldBlock.h:52