1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 void make_indirect_temperature_field(void)
 {
    SAF_FieldTmpl temp_mesh_ftmpl;  /* Handle to the field template on
                                     * the mesh. */
    SAF_Field temp_mesh,            /* Handle to the field on the mesh. */
              buf[2];
    void *pbuf = &buf[0];

    buf[0] = temp_d0;
    buf[1] = temp_d1;
    /*
     ---------------------------------------------------------------------------
     *                         DECLARE FIELD TEMPLATES
     ---------------------------------------------------------------------------
     */
    saf_declare_field_tmpl(SAF_ALL, db, "temp_on_mesh",    SAF_ALGTYPE_FIELD,
                           NULL, SAF_NOT_APPLICABLE_QUANTITY, SAF_NOT_APPLICABLE_INT, NULL, &temp_mesh_ftmpl);

    /*
     ---------------------------------------------------------------------------
     *                         DECLARE AND WRITE FIELDS
     ---------------------------------------------------------------------------
     */

    saf_declare_field(SAF_ALL, db, &temp_mesh_ftmpl, "temperature", &mesh, SAF_NOT_APPLICABLE_UNIT,
                      &domains, SAF_NODAL(&nodes, &zones), SAF_HANDLE, NULL,
                      SAF_INTERLEAVE_NONE, SAF_IDENTITY, NULL, &temp_mesh);
    saf_write_field(SAF_ALL, &temp_mesh, SAF_WHOLE_FIELD, 1, H5I_INVALID_HID,
                    &pbuf, db);

    return;
 }