wiki:u/madams/3DCDMVisualizationInstructions

Version 23 (modified by madams, 10 years ago) ( diff )

On this page is a series of instructions on how to visualize data from AstroBEAR in the software VisIt in particularly fancy ways. The instructions and examples are from the data concerning our CollidingFlows high resolution runs located on BlueHive2 through Erica and Marissa's accounts. These techniques may potentially be useful to observe other types of physics. Click any of the figures to enlarge them on a new tab.

Initial Steps

  1. Import the data sets you want to visualize.
  2. Create a new database correlation, so that when your movie plays, all of the data sets play together. Open Controls > Database correlations… > New …
    • Select the sources from step 0.
    • Select the arrow to indicate that you want them to be a correlated source.
    • Rename the correlation if you'd like. For instance in my correlation below (Active time slider), I've renamed it NoShear3DCDM.
    • Click create database correlation.
    • In the first window that popped up, click apply. Now you have your data base correlation.
  3. Input your pseudocolor plots: Add + > Pseudocolor. Now choose you corresponding data set. In my example, I have chosen mass1, mass2 and mass3 (see Figure 1).
  4. Your data sets should be green, indicating that they are ready to be drawn (see Figure 1). While VisIt is drawing, they will be yellow. If it cannot drawn them, they will be red.
  5. If you are already familiar with visualizing the data set you're attempting to make a new fancy simulation of, it might be worth your time to adjust the colorbar and switch it to a log plot. This way one doesn't forget after making a movie. In my examples I'll have the legends turned off, and the color bar will have a minimum of 60 and maximum of 2000 (as a log plot).

Figure 1. Initial set up on correlating the data sets in Visit. Note they are indicated as ready to draw by the green font. They are correlated as indicated by the active time slider. The specific source being dealt with can be manipulated by changing the active source (current is mass3_along_3_*.bov).

Hints and Suggestions: While doing these steps you may want to make heavy use of hiding and showing each dataset as you go. Depending on how big your data set is, it can be quite computationally intensive. Feel free to edit your window for your movie as you please at some point by going to Controls > Annotation, and Controls > View.

3D Column Density Map (CDM) Plots

Column density maps integrate the density over the time interval for which your run was produced along each axis. Essentially you see whatever you plan to simulate evolves with time as some sort of kinematic cross section down x, y or z axis. One can create a "corner" or 3D box figure of these cross sections that we call column density maps, as illustrated by Figures 6 and 7. The procedure is like so:

  1. Hide all but one data set. Go to operators ± > Transforms > Elevate. Ensure that you elevate with zero height as shown in Figure 2.

Figure 2. Prior to drawing mass1, we are going to elevate it with zero height.

Figure 3. The following result of elevating with zero height. You have a slice that you can manipulate and rotate with the mouse in your window.

  1. Now we can going to transform this plane: Operators ± > Transform > Transform. Now you are faced with a series of tabs, or options: Arbitrary, Coordinate and Linear. You may need to use Arbitrary later on to align the sink particles on your .bov file, however for select the linear tab.

Figure 4. When you initially open up the transform operator on your slice. Again, your data set reverts back to being "ready to draw" green. The linear tab provides a series of inputs for a rotation matrix. For mass1, simple let it be projected by the identity matrix. The other two masses will require a different transform.

  1. Now we are done with mass1. We will move onto mass2 (keeping mass3 hidden). Similarly see step 1 to elevate the .bov. Now we're going to transform it with the following matrix shown in Figure (as a series of row vectors): {(0, 0, 1, 0),(1, 0, 0, 0),(0, 1, 0, 0),(0, 0, 0, 1)}. Now draw mass2. It should align snug next to mass1 along the appropriate axis (see Figure 5).

Figure 5. Elevating and transforming the mass2 data set. How it is drawn can be seen in the Window.

  1. Now we are done with both mass1 and mass2, so we can finish up similarly with mass3. Use the same transformation matrix as for mass2, however click the invert linear transform tab. The matrix should specifically be: {{0, 1, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}, {0, 0, 0, 1}}

Figure 6. The box is now complete!

Figure 7. The final product at the 200th frame, where we can observe physical phenomena.

Summary

We imported the data sets we want to visualize and made a database correlation for them. One at a time, we elevated each set with zero height, and then transformed with rotation matrices in order to displace them onto their appropriate axis. In the end we have a product that illustrates the column density maps down the barrel (parallel to the magnetic field) of two colliding flows, along with the two perpendicular CDM cases flanking its sides.

Projecting Sinks

Given that our data deals with colliding flows and how their interaction can induce star formation, it is pertinent to discuss the formation of sink particles. To learn more about sink particles, see Fedderath et al. in Erica's Library. Here we present two ways of projecting and aligning the sink particles onto a 3D CDM bov. Keep in mind if you want to simply visualize sinks on a 2D surface (just one .bov) you can just transform it ontop (page on this in development). All the sinks you will see are noted as black 'axes' so you can see them.

Using Chombos

This method simply requires the importation of the chombo files from your out directory into VisIt, where you will add them three times for each face of the box you have created. In order to do this, we will use the 'project' and 'elevate' operators in VisIt. Before beginning, import the chombo*.hdf files from your out directory into VisIt. After revisit the database correlations and either edit or make a new one so that the .bovs and the .hdf files will be in sync on your active time slider. In the visuals below, you will see that I have hid the legends for the sinks — they are simply using a black colorbar.

  1. After importing chombo*.hdf files, Add + > Pseudocolor > P_mass. Do this three times, each one will be on a frame. If you feel like hiding two while working on on at a time, feel free to do so.

Figure 8. When we first add the chombo files P_mass (currently at frame 0).

Figure 9. When you first draw the sink, it may change the parameters of the box (currently frame 200). It will also be hovering. Our objective is to project this sink onto the faces of our box. There is no significance in the change in active time slider name from NoShear3DCDM → NoShear3DCDM1 → NoShear3DCDMP_mass.

  1. For each of the P_mass variables, apply the Transform, Elevate and Project operators like so (Figure 10). For now, let us focus on the sinks you are going to project onto mass1 (down the barrel, parallel to the flow). One can find all three the operators under Operators ± > Transforms. Ensure that the order goes Project first and Elevate second. The position of Transform relative to the others does not matter so much. Their specifics can be seen in Figure 11.

Figure 10. The first P_mass drawn onto mass1, as illustrated by the black crosses. Note the applied transforms force the sinks onto mass1, where we currently have the others hidden.

Figures 11. Projection, elevate and transform operator attributes. For mass1, we aim to project the sinks onto the the x-axis, elevate them with zero height and then transform them. Ultimately the method is comparable to how one would align the sides of the box to make a 3D CDM. One just needs to take a few extra steps since we're dealing with 3D data that we want to use 2D data operators on.

  1. Now we do similarly for the sinks on mass2 and mass3. Their projection, elevation and transform operator attributes can be seen in Figures 12 and 13.

Figures 12. The projection, elevate and transform operator attributes we designate to project P_mass onto mass2. Note the change in linear transformation and the axis of projection.

Figures 13. The projection, elevate and transform operator attributes we designate to project P_mass onto mass3. Note the change in linear transformation and the axis of projection.

  1. The end product should look like Figure 14.

Figure 14. P_mass is successfully projected onto each .bov.

Potential VisIt Errors

Using both the Elevate and Transform operators yield:

Pseudocolor:  viewer: Surface requires 2D plot data.

Using both the Project and Transform operators yield:

The plot spatial dimensions do not match, 2D vs 3D. Plots need to be in windows with plots of the same spatial dimension.

Both of these are alleviated by using all three operators in the order of Project, Elevate and then Transform. Transform could also go first, however VisIt seems less buggy if you denote Project before Elevate. Next to the operators are arrows than can allow you to tell VisIt what you want it to enact first.

Summary

We edited our database correlation for the imported chombo files, and added P_mass to our 3D CDM visualization. Similarly to how we created our 3D CDM box, we elevated P_mass three times with zero height, and then transformed with rotation matrices in order to displace them onto their appropriate axes. Unlike the procedure to create our 3D box, we needed to make use of the projection operator due to the particular data type P_mass uses which conflicts with our goal of making a 3D simulation. Once all operators are applied, one will be able to see the sinks on their 3D visualization.

Using a Script

The script used (okc_to_curve.sh) can be found in the attachments below, along with the original sink file for frame 0 and its three projections. To run the script, copy it into your run directory with the .okc files and execute it. Immediately new curve files should be produced. With this method we simply plot the sinks as a curve file instead of as a pseudocolor variable inherent in the chombo (pmass).

Summary

UNDER CONSTRUCTION

Please contact Marissa at madams@pas.rochester.edu if you encounter any issues or have suggestions for improvement of these instructions.

Attachments (28)

Note: See TracWiki for help on using the wiki.