visualization of 3d numerical simulations in … · of 3d numerical simulations in astrophysics...

131
Horacio Palomino TRITA-NA-E03111 Visualization of 3D Numerical Simulations in Astrophysics using the VR-cube

Upload: vodat

Post on 29-Apr-2018

232 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Horacio Palomino

TRITA-NA-E03111

Visualization

of 3D Numerical Simulations in Astrophysics using the VR-cube

Page 2: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Numerisk analys och datalogi Department of Numerical Analysis KTH and Computer Science 100 44 Stockholm Royal Institute of Technology SE-100 44 Stockholm, Sweden

Horacio Palomino

TRITA-NA-E03111

Master’s Thesis in Numerical Analysis (20 credits) at the Scientific Computing International Master Program,

Royal Institute of Technology year 2003 Supervisor at Nada was Kai-Mikael Jää-Aro

Examiner was Axel Ruhe

Visualization

of 3D Numerical Simulations in Astrophysics using the VR-cube

Page 3: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Abstract The ways of interpreting complex processes and simulations involving data sets is one of the essential themes that scientific visualization has to take into account these days. All the different forms of interpretation and exploration of the data, and information, have similar goals, to gain a deeper understanding and insight into the data. With the development of computers and the technological advances in hardware and software, scientists and engineers have been able to model phenomena that earlier were almost not conceivable. Yet, visualization is far behind data generation, and new techniques and ways of interpretation have to be developed for closing this gap. Some of these remarkable phenomena can be found in the field of astrophysics: interstellar clouds and jets, star formation, accretion disks, neutron stars and black hole coalition, are only a few among many exciting astronomical events that we have been able to study. This thesis explores new ways of visualizing these kinds of data and will present the results obtained from the visualization of two- and three-dimensional numerical simulations in astrophysics of the phenomena mentioned previously. An effort to produce true 3D visualization using stereo computer graphics and virtual reality techniques, specifically the VR-cube is also presented here. The thesis is divided in three main parts. The first one covers the scientific visualization aspects and visualization models. The second one portrays an overview of the astrophysical phenomena studied with an outline of the mathematical models and the numerical simulations. The third and last one gives a description of the environment used to produce the visualizations, and presents the visualization techniques with the results achieved after their implementation and the algorithms employed. Finally, this thesis is completed by a glossary of terms and a comprehensive bibliography employed in the development of this work and relevant for our particular visualizations.

iii

Page 4: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Visualisering av två- och tredimensionella Astrofysiksimuleringar: Översikt, Analys

och Tolkning. Fyra fallstudier

Sammanfattning De sätt på vilka man kan tolka komplexa processer och simuleringar av datamängder är en av de huvudtema som vetenskaplig visualisering måste ta hänsyn till idag. Alla de olika formerna för tolkning och utforskning av data och information har samma mål - att få en djupare förståelse av och insikt i data. Med datorernas utveckling och de tekniska framstegen i hård- och mjukvara har vetenskapare och ingenjörer fått möjlighet att studerar fenomen på ett sätt som tidigare var närmast omöjligt. Ändå är framstegen i datagenerering större än våra möjligheter att visualisera dessa data och nya tekniker och tolkningsmetoder måste utvecklas för att överbrygga denna klyfta. Några av dessa märkliga fenomen finns inom astrofysiken: interstellära moln och strålar, stjärnbildning, neutronstjärnor och sammanslagning av svarta hål är endast några av de många spännande astronomiska händelser som vi kunnat studera. Detta examensarbete utforskar nya sätt att visualisera dessa typer av data och kommer att presentera resultat erhållna från visualisering av två- och tredimensionella numeriska simuleringar av ovannämnda astrofysiska fenomen. Ett försök att framställa 3D-visualiseringar med stereoskopisk datorgrafik och virtuella miljöer, i synnerhet VR-kuben, beskrivs också. Rapporten består av tre huvuddelar. Den första beskriver vetenskaplig visualisering och visualiseringsmodeller. Den andra delen ger en översikt av de studerade astrofysiska fenomenen, de använda matematiska modellerna och de numeriska simuleringarna. Den tredje och sista delen beskriver den miljö i vilken visualiseringarna framställs och de visualiseringstekniker och algoritmer som används. Till slut är rapporten försedd med ordförklaringar och en utförlig litteraturförteckning.

v

Page 5: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Acknowledgments

I would like to thank the Department of Numerical Analysis and Computer Science at the Royal Institute of Technology (KTH) for the opportunity to be part of the Master Program in Scientific Computing. Especially, I am very grateful to Lennart Edsberg for all the support, understanding and encouragement during my studies. I am very indebted to my supervisor Kai-Mikael Jää-Aro for accepting my thesis proposal and letting me carry out a work that I had envisaged for a long time. This work and my entire studies would not have been possible without the scholarship awarded from the Swedish Institute for International Cooperation in Research and Higher Education (STINT). The funding is gratefully acknowledged. Many Thanks to all my classmates and friends, International and Swedish, for having given me a remarkable and pleasant stay in Scandinavia. Finally, I owe what I am to my parents: con mucho respeto, cariño y amor, este y todos mis logros los dedico a ustedes.

vii

Page 6: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

TRADEMARKS

This thesis makes use of many terms that are trademarks ™ or registered trademarks ®. The following are known to be trademarks or registered trademarks by the following companies, and they should be referred in a manner acceptable to the companies concerned. Other trademarks and registered trademarks, that may not be noted here but mentioned in this work, are the property of the respective trademark holders. Cray Inc. Cray Y-MP Electronic Visualization Laboratory, University of Illinois at Chicago CAVE Inition ltd BOOM Kitware, Inc. vtk Ohio Supercomputer Center aPE Research Systems, Inc. A Kodak Company IDL Silicon Graphics, Inc. Onyx2, OpenGL Sun Microsystems, Inc. Java The MathWorks, Inc. MATLAB VirCinity COVISE, COVER

ix

Page 7: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

CONTENTS

Abstract ................................................................................................................................ iii Sammanfattning................................................................................................................... v Acknowledgments.............................................................................................................vii Illustrations.........................................................................................................................xv Part I: Scientific Visualization 1 1. Introduction 3

1.1 Scientific Visualization.......................................................................................... 3 1.2 The Visualization Process .................................................................................... 5

2. High Level Models 7 3. Module Model 9

3.1 Overview................................................................................................................. 9 3.2 Details of Modules and Data Types.................................................................11 3.3 Other aspects........................................................................................................12

4. Functional Model 13 4.1 Overview...............................................................................................................13 4.2 Differences between the Models ......................................................................14

4.2.1 Advantages .................................................................................................14 4.2.2 Disadvantages ............................................................................................14

Part II: The Numerical Simulations 17 5. Numerical Simulations in Astrophysics 19

5.1 The Process of Star Formation.........................................................................20 5.1.1 A Model of Star Formation in the ISM ................................................20

5.2 Stellar Jets from Variable Sources ....................................................................22 5.2.1 A 3D Model of Variable-Source Stellar Jets.........................................22

5.3 Close Binary Star Systems..................................................................................24 5.3.1 Accretion Disks .........................................................................................25 5.3.2 Black Hole–Neutron Star Coalescence.................................................25 5.3.3 Hydrodynamics of the Coalescence of Black Holes with Neutron Stars: A 3D Model..............................................................................25 5.3.4 2D Simulations of Accretion Disks around Black Holes ..................27

xi

Page 8: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Part III: The Environment and The Visualizations 31 6. The Process of Scientific Visualization 33

6.1 The Process of Numerical Simulations and Visualization ...........................33 6.1.1 Domain Transformations ........................................................................33 6.1.2 Point Location in Computational and Physical Space........................35 6.1.3 Interpolation...............................................................................................36

7. Data Preparation and Manipulation 39 7.1 Data Sources and Classification........................................................................39 7.2 Data Normalization.............................................................................................40 7.3 Data Selection.......................................................................................................40 7.4 Feature Detection, Enhancement and Extraction.........................................40 7.5 Grid Rezoning......................................................................................................41 7.6 Coordinate Transformation...............................................................................41 7.7 Geometric Transformation................................................................................41

8. Visualization Techniques 43 8.1 Dimensionality of Dependent Variables .........................................................44

8.1.1 Scalar Fields ................................................................................................44 8.1.2 Vector Fields ..............................................................................................44 8.1.3 Tensor Fields..............................................................................................45

8.2 Basic Rendering Techniques..............................................................................45 8.3 Colour Mapping...................................................................................................46

8.3.1 Transparency and Alpha Values.............................................................47 8.4 Arrows, Hedgehogs and Oriented Glyphs .....................................................48 8.5 Contouring............................................................................................................48 8.6 Volume Rendering...............................................................................................50

8.6.1 Image-Order Volume Rendering ...........................................................50 8.6.2 Object-Order Volume Rendering ..........................................................51

8.7 Stereo Rendering..................................................................................................51 8.7.1 Time-Parallel Techniques ........................................................................52 8.7.2 Time-Multiplexed Techniques ................................................................53

8.8 Hybrid Rendering ................................................................................................53 8.8.1 Environment Geometry...........................................................................53

8.9 Image Processing Techniques ...........................................................................54 8.9.1 Image Enhancement.................................................................................54 8.9.2 Feature Extraction and Segmentation...................................................55 8.9.3 Transformations ........................................................................................55

8.10 Aliasing and Anti-Aliasing ...............................................................................55 8.11 Animation ...........................................................................................................56 8.12 Human-Computer Interaction........................................................................57

xii

Page 9: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

9. The Environment 59 9.1 The Interactive Data Language.........................................................................59 9.2 MATLAB..............................................................................................................59 9.3 VTK .......................................................................................................................60 9.4 COVISE................................................................................................................61

9.4.1 COVER ......................................................................................................62 9.5 The CAVE............................................................................................................63

10. The Visualizations 67 10.1 Building the Visualization: finding the appropriate software, searching for the right technique, and creating the image..................................67 10.2 Two-Dimensional Visualizations ...................................................................73

10.2.1 Clouds in the Interstellar Medium.......................................................74 10.1.2 Accretion Disks around Black-Holes..................................................76

10.3 Three-Dimensional Visualizations .................................................................82 10.3.1 Clouds in the Interstellar Medium.......................................................82 10.3.2 Stellar Jets from Variable Sources........................................................86 10.3.3 Coalition of a Neutron Star with a Black Hole .................................87 10.3.4 Volume Rendering..................................................................................88 10.3.5 Stereo Rendering of Clouds in the Interstellar Medium..................91

10.4 The 3D Numerical Simulations in the VR-Cube ........................................94

11. Conclusions 99 Appendices 101 1. Glossary ........................................................................................................................103 2. References ....................................................................................................................113 3. Colour Plates................................................................................................................119

xiii

Page 10: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

ILLUSTRATIONS

Figure (Chapter).(Number) Page Figure 2.1. The Scientific Visualization Cycle Model. .................................................. 7 Figure 3.1. Basic Visualization Module. .......................................................................... 9 Figure 3.2. A network of modules: dataflow modelling a very simple

visualization..........................................................................................................10 Figure 4.1. Functional Model. .........................................................................................13 Figure 6.1. Examples of Grid Types..............................................................................34 Figure 8.1. Summary of Visualization Techniques fit into the classification

scheme...................................................................................................................43 Figure 9.1. The Interactive Data Language (IDL). .....................................................60 Figure 9.2. The MATLAB Environment. ....................................................................61 Figure 9.3. COVISE. ........................................................................................................62 Figure 9.4. The CAVE at Kungliga Tekniska Högskolan. ........................................64 Figure 10.1. Contouring of an accretion disk...............................................................68 Figure 10.2. Colour filled contouring of an accretion disk........................................69 Figure 10.3. Black-and-White dithered image of an accretion disk. ........................70 Figure 10.4. Colour mapping using a grey scale lookup table...................................70 Figure 10.5. Data selection, enhacement by byte scaling and colour mapping. ....71 Figure 10.6. New colour mapping using a grey scale lookup table..........................72 Figure 10.7. Colour mapping using a green/white lookup table..............................72 Figure 10.8. Colour mapping using a red temperature lookup table. ......................73 Figure 10.9. Visualization of the evolution of the density field from the

numerical simulations of clouds in the interstellar medium, with magnetic field, self-gravity, turbulence, thermal pressure, and local star formation. .............................................................................................................74

Figure 10.10. Visualization of the evolution of the density field from a dynamic simulation of a black hole-neutron star coalescence....................76

Figure 10.11. Visualization of the evolution of one side of an accretion disk, of the velocity field from a simulation of a black hole-neutron star coalescence. ..........................................................................................................78

Figure 10.12. Combination of techniques. ...................................................................81 Figure 10.13. The Necker effect.....................................................................................83 Figure 10.14. Visualization using the z-buffer. ............................................................84 Figure 10.15. Rotation over 360° of the visualization of the density field from

3D numerical simulations of magnetohydrodynamic clouds in the interstellar medium. ............................................................................................85

Figure 10.16. Visualization of the density field of a stellar jet. The images show a change in the density value from minimum to maximum. ...........86

xv

Page 11: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Figure 10.17. Visualization of the density field from the numerical simulations of a neutron star and a black hole coalition. ..................................................88

Figure 10.18. Volume Rendering of Clouds in the Interstellar Medium using object-order methods with orthographic projection....................................89

Figure 10.19. Volume Rendering of Clouds in the Interstellar Medium using object-order methods with perspective projection.......................................90

Figure 10.20. Volume Rendering of Neutron Star-Black Hole Coalescence using object-order methods with orthographic projection. ........................90

Figure 10.21. Volume Rendering of Neutron Star-Black Hole Coalescence using object-order methods with perspective projection ............................91

Figure 10.22. Maximum Parallax ....................................................................................91 Figure 10.23. Stereo view of MHD clouds in the interstellar medium using

time parallel techniques......................................................................................92 Figure 10.24. COVER’s 3D menu and transfer function editor..............................95 Figure 10.25. Visualization of the Astrophysical Simulations in the CAVE:

MHD Clouds in the ISM...................................................................................96 Figure 10.26. Visualization of the Astrophysical Simulations in the CAVE:

Black Hole-Neutron Star Coalescence............................................................97

xvi

Page 12: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Part I

Scientific Visualization

Page 13: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

2

Page 14: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

C h a p t e r 1

Introduction

1.1 Scientific Visualization

Visualization has become a necessary and indispensable tool for the understanding and exploration of data and information. Scientific visualization is more than just the application of graphics to science and engineering, it is an interdisciplinary field where many disciplines are involved such as signal processing, computational geometry, CAD systems, imaging and computer graphics as well as data processing and filtering, user interface methodology, computational techniques, and software design. Scientific visualization makes use of these disciplines in order to achieve its main goal: to gain a deeper understanding and insight into the data. All these systems concerned with scientific visualization benefit from having collaborating disciplines: computational scientists and engineers combine in areas such as fluid dynamics and molecular modelling; and visualization scientists and engineers combine in areas concerning visualization software, hardware, and networking; artists and cognitive scientists combine and ensure that the best forms of visual communication are being used (colour, composition, visual representation, visual perception, etc). The term Visualization in Scientific Computing (ViSC) (McCormick 1987) is also used for this field, but often it is simply called visualization. Clearly, there will be differences between definitions according to authors of each field when choosing wider or narrower scopes for their purposes. The interpretation of numbers into abstract entities, or non-representational pictures, dates back to the Renaissance. It was not until then when the visual-artistic, empirical-statistical, and mathematical skills were combined, with the power of imagination, to develop new insights and approaches to show data and information. Leonardo da Vinci (1452-1519), the great pioneer in many fields, has been also recognized for suggesting modern flow visualization (Nakayama and Boucher 1999). In his numerous sketches and charts of fluids, he drew streamlines and vortices which almost satisfy our present needs. But it was not until 1750-1800 that statistical graphics – length and area to show quantity, time-series, scatterplots, and multivariate displays – were invented (Tufte 1983). With respect to astronomy, probably Galileo was the first one in annotating and drawing sketches about the sky with a scientific purpose. In 1610, he turned his new telescope towards Jupiter and annotated his observations accompanied with illustrations. His book, The Starry Messenger, records the series of observations.

3

Page 15: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

He also made detailed telescopic observations of sunspots in 1610-1612, marking the spots directly onto paper, maintaining the proper image plane while drawing a large diagram of a spotted sun (Tufte 1990). Although it was only then that astronomical observations using scientific methodology were properly recorded, the long struggle to understand the secrets of the sky and interpret them has been there since early civilizations and cultures around the world: the Stonehenge monument in England, the pyramids in Egypt, the structures and writings (pictograph writing) of the Maya and Aztecs, and the medicine wheels of the Native Americans. Visualizing 2D images and graphics on computer devices has become part of our daily routine; we use the computer to display images and to plot graphs. Recent trends in technology have made it possible to display 3D images on flat screens, and not only that, but also animation in real time has been extended enormously. One of the best examples demonstrating this is in the computer game industry, where the rendering of 3D images is done using real-time interactive display techniques. In the scientific community, different methods have been developed to convert the numeric raw data into a practical visual format, the best-known example being the conversion of numeric data into different types of graphs, and there exist many commercial languages which provide various forms of visualization that go beyond simple graphs. Although many of these visualization tools could be enough for presenting and displaying 3D numerical data on 2D screen devices, there is a need, and presently a lack, of visualization techniques for true 3D analysis of real-world 3D numerical models. The work presented in this thesis covers the visualization of 2D and 3D numerical simulations in the field of Astrophysics, as well as the techniques applied in order to analyse the data from the simulations. And ultimately, visualize the 3D data in a true 3D environment. It has been debated (DeSanctis 1984) whether sometimes text descriptions are better than graphical displays, and if computer graphics are really significant as decision aids for researchers. DeSanctis has found in her work that in many cases, tables are better than graphs for obtaining specific data values, but graphs are usually better than tables for identifying trends. She did not investigate possible advantages of more complex visual displays, however what is true is that in some cases, graphs are definitely better than text, but in other cases text can be favoured over graphics and it will be eventually the decision of the researcher whether a graph fits better for a particular purpose than a text table, or vice versa. Many people think and remember things in terms of pictures, relating the world in an inherently graphical way and use their imagination as a primary component of creative thought (Gregory 1970). Thus, the interpretation of abstract entities with visualization is a key issue in the understanding of these entities and relating them to our physical world. This work expects that the visualization of the numerical simulations in two and three dimensions carried out in this thesis, will give a new insight of the data to the astrophysicists but also, and very importantly, to the general

4

Page 16: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

public and popular science. Ultimately this work also seeks what astronomy has been doing all this time, to try to resolve our curiosity and to try to understand a little bit more of the universe where we are living, fantasizing about being able to make a journey in space. Human imagination seems to have no limits and we will continue implementing, or at least trying, to make real what we believe can be possible. 1.2 The Visualization Process

