~chaffra/+junk/trilinos

« back to all changes in this revision

Viewing changes to packages/pamgen/doc/sand_report/pamgen_mesh.tex

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Johannes Ring
  • Date: 2009-12-13 12:53:22 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20091213125322-in0nrdjc55deqsw9
Tags: 10.0.3.dfsg-1
[Christophe Prud'homme]
* New upstream release

[Johannes Ring]
* debian/patches/libname.patch: Add prefix 'libtrilinos_' to all
  libraries. 
* debian/patches/soname.patch: Add soversion to libraries.
* debian/watch: Update download URL.
* debian/control:
  - Remove python-numeric from Build-Depends (virtual package).
  - Remove automake and autotools from Build-Depends and add cmake to
    reflect switch to CMake.
  - Add python-support to Build-Depends.
* debian/rules: 
  - Cleanup and updates for switch to CMake.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
 
 
3
\clearpage
 
4
\section{Capabilities}\label{sec:caps}
 
5
The capabilities of \textsc{pamgen} are best understood by studying Section ~\ref{sec:specifying_a_mesh}, which documents in detail the instructions available for specifying a mesh. This section provides a brief overview of the library's capabilities. \textsc{pamgen} will be distributed as part of the \textsc{Trilinos} package of matrix and finite element tools.
 
6
 
 
7
\subsection{Dimensions}
 
8
\textsc{pamgen} can create both two and three dimensional meshes. It creates quadrilateral finite element meshes if two dimensions are specified, and it creates hexahedral finite element meshes if three dimensions are specified. For two dimensional quadrilateral meshes the Z component of nodal coordinates is not supplied.
 
9
 
 
10
\subsection{Mesh Geometries}
 
11
 
 
12
The \textsc{pamgen} library handles the mesh geometries shown below:
 
13
\begin{itemize}\addtolength{\itemsep}{-0.5\baselineskip}
 
14
\item Bricks
 
15
\item Partial hollow cylinders
 
16
\item Complete hollow cylinders
 
17
\item Partial solid cylinders
 
18
\item Complete solid cylinders
 
19
\end{itemize}
 
20
 
 
21
 
 
22
\begin{figure}[h]
 
23
    \centering
 
24
      \includegraphics[width=1.0in]{brick}
 
25
      \includegraphics[width=1.0in]{cubit_radial1}
 
26
      \includegraphics[width=1.0in]{cubit_radial2}
 
27
      \includegraphics[width=1.0in]{cubit_radial_trisection}
 
28
      \includegraphics[width=1.0in]{cubit_radial_trisection2}
 
29
  \caption{The mesh geometry zoo in 3D.}
 
30
  \label{fig:btm}
 
31
\end{figure}
 
32
 
 
33
\subsection{Boundary Conditions}
 
34
Boundary conditions application regions in the form of node sets and side sets can be applied to the face, edge, or corner of any element block in the finite element mesh. They may also be applied to any face, edge, or corner of the entire mesh.
 
35
\subsection{Decomposition}
 
36
There are several mesh decomposition strategies available in \textsc{pamgen}:
 
37
\begin{itemize}\addtolength{\itemsep}{-0.5\baselineskip}
 
38
\item A default decomposition based on a constrained optimized solution that slices through the entire mesh in its three (or two in 2D) topological dimensions.
 
39
\item A user defined slicing strategy that specifies the number of slices through the mesh in each topological direction.
 
40
\item A sequential strategy that distributes elements beetween processors based on their element ids with the first n  elements going to processor 0 ...
 
41
\item A random strategy that assigns element to processors randomly.
 
42
\end{itemize}
 
43
 
 
44
\subsection {Geometry Transformation}
 
45
Any mesh can be modified by re-evaluating the nodal coordinate values using a user-supplied function. This function has the original nodal coordinates as input values. Its output values define the new nodal coordinates.
 
46
 
 
47
 
 
48
 
 
49
\begin{figure}[h]
 
50
    \centering
 
51
      \includegraphics[width=1.0in]{3d_warped_geometry_white_bg}
 
52
      \includegraphics[width=1.0in]{mesh_warp_2d_white_bg}
 
53
  \caption{Examples of geometry transformation.}
 
54
  \label{fig:btm}
 
55
\end{figure}
 
56
 
 
57
 
 
58
\subsection{Element Density}
 
59
Several of the geometry types allow specification of first and last element sizes within a block in a particular cartesian direction. In addition the user may control node distribution over any geometry by providing a user defined distribution function. This function is evaluated so that nodes are shifted towards areas where the function has its highest values. 
 
60
 
 
61
\clearpage
 
62
\section{Approach}\label{sec:challenge}
 
63
\textsc{pamgen} operates on the premise that mesh generation is deterministic. This means that every execution of code compiled with compiler A and run on processor B under operating system C reading mesh instructions file D will produce an identical mesh. The mesh will have the same topology and the nodes will have the same coordinate locations.  On a multi-processor machine of identical nodes an arbitrary number of processors executing identical instructions produce an identical mesh. Use of \textsc{pamgen} on heterogeneous machines may produce unexpected results.
 
64
 
 
65
With one significant exception, \textsc{pamgen} operates in the same way as these identical processors producing identical mesh. The exception is that each processor only allocates for a subset of the nodes and elements, and each processor performs topology and geometry calculations only for the entities and dependencies present on that processor.  \textsc{pamgen} exploits the fact that each processor is capable of producing the entire mesh in order to allow each processor to produce its own mesh. The deterministic nature of the meshing process is essential to allow correspondence in topologies and geometries produced on adjacent processors.
 
66
 
 
67
The implementation of the mesh generation in \textsc{pamgen} is as much as possible implicit. Quantities are not allocated until they are ready for output, and they are not calculated until they can be stored, or until they are required by a dependent calculation. This approach can result in duplication of intermediate calculations, but it avoids the severe limitations on total problem size that occur if attempts are made to allocate any quantity with a size related to the total mesh size. 
 
68
 
 
69
\clearpage
 
70
\section{Usage}\label{sec:usage}
 
71
For the few simple geometries and element types it supports, the \textsc{pamgen} library is a substitute for pre-processed finite element mesh files.  Successful usage of the library requires some modification of the analysis code. 
 
72
 
 
73
The \textsc{pamgen} library must be linked into the analysis executable to allow access to the mesh creation, query and deletion functions.
 
74
 
 
75
The modules in the analysis code that read finite element mesh data from a file must be adapted to:
 
76
\begin{itemize}\addtolength{\itemsep}{-0.5\baselineskip}
 
77
\item Read in a ``C''-progamming language string that specifices the geometry, topology, and boundary conditions of a mesh.
 
78
\item Pass that string to the \textsc{pamgen} Create\_Pamgen\_Mesh(...) function along with the rank of the mesh requested and the total number of processors across which the mesh is spread. 
 
79
\item Handle message and possibly error strings available after calling Create\_Pamgen\_Mesh(...).
 
80
\item Call the \textsc{pamgen} query functions to populate the analysis code's mesh and communication data structures.
 
81
\item Call the \textsc{pamgen} Delete\_Pamgen\_Mesh() function release memory allocated within the library.
 
82
\end{itemize}
 
83
 
 
84
The source code for a stand-alone executable called ``pamgen\_lt\_c'' is distributed with the \textsc{pamgen} library. This example code is an excellent starting point for adapting an analysis code to use the \textsc{pamgen} library.
 
85
 
 
86
 
 
87
\clearpage
 
88
\section{Specifying a Mesh}\label{sec:specifying_a_mesh}
 
89
 
 
90
The ``C''-programming language string passed to \textsc{pamgen} is the complete definition of the mesh's geometry, topology, node sets, side sets, and parallel decomposition. It must begin with a \texttt{MESH} keyword, and it must end with an \texttt{END} keyword. The \texttt{MESH -- END} keyword pair must surround a \texttt{RECTILINEAR --
 
91
END}, \texttt{SPHERICAL -- END}, \texttt{BRICK -- END}, \texttt{RADIAL -- END}, \texttt{RADIAL TRISECTION -- END}, or \texttt{CYLINDRICAL -- END}
 
92
keyword pair and may have additional \texttt{SET ASSIGN -- END}, \texttt{DECOMPOSITION STRATEGY -- END},
 
93
\texttt{USER DEFINED ELEMENT DENSITY -- END}, or \texttt{USER DEFINED GEOMETRY TRANSFORMATION -- END} keyword pairs.
 
94
 
 
95
{\ttfamily \begin{verbatim}
 
96
MESH
 
97
 {RECTILINEAR | SPHERICAL | BRICK | RADIAL | RADIAL TRISECTION | CYLINDRICAL}
 
98
    [subkeyword-list]
 
99
   END
 
100
  [SET ASSIGN]
 
101
  [END]
 
102
  [DECOMPOSITION STRATEGY]
 
103
  [END]
 
104
  [USER DEFINED GEOMETRY TRANSFORMATION]
 
105
  [END]
 
106
  [USER DEFINED ELEMENT DENSITY]
 
107
  [END]
 
108
END
 
109
\end{verbatim}
 
110
}
 
111
 
 
112
\subsection{Dimensionality}
 
113
\label{sec:dimensionality}
 
114
\index{Dimensionality}
 
115
The dimensionality of the mesh is not specified in the ``C'' programming language string. It is passed to the \textsc{pamgen} library at execution time through the \textsc{pamgen} API.  In general a 2D mesh can be specified by removing 3D specific keywords and values (those referencing a third coordinate [for example Z or k]) from a 3D mesh description. 
 
116
 
 
117
\subsection{Block IDs}
 
118
\label{sec:blockids}
 
119
\index{Block IDs}
 
120
The finite elements created using \textsc{pamgen} are grouped into blocks. Each block has a positive non-zero id.  These ids are automatically assigned by \textsc{pamgen} and are not under the control of the user. If there is a single block then its id is 1. When there are more than  one block, the ids are assigned beginning with the block in the lowest topological position in i, j, k space. Subsequent blocks are incrementally numbered first in the i topological direction, next in the j topological direction, and finally in the k topological direction. In the case of \texttt{BRICK} and \texttt{RECTILINEAR} meshes i, j, and k correspond to the coordinate directions x, y, and z. In the case of \texttt{CYLINDRICAL}, \texttt{RADIAL}, and \texttt{RADIAL TRISECTION} meshes i, j, and k correspond to r, $\theta$, and z.
 
121
 
 
122
 
 
123
\clearpage
 
124
\subsection{Geometry and Topology}
 
125
\label{sec:inline-mesh}
 
126
\index{Geometry and Topology}
 
127
 
 
128
\subsubsection {Rectilinear}
 
129
\index{Rectilinear}
 
130
{\ttfamily \begin{verbatim}
 
131
RECTILINEAR
 
132
   [subkeyword-list]
 
133
END
 
134
\end{verbatim}
 
135
}
 
136
 
 
137
The \texttt{RECTILINEAR -- END} block pair surrounds the description
 
138
of the geometry of a rectilinear mesh.  The extent
 
139
of the domain is given by a pair of vectors (gmin and gmax).  The
 
140
number of blocks in each coordinate direction and the number of
 
141
elements in each block are given by additional keywords.  The total
 
142
number of elements specified in this type of mesh is the
 
143
product of the total number of blocks \texttt{BX} $\times$ \texttt{BY}
 
144
$\times$ \texttt{BZ} and the total number of elements per block
 
145
\texttt{NX} $\times$ \texttt{NY} $\times$ \texttt{NZ}.  For a 2D mesh
 
146
\texttt{NZ} and \texttt{BZ} must be omitted.  The keywords associated
 
147
with the \texttt{RECTILINEAR} keyword are given in
 
148
Table~\ref{tab:inlinemesh-rectilinear}.
 
149
 
 
150
\threecolumntable{
 
151
  Keywords for \texttt{RECTILINEAR -- END}.
 
152
  \label{tab:inlinemesh-rectilinear}
 
153
}{
 
154
\hline
 
155
  Sub-Keyword & Input & Description \\
 
156
 
 
157
\hline \hline
 
158
  \texttt{NX} & \texttt{int} &
 
159
       Number of cells in x-direction. \\ \hline
 
160
  \texttt{NY} & \texttt{int} &
 
161
       Number of cells in y-direction. \\ \hline
 
162
  \texttt{NZ} & \texttt{int} &
 
163
       Number of cells in z-direction. \\ \hline
 
164
  \texttt{BX} & \texttt{int} &
 
165
       Number of blocks in the x-direction. \\ \hline
 
166
  \texttt{BY} & \texttt{int} &
 
167
       Number of blocks in the y-direction. \\ \hline
 
168
  \texttt{BZ} & \texttt{int} &
 
169
       Number of blocks in the z-direction. \\ \hline
 
170
  \texttt{GMIN} & \texttt{vector} &
 
171
       Minimum domain coordinates (x,y,z). \\ \hline
 
172
  \texttt{GMAX} & \texttt{vector} &
 
173
       Maximum domain coordinates (x,y,z).  \\ \hline
 
174
}
 
175
 
 
176
An example of a mesh specification with the
 
177
\texttt{RECTILINEAR} option is illustrated in Figure~\ref{fig:rect_inline}.
 
178
 
 
179
%\clearpage
 
180
 
 
181
\begin{figure}[htb]
 
182
\centering
 
183
  \begin{minipage}[c]{0.5\linewidth}
 
184
    \centering
 
185
{\ttfamily  \begin{verbatim}
 
186
mesh 
 
187
  rectilinear 
 
188
    nx = 10 
 
189
    ny = 10 
 
190
    nz = 10 
 
191
    bx = 4 
 
192
    by = 7 
 
193
    bz = 5 
 
194
    gmin = 1.0 1.0 1.0 
 
195
    gmax = 4.0 7.0 5.0 
 
196
  end 
 
197
  set assign 
 
198
    nodeset,ihi,2 
 
199
    nodeset,jhi,1 
 
200
  end 
 
201
end
 
202
\end{verbatim}}
 
203
  \par\vspace{0pt}
 
204
  \end{minipage}%
 
205
  \hfill
 
206
  \begin{minipage}[c]{0.5\linewidth}
 
207
    \centering
 
208
      \includegraphics[width=3.25in]{rect_inline}
 
209
  \end{minipage}
 
210
  \caption{Definition of a three-dimensional \texttt{RECTILINEAR} mesh.}
 
211
  \label{fig:rect_inline}
 
212
\end{figure}
 
213
 
 
214
\clearpage
 
215
\subsubsection{Spherical}
 
216
\index{Spherical}
 
217
{\ttfamily \begin{verbatim}
 
218
SPHERICAL
 
219
   [subkeyword-list]
 
220
END
 
221
\end{verbatim}
 
222
}
 
