aboutsummaryrefslogtreecommitdiff
path: root/doc/html/AmrGrid.html
blob: f0b5a82cc76e0072df0e13c803dd6e64cfc7f11e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
  <head>
    <title>AMR Grid Data Structure</title>
  </head>

  <body>
 
    <body bgcolor="#F0F0F0">
    <font face="arial,helvetica"><h1>AMR Grid Datastructure</h1></font>
      
      Common to all of the AMR readers is an <b>AmrGrid</b>
      informational datastructure.  This datastructure is <i>not</i>
      necessary for the <a href="AMRwriter.html">AMRwriter</a>.  
      This structure stores all of the
      AMR parameters related to the grid that enable you to determine
      where it should fit into the AMR hierarchy, the type of data
      that it stores and the rank, dimensions, and physical size of
      the grid.  It also has a pointer which can be used optionally 
      to store the grid data.<p>

	The structure has both a C and a C++ representation.  The only 
	difference between the two is that the C structure represents
	the datatype as an integer and the C++ version represents the
	datatype as an enum.  Since the C++ struct is inherited
	directly from the C version, the two interoperate
	seamlessly.<p>
<font face="arial,helvetica" color="#555588">
	  <h2>Datastructure Specification</h2>
	</font>
	
<table border=1><tr>
<td>
      	<font face="arial,helvetica" color="#885555"><b>C Datastructure</b></font>
</td>
<td>
	<font face="arial,helvetica" color="#885555"><b>C++ Datastructure</b></font>
</td>
</tr>
<tr><td>
<pre>
typedef struct AmrGrid {          
  int level;
  int maxlevel;
  int maxtime;
  int timestep;
  int persistence; 
  int rank;
  int dims[3];
  double delta[3];
  double origin[3];
  int timerefinement;
  int nbytes;
  int dataveclen;
  int datatype;
  void *data;
} AmrGrid;
</pre>
</td><td>
      <pre>
struct AmrGrid {
  // Members inherited from C AmrGrid 
  int level;
  int maxlevel;
  int maxtime;
  int timestep;
  int persistence; 
  int rank;
  int dims[3];
  double delta[3];
  double origin[3];
  int timerefinement;
  int nbytes;
  int dataveclen;
  void *data;
  // Members specific to C++ AmrGrid  
  IObase::DataType datatype;
};
</pre></td></tr></table>

	<font face="arial,helvetica" color="#555588">
	  <h2>Datastructure Member Descriptions</h2>
	</font>
<DL>
<DT><i>int</i> <b>level</b>
<DD>The level in the AMR hierarchy. Level 0 is the Top (least refined)
	  level.
<DT><i>int</i> <b>maxlevel</b>
<DD>The maximum number of levels in the AMR hierarchy for all
	  timesteps stored in this file.  Levels are numbered from 0
	  to maxlevel-1.
<DT><i>int</i> <b>maxtime</b>
<DD>Maximum timestep in the datafile.  This parameter is optional
	  <i>(and generally unused)</i> and will be removed from 
	  future releases.
<DT><i>int</i> <b>timestep</b>
<DD>This is the current integer timestep with respect to the finest
	  granularity timestep that can occur in the file.  It is not
	  necessarily uniform in time.  It simply delineates the order 
	  in which things change in the file.  It is a fundamental
	  parameter written by the <a href="AMRwriter.html">AMRwriter</a>.
<DT><i>int</i> <b>persistence</b>
<DD>This is the number of timesteps that the grid remains active from
	  the timestep that it is created.  Like the <b>timestep</b>
	  parameter, it can also be non-uniform.  It is an optional
	  parameter that is often automatically computed by the
	  AMRreader class from available data.
<DT><i>int</i> <b>rank</b>
<DD>The number of dimensions for the grid.  Currently you cannot mix
	  grids of different dimensions together (ie. a 2D grid cannot 
	  be embedded in a 3D grid), so if one grid is rank=3, then
	  all of the grids in the file must have the same rank.
<DT><i>int</i> <b>dims[3]</b>
<DD>The dimensions of the grid (only the first <i>rank</i> values of
	  this array will be filled).
<DT><i>double</i> <b>delta[3]</b>
<DD>The physical spacing between gridpoints.  This is actually
	  redundant information since the same information can be
	  inferred/computed from the <b>origin</b> and integer
	  refinement information.  It is there for convenience though
	  even though it is not as precise as the integer specification.
<DT><i>double</i> <b>origin[3]</b>
<DD>The physical origin (minimum extent in 3-space) of the grid.
<DT><i>int</i> <b>timerefinement</b>
<DD>The rate at which the grid steps at this level with respect to the 
	  topgrid.  This is an optional parameter and will likely be
	  dropped from future implementations of this system.
<DT><i>int</i> <b>nbytes</b>
<DD>Number of bytes of storage required for the grid data if it were loaded 
	  into memory..  This is useful for memory allocation/management.
<DT><i>int</i> <b>dataveclen</b>
<DD>The number of elements-per-point in the data.  For instance a
	  3D vector velocity field would have a dataveclen=3 for the i,j,k
	  direction of the vector components.  dataveclen=1 for all
	  scalar values like density and temperature.
	  Currently this is not
	  used, but will be in future implementations of the readers.
<DT><i>int/IObase::DataType</i> <b>datatype</b>
<DD>The type of the data as it is stored on disk.  This is represented 
	  as an <i>integer</i> for C and as an <i>enum</i> of type
	  <i>IObase::DataType</i> for C++.  The definitions for the
	  <a href="DataTypes.html">datatypes are defined
	    by the FlexIO libraries</a>.
	  Integer datatypes are implemented in <a href="src/IO.h">IO.h</a>
	  and the C++ <i>IObase::DataType</i> is implemented in 
	  <a href="src/IO.hh">IO.hh</a>.
 <DT><i>void *</i><b>data</b>
	<DD>Pointer to memory array storing the data.  This is NULL
	  if the data has not been loaded into memory.  So you can use 
	  this datastructure just to aquire information about the
	  grids and then load the data only when it is needed.
</DL>

	
	

    <hr>
    <address><a href="mailto:jshalf@ncsa.uiuc.edu"></a></address>
<!-- Created: Thu Jan 28 12:40:39 CST 1999 -->
<!-- hhmts start -->
Last modified: Thu Jan 28 17:14:34 CST 1999
<!-- hhmts end -->
  </body>
</html>