The first stage in the visualization process is the acquisition or collection of data from a source. It can be experimental data, measured data, or data from a numerical computation. Formerly, the most frequent application areas where scientific visualization was employed were in engineering, medicine, and, of course, in science. Although nowadays this same technology is used in almost every field where the need of presenting information in visual form, and the use of computers, take place. Thus visualization has become an indispensable tool in many areas. For the particular case of our concern, these data are obtained from numerical computations of astrophysical phenomena. The capability of visualizing a numerical solution gives us a tremendous tool for understanding not only the solution, but also the numerical method. As the much cited Richard Hamming said, “the purpose of computing is insight, not numbers” (Hamming 1962), and the working knowledge of numerical analysis, computer programming, and visualization will lead us to the eventual goal of understanding a bit more of our physical universe. With scientific visualization we also have an effective analysis of the performance of the models through visual observation. Once we have generated, or collected, the data, visualization techniques are then applied and the data are transformed and/or modified by various methods to enhance the meaning of the data and/or to map to a form appropriate for representation, where ultimately, it will be rendered or displayed. More formally, in a mathematical context, consider an empirical model from the supplied data which provides us with some entity to visualize. Typically this entity is defined over some domain of independent variables, and it will have a range of dependent values or results. We can represent this functional relationship symbolically as:

