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