wiki:rp_xml_ele_flow

Version 2 (modified by gah, 15 years ago) (diff)

--

<flow>

A <flow> is a subelement of a <field> element's <component> element that describes how the component data is to be displayed as a flow.

<output>
  <field>
    <component>
       <flow>
         <label>Flow label</label>
         <description>Flow label</description>
           ...more...
       </flow>
       <mesh>mygrid</mesh>
       <values>...more...</values>
    <component>
  </field>
</output>

The component's <values> element contains vectors of 2 or 3 numbers that describe the motion of particles.

The component's mesh must be a <unirect3d> element. The unirect3d is a uniform rectangular mesh in 3 dimensions. Each vector in <values> is associated with a point on the mesh. The order is "x1,y1,z1, x1,y1,z2, ... x1,y2,z1, x1,y2,z2, ..." where z varies quickest.

<output>
  <field>
    <component>
      <flow>
        <label>Flow label</label>
        <description>Flow label</description>
           ...more...
      </flow>
      <mesh>mygrid</mesh>
      <values>...more...</values>
    <component>
  </field>
</output>
<unirect3d id="mygrid">
  <xaxis>
    <min>0</min>
    <max>6300</max>
    <numpoints>126</numpoints>
  </xaxis>
  <yaxis>
    <min>0</min>
    <max>1500</max>
    <numpoints>30</numpoints>
  </yaxis>
  <zaxis>
    <min>0</min>
    <max>1519.05</max>
    <numpoints>22</numpoints>
  </zaxis>
</unirect3d>

A flow may contain one or more particle injection planes. The injection plane is where particles enter the flow. The injection planes are axis-aligned and may be positioned anywhere along the flow.

Example flow element:

<field>
  <component>
     <flow>
       <label>Flow label</label>
       <description>Flow label</description>
       <particles>
     </flow>
  <xaxis>
    <label>X Axis Label</label>
    <min>1.0</min>
    <max>100.0</max>
    <numpoints>10</numpoints>
    <units>um</units>
  </xaxis>
  <yaxis>
    <label>Y Axis Label</label>
    <min>-1.0</min>
    <max>1.0</max>
    <numpoints>500</numpoints>
    <units>um</units>
  </yaxis>
</flow>

Note that we set hide tag to yes. This ensures Rappture does not try to visualize the flow object. Flow objects are containers to describe uniform rectangular grids for field objects. The flow object is only useful when accompanying a field. Currently there is no way to visualize a flow object alone.

Each flow object must have both an xaxis and yaxis element, representing the X and Y dimensions. It must contain sub-elements defining the minimum and maximum points in the dimension, along with the number of points.

The axis sub-elements are as follows:

<xaxis><label>
is the text displayed along the x-axis.
<xaxis><min>
is the minimum x-coordinate.
<xaxis><max>
is the maximum x-coordinate.
<xaxis><numpoints>
is the number of uniformly spaced points on the x-axis.
<yaxis><label>
is the text displayed along the y-axis.
<yaxis><min>
is the minimum y-coordinate.
<yaxis><max>
is the maximum y-coordinate.
<yaxis><numpoints>
is the number of uniformly spaced points on the y-axis.

The flow is used by the field object.

<field id="f2d">
  <about>
    <label>2D Field</label>
  </about>
  <component>
    <mesh>output.flow(mygrid)</mesh>
    <values>0
0
0
0
...
    </values>
  </component>
</field>

The field defines the relation between the points in space and the measured values at those points. The field's values element is a list of values. There will be one value for each x,y point defined by the grid. The values must be order where the y-axis values vary first.

  v(1,1) v(1,2) v(1,3) ...  v(3,1) v(3,2) v(3,3)

In this example, the <cloud> contains a series of (x,y) points defining the mesh. The <field> includes a <mesh> attribute pointing to output.cloud(m2d) as the underlying mesh. The values within the field correspond to the points defined in the cloud. The first value represents the field at the first mesh point, the second value at the second mesh point, and so forth.


<flow id="mygrid">
   <about>
    <label>2D Mesh</label>
  </about>
  <axis>
    <min>1.0</min>
    <max>10.0</max>
    <npoints>100</npoints>
    <label>X axis</label>
    <units>secs</units>
  </axis>
  <axis>
    <min>0.0</min>
    <max>500.0</max>
    <npoints>500</npoints>
    <label>Y axis</label>
    <units>um</units>
  </axis>
</flow>

You can see working code in the zoo of example's in the flow example or on the hub in the directory /apps/rappture/examples/zoo/flow.