RXF ⇒: (1.1) The entity is therefore a function F of many variables:

)(XF where ),...,,( 21 mxxxX = , (1.2)

5

Page 17: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

the domain X being a subset of ℜ and hence having the dimension m. Assuming that R is a subset of , then (1.1) can be considered an (m+n)-dimensional dataset.

m

nℜ

The dimensionality of the dependent variables defines how many values are available at every data point, so the function F can be one of a number of different types: a scalar, a vector ( ),...,,( 21 kfffF = ), or even a tensor of second order ( )( jkfF = ) or higher. Thus, the classification of the techniques for visualizing the entity will be based on the type of the function and the dimension m of the domain. Of course there is also the case where there is no associated function, where we want simply to visualize a set of points, e.g., a scatter plot. In this thesis we have concentrated mainly on scalar fields. Scalar variables do not have a direction and have a tensor rank of zero. They do not vary under rotation or translation of a local reference frame, and they are often called singled-valued functions. These scalar variables, in a three dimensional space and time, can be described by

),,,( tzyxf . (1.3) As we did with the functional relationship, we can represent visualization as a similar mapping of data to some kind of representation.

tionrepresentadataV ⇒: , (1.4) in which typically we want to determine or verify the mapping f. Hence the mapping V is usually designed in such a way that the representation of data creates a better understanding, or corroborates and validates the suppositions, of f. The utilities used to perform this mapping are the so called visualization toolkits. The set data can include not only the values from X and R, but also from other sources in order to create the representation in a more useable way; add a reference frame for spatial location; create relations between different data, juxtapose simulated and experimental results to ensure that the model simulates some real-world system in the expected way; and add some other common features including colour, size, shape, orientation, and sound.

6

Page 18: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

C h a p t e r 2

High Level Models Scientific visualization systems form part of the process of scientific investigation. Visualization systems facilitate and contribute to the processes of preparation and verification of the hypothesis. But scientific visualization not only can be seen as part of the whole process; visualization of data, itself, can be regarded as an entire process of scientific investigation. We need a problem formulation where hypotheses are supposed based on some initial insight. We have a preparation stage where data collection and the computations take place, and a verification stage where our results will validate or not our hypothesis. For this reason, a model of scientific investigation is used for our purposes, and a scientific visualization cycle model is introduced in this thesis. Watson has proposed a cyclic model of the process of scientific investigation (Watson 1990). This model has been used as a starting point and it has been modified to introduce some important aspects considering visualization systems. The model is a cyclic process, with the scientist using insight to formulate his hypothesis, collect data from computational methods or measured data, transform and map these data for later display and interpret the output and then repeat and refine the cycle.

Data Collection Data Manipulation Hypothesis Computations

User Rendering Techniques Insight Results

Figure 2.1. The Scientific Visualization Cycle Model.

7

Page 19: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

This model is introduced to differentiate the term visualization, which involves the entire process of a scientific investigation, from the one of graphic rendering, which is merely the mapping of data to rendered image. Thus the visualization cycle includes not just the activity of producing pictures from data, but also the complete cogitative process, where the user performs a research methodology in a scientific problem formulation, from using insight to construct a hypothesis to rendering and interpreting the output. The components of this model can be seen as modules of all the aspects in the visualization cycle, and this happens to be useful when discussing and analysing visualization systems. A more detailed model of part of the visualization process can be found in Haber and McNabb (1990). Haber presented at the 1990 IEEE conference on Visualization a detailed model of part of the visualization process. Similar models to that of Haber can be found in Dyer (1990), these models were used in the development of a visualization system (apE) at Ohio Supercomputer Center. More generalized network models of the transformation models, users interacting with data input and data transformation as well as rendering, are described in Upson et al. (1989).

8

Page 20: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

C h a p t e r 3

Module Model

3.1 Overview

In the Module Model, the Visualization System is modelled as a controlled dual dataflow. The dataflow abstraction, besides being ideal for remote execution and parallel operation, is attractive because it highlights the mapping stage and provides a system for exploring additional mapping methods interactively. These modules are inserted into the visualization system to form the required visualization tool, and the user constructs his own tool tailored to his specific application needs. The module can be seen as a computational unit, which accepts dataflow as input and generates other data as output, and responds to controls from a Command Interpreter. The dual dataflow is terminated at one end by a Command Sequencer module which is responsible for converting input into a command sequence, and at the other end, the output, the dataflow is terminated by the “user module”, with the user converting the output of the system into further command input.

Internal Data MetaData Control Data Storable (Parameters) Data

Internal MetaData Data

Basic Module

Figure 3.1. Basic Visualization Module.

9

Page 21: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Most modules are variants of this basic visualization module, which is basically an interceptor of a data flow towards the user and a data flow away from the user responding to a series of commands. To build a visualization application a group of modules is connected to form a computation network (see Fig. 3.2). The connections represent the flow of data among the modules. Simple visualization systems may be constructed as a linear sequence of modules. Loops are not allowed, nevertheless, it is possible to fork and merge the flow path, and to send feedback from later to earlier modules in the dataflow network.

external data disk resident data set(s) typical transforms: data-to-data data-to-geometry data-to-pixels display visualized images

Data Import

Data Access

Data Manipulation

Rendering Technique

Generate (or read) Colour map

Base Graphic System

User Interface- Image Viewer

Figure 3.2. A network of modules: dataflow modelling a very simple visualization.

The concept of modules, and in general the applications composed of smaller components at a higher level of abstraction, has been well known since the development of object-oriented programming technology. This abstraction that permits to encapsulate the properties and behaviour of the

10

Page 22: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

entities in a system has many advantages over the conventional, procedural programming model (Cox 1986). The module model makes visualization applications easier to develop (well, sometimes). Hence the research community is enormously benefited, enabling scientists and engineers to skip those arduous hours of programming and to explore interactively additional visualization techniques. 3.2 Details of Modules and Data Types

As we saw previously, modules are software components of a system and when connected together they can build visualization applications. Modules can be characterised mainly by their input and output connections. If a module has no upstream inputs and at least one downstream output, it is generally called a source module. They represent the data sources, either from an external source or data being generated directly within the system. On the other case, a module having one or more input connections but no downstream output, it is called a terminal module, and they correspond to the outputs of the network, such as displays or any other external resource where the data may be exported. In most module application frameworks it is common to include the source modules and some terminal modules into an Input/Output-Module category, while the terminal modules related to displays are located into a category of Renderers. The rest of the modules, those having multiple inputs and outputs, represent any data transformation, data manipulation, and visualization technique. In this category are included data filters, which perform certain operations to pass only selected information like interpolation, scaling, and warping; geometric mapper functions, in charge of creating a geometrical output, for instance contours and surface generators; colour modules which convert scalar input into colour values; and other tool modules for various data transformations. For describing the dataflow between the logical modules, the model needs to employ a set of data types. Among them we can find an external data type, which may import or export data at any level of the hierarchy; an internal data, i.e., all information permitted to pass along the dual flow network; a storable data, which may store and retrieve the internal data within the system at any level; a graphics data type, which is a reduced form of internal data representing the graphics primitives after the visualization technique was performed; a picture data type, a reduced form of graphics data, usually a pixel map; a control data type, which activates and controls the modules of the system and is connected to all control inputs; and, of course, a user input/visual output type which includes all forms of communication between the user and the system.

11

Page 23: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

3.3 Other aspects

On the other hand, there are other aspects and behaviours of the visualization system that may not be reflected in terms of the “module model”. The functional capabilities of a visualization system are well described, but it does not indicate how rich the system may be in terms of functionality. Thus the functional richness is an aspect which cannot be quantified in this type of model, as opposed to systems that are primarily aimed, for instance, at image processing, which may contain many options for transforming image data and generating displayable images. Also the usefulness of a visualization system depends in great part upon the range of data import and export functions available. Nowadays we have many scientific disciplines, and commercial companies, defining their own data formats at a very high rate, for which the visualization systems need to have a flexible approach to the addition of new data import and export modules.

12

Page 24: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

C h a p t e r 4

Functional Model

4.1 Overview

As we have seen in the previous chapter, the module model does not encompass aspects in terms of the functional capabilities and some other aspects that cannot be quantified using that type of model. The functional model is based on the data-flow paradigm, which means that it shows how data flows through the system, and also describes the dependency of its various parts upon one another. Most visualization systems currently available focus on the data-flow paradigm in an algorithm oriented way, making data itself not accessible directly by the user, but means are provided to connect modules to the network by typing a series of commands in order to perform certain visualization tasks.

Point Array Lines Polygons Mesh

Outline Surface Contour Extract Plane

Display Display Display Display

Data: F(x,y,z)

Line Contour

Figure 4.1. Functional model. In this paradigm, modules are connected together into a network. The modules (oval blocks) perform algorithm operations on data as it flows through the network. The rectangular blocks represent data stores or objects,

13

Page 25: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

which represent and provide access to data. The blocks may also have local parameters that serve as additional input. The execution of this network is controlled in response to demands for data (demand-driven) or in response to user input (event-driven). For any given process to execute correctly, all the inputs must be up to date, which suggests that functional models require a synchronization mechanism to ensure that the correct output will be generated. The appeal of this model is that it can be quickly adapted, is easier to describe and to implement the algorithm, and tends to be easier to learn and apply. 4.2 Differences between the Models

Of course there will be advantages and disadvantages, as well as similarities and differences between the visualization models presented here. The main difference is that the systems based on the module model are more abstract. In contrast, the visualization systems based on the functional model are more concrete. These models are often referred to as abstract data models or concrete data models respectively. This does not mean that the functional models are not abstract, or vice versa. The difference comes in the level of abstraction. Usually concrete models have a relative level of abstraction which is lower than in the other models. 4.2.1 Advantages

The main advantage the abstract models have is that, because of their level of abstraction, they are capable of representing a wider range of data and are more flexible. The data representation in these models can be used to exploit regularity in data to obtain compact representations, which leads to compact computer codes. Another advantage is that the complexity of abstract models can be hidden by creating simpler, application-specific interfaces. On the other hand, concrete models are easier to describe, interface, and implement than abstract models. Concrete models are normally programmed in an algorithm oriented way, and many users find them easier to follow and understand than the more abstract models, making them easier to learn and apply. 4.2.2 Disadvantages

The level of abstraction influences the computer code and/or database interface to the data model. Abstract models result in abstract code and data representations. Models that are too abstract can be confusing in the computer code as well as in the interfaces, and can be misused because of user misunderstanding. The level of abstraction requires the users to envisage an abstract thinking too, which many people sometimes find quite difficult. Concrete models, on the other hand, besides being sometimes easy to learn

14

Page 26: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

and apply, cannot be made more abstract by modifying interfaces, as happens in the abstract models. They are limited in flexibility and capability. The access to the underlying data is mostly limited. There is no explicit control of data by users within most of the dataflow. As data do not exist as directly accessible data objects, a selective handling is not possible. Finally, as in virtually every aspect of scientific investigation, any system is only evaluated as appropriate or inappropriate only when measured against a particular application. We cannot consider a system to be a poor system if it was not designed for another application beyond the defined scope. For example, a system designed for image processing, but incapable of volume rendering, cannot be tagged as being a poor system. Each visualization system will have, explicitly or implicitly, a defined scope and an anticipated area of application.

15

Page 27: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

16

Page 28: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Part II

The Numerical Simulations

17

Page 29: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

18

Page 30: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

C h a p t e r 5

Numerical Simulations in Astrophysics Modern Astronomy has incorporated computational astrophysics as its third main branch, along with observation and traditional theory. Powerful computers have made possible the advance from imagination to image by simulating those processes that are hidden from view, and also those events occurring so slowly or rapidly that we would never be able to see them with direct observation. Processes that required billions of years or few milliseconds cannot possibly be observed directly but may be investigated using modern supercomputers. Thus, the application of physics to astronomy, astrophysics, with the help of high-speed computing machines, has allowed astronomers to explain a wide range of observations, including strange and exotic objects and events, such as interstellar clouds and jets, star formation, accretion disks, and neutron stars and black hole coalition among many others. Astrophysics also has traditionally led the way in large-scale computation and visualization. This chapter presents a description of the numerical simulations from which the data has been obtained for making the visualizations. These simulations are results from very recent scientific investigations in astrophysics carried out by several researchers during long time in different institutions around the world, in particular the Institute of Astronomy at the National Autonomous University of Mexico, and the Department of Physics and Astronomy at University College London. The codes for running the simulations were obtained during a long collaboration with these researchers when I was studying and later employed by the Institute of Astronomy in Mexico City. During these years, I have had the privilege to continue working with them, and the opportunity to interpret and visualize the outcome from their numerical simulations. In the next sections, besides the numerical description and the equations describing the astrophysical processes, the reader will find introductory content about these phenomena and will be referred to appropriate texts for further reading. For those already interested in the subject, we recommend the textbook of Carroll and Ostlie (1996) as a good starting point for modern astrophysics, in which the reader can find from historical passages to a good mathematical and physical description of astrophysical phenomena. Thus let us begin with the processes involved in the formation of stars, then continue with its evolution and the mass loss occurring in the production of jets of gas ejected by young stars, and finally arrive to the final stages in the evolution of stars in binary systems.

19

Page 31: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

5.1 The Process of Star Formation

Over the last decades, our understanding of stellar evolution has developed significantly due to advances in observational techniques, improvements in our knowledge of the physical processes in stars, and increases in computational power. Following, we present an overview of a model for local star formation in the interstellar medium. A star is formed when a large amount of gas and dust starts to collapse in on itself due to its gravitational attraction. This gas and dust that exists between the stars is known as the interstellar medium (ISM). To understand the evolution of a star, it is important to study the nature of the ISM. The dominant component of the ISM is hydrogen gas in its various forms; neutral hydrogen (H I), ionised hydrogen (H II), and molecular hydrogen (H2). Hydrogen comprises approximately 70% of the matter in the ISM, and helium makes up most of the remaining mass; metals, such as carbon and silicon, account for only a few percent of the total. Most hydrogen in diffuse interstellar hydrogen clouds is in the form of H I in the ground state. Observation has indicated that the composition of the dust in the ISM is of both graphite and silicate grains. In the ISM, collisions between hydrogen atoms occur on time scales of hundreds of years. Molecular clouds are complexes of dust and gas where temperatures are typically T ~ 20 K, and densities in the range of n ~ 100– 300 cm-3, and typical sizes on the order of 50 pc. These clouds interacting with each other make astrophysical flows highly turbulent with a wide variety of mostly compressible energy sources, e.g. strong heating processes and radiative cooling, at various scales. Turbulent flows and gravitational collapse of the cloud are the main mechanisms of star formation. For the gravitational collapse to occur, the minimum mass necessary of the molecular cloud must satisfy the Jeans criterion, i.e., it must be higher than the critical value known as the Jeans mass. The earliest stage of evolution in a star is the formation of pre-nuclear-burning objects known as protostars from interstellar molecular clouds. 5.1.1 A Model of Star Formation in the ISM A model for local star formation in the interstellar medium can be obtained by solving the magnetohydrodynamic (MHD) equations with cooling-induced compressibility on the structure of turbulent flows and gravitational collapse. The magnetohydrodynamic equations to simulate highly compressible flows representing the ISM on the plane of the Galactic disk (see Vazquez-Semadeni, Passot, & Pouquet 1996) are given by the following equations:

20

Page 32: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

ρµρρ 2)( ∇=⋅∇+∂∂ u

t,

uvuBBMJPuu

tu

a

88

2

2)(1∇−×Ω−××∇+∇

∇−=∇⋅+

∂∂

ρφ

ρ

cs FFuuv ++

⋅∇∇+∇+ )(

312

2 ,

Λ−Γ+Γ+∇

+⋅∇−−=∇⋅+∂∂ ρ

ρκγ sdT

eueeute 2

)1( ,

BBvButB 28

8)( ∇+∇−××∇=∂∂ η ,

12 −=∇ ρφ , eP ργ )1( −= ,

(5.1)

(5.2)

(5.3)

(5.4)

(5.5)

where ρ is the density, u is the fluid velocity, e is the internal energy per unit mass, P is the thermal pressure, B is the magnetic induction, Ω is the angular velocity of the rotation, and φ is the gravitational potential. Fs corresponds to the shearing force and Fc is an additional acceleration introduced as a wind-mimicking momentum source. The model incorporated the terms for cooling, Λ, and diffuse heating due to UV radiation and cosmic rays (Γd) and the stellar local heating (Γs). The ratio vp cc=γ of specific heats at constant pressure and volume, respectively, is 35=γ (a monatomic gas). The temperature T measure in kelvins, is related to the internal energy by e . From the nondimensionalization (Passot, Vazquez-Semadeni, & Pouquet 1995) the resulting nondimensional parameters are J, the number of Jeans lengths in the integration box, whose side is 2π, and M

Tcv=

a, the Mach number. Ma =1 has been taken, which corresponds to the characteristic velocity u0 at the initial mean temperature of the flow. A mass diffusion is added to the continuity equation in order to smooth out the density gradients, thus allowing the simulations to reach higher rms Mach numbers. A hyperviscosity scheme with a ∇

ρµ 2∇

8 operator is used, which confines viscous effects to the smallest resolved scales and allows for the use of much smaller values of kinematic viscosity v2 and magnetic diffusivity η than would be possible with v8 = 0. Finally, the initial conditions for all variables are Gaussian fluctuations with random phases.

21

Page 33: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

These equations are solved in two dimensions with periodic boundary conditions, using a Fourier pseudospectral technique with a resolution of 10242 collocation points on a twelve-processor Silicon Graphics Onyx2, a parallel shared memory machine; and in three dimensions with a resolution of 1003. We refer to Passot, Vazquez-Semadeni, & Pouquet (1995), for further details concerning the technique and the model terms, and to Palomino, Li, & Pei (2002) concerning the migration of the code to a parallel environment. Unsurprisingly, the performance of the parallelized code in the parallel machine was noticeably faster than the serial one. 5.2 Stellar Jets from Variable Sources During the pre-main-sequence of evolution in a star, young protostars experience significant mass loss in the form of expanding shells. In some extreme cases mass accretion occurs rather than mass loss; with the mass accretion rates being of the same order as mass loss rates. Along with expanding shells, mass loss also occurs via the production of jets of gas that have been ejected in rather narrow beams in opposite directions. Herbig-Haro objects, first discovered in the vicinity of the Orion nebula in the early 1950s by George Herbig and Guillermo Haro, are associated with the jets produced by young protostars. As jets expand supersonically into the interstellar medium, collisions excite the gas, resulting in bright objects with emission-line spectra. Astrophysical jets occur in a variety of phenomena over enormous ranges of energy and physical size; for example, jets are also originating from deep within the accretion disk, possibly from the central star itself; from young binary neutron stars; from extragalactic radio sources; and inside planetary nebulae, among other variable sources. We recommend the comprehensive but introductory book of Kund (1995), to the reader interested to understand the fascinating phenomena of jets from stars and galactic nuclei. 5.2.1 A 3D Model of Variable-Source Stellar Jets Three-dimensional numerical simulations of a variable-source, Herbig-Haro type jet, with the time-dependence of the jet ejection vector such that its direction precesses on a cone and its ejection speed varies as a sine wave, have been performed by Lim (2001). In the simulations the usual inviscid Euler equations for continuity of mass, x– y– z–momentum and energy:

( ) 0=⋅∇+∂∂ v

trρρ ,

(5.6)

22

Page 34: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

( ) ρPvvdtv

∇−=∇⋅+∂ rrr

,

(5.7)

( ) ( ) 0=

∇⋅+

∂∂

Γ−∇⋅+∂ ρρ

ρv

tPPv

dtP rr ,

(5.8)

are solved, where the fluid variables P, ρ and vr are, as customary, the pressure, density, and velocity, respectively; Γ is the ratio of the specific heats. The equations are solved in three dimensions from the point of jet injection using the method of Flux-Vector Splitting due to Van Leer (1972), on a Cartesian grid with maximum resolution 257 x 257 x 513 in the x, y and z directions respectively. The jet considered is over-pressurised, highly ionised and more dense than the static and neutral environment. The physical size of the grid in each dimension is xmax = 5.14 x 1017 cm, ymax = 5.14 x 1017 cm and zmax = 1.028 x 1018 cm, and a jet is injected into the undisturbed environment from a disk, at z = 0, centred on (xmax/2, ymax/2) with radius 3.0 x 1016 cm. Initially the number density of the jet is 1000 cm-3 and temperature 10000K, it is assumed at injection to be 90% ionised. The injection velocity components of the jet are defined as follows

1)2cos(2.34 −= kmstv px τπ ,

(5.9)

1)2sin(2.34 −= kmstv py τπ ,

(5.10)

1)2sin(90300 −+= kmstv vz τπ . (5.11) The jet, therefore, precesses on a cone which, at t = 0, has a half-angle of 6.5°. The magnitude of the ejection velocity, in the z-direction, varies as a sine wave of amplitude 90 kms-1 superimposed on the mean value of 300 kms-1. The timescales pτ and vτ , for precession and z-velocity variation respectively, are chosen so that one revolution of the ejection vector takes place in 200 years and the period of the sine wave in Eq. (5.11) is 50 years. The path of the jet is helical and its radial motion (of order 34 kms-1) has a mach number close to 3. The environment into which the jet moves is stationary, has a density of 100 cm-3, a temperature of 10000K, i.e. same as the jet, and it is assumed to be 99.99% neutral. The development of this model, the description of the adaptive part of the code, and the technique of pointer-based formulation of the linked grid employed are described in detail by Lim & Steffen (2001) with reference to galactic scale jets. Due to the resolution of the code these numerical simulations were performed on a Cray Y-MP 4/64.

23

Page 35: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

5.3 Close Binary Star Systems Astronomers have had ample opportunity to observe plenty of binary star systems. In fact, at least half of all “stars” in the sky are actually multiple systems, two or more stars in orbit about a common centre of mass. In most of these systems the stars are sufficiently far apart from each other that the influence of one on the other is almost negligible. They evolve essentially independently, except for the gentle grip of gravity that binds them together. If the stars are very close, with a separation roughly equal to the diameter of the larger star, then one or both stars may have their outer layers gravitationally deformed giving the appearance of a teardrop. As a star rotates through the tidal bulge raised by its companion’s gravitational pull, it is forced to pulsate. Orbital and rotational energy are dissipated in this way until the system reaches the state of minimum energy for its constant angular momentum, resulting in synchronous rotation and circular orbits. Thereafter the same side of each star always faces the other as the system rotates rigidly in space and no further energy can be lost by tidally driven oscillations. The distorted star may even lose some of its photospheric gases to its companion. The spilling of gas from one star onto another can lead to some spectacular celestial phenomena, such as the formation of accretion disks or perhaps, depending on the mass of the secondary star, it may explode as a supernova. The life history of a close binary system is quite complicated, it can have many possible variations depending on the initial masses and separation of the two stars interacting. There are many types of close binary systems. Some of the main classes of interacting binaries are: Algols, two normal stars in a semidetached binary system; Ursae Majoris Contact Systems, short period contact binaries with high levels of magnetic activity coalescing into single stars; Nova-like Binaries, also short period systems with white dwarf components; X-ray Binaries with Neutron Star and Black Hole Components, powerful x-ray sources due to the accretion of gas onto the degenerate component of the system from a nondegenerate companion; Symbiotic Binaries, consisting of an M giant and an accretion component such as a white dwarf; Barium and S-Star Binaries, also giant stars with white dwarf companion; and Post-Common Envelope Binaries, usually a hot white dwarf component and a cooler secondary star. A good introduction into this subject and other interesting astrophysical phenomena can be found in Carroll and Ostlie (1996). A broad comprehensive introduction to all aspects of black hole physics is given in Hehl, Kiefer, & Metzler (1997). A more advanced text regarding theory of black holes, neutron starts, and binary systems can be found in the well-known classic book of Shapiro and Teukolsky (1983).

24

Page 36: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

5.3.1 Accretion Disks The orbital motion of a semidetached binary (when the transfer of mass from one star to the other one begins) can prevent the mass that escapes from the swollen secondary star from falling directly onto the primary star. The primary’s movement is often enough to keep it out of the path of the gases that spill. If the radius of the primary star is less than about 5% of the binary separation, the mass stream will miss striking the primary’s surface. Instead, the mass stream goes into orbit around the primary to form a thin accretion disk of hot gas in the orbital plane (Carroll and Ostlie 1996). Viscosity, an internal friction that converts the directed kinetic energy of bulk mass motion into random thermal motion, causes the orbiting gases to lose energy and slowly spiral inward toward the primary. The mechanisms responsible for the viscosity in accretion disks are not completely understood, the familiar molecular viscosity due to interparticle forces is far too weak to be effective. Other possibilities involve random motions of the gas, such as turbulence in the disk material caused by thermal convection or by a magnetohydrodynamic instability in the magnetic fields that interact with the differentially rotating disk. Whatever the mechanism, the gas is heated throughout its descent to increasingly higher temperatures as the lost orbital energy is converted into thermal energy. Finally, the plunging gas ends its journey at the star’s surface. 5.3.2 Black Hole–Neutron Star Coalescence As we have seen, there are many types of close binary systems and we have mentioned just a few of them. Many close binary systems have been observed, including binaries containing two neutron stars, and the observations have matched the predictions of the theory. Black Hole – Neutron Star binary systems are not known yet, but population synthesis studies (Kalogera et al. 2001) over the past 25 years lead us to believe that their rate is comparable to that of double neutron star systems, on the order of 10-6-10-15 per year per galaxy. The theoretical study of the tidal disruption of a neutron star by a black hole was addressed many years ago (Wheeler 1971). Numerical hydrodynamical studies of binary neutron star coalescence were begun by Oohara & Nakamura (1989), and more recent simulations on merging black hole – neutron star binaries have been studied by Lee & Kluźniak (1995, 1999). 5.3.3 Hydrodynamics of the Coalescence of Black Holes with Neutron Stars: A 3D Model. A numerical study of the hydrodynamics in the final stages in the spiral in a black hole–neutron star binary has been performed by Lee (2000). A Newtonian three-dimensional Smooth Particle Hydrodynamics (SPH) code

25

Page 37: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

was used to model the final stages when the binary separation becomes comparable to the stellar radius. Let us stop here for a second to initiate the reader into this simulation method. SPH is a relatively new technique for hydrodynamic calculations developed by Lucy (1977) and Gingold and Monaghan (1977). It is a gridless Lagrangian method that uses a particle interpolation method to compute smooth hydrodynamic variables (see Monaghan 1992 for a complete review of this method) and is ideally suited for the study of complicated flows in three dimensions (e.g. tracking accurately the orbital motion of two stars across a large 3D grid can be quite tricky), when no assumptions about symmetry in the system are made, and where are large volumes that are basically devoid of matter. There are no boundary conditions at all and the modelling of the fluid is not restricted to a particular region in space. Thus, this method is suitable for this kind of simulations. The neutron star is modelled with a stiff (adiabatic index Γ = 3) polytropic equation of state, so that the pressure is given by with Γ and K being constants. The black hole is modelled as a Newtonian point mass of mass M

Γ= ρKP

BH which accretes matter via an absorbing boundary at the Schwarzschild radius 22 cGMr BHSch = . Any SPH particle that crosses this boundary is absorbed by the black hole, whose mass and momentum are adjusted so as to ensure conservation of total mass and total linear momentum in the system. The simulations used here consisted in N ~ 3800 SPH particles to model the neutron star and about N ~ 8000 for the whole system, this number obviously decreases since accretion onto the black hole demands a loss of particles. The initial (spherical) neutron star was constructed by placing the SPH particles on a uniform 3D grid with particle masses proportional to the Lane-Emden density (this ensures that the spatial resolution is approximately uniform throughout the fluid). This isolated star is then allowed to relax by including a damping term linear in the velocities in the equations of motion. The initial conditions correspond to irrotational binaries in equilibrium (approximating the neutron star as a compressible triaxial ellipsoid), and the initial mass ratio BHNS MMq = was set to 0.5. To perform a dynamical run (in this case for approximately 23 ms), the black hole and every SPH particle are given the velocity as determined from the corresponding initial conditions in an inertial frame, with the origin of coordinates at the centre of mass of the system. Each SPH particle is assigned a specific internal energy )1()1( −Γ= −ΓρKi

uPu and the equation of state is

changed to that of an ideal gas, ρ)1( −Γ= . The specific internal energy is then evolved according to the first law of thermodynamics, taking into account the contribution from artificial viscosity. Artificial viscosity is used in

26

Page 38: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

SPH to handle the presence of shocks and avoid particle interpenetration. The momentum and energy equations are written as:

RRiiijiij

ji

ji

jj

i aWPP

mdtvd rr

−Φ∇−∇

Π+−= ∑ ρρ

2,

(5.12)

and

( ) ijijiijji

ji

jj

i WvvPP

mdt

du∇⋅−

Π+= ∑ rr

ρρ

2

21 ,

(5.13)

Here is the artificial viscosity terms computed using the form presented

by Balsara (1995), and ijΠ

RRiauPv rr ,,,,, Φρ and W are the velocity, pressure,

density, internal energy per unit mass, gravitational potential, radiation reaction acceleration and interpolation kernel, respectively. For further details of these particular simulations and a more detailed description concerning the technique and the model terms, we refer to Lee (2000). 5.3.4 2D Simulations of Accretion Disks around Black Holes Accretion onto black holes is often thought to occur in the form of a disk, due to the angular momentum of the accreting matter, and has been considered an efficient way to transform gravitational energy into radiation and a strong candidate as central engine for cosmological gamma-ray bursts. The study of the hydrodynamic evolution of massive accretion disks around black holes, formed when a neutron star is disrupted by a black hole in a binary system, has been recently carried out by Lee & Ramirez-Ruiz (2002). In their simulations the equations of hydrodynamics are solved in two dimensions using smooth particle hydrodynamics (SPH). The initial conditions are taken from the three-dimensional calculations mentioned in the previous section. By assuming azimuthal symmetry they were able to follow the time dependence of the disk structure for a few tenths of a second (terminated in t = 0.2 s), rather than a mere few tens of milliseconds like in the 3D simulations. Thus, the inner regions of the output from the three-dimensional calculations were mapped to cylindrical coordinates (r, z) to begin the calculations (with 200<< z0 km and 0 400<< r km).

27

Page 39: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

In this model an ideal gas equation of state is used, with )1( −Γ= uP ρ (u is the internal energy per unit mass), and it is assumed that all the dissipated energy is radiated away. The fluid is initially given the azimuthal velocity v required for centrifugal equilibrium. The self-gravity of the disk is neglected, and a black hole produces a Newtonian point-mass potential

φ

rGM BHBH −=Φ . Accretion is modelled by an absorbing boundary at 22 cGMr BHSch = (the Schwarzschild radius).

For the implementation of SPH for the two-dimensional azimuthally symmetric calculations, the set of equations for momentum and energy are given by

art

rrzrrrrBHr

dtdv

zt

rt

rt

RrGM

rP

dtdv

+

∂∂

++∂

∂+−

∂∂

−=ρρ11

3 ,

(5.14)

∂+

∂+=

zt

rt

rt

dtdv zrr φφφφ

ρ21 ,

(5.15)

art

zzzzrzrBHz

dtdv

zt

rt

rt

RzGM

zP

dtdv

+

∂∂

++∂

∂+−

∂∂

−=ρρ11

3

(5.16)

dtdsTvP

dtdu

+⋅∇

−=

r

ρ.

(5.17)

Here R = (r2 + z2)1/2 is the distance to the origin, and the artificial viscosity terms are computed to minimize the effects of artificial shear on the evolution of the disk. Artificial viscosity is used to model the presence of shocks and avoid particle interpenetration, with an accompanying reduction in spurious numerical effects. dtdsT is the energy dissipation per unit mass. P, ρ , G and MBH correspond, as usual, to the pressure, density, the universal gravitational constant, and the mass of the black hole respectively. The explicit forms of the acceleration and the energy dissipation for a given SPH particle are:

28

Page 40: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

ijiijij

jarti

Wmdtvd

∇Π−=

≠,

r

, (5.18)

and

( ) ijijiijij

jarti

WvvmdtdsT ∇⋅−Π=

rr

21

,

, (5.19)

Where W is the SPH interpolation kernel given by Monaghan and Lattanzio (1985), adapted to azimuthal symmetry, and ijΠ is the artificial viscosity terms using the prescription of Balsara (1995). For a detailed description of these simulations, the numerical method and its implementation, of accretion disks around black holes, from a black hole–neutron star coalescence, with dynamical evolution, meridional circulations, and gamma-ray bursts, we refer to Lee & Ramirez-Ruiz (2002).

29

Page 41: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

30

Page 42: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Part III

The Environment and The Visualizations

31

Page 43: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

32

Page 44: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

C h a p t e r 6

The Process of Scientific Visualization One of the important themes of Scientific Visualization is the utilization of the human sensory system in steering and interpreting complex processes and simulations involving voluminous datasets, like the ones we have seen in the previous chapter. Vision dominates our sensory input, thus graphical representations of these abstract datasets play a key role in the understanding of the mathematical abstraction and physical models. We have seen in Part I some aspects of scientific visualization and its processes towards the formation of the graphical representation. Part II has described how we have obtained the “raw data”, resulting from the data generation process, in our particular case from numerical simulations in astrophysics. This third and last Part will cover in detail, in this and the following chapters, the visualization processes, techniques, important aspects and variety of operations which are involved and are applied during the course of producing the visualizations of the numerical simulations reviewed previously in astrophysics; the environment used in producing the visualizations; and finally the graphical representation of the simulations displaying the beautiful mixture between science and art. 6.1 The Process of Numerical Simulations and Visualization Here we will extend our discussion in what we have said in Section 1.2 about the visualization process. There, a general introduction of the stages in the process and the mapping of data to some kind of representation was given. In this section we will go deeper into those aspects and treat in more detail the process concerning the numerical simulations and their visualization. 6.1.1 Domain Transformations In Section 1.2 we have seen that data can be represented, symbolically, as a functional relationship over some domain of independent variables, and that, similarly, we can portray visualization as a mapping of data to some representation form. Particularly, the process of numerical simulations and visualization is typically performed in three different domains: the physical domain P, the computational domain C, and the graphical domain G.

33

Page 45: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

The simulations considered previously all describe some type of flow. Therefore, the equations of motion must be defined in the physical domain. The domain is then discretized, often into a curvilinear, boundary-conforming grid, fitting the surface of objects, and the flow variables (velocity, density, pressure, etc) are described at any grid point of P. The equation of motion are then transformed to the computational domain, which is also discretized to suit the needs of the numerical computation, often into a uniform rectangular grid, and thus deformed with respect to P, or as we have seen, the domain can also be bounded and the flow variables described using smooth particle hydrodynamics, which is gridless. The graphical domain is also often discretized to suit the needs of graphics processing. Visualization often directly refers to physical reality, therefore the shape of objects in G is usually the same as in P. Often a regular rectangular discretization is used. G is populated with geometric primitives and attributes, such as shapes and colours, which must be ultimately expressed in pixels. The first step in the transition between these domains is the discretization or grid generation, as a part of the pre-processing for numerical computations. Grids can be of several types: structured or unstructured (these grids are also often referred to as regular and irregular, respectively), rectilinear or curvilinear, and combination of these. Even more complex situations may occur when grids are staggered, which means that data values (such as velocity vector components) are computed in different faces of each grid cell. The geometry of the grids can be curvilinear, resulting in cells with warped brick shape, or orthogonal, resulting in cells with a cubical shape (Cartesian grid) or rectangular brick shape. A good foundation for numerical grid generation can be found in Thompson et al. (1985).

Cartesian grid

Uniform grid

Rectilinear grid Structured grid

Structured curvilinear

grid

Unstructured grid

Staggered grid Scattered locations

Figure 6.1. Examples of grid types.

34

Page 46: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

The discretization of P for a flow simulation often is the definition of a structured, curvilinear grid with cell indices (i, j, k), such that the grid point nearest to the origin of the grid has coordinates (i, j, k). A general point of P is denoted as xp(x, y, z). Velocity vectors vp(i, j, k) = (u, v, w) are computed at each grid point. Computational space C is commonly discretized as a regular orthogonal Cartesian grid with the same cell indices (i, j, k) and points xc(ξ, η, ζ). Velocities at the grid points of C are vc(i, j, k) = (u’, v’, w’). Generally, a single global transformation between P and C is not known, but for each neighbourhood of a grid point (i, j, k), in P a local transformation L can be determined. Transformations for other points in P must then be derived by interpolation between grid values. L denotes the local transformation of a grid point (i, j, k) from C to P as xp = L(xc); similarly, L-1 is used to transform a point from P to C. The Jacobian matrix J of L, defined analytically as J =

L/ x∂ ∂ c, can be used to transform a vector quantity from C to P. For instance, vp = J· vc. Again, the inverse J –1 is used to transform a vector from P to C. Scientific visualization often directly refers to physical reality, thus the graphical domain G must be undeformed with respect to P. Also, a new discretization is needed in G, to support the operations in the rendering stage. The transition to G usually involves a resampling of the data field, and this has several disadvantages. Especially the transition from a boundary-conforming, locally refined curvilinear grid in P to a uniform orthogonal grid in G, which may lead to a severe waste of storage space, or to loss of information, depending on the resolution of the rectangular grid. In areas where the resolution of the P grid is higher than the one in G, data may be lost, while in low resolution areas of P, oversampling will lead to many identical points in G. Often, the boundary conformance will be lost, so that object geometry must be represented separately in G. Also, degradation of accuracy may arise as a result of interpolation. 6.1.2 Point Location in Computational and Physical Space It is often necessary to determine the location of a point with respect to a grid, that is, given the coordinates of a point, we must find the grid cell indices (i, j, k), and fractional offsets (α, β, γ) within the cell containing that point. If we have a point xc(ξ, η, ζ) in C, it is easy to find the cell, if the grid in C is regular and orthogonal. If we have a point xp(x, y, z) in a structured curvilinear grid in P, and we must find the corresponding point xc in C, and incremental search through

35

Page 47: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

the cells must be performed, starting from an initial point, each time taking a step towards a neighbouring cell. One algorithm for this search is the stencil walk (Buning 1989). 6.1.3 Interpolation The quantities obtained from the computations are usually only given at grid points, so that for other points values must be obtained by interpolation. Interpolations may be of zero, first, or higher order, depending on the accuracy required. Let us assume a regular orthogonal grid (as often used in computational space C), in which cells are cubes with (i, j, k) as integer indices; α, β, and γ are the fractional (0…1) offsets of a point within a cell; S(i, j, k) = Sijk is a grid point value. For zero order interpolation, the value within each grid cell is assumed to be constant. The value for a point inside the cell is either the average of the surrounding eight grid points, or equal to the value in the nearest grid point. This interpolation is discontinuous over the grid cell boundaries. In the first order interpolation, a linear variation of the value in the grid cells is assumed. With tri-linear interpolation, a linear interpolation is performed in x-, y-, and z-direction using the fractions α, β, and γ, respectively. In a regular orthogonal grid, α, β, and γ can be easily determined from the coordinates. The interpolation can then be described for a single cell (with i,j,k = 0,1), with two linear basis functions: ss −=Φ 1)(0 , and ss =Φ )(1 ; the product of three basis functions is defined on each of the eight corner grid points of the cell by

)()()(),,( γβαγβα kjiijk Φ⋅Φ⋅Φ=Φ , with i, j, k = 0 or 1 (6.1) Now the interpolated value is obtained as:

),,(1,0,,

γβααβγ ijkkji

ijkSS Φ⋅= ∑=

. (6.2)

Higher order interpolations work in a similar way, using higher order basis functions. Interpolation in a regular curvilinear grid, as is often the case in physical space P, is more complex. The fractions (α, β, γ) are unknown in this case, and must be computed. We can use the same interpolation method described above; starting from a given point xp(x, y, z) in cell (i, j, k), we have:

36

Page 48: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

),,(

1,0,,γβααβγ ijk

kjiijkxx Φ⋅= ∑

=

rr , (6.3)

giving three non-linear equations, which can be solved numerically to find α, β, and γ.

37

Page 49: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

38

Page 50: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

C h a p t e r 7

Data Preparation and Manipulation Visualization usually starts with “raw data” which have been acquired, collected or, as in our case, generated. Often these data are not suitable for direct visualization in the given form. Data preparation and manipulation must take place in order to have it in a form suitable for its visualization. Data manipulation consists of a variety of operations, including data enrichment and enhancement, and computation of derived quantities for a certain visualization mapping. Therefore, prior to visualization, we must first perform some form of filtering, structuring, conversion or subsetting. The most common type of operations are: Data Normalization; Filtering; Smoothing; Data Selection; Feature Detection, Enhancement and Extraction, Grid Rezoning; Coordinate Transformation; Linear Transformation; Geometric Transformation; Colour table Manipulation and Feature Mapping, among many others. A brief description will be given of those ones employed in the development of this work. 7.1 Data Sources and Classification The source of data being analysed is important, and thus its classification. Numerous classifications of data exist, which include methods based on data sources, formats, and types of data. For practical purposes we will choose a broad classification just enough to encompass both the data being investigated and the data required for the system to execute. A practical model to assist in classifying data sources needs to relate whether the data come from a source external to the computing system, of which the visualization system is part, or whether it has been internally generated, this is, a distinction is made between external and internal data. Thus, the visualization system must be capable of importing data from external sources, as well as exporting data from the system. Another important classification relates to whether the data is in its original from, or if it has undergone any kind of operations which make it subsequently derived from that base. For example, data may often need some enhancement, or preparation, or “cleaning up” process prior to beginning formal analysis. This refined data is therefore derived from the original data. Further manipulation may occur and this too can be regarded as generating more derived data. The derived data should be labelled or tagged to identify it as non-original data. For example, a common approach to tagging derived datasets is to include a history of all processing which it has undergone. In most of our final visualizations we have been dealing with derived data.

39

Page 51: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Now that we have made a classification of our datasets, let us proceed to the description of the operations for data preparation and manipulation in order to make our data ready for, ultimately, its visualization. 7.2 Data Normalization Data normalization is applied to data (generally raw data) in order to scale it to a given range of values, for example between zero and one, thereby allowing mathematical processes or graphical presentation facilities to work with a pre-defined range of values. Normalization curves are generally linear but logarithmic or exponential curves are also frequently used. 7.3 Data Selection To reduce the amount of data to be visualized, and to concentrate on those parts we are most interested in or just to obtain more detail in certain characteristics of the data, data selection techniques must be applied. The simplest selection is a global thinning by sub-sampling, or by aggregation and averaging of the whole data field. Also a part may be cut out by clipping the data against a given volume. More sophisticated selection can be done by calculating some index of interest for each grid cell, and only visualizing cells with a high value of this index. Measures for this may be local extreme values of a quantity, or large gradients, such as a sudden change of velocity. The computed indices can be treated as a scalar field, and volume rendering may be applied for visualization. Thresholding, or more advanced image processing techniques can be used to decompose the data in meaningful parts (Hagen et al. 1992). 7.4 Feature Detection, Enhancement and Extraction Like data selection, feature extraction is a first stage process in image analysis. The aim of edge detection and enhancement is to locate and accentuate certain features in the data. Edge detectors generally take the form of a mask kernel which is convolved with the image zeros or maximum, values are then searched for an indication of a “crossing” or edge. Edge enhancement does not increase the inherent information content of the data, it simply emphasizes specific characteristics (e.g. amplitudes in the data which represent physical phenomena).

40

Page 52: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

7.5 Grid Rezoning Grid rezoning is the resampling of data with a structure defined by one grid to a new, possibly overlapping, grid structure. For example, data may be mapped to a regular, rectangular grid of pixels for subsequent display. Grid rezoning is usually performed on derived data. 7.6 Coordinate Transformation Sample data may be in one coordinate system, e.g. linear, but the modelling processes may require the data to be in an alternate format, perhaps because the scaling of data naturally dictates this, for example, logarithmic or exponential, or because the physical properties associated with the data mean they are better processed or viewed in a different system, e.g. polar coordinates. 7.7 Geometric Transformation Geometric transformations are generally used to correct data distortion or to generate a required perspective for viewing an object or image. There are a wide range of techniques which are included in this class. Among these we can find projection, rescaling, rotation, polynomial warping (rubber-sheeting), translation, skewing, etc. A projection can also be considered to be a data-smoothing operation (data is never gained but often lost), projecting n-dimensional data onto n–1 dimensions will generally result in the loss of structural information.

41

Page 53: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

42

Page 54: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

C h a p t e r 8

Visualization Techniques The algorithms employed for visualization are usually classified according to the type of data they operate on, or the type of data they generate. This type of data can be expressed as a function F of many variables. The function F can be one of a number of different types: a scalar, a vector ( ), or even a tensor of second order (),...,,( 21 kfffF = )( jkfF = ) or higher. Thus, the classification of the techniques for visualizing the entity will be based on the type of the function and the dimensionality of the dependent variables. Of course there is also the case where there is no associated function, just a set of points.

Vector Dimen- sion

Point Scalar 2D 3D

1

1D Scatter Plot

Line Graph Histogram Bar Chart

2

2D Scatter Plot

Contour Plot Surface View Image Display Bounded Region Plot 2D Histogram 2D Bar Chart

2D Arrows 2D Stream- lines 2D Particle Tracks 2D Field Topology

3D Arrows in Plane

3 3D Scatter Plot

Isosurfaces Basket Weave Volume Rendering

3D Arrows in Volume

n ndimensional Scatter Plot

Parallel Coordinates

Figure 8.1. Summary of Visualization Techniques fit into the classification scheme used here (adapted from Brodlie et al. 1991).

43

Page 55: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Other researchers have created different classifications. For example, Bergeron and Grinstein (1989) introduced the concept of lattices to describe different arrangements of data. The dimension of the lattice indicates the ordering of the data: zero-dimensional is unordered (e.g. a set of points), one-dimensional indicates a vector of data elements (for example a list of points to be connected by a polyline), and two-dimensional indicates an array of data elements (for example height and pressure at nodes of a regular grid). This classification is more oriented to the data, rather than the entity underlying the data. For example, in a contouring instance, Bergeron and Grinstein would distinguish data collected at random from data collected on a regular grid. For the rest of this work we will use the classification based on the dimensionality of the dependent variables, since it is important to us to make a clear distinction between dependent and independent variables. 8.1 Dimensionality of Dependent Variables The dimensionality of the dependent variable defines how many values are available at every data point. The dependent variables at a data point can have a relationship such as the x, y, z component of a vector or can be independent of each other like temperature, pressure, density, etc. 8.1.1 Scalar Fields Scalar fields do not have a direction. These variables do not vary under rotation or translation of a local reference frame. They are also called single-valued functions. A scalar variable in three dimensional space and time can be described by

),,,( tzyxf . (8.1) Examples for single-valued functions are temperature, density, pressure, mass, energy, etc. 8.1.2 Vector Fields Vector fields have both magnitude and direction. They are usually represented as an n-tuple of numbers, where n is the dimension of the space. A three-dimensional vector function on a three-dimensional base space can be described by

44

Page 56: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

=

),,(),,(),,(

3

2

1

zyxfzyxfzyxf

fr

. (8.2)

Often a vector field is derived from a scalar field by differentiation with respect to each coordinate dimension of the base space. Such a field is called a gradient. Examples for vector valued functions are: force, velocity, acceleration, surface normal, etc. 8.1.3 Tensor Fields Tensors are complex mathematical generalizations of vectors and matrices. A tensor field is a field that has certain transformation properties under coordinate transformations. The tensor rank is a measure of the amount of information at each point in space. Tensor variables are represented by multi-component functions. Mathematically they can be described as

),...,,,(...... tzyxf kl

ij . (8.3)

The previous lower dimensional cases can be regarded as special cases of the tensor field:

• scalar (zero-order tensor), • vector (first-order tensor), • matrix (second-order tensor).

A rank two tensor can be represented by an n x n matrix. Examples of second order tensors are stress, which associates a force vector to each direction. A fourth order tensor is e.g. the curvature in differential geometry. Stress and strain are examples of symmetric tensors. The vorticity of a flow is an asymmetric tensor. The symmetry property is preserved under transformations. This work does not make use of tensor fields, and only deals with the two variables described previously: scalar and vector fields. 8.2 Basic Rendering Techniques In this and the following sections the methods employed to transform our data into various forms of representation are described. These methods generate the graphic primitives that we eventually can render and display.

45

Page 57: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

In the visualization mapping stage, visual primitives have been defined to represent the data. Generally speaking, the rendering process consists of four stages: viewing transformations, visible surface determination, lighting calculations, and scan conversion. The basic rendering techniques for these primitives will not be summarized here. Many techniques for rendering lines, curves, polygons and curved surfaces can be found in any computer graphics textbook such as Foley et al. (1997). We will concentrate here on the visualization mappings employed for the development of this work (a good introduction of these and many other computer graphics techniques can be found in (Ibid) and Schroeder et al. (1998)). Often, a visualization will consist of a combination of several types of primitives, and therefore it is advantageous if a visualization system permits the use of many different primitives in a single image. 8.3 Colour Mapping Colour mapping is one of the most common scalar visualization techniques. Basically, it consists of mapping scalar data to colours, and to display the colours on the computer system. The scalar mapping is implemented by indexing into a colour lookup table, where scalar values serve as indices into the lookup table. Colour mapping is a one-dimensional visualization technique. It maps one piece of information (i.e. a scalar value) into a colour specification. However, the display of colour information is not limited to one-dimensional displays. We also use colour information mapped onto 1D, 2D, or 3D objects. The mapping proceeds as follows. The lookup table holds an array of colours (e.g. red, green, blue (RGB) components or other comparable representations), which is the palette of colours we will use for the mapping. Associated with the table is a minimum and maximum scalar range (min, max) into which the scalar values are mapped. Scalar values greater than the maximum range are clamped to the maximum colour value, and scalar values less than the minimum range are clamped to the minimum colour value. Then, for each scalar value si, the index i into the colour table with n entries is given by

0min, =< isi

1max, −=> nisi

−−

=minmax

minisni .

(8.4)

Although this mapping is often used and presented as a linear operation, the colour lookup table itself need not be linear. Tables can be designed to

46

Page 58: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

enhance small variations in scalar value using logarithmic, exponential, or other schemes. The key issue to colour mapping for scalar visualization is to choose properly which lookup table entries will be used. Careful use of colours can often enhance important features of a dataset. In contrast, any type of lookup table could exaggerate unimportant details or create visual artefacts due to unforeseen interactions between data and the colour choice. Designing lookup tables is as much art as it is science. From a practical point of view, tables should accentuate important features, while minimizing less important or extraneous details. It is also desirable to use palettes that inherently contain scaling information. For example, a colour rainbow scale from blue to red is often used to represent temperature scale, since many people associate “blue” with cold temperatures, and “red” with hot temperatures. However, even this scale is problematic, a physicist would say that blue is hotter than red, since hotter objects emit shorter wavelengths, which means more blue light than red. 8.3.1 Transparency and Alpha Values We are not only interested in rendering opaque objects which reflect, scatter, or absorb light at their surface, but sometimes we also want the light to be transmitted through the interior of the object in order to explore in more detail the inside of the region bounded by the surface; this means that the object will have a certain transparency. In computer graphics, transparency and its complement, opacity, are often referred to as alpha values. For example, a polygon that is 50 percent opaque will have an alpha value of 0.5 on a scale from zero to one. Frequently, the alpha value is specified as a property for the entire actor (i.e. the object we wish to render), but also can be done on a vertex basis in the same way as with colours. The RGB specification is then extended to RGBA where A represents the alpha component. Naturally, this involves some complications in the rendering process, and the lighting equations for a semitransparent actor must be solved for that actor, and then for those objects which lie behind the actor. The resulting colour is then a composite colour expressed by

bss

bsss

bsss

bsss

AAAABABABGAGAGRARAR

)1()1()1()1(

−+=−+=−+=−+=

,

(8.5)

47

Page 59: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

where the subscripts, s and b, refer to the surface of the actor and what is behind the actor, respectively. The term )1( sA− is called the transmissivity, and represents the amount of light that is transmitted through the actor. 8.4 Arrows, Hedgehogs and Oriented Glyphs Arrows are icons for vectors, and the most obvious way to visualize a velocity field is to draw an oriented, scaled line for each vector, in which the line begins at the point with which the vector is associated and is oriented in the direction of the vector components (vx, vy, vz). Naturally, the resulting line must be scaled up or down to control the size of its visual representation. This technique is often referred to as a hedgehog because of the bristly result. There are many variations of this technique. Besides the arrows indicating the direction of the line, the lines may be coloured according to the vector magnitude, or some other scalar quantity (e.g. temperature or density). Also, instead of using a line, oriented glyphs can be used. By glyphs is understood any 2D or 3D geometric representation such as an oriented triangle or cone. In 2D, this technique can give reasonable results, provided that the arrows, or glyphs, are scaled so they do not overlap. In 3D, rendering glyphs becomes more complex and numerous problems arise. Perspective is the only depth cue available; there is no occlusion, or directional light reflection to assist depth reading (unless we rotate our view or use another technique to support depth perception), and 3D glyphs can be ambiguous in direction. Therefore, care should be used in applying these techniques. 8.5 Contouring Contours are curves (in 2D) or surfaces (in 3D) where a given scalar physical variable has a constant value. Contouring can be seen as a natural extension to colour mapping; different colours separate data values into distinct regions. When we contour data, we are constructing the boundary between these regions. These boundaries correspond to the contour lines or surfaces. Contours are also called iso-curves (often also referred to as iso-lines), and iso-surfaces to denote a constant scalar value for 2D and 3D, respectively. Their applicability is limited to scalar data, such as pressure, temperature, density, or velocity magnitude, or scalar quantities derived from a vector field. Examples of contour displays include weather maps annotated with lines of constant temperature (iso-therms), or topological maps drawn with lines of constant elevation. In this work we have dealt with the density field of the astrophysical simulations in 2D and 3D cases.

48

Page 60: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Contouring always begins by selecting a scalar value, or contour value, that corresponds to the contour lines or surfaces generated. In order to generate the contours, some form of interpolation must be used because our scalar values lie at a finite set of points in the dataset, and the contour value may lie between the point values. Since the most common interpolation technique is linear, we generate points on the contour surface by linear interpolation along the edges. Once the points on cell edges are generated, we can connect these points into contours using a few different approaches. One approach detects an edge intersection (i.e. contour passes through an edge) and then tracks this contour as it moves across cell boundaries. If a contour enters a cell, it must exit a cell as well. The contour is then tracked until it closes back on itself, or exits a dataset boundary. A good review of contouring methods is given in Sabin (1986). Another approach is to use a divide and conquer technique, treating cells independently. These algorithms are called marching squares and marching cubes (Lorensen 1987) for 2D and 3D, respectively; the latter one also referred to as voxel intersection method. The basic assumption of these techniques is that a contour can only pass through a cell in a finite number of ways. A case table is constructed that enumerates all possible topological states of a cell, given combination of scalar values at the cell points. The number of topological states depends on the number of cell vertices, and the number of inside/outside relationships a vertex can have with respect to the contour value. A vertex is considered inside a contour if its scalar value is larger than the scalar value of the contour line. Vertices with scalar values less than the contour value are said to be outside the contour. As usual, there exist advantages and disadvantages to both the edge-tracking and marching cubes approaches. The marching squares algorithm is easy to implement, which becomes very important when we extend the technique to 3D and the isosurface tracking becomes much more difficult. On the other hand, the algorithm creates disconnected line segments and points, and the required merging operation requires extra computation resources. The tracking algorithm can be implemented to generate a single polyline per contour line, avoiding the need to merge coincident points. In 3D, contour surfaces have the advantage of visualization with a full range of visual depth cues, but also a problem is the display of multiple contours in one picture. We can solve this problem by doing a dynamic probing of the scalar field by interactively varying the contour value, and showing a changing contour surface. In addition, we can generate a movie clip showing sets of precomputed contour surfaces. All these methods and variation we have seen, show that contouring is a very powerful yet general technique for visualizing data from a variety of fields.

49

Page 61: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

8.6 Volume Rendering Some of our data, as we have seen, are inherently volumetric. Our simulations produce large quantities of volumetric data in three or more dimensions which require effective visualization techniques. The broad class of these techniques that deal with volumetric data to produce an image are known as volume rendering. For a survey of volume rendering techniques, see Kaufman (1990). It is worth mentioning that in the past, researchers attempted to define volume rendering as a process that operates directly on the dataset to produce an image without generating an intermediate geometric representation, but nowadays, with the advances in graphics hardware and clever implementations, developers have been able to use geometric primitives to produce images that are identical to those generated by direct volume rendering techniques, making it practically impossible to define volume rendering in a way that is distinct from geometric rendering. In volume rendering, a scalar data field (e.g. a density field) is usually considered as a regular 3D array (structured points dataset) of cubical volume elements, which are called voxels, with one scalar data item associated with each volume element. A segmentation can be made of the data, by selecting only the voxels that satisfy certain criteria, such as a given minimum scalar value, or by applying other 3D image segmentation techniques. The selected voxels are then projected onto the screen and rendered using one, or a combination, of the two volume rendering approaches: image-order and object-order techniques. We must mention that there are other volume rendering techniques that cannot easily be classified as image-order or object-order, for example, a volume rendering technique may traverse both the image and the volume simultaneously, or the image may be computed in the frequency domain rather than the spatial domain (see Malzbender and Kitson 1993). Plane sections are often used in volume visualization to inspect a 3D dataset. This can be achieved by moving a plane through the volume and watching the changing patterns projected onto the section plane. Naturally, to generate a 2D image that represents an entire 3D data volume introduces new complications. Classification must be performed to assign colour and opacity to regions within the volume, and volumetric illumination models must be defined to support shading, and so on. 8.6.1 Image-Order Volume Rendering Image-order volume rendering is often referred to as ray casting or ray tracing. The basic idea is to determine the visibility of surfaces, i.e. the value of each pixel in the image plane, by tracing imaginary rays of light from the centre of projection (the viewer’s eye) through the volume, according to the current camera parameters, in order to compute pixel values. The basic ray

50

Page 62: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

tracing can also be extended to handle specular reflection and refraction, and shadows. This extended ray tracing is usually referred to as a recursive ray tracing algorithm. Ray tracing is a flexible technique that can be used to render any structured points dataset, and also relatively easy to extend in order to work on rectilinear or structured grids. Unfortunately, ray tracing is fairly slow and acceleration methods must be used in order to improve performance, at the cost of some additional memory requirements and loss in flexibility. 8.6.2 Object-Order Volume Rendering Object-order volume rendering methods process samples in the volume based on the organization of the voxels in the dataset and the current camera parameters. Here, the volume is traversed in a front to back or back to front order, with each voxel processed to determine its contribution to the image. This process is typically used when an alpha composite method is employed, and it is analogous to sorting translucent polygons before each projection in order to ensure a correct combination. When graphics hardware is used for compositing, a back to front ordering is commonly preferred since it is then possible to perform alpha blending without the need for alpha bitplanes in the frame buffer. When a software compositing method is employed, a front to back ordering is more common since partial image results are more visually meaningful, and can be used to avoid additional processing when a pixel reaches full opacity. After a voxel is processed, its projected position on the view plane is determined and an operation is performed at that pixel location using the voxel and image information. This operator is similar to the ray function used in image-order ray casting methods. Although this technique for projecting voxels is both fast and efficient, it often yields image artefacts due to the discrete selection of the projected image pixel. For example, moving the camera closer to the volume in a perspective projection will make neighbouring voxels to project far from each other on the view plane, resulting in distracting holes in the image. 8.7 Stereo Rendering So far we have seen a number of techniques to produce 3D graphics on 2D display devices. However, it is possible to simulate 3D viewing using true 3D techniques. These techniques make use of binocular parallax, also referred to as binocular disparity, which is the result of viewing 3D objects with our two eyes. Since each eye sees a slightly different picture, our mind interprets these differences to determine the depth of objects in our view. Binocular disparity is modelled in computer graphics with the eyes considered as two off-axis centres of perspective projection. The different techniques for introducing binocular disparity into renderings, and the overall process for producing the

51

Page 63: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

image, is known as stereo rendering, since at some point in the process a stereo pair of images is involved. The rapid advances in true 3D techniques and technologies over the last decades have made active stereo an important capability. Hardware has improved and become considerably cheaper, as well as the development of liquid-crystal polarizing shutters and liquid-crystal parallax barrier methods. True 3D is rapidly becoming an important part of computer graphics, visualization, and virtual-reality systems. In addition, the improvement of high resolution colour printing has made 3D hardcopy more available and useful for achieving and transporting 3D images. The different methods for producing stereoscopic images can be divided into two main broad groups: those that present both eye views simultaneously in combination with a process to extract left and right eye views, or time-parallel methods, and those that present the two eye images in sequence using optical techniques to occlude the right-eye view when the left-eye view is being presented, and vice versa, called field-sequential or time-multiplex methods. 8.7.1 Time-Parallel Techniques Time parallel techniques display both images at the same time. 3D movies traditionally used the old anaglyph method, commonly called red-green (or red-blue or red-cyan) stereo. This method requires the user to wear a pair of glasses that filter entering the light. The left eye can only see the image through a red filter, and the right through a green filter. To create the composite image, typically two images are generated for the two views and their RGB values are converted to intensity; i.e. the fused image’s red values are taken from the left eye image intensities and the green values are taken from the right eye image intensities. The resulting image has none of the original hue or saturation, but it does contain both original images’ intensities. The advantages of this technique are that the composite images can be displayed on a monitor, paper, or film, and all we need is an inexpensive pair of glasses in order to view them. There is another technique, similar to the anaglyph method, that preserves all the colour information from the original images. It consists in separating the different views by using polarized light by placing oriented polarizing filters in front of two projectors. The projections screen must be coated with a metallic surface so that the polarization of the reflected light is maintained. The viewer then uses passive polarized glasses in which the polarization is consistent with the filters on the projectors so that the right eye image is blocked from the left eye and vice versa. Polarizing filters can also be attached to glass-mounted slides, avoiding the need of filters to the projectors. Polarized stereo rendering typically projects one eye’s image through a vertical filter and the other through a horizontal filter.

52

Page 64: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

8.7.2 Time-Multiplexed Techniques Time multiplexed methods are the most popular approach for viewing stereo on graphics workstations. It basically consists in alternating images, combined with a method for also alternating which eye views the image. The technology for workstations uses liquid-crystal shutters that attach to the front of the computer monitor. The shutter polarizes the left and right eye images in different directions, and the user wears passive polarized glasses. Technologies have also been developed in which the polarizing shutters are built into the viewing glasses and powered by batteries. The shutters are switched using an infrared signal synchronized to the refresh rate of the monitor. The left and right eye views are then displayed alternately at typically 120 Hz to preclude flicker. A good description of how the liquid-crystal shutter systems work is presented in Boss (1993). We also refer the reader interested in a comprehensive and introductory text about stereo graphics and other true 3D technologies to McAllister (1993). 8.8 Hybrid Rendering Sometimes it is necessary and of particular importance to display several types of data in a single picture. We have seen that in scientific visualization data sets often contain combinations of scalar and vector data, and several types of derived quantities may be computed from these data. In order to profoundly explore the data, we must employ several combinations of visualization, which should not be restricted to rendering in separate modes. In addition, quick and crude rendering should be available as well as high quality images. All these considerations lead to the concept of hybrid rendering. 8.8.1 Environment Geometry Display of environment geometry is often desirable, many times necessary, in scientific visualization. The environment geometry shows the context of the particular problem studied, and also supports spatial orientation. The environment can usually be shown as a collection of surfaces or solid objects, allowing the use of many spatial cues. Techniques for rendering are mainly standard computer graphics methods. It is important to note that objects of the environment must be displayed together with the data, and therefore the rendering techniques must be used in combination with other rendering technique, i.e. hybrid rendering methods.

53

Page 65: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

8.9 Image Processing Techniques We have reviewed the visualization techniques employed for the interpretation of our datasets. These techniques are applied to the numerical data for later being displayed as images in the screen. Once we have the image, it is possible, and sometimes necessary, to manipulate it and make some changes in order to obtain a better visual representation. Image Processing is a term given to this particular class of operations applied to regular two-dimensional arrays of pixels, which constitute the image. There are a large number of algorithms that have been developed for image processing, the main ones concerned with Scientific Visualization are: image enhancement, feature extraction, and transformations. Some scientific visualization systems incorporate some of these image processing techniques, while in others, it may be necessary to use image processing libraries from other sources. Jain (1989) provides a general introduction to the techniques of image processing, and it is recommended to the reader interested in this field. 8.9.1 Image Enhancement Image enhancement is the emphasis of image features for analysis or display. There exist many techniques for image enhancement including: i) Pixel Operations. These techniques operate on individual data elements