223
 
 
224
The \texttt{SPHERICAL -- END} block pair allows the description of a
 
225
curvilinear spherical mesh centered at the origin and described by an
 
226
inner and outer radius, and the extent of revolution in $\theta$ and $\phi$
 
227
directions.  Angle $\theta$ is measured counter-clockwise about the z-axis from
 
228
the x-axis, and angle $\phi$ is measured counter-clockwise from the y-axis
 
229
about the x-axis.  The number of elements and blocks in each
 
230
curvilinear coordinate direction are specified by the keywords in
 
231
Table~\ref{tab:inlinemesh-radial}.  The parameters \texttt{PHI, NPHI,
 
232
and BPHI} are only appropriate for 3D problems. When used in 2D
 
233
simulations, \texttt{CYLINDRICAL} and \texttt{SPHERICAL} keywords
 
234
produce identical meshes.
 
235
 
 
236
\threecolumntable{
 
237
  Keywords for \texttt{SPHERICAL -- END}.
 
238
  \label{tab:inlinemesh-radial}
 
239
}{
 
240
\hline
 
241
  Sub-Keyword & Input & Description \\
 
242
 
 
243
\hline \hline
 
244
  \texttt{NR} & \texttt{int} &
 
245
       Number of cells in r-direction. \\ \hline
 
246
  \texttt{NTHETA} & \texttt{int} &
 
247
       Number of cells in $\theta$-direction. \\ \hline
 
248
  \texttt{NPHI} & \texttt{int} &
 
249
       Number of cells in $\phi$-direction. \\ \hline
 
250
  \texttt{BR} & \texttt{int} &
 
251
       Number of blocks in the r-direction. \\ \hline
 
252
  \texttt{BTHETA} & \texttt{int} &
 
253
       Number of blocks in $\theta$-direction. \\ \hline
 
254
  \texttt{BPHI} & \texttt{int} &
 
255
       Number of blocks in $\phi$-direction. \\ \hline
 
256
  \texttt{RI} & \texttt{real} &
 
257
       Inner radius \\ \hline
 
258
  \texttt{RO} & \texttt{real} &
 
259
       Outer radius \\ \hline
 
260
  \texttt{THETA} & \texttt{real} &
 
261
       Angular extent in $\theta$ (degrees,0.-180. in 3D, 0.-360. in 2D) \\ \hline
 
262
  \texttt{PHI} & \texttt{real} &
 
263
       Angular extent in $\phi$ (0.-360) \\ \hline
 
264
}
 
265
 
 
266
%\clearpage
 
267
 
 
268
An example of a mesh definition syntax with the
 
269
\texttt{SPHERICAL} option is illustrated in
 
270
Figure~\ref{fig:test_radial} for a 2D simulation.  An example of 3D
 
271
spherical mesh generation follows in
 
272
Figure~\ref{fig:str_inline_sphere}.
 
273
 
 
274
\begin{figure}[htb]
 
275
  \centering
 
276
  \begin{minipage}[c]{0.4\linewidth}
 
277
    \centering
 
278
{\ttfamily \begin{verbatim}
 
279
mesh
 
280
  spherical
 
281
    ri = 0.0
 
282
    ro = 0.5
 
283
    theta = 45
 
284
    ntheta = 10
 
285
    nr = 20
 
286
    br = 2
 
287
    btheta = 2
 
288
  end
 
289
end
 
290
\end{verbatim}}
 
291
  \end{minipage}%
 
292
  \hfil
 
293
  \begin{minipage}[c]{0.6\linewidth}
 
294
    \centering
 
295
      \includegraphics[width=2.75in]{test_radial}
 
296
  \end{minipage}
 
297
  \caption{Definition of a two-dimensional spherical mesh.}
 
298
  \label{fig:test_radial}
 
299
\end{figure}
 
300
 
 
301
%\clearpage
 
302
 
 
303
\begin{figure}[htb]
 
304
\centering
 
305
  \begin{minipage}[c]{0.4\linewidth}
 
306
    \centering
 
307
{\ttfamily \begin{verbatim}
 
308
mesh
 
309
  spherical
 
310
    ri = 0.5
 
311
    ro = 1.0
 
312
    theta = 180.0
 
313
    ntheta = 10
 
314
    nr = 10
 
315
    br = 2
 
316
    btheta = 2
 
317
    bphi = 2
 
318
    nphi = 10
 
319
    phi = 90
 
320
  end
 
321
end
 
322
\end{verbatim}}
 
323
  \end{minipage}%
 
324
  \hfil
 
325
  \begin{minipage}[c]{0.6\linewidth}
 
326
    \centering
 
327
      \includegraphics[width=2.75in]{str_inline_sphere}
 
328
  \end{minipage}
 
329
  \caption{Definition of a three-dimensional spherical mesh.}
 
330
  \label{fig:str_inline_sphere}
 
331
\end{figure}
 
332
 
 
333
\clearpage
 
334
\subsubsection{Cylindrical}
 
335
\index{Cylindrical}
 
336
{\ttfamily \begin{verbatim}
 
337
CYLINDRICAL
 
338
   [subkeyword-list]
 
339
END
 
340
\end{verbatim}
 
341
}
 
342
 
 
343
The \texttt{CYLINDRICAL -- END} block pair allows the description of a
 
344
curvilinear cylindrical mesh centered at the origin in x and y, and
 
345
aligned along the z-axis.  It is described by an inner and outer
 
346
radius, the extent of revolution in angle $\theta$ about the z-axis,
 
347
and its start and end in the z-direction.  Angle $\theta$ is measured
 
348
counter-clockwise about the z-axis from the x-axis.  The number of
 
349
elements and blocks in each indicial direction are specified by the
 
350
keywords in Table~\ref{tab:inlinemesh-cylinder}.  The parameters
 
351
\texttt{ZMIN, ZMAX, NZ, and BZ} are only appropriate for 3D
 
352
problems.  When used in 2D solutions, \texttt{CYLINDRICAL} and
 
353
\texttt{SPHERICAL} produce identical meshes.
 
354
 
 
355
\threecolumntable{
 
356
  Keywords for \texttt{CYLINDRICAL -- END}.
 
357
  \label{tab:inlinemesh-cylinder}
 
358
}{
 
359
\hline
 
360
  Sub-Keyword & Input & Description \\
 
361
 
 
362
\hline \hline
 
363
  \texttt{NR} & \texttt{int} &
 
364
       Number of cells in r-direction. \\ \hline
 
365
  \texttt{NTHETA} & \texttt{int} &
 
366
       Number of cells in $\theta$-direction. \\ \hline
 
367
  \texttt{NZ} & \texttt{int} &
 
368
       Number of cells in z-direction. \\ \hline
 
369
  \texttt{BR} & \texttt{int} &
 
370
       Number of blocks in the r-direction. \\ \hline
 
371
  \texttt{BTHETA} & \texttt{int} &
 
372
       Number of blocks in $\theta$-direction. \\ \hline
 
373
  \texttt{BZ} & \texttt{int} &
 
374
       Number of blocks in z-direction. \\ \hline
 
375
  \texttt{RI} & \texttt{real} &
 
376
       Inner radius \\ \hline
 
377
  \texttt{RO} & \texttt{real} &
 
378
       Outer radius \\ \hline
 
379
  \texttt{THETA} & \texttt{real} &
 
380
       Angular extent in $\theta$ degrees, 0.-360. \\ \hline
 
381
  \texttt{ZMIN} & \texttt{real} &
 
382
       Start of mesh in z-direction \\ \hline
 
383
  \texttt{ZMAX} & \texttt{real} &
 
384
       End of mesh in z-direction \\ \hline
 
385
}
 
386
 
 
387
An example of a \textsc{pamgen} mesh definition with the
 
388
\texttt{CYLINDRICAL} option is illustrated in
 
389
Figure~\ref{fig:rect_cylinder}.
 
390
 
 
391
\begin{figure}[htbp]
 
392
\centering
 
393
  \begin{minipage}[c]{0.4\linewidth}
 
394
    \centering
 
395
{\ttfamily \begin{verbatim}
 
396
mesh
 
397
  cylindrical
 
398
    ri = 0.5
 
399
    ro = 1.0
 
400
    theta = 90.0
 
401
    ntheta = 10
 
402
    nr = 10
 
403
    br = 2
 
404
    zmin = 1.0
 
405
    zmax = 2.0
 
406
    nz = 10
 
407
    bz = 2
 
408
  end
 
409
end
 
410
\end{verbatim}}
 
411
  \end{minipage}%
 
412
  \hfil
 
413
  \begin{minipage}[c]{0.6\linewidth}
 
414
    \centering
 
415
      \includegraphics[width=3.5in]{cylinder}
 
416
  \end{minipage}
 
417
  \caption{Three dimensional \texttt{CYLINDRICAL} mesh.}
 
418
  \label{fig:rect_cylinder}
 
419
\end{figure}
 
420
 
 
421
\clearpage
 
422
\subsubsection {Radial and Radial Trisection}
 
423
\index{Radial}
 
424
\index{Radial Trisection}
 
425
\index{Trisection}
 
426
{\ttfamily \begin{verbatim}
 
427
{RADIAL | RADIAL TRISECTION }
 
428
   [ENFORCE PERIODICITY]
 
429
   [TRISECTION BLOCKS, int]
 
430
   [TRANSITION RADIUS, int]
 
431
   [ZMIN real]
 
432
   NUMZ int
 
433
     ZBLOCK int real {INTERVAL int | FIRST SIZE real [LAST SIZE real]}
 
434
   {NUMR | NUMX} int INITIAL RADIUS real 
 
435
     RBLOCK int real {INTERVAL int | FIRST SIZE real [LAST SIZE real]}
 
436
   {NUMA | NUMY} int
 
437
     ABLOCK int real {INTERVAL int | FIRST SIZE real [LAST SIZE real]}
 
438
END
 
439
\end{verbatim}
 
440
}
 
441
 
 
442
The \texttt{RADIAL} and \texttt{RADIAL TRISECTION} block pairs allow the description of
 
443
a
 
444
curvilinear cylindrical mesh centered at the origin in x and y, and
 
445
aligned along the z-axis.  The \texttt{RADIAL TRISECTION -- END}
 
446
block pair fills in the center of the cylindrical mesh with transition
 
447
elements.  These options are similar to the \texttt{CYLINDRICAL}
 
448
but they have a different set of controls on element distribution.  The
 
449
successful creation of these meshes requires sequential
 
450
specification of the information for the number of elements blocks and
 
451
their sizes in each coordinate direction. 
 
452
 
 
453
The \texttt{ENFORCE PERIODICITY} keyword applies only to \texttt{RADIAL} and \texttt{RADIAL TRISECTION} mesh descriptions that meet certain requirements: 
 
454
\begin{itemize}
 
455
        \item The meshes must have azimuthal angles of 90, 180, or 360 degrees.
 
456
        \item The meshes must have a single block of elements in the azimuthal direction. 
 
457
        \item The meshes must have an even number of elements in each 90 degree segment of the mesh. 
 
458
        \item For \texttt{RADIAL TRISECTION} meshes, one transition zone is required for each 90 degrees of azimuth. 
 
459
\end{itemize} 
 
460
 
 
461
This keyword causes the mesh generation to perform all node coordinate calculations in the first 45 degrees of the azimuthal domain. Coordinate locations of nodes ouside of 45 degrees are formed by permuting the sign and oder of the components of periodically corresponding nodes' locations. This guarantees that there will be no differences between the absolute floating point values of periodically corresponding nodes' coordinates.  
 
462
 
 
463
The \texttt{NUMZ | NUMR | NUMA} keywords are followed by an integer
 
464
specifying the number
 
465
of element blocks in that coordinate direction. The
 
466
\texttt{NUMR} line includes an additional real parameter that
 
467
specifies the inner radius of the cylindrical mesh. Specification of
 
468
an inner radius of 0.0 will result in degenerate elements with
 
469
co-located nodes along the \texttt{Z} axis. The innner radius
 
470
specification is ignored for \texttt{RADIAL TRISECTION} meshes.
 
471
 
 
472
Immediately following
 
473
the \texttt{NUMZ int | NUMR int INITIAL RADIUS real | NUMA int} lines, there must be a \texttt{ZBLOCK |
 
474
  RBLOCK | ABLOCK} line for each of the blocks in that direction.
 
475
These lines specify the spatial extent of the particular block and the
 
476
distribution of elements in the block in that direction. The \texttt{INTERVAL int} keyword
 
477
specifies a fixed number of elements in the
 
478
block. A \texttt{FIRST SIZE real LAST SIZE real} pair specifies the absolute
 
479
size of the first and last elements in the block. When the \texttt{FIRST SIZE real LAST SIZE real} specification is
 
480
used, the element sizing will be linear between the first and last
 
481
elements. The sizes of the first and last elements may be
 
482
adjusted slightly to provide linear sizing. The approximate number of elements that will be generated using \texttt{FIRST SIZE} and \texttt{LAST SIZE} sizing controls is given by truncating to an integer, the length of the mesh segment divided by the average of the \texttt{FIRST SIZE} and \texttt {LAST SIZE} values. There is a slight chance that this calculation will result in a different number of elements on different computer platforms.  Omission of the
 
483
\texttt{LAST real} keyword is equivalent to setting the element size
 
484
to that given by the \texttt{FIRST SIZE real} keyword.
 
485
 
 
486
The \texttt{RADIAL TRISECTION -- END} block pair requires the
 
487
additional input of \texttt{TRISECTION BLOCKS, int} and it accepts the
 
488
optional \texttt{TRANSITION RADIUS, real} keyword value pair.  The
 
489
\texttt{TRISECTION BLOCKS} keyword specifies the number of transition
 
490
zones that will be used in the central region of the mesh. This
 
491
number must be supplied. One transition zone is recommended for each
 
492
90 degrees of azimuth.  The \texttt{TRANSITION RADIUS} is the distance
 
493
from the origin to the corners of the transition zones of
 
494
mesh. Without this parameter the transition radius is chosen to be one
 
495
half of the radial thickness of the first block.  When \texttt{RADIAL TRISECTION} is selected, any \texttt{INITIAL RADIUS} supplied is
 
496
  ignored.
 
497
 
 
498
The \texttt{ZMIN real} keyword value pair is available to specify an offset for the
 
499
entire mesh in the \texttt{Z} direction.
 
500
 
 
501
If the cumulative values of the sizes of the azimuthal blocks, given
 
502
by the second argument of \texttt{ABLOCK int real} is equal to 360.0 degrees, then the mesh
 
503
will form an single closed ring of elements.
 
504
 
 
505
 
 
506
An example of \textsc{pamgen} mesh definition with the
 
507
\texttt{RADIAL} option is illustrated in
 
508
Figure~\ref{fig:rect_cubit_radial}.
 
509
 
 
510
\begin{figure}[!thbp]
 
511
\centering
 
512
\hfil
 
513
  \begin{minipage}[c]{1.0\linewidth}
 
514
    \centering
 
515
\includegraphics[width=3.0in]{cubit_radial1}
 
516
{\ttfamily \begin{verbatim}
 
517
mesh
 
518
  radial
 
519
    numz 2
 
520
      zblock 1 10.0 first size 1 last size 2
 
521
      zblock 2 10.0 first size 2 last size 1
 
522
    numr 2 initial radius 1.
 
523
      rblock 1 10. first size 1. last size 2.
 
524
      rblock 2 10. first size 2. last size 1.
 
525
    numa 1
 
526
      ablock 1 120. interval 10
 
527
  end
 
528
end
 
529
\end{verbatim}}
 
530
  \end{minipage}%
 
531
  \caption{Three dimensional \texttt{RADIAL} mesh.}
 
532
  \label{fig:rect_cubit_radial}
 
533
\end{figure}
 
534
 
 
535
 
 
536
 
 
537
A second example of \textsc{pamgen} mesh definition with the
 
538
\texttt{RADIAL} option is illustrated in
 
539
Figure~\ref{fig:rect_cubit_radial2}. In this case the sum of the
 
540
azimuthal blocks is 360.0 and the mesh is a
 
541
complete cylinder.
 
542
 
 
543
\begin{figure}[htbp]
 
544
\centering
 
545
  \begin{minipage}[c]{0.4\linewidth}
 
546
    \centering
 
547
{\ttfamily \begin{verbatim}
 
548
mesh
 
549
  radial
 
550
  numz 1
 
551
    zblock 1 10.0 interval 6
 
552
  numr 3 
 
553
    rblock 1 2. interval 12
 
554
    rblock 2 5. interval 6
 
555
    rblock 3 5. interval 12
 
556
  numa 1
 
557
    ablock 1 360. interval 36
 
558
 end
 
559
end
 
560
\end{verbatim}}
 
561
  \end{minipage}%
 
562
  \hfil
 
563
  \begin{minipage}[c]{0.6\linewidth}
 
564
    \centering
 
565
      \includegraphics[width=3.0in]{cubit_radial2}
 
566
  \end{minipage}
 
567
  \caption [A 360 degree \texttt{RADIAL} mesh.]{Three dimensional \texttt{RADIAL} mesh with azimuthal
 
568
    angle of 360 degrees.}
 
569
  \label{fig:rect_cubit_radial2}
 
570
\end{figure}
 
571
 
 
572
An example of a \textsc{pamgen} mesh definition with the
 
573
\texttt{RADIAL TRISECTION} option is illustrated in
 
574
Figure~\ref{fig:cubit_radial_trisect3}. This figure is annotated to
 
575
show the correspondence between input parameters and the
 
576
resulting mesh. This mesh uses a \texttt{TRISECTION BLOCKS} setting of 3. In this case the azimuthal
 
577
angle is 90. degrees and the \texttt{FIRST SIZE}, \texttt{LAST SIZE},
 
578
 and \texttt{TRANSITION RADIUS} directives are used. 
 
579
 
 
580
\begin{figure}[!thbp]
 
581
\centering
 
582
  \hfil
 
583
  \begin{minipage}[c]{1.0\linewidth}
 
584
    \centering
 
585
      \includegraphics[width=5.5in,height=4.5in]{cubit_tris_rad_grad_trans}
 
586
{\ttfamily \begin{verbatim}
 
587
mesh
 
588
  radial trisection
 
589
    trisection blocks, 3
 
590
    transition radius, 6.5
 
591
    numz 1
 
592
      zblock 1 1. interval 1
 
593
    numr 3
 
594
      rblock 1 8.0 interval 4
 
595
      rblock 2 3.0 first size 0.05 last size 0.5
 
596
      rblock 3 4.0 first size 0.5 last size 0.05
 
597
    numa 1
 
598
      ablock 1 90. interval 12
 
599
  end
 
600
end
 
601
\end{verbatim}}
 
602
  \end{minipage}
 
603
  \caption [A \texttt{RADIAL TRISECTION} mesh with three trisection blocks.]{A \texttt{RADIAL TRISECTION} mesh with azimuthal
 
604
    angle of 90 degrees and three trisection blocks. \texttt{FIRST
 
605
      SIZE} and \texttt{LAST SIZE} commands are used to specify
 
606
    element density.}
 
607
  \label{fig:cubit_radial_trisect3}
 
608
\end{figure}
 
609
 
 
610
An second example of a \textsc{pamgen} mesh definition with the
 
611
\texttt{RADIAL TRISECTION} option is illustrated in
 
612
Figure~\ref{fig:cubit_radial_trisect1}. 
 
613
 
 
614
\begin{figure}[htbp]
 
615
\centering
 
616
  \begin{minipage}[c]{0.4\linewidth}
 
617
    \centering
 
618
{\ttfamily \begin{verbatim}
 
619
mesh
 
620
  radial trisection
 
621
    trisection blocks, 2
 
622
    zmin -0.00075
 
623
    numz 1
 
624
      zblock 1 1. interval 4
 
625
    numr 3 
 
626
      rblock 1 2.0 interval 4
 
627
      rblock 2 3.0 interval 4
 
628
      rblock 3 4.0 interval 4
 
629
    numa 1
 
630
      ablock 1 90. interval 12
 
631
  end
 
632
end
 
633
\end{verbatim}}
 
634
  \end{minipage}%
 
635
  \hfil
 
636
  \begin{minipage}[c]{0.6\linewidth}
 
637
    \centering
 
638
      \includegraphics[width=3.0in]{cubit_radial_trisection}
 
639
  \end{minipage}
 
640
  \caption [A \texttt{RADIAL TRISECTION} mesh with three trisection blocks.] {Three dimensional \texttt{RADIAL TRISECTION} mesh with azimuthal
 
641
    angle of 90 degrees and two trisection blocks.}
 
642
  \label{fig:cubit_radial_trisect1}
 
643
\end{figure}
 
644
 
 
645
 
 
646
A third example of a \textsc{pamgen} mesh definition with the
 
647
\texttt{RADIAL TRISECTION} option is illustrated in
 
648
Figure~\ref{fig:cubit_radial_trisect2}. In this case the azimuthal
 
649
angle is 360. degrees and the mesh is a complete circular disk. 
 
650
 
 
651
\begin{figure}[htbp]
 
652
\centering
 
653
  \begin{minipage}[c]{0.4\linewidth}
 
654
    \centering
 
655
{\ttfamily \begin{verbatim}
 
656
mesh
 
657
  radial trisection
 
658
    trisection blocks, 4
 
659
    zmin -0.00075
 
660
    numz 1
 
661
      zblock 1 4. interval 4
 
662
    numr 3 
 
663
      rblock 1 2.0 interval 4
 
664
      rblock 2 3.0 interval 4
 
665
      rblock 3 5.0 interval 4
 
666
    numa 1
 
667
      ablock 1 360. interval 32
 
668
  end
 
669
end
 
670
\end{verbatim}}
 
671
  \end{minipage}%
 
672
  \hfil
 
673
  \begin{minipage}[c]{0.6\linewidth}
 
674
    \centering
 
675
      \includegraphics[width=3.0in]{cubit_radial_trisection2}
 
676
  \end{minipage}
 
677
  \caption [A 360 degree \texttt{RADIAL TRISECTION} mesh.] {Three dimensional \texttt{RADIAL TRISECTION} mesh with azimuthal
 
678
    angle of 360 degrees and four trisection blocks.}
 
679
  \label{fig:cubit_radial_trisect2}
 
680
\end{figure}
 
681
 
 
682
 
 
683
\clearpage
 
684
\subsubsection {Brick}
 
685
\index{Brick}
 
686
 
 
687
{\ttfamily \begin{verbatim}
 
688
BRICK
 
689
  NUMZ int (l)
 
690
    ZBLOCK 1 real {INTERVAL int | FIRST SIZE real [LAST SIZE real]}
 
691
    ZBLOCK 2 real {INTERVAL int | FIRST SIZE real [LAST SIZE real]}
 
692
    ...
 
693
    ...
 
694
    ZBLOCK l real {INTERVAL int | FIRST SIZE real [LAST SIZE real]}
 
695
  NUMX int (m)
 
696
    XBLOCK 1 real {INTERVAL int | FIRST SIZE real [LAST SIZE real]}
 
697
    XBLOCK 2 real {INTERVAL int | FIRST SIZE real [LAST SIZE real]}
 
698
    ...
 
699
    ...
 
700
    XBLOCK m real {INTERVAL int | FIRST SIZE real [LAST SIZE real]}
 
701
  NUMY int (n)
 
702
    YBLOCK 1 real {INTERVAL int | FIRST SIZE real [LAST SIZE real]}
 
703
    YBLOCK 2 real {INTERVAL int | FIRST SIZE real [LAST SIZE real]}
 
704
    ...
 
705
    ...
 
706
    YBLOCK n real {INTERVAL int | FIRST SIZE real [LAST SIZE real]}
 
707
END
 
708
\end{verbatim}
 
709
}
 
710
 
 
711
The \texttt{BRICK} mesh topology type is a more flexible version of the \texttt{RECTILINEAR} type in that it allows different numbers of elements in each element block in each coordinate direction. The creation of a
 
712
\texttt{BRICK} mesh is analogous to the \texttt{RADIAL} mesh option
 
713
and
 
714
successful creation of these meshes requires sequential
 
715
specification of the information for the number of elements blocks and
 
716
their sizes in each coordinate direction. 
 
717
 
 
718
The \texttt{NUMX | NUMY | NUMZ} keywords are followed by an integer
 
719
specifying the number
 
720
of element blocks in that coordinate direction. The
 
721
 
 
722
Immediately following
 
723
the \texttt{NUMX int | NUMY int | NUMZ int} lines, there must be a \texttt{XBLOCK |
 
724
  YBLOCK | ZBLOCK} line for each of the blocks in that direction. The first integer on  this line corresponds to the ordinal (beginning with 1) of the line.
 
725
These lines specify the spatial extent of the particular block and the
 
726
distribution of elements in the block in that direction. The \texttt{INTERVAL int} keyword
 
727
specifies a fixed number of elements in the
 
728
block. A \texttt{FIRST SIZE real LAST SIZE real} pair specifies the absolute
 
729
size of the first and last elements in the block. When the \texttt{FIRST SIZE real LAST SIZE real} specification is
 
730
used, the element sizing will be linear between the first and last
 
731
elements. The sizes of the first and last elements may be
 
732
adjusted slightly to provide linear sizing. Omission of the
 
733
\texttt{LAST real} keyword is equivalent to setting the element size
 
734
to that given by the \texttt{FIRST SIZE real} keyword.
 
735
 
 
736
 
 
737
An example of a \textsc{pamgen} mesh definition with the
 
738
\texttt{BRICK} option is illustrated in
 
739
Figure~\ref{fig:brick1}.
 
740
 
 
741
\begin{figure}[htbp]
 
742
\centering
 
743
  \begin{minipage}[c]{0.4\linewidth}
 
744
    \centering
 
745
{\ttfamily \begin{verbatim}
 
746
 
 
747
 
 
748
 
 
749
 
 
750
 
 
751
 
 
752
 
 
753
 
 
754
 
 
755
 
 
756
mesh
 
757
  brick
 
758
    numz 2
 
759
      zblock 1 2. interval 5
 
760
      zblock 2 8. interval 4
 
761
    numx 2
 
762
      xblock 1 5.0 interval 5
 
763
      xblock 2 5.0 interval 5
 
764
    numy 2
 
765
      yblock 1 10. first size 1. last size .1
 
766
      yblock 2 10. first size .1 last size 1.
 
767
  end
 
768
end
 
769
\end{verbatim}}
 
770
  \end{minipage}%
 
771
  \hfil
 
772
  \begin{minipage}[c]{0.6\linewidth}
 
773
    \centering
 
774
      \includegraphics[width=3.0in]{brick}
 
775
  \end{minipage}
 
776
  \caption{Three dimensional \texttt{BRICK} mesh.}
 
777
  \label{fig:brick1}
 
778
\end{figure}
 
779
 
 
780
 
 
781
\clearpage
 
782
\subsection{Boundary Conditions (Nodesets and Sidesets)}
 
783
\label{sec:nodesets-sidests}
 
784
\index{Boundary Conditions}
 
785
\index{Nodesets}
 
786
\index{Sidesets}
 
787
\index{Set Assign}
 
788
 
 
789
{\ttfamily \small \begin{verbatim}
 
790
SET ASSIGN 
 
791
   [{NODESET | SIDESET},{IHI | JHI | ... | V00 | V01 | ... | E00 | 
 
792
   E01 | ALL| ... }, int]
 
793
   [{BLOCK SIDESET | BLOCK NODESET},{IHI | JHI | ... | V00 | V01 | 
 
794
   ... | E00 | E01 | ... }, int, int]
 
795
   ...
 
796
END
 
797
\end{verbatim}
 
798
}
 
799
 
 
800
The \texttt{SET ASSIGN -- END} keyword pair allows the specification
 
801
of nodesets and sidesets on the exterior of meshes.  These
 
802
nodesets and sidesets can be used for specifying boundary conditions
 
803
on the domain. The nodeset or sideset is applied to the topological
 
804
face, edge, or vertex associated with the prescribed topological
 
805
direction. The mesh domain topology and associated labels are
 
806
shown in Figure~\ref{fig:set_assign_topology}.This specification
 
807
applies to the entire  domain and cannot be used to
 
808
specifiy individual blocks.
 
809
 
 
810
The most commonly used sub-domains are the exterior faces of the
 
811
domain. They can be prescribed using \textsc {IHI, JHI, KHI, ILO,
 
812
JLO,} or \textsc {KLO}. For RECTILINEAR meshes \textsc {I,J,} and
 
813
\textsc {K} correspond to the coordinate directions x, y, and z. For
 
814
SPHERICAL meshes \textsc {I,J,} and \textsc {K} correspond to the
 
815
coordinate directions r, $\theta$, and $\phi$. For CYLINDRICAL meshes \textsc
 
816
{I,J,} and \textsc {K} correspond to the coordinate directions r,
 
817
$\theta$, and z.  The \textsc {KHI, KLO} options do not exist in two
 
818
dimension simulations.
 
819
 
 
820
The \textsc{ALL} option for nodesets places all the nodes of the mesh in a 
 
821
nodeset with the requested id. The \textsc{ALL} option is not available for 
 
822
sidesets.
 
