Project

General

Profile

Naming » History » Version 1

Ted Sume, 11/18/2019 12:35 PM

1 1 Ted Sume
# Naming
2
3
# Naming Conventions
4
There are several situations where it is necessary for VizSchema objects to refer to one another. For example, variables must specify their mesh. VizSchema uses a simple naming scheme, similar to paths in a file system, to allow these references. 
5
6
**Groups**
7
8
The Hdf5 file format allows the creation of Groups, which may in turn contain other groups or datasets. Each file begins with a single root group, denoted with a single forward slash - "/". Each successive level of group nesting is denoted by adding the name of the group at each level, separated by another forward slash. This is essentially the same as directories or folders in a file system. In hdf5 data files, a common use of groups is to store data from separate timesteps. 
9
10
**Relative vs Fully-qualified Paths**
11
12
Both relative and fully-qualified path names are accepted for any of the situations that require referencing another object in a file. Fully-qualified names begin with a forward slash, which tells VizSchema that the path begins in the root of the file. A name without a leading forward slash tells [VizSchema](https://ice.txcorp.com/projects/vizschema) that the path begins in the group where it is located. Note that fully qualified names are valid no matter where they are located in a file, while a relative name will need to be changed if the name of the enclosing group changes. 
13
14
**Examples**
15
16
*Both acceptable*
17
In this example, a variable refers to a uniform mesh located in the root of the file. In this case, the fully qualified name of the mesh is "/mycartgrid". Since the variable is located in the root of the file as well, the relative path "mycartgrid" would also work. 
18
```
19
GROUP "/" {
20
  Group "A" {
21
    Dataset "phi" {
22
      Att vsType = "variable"                     // Required string
23
      Att vsMesh = "/mycartgrid"                  // Required string
24
      DATASPACE [201, 301, 105]                   // Required float array
25
    }
26
  }
27
  Group mycartgrid {
28
    Att vsType = "mesh"                         // Required string
29
    Att vsKind = "uniform"                      // Required string
30
    Att vsStartCell = [0, 0, 0]                 // Required integer array
31
    Att vsNumCells = [200, 300, 104]            // Required integer array
32
    Att vsLowerBounds = [-2.5, -2.5, -1.3]      // Required float array
33
    Att vsUpperBounds = [2.5, 2.5, 1.3]         // Required float array
34
  }
35
}
36
```
37
38
**Time steps**
39
40
In this example, there are multiple time steps in the same file. The data and mesh for step 0 are in the group "Step_0000", and the data and mesh for step 1 are in the group "Step_0001". The variable in step 0 uses a fully-qualified path to refer to its mesh. The variable in step 1 uses a relative path to refer to its mesh. 
41
```
42
GROUP "/" {
43
  Group "Step_0000" {
44
    Group "A" {
45
      Dataset "phi" {
46
        Att vsType = "variable"
47
        Att vsMesh = "/Step_0000/mycartgrid"        // Fully qualified reference
48
        DATASPACE [201, 301, 105]
49
      }
50
    }
51
    Group mycartgrid {
52
      Att vsType = "mesh"
53
      Att vsKind = "uniform"
54
      Att vsStartCell = [0, 0, 0]
55
      Att vsNumCells = [200, 300, 104]
56
      Att vsLowerBounds = [-2.5, -2.5, -1.3] 
57
      Att vsUpperBounds = [2.5, 2.5, 1.3]
58
    }
59
  }
60
61
Group "Step_0001" {
62
    Group "A" {
63
      Dataset "phi" {
64
        Att vsType = "variable"                     
65
        Att vsMesh = "mycartgrid"                   // Relative reference
66
        DATASPACE [201, 301, 105]  
67
      }
68
    }
69
    Group mycartgrid {
70
      Att vsType = "mesh"       
71
      Att vsKind = "uniform"                      
72
      Att vsStartCell = [0, 0, 0]               
73
      Att vsNumCells = [200, 300, 104]        
74
      Att vsLowerBounds = [-2.5, -2.5, -1.3]     
75
      Att vsUpperBounds = [2.5, 2.5, 1.3]      
76
    }
77
  }
78
}
79
```