(pixels) without reference to any other surrounding pixels. Contrast Manipulation, which consists of a linear transformation used to increase image contrast or to invert an image (it can also be used to clip off noise from the image if the input signal lies within a known range), and Histogram Manipulation, in which a histogram of all the grey level intensities is constructed and the pixels are modified to produce the desired distribution of grey levels (this technique can be useful for enhancing low-contrast images whose grey levels lie within a narrow band), are among such operations.

ii) Local Area Operators. These are operations on the local surrounding the

pixel. Filters are used on an image pixel which is then replaced by a pixel whose characteristics are derived from the nature of the filter. Various filters include low-pass filter (used for smoothing edges), high-pass filters (used for emphasising edges), and smoothing filters (e.g. median filters).

iii) Pseudocolour (False Colour). Pseudocolour can be thought of as mapping

a set of scalar values into a colour image so that discrete features of the dataset can be distinguished by different, non-natural, colours.

54

Page 66: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

8.9.2 Feature Extraction and Segmentation Feature extraction allows quantitative measurements to be made from an image in order to describe it numerically. It uses techniques for collecting information such as spatial features, edge detection, boundary extraction and contour following, shape features, and texture. Segmentation techniques are used to isolate the derived object within the image. Such techniques are tresholding, labelling connected pixels sets, boundary-based profiles, among others. 8.9.3 Transformations Transformations involve the mapping of input data via some function, in order to compress it or more easily determine the features of the original data. The result of this transformation may look very different from the original image, but measurements on the transformed image may give information about features in the original image. Examples of this kind of transformations are the Fourier transform and the Hough transform. 8.10 Aliasing and Anti-Aliasing Aliasing is a well known visual effect caused by the discrete nature of the display screen, and at some point most computer users will experience aliasing problems. In computer graphics the most common aliasing problems are jagged edges and silhouettes, Moiré patterns, irregular and granular textures, and missing small details. These aliasing problems come from the rasterization process as the graphics system converts primitives, such as line segments, into pixels on the screen. For example, the quickest way to rasterize a line is to use an all or nothing strategy. If the line passes through the pixel, then the pixel is set to the line’s colour; otherwise, it is not altered. The result of this method gives a stair-stepped appearance. Foley et al. (1990) describes how aliasing got its name, and discusses how it can be explained from signal theory. The several techniques for handling aliasing problems are collectively known as anti-aliasing techniques. One approach is to take the colour of a pixel as a mixture of its original colour and the colour of the line touching that pixel; with the ratio of the colour being determined by the line’s occupancy. When combining several samples to determine the colour for a given pixel, digital low-pass filtering can be applied. The samples are weighted according to a filter function, which specifies the weights depending on the distance of a sample point to the pixel centre. From the sample values, a weighted average is then computed. Another approach is to break each pixel down into smaller

55

Page 67: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

subpixels. Primitives are rendered using the all or nothing strategy, but at subpixel resolutions. Then the subpixels are averaged to determine the resulting pixel’s colour. This is an effective method but tends to require much more memory; breaking a pixel into 10 subpixels requires about 10 times the memory and rendering time. Analogue to the spatial aliasing describe above, there exists also temporal aliasing caused by taking only one point sample for each time step. This results in jerky motion, flicker, strobing effects, and even false movements that are not acceptable in animated visualization. Care should be taken in order to avoid these problems when working with animation. 8.11 Animation Animation can be used for many purposes in scientific visualization, but mainly it is used to help in understanding and clarifying the information of our data from a different perspective. This information is supplemented by the motion effect. For example, rotating our data can help to clarify the relative distance of a point from the centre of rotation. Besides the changing in position, also changes in size, material properties, lighting, colour, and viewing specifications benefit and provide additional information to the user. Motion becomes even more powerful when it is under the interactive control of the viewer. Animation is not only motion, it covers all changes that have a visual effect. It thus includes the time-varying position, or motion dynamics, and even changes of rendering techniques. Animations can either be produced in real time, or simply by playback of a series of pre-computed images (frames). In real time animation, rendering of each frame is done during display, which has the advantage that the animation may be interactively controlled by the user. A disadvantage is that the screen update time usually depends on the image complexity and the rendering techniques employed. Pre-computed frames may be displayed one at a time and put together as a movie clip which can be played directly on the screen. As the screen update rate of the movie is independent of the contents of the frames, playback speed can be constant. Unfortunately, interactive control of most viewing parameters, such as viewing direction or position of particles, is not achievable. It is possible though to combine time-varying position animation with steady position animation. For example, for an unsteady flow a new velocity field is computed for each frame and a new particle position, when we want to obtain more detailed information at a certain time, we stop computing new velocity fields and positions, and then make a rotation of the steady scene, or even a zoom, in order to obtain the relevant information we are interested to see with greater detail.

56

Page 68: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Using animation techniques is often crucial for understanding complex data, scenes, or phenomena. And it becomes almost essential and indispensable when we project three, or more dimensions, onto a two-dimensional display. When three-dimensional objects in a scene are moved in relation to each other, or in relation to other fixed scene attributes, many attributes are greatly enhanced and understood. Ideally any scene could be animated in real-time under user control; however, creating full screen images at adequate speed is not feasible with most currently available computer systems. Thus, we have created the images one at the time and then encoded them into a portable video format, for playing them back on, virtually, any computer. The animations showing the distinct visualizations from the numerical simulations in astrophysics, in form of movie-clips, can be obtained in Palomino (2003). 8.12 Human-Computer Interface Finally, we will end this chapter by addressing that visualization comprises not only techniques, tools, and systems, as we have seen here, but also, and very importantly, the end users’ problem solving skills. Therefore, besides a collection of novel rendering techniques, visualization should address issues associated with such areas as system design, data models, and Human-Computer Interaction (HCI). Visualization systems need to be flexible and extensible, so that a scientist, engineer or other user can easily construct and experiment with different ways of exploring data or hypothesis, the same applies to the application we want to design inside a system. When devising frameworks and interface concepts such as windows and widgets, we should take greater account of research in cognitive science. We also require studies to find what kinds of interaction are most useful for visualization and for the end users. HCI issues in visualization can be described in the following categories: i) Cognitive Issues, concerned with mental models and problem solving; ii) Perceptual Issues, such as how humans process colour, depth representation

and motion; iii) Human Factors, concerned with making the user feel comfortable with

system, such as representations of scale, orientation and time, and provision of help facilities.

Consequently, effective use of scientific visualization relies on the intellectual, perceptual and sensorial activities of the end user. Psychology offers a partial understanding of these activities and we should apply this knowledge when constructing visualization applications.

57

Page 69: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

58

Page 70: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

C h a p t e r 9

The Environment In this chapter an overview of the environment in which this work has been developed is given, including both hardware and software. 9.1 The Interactive Data Language

IDL, the Interactive Data Language, is a computing environment for interactive data analysis and visualization. IDL is a software developed by Research Systems Inc., a Kodak Company, currently used by numerous research and development institutions around the globe, where analysts, scientists and engineers need to diagnose, display and visualize data. IDL integrates an array-oriented language with numerous mathematical analysis and graphical display techniques. A fourth-generation language, IDL is more compact than C or FORTRAN, and it has a rich library of built-in image processing, math, statistics, and analysis routines, which can save days or weeks of programming (Research Systems Inc. 2002a, 2002b). Also existing FORTRAN and C routines can be dynamically linked into IDL to add specialized functionality, and alternatively, C and FORTRAN programmes can call IDL routines as a subroutine library or display engine. 9.2 MATLAB

MATLAB is an advanced interactive software package specially designed for scientific and engineering computation, a high-performance language for technical computing. The name MATLAB stands for matrix laboratory; it was originally written to provide easy access to matrix software developed by the LINPACK and EISPACK projects. Today, MATLAB uses software developed by the LAPACK and ARPACK projects, which are very high standard software for matrix computation. MATLAB is an interactive system whose basic data element is an array that does not require dimensioning, which allows to solve many technical computing problems, especially those with matrix and vector formulations, in very short times (The MathWorks 1998). Besides computation, MATLAB also integrates visualization and programming in an easy-to-use environment.

59

Page 71: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Figure 9.1. The Interactive Data Language System. 9.3 VTK

The Visualization Toolkit (VTK) is a system for 3D computer graphics and visualization which consists of a C++ class library of objects including graphical components such as lights, cameras, actors, and transformation matrices; data objects such as images, volumes, or structured and unstructured grids; and algorithm objects such as contouring, decimation, triangulation, and implicit modelling. With VTK it is possible to visualize geometry from CAD systems, view medical data, results of computer simulations, display multivariate or financial data, and create applications that transform data into 3D visualizations. VTK provides Tcl/Tk and Java interfaces which means that it is possible to build applications by writing either C++, Tcl/Tk, Java or Python code to manipulate the VTK classes. VTK has been designed to be operating system and graphics library independent.

60

Page 72: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Figure 9.2. The MATLAB Environment. 9.4 COVISE

