“Sharing is good, and with digital technology, sharing is easy.” –Richard Stallman.
Tecplot divides datasets into zones. These zones may represent different areas of the physical domain, the same physical domain at different time steps, or different results that you may wish to compare. The zones may also have different dimensionality; for example there may be a mixture of 3D volume zones that contain field variables and 2D surface zones that contain the problem geometry and surface properties.
In many cases, different zones contain the same data. For example, multiple time steps of a CFD solution often have the same X, Y, Z coordinates of nodes. In this case, repeating the specification of X, Y, and Z for each time step is wasteful.
Luckily, Tecplot allows for variable sharing where the values of X, Y, and Z are only specified for one zone and the other zones share those values.
Likewise, Tecplot allows for connectivity sharing, where the node-map (list of node-numbers that define the finite-element cells) can also be specified once and shared with other zones. By using the variable and connectivity sharing correctly, you can dramatically reduce data file size and Tecplot memory usage.
And, because Tecplot only has to read this data once, the performance improved. WIN WIN!
Take Advantage of Variable Sharing
If you are a code developer, you should take advantage of variable sharing when writing out multiple time steps. When writing binary data, this is done with the ShareVarFromZone and ShareConnectivityFromZone parameters of the TecIO TECZNE function.
For ASCII data (not recommended except for very small datasets) specify the VARSHARELIST and/or CONNECIVITYSHAREZONE parameters in the zone header.
Another way to take advantage of variable sharing is to write separate grid/solution files. This is done by specifying in TECINI a FileType of 1 for the grid file and a FileType of 2 for the solution file. When you read in the grid file and multiple solution files it will automatically share the grid variables (X, Y, Z and node-map).
Data Sharing Can Be Very Beneficial
There are other scenarios where data sharing is very beneficial. For example, CFD solutions and other physical simulations often take advantage of known solution symmetries. For example, the left side of an airplane is generally the mirror image of the right side. When the airplane is flying straight, you really only need to solve the flow equation for half of the plane. This was done for the Trapezoidal Wing Solution image shown above.
When presenting this solution, you may want to display the whole plane. In Tecplot, this can be done with Date->CreateZone->Mirror, and specify mirror about the XZ plane. This command will automatically take advantage of variable sharing for those variables that are identical. In this case, that is every variable but Y and the y-component of velocity. The result looks like the image at right.
Be Careful When Using Data Sharing
So far, I’ve made data sharing look like a wonderful thing and, if you are curious person, you may have already thought of many other ways you can use data sharing.
BE CAREFUL! Variable sharing should only be used when both zones use all of the nodes.
DO NOT Share Data Between Volume and Surface Zones
A temping place to use variable sharing is with volume zones and bounding surface zones. For example, in the trap wing solution above, the nodes on the surface are also nodes in the volume zone, and the coordinates and field data at those nodes are the same.
So, why not share all the variables? And for the surface, create a new FEQuad zone that has a different node-map that references a small fraction of the volume nodes?
Although this will save some memory in the file, it is very bad for Tecplot performance.
Many algorithms within Tecplot loop over all the nodes. In the case of surfaces sharing volume nodes it will loop over all of the volume nodes for each of the surfaces. For the half trap wing solution there are only 2.6 million nodes on the surface but 76 million nodes in the volume. If you shared the volume data with the surface, the algorithms that loop over the nodes would be doing at least 30 times more work than required. Since the surface data is actually broken up into four zones, it will actually be doing 120 times more work than required. DON’T DO IT!
DO NOT Share Variables with Smaller Volume Zones
It is sometimes nice to partition the volume data into logical regions. If you do this, you might think it would be convenient to write all of the volume data into one zone and share it with the other partitions – each zone using a fraction of the total nodes. This is bad for the same reason sharing volume nodes with surface zones is bad – algorithms that loop over all nodes waste a lot of time.
- Do share data between volume zones that all use the full set of nodes.
- DO NOT share data between zones where one of them uses less than the full set of nodes.