823
 
 
824
Specifying a nodeset on the \textsc{ILO} face of a \texttt{RADIAL TRISECTION} mesh 
 
825
refers to the edge aligned with the Z axis (see Figure~\ref{fig:block_ss}). 
 
826
Sidesets may not be  specified on the \textsc{ILO} face of 
 
827
\texttt{RADIAL TRISECTION} meshes.
 
828
 
 
829
\begin{figure}[htbp]
 
830
{\ttfamily \small \begin{verbatim}
 
831
  Side: 0-4-7-3  - ILO      k  7---------6      Edge:  0-1 - E00  
 
832
  Side: 1-2-6-5  - IHI      | /|  j     /|      Edge:  1-2 - E01
 
833
  Side: 0-1-5-4  - JLO      |/ | /     / |      Edge:  3-2 - E02
 
834
  Side: 3-7-6-2  - JHI      4---------5  |      Edge:  0-3 - E03
 
835
  Side: 0-3-2-1  - KLO      |  3------|--2      Edge:  0-4 - E04
 
836
  Side: 4-5-6-7  - KHI      | /       | /       Edge:  1-5 - E05
 
837
                            |/        |/        Edge:  2-6 - E06
 
838
  Vertex: 0 - V00           0---------1 --i     Edge:  3-7 - E07
 
839
  Vertex: 1 - V01                               Edge:  4-5 - E08
 
840
  Vertex: 2 - V02                               Edge:  5-6 - E09
 
841
  Vertex: 3 - V03                               Edge:  7-6 - E10
 
842
  Vertex: 4 - V04                               Edge:  4-7 - E11
 
843
  Vertex: 5 - V05
 
844
  Vertex: 6 - V06
 
845
  Vertex: 7 - V07
 
846
\end{verbatim}
 
847
}
 
848
\caption{Block topology and labels.}
 
849
\label{fig:set_assign_topology}
 
850
\end{figure}
 
851
 
 
852
\emph{BLOCK NODESETS and BLOCK SIDESETS are only available to the BRICK,
 
853
RADIAL, and  RADIAL TRISECTION geometry mesh types.}
 
854
 
 
855
The \texttt{  [{BLOCK SIDESET | BLOCK NODESET},{ IHI | JHI | KHI | ILO | JLO |
 
856
KLO }, int, int]} command allows specification of nodesets and
 
857
sidesets on the topological faces of blocks that may be within the
 
858
finite element mesh. The first integer specifies the id that the
 
859
sideset or nodeset will have, the second integer specifies the block
 
860
on which the sideset or nodeset is applied.
 
861
 
 
862
An example of \texttt{BLOCK SIDESET} applied to a mesh definition with the
 
863
\texttt{RADIAL TRISECTION} option is illustrated in
 
864
Figure~\ref{fig:block_ss}. In this example a sidet is applied to the
 
865
\texttt{IHI} face of block 2. The sideset applied to block 2 will
 
866
have sideset id 45. The faces called out in these sidesets will have
 
867
outward normals facing in the \texttt{IHI} direction.
 
868
 
 
869
\begin{figure}[htbp]
 
870
\centering
 
871
  \begin{minipage}[c]{0.4\linewidth}
 
872
    \centering
 
873
{\ttfamily \begin{verbatim}
 
874
mesh
 
875
  radial trisection
 
876
    trisection blocks, 2
 
877
    zmin -0.00075
 
878
    numz 1
 
879
      zblock 1 1. interval 4
 
880
    numr 3 
 
881
      rblock 1 2.0 interval 4
 
882
      rblock 2 3.0 interval 4
 
883
      rblock 3 4.0 interval 4
 
884
    numa 1
 
885
      ablock 1 90. interval 12
 
886
  end
 
887
  set assign
 
888
    nodeset, ilo, 100
 
889
    block sideset, ihi, 45, 2
 
890
  end
 
891
end
 
892
\end{verbatim}}
 
893
  \end{minipage}%
 
894
  \hfil
 
895
  \begin{minipage}[c]{0.6\linewidth}
 
896
    \centering
 
897
      \includegraphics[width=3.0in]{block_ss}
 
898
  \end{minipage}
 
899
  \caption [A \texttt{RADIAL TRISECTION} mesh with sidesets.] {Three dimensional \texttt{RADIAL TRISECTION} mesh with azimuthal
 
900
    angle of 90 degrees and two trisection blocks having sidesets
 
901
    specified on the radially outward directed faces of blocks 1 and 2. A nodeset is specified on the \textsc{ILO} face of this mesh and marks the edge corresponding to the z axis (blue circles).}
 
902
  \label{fig:block_ss}
 
903
\end{figure}
 
904
 
 
905
\clearpage
 
906
\subsection{User Defined Geometry Transformation}
 
907
\label{sec:inline-geometry-transform}
 
908
\index{User Defined Geometry Transformation}
 