COVISE is a modular visualization system, an extendable distributed software environment which integrates simulations, postprocessing and visualization functionalities. COVISE stands for COoperative VIsual Simulation Environment. Its development was initiated in 1993 for the PAGEIN (Pilot Applications in a Gigabit European Integrated Network) project, which aimed to evaluate possibilities of distributing computing and collaborative engineering on top of European high speed network infrastructures. The design and development of the software architecture for PAGEIN was led by the Visualization Department of the University of Stuttgart Computing Centre (Vircinity IT 2001). The architecture of COVISE, based on the module model, allows developers to extend the existing functionality by integrating new code as modules. These modules are then connected to form a dataflow network, which is accessible in the visual programming area, or canvas. The implementation of the COVISE system is done in C++, and the basic communication functionality is provided as a library.

61

Page 73: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

In order to visualize our application, a render module must be placed at the end of the pipeline. The renderer can either be a desktop renderer based on Open Inventor, or the VR oriented render module COVER, which is Performer based.

Figure 9.3. COVISE. 9.4.1 COVER COVER (COvise Virtual Environment Renderer) is the COVISE renderer module for Virtual Environments. It was originally developed for COVISE but it can also be used independently of COVISE and just be used as a virtual reality viewer for 3D geometry. COVER supports all major Virtual Reality (VR) input devices (tracking devices) and arbitrary projection-screen configurations (backprojection displays). In addition, COVER is extensible through a flexible plugin system based on the multiprocessing graphics API OpenGL Performer.

62

Page 74: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

9.5 The CAVE

CAVE is a recursive acronym that stands for CAVE Automatic Virtual Environment, but also stands as a reference to the “Simile of the Cave” found in Plato’s Republic (Plato c.375 BC), in which the philosopher explores the ideas of perception, reality and illusion. Plato used the analogy of a person facing the back of a cave alive with shadows that are his only basis for ideas of what real objects are. The CAVE is a projection-based virtual reality (VR) system, which provides real-time viewer-centred head-tracking perspective with a large angle of view, interactive control, and binocular (stereo) display (Cruz-Neira et al. 1993). It was developed at the Electronic Visualization Laboratory (EVL) at the University of Illinois in Chicago in 1991, with the main purpose of being a “Virtual Reality Theatre” with scientific content. It premiered at the SIGGRAPH ’92 conference. The CAVE was also developed to overcome some of the limitations of the existing VR systems at that time, e.g. HMD, BOOM, which have significant geometric distortion, furthermore the tracking errors in the CAVE are less distracting due the fact that the projection plane does not move with the viewer’s position and angle as it does in other systems (Ibid). The CAVE also has the advantage of allowing multiple users to be immersed and share the VR experience. At the Royal Institute of Technology (KTH), the configuration of the CAVE consists of a projection-based system surrounding the viewer with 6 screens, a 3 x 3 x 2.5 metre theatre. The screens are arranged in a cube, with images rear-projected onto the four walls, a fifth up-projection screen for the floor; that is a projector underneath points to a mirror, which reflects the image onto the floor, and a sixth one projecting onto the ceiling from above also using a mirror. The six displays are driven by a Silicon Graphics Onyx2 with three SGI Infinite Reality Engine2. Each engine, or graphic pipeline, is split into two, for driving two of the six displays, and each display has full-colour workstation resolution. Electrohome projectors throw the workstation fields (1152x960 stereo for the walls and 1152x1152 stereo for the floor and ceiling) at 96 Hz onto the screens, giving approximately 2000 linear pixel resolution to the surrounding composite image. Computer-controlled audio provides a sonification capability to multiple speakers of eight-channel stereo to create also a 3D audio environment. The 3D effect comes from the stereo projection and it is achieved by projecting an image for the left eye followed by an image for the right eye. To get this effect the users must wear stereo glasses, more formally liquid-crystal stereo-shutter glasses, in order to view the stereoscopic images. The stereo glasses are synchronized with the computer using infrared emitters which are placed around the edges of the CAVE. The synchronization is to that of the screen update rate of 96 Hz, as a result, when the computer is rendering the left-eye perspective, the right shutter on the glasses is closed and vice versa.

63

Page 75: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

This action tricks the brain giving the illusion that the left eye is seeing the left perspective and the right eye is seeing the right perspective. These perspectives, in order to create the desired effect, must be accurate, hence the user’s head position and orientation have to be tracked to get the correct perspective. The tracking is done with a Polhemus Fastrack Long Ranger electromagnetic, 6 degree of freedom tracking system. The tracker senses a tethered electromagnetic sensor that is mounted on the user’s glasses; although many people can be in the CAVE at once, only one user, the one wearing the driver glasses, is tracked, and the other people should stand close to the driver in order to get the correct perspective.

Figure 9.4. The CAVE at Kungliga Tekniska Högskolan. Besides the sensor for tracking the user’s head, there is a second electromagnetic sensor attached to the wand. The wand is the interactive input device and the primary input device in the CAVE; it can be thought of as a 3D equivalent of a mouse, having many buttons and a pressure sensitive joystick. Currently we are using a Logitech Wireless wand. Software support for the CAVE comes in the form of the CAVElib. The library consists of C functions and macros developed to control the operation of the CAVE. The CAVE library hides a lot of the device specific details, the functions keep all the devices synchronized, produce the correct perspective

64

Page 76: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

for each wall, keep track of which walls are in use, and provide the applications with the current state of all the CAVE elements. The CAVE library also provides options to simulate some or all of the hardware’s specific parts of the CAVE environment. The CAVE simulator allows application developers to test their codes on ordinary workstations without requiring constant use of the CAVE hardware. The simulator uses the same executables as the CAVE using different configuration files, which specify if the simulator mode is running. The standard CAVE library uses OpenGL, which is a standard graphics API, OpenGL Performer and Open Inventor; OpenGL Performer is a software toolkit for 3D rendering based on OpenGL. This means that CAVE applications must be written using OpenGL, or Performer, or Open Inventor, and linked to the CAVE library and the other libraries necessary for building the application. There are of course also higher-level tools, such as DIVE or COVISE, that do not require the programmer to work at the graphical API level, but rather with objects directly.

65

Page 77: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

66

Page 78: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

C h a p t e r 1 0

The Visualizations We have reviewed in the previous chapters the techniques applied to our data in order to produce the visualizations. Here, we will show the results achieved after the implementation of those techniques, which have been successfully applied producing stunning visualizations of the numerical simulations in astrophysics. We have seen that, besides the scientific aspect, visualization has an artistic, or aesthetic, element. Good visualizations represent a balance between effective communication of information and aesthetically pleasing presentation. This mixture between science and art has always fascinated us and it is one of the main reasons for the development of this thesis. Most of the visualizations of these astrophysical simulations are presented in this work for the first time. Some others were already presented at conferences and astronomical meetings coming from the work of this thesis. In particular, the visualizations of accretion disks around black holes, when a neutron star is disrupted by the later one, were presented at the International Astronomical Union (IAU) Colloquium 192: Supernovae, in Valencia, Spain, in April 2003. The 3D visualizations of clouds in the interstellar medium and neutron star-black hole coalescence, have been presented frequently in National Meetings, and some international symposiums, around Mexico during the last couple of years. In the next section we will try to show the process of creating good visualizations, and the steps with the techniques used to produce the final images: the process of scientific visualization in pictures. Following it, the actual visualizations of the numerical simulations in astrophysics will be presented in lively illustrations. The reader also can find in Appendix 3 the colour plates of these illustrations. 10.1 Building the Visualization: finding the appropriate software, searching for the right technique, and creating the image. We have generated data from the numerical computations, and now what we have is a bunch of numbers stored in large files. Then, what to do? How do we interpret those numbers? Here, we will show with illustrations the development of a visualization from early stages until it reaches a satisfactory form. For simplicity we will take as example the process of the visualization of the 2D numerical simulations of an accretion disk around a black hole (see Section 5.3.4), but the same procedure is applied to the rest of the simulations

67

Page 79: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

in 2D as well as in 3D (perhaps using different approaches and techniques but the process for using these methods is, in essence, the same). First, we start with our generated raw data and by selecting which type of it we want to visualize. Let us take the density field, a scalar field (see Section 8.1.1). Here we are dealing with densities of stellar magnitude which means that the density numbers will be of very high order. Therefore we will need to prepare and manipulate the data in order to be able to work with it, employing the methods described in Chapter 7. We use data normalization (see Section 7.1) and apply it to the data in order to reduce the range of values, by taking a logarithmic scale of the density field, which will facilitate the mathematical process for the graphical representation. The next step is to choose an appropriate visualization system. Of the ones we have reviewed in the previous chapter, we have realized that some have been specifically designed for 3D computer graphics and are not suitable for our 2D data (of course we could always employ some tricks to make 2D data accessible for 3D systems, i.e. two axes being the x and y coordinates respectively, and the third one the scalar values, but unless we have some specific purpose in doing this, it is not worth the extra time). Thus, we have MATLAB and IDL as the proper options. We begin with MATLAB due to its easy-to-use environment, from which we may benefit to create a quick visualization. We apply contouring techniques (see Section 8.5) to create a rather simple, yet illustrative picture, of the density levels of our accretion disk.

Figure 10.1. Contouring of an accretion disk. We now have an idea of what our data look like. It is possible to change the contour levels, or even add more contours, as we would wish through our specifications. Also we could fill the different levels of the contours with colour obtaining a rather nice image.

68

Page 80: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Figure 10.2. Colour filled contouring of an accretion disk. Is it possible to obtain a more realistic representation of our data? The last image (Figure 10.2) gives us information of how density numbers are distributed in the accretion disk. As expected, higher density lies near the black hole. The image looks good and we can be satisfied with it, but we know that MATLAB was not specifically designed for visualization and image processing purposes. In the contrary, IDL has an extensive library of image processing and data manipulation routines which may help us to create another kind of visualization. Let us make a simple mapping of the values of each grid point corresponding to the density field to a black-and-white representation of pixels on the display using the IDL library. Using the information from the contour levels we map the higher values to white and approximate the lower contour levels to shades of grey, by a mixture of both black and white pixels. This is achieved by the technique called dithering, which is very useful when the graphics hardware only supports black and white. The same technique works just as well for other colours. For example, if the graphics hardware supports primary blue, primary green, and white but not a pastel sea green, it is possible to approximate this colour by dithering the green, blue, and white that the hardware does support. Figure 10.3 shows the result of mapping the data onto black-and-white pixels by an approximation of the distinct levels of contours using different shades of grey via the method of dithering. Some people may prefer the image in Figure 10.2 over the one shown in Figure 10.3 because it contains colours. Others may differ, preferring the latter one because it looks more realistic. What we can say is that both are good visualizations using, slightly similar but different techniques for representing the same data, and each of them will be appropriate according to the context in which we place them. As we go along, we will be employing more sophisticated visualization techniques. This does not mean that they are better than the previous one, or vice versa, but they are more sophisticated

69

Page 81: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

because they require more processes, more programming, and more computations in order to make use of them to create the visualization. Sometimes we just want to display a series of contour plots, needing only a fraction of a second, rather than a sophisticated colourful visualization using advanced techniques which may need a couple of minutes for its rendering.

Figure 10.3. Black-and-White dithered image of an accretion disk. Now, let us make use of another visualization technique that is very common for scalar entities: colour mapping (see Section 8.3). The mapping is implemented by indexing into a colour lookup table and the scalar values serve as indices into the lookup table. For simplicity we take as a first instance a grey scale lookup table. The result of applying this visualization technique is shown in Figure 10.4.

Figure 10.4. Colour mapping using a grey scale lookup table.

70

Page 82: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

At this stage we could apply another lookup table to obtain a colourful picture, or perhaps use another technique to render a slightly different image. However, before proceeding with a new visualization method, we realize by looking at the previous image that it could give more information if we reduce the black strip and show where the star lies. In order to do this we must go back and perform again the simulations making the appropriate changes to the discretization of our problem. This means that we discretize again the physical domain (see Section 6.1.1) and set the new boundaries for our new computational domain which will include this time a fraction inside the middle black strip showing the star in the centre. We can also see from Figure 10.4 that we have a grey background in the image. Therefore we can choose for our new visualization to only display the data values which are above a certain threshold by making a careful data selection (see Section 7.2). Usually when we make a data selection we must also make some kind of data enhancement (see Section 7.3) to accentuate the features of the chosen data. For example, let us assume that the data values range from 1 to 10 and that they are floating point numbers; and also that the grey background is due to all the values below 7. If our lookup table is composed of grey shades with indices from 0 for black to 255 for white, then it will be appropriate to do a resampling that will map the floating point values between 7 and 10 to the byte indices from 0 to 255, i.e. a byte scaling, in order to enhance the changes of the data values. Once we have done this, our new visualization will look as follows.

Figure 10.5. Data selection, enhacement by byte scaling and colour mapping. Perhaps in the last image we have lost some information. In accretion disks rays burst in all directions (as we could see from the contour image, Figure 10.1), and therefore we must change our selection criterion to try to retain the information of the rays blasting in all direction without getting that grey background we want to avoid. The new image obtained after employing

71

Page 83: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

the same techniques with different selection criteria, is shown in the following figure.

Figure 10.6. New colour mapping using a grey scale lookup table. Now it is time to add a colour lookup table. As was mentioned in Section 8.3 a lookup table does not necessary need to be linear or uniform, neither do the data values need to be mapped from the lower ones to the lower intensity colours and so forth. In this case we will use a linear colour lookup table, but later we will see that it is possible to use a multi-colour non-linear lookup table which will enhance different variations and can give us a different perspective of the data behaviour. Let us start using a linear-green/white lookup table where data values will be mapped from the lower ones to a specified green value, the higher ones to a mixture of green and white, and the highest one being only white.

Figure 10.7. Colour mapping using a green/white lookup table.

72

Page 84: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

The previous image gives a better picture of the density levels of the accretion disk than the one obtained using only a grey scale lookup table. Yet, we are still not completely satisfied with it. The lower values seemed not to fade smoothly till the zero value (or black colour) is reached, giving an impression of a radical cut in the middle of the image. We could modify the lookup table in order to correct this, but instead we would rather prefer to use a new one which will be more representative of astrophysical phenomena. Blue or red are the candidates due to the high temperature association with the hot stars. Therefore let us choose a red temperature lookup table, in which we will make the corresponding changes in order to avoid the drastic cut in the middle as the before. The final resulting image, with which we are very pleased and satisfied, is presented below:

Figure 10.8. Colour mapping using a red temperature lookup table. 10.2 Two-Dimensional Visualizations For the visualization of the two-dimensional numerical simulations, the software which best fulfilled our needs was the Interactive Data Language. The power of IDL, with its extensive library of image processing and analysis routines, made it ideal to access image data and investigate the best way to extract useful information interactively. Numerous advantages were found using IDL, most of them are mainly related to the interactive analysis of data such as the compilation and execution of IDL commands which provides instant feedback and hands-on interaction, moreover the operators and functions work on entire arrays (without using loops), simplifying interactive analysis and reducing programming time. Another main advantage was IDL’s flexibility in input/output facilities which supports virtually every data form, type and size. IDL’s rich library of built-in image processing, numerical, statistical and analysis routines, including Numerical Recipes routines and

73

Page 85: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

many others, was also a time-saving alternative to programming in C or other visualization system. In addition, IDL provides widgets that we have been able to use, with quite some extra programming, in order to create multi-platform graphical user interfaces to our IDL programmes. About MATLAB, we have found that it was a very flexible and easy-to-use tool when trying to visualize vector fields as well as for contouring of scalar fields, but it has many limitations when image processing tools are required. Requiring fairly little programming with MATLAB, we have been able to display the velocity fields of some of the two-dimensional simulations. In contrast, IDL needs more extended programming in order to perform the same type of visualization. 10.2.1 Clouds in the Interstellar Medium In the following series of images, the visualization of the density field from the 2D numerical simulations of highly compressible flows representing the interstellar medium (ISM) on the Galactic plane by solving the magnetohydrodynamic equations (see Section 5.1.1) are shown. The simulations correspond to a square of 1 kpc on a side of the ISM, with magnetic field, self-gravity, turbulence, thermal pressure, and local star formation. From the left image to the right and down in successive order, we will see a representation of the evolution of the density field over 65 million years.

74

Page 86: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

75

Page 87: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Figure 10.9. Visualization of the evolution (from left-top to right-down) of the density field from the numerical simulations of clouds in the interstellar medium, with magnetic field, self-gravity, turbulence, thermal pressure, and local star formation. 10.1.2 Accretion Disks around Black Holes Accretion onto black holes is often thought to occur in the form of a disk (see Section 5.3.1, 5.3.4). The following series of images, from left to right and down, display the visualizations of the density field from 2D hydrodynamic simulations of massive accretion disks around black holes, formed when a neutron star is disrupted by a black hole in a binary system. The visualizations show the evolution of the disk structure for a few tenths of a second (t = 0.2 s).

76

Page 88: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

77

Page 89: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Figure 10.10. Visualization of the evolution (from left-top to right-down) of the density field from a dynamic simulation of a black hole-neutron star coalescence. In the next figure the visualization of the velocity field coming from the same simulations is presented. Using the techniques described in Section 8.4 for the visualization of vector fields (see Section 8.1.2), we have been able to correctly display the evolution of one side of the disk of the velocity field corresponding to the first four frames shown in Figure 10.10.

78

Page 90: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

79

Page 91: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Figure 10.11. Visualization of the evolution of one side of an accretion disk, of the velocity field from a simulation of a black hole-neutron star coalescence. The previous visualizations sometimes are difficult to foresee. Usually, vector visualization techniques are combined with another one in order to give more significance to the data than the mere arrows. Thus, it is preferable to display the velocity field in combination with another entity, for example the density field. The next image shows how a combination of techniques may help in interpreting the data. We have taken a scalar entity, the density, and superimposed the velocity, a vector field, using contouring and directional arrows, respectively. A more advanced and very interesting visualization of the evolution of the velocity field with a sophisticated visualization of the evolution of the density field will be presented elsewhere, in Palomino and Lee (2003).

80

Page 92: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Figure 10.12. Combination of techniques.

81

Page 93: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

