At the bottom he collects the array objects into a field object.  Each
receives a name: "positions", "connections" and "data".  These identify
those arrays the coordinates, connections and solutions data.

DX only supports arbitrary polygons in 2-D, using a more complex
description referred to as faces, loops and edges in the place of
"connections"..  These present themselves as three arrays, named "faces",
"loops", and "edges".   If thats what you need, then check out the docs for
more info.  Be forwarned that FLE data is not fully supported in the DX
module set, but you can render FLE data.

The "connections" carries an attribute named "element type" that indicates
how to interpret the connections data.  If the  attribute contains the
string "tetras", then the connections array should be n integer 4-vectors.
Hexahedra, called "cubes", are n integer 8-vectors, triangles are
3-vectors, quads 4, and lines are 2.   There are compact representations
for hexahedra, quads and lines.

The data component carries an attribute called "dep", with a value of
either "positions" or "connections", indicating which the data values are
associated with.  If meaning that its in a dependent relationship with
either the vertices of the grid or the connections elements.  In the case
of positions, the data is assumed to be interpolatable through the element;
if its dep on connections, then its constant for the element.  If your
calculations are cell-centered but you want interpolation, a
quick-and-dirty solution is to use Post to average the data values of cells
incident on a vertex and assign the value to the vertex.  Alternatively,
you need to create an interpolation grid that is defined on the element
centroids.

Hope this helps, I guess its a little dense.

Greg

Steve Ettorre <[EMAIL PROTECTED]>@opendx.watson.ibm.com on 06/26/2000
05:24:54 PM

Please respond to [email protected]

Sent by:  [EMAIL PROTECTED]


To:   "[email protected]"
      <[email protected]>
cc:
Subject:  [opendx-users] question on basic commands



Hi

I am trying to interface dx to an existing CFD code which utilizes a
completely unstructured grid (i.e. the code knows nothing about the
shape of the elements). To gain some familiarity, a friend has given me
some C++ code which interfaces dx with another CFD code. In my friend's
code the element shapes are restricted to quads, triangles or tets. In
examining my friend's code I see that it creates 3 array objects in
succession in its dx header file (see code excerpt below). The first
object appears to be for the nodal coordinates, the second for
connections and the third for actual solution values. My questions are:

1) How does dx know which of the objects is coordinates, connections or
solution data?
2) Does it make sense to supply connections information if the element
shape is unknown and might in general be a multi-sided polygon?
3) If it is appropriate to do so in my case, where can I find the spec
for supplying connections information? Looking at the dx userguide I
would guess that it consists of the list of numbered vertices for each
element in the grid.
4) My code calculates solution data at the centroid of the elements, not
the vertices. How do I inform dx of this arrangement?

TIA,
Steve

******************************************Code Excerpt (dx header
file)********************************************
void VisDataDX::write_header(const char* fname)
{

  ofstream hfile(fname, ios::out);

  //  write the header file
  char *wd = getcwd(NULL,128);

  hfile << "object 1 class array type float rank 1 shape 3 items "
 << numnp << " msb binary" << endl;

  hfile << " data file " << wd << "/dx_data.bin,0 " << endl;
  hfile << " attribute \"dep\" string \"positions\" \n\n";

  int offset = sizeof(float)*numnp*3;

  hfile << "object 2 class array type int rank 1 shape " << nen
 << " items "
 << numel << " msb binary" << endl;

  hfile << " data file " << wd << "/dx_data.bin," << offset << endl;
  hfile << " attribute \"element type\" string \""
 << _elm_type << "\"" << endl;
  hfile << " attribute \"ref\" string \"positions\" \n\n" << endl;

  offset += sizeof(int)*nen*numel;

  switch (ndof) {
  case 5:
    hfile << "object 3 class array type float rank 1 shape 5 items "
   << numnp << " msb binary" << endl;

    hfile << " data file " << wd << "/dx_data.bin," << offset << endl;
    hfile << " attribute \"dep\" string \"positions\" \n\n";
    break;
  case 1:
    hfile << "object 3 class array type float rank 0 items "
   << numnp << " msb binary" << endl;

    hfile << " data file " << wd << "/dx_data.bin," << offset << endl;
    hfile << " attribute \"dep\" string \"positions\" \n\n";
    break;
  default:
    cerr << "\nVisDataDX Error: unsupported ndof = " << ndof << endl;
    exit(-1);
  }

  hfile << "object 4 class array type int rank 0 items " << numel <<
endl;
  hfile << " data file " << wd << "/partit.out" << endl;

  hfile << " attribute \"dep\" string \"connections\" \n\n";

  hfile << "object \"irregular positions irregular connections\" "
 << "class field" << endl;
  hfile << " component \"positions\" value 1" << endl;
  hfile << " component \"connections\" value 2" << endl;
  hfile << " component \"data\" value 3" << endl;
  hfile << "\n end \n";
}

--
Steve Ettorre
e-mail: [EMAIL PROTECTED]
-------------------------------------------
"...thinking is not consciousness -
 it requires hard work..." - Rush Limbaugh
-------------------------------------------





Reply via email to