909
 
 
910
 
 
911
{\ttfamily \small \begin{verbatim}
 
912
USER DEFINED GEOMETRY TRANSFORMATION 
 
913
  "
 
914
    user supplied `C' language instructions;
 
915
  "
 
916
END
 
917
\end{verbatim}
 
918
 
919
 
 
920
The \texttt{USER DEFINED GEOMETRY TRANSFORMATION -- END} keyword pair provides
 
921
a powerful way to modify the coordinats of any node of a mesh. The keyword-end
 
922
pair must surround a double quote surrounded block of `C' code. This code will be called with coordinates of every node in the mesh. It may modify the the coordinats by setting the output variables \texttt{outxcoord}, \texttt{outycoord}, and \texttt{outzcoord}. The unmodified values of the node's coordinates are available in the input variables \texttt{inxcoord}, \texttt{inycoord}, and \texttt{inzcoord}.  The coordinates will remain unchanged if the output variables are not modified.  A presentation of the capabilities and
 
923
limitations of runtime compiled 'C' functions is included in
 
924
Appendix~\ref{sec:runtime-compiler-functionality}.
 
925
 
 
926
Examples of meshes produced using this capability feature of \textsc{pamgen} are shown below in Figure~\ref{fig:3d_transform_example} and Figure~\ref{fig:2d_transform_example}. In the first example the nodes with positive Z coordinate values are rotated about the Z axis an angle propportional to their distance from the Z=0 plane. In the second example nodes a distance of 0.5 from the origin are rotated about the origin in proportion to their distance from the origin.
 
927
 
 
928
\begin{figure}[t]
 
929
  \centering
 
930
    \begin{minipage}{0.3\linewidth}
 
931
{\ttfamily \begin{verbatim}
 
932
 
 
933
 
 
934
 
 
935
 
 
936
 
 
937
 
 
938
mesh
 
939
  rectilinear
 
940
    nx = 4
 
941
    ny = 4
 
942
    nz = 4
 
943
    bx =  3
 
944
    by =  3
 
945
    bz =  3
 
946
    gmin = -1.0 -1.0 -1.0
 
947
    gmax =  1.0  1.0  1.0
 
948
  end
 
949
  user defined geometry transformation
 
950
     "
 
951
     double r = sqrt(inxcoord*inxcoord+inycoord*inycoord);
 
952
     double theta = atan2(inycoord,inxcoord);
 
953
     if(inzcoord > 0.0)
 
954
      {
 
955
        theta = theta + (3.14159 / 4.0)*(inzcoord/1.0);
 
956
        r = r*(1.0-inzcoord/1.1);
 
957
        outxcoord = r*cos(theta);
 
958
        outycoord = r*sin(theta);
 
959
      }
 
960
     "
 
961
  end
 
962
end
 
963
\end{verbatim}}
 
964
    \end{minipage}%
 
965
    \hfill
 
966
    \begin{minipage}[t]{0.65\linewidth}
 
967
%      \centering
 
968
        \includegraphics[width=4.8in]{3d_warped_geometry_white_bg}
 
969
    \end{minipage}
 
970
 \caption [3D Geometry Transformation Example]{3D mesh illustrating the ability to modify nodal coordinates using \texttt{USER
 
971
      DEFINED GEOMETRY TRANSFORMATION}.}
 
972
    \label{fig:3d_transform_example}
 
973
\end{figure}
 
974
 
 
975
 
 
976
\begin{figure}[t]
 
977
  \centering
 
978
    \begin{minipage}{0.3\linewidth}
 
979
{\ttfamily \begin{verbatim}
 
980
 
 
981
 
 
982
 
 
983
 
 
984
 
 
985
 
 
986
 
 
987
 
 
988
 
 
989
 
 
990
mesh
 
991
  rectilinear
 
992
    nx = 10
 
993
    ny = 10
 
994
    bx =  3
 
995
    by =  3
 
996
    gmin = -1.0 -1.0
 
997
    gmax =  1.0  1.0
 
998
  end
 
999
  user defined geometry transformation
 
1000
    "
 
1001
    double r = sqrt(inxcoord*inxcoord+inycoord*inycoord);
 
1002
    double theta = atan2(inycoord,inxcoord);
 
1003
    if(r > 0.5)
 
1004
     {
 
1005
       theta = theta + (3.14159 / 4.0)*((r-0.5)/0.5);
 
1006
       outxcoord = r*cos(theta);
 
1007
       outycoord = r*sin(theta);
 
1008
     }
 
1009
    "
 
1010
  end
 
1011
end
 
1012
\end{verbatim}}
 
1013
    \end{minipage}%
 
1014
    \hfill
 
1015
    \begin{minipage}[t]{0.65\linewidth}
 
1016
%      \centering
 
1017
        \includegraphics[width=3.8in]{mesh_warp_2d_white_bg}
 
1018
    \end{minipage}
 
1019
    \caption [2D Geometry Transformation Example]{2D mesh illustrating the ability to modify nodal coordinates using \texttt{USER
 
1020
      DEFINED GEOMETRY TRANSFORMATION}.}
 
1021
    \label{fig:2d_transform_example}
 
1022
\end{figure}
 
1023
 
 
1024
 
 
1025
\clearpage
 
1026
\subsection{User Defined Element Density}
 
1027
\label{sec:inline-element-density}
 
1028
\index{User Defined Element Density}
 
1029
 
 
1030
 
 
1031
{\ttfamily \small \begin{verbatim}
 
1032
USER DEFINED ELEMENT DENSITY, {I|J|K} 
 
1033
  "
 
1034
    user supplied `C' language instructions;
 
1035
  "
 
1036
END
 
1037
\end{verbatim}
 
1038
 
1039
 
 
1040
The \texttt{USER DEFINED ELEMENT DENSITY -- END} keyword pair provides
 
1041
a flexible way to bias \texttt{RECTILINEAR},
 
1042
\texttt{SPHERICAL}, and \texttt{CYLINDRICAL} meshes. The keyword-end
 
1043
pair must surround a double quote surrounded block of `C' code that
 
1044
evaluates on the input variable \texttt{coord} and sets the return
 
1045
value \texttt{field}. The return value \texttt{field} must be set to a
 
1046
positive value across the range of the mesh in the selected
 
1047
topological direction. A presentation of the capabilities and
 
1048
limitations of runtime compiled 'C' functions is included in
 
1049
Appendix~\ref{sec:runtime-compiler-functionality}.
 
1050
 
 
1051
The mesh biasing adjusts the nodal coordinates such that the density
 
1052
of the elements in a region of the mesh in the selected coordinate
 
1053
direction is proportional to the value of \texttt{field} relative to
 
1054
the integral of \texttt{field} across the mesh domain. This is
 
1055
implemented by numerically solving the equation given below. In this
 
1056
equation \begin {math} x _ i \end {math} is the coordinate of node
 
1057
\begin {math} i \end {math}, \begin {math} n \end {math} is the total
 
1058
number of nodes in the coordinate direction, and \begin {math} f(u)
 
1059
\end {math} is the user supplied function.
 
1060
 
 
1061
\begin{equation}
 
1062
   \frac {\int _ {0} ^ {x _ i} f(u)du } {\int _ {0} ^ {x _ n} f(u)du }
 
1063
   = \frac {i} {n} 
 
1064
\end{equation}
 
1065
 
 
1066
When these functions are applied to a two dimensional
 
1067
\texttt{RECTILINEAR} mesh spanning from $(0.0, 0.0)$ to $(1.0, 1.0)$ and
 
1068
having two blocks and 10 elements in both the 'I', and 'J' directions,
 
1069
the resulting mesh is graded as shown in
 
1070
Figure~\ref{fig:bias_example}.  The grading is a continuous
 
1071
exponential function in the 'I' direction and is a discontinuous
 
1072
function in the 'J' direction. In the 'J' direction the domain
 
1073
stretching from 0.0 to 0.5 has twice the element density as the range
 
1074
from 0.5 to 1.0.
 
1075
%\clearpage
 
1076
 
 
1077
Diagnostic information for the user provided functions is included in
 
1078
the \texttt{runid.out} file.  This information includes the total
 
1079
integrated value of the function, the minimum and maximum value of the
 
1080
function, and a plot of the function's values across the range of
 
1081
evaluation.
 
1082
 
 
1083
\begin{figure}[htbp]
 
1084
  \centering
 
1085
    \begin{minipage}{0.5\linewidth}
 
1086
{\ttfamily \begin{verbatim}
 
1087
user defined element density, i
 
1088
  "
 
1089
    field = 1.*exp(-5.*(coord));
 
1090
  "
 
1091
end
 
1092
user defined element density, j
 
1093
  "
 
1094
    field = 1;
 
1095
    if(coord < 0.5)  { field = 2;}
 
1096
    if(coord >= 0.5) { field = 1;}
 
1097
  "
 
1098
end
 
1099
\end{verbatim}}
 
1100
    \end{minipage}%
 
1101
    \hfill
 
1102
    \begin{minipage}{0.45\linewidth}
 
1103
      \centering
 
1104
        \includegraphics[width=2.8in]{bias_example}
 
1105
    \end{minipage}
 
1106
    \caption{2D mesh created with a \texttt{USER
 
1107
      DEFINED ELEMENT DENSITY}.}
 
1108
    \label{fig:bias_example}
 
1109
\end{figure}
 
1110
 
 
1111
\renewcommand{\textfraction}{0.2}
 
1112
\renewcommand{\topfraction}{0.7}
 
1113
\renewcommand{\bottomfraction}{0.3}
 
1114
\renewcommand{\floatpagefraction}{0.5}
 
1115
 
 
1116
\clearpage
 
1117
\subsection{Decomposition Strategy}
 
1118
\label{sec:inline-decomposition-strategy}
 
1119
\index{Decomposition Strategy}
 
1120
 
 
1121
{\ttfamily \begin{verbatim}
 
1122
DECOMPOSITION STRATEGY
 
1123
   {BISECTION}
 
1124
   {PROCESSOR LAYOUT}
 
1125
     {NUMPROCS, I, int (1)}
 
1126
     {NUMPROCS, J, int (1)}
 
1127
     {NUMPROCS, K, int (1)}
 
1128
   {END}
 
1129
   {SEQUENTIAL}
 
1130
   {RANDOM}
 
1131
END
 
1132
\end{verbatim}
 
1133
}
 
1134
 
 
1135
An optional \texttt{DECOMPOSITION STRATEGY -- END} block pair surrounds the description
 
1136
of the decomposition method used for parallel simulations. The default strategy is \texttt{BISECTION}. The keywords associated
 
1137
with the \texttt{DECOMPOSITION STRATEGY} keyword are given in
 
1138
Table~\ref{tab:inlinemesh-decomp_strat}.
 
1139
 
 
1140
\mthreecolumntable{
 
1141
  Keywords for \texttt{DECOMPOSITION STRATEGY -- END}.
 
1142
  \label{tab:inlinemesh-decomp_strat}
 
1143
}{
 
1144
\hline
 
1145
  Sub-Keyword & Input & Description \\
 
1146
 
 
1147
\hline \hline
 
1148
  \smallskip \texttt{BISECTION} & &
 
1149
       Recursively bisect domain making slices calculated to assign nearly equal numbers of elements to each processor. This option is the default. \\ \hline \smallskip
 
1150
  \begin{minipage} [c]{1.0\linewidth} \setlength{\parindent}{0.1in} \noindent \texttt{PROCESSOR LAYOUT} \\ \indent \texttt{NUMPROCS \{I|J|K\}}, int (1)  \\ \texttt{END} \end{minipage}  & \texttt{int} (1)&
 
1151
       Invokes a decomposition strategy that slices up the mesh in accordance with the request of the user.  The integer value value is number of segments into which the mesh should be divided in
 
1152
       the given direction. The product of the number of segments requested in each direction must equal the number of processors.  \\ \hline
 
1153
  \smallskip \texttt{SEQUENTIAL} & &
 
1154
       Invokes a decomposition strategy that distributes the elements between processors in sequential order. If there are k elements and n processors an average of k/n elements will go to each processor. \emph{This decomposition strategy is not for large simulations and is intended mainly for testing and verification purposes.}  \\ \hline
 
1155
  \smallskip \texttt{RANDOM} & &
 
1156
       Invokes a decomposition strategy that randomly distributes the elements between processors. It results in tremendous communications overhead. \emph{This decomposition strategy is not for production simulations and is intended mainly for testing and verification purposes.}\\ \hline
 
1157
}
 
1158
 
 
1159
The \texttt{BISECTION} decomposition strategy is the default for parallel calculations. This is
 
1160
because it is robust in providing decompositions and the resulting
 
1161
regions have satisfactory surface area to volume ratios. This strategy 
 
1162
attempts to automatically determine the number of slices to make through 
 
1163
the entire mesh domain to provide an equal number of elements to each processor. This strategy will be most successful when the number of processors, and the number of elements in each direction are a power of 2 or a product of several prime numbers.
 
1164
 
 
1165
The \texttt{PROCESSOR LAYOUT} decomposition strategy offers the user
 
1166
improved control of the distribution of elements to each
 
1167
processor in a parallel simulation. The strategy divides the mesh into the number of segments specified by the keyword-value pair for each coordinate direction. The number of
 
1168
processors must equal the product of the values given for each of the
 
1169
\texttt{NUMPROCS} directions. The default value for a coordinate direction is one.  
 
1170
 
 
1171
When using a \texttt{RADIAL TRISECTION} mesh the number of processors in the \texttt{I} (radial) direction is fixed at 1, and the total number of processors must be equal to the
 
1172
product of the values given for the \texttt{J} and \texttt{K}
 
1173
\texttt{NUMPROCS} directions. For this mesh type the decomposition
 
1174
assigns elements from the inner transition blocks to the processor
 
1175
that owns the adjacent elements in the outer cylinderical blocks.
 
1176
An example of the \texttt{PROCESSOR LAYOUT} decomposition option
 
1177
applied to a \texttt{RADIAL TRISECTION} mesh is shown in Figure \ref{fig:tri_dec}.
 
1178
 
 
1179
Examples of \texttt{BISECTION} and
 
1180
\texttt{PROCESSOR LAYOUT} decomposition options applied to a mesh definition with the
 
1181
\texttt{RADIAL} option are shown below in
 
1182
Figures~\ref{fig:dec_bis} and
 
1183
 \ref{fig:dec_pl}. The total
 
1184
number of elements in this problem was 204, 17 in the radial or
 
1185
\texttt{I} direction and 12 in the azimuthal or \texttt{J} direction.
 
1186
 
 
1187
For the \texttt{BISECTION} decomposition the recursive cuts made on
 
1188
the 17x12x1 array of elements results in three processors with 3x12x1 elements,
 
1189
four processors with 2x12x1
 
1190
elements and a single processor 6x8x1 elements. 
 
1191
 
 
1192
For the \texttt{PROCESSOR LAYOUT} decomposition the
 
1193
17 elements in the \texttt{I} or radial direction are divided by 4 to
 
1194
set the size of segments produced in that direction at 4. The first segment's size is increased by one to handle the remainder of dividing 14 by 4. This decomposition would equally
 
1195
distribute elements to each processor if the \texttt{I} direction had a number of
 
1196
elements evenly divisible by 4.
 
1197
 
 
1198
\begin{figure}[htbp]
 
1199
\centering
 
1200
  \begin{minipage}[c]{0.4\linewidth}
 
1201
    \centering
 
1202
{\ttfamily \begin{verbatim}
 
1203
mesh
 
1204
  radial
 
1205
    numz 1
 
1206
      zblock 1 10.0 interval 1
 
1207
    numr 4 initial radius 1.
 
1208
      rblock 1 2. interval 3
 
1209
      rblock 2 4. interval 3
 
1210
      rblock 3 6. interval 5
 
1211
      rblock 4 8. interval 6
 
1212
    numa 1
 
1213
      ablock 1 60. interval 12
 
1214
  end
 
1215
  decomposition strategy
 
1216
    bisection
 
1217
  end
 
1218
end
 
1219
\end{verbatim}}
 
1220
  \end{minipage}%
 
1221
  \hfil
 
1222
  \begin{minipage}[c]{0.6\linewidth}
 
1223
    \centering
 
1224
      \includegraphics[width=2.0in]{bisect_7_white}
 
1225
  \end{minipage}
 
1226
  \caption [\texttt{BISECTION} decomposition run on 7 processors.] {Three dimensional \texttt{RADIAL} mesh with azimuthal
 
1227
    angle of 60 degrees run on 7 processors using \texttt{BISECTION} decomposition.}
 
1228
  \label{fig:dec_bis}
 
1229
\end{figure}
 
1230
 
 
1231
 
 
1232
\begin{figure}[htbp]
 
1233
\centering
 
1234
  \begin{minipage}[c]{0.4\linewidth}
 
1235
    \centering
 
1236
{\ttfamily \begin{verbatim}
 
1237
mesh
 
1238
  radial
 
1239
    numz 1
 
1240
      zblock 1 10.0 interval 1
 
1241
    numr 4 initial radius 1.
 
1242
      rblock 1 2. interval 3
 
1243
      rblock 2 4. interval 3
 
1244
      rblock 3 6. interval 5
 
1245
      rblock 4 8. interval 6
 
1246
    numa 1
 
1247
      ablock 1 60. interval 12
 
1248
  end
 
1249
  decomposition strategy
 
1250
    numprocs i, 4
 
1251
    numprocs j, 2
 
1252
  end
 
1253
end
 
1254
\end{verbatim}}
 
1255
  \end{minipage}%
 
1256
  \hfil
 
1257
  \begin{minipage}[c]{0.6\linewidth}
 
1258
    \centering
 
1259
      \includegraphics[width=2.0in]{numprocs_8}
 
1260
  \end{minipage}
 
1261
  \caption [\texttt{PROCESSOR LAYOUT} decomposition run on 8 processors.] {Three dimensional \texttt{RADIAL} mesh with azimuthal
 
1262
    angle of 60 degrees run on 8 processors using \texttt{PROCESSOR LAYOUT} decomposition.}
 
1263
  \label{fig:dec_pl}
 
1264
\end{figure}
 
1265
\begin{figure}[htbp]
 
1266
\centering
 
1267
  \begin{minipage}[c]{0.4\linewidth}
 
1268
    \centering
 
1269
{\ttfamily \begin{verbatim}
 
1270
mesh
 
1271
  radial trisection
 
1272
    trisection blocks, 4
 
1273
    numz 1
 
1274
      zblock 1 4.0 interval 1
 
1275
    numr 3 
 
1276
       rblock 1 2. interval 4
 
1277
       rblock 2 3. interval 4
 
1278
       rblock 3 5. interval 4
 
1279
    numa 1
 
1280
      ablock 1 360. interval 32
 
1281
  end
 
1282
  decomposition strategy
 
1283
    numprocs j, 8
 
1284
  end
 
1285
end
 
1286
\end{verbatim}}
 
1287
  \end{minipage}%
 
1288
  \hfil
 
1289
  \begin{minipage}[c]{0.6\linewidth}
 
1290
    \centering
 
1291
      \includegraphics[width=2.0in]{trisection_decomp}
 
1292
  \end{minipage}
 
1293
  \caption [\texttt{PROCESSOR LAYOUT} decomposition on 8 processors.] {Three dimensional \texttt{RADIAL TRISECTION} mesh run on 8 processors using \texttt{PROCESSOR LAYOUT} decomposition.}
 
1294
  \label{fig:tri_dec}
 
1295
\end{figure}
 
1296
 
 
1297
 
 
1298
\clearpage
 
1299
\section{Library Interface}\label{sec:execution_steps}
 
1300
\subsection{Creating a Mesh}
 
1301
Mesh creation proceeds through a single function call. Additional functions are available to access messages generated during the mesh creation.
 
1302
\subsubsection{Create\_Pamgen\_Mesh}
 
1303
{\ttfamily  \begin{verbatim}
 
1304
int Create_Pamgen_Mesh( char * file_char_array,
 
1305
                        int dimension,
 
1306
                        int rank,
 
1307
                        int num_procs);
 
1308
\end{verbatim}}
 
1309
This function creates a representation of the mesh for the processor of the specified rank out of the total num\_procs. It returns an enumerated value. A return value of \textbf{ERROR\_FREE\_CREATION
 
1310
} signifies success. A return value of \textbf{ERROR\_CREATING\_IMD} significes an error in the specification of the mesh geometry, topology, or boundary conditions. A return value of \textbf{ERROR\_CREATING\_MS} significes an error in allocating and populating the arrays that store the mesh geometry and topology. A return value of \textbf{ERROR\_PARSING\_DEFINITION} significes an error occurred while parsing the string passed in file\_char\_array. The details of the syntax error are recoverable by subsequent calls.
 
1311
 
 
1312
%\begin{itemize}
 
1313
{
 
1314
\setlength{\parindent}{0pt}
 
1315
 
 
1316
 \textbf{char *file\_char\_array}
 
1317
This input variable points to a null terminated string that holds a terse description of the desired mesh.  This form of this description is given in a later section.
 
1318
 
 
1319
 \textbf{int dimension}
 
1320
This input variable indicates the dimension of the desired mesh. Acceptable values are 2 (quadrilaterals created in x,y plane) and 3 (hexahedral elements created in 3 space).
 
1321
 
 
1322
 \textbf{int rank}
 
1323
This input variable may range from 0 to one less than num\_procs. It specifies for which processor the mesh is being generated.
 
1324
 
 
1325
 \textbf{int num\_procs}
 
1326
This input variable must be greater than 0.  It specifes the total number of processors across which the mesh is decomposed.
 
1327
}
 
1328
%\end{itemize}
 
1329
\subsubsection{getPamgenEchoStreamSize}
 
1330
{\ttfamily  \begin{verbatim}
 
1331
int getPamgenEchoStreamSize(void);
 
1332
\end{verbatim}}
 
1333
 
 
1334
This function returns the size of the string (not counting termination character) that contains an echo of the \textbf{char * file\_char\_array} string previously passed to Create\_Pamgen\_Mesh. If a parsing error occurred, this string will be annotated with a summary of the error. Use of this function and subsequent access and display of this string is highly recommended if the value pointed to by \textbf{int * parse\_error\_count} is non-zero on return. 
 
1335
 
 
1336
\subsubsection{getPamgenEchoStream}
 
1337
{\ttfamily  \begin{verbatim}
 
1338
char * getPamgenEchoStream(char * echo_stream_pointer);
 
1339
\end{verbatim}}
 
1340
This function takes a character pointer and returns that same pointer after it has been filled.
 
1341
 
 
1342
{\setlength{\parindent}{0pt}
 
1343
 \textbf{char *echo\_stream\_pointer} This input variable must point to allocated memory big enough to hold the the results of ``getEchoStreamSize(void)'' plus a termination character.
 
1344
}
 
1345
 
 
1346
\subsubsection{getPamgenErrorStreamSize}
 
1347
{\ttfamily  \begin{verbatim}
 
1348
int getPamgenErrorStreamSize(void);
 
1349
\end{verbatim}}
 
1350
This function returns the size of an error string associated with a return value of \textbf{ERROR\_CREATING\_MS} from Create\_Pamgen\_Mesh.
 
1351
 
 
1352
 
 
1353
\subsubsection{getPamgenErrorStream}
 
1354
{\ttfamily  \begin{verbatim}
 
1355
char * getPamgenErrorStream(char * error_stream_pointer);
 
1356
\end{verbatim}}
 
1357
This function takes a character pointer and returns that same pointer after it has been filled.
 
1358
 
 
1359
{\setlength{\parindent}{0pt}
 
1360
 \textbf{char *error\_stream\_pointer} This input variable must point to allocated memory big enough to hold the the results of getErrorStreamSize plus a termination character.
 
1361
}
 
1362
 
 
1363
 
 
1364
\subsubsection{getPamgenWarningStreamSize}
 
1365
{\ttfamily  \begin{verbatim}
 
1366
int getPamgenWarningStreamSize(void);
 
1367
\end{verbatim}}
 
1368
This function returns the size of a string containing warnings generated within the Create\_Pamgen\_Mesh function.
 
1369
 
 
1370
\subsubsection{getPamgenWarningStream}
 
1371
{\ttfamily  \begin{verbatim}
 
1372
char * getPamgenWarningStream(char * warning_stream_pointer);
 
1373
\end{verbatim}}
 
1374
This function takes a character pointer and returns that same pointer after it has been filled.
 
1375
 
 
1376
{\setlength{\parindent}{0pt}
 
1377
 \textbf{char *warning\_stream\_pointer} This input variable must point to allocated memory big enough to hold the the results of getWarningStreamSize plus a termination character.
 
1378
}
 
1379
 
 
1380
\subsubsection{getPamgenInfoStreamSize}
 
1381
{\ttfamily  \begin{verbatim}
 
1382
int getPamgenInfoStreamSize(void);
 
1383
\end{verbatim}}
 
1384
This function returns the size of a string containing information messages generated within the Create\_Pamgen\_Mesh function. These messages include information such as the total number of elements in the mesh, the total number of nodes in the mesh, and the mesh distribution based on decomposition.
 
1385
 
 
1386
\subsubsection{getPamgenInfoStream}
 
1387
{\ttfamily  \begin{verbatim}
 
1388
char * getPamgenInfoStream(char * info_stream_pointer);
 
1389
\end{verbatim}}
 
1390
This function takes a character pointer and returns that same pointer after it has been filled.
 
1391
 
 
1392
{\setlength{\parindent}{0pt}
 
1393
 \textbf{char *info\_stream\_pointer} This input variable must point to allocated memory big enough to hold the the results of getInfoStreamSize plus a termination character.
 
1394
}
 
1395
\clearpage
 
1396
\subsection{Querying a Mesh}
 
1397
All of the mesh query and access functions are based on the \texttt{EXODUS II} ~\cite{Schoof-Yarberry:1995} and \texttt{NEMESIS} ~\cite{Hennigan-StJohn-Shadid:1998} APIs. These APIs were written to standardize a platform independent interface for writing and reading binary mesh specification files. \texttt{NEMESIS} is a parallel extension of the serial \texttt{EXODUS II} API.  The \textsc{pamgen} function names are formed by prefixing the \texttt{EXODUS II} or \texttt{NEMESIS} function name with \textbf{im\_}. The remainder of the function signature and functionality remains unchanged. It may help to note that the original \texttt{EXODUS II} functions begin with \textbf{ex\_}, and the original \texttt{NEMESIS} functions begin with \textbf{ne\_}. 
 
1398
 
 
1399
Querying a mesh database to build up a complete representation in accessible memory is a straightforward process.  Typically a query function is used to ascertain the number of items in an array, then memory is allocated and passed in through an access function which fills the memory with the requested information. The query and access functions will be presented in the same order they appear in the example function ``read\_mesh\_to\_memory()'' shown in Appendix~\ref{sec:read-mesh-to-memory}.
 
1400
 
 
1401
 
 
1402
\subsubsection{im\_ex\_get\_init}
 
1403
{\ttfamily  \begin{verbatim}
 
1404
int im_ex_get_init( int exoid,
 
1405
                    char *title,
 
1406
                    int  *num_dim,
 
1407
                    int  *num_nodes,
 
1408
                    int  *num_elem, 
 
1409
                    int  *num_elem_blk,
 
1410
                    int  *num_node_sets,
 
1411
                    int  *num_side_sets);
 
1412
\end{verbatim}}
 
1413
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. The number of nodes, elements, element blocks is limited to those entities local to the rank processor for which the mesh was created. It returns a non-zero value if an error occurs.
 
1414
 
 
1415
{\setlength{\parindent}{0pt}
 
1416
 \textbf{int exoid} An unused input variable.\par
 
1417
 \textbf{char *title} A title string containing ``PAMGEN Inline Mesh''.\par
 
1418
 \textbf{char *num\_dim} On return points to the number of coordinates per node (2 or 3).\par
 
1419
 \textbf{char *num\_nodes} On return points to the number of nodes.\par
 
1420
 \textbf{char *num\_elem} On return points to the number of elements.\par
 
1421
 \textbf{char *num\_elem\_blk} On return points to the number of element blocks.\par
 
1422
 \textbf{char *num\_node\_sets} On return points to the number of node sets.\par
 
1423
 \textbf{char *num\_side\_sets} On return points to the number of side sets.\par
 
1424
}
 
1425
 
 
1426
\subsubsection{im\_ex\_inquire}
 
1427
{\ttfamily  \begin{verbatim}
 
1428
int im_ex_inquire( int exoid,   
 
1429
                   int query_value,
 
1430
                   int *int_value,
 
1431
                   float *float_value,
 
1432
                   char * char_array_value);
 
1433
\end{verbatim}}
 
1434
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. This is a general purpose query function that takes an enumerated query value and changes the value pointed to by int\_value, float\_value, or char\_array\_value depending on the data requested by the query\_value. It returns a non-zero value in case of error. Im\_ex\_inquire supports the following query values:
 
1435
\begin{itemize}\addtolength{\itemsep}{-0.5\baselineskip}\renewcommand{\labelitemi}{}
 
1436
        \item \textbf{IM\_EX\_INQ\_NS\_NODE\_LEN} The length of the concatenated nodeset list is returned in int\_value.
 
1437
        \item \textbf{IM\_EX\_INQ\_NS\_DF\_LEN} The length of the concatenated nodeset distribution list is returned in int\_value.
 
1438
        \item \textbf{IM\_EX\_INQ\_SS\_ELEM\_LEN} The length of the concatenated sidesets element list is returned in int\_value.
 
1439
        \item \textbf{IM\_EX\_INQ\_SS\_NODE\_LEN} The aggregate length of the sideset nodes is returned in int\_value.
 
1440
        \item \textbf{IM\_EX\_INQ\_SS\_DF\_LEN } The length of the concatenated side sets distribution factor is returned in int\_alue.
 
1441
        \item \textbf{IM\_EX\_INQ\_API\_VERS} The API version is returned in float\_value.
 
1442
        \item \textbf{IM\_EX\_INQ\_EB\_PROP} The number of element block properties is returned in int\_value.
 
1443
        \item \textbf{IM\_EX\_INQ\_NS\_PROP} The number of node sets properties is returned in int\_value.
 
1444
        \item \textbf{IM\_EX\_INQ\_SS\_PROP} The number of side set properties is returned in int\_value.
 
1445
        \item \textbf{IM\_EX\_INQ\_QA} The number of QA records is returned in int\_value.
 
1446
        \item \textbf{IM\_EX\_INQ\_INFO} The number of INFO records is returned in int\_value.
 
1447
         
 
1448
\end{itemize} 
 
1449
 
 
1450
\subsubsection{im\_ex\_get\_coord}
 
1451
{\ttfamily  \begin{verbatim}
 
1452
int im_ex_get_coord( int exoid, 
 
1453
                     double* x_coors,
 
1454
                     double* y_coors,
 
1455
                     double* z_coors);
 
1456
\end{verbatim}}
 
1457
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. This function takes pointers to memory allocated to a length equal to the number of nodes local to the processor and fills in the nodal coordinate values. A non-zero return value indicates an error.
 
1458
 
 
1459
{\setlength{\parindent}{0pt}
 
1460
 \textbf{int exoid} Unused input variable.}
 
1461
 
 
1462
{\setlength{\parindent}{0pt}
 
1463
 \textbf{double * x\_coors} Returned X coordinates of the nodes.}
 
1464
 
 
1465
{\setlength{\parindent}{0pt}
 
1466
 \textbf{double * y\_coors} Returned Y coordinates of the nodes.}
 
1467
 
 
1468
{\setlength{\parindent}{0pt}
 
1469
 \textbf{double * z\_coors} Returned Z coordinates of the nodes (if num\_dim = 3).}
 
1470
 
 
1471
 
 
1472
\subsubsection{im\_ex\_get\_coord\_names}
 
1473
{\ttfamily  \begin{verbatim}
 
1474
int im_ex_get_coord_names( int exoid,
 
1475
                           char ** coord_names);
 
1476
\end{verbatim}}
 
1477
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. It returns the names of the coordinates. A non-zero return indicates an error.
 
1478
 
 
1479
{\setlength{\parindent}{0pt}
 
1480
 \textbf{int exoid} Unused input variable.}
 
1481
 
 
1482
{\setlength{\parindent}{0pt}
 
1483
 \textbf{char ** coord\_names} Returned vector pointing to num\_dim coord names. \textbf{coord\_names} can be declared and allocated as shown below.}
 
1484
{\ttfamily  \begin{verbatim}
 
1485
char* coord_names[3];
 
1486
for(int i = 0; i < num_dim; i++)
 
1487
   coord_names[i] = (char*)calloc((MAX_STR_LENGTH+1),sizeof(char));
 
1488
\end{verbatim}}
 
1489
 
 
1490
\subsubsection{im\_ex\_get\_map}
 
1491
{\ttfamily  \begin{verbatim}
 
1492
int im_ex_get_map( int exoid,
 
1493
                   int * element_map);
 
1494
\end{verbatim}}
 
1495
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. It loads the global element numbers into the provided storage. A non-zero return value indicates an error.
 
1496
 
 
1497
{\setlength{\parindent}{0pt}
 
1498
 \textbf{int exoid} Unused input variable.}
 
1499
 
 
1500
{\setlength{\parindent}{0pt}
 
1501
 \textbf{int * element\_map} On return this array holds the global element ids of the elements local to this processor. For a serial problem this runs sequentially from 1 to num\_elem. Memory sized to num\_elem must be allocated prior to making this call.}
 
1502
 
 
1503
\subsubsection{im\_ex\_get\_elem\_num\_map}
 
1504
{\ttfamily  \begin{verbatim}
 
1505
int im_ex_get_elem_num_map( int exoid,
 
1506
                            int * element_num_map);
 
1507
\end{verbatim}}
 
1508
For \textsc{pamgen} this function is identical to ``im\_ex\_get\_map''.
 
1509
 
 
1510
{\setlength{\parindent}{0pt}
 
1511
 \textbf{int exoid} Unused input variable.}
 
1512
 
 
1513
{\setlength{\parindent}{0pt}
 
1514
 \textbf{int * element\_num\_map}  On return this array holds the global element ids of the elements local to this processor. For a serial problem these values run sequentially from 1 to num\_elem. Memory sized to num\_elem must be allocated prior to making this call.}
 
1515
 
 
1516
\subsubsection{im\_ex\_get\_node\_num\_map}
 
1517
{\ttfamily  \begin{verbatim}
 
1518
int im_ex_get_node_num_map( int exoid,
 
1519
                            int * node_num_map);
 
1520
\end{verbatim}}
 
1521
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. It loads the global node numbers into the provided storage. A non-zero return indicates an error.
 
1522
 
 
1523
{\setlength{\parindent}{0pt}
 
1524
 \textbf{int exoid} Unused input variable.}
 
1525
 
 
1526
{\setlength{\parindent}{0pt}
 
1527
 \textbf{int * node\_num\_map}  On return this array holds the global node ids of the nodes local to this processor. For a serial problem this runs from 1 to num\_nodes. Memory sized to num\_nodes must be allocated prior to making this call.}
 
1528
%element block ids
 
1529
\subsubsection{im\_ex\_get\_elem\_blk\_ids}
 
1530
{\ttfamily  \begin{verbatim}
 
1531
int im_ex_get_elem_blk_ids( int exoid,
 
1532
                            int * elem_blk_ids);
 
1533
\end{verbatim}}
 
1534
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. It loads the element block ids into the provided storage. A non-zero return value indicates an error.
 
1535
 
 
1536
{\setlength{\parindent}{0pt}
 
1537
 \textbf{int exoid} Unused input variable.}
 
1538
 
 
1539
{\setlength{\parindent}{0pt}
 
1540
 \textbf{int * elem\_blk\_ids}  On return this array holds the ids of the element blocks on this processor. For \textsc{pamgen} meshes the element block ids across the entire problem will run sequentially from 1 to num\_elem\_blk. On any particular processor of a parallel mesh any set of the global element blocks may be present. Storage sized to num\_elem\_blk must be allocated prior to making this call.}
 
1541
 
 
1542
\subsubsection{im\_ex\_get\_elem\_block}
 
1543
{\ttfamily  \begin{verbatim}
 
1544
int im_ex_get_elem_block( int exoid,
 
1545
                          int elem_blk_id,
 
1546
                          char * elem_type,
 
1547
                          int * num_elem_this_blk,
 
1548
                          int * num_nodes_per_elem,
 
1549
                          int * num_attr);
 
1550
\end{verbatim}}
 
1551
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. It provides information about the requested element block.  Review of the conventions documented in the \texttt{EXODUS II} manual is the most effective way to understand the mesh storage and retrieval. Under the \texttt{EXODUS II} convention, a finite element mesh is composed of one or more blocks of elements. Each block contains elements of the same type. Within a block, all elements have the same number of nodes and the same connectivity convention. The number of nodes is stored explicitly, and the connectivity convention is called out by a string. This string corresponds to a table of conventional element connectivities in the \texttt{EXODUS II} manual. A non-zero return value indicates an error.
 
1552
 
 
1553
{\setlength{\parindent}{0pt}
 
1554
 \textbf{int exoid} Unused input variable.}
 
1555
 
 
1556
{\setlength{\parindent}{0pt}
 
1557
 \textbf{int elem\_blk\_id}  Input variable specifying the id of the block for which information is requested. This id must be one of the values in the elem\_blk\_ids array.}
 
1558
 
 
1559
{\setlength{\parindent}{0pt}
 
1560
 \textbf{char * elem\_type}  On return this variable holds one of the standard \texttt{EXODUS II} element types as a string. The element\_type pointer must be allocated as length MAX\_STR\_LENGTH+1. For \textsc{pamgen} the stored value will be QUAD in 2D or HEX in 3D.}
 
1561
 
 
1562
{\setlength{\parindent}{0pt}
 
1563
 \textbf{int * num\_elem\_this\_blk}  On return this variable holds the number of elements in this block. }
 
1564
 
 
1565
{\setlength{\parindent}{0pt}
 
1566
 \textbf{int * num\_nodes\_per\_elem}  On return this variable holds the number of nodes per element for the elements in this block. }
 
1567
 
 
1568
{\setlength{\parindent}{0pt}
 
1569
 \textbf{int * num\_attr}  On return this variable holds the number of attributes for this block for \textsc{pamgen} this is always 0. }
 
1570
 
 
1571
\subsubsection{im\_ex\_get\_elem\_conn}
 
1572
{\ttfamily  \begin{verbatim}
 
1573
int im_ex_get_elem_conn( int exoid,
 
1574
                         int elem_blk_id,
 
1575
                         int * connect);
 
1576
\end{verbatim}}
 
1577
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. It fills the storage pointed to by connect with the connectivity of the elements in the block referred to by elem\_blk\_id. A non-zero return value indicates an error.
 
1578
 
 
1579
{\setlength{\parindent}{0pt}
 
1580
 \textbf{int exoid} Unused input variable.}
 
1581
 
 
1582
{\setlength{\parindent}{0pt}
 
1583
 \textbf{int elem\_blk\_id}  Input variable specifying the id of the block for which information is requested. This id must be one of the values in the elem\_blk\_ids array.}
 
1584
 
 
1585
{\setlength{\parindent}{0pt}
 
1586
 \textbf{int * connect}  On return the storage pointed to by \textbf{connect} holds the connectivity for the requested block. \textbf{Connect} must point to storage sized to num\_elem\_this\_block*num\_nodes\_per\_elem. \textbf{Connect} holds (in the order specified by the \texttt{EXODUS II} convention) the nodes of each element in the specified block. The first element's connectivity begins at an offset of 0 and the nth element's connectivity begins at an offset of n*num\_nodes\_per\_element. The \texttt{EXODUS II} standard specifies that the indices of the connectivity are numbered  from 1 so that in order to retrieve the coordinates of an element's nodes the indices given in \textbf{connect} must be decrimented by 1.}
 
1587
 
 
1588
\subsubsection{im\_ex\_get\_node\_set\_ids}
 
1589
{\ttfamily  \begin{verbatim}
 
1590
int im_ex_get_node_set_ids( int exoid,
 
1591
                            int * node_set_ids);
 
1592
\end{verbatim}}
 
1593
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. It loads the node set ids into the provided storage. Node set ids are specified in the string passed to the Create\_Pamgen\_Mesh function. By convention they must be non-zero and positive. A non-zero return value indicates an error.
 
1594
 
 
1595
{\setlength{\parindent}{0pt}
 
1596
 \textbf{int exoid} Unused input variable.}
 
1597
 
 
1598
{\setlength{\parindent}{0pt}
 
1599
 \textbf{int * node\_set\_ids}  On return this array holds the ids of the node sets on this processor.  Storage sized to num\_node\_sets must be allocated prior to making this call.}
 
1600
 
 
1601
 
 
1602
\subsubsection{im\_ex\_get\_node\_set\_param}
 
1603
{\ttfamily  \begin{verbatim}
 
1604
int im_ex_get_node_set_param( int exoid,
 
1605
                              int node_set_id,
 
1606
                              int * num_nodes_in_node_set,
 
1607
                              int * num_df_in_node_set);
 
1608
\end{verbatim}}
 
1609
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. It function provides sizing information for node set data. A non-zero return value indicates an error.
 
1610
 
 
1611
{\setlength{\parindent}{0pt}
 
1612
 \textbf{int exoid} Unused input variable.}
 
1613
 
 
1614
{\setlength{\parindent}{0pt}
 
1615
 \textbf{int node\_set\_id}  Input variable specifying the id of the node set for which information is requested. This id must be one of the values in the node\_set\_ids array.}
 
1616
 
 
1617
{\setlength{\parindent}{0pt}
 
1618
 \textbf{int * num\_nodes\_in\_node\_set}  On return this variable is set to the number of nodes in the specified node set.}
 
1619
 
 
1620
{\setlength{\parindent}{0pt}
 
1621
 \textbf{int * num\_df\_in\_node\_set}  On return this variable is set to the number of df in the specified node set. Distribution factors are scalar values linked to the members of node sets or side sets. \textsc{pamgen} does not produce any distribution factors on node sets or side sets. For \textsc{pamgen} this will be 0.}
 
1622
 
 
1623
 
 
1624
\subsubsection{im\_ex\_get\_node\_set}
 
1625
{\ttfamily  \begin{verbatim}
 
1626
int im_ex_get_node_set( int exoid,
 
1627
                        int node_set_id,
 
1628
                        int * node_set_node_list);
 
1629
\end{verbatim}}
 
1630
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. On return the provided storage is populated with the local nodes of the node set.
 
1631
 
 
1632
{\setlength{\parindent}{0pt}
 
1633
 \textbf{int exoid} Unused input variable.}
 
1634
 
 
1635
{\setlength{\parindent}{0pt}
 
1636
 \textbf{int node\_set\_id}  Input variable specifying the id of the node set for which information is requested. This id must be one of the values in the node\_set\_ids array.}
 
1637
 
 
1638
{\setlength{\parindent}{0pt}
 
1639
 \textbf{int * node\_set\_node\_list}  On return this array holds the local ids of the nodes in the node set. The ids are numbered from 1. Storage must be sized for num\_nodes\_in\_nodeset.}
 
1640
 
 
1641
 
 
1642
\subsubsection{im\_ex\_get\_side\_set\_ids}
 
1643
{\ttfamily  \begin{verbatim}
 
1644
int im_ex_get_side_set_ids( int exoid,
 
1645
                            int * side_set_ids);
 
1646
\end{verbatim}}
 
1647
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. It loads the side set ids into the provided storage. Side set ids are specified in the string passed to the Create\_Pamgen\_Mesh function. By convention they must be non-zero and positive. A non-zero return value indicates an error.
 
1648
 
 
1649
{\setlength{\parindent}{0pt}
 
1650
 \textbf{int exoid} Unused input variable.}
 
1651
 
 
1652
{\setlength{\parindent}{0pt}
 
1653
 \textbf{int * side\_set\_ids}  On return this array holds the ids of the side sets on this processor.  Storage sized to num\_side\_sets must be allocated prior to making this call.}
 
1654
 
 
1655
 
 
1656
\subsubsection{im\_ex\_get\_side\_set\_param}
 
1657
{\ttfamily  \begin{verbatim}
 
1658
int im_ex_get_side_set_param( int exoid,
 
1659
                              int side_set_id,
 
1660
                              int * num_sides_in_side_set,
 
1661
                              int * num_df_in_side_set);
 
1662
\end{verbatim}}
 
1663
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. It provides sizing information for side set data. A non-zero return value indicates an error.
 
1664
 
 
1665
{\setlength{\parindent}{0pt}
 
1666
 \textbf{int exoid} Unused input variable.}
 
1667
 
 
1668
{\setlength{\parindent}{0pt}
 
1669
 \textbf{int side\_set\_id}  Input variable specifying the id of the side set for which information is requested. This id must be one of the values in the side\_set\_ids array.}
 
1670
 
 
1671
{\setlength{\parindent}{0pt}
 
1672
 \textbf{int * num\_sides\_in\_side\_set}  On return this variable is set to the number of sides in the specified side set.}
 
1673
 
 
1674
{\setlength{\parindent}{0pt}
 
1675
 \textbf{int * num\_df\_in\_side\_set}  On return this variable is set to the number of df in the specified side set.  Distribution factors are scalar values linked to the members of node sets or side sets. \textsc{pamgen} does not produce any distribution factors on node sets or side sets. For \textsc{pamgen} this will be 0.}
 
1676
 
 
1677
 
 
1678
 
 
1679
 
 
1680
\subsubsection{im\_ex\_get\_side\_set}
 
1681
{\ttfamily  \begin{verbatim}
 
1682
int im_ex_get_side_set( int exoid,
 
1683
                        int side_set_id,
 
1684
                        int * side_set_element_list,
 
1685
                        int * side_set_side_list);
 
1686
\end{verbatim}}
 
1687
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. It populates storage that specifies the sides of elements that are in a particular side set. The \texttt{EXODUS II} convention specifies a side by listing an element id and the side of that element that is in the sideset. This information is provided in two corresponding arrays of equal length. The sides specify a set of nodes on the element by reference to element topology tables in the \texttt{EXODUS II} manual. A non-zero return value indicates an error.
 
1688
 
 
1689
{\setlength{\parindent}{0pt}
 
1690
 \textbf{int exoid} Unused input variable.}
 
1691
 
 
1692
{\setlength{\parindent}{0pt}
 
1693
 \textbf{int side\_set\_id}  Input variable specifying the id of the side set for which information is requested. This id must be one of the values in the side\_set\_ids array.}
 
1694
 
 
1695
{\setlength{\parindent}{0pt}
 
1696
 \textbf{int * side\_set\_element\_list}  On return this array holds the local ids of the elements having sides in the side set.  Storage must be sized for num\_sides\_in\_sideset.}
 
1697
 
 
1698
{\setlength{\parindent}{0pt}
 
1699
 \textbf{int * side\_set\_side\_list}  On return this array holds the sides that are in the side set.  Storage must be sized for num\_sides\_in\_sideset.}
 
1700
 
 
1701
 
 
1702
\subsubsection{im\_ex\_get\_qa}
 
1703
{\ttfamily  \begin{verbatim}
 
1704
int im_ex_get_qa( int exoid,
 
1705
                  char * qa_record[][4]);
 
1706
\end{verbatim}}
 
1707
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. It populates previously allocated qa\_record storage with Quality Assurance (QA) information. By convention the four components of each record are:
 
1708
 
 
1709
\begin{enumerate}\addtolength{\itemsep}{-0.5\baselineskip}
 
1710
  \item The analysis code name\par
 
1711
  \item The analysis code QA descriptor\par
 
1712
  \item The analysis time
 
1713
  \item The analysis date
 
1714
\end{enumerate}
 
1715
\textsc{pamgen} will return ``PAMGEN'', ``Parallel Mesh Generator'' and then two copies of the date and time. A non-zero return value indicates an error.
 
1716
 
 
1717
{\setlength{\parindent}{0pt}
 
1718
 \textbf{int exoid} Unused input variable.}
 
1719
 
 
1720
{\setlength{\parindent}{0pt}
 
1721
 \textbf{char * qa\_record[][4]} Previously allocated storage that is filled with QA records. The memory may be allocated as shown below.}
 
1722
{\ttfamily  \begin{verbatim}
 
1723
 char * qa_record[10][4];
 
1724
 for(int i = 0; i < 10; i++)
 
1725
    for(int j=0; j<4; j++) qa_record[i][j] = (char*)malloc(MAX_STR_LENGTH+1);
 
1726
\end{verbatim}}
 
1727
 
 
1728
\subsubsection{im\_ex\_get\_info}
 
1729
{\ttfamily  \begin{verbatim}
 
1730
int im_ex_get_info( int exoid,
 
1731
                    char ** info_record);
 
1732
\end{verbatim}}
 
1733
This function is based on the \texttt{EXODUS II} API and is concerned only with serial information. It populates previously allocated info\_record storage. A non-zero return value indicates an error.
 
1734
 
 
1735
{\setlength{\parindent}{0pt}
 
1736
 \textbf{int exoid} Unused input variable.}
 
1737
 
 
1738
{\setlength{\parindent}{0pt}
 
1739
 \textbf{char ** info\_record} Previously allocated storage into which info records are copied. At present for \textsc{pamgen} num\_info\_records is zero. Memory should would be allocated as  shown below.}
 
1740
{\ttfamily  \begin{verbatim}
 
1741
 char ** info_record;
 
1742
 info_record = (char**)malloc(num_info_records*sizeof(char*));
 
1743
 for(int i = 0; i < num_info_records; i++)
 
1744
    info_record[i] = (char*)malloc(MAX_STR_LENGTH+1);
 
1745
\end{verbatim}}
 
1746
 
 
1747
\subsubsection{im\_ne\_get\_init\_global}
 
1748
This function is adapted from the \texttt{NEMESIS} API. It is typically the first function called when gathering information about the parallel nature of the mesh. It retrieves the mesh sizing information for the complete mesh. A non-zero return value indicates an error.
 
1749
{\ttfamily  \begin{verbatim}
 
1750
int im_ne_get_init_global( int   neid,  
 
1751
                           int  *num_nodes_global,
 
1752
                           int  *num_elems_global,      
 
1753
                           int  *num_elem_blks_global,
 
1754
                           int  *num_node_sets_global,
 
1755
                           int  *num_side_sets_global );
 
1756
\end{verbatim}}
 
1757
 
 
1758
{\setlength{\parindent}{0pt}
 
1759
 \textbf{int neid} Unused input variable.}
 
1760
 
 
1761
{\setlength{\parindent}{0pt}
 
1762
 \textbf{int * num\_nodes\_global} On return this variable is set to the total number of nodes in the mesh.}
 
1763
 
 
1764
{\setlength{\parindent}{0pt}
 
1765
 \textbf{int * num\_elems\_global} On return this variable is set to the total number of elements in the mesh.}
 
1766
 
 
1767
{\setlength{\parindent}{0pt}
 
1768
 \textbf{int * num\_elem\_blks\_global} On return this variable is set to the total number of element blocks in the mesh.}
 
1769
 
 
1770
{\setlength{\parindent}{0pt}
 
1771
 \textbf{int * num\_node\_sets\_global} On return this variable is set to the total number of node sets in the mesh.}
 
1772
 
 
1773
{\setlength{\parindent}{0pt}
 
1774
 \textbf{int * num\_side\_sets\_global} On return this variable is set to the total number of side sets in the mesh.}
 
1775
 
 
1776
 
 
1777
\subsubsection{im\_ne\_get\_init\_info}
 
1778
This function is adapted from the \texttt{NEMESIS} API. It retrieves information about the decomposition of the mesh. A non-zero return value indicates an error.
 
1779
{\ttfamily  \begin{verbatim}
 
1780
int im_ne_get_init_info( int   neid,    
 
1781
                         int  *num_proc,
 
1782
                         int  *num_proc_in_file,
 
1783
                         char *file_type);
 
1784
\end{verbatim}}
 
1785
 
 
1786
{\setlength{\parindent}{0pt}
 
1787
 \textbf{int neid} Unused input variable.}
 
1788
 
 
1789
{\setlength{\parindent}{0pt}
 
1790
 \textbf{int *num\_proc} On return this variable is filled with the total number of processors over which the mesh is spread.}
 
1791
 
 
1792
{\setlength{\parindent}{0pt}
 
1793
 \textbf{int *num\_proc\_in\_file} On return this variable is filled with the number of processors for which mesh is available via query. This value will always be 1 when using \textsc{pamgen}.}
 
1794
 
 
1795
{\setlength{\parindent}{0pt}
 
1796
 \textbf{char *file\_type} Unused variable should be sized as shown below.}
 
1797
{\ttfamily 
 
1798
        \begin{verbatim}char file_type [2];\end{verbatim}}
 
1799
 
 
1800
\subsubsection{im\_ne\_get\_eb\_info\_global}
 
1801
{\ttfamily  \begin{verbatim}
 
1802
int im_ne_get_eb_info_global( int neid,
 
1803
                              int *el_blk_ids_global,
 
1804
                              int *el_blk_cnts_global);
 
1805
\end{verbatim}}
 
1806
This function is adapted from the \texttt{NEMESIS} API. It retrieves the element block ids from the entire mesh as well as the sizes of each of these element blocks. A non-zero return value indicates an error.
 
1807
 
 
1808
{\setlength{\parindent}{0pt}
 
1809
 \textbf{int neid} Unused input variable.}
 
1810
 
 
1811
{\setlength{\parindent}{0pt}
 
1812
 \textbf{int *el\_blk\_ids\_global} On return this array holds the element block ids for the entire mesh. It must be sized to hold num\_elem\_blks\_global integers.}
 
1813
 
 
1814
{\setlength{\parindent}{0pt}
 
1815
 \textbf{int *el\_blk\_cnts\_global} On return this array holds the number of elements in each element block of the entire mesh. It must be sized to hold num\_elem\_blks\_global integers.}
 
1816
 
 
1817
 
 
1818
 
 
1819
\subsubsection{im\_ne\_get\_ns\_param\_global}
 
1820
{\ttfamily  \begin{verbatim}
 
1821
int im_ne_get_ns_param_global(int  neid,        
 
1822
                              int *ns_ids_global,
 
1823
                              int *ns_n_cnt_global,
 
1824
                              int *ns_df_cnt_global);
 
1825
\end{verbatim}}
 
1826
This function is adapted from the \texttt{NEMESIS} API. It retrieves node set information for the entire mesh. A non-zero return value indicates an error.
 
1827
 
 
1828
{\setlength{\parindent}{0pt}
 
1829
 \textbf{int neid} Unused input variable.}
 
1830
 
 
1831
{\setlength{\parindent}{0pt}
 
1832
 \textbf{int *ns\_ids\_global} On return this array holds the node set ids for the entire mesh. It must be sized to hold num\_node\_sets\_global integers.}
 
1833
 
 
1834
{\setlength{\parindent}{0pt}
 
1835
 \textbf{int *ns\_n\_cnt\_global} On return this array holds the number of nodes in each node set for the entire mesh. It must be sized to hold num\_node\_sets\_global integers.}
 
1836
 
 
1837
{\setlength{\parindent}{0pt}
 
1838
 \textbf{int *ns\_df\_cnt\_global} On return this array holds the number of node set distribution factors for the entire mesh. It must be sized to hold num\_node\_sets\_global integers. For \textsc{pamgen} the number of distribution factors for each node set will be 0.}
 
1839
 
 
1840
 
 
1841
 
 
1842
\subsubsection{im\_ne\_get\_ss\_param\_global}
 
1843
{\ttfamily  \begin{verbatim}
 
1844
int im_ne_get_ss_param_global(int  neid,        
 
1845
                              int *ss_ids_global,
 
1846
                              int *ss_s_cnt_global,
 
1847
                              int *ss_df_cnt_global);
 
1848
\end{verbatim}}
 
1849
This function is adapted from the \texttt{NEMESIS} API. It retrieves side set information for the entire mesh. A non-zero return value indicates an error.
 
1850
 
 
1851
{\setlength{\parindent}{0pt}
 
1852
 \textbf{int neid} Unused input variable.}
 
1853
 
 
1854
{\setlength{\parindent}{0pt}
 
1855
 \textbf{int *ss\_ids\_global} On return this array holds the side set ids for the entire mesh. It must be sized to hold num\_side\_sets\_global integers.}
 
1856
 
 
1857
{\setlength{\parindent}{0pt}
 
1858
 \textbf{int *ss\_s\_cnt\_global} On return this array holds the number of sides in each side set for the entire mesh. It must be sized to hold num\_side\_sets\_global integers.}
 
1859
 
 
1860
{\setlength{\parindent}{0pt}
 
1861
 \textbf{int *ss\_df\_cnt\_global} On return this array holds the number of side set distribution factors for the entire mesh. It must be sized to hold num\_side\_sets\_global integers. For \textsc{pamgen} the number of distribution factors for each side set will be 0.}
 
1862
 
 
1863
\subsubsection{im\_ne\_get\_loadbal\_param}
 
1864
{\ttfamily  \begin{verbatim}
 
1865
int im_ne_get_loadbal_param( int  neid,
 
1866
                             int *num_internal_nodes,
 
1867
                             int num_border_nodes,
 
1868
                             int *num_external_nodes,
 
1869
                             int *num_internal_elems,
 
1870
                             int *num_border_elems,
 
1871
                             int *num_node_cmaps,
 
1872
                             int *num_elem_cmaps,
 
1873
                             int  proc);
 
1874
\end{verbatim}}
 
1875
This function is adapted from the \texttt{NEMESIS} API. On return its arguments are filled with sizing information for  processor communication data. This information is the first step in gathering all the information required to construct communication protocols between adjacent regions of decomposed mesh. A non-zero return value indicates an error.
 
1876
 
 
1877
{\setlength{\parindent}{0pt}
 
1878
 \textbf{int neid} Unused input variable.}
 
1879
 
 
1880
{\setlength{\parindent}{0pt}
 
1881
 \textbf{int * num\_internal\_nodes} On return this variable is filled with the number of nodes that are local to the mesh on this processor.}
 
1882
 
 
1883
{\setlength{\parindent}{0pt}
 
1884
 \textbf{int * num\_border\_nodes} On return this variable is filled with the number of nodes that are common to the mesh on this processor and to adjacent processors.}
 
1885
 
 
1886
{\setlength{\parindent}{0pt}
 
1887
 \textbf{int * num\_external\_nodes} On return this variable is filled with the number of nodes that are not local to this processor but are common to elements that share nodes with this processor.}
 
1888
 
 
1889
{\setlength{\parindent}{0pt}
 
1890
 \textbf{int * num\_internal\_elems} On return this variable is filled with the number of elements that are local to this processor.}
 
1891
 
 
1892
{\setlength{\parindent}{0pt}
 
1893
 \textbf{int * num\_border\_elems} On return this variable is filled with the number of elements that are not local to this processor but do share nodes with elements local to this processor.}
 
1894
 
 
1895
{\setlength{\parindent}{0pt}
 
1896
 \textbf{int * num\_node\_cmaps} On return this variable is filled with the number of node communication maps.}
 
1897
 
 
1898
{\setlength{\parindent}{0pt}
 
1899
 \textbf{int * num\_elem\_cmaps} On return this variable is filled with the number of element communication maps.}
 
1900
 
 
1901
{\setlength{\parindent}{0pt}
 
1902
 \textbf{int proc} Unused input variable.}
 
1903
 
 
1904
 
 
1905
\subsubsection{im\_ne\_get\_elem\_map}
 
1906
{\ttfamily  \begin{verbatim}
 
1907
int im_ne_get_elem_map( int   neid,
 
1908
                        int  *elem_mapi,
 
1909
                        int  *elem_mapb,
 
1910
                        int   proc);
 
1911
\end{verbatim}}
 
1912
 
 
1913
This function is adapted from the \texttt{NEMESIS} API. On return the the arguments of this function are populated with the internal and boundary element maps.
 
1914
 
 
1915
{\setlength{\parindent}{0pt}
 
1916
 \textbf{int neid} Unused input variable.}
 
1917
 
 
1918
{\setlength{\parindent}{0pt}
 
1919
 \textbf{int * elem\_mapi} On return this variable is filled with the internal element ids. Storage sized to num\_internal\_elems must be supplied.}
 
1920
 
 
1921
{\setlength{\parindent}{0pt}
 
1922
 \textbf{int * elem\_mapb} On return this variable is filled with the border element ids. Storage sized to num\_border\_elems must be supplied. }
 
1923
 
 
1924
{\setlength{\parindent}{0pt}
 
1925
 \textbf{int proc} Unused input variable.}
 
1926
 
 
1927
 
 
1928
\subsubsection{im\_ne\_get\_node\_map}
 
1929
{\ttfamily  \begin{verbatim}
 
1930
int im_ne_get_node_map( int   neid,
 
1931
                        int  *node_mapi,
 
1932
                        int  *node_mapb,
 
1933
                        int  *node_mape,
 
1934
                        int   proc);
 
1935
\end{verbatim}}
 
1936
 
 
1937
This function is adapted from the \texttt{NEMESIS} API. On return the the arguments of this function are populated with the internal and boundary node maps.
 
1938
 
 
1939
{\setlength{\parindent}{0pt}
 
1940
 \textbf{int neid} Unused input variable.}
 
1941
 
 
1942
{\setlength{\parindent}{0pt}
 
1943
 \textbf{int * node\_mapi} On return this variable is filled with the internal node ids. Storage sized to num\_internal\_nodes must be supplied.}
 
1944
 
 
1945
{\setlength{\parindent}{0pt}
 
1946
 \textbf{int * node\_mapb} On return this variable is filled with the border node ids. Storage sized to num\_border\_nodes must be supplied. }
 
1947
 
 
1948
{\setlength{\parindent}{0pt}
 
1949
 \textbf{int * node\_mape} On return this variable is filled with the external node ids. Storage sized to num\_external\_nodes must be supplied. }
 
1950
 
 
1951
 
 
1952
{\setlength{\parindent}{0pt}
 
1953
 \textbf{int proc} Unused input variable.}
 
1954
 
 
1955
 
 
1956
\subsubsection{im\_ne\_get\_cmap\_params}
 
1957
{\ttfamily  \begin{verbatim}
 
1958
int im_ne_get_cmap_params( int neid,
 
1959
                           int *node_cmap_ids,
 
1960
                           int *node_cmap_node_cnts,
 
1961
                           int *elem_cmap_ids,
 
1962
                           int *elem_cmap_elem_cnts,
 
1963
                           int  processor);
 
1964
\end{verbatim}}
 
1965
This function is adapted from the \texttt{NEMESIS} API. On return the storage passed in its arguments is filled with the communication map ids and counts.  A non-zero return value indicates an error.
 
1966
 
 
1967
{\setlength{\parindent}{0pt}
 
1968
 \textbf{int neid} Unused input variable.}
 
1969
 
 
1970
{\setlength{\parindent}{0pt}
 
1971
 \textbf{int * node\_cmap\_ids} On return this storage is filled with the ids for each node communication map. Storage sized to num\_node\_cmap must be provided.For \textsc{pamgen} these values will run from 0 to num\_node\_cmaps-1.}
 
1972
 
 
1973
{\setlength{\parindent}{0pt}
 
1974
 \textbf{int * node\_cmap\_cnts} On return this storage is filled with the number of nodes in each node communication map. Storage sized to num\_node\_cmap must be provided.}
 
1975
 
 
1976
{\setlength{\parindent}{0pt}
 
1977
 \textbf{int * elem\_cmap\_ids} On return this storage is filled with the ids for each element communication map. Storage sized to num\_elem\_cmap must be provided. For \textsc{pamgen} these values will run from 0  to num\_elem\_cmaps-1.}
 
1978
 
 
1979
{\setlength{\parindent}{0pt}
 
1980
 \textbf{int * elem\_cmap\_elem\_cnts} On return this storage is filled with the number of elements in each element communication map. Storage sized to num\_elem\_cmap must be provided. }
 
1981
 
 
1982
{\setlength{\parindent}{0pt}
 
1983
 \textbf{int proc} Unused input variable.}
 
1984
 
 
1985
\subsubsection{im\_ne\_get\_node\_cmap}
 
1986
{\ttfamily  \begin{verbatim}
 
1987
int im_ne_get_node_cmap( int  neid,
 
1988
                         int  map_id,
 
1989
                         int *node_ids,
 
1990
                         int *proc_ids,
 
1991
                         int  processor);
 
1992
\end{verbatim}}
 
1993
This function is adapted from the \texttt{NEMESIS} API. On return the storage passed in its arguments is filled with the node communication maps.  A non-zero return value indicates an error.
 
1994
 
 
1995
{\setlength{\parindent}{0pt}
 
1996
 \textbf{int neid} Unused input variable.}
 
1997
 
 
1998
{\setlength{\parindent}{0pt}
 
1999
 \textbf{int map\_ids} The id of the node communication map that is being queried. This must be one of the entries in node\_cmap\_ids.}
 
2000
 
 
2001
{\setlength{\parindent}{0pt}
 
2002
 \textbf{int * node\_ids} On return this storage is filled with the ids of nodes in the map. Storage must be sized to node\_cmap\_cnts[map\_id]. }
 
2003
 
 
2004
{\setlength{\parindent}{0pt}
 
2005
 \textbf{int * proc\_ids} The processor id onto which the associated node in node\_ids maps. Storage must be sized to node\_cmap\_cnts[map\_id].}
 
2006
 
 
2007
{\setlength{\parindent}{0pt}
 
2008
 \textbf{int proc} Unused input variable.}
 
2009
 
 
2010
\subsubsection{im\_ne\_get\_elem\_cmap}
 
2011
{\ttfamily  \begin{verbatim}
 
2012
int im_ne_get_elem_cmap( int  neid,
 
2013
                         int  map_id,
 
2014
                         int *elem_ids,
 
2015
                         int *side_ids,
 
2016
                         int *proc_ids,
 
2017
                         int  processor);
 
2018
\end{verbatim}}
 
2019
This function is adapted from the \texttt{NEMESIS} API. On return the storage passed in its arguments is filled with the element communication maps.  A non-zero return value indicates an error.
 
2020
 
 
2021
{\setlength{\parindent}{0pt}
 
2022
 \textbf{int neid} Unused input variable.}
 
2023
 
 
2024
{\setlength{\parindent}{0pt}
 
2025
 \textbf{int map\_ids} The id of the element communication map that is being queried.This must be one of the entries in elem\_cmap\_ids.}
 
2026
 
 
2027
{\setlength{\parindent}{0pt}
 
2028
 \textbf{int * elem\_ids} On return this storage is filled with the ids of elements in the map. Storage must be sized to elem\_cmap\_cnts[map\_id]. }
 
2029
 
 
2030
{\setlength{\parindent}{0pt}
 
2031
 \textbf{int * side\_ids} On return this storage is filled with the ids sides of elements in the map. Storage must be sized to elem\_cmap\_cnts[map\_id]. }
 
2032
 
 
2033
{\setlength{\parindent}{0pt}
 
2034
 \textbf{int * proc\_ids} The processor id onto which the associated element in elem\_ids maps. Storage must be sized to elem\_cmap\_cnts[map\_id].}
 
2035
 
 
2036
{\setlength{\parindent}{0pt}
 
2037
 \textbf{int proc} Unused input variable.}
 
2038
 
 
2039
\clearpage
 
2040
\subsection{Deleting a Mesh}
 
2041
 
 
2042
\subsubsection{Delete\_Pamgen\_Mesh}
 
2043
{\ttfamily  \begin{verbatim}
 
2044
int Delete_Pamgen_Mesh(void);
 
2045
\end{verbatim}}
 
2046
This function clears and deletes the memory used to store mesh data created with the ``Create\_Pamgen\_Mesh(...)'' function. After this function is called ``Create\_Pamgen\_Mesh(...)'' may be called again to create a different mesh.
 
2047