10.3 Three-Dimensional Visualizations For the three-dimensional data, we have found that the distinct visualization systems employed have advantages and disadvantages. The nature of the Visualization Toolkit (VTK), designed for 3D graphics and visualization, made it relatively easy to access and render the volumetric data, as well as having tools for its manipulation such as rotation, scaling and zooming on the display in almost real time without any additional programming. A big advantage of VTK is that of being freely available. VTK is a compiled language, although we could use the Tcl interface which is interpreted, but it offers less flexibility when one wants to explore and interact with the data. As a C++ class library, we must take care in using the appropriate compiler and linking the appropriate libraries in order to correctly construct our application. Furthermore, VTK’s library is very complex and to some extent poorly documented, which make it difficult to search for specific functions in the large structure of sub-classes, classes, super-classes, etc., and making the time spent on building an application not being productive at all. The Interactive Data Language (IDL) again was the choice for our volumetric visualizations, mainly due to the powerful interaction system for exploring data that it possesses. Also, as a stand alone and multi-platform system, IDL gives the advantage of building applications significantly faster, programming interactively in an interpreted language. In addition, we have been able to create Graphical User Interfaces (GUI) using widgets to have interactive control over the data in a user-friendly way. However, IDL does not encompass multiscreen visualization, nor does VTK, which makes those systems not suitable at all for virtual environments. Therefore, we have to utilise COVISE in order to render our data in the VR-cube. COVISE also has limitations, and it is not easy to work with it. In principle, its modular approach should allow us to build our applications relatively easy, but that was not the case. It is true that programming in COVISE is easier than in the other systems but COVISE is quite strict in many aspects and it does not allow certain degrees of flexibility. For example, just for reading and loading the data, COVISE needs that the file should have a certain specific name structure and also the file type must be one of the kinds which COVISE supports. Taking all these factors into consideration, we have decided to employ IDL for rendering our volumetric data, but switching to COVISE when displaying our data in the VR-cube. 10.3.1 Clouds in the Interstellar Medium We have seen in Section 10.2.1 a nice evolution of molecular magnetohydrodynamic clouds in the interstellar medium in two dimensions. The same code has been extended into 3D which in turn brings more complications, mainly with respect to hardware resources. Computation times

82

Page 94: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

increase too much, file storage becomes incredibly big, and it is more difficult to handle and manipulate 3D data. Therefore we have in this work restricted ourselves to produce the visualizations of the numerical simulations for only one time step and to show a rotation of the density field for that time step. Visualizations showing the temporal evolution of the 3D clouds with these and other more advanced techniques will be presented elsewhere (Palomino, Vazquez-Semadeni, & Ballesteros 2003). We have included in our visualization an environment geometry (see Section 8.8.1) which will help us as a reference frame in the image and will support us with the spatial orientation. Visualizing 3D data on a 2D surface, like a computer screen, is very complex; a two-dimensional image sometimes could represent many possible 3D shapes, and thus we need additional information in our visualization which may help in the perception of the 3D data. At this point we have to be careful regarding how we perform the hybrid rendering (Section 8.8). It is fairly easy to make the mistake of superimposing objects, the last one rendered being on top, occasioning misunderstanding in the final image. For example, if we first render our main visualization and then add the environment geometry, i.e. axes, we could mislead the interpretation of the image, and our picture could be seen in two different ways causing the Necker effect (Gregory 1970) where the image could be seen as one looking up at the bottom of the parallelogram, or one looking down on the top of the parallelogram. The Necker effect can be perceived in the next figure:

Figure 10.13. The Necker effect.

83

Page 95: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

It is easy to eliminate this undesired effect by making use of the z-buffer, or depth-buffer, an image-precision algorithm developed by Catmull (1974). The z-buffer is one of the simplest visible-surface algorithms to implement in both software and hardware. Basically, we load all the objects we wish to render and the z-buffer keeps track of the depth of the objects, storing only the largest value which represents the front clipping plane. Many systems automatically make use of the z-buffer but sometimes it is necessary to specify which objects will be rendered using this buffer and which will not.

Figure 10.14 Visualization using the z-buffer. Once we have overcome this tiny difficulty we proceed to render the density field of the volumetric data by computing isosurfaces (see Section 8.5). The method which IDL uses to compute the polygons that describe a three-dimensional contour is that of Klemp et al. (1990). The shaded surface is constructed using the scan line algorithm (Watkins 1970), and the light source vector is placed at [0, 0, 1], with the light rays parallel to the z axis. These same techniques are used for all subsequent isosurface visualizations presented here. The next images will show the rotation, over 360°, of the density field for one time step, from the 3D numerical simulations of the magneto-hydrodynamic clouds in the interstellar medium. A constant density surface (isosurface) has been rotated using the z-axis as the centre of rotation.

84

Page 96: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Figure 10.15. Rotation over 360° of the visualization of the density field from 3D numerical simulations of magnetohydrodynamic clouds in the interstellar medium.

85

Page 97: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

10.3.2 Stellar Jets from Variable Sources After obtaining the volumetric data from the numerical simulations of the stellar jets, just as before, we take the density field and compute the isosurfaces using the same method described above. The following images show the visualization of the density field of the jet varying the contour value and showing how this changes the contour surface from minimum to maximum values. By doing this we have overcome some of the difficulties associated with contouring that were mentioned in Section 9.4.

86

Page 98: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Figure 10.16. Visualization of the density field of a stellar jet. The images show a change in the density value from minimum (top-left) to maximum (down-right). 10.3.3 Coalition of a Neutron Star with a Black Hole Here we will present the visualization of a constant density surface from a 3D numerical simulation of a coalition of a neutron star with a black hole (see Section 5.3.3). Using the same techniques as before, we have been able to visualize and rotate the isosurface showing how the neutron star (small sphere on the side) is being disrupted by the black hole (middle empty spot). With scientific visualization we have an effective analysis of the performance of the model through visual observation.

87

Page 99: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Figure 10.17. Visualization of the density field from the numerical simulations of a neutron star and a black hole coalition.

10.3.4 Volume Rendering We have seen that visualizing constant density surfaces, or isosurfaces, gives us a very good picture of the performance of our numerical simulations. We could vary the density value and analyse what is happening from different points of view, as we did with the stellar jet (Section 10.3.2). Although contouring is a very good and widely used technique, we sometimes would like to see the whole picture, and that is what volume rendering aims for; to

88

Page 100: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

produce an image without generating any intermediate geometric representation. The approach that has been employed for volume rendering is the object-order volume rendering (see Section 8.6.2). We have chosen this method against the image-order one because of the nature of the data: very big datasets, which would make using ray tracing fairly slow. We have assigned colour and opacity to regions within the volume, and we have also added volumetric illumination models, supporting shading, at different locations. Finally, in our GUI developed, we have included scaling, zooming and rotation in almost real time, allowing us to have a very friendly interactive control over our data. 10.3.4.1 MHD Clouds in the ISM

A volume rendering using object-order methods of magnetohydrodynamic clouds in the interstellar medium is presented here. The next images will show an orthographic projection and a perspective projection of the volumetric data.

Figure 10.18. Volume Rendering of Clouds in the Interstellar Medium using object-order methods with orthographic projection.

89

Page 101: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Figure 10.19. Volume Rendering of Clouds in the Interstellar Medium using object-order methods with perspective projection.

10.3.4.2 Neutron Star–Black Hole Coalition

From our volumetric data of the coalescence of a neutron star with a black hole, we have created a volume rendering using an object-order approach, the same techniques as before have been applied to visualize how the black hole disturbs the neutron star, losing its matter as a spill of gas onto the former one.

Figure 10.20. Volume Rendering of Neutron Star-Black Hole Coalescence using object-order methods with orthographic projection.

90

Page 102: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Figure 10.21. Volume Rendering of Neutron Star-Black Hole Coalescence using object-order methods with perspective projection.

10.3.5 Stereo Rendering of Clouds in the Interstellar Medium Now we will make use of the techniques reviewed in Section 8.7, and try to produce a true 3D visualization. In order to introduce the binocular disparity into our image we have employed time-parallel methods, and used the anaglyph technique that requires to use a simple pair of glasses that filter the entering light. To create the composite image, we generate first two independent images from two views with the proper separation of binocular parallax. Parallax values should not exceed 1.5° (Valyus 1962). Some images require less parallax for comfortable viewing, but it is also possible to exceed this recommendation for viewer-space effects.

1.5° Left view Right view

Figure 10.22. Left and right image points should not exceed the maximum parallax, more distant between the image points may be acceptable, but remember the 1.5° rule.

After we have created the images from the two different views, the next step is to convert their RGB values into intensities and merge the images, where the fused image’s red values are taken from the left eye image intensities and the green values are taken from the right eye image intensities. The resulting images are shown in the next figure.

91

Page 103: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

92

Page 104: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

93

Page 105: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Figure 10.23. Stereo view of MHD clouds in the interstellar medium using time parallel techniques.

10.4 The 3D Numerical Simulations in the VR-Cube Finally, we conclude this work with the visualization of our volumetric data in a true 3D environment: the VR-Cube. As mentioned before, we have chosen COVISE (see Section 9.4) as the most suitable visualization system for displaying 3D datasets in the CAVE (see Section 9.5). Employing the COVISE renderer module for virtual environments, COVER (see Section 9.4.1), we have been able to effectively visualize our 3D datasets. Unfortunately, due to hardware limitations, we had to lower the resolution of our data by a factor of three in order to render the volumetric data in the CAVE. For technical reasons, on SGI machines each voxel occupies at least two bytes of texture memory, even if only 8 bits per voxel are stored. In order to manipulate the data in real-time inside the CAVE, we have used COVER’s Volume menu. COVER’s volume rendering capabilities can be accessed through it, allowing a variety of operations such as setting the rendering speed (which in turns affects display quality), or enabling a clipping plane. The volumes are then displayed by drawing them slice by slice (the number of slices will also determine the rendering speed). The slices are

94

Page 106: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

always oriented in such a way that their normal vectors point towards the user, so that the user never looks in between slices. As soon as the volume is successfully loaded, a transfer function editor window pops up. Using the transfer function we can change the colour mapping, the alpha value (opacity), brightness, among others. The transfer function editor is the main interaction element to the volume data. It consists of rotary knobs, which are manipulated by clicking on them and then twisting the hand (similar to real knobs), and it is fairly easy to operate (although it takes a while until one gets accustomed to how the transfer function editor functions).

Figure 10.24. COVER’s 3D menu (left) and transfer function editor (right). The next pictures will give an idea to the reader of what it is like to be submerged in the CAVE. We can see the user having the control wand, which is the primary input device. The wand has an electromagnetic sensor attached, which controls the movement of the pointer (it can be thought of as the user having a sword). Using the pointer, and the respective buttons, we can scale, rotate, and translate the volume. Also it is the element we use for selecting and modifying the transfer functions, e.g. colour and opacity, located in the transfer function editor.

95

Page 107: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Figure 10.25. Visualization of the Astrophysical Simulations in the CAVE: MHD Clouds in the ISM with local star formation.

96

Page 108: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Figure 10.26. Visualization of the Astrophysical Simulations in the CAVE: Black Hole-Neutron Star Coalescence.

97

Page 109: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

98

Page 110: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

C h a p t e r 1 1

Conclusions In the preceding chapters, we have reviewed different aspects of scientific visualization. Starting from an introduction of the visualization process and the visualization models, we have arrived at appreciating some astonishing images coming from data of the numerical simulations of the different cases that we have seen in the field of astrophysics. The numerical models of the simulations performed, from which the data have been obtained, have been briefly described. The mathematical models and the respective equations describing the astrophysical processes studied have been also presented here. We have added some introductory text before each mathematical description of the physical phenomena in order to make the reader, who may be unfamiliar with astronomy, aware of exactly what we have been studying. We also have seen a brief overview of some of the current techniques and applications of scientific visualization, how the structure of these techniques is based on the entity being visualized, and how the common presentation techniques are classified according to the structure employed. Each technique can typically seen as three separate stages: the creation of a continuous model from some supplied discrete data; the mapping of that model to some suitable abstract visualization object; and finally the rendering of that object. This coverage is not exhaustive, but the techniques described here have been representative for our particular practice of visualizing data in the area of astrophysics. Several visualization systems have been evaluated in this work too. In all of them we have found advantages and disadvantages, and we do not have a complete winner. As we have mentioned before, we cannot consider a system to be a poor system if it was not designed for another application beyond the defined scope. Thus, COVISE has been the best visualization system when working with Virtual Environments, but we have preferred to use IDL or MATLAB when working on the desktop. IDL has a more powerful library for visualization and image processing than that of MATLAB, and that is why we have chosen to work with IDL for scientific visualization purposes. On the other hand, MATLAB's working environment is friendlier and easy-to-use than the one of IDL, making it rather easy when we want to manipulate data and generate basic visualizations. We cannot leave VTK behind either, it is a very powerful library for 3D computer graphics, and it is for free! But we felt that VTK is

99

Page 111: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

more oriented to C++, Java or Tcl/Tk programmers rather than scientists. And ultimately, we want that the applications built during this work will be used by scientists, mainly astrophysicists, of several disciplines. Finally, we have presented the visualizations of the two- and three-dimensional numerical simulations in astrophysics of the distinct cases of study: magnetohydrodynamic clouds in the interstellar medium, stellar jets from variable sources, neutron star - black hole coalescence, and accretion disks around a black hole. Visualizing these scientific data has not been an easy task, and we have not finished our work yet. Further work is continuing and, as we have mentioned, it will presented in some other publications. Presently, there is a strong demand for new visualization techniques for large scale numerical simulations, not only in the area of astrophysics but almost in any field, and it can only be satisfied by combining the efforts of astrophysicists, numerical analysts, and computer graphics experts. We also have seen that scientific visualization is more than a science, it has an important aesthetic side. Thus additional knowledge is required to contribute in this field from perceptual and cognitive psychology, and artists and designers. This calls for a cooperative effort in the future development of scientific visualization: a beautiful mixture between science and art.

100

Page 112: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Appendices

101

Page 113: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

102

Page 114: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Glossary This glossary consists of visualization terms, words or phrases, used with specific meaning in the context of this work in scientific visualization (including computer graphics and some astrophysical terms), and also of abbreviations and acronyms of products, techniques and organizations that are mentioned throughout this thesis. Abstraction: A mental process that extracts the essential form or unifying properties of a concept. ACM: Association for Computing Machinery. Accretion Disk: A relatively flat sheet of gas and dust surrounding a newborn star, a black hole, or any massive object growing in size by attracting material. Actor: Name given to the object we wish to render such as a cube or sphere. Actors represent graphical data or objects. Alpha: A value that specifies opacity, or transparency. An alpha value of one indicates that the object is opaque. An alpha value of zero indicates that the object is completely transparent. Animation: A sequence of images displayed successively (see Section 8.10). The images may vary due to changes in geometry, colour, lighting, camera position, or other graphics parameters. Animations are used to display the variation of one or more variables, or just to see the actor from different locations. Antialiasing: The process of reducing aliasing effects (see Section 8.9). A common use of antialiasing is to draw straight lines that do not have the jagged edges found in many systems without antialiasing. ApE: A visualization system available from the Ohio Supercomputer Centre. API: Application Programmer’s Interface. ARPACK: ARnoldi PACKage. A collection of Fortran subroutines designed to solve large scale eigenvalue problems. Astronomy: The scientific study of the origin, evolution, composition, distance, and motion of all bodies and scattered matter in the universe. The

103

Page 115: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

main branches of the subject are: astrometry, celestial mechanics, and astrophysics. (See also astrophysics; cosmology). Astrophysics: The part of astronomy that deals principally with physics of the universe, structure of all cosmic matter and the consequent external features and positions. (See also astronomy; cosmology). Binocular Parallax: The effect of viewing the same object with two slightly different viewpoints in order to create depth information (see Section 8.7). C++: A compiled programming language. C++ is an extension of the C programming language that incorporates object-oriented principles. CAD: Computer Aided Design. CAVE: Cave Automatic Virtual Environment (see Section 9.5). Cell: The elements of visualization datasets. Cells define a topology (e.g., polygon, triangle) in terms of a list of point coordinates. Clipping Plane: A plane which restricts the rendering or processing of data. Front and back clipping planes are commonly used to restrict the rendering of primitives to those lying between the two planes. Colour Mapping: A scalar visualization technique that maps scalar values into colour (see Section 8.3). Generally used to display the variation of data on a surface or through a volume. Compiled System: A compiled system requires that a programme be compiled before it is executed (cf. interpreted systems). Connectivity: A technique to extract connected cells. Cells are connected when they share common features such as points, edges, or faces. Contour: The (closed) boundary of a structure or the outline of a region in a 2D data plane or cross-section. Contouring: A scalar visualization technique that generates lines in 2D, or surfaces in 3D, representing a constant scalar value across a scalar field (see Section 8.5). Generally, contour lines are called isolines and contour surfaces are called isosurfaces. Cosmology: The branch of astronomy concerned with the evolution, general structure, and nature of the universe as a whole. COVER: Covise Virtual Environment Renderer. It is the COVISE renderer module for Virtual Environments (see Section 9.4.1).

104

Page 116: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

COVISE: Cooperative Visual Simulation Environment. A modular visualization system which integrates simulation, postprocessing and visualization functionalities (see Section 9.4). Cray: Generically Cray Systems and Cray Research, firms involved in the production of supercomputers (inter alia). Cross-section: The set of voxels residing on a plane that passes through the dataset. Cutting: A visualization technique to slice through or cut the data. Dataset: The general term used to describe visualization data. Datasets consist of structure (geometry and topology) and dataset attributes (scalar, vectors, tensors, etc.). Data Flow Diagram: A diagram that shows the information flow and operations on that information as it moves throughout a programme or process. Data Object: An object that is an abstraction of data. Typical visualization objects include structured grids and volumes. Data Selection: The process of selecting a portion of data based on characteristics of the data (see Section 7.2). Depth-cueing: The variation of the intrinsic colour of an object according to its distance from the virtual viewer. Dithering: A technique that approximates shades of grey by using a mixture of both black and white pixels. This technique is often used to work around colour limitations in the graphics hardware. The same method also works for other colours. DIVE: Distributed Interactive Virtual Environment. A software developed by the Swedish Institute of Computer Science (SICS). Dividing Cubes: A contour algorithm that represents isosurfaces as a dense cloud of points. The algorithm subdivides voxels that lie on the surface of the object into a small cubes which are represented as point primitives (cf. marching cubes). EISPACK: An old library of Fortran routines for computing eigenvalues and eigenvectors in numerical linear algebra.

105

Page 117: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Entity: Something within a system that has identity. For example, physical entities in the real world are cars, airplanes, etc. A database and isosurface algorithm are examples of non-physical entities. EVL: Electronic Visualization Laboratory. The EVL is part of the University of Illinois in Chicago and it is the place where the CAVE was developed. Execution: The process of updating a visualization network. Filter: An algorithm which is applied to a set of data to select a subset, or modify the data in the set. Functional Model: The description of a system based on what it does (see Chapter 4). Galaxy: Vast star systems containing thousands of billions of stars, dust and gas, held together by gravity. Galaxies are the basic building blocks of the Universe. There are three main classes, Elliptical, Spiral and Barred, named after their appearance. Glyph: A general visualization technique used to represent data using a meaningful shape or pictorial representation (see Section 8.4). Hedgehog: A vector visualization technique that represents vector direction and magnitude with oriented lines (see Section 8.4). HCI: Human-Computer Interaction (see Section 8.12). Histogram: A technique used to summarize data by reporting the number of data points that fall within a certain range of values. Because histograms provide only a summary, they depict the original information only indirectly. IDL: Interactive Data Language (see Section 9.1). IEEE: Institute of Electrical and Electronic Engineers. Image-Order Techniques: Rendering techniques that determine for each pixel in the image plane which data samples contribute to it (see Section 8.6.1). Image-order techniques are implemented using ray tracing (cf. object-order techniques). Interpolation: The process of computing new intermediate data values between existing data values (see Section 6.1.3). Cells use interpolation functions to compute data values interior to or on the boundary of the cell. Interpreted System: An interpreted system can execute programmes without going through a separate compilation stage. Interpreted systems often allow

106

Page 118: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

the user to interact and modify the programme as it is running (cf. compiled systems). Irregular Data: Data in which the relationship of one data item to the other data items in the dataset is arbitrary. Irregular data are also known as unstructured data. ISM: Interstellar Medium. The gas and dust that exists between the stars. Isosurface: A pseudosurface representing a constant valued scalar function within a volumetric dataset (see contouring). Isovalue: The scalar value used to generate an isosurface. Jacobian: A matrix that relates one coordinate system to another. Jeans Length: The minimum radius for the spontaneous collapse of an interstellar cloud of dust and gas of a specific mass and temperature (see Section 5.1). Jets: Blasts of particles, usually coming from an active galactic nucleus or a pulsar. Unlike a jet airplane, when the stream of gas in one direction, astrophysical jets come in pairs with each jet aiming in opposite directions (See Section 5.2). kpc: kilo-parcek (see parcek). Lane-Emden equation: Equation for the density structure inside a star, which relates the central temperature of a star to its mass and radius. Line: A cell defined by two points. LAPACK: Linear Algebra PACKage. LAPACK is a library of Fortran subroutines designed for solving the most commonly occurring problems in numerical linear algebra using a wide range of modern high performance computers. LINPACK: A Linear algebra Package consisting of Fortran subroutines that analyse and solve linear equations and linear least-square problems. LINPACK has been largely superseded by LAPACK, which has been designed to run efficiently on shared-memory and vector supercomputers. Mapper: A process object that terminates the visualization network. It maps input data into graphical libraries, or other devices, or writes data to disk, or a communication device.

107

Page 119: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Marching Cubes: A contouring algorithm to create surfaces of constant scalar value from a volumetric dataset by a sequential tessellation of the boundary voxels by tiny triangles (cf. dividing cubes). MATLAB: Matrix Laboratory (see Section 9.2). Metadata: Data which describe and define other data. MHD: Magneto-Hydro Dynamics. Module Model: The description of a system modelled as a controlled dual dataflow, in which modules are inserted into the system to construct a specific application (see Chapter 3). Object: An abstraction that models the state and behaviour of entities in a system. Object Model: The description of a system in terms of the components that make up the system, including the relationship of the components one to another. Object-Order Techniques: Rendering techniques that project object data (e.g. polygons or voxels) onto the image plane (cf. image-order techniques). Object-Oriented: A software development technique that uses objects to represent the state and behaviour of entities in a system. Opacity: The relative capacity of an object to obstruct the transmission of light through it (see alpha, cf. translucency, transparency). Orthographic Projection: A mapping of world coordinates into view coordinates that preserves all parallel lines. In an orthographic projection, also called parallel projection, an object appears to have the same size regardless of how far away it is from the viewer. This is equivalent to having a centre of projection that is infinitely far away (cf. perspective projection). Parcek: (Symbol: pc). A unit of length, used in astronomy, equal to the distance at which a base line of one astronomical unit subtends an angle of one second of arc. 1 parsec == 3.085 72 x 1016 metres or about 3.26 light-years. Perspective Projection: A mapping of world coordinates into view coordinates that roughly approximates a camera lens. Specifically, the centre of projection must be a finite distance from the view plane. As a result closer objects appear larger than distant objects (cf. orthographic projection).

108

Page 120: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Pixel: An abbreviation for picture element, a constant valued element in an image. Point: A geometric specification of position in a 3D space. Polygon: A cell consisting of three or more co-planar points defining a polygon. The polygon can be concave but without imbedded loops. Polygon Data: A dataset type consisting of arbitrary combinations of vertices, polyvertices, linesm polylines, polygons, and triangle strips. Polygonal data is an intermediate data form that can be easily rendered by graphics libraries, and yet can represent many types of visualization data. Polyline: A composite cell consisting of one or more lines. Polyvertex: A composite cell consisting of one or more vertices. Rasterization: The process which refers specifically to those steps that involve determining pixel values from input geometric primitives. Regular Data: Data in which one data item is related, either geometrically or topologically, to other data items. Also referred to as structured data. Rendering: The process of converting object geometry (i.e. geometric primitives), object properties, and a specification of lights and camera into an image. The primitives may take many forms including surface primitives (points, lines, polygons, splines), implicit functions, or volumes. RGB: Red, Green, Blue; a method of describing colour pictures. rms: Root-mean-square velocity. The square root of the mean square velocity. Sampling: Selective acquisition or sampling of data, often at regular intervals. Sampling is also often referred to as probing. Scalar: A single value or function value. May also be used to represent a field of such values. Scalar Range: The minimum and maximum scalar values of a scalar field. Scene: A complete representation of the components required to generate an image or animation including lights, camera, actors, properties, transformations, geometry, texture, and other pertinent information. Shading: A colouring of the image pixels that represents the light intensity transmitted to each pixel, taking into consideration the light model, e.g. direct

109

Page 121: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

and indirect illumination, position of the light sources and emitters, and the position and orientation of the image. SGI: Silicon Graphics. Manufacturer of graphics workstations (inter alia). SIGGRAPH: ACM Special Interest Group in Computer Graphics. SPH: Smooth Particle Hydrodynamics (see Section 5.3.3). Structured Data: Data in which one data item is related, either geometrically or topologically, to other data items. Also referred to as regular data. Structured Grid: A dataset whose structure is topologically regular but whose geometry is irregular. Geometry is explicit and topology is implicit. Structured Points: A dataset whose structure is both geometrically and topologically regular. Both geometry and topology are implicit. A 3D structured point dataset is known as a volume. A 2D structured point dataset is known as a pixmap. Surface Rendering: Rendering techniques based on geometric surface primitives such as points, lines, polygons, and splines, by first converting them into an intermediate surface representation and then using conventional computer graphics techniques to render them (cf. volume rendering). Topology: A subset of the information about the structure of a dataset. Topology is a set of properties invariant under certain geometric transformation such as scaling, rotation, and translation. Transparency: The property of an object which allows the transmission of light through it without appreciable scattering so that other objects beyond are entirely visible (see alpha, cf. opacity). Uniform Grid: See structured points. Vector: A specification of direction and magnitude. Vectors can be used to describe fluid velocity, structural displacement, or object motion. Vertex: A primary 0D cell, sometimes used synonymously with point or node. View Coordinate System: The projection of the world coordinate system into the camera’s viewing. Visual Programming: A programming model that enables the construction and manipulation of visualization applications. A typical implementation is

110

Page 122: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

the construction of a visualization pipeline by connecting execution modules into a network. Visualization Network: A series of process objects and data objects joined together into a dataflow network. Volume: A regular array of points in three-dimensional space. Volumes are often defined as a series of 2D images arranged along the z-axis. Volume Rendering: The process of directly viewing volume data without converting the data to intermediate surface primitives (cf. surface rendering). Volume Shading: The technique of shading a volumetric dataset or its projection. Voxel: An abbreviation for volume element, or volume cell. It is the 3D conceptual counterpart of the 2D pixel. Each voxel is a quantum unit of volume and has a numeric value. VTK: The Vizualization Toolkit (see Section 9.3). Widget: An element of a graphical user interface, such as a button, menu item, or checkbox. World Coordinate System: A three-dimensional Cartesian coordinate system in which the main elements of a rendering scene are positioned. Z-Buffer: Memory that contains the depth (along the view plane normal) of a corresponding element in a frame buffer. Z-Buffering: A technique for performing hidden line, point, surface, removal by keeping track of the current depth, or z value for each pixel. These values are stored in the z-buffer.

111

Page 123: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

112

Page 124: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

References Balsara D., 1995. “von Neumann Stability Analysis of Smoothed Particle

Hydrodynamics – Suggestions for Optimal Algorithms”. Journal of Computational Physics, 121, 357.

Bergeron R.G., Grinstein G.G., 1989. “A reference model for the

visualization of multi-dimensional data”, Proc. Eurographics ’89, 393-399. (Elsevier Science Publishers B.V.).

Boss P.J., 1993. “Liquid-Crystal Shutter Systems for Time-Multiplexed

Stereoscopic Displays”. In Stereo Computer Graphics and Other True 3D Technologies. McAllister D.F (Ed.) Princeton University Press.

Brodlie K.W., Carpenter L.A., Earnshaw R.A., Gallop J.R., Hubbold R.J.,

Mumford A.M., Osland C.D., Quarendon P., 1991. Scientific Visualization: Techniques and Applications, Springer-Verlag Berlin Heidelberg.

Buning P.G., 1989. Numerical Algorithms in CFD Post-Processing. von Karman

Institute for Fluid Dynamics, Lecture Series 1989-07. Carroll B.W., Ostlie D.A., 1996. An Introduction to Modern Astrophysics. Addison-

Wesley, Reading, Mass. Catmull E., 1974. A Subdivision Algorithm for Computer Display of Curved Surfaces.

Ph.D. Thesis, Computer Science Department, University of Utah, Salt Lake City, UT.

Cox B.J., 1986. Object-Oriented Programming, an Evolutionary Approach, Addison-

Wesley, Reading, Mass. Cruz-Neira C., Sandin D.J., and DeFanti T.A., 1993. “Surround-Screen

Projection Bases Virtual Reality: The Design and Implementation of the CAVE”. In Proceedings of ACM SIGGRAPH 93, pp 135-142.

DeSanctis G., 1984. “Computer Graphics as Decision Aids: Direction for

Research”. Decision Science Journal vol 15, 463-487. DeVries P.L., 1994. Computational Physics, John Wiley & Sons, Inc., New York. Dyer D.S., 1990. “A Dataflow Toolkit for Visualization”, IEEE Computer

Graphics and Applications vol 10 (4), July 1990.

113

Page 125: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Foley J.D., van Dam A., Feiner S.K., Hughes J.F., 1990. Computer Graphics: Principles and Practices. Second Edition, Addison-Wesley, Reading Massachusetts.

_____, 1997. Introduction to Computer Graphics, Addison-Wesley, Reading

Massachusetts. Gingold R.A., Monaghan J.J., 1977. “Smoothed Particle Hydrodynamics:

theory and application to non-spherical stars”. Monthly Notices of the Royal Astronomical Society (MNRAS), 181, 375.

Gregory R.L., 1970. Eye and Brain: The Psychology of Seeing. World University

Library, London. Haber R.B., McNabb D.A., 1990. “Visualization Idioms: A Conceptual Model

for Scientific Visualization Systems”, In Visualization in Scientific Computing, Nielson G.M., Shriver B., Rosenblum L.J. (Eds).

Hagen H., Müller H., Nielson G.M. (Eds.), 1992. Focus on Scientific

Visualization. Springer-Verlag Berlin. Hamming R.W., 1962. Numerical Methods for Scientists and Engineers, McGraw-

Hill, New York. Hehl F.W., Kiefer C., Metzler R.J.K. (Eds.), 1997. Black Holes: Theory and

Observation. Springer-Verlag Berlin. Jain A.K., 1989. Fundamentals of Digital Image Processing. Prentice Hall

International. Kalogera V., Narayan R., Spergel D.N., Taylor J.H., 2001. “The Coalescence

Rate of Double Neutron Star Systems”. Astrophysical Journal (ApJ), 556, 340.

Kaufman A. (Ed), 1990. Volume Visualization. IEEE Computer Society Press. Kund W. (Ed.), 1995. Jets from Stars and Galactic Nuclei. Springer-Verlag Berlin. Lee W.H., 2000. “Newtonian Hydrodynamics of the Coalescence of Black

Holes with Neutron Stars II: Tidally Locked Binaries with a Soft Equation of State”. Monthly Notices of the Royal Astronomical Society (MNRAS), 308, 780.

Lee W.H., Kluźniak W., 1995. “Merge of a Neutron Star with a Newtonian

Black Hole”. Acta Astronómica, 45, 705.

114

Page 126: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

_____, 1999. “Newtonian Hydrodynamics of the Coalescence of Black Holse with Neutron Stars. I: Tidally Locked Binaries with Stiff Equation of State”. Astrophysical Journal (ApJ), 526, 178.

Lee W.H., Ramirez-Ruiz, E., 2002. “Accretion Disks around Black Holes:

Dynamical Evolution, Meridional Circulations and Gamma Ray Bursts”. Astrophysical Journal (ApJ), 577, 893.

Lim A.J., 2001. “3D Numerical Simulations of Intrinsically Variable Stellar

Jets I: A Preliminary Calculation”. Monthly Notices of the Royal Astronomical Society (MNRAS), 306, 314.

Lim A.J., Steffen W., 2001. “Jet Cocoons in Rotating Seyfert Galaxies:

Adaptive Three-dimensional Hydrodynamics”. Monthly Notices of the Royal Astronomical Society (MNRAS), 322, 166.

Lorensen W.E., Cline H.E., 1987. “Marching Cubes: A High Resolution

Surface Construction Algorithm”. ACM SIGGRAPH Computer Graphics vol 21 (4) 163-169, July 1987.

Lucy L.B., 1977. “A numerical approach to the testing of the fission

hypothesis”. The Astronomical Journal (AJ), 82, 1013. McAllister D.F (Ed.), 1993. Stereo Computer Graphics and Other True 3D

Technologies. Princeton University Press. Malzbender T., Kitson F., 1993. “A Fourier Technique for Volume

Rendering”. In Focus on Scientific Visualization. Hagen H., Müller H., Nielson G.M. (Eds.). Springer-Verlag.

Monaghan J.J., Lattanzio, J:C., 1985. “A Refined Particle Method for

Astrophysical Problems”. Astronomy and Astrophysics (A&A). 149, 135. Monaghan J.J., 1992. “Smoothed Particle Hydrodynamics”. Annual Review of

Astronomy and Astrophysics (ARA&A), 30, 543. McCormick B., DeFanti T.A., and Brown M.D. 1987. “Visualization in

Scientific Computing”, ACM SIGGRAPH Computer Graphics vol 21 (6), November 1987.

Nakayama Y., Boucher R. F., 1999. Introduction to Fluid Mechanics. Arnold

Publishers, London. Oohara K., Nakamura T., 1989. ”Gravitational Radiation from Coalescing

Binary Neutron Stars I”. Prog. Theor. Phys., 82, 535.

115

Page 127: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Palomino H.U., 2003. “Animations and Movie-Clips from the Visualizations of 2D and 3D Numerical Simulations in Astrophysics”. http://www.astroscu.unam.mx/~horacio/astromovies/ .

Palomino H.U., Li B., Pei G., 2002. ”Optimization and Parallelization of a

Magnetohydrodynamic Code of Clouds in the Interstellar Medium”. Paper presented at the High Performance Summer School, Stockholm Sweden.

Palomino H.U., Lee W.H., 2003. “Visualization of the Temporal Evolution of

Accretion Disks around Black Holes: A combination of Techniques”. In preparation.

Palomino H.U., Vazquez-Semadeni E., Ballesteros J., 2003. “Visualization of

3D Numerical Simulation of Magnetohydrodynamic Clouds in the Interstellar Medium: Temporal Evolution Animation”. In preparation.

Passot T., Vázquez-Semadeni E., Pouquet A. 1995, “A Turbulent Model for

the Interstellar Medium II: Magnetic Fields and Rotation”. Astrophysical Journal (ApJ), 455, 536.

Plato. c.374 BC. The Republic. Oxford World’s Classics Publications, 1998. Research Systems Inc., 2002a. Getting Started with IDL. Research Systems Inc.,

Denver, Colorado. _____, 2002b. Image Processing in IDL. Research Systems Inc., Denver,

Colorado. Sabin M.A., 1986. “A Survey of Contouring Methods”. Computer Graphics

Forum vol 5, 325-339. Schroeder W., Martin K., Lorensen B., 1998. The Visualization Toolkit. An

Object-Oriented Approach to 3D Graphics. Prentice Hall, Inc. New Jersey. Schulze-Döbold J., Wössner U., Walz S.P., Lang U., 2001. “Volume

Rendering in a Virtual Environment”. Proceedings of 5th IPTW and Eurographics Virtual Environment. Springer-Verlag, pp. 187-198.

Shapiro S.L., Teukolsky S.A., 1983. Black Holes, White Dwarfs, and Neutron Stars:

The Physics of Compact Objects. John Wiley & Sons Inc. The MathWorks Inc, 1998. Using MATLAB. The MathWorks Inc. Thompson J.F., Warsi Z.U.A., Mastin C.W., 1985. Numerical Grid Generation:

Foundations and Applications. Elsevier Science Publishing Co.

116

Page 128: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Tufte E. R., 1983. The Visual Display of Quantitative Information. Graphics Press, Connecticut.

_____, 1990. Envisioning Information. Graphics Press, Connecticut. Upson C., 1989. “Scientific Visualization Environments for the Computational

Sciences”, Proc. Compcon 89, pp 322-327. Upson C., Faulhaber T., Kamins D., Laidlaw D., Schlegel D., Vroom J.,

Gurwitz R., van Dam A., 1989. “The Application Visualization System: A Computational Environment for Scientific Visualization”, IEEE Computer Graphics and Applications vol 9 (4), July 89.

Valyus N.A., 1962. Stereoscopy. Focal Press, London, New York. Van Leer B., 1982. “Flux-Vector Splitting for the Euler Equations”. Lect.

Notes. Phys. 170, 507. Vázquez-Semadeni E., Passot T., Pouquet A., 1996. “Influence of Cooling-

Induced Compressibility on the Structure of Trubulent Flows and Gravitational Collapse”. Astrophysical Journal (ApJ), 473, 881.

Vircinity IT, 2001. COVISE User’s Guide. Vircinity IT, Computing Center

University of Stuttgart. Watkins G.S., 1970. A Real Time Visible Surface Algorithm. PhD Thesis,

Computer Science Department, University of Utah, Salt Lake City. Watson D., 1990. “The State of the Art of Visualisation”, Proc.

SuperComputing Europe Fall Meeting, Aachen, September 90. Wheeler J.A., 1971. Pontificiae Academiae Scientiarum Scripta Varia, 35, 539.

117

Page 129: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

118

Page 130: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

Colour Plates

119

Page 131: Visualization of 3D Numerical Simulations in … · of 3D Numerical Simulations in Astrophysics using the VR ... of 3D Numerical Simulations in Astrophysics ... object-order methods

120