Query an element’s history from the database

ReadBackElementHistory is a function defined in loadbalance.c.

Synopsis:

void ReadBackElementHistory(DbInfo_t *dbInfo, int myProcNum, int histElem, int *numReadBack, ElementHistory_t **hist)

Formal Arguments:

  • dbInfo: database info object
  • myProcNum: processor rank in MPI_COMM_WORLD
  • histElem: the element for which history
  • numReadBack: number of dump for which history was read back
  • hist: the resulting history buffer

Description: This function queries the pressure dump history for a specific element back out of the database.

Issues: For expediency in completing the use-case, this function was written to be fairly specific to what was written to the database. Note that the approach taken here is written assuming each dump is a different set in the self collection on the top-level set.

A more general dump history tool would involve the following…

1
2
3
4
5
6
7
8
 Command-line arguments...
    -elemID %d (0 or more times)    identify the element(s) you want dump history for
    -nodeID %d (0 or more times)    identify the node(s) you want dump history for
    -field %s (1 or more times)     identify the field(s) you want dumped for each elem/node
                                       use "all" for all fields
    -IDfield                        If the node or element IDs you specified with -elemID or
                                       -nodeID are not native collection indices, specify the name
                                       of the field in which these ID's are stored
1
 Possible output...
1
 Dump History for Element 5...
1
2
3
4
5
 stepIdx | step coord |  lives in  |    pressure    |   velocity   |    gauss-pts
         |            |            |                |  vx  vy  vz  | d0  d1  d2  d3
 --------|------------|------------|----------------|--------------|-------------
   000   |   0.000    | whole-005  |      2.4       |  0.1 2.0 2.2 | 2.0 2.2 2.2 2.3
   020   |   0.059    | whole-005  |      3.9       |  blah-blah-blah
1
 or in some decomposed database...
1
 Dump History for Element 16...
1
2
3
4
5
6
7
8
9
 stepIdx | step coord |  lives in  |    pressure    |   velocity   |    gauss-pts
         |            |            |                |  vx  vy  vz  | d0  d1  d2  d3
 --------|------------|------------|----------------|--------------|-------------
   000   |   0.000    | proc0-000  |      2.4       |  0.1 2.0 2.2 | 2.0 2.2 2.2 2.3
   000   |   0.000    | proc1-007  |      2.4       |  0.1 2.0 2.2 | 2.0 2.2 2.2 2.3
   000   |   0.000    | proc2-004  |      2.4       |  0.1 2.0 2.2 | 2.0 2.2 2.2 2.3
   020   |   0.059    | proc0-000  |     42.3       |  0.1 2.0 2.2 | 2.0 2.2 2.2 2.3
   020   |   0.059    | proc1-007  |     42.4       |  0.1 2.0 2.2 | 2.0 2.2 2.2 2.3
   020   |   0.059    | proc2-004  |     42.3       |  0.1 2.0 2.2 | 2.0 2.2 2.2 2.3
1
2
 In this example, element 16 is shared by three processor pieces. And, this shows example output
 where one processor doesn't agree with the others on the pressure value.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 algorithm...
    1. open the database
    2. find all suites
    3. order suites (by coord value associated with first member state or something)
    4. For each suite...
       a. read a state field
       b. for each field in the state matching field(s) specified on command-line.
             a. if field is inhomog, find pieces on which it is homog
                1. locate the identified nodes and elements in each piece
                   by reading subset relations and examining them
                2. for each piece...
                   partially read the field to obtain the dofs for all
                   specified node/elems
                3. capture dof values, names of pieces (sets) and local
                   indexes on these sets
             b. otherwise, just partially read the field to obtain the dofs
                for all specified nodes/elemes
             c. build up buffers of dof values, names of pieces (sets) and local
                indexes on these sets

See Also: