Paraview is an open source, data visualisation software, ideal for viewing data before meshing, after meshing and after micromagnetic simulations. Paraview is also useful as it can be used to convert image stack data into a surface mesh, whilst retaining the aspect ratios of the data. Paraview itself contains significant user resources, which can be found under the ‘help’ tab.
Opening and Viewing Data
Opening image stack data is done using the ‘Open…’ function, which can be accessed via the file tab, the Open… icon or by Ctrl+O. This opens the ‘Open…’ window, as shown in Fig.1.
Once the data has been loaded, but before it can be visualised, the voxel size (x, y and z dimensions) needs to be defined in the Properties tab, located in the bottom left of the window. Using the ‘Use Custom Data Spacing’, shown in Fig.2, the x, y and z dimensions of each voxel are defined. The dimensions should be defined in micrometres, since these are the units used in MERRILL. Once this has been applied, the data can then be visualised.
Visualising a Volume
By default, Paraview will display only the outline of the bounding box of the data, this can be change by selecting ‘Volume’ in the ‘Representation’ tab. This can be found at the top of the window, as shown in Fig.3, or in the Display tab, found beneath the custom data spacing option in the Properties tab, shown in Fig.4.
This will display the data by assigning colours, initially on a scale from blue to red, to the voxels depending on their value. The colour scale of this visualisation can be controlled using the ‘Edit’ function, found beneath the Representation tab in the Properties, as shown in Fig.4.
Volumes can be visualised by editing the ‘Mapping Data’ tab shown in Fig.5 to change the colour and scaling. For example, the particle shown in Fig.6 was created by increasing the scaling of the low value voxels and decreasing the high value voxels to zero, since the data ranged from 16-64, with the particle defined by the low value voxels.
Visualising a Surface
Data can also be visualised as a surface using the ‘Contour’ function, which can be used using either the Filters->Common tab or the ‘Contour’ icon as shown in Fig.8. The contour is taken at a user defined voxel value, which is set in the Properties tab, also shown in Fig.8. The resulting surface is shown in Fig.7.
Smoothing a Surface
Surfaces created from image stack data is often stepped, as in Fig.7. Smoothing can be done in Paraview using the ‘Smooth’ function, which can be found in the Filters>Alphabetical tab, as shown in Fig.9.
This will open the Smoothing tab in the properties tab, where the level of smoothing can be controlled by the number of iterations, as shown in Fig.10. The output of 2000 iterations of smoothing is also shown. It is worth noting that saving a surface as a .stl surface file will also apply some smoothing to the objects, this is covered in the ‘Mesh Generation – Iso2Mesh’ guide.
Opening and Visualising Meshes
Paraview can also be used to visualise tetrahedral meshes, once in a PATRAN format. Paraview does not recognise .pat extension files as true PATRAN files and so in order to open them, the ‘Files of type’ tab needs to be set to ‘All files (*)’ as shown in Fig.11. Once the .pat mesh has been selected the ‘Open Data With…’ prompt will open automatically, as shown in Fig.13. The ‘PATRAN Files’ option will then open the mesh file. The default representation will be a surface, but the mesh can also be viewed as a wiremesh using the ‘Wireframe’ option, which can be found in the ‘Representations’ tab, both options are shown in Fig.12.
Mesh quality can be very important, since very non equilateral tetrahedra can cause errors when running simulations in MERRILL. This can be checked in Paraview, using the ‘Mesh Quality’ function, which can be found in Filters->Alphabetical, as shown in Fig.14.
This function plots the tetrahedra on a scale from highest to lowest quality (blue to red respectively) as shown in Fig.15. Finding the lowest quality tetrahedra can be done using the ‘Threshold’ function, which can be found in Filters->Common. The lower bound of the threshold can then be set in the Properties tab as shown in Fig.16.
By setting the ‘Minimum’ value at the higher end of the quality range, the lowest quality tetrahedra can be isolated and viewed, as shown in Fig.17. Values below ~100 should cause no problems in MERRILL simulations, but values above may cause errors to occur and the meshes should be refined before use.
Micromagnetic simulations using MERRILL produces .tec files of each of the magnetic states at each simulation step. These can be visualised in Paraview, allowing the individual steps in any simulation to be analysed, whether these steps are steps in external field, temperature or different random states.
These .tec files are loaded using the ‘Load State…’ function. This opens the ‘Load State File’ prompt. Here the ‘Takeshi X 0mT.pvsm’ should be chosen, not the .tec file. This loads the ‘Fix Paths in State File’ prompt. Selecting the ‘…’ icon will open another prompt. Here the .tec file is selected, these windows are shown in Fig.18. In the case that the simulation produces multiple .tec files, for example in a hysteresis simulation, these mult_tec files will appear as a single option here, selecting this will open all of the magnetic states, which can then be cycled through. Using the arrows at the top of the window.
This will load the magnetic states into the objects shown in Fig.19. The two which can be used to control the visualisation are the ‘Contour1’ and ‘Glyph 1’ objects. The contour object is a surface which is taken at a specific level of helicity, and is used the show the core of magnetic vortices in the magnetic states. The glyph object contains the magnetic vectors. Both can be adjusted in the Properties tab. The example magnetic state before and after adjustment is shown in Fig.20. The density of the magnetic vectors and the size of the magnetic vectors can be changed using the ‘Glyph Mode’ and ‘Scale Factor’ options respectively. Changing the ‘Glyph Mode’ to ‘Every Nth Point’ and increasing the ‘Stride’ value reduces the number of vectors displayed, only every Nth vector, where N = ‘Stride’, is displayed. Lowering the value of the ‘Isosurfaces’ in the contour object Properties tab from the default value of 100 to a lower value, in this example 40, lowers the necessary helicity value at which a surface is created. The colour of the vectors is defined by their alignment along the Mx, My or Mz axis of the simulation, from negative to positive (blue to red).