Personal tools
You are here: Home / Software / Formats / MIXD

MIXD Format

MIXD flow field data, used by XNS and other programs, typically consists of separate files mien, mxyz and data. A boundary information file mrng is often required as well. These files are binary, with no Fortran control blocks included, and big-endian. Floating point files use standard IEEE 64-bit representation, while integer files use 4-byte integers. We will use these mesh parameters:

ne number of elements
nn number of nodes
nen number of element nodes
nef number of element faces
nsd number of space dimensions
ndf number of degrees of freedom per node

minf

Not really part of the format, but a traditional name for a text file that lists the number of nodes and elements, each preceded by a keyword that is understood by XNS, Visual3, etc. An example:

ne  6000
nn 14322

This file is typically included (source minf) in the appropriate input file, e.g., xns.in or visual3.in.

mien

This file contains the finite element connectivity array. There are nen entries for each element containing the global node number, from 1 to nn, of the element nodes. In the example shown, this file contains the following entries:

f-mesh-data-ien.gif

elementnodenodenode
1126
2276
3237
4387
5348
6498
78914
881413
981312
107812
1171211
126711
1361110
145610
15165

Note that the connectivity data implies a local ordering of element nodes, from 1 to nen. This numbering is not particularily important, except for the requirement that it be consistent. For a 2D mesh, all elements should adopt either clockwise or counter-clockwise local node ordering. For a 3D mesh, a consistent ordering is again necessary in order to avoid negative volume elements.

The file is integer binary, 4 bytes per integer, with no control blocks (also known as C-style binary). A typical way to read it in Fortran would be:

      integer ien(nen,ne)
      ...
      open (unit=1, file="mien", access="direct", recl=nen∗ne∗4)
      read (unit=1, rec=1) ien
      close (unit=1)

or using the EWD library:

      call ewdreadint(ien, nen∗ne, "mien", 0, .false., .false.)

On Mac OS X, content of a connectivity file can be viewed using the octal dump command:

od -D mien | less

The command exists on most UNIX systems, but the specific option to interpret bytes as 32-bit integers may be different.

On little-endian Intel machines, the bytes need to be swapped first, e.g. using inline Perl code:

cat mien | perl -e ’while (sysread(STDIN,$d,4)){print pack("N",unpack("V",$d));}’ > mien.little

mxyz

This file contains the nodal coordinates. There are nsd entries for each node containing the coordinates of that node. In the example shown, this file contains the following entries:

f-mesh-data-x.gif

nodex coordinatey coordinate
10.000.00
20.800.00
31.600.00
42.400.00
50.000.60
60.500.70
71.150.70
81.850.75
92.400.80
100.001.40
110.601.20
121.251.20
131.801.60
142.401.75

The file is double-precision binary, 8 bytes per float, with no control blocks (also known as C-style binary). A typical way to read it in Fortran would be:

      real∗ 8 x(nsd,nn)
      ...
      open (unit=1, file="mxyz", access="direct", recl=nsd∗nn∗8)
      read (unit=1, rec=1) x
      close (unit=1)

or using the EWD library:

      call ewdreadfloat(x, nsd∗nn, "mxyz", 0, .false., .false.)

On Mac OS X, content of a coordinate file can be viewed using the octal dump command:

od -F mxyz | less

or, better still, using hexadecimal dump, with number of fields per column adjusted depending on the dimensionality of the domain:

hexdump -e ’"%E %E %E\n"’ mxyz | less

These commands exists on most UNIX systems, but the specific option to interpret bytes as 64-bit floating-point numbers may be different.

On little-endian Intel machines, the bytes need to be swapped first, e.g. using inline Perl code:

cat mxyz | perl -e ’while (sysread(STDIN,$d,8)){print pack("N",unpack("V",$d));}’ > mxyz.little

data

This file contains the nodal flow field data. There are ndf entries for each node containing the flow field variables of that node. The format is identical to the mxyz file.

Content of a data file can be viewed the same way as the coordinate file.

mrng

This file contains the Reference Node Group (RNG), or boundary, information. There are nef entries for each element containing the boundary code of that face. The boundary codes are either positive, for faces where RNG, or boundary code, is assigned, or zero, for faces with no boundary code assigned. For internal faces, zero value is sometimes replaced with a negative number of the neighboring element (dual connectivity). In the example shown, this file contains the following entries:

f-mesh-data-rng.gif

elementface codeface codeface code
11-2-15
2-3-12-1
31-4-2
4-5-10-3
51-6-4
62-7-5
7-62-8
8-73-9
9-83-10
10-4-9-11
11-103-12
12-2-11-13
13-123-14
14-15-134
15-1-144

The file is integer binary, 4 bytes per integer, with no control blocks (also known as C-style binary). A typical way to read it in Fortran would be:

      integer rng(nef,ne)
      ...
      open (unit=1, file="mrng", access="direct", recl=nef∗ne∗4)
      read (unit=1, rec=1) rng
      close (unit=1)

or using the EWD library:

      call ewdreadint(rng, nef∗ne, "mrng", 0, .false., .false.)

In order to apply boundary conditions to proper nodes, we need also to define a mapping from element faces to element nodes. The drawings below define the conventions for face numbering (circled labels) used in our files and software:

triangle quadrilateral tetrahedron
RNG triangle RNG quad RNG tet
hexahedron
RNG hex

Content of a RNG file can be viewed the same way as the connectivity file.

The XNS is able to generate simple rectangular or cubic meshes in 2 or 3 dimensions. In that case, the RNGs are defined as follows (unless explicitly reordered in the XNS input file):

  • 2D → 1: y = ymin, 2: x = xmax, 3: y = ymax, 4: x = xmin.
  • 3D → 1: z = zmin, 2: y = ymin, 3: x = xmax, 4: y = ymax, 5: x = xmin, 6: z = zmax.

Space-time

For now, for space-time cases, the semi-discrete, or spatial, meshes are simply extruded into the temporal dimension, forming e.g. prisms from triangles. This extrusion is done entirely within XNS, and so the spatial mesh files are still used. The only modification concerns the number of nodes, which was too hard for XNS to modify (and redistribute on multiple processors). For that reason, space-time cases use modified minf and mxyz files, which simply double the number of nodes to account for two time levels per time steps. The spatial versions are typically renamed as minf.space and mxyz.space. In case the space-time files are not generated by a particular mesh generation program, they can be created by hand:

hydra(~)% cp minf.space minf
hydra(~)% vi minf
<...double number of nodes listed in the file...>
hydra(~)% cat mxyz.space mxyz.space > mxyz

This should not really be so hard to do inside XNS, which would let us eliminate the space-time files, at least for the structured-in-time meshes currently in use. However, the mesh files formatted for space-time are still useful in postprocessing, as they contain information for both time levels in a time step.

Multiple Data Sets

In the course of a time-dependent simulation, a sequence of data files is typically obtained. In case of changing connectivity and coordinates, these may be also recorded in a sequence of files. For visualization purposes, those files cannot be simply concatenated, since they include initial solutions which are identical to the last solution of the previous run. To eliminate these duplicate sets, one can use the dd utility and a script similar to this:

hydra(~)% cat Combine
dd if=ia.1e5.0050 of=mien.all bs=18210320
dd if=ia.1e5.0100 of=mien.all bs=18210320 skip=1 seek=51
dd if=ia.1e5.0150 of=mien.all bs=18210320 skip=1 seek=101
dd if=ia.1e5.0200 of=mien.all bs=18210320 skip=1 seek=151
 
dd if=xa.1e5.0050 of=mxyz.all bs=9450864
dd if=xa.1e5.0100 of=mxyz.all bs=9450864 skip=1 seek=51
dd if=xa.1e5.0150 of=mxyz.all bs=9450864 skip=1 seek=101
dd if=xa.1e5.0200 of=mxyz.all bs=9450864 skip=1 seek=151
 
dd if=da.1e5.0050 of=data.all bs=12601152
dd if=da.1e5.0100 of=data.all bs=12601152 skip=1 seek=51
dd if=da.1e5.0150 of=data.all bs=12601152 skip=1 seek=101
dd if=da.1e5.0200 of=data.all bs=12601152 skip=1 seek=151
hydra(~)% ./Combine

Here, the bs parameter specifies the record length in bytes for each type of file, which is basically the size of mien, mxyz or data.out file, respectively. The skip parameter causes the first record in most files to be skipped. The seek parameter fast forwards a given number of records and causes the data to be effectively appended at the end of the output file (assuming 50 records were saved in each simulation).

« May 2013 »
May
MoTuWeThFrSaSu
12345
6789101112
13141516171819
20212223242526
2728293031
Upcoming Events
Marine 2013 May 29, 2013 - May 31, 2013 — Hamburg, Germany
MPF 2013 Jun 11, 2013 - Jun 14, 2013 — Sardinia, Italy
Coupled Problems 2013 Jun 17, 2013 - Jun 19, 2013 — Ibiza, Spain
USNCCM 12 Jul 22, 2013 - Jul 25, 2013 — Raleigh, North Carolina
GACM 2013 Sep 30, 2013 - Oct 02, 2013 — Hamburg, Germany
Upcoming events…