graphics-smoke's Introduction
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- saved from url=(0046)http://www.win.tue.nl/~alext/COURSES/INFO_VIS/ --> <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=windows-1252"> <meta name=ProgId content=Word.Document> <meta name=Generator content="Microsoft Word 10"> <meta name=Originator content="Microsoft Word 10"> <link rel=File-List href="README_files/filelist.xml"> <link rel=Edit-Time-Data href="README_files/editdata.mso"> <!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--> <title>Visualization Course – What is in this directory</title> <!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>ATelea</o:Author> <o:LastAuthor>MK</o:LastAuthor> <o:Revision>32</o:Revision> <o:TotalTime>150</o:TotalTime> <o:Created>2005-12-02T13:22:00Z</o:Created> <o:LastSaved>2007-09-11T17:39:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>1128</o:Words> <o:Characters>6435</o:Characters> <o:Company>TU Eindhoven</o:Company> <o:Lines>53</o:Lines> <o:Paragraphs>15</o:Paragraphs> <o:CharactersWithSpaces>7548</o:CharactersWithSpaces> <o:Version>10.6830</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:SpellingState>Clean</w:SpellingState> <w:GrammarState>Clean</w:GrammarState> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--> <style> <!-- /* Font Definitions */ @font-face {font-family:Wingdings; panose-1:5 0 0 0 0 0 0 0 0 0; mso-font-charset:2; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:0 268435456 0 0 -2147483648 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0pt; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} h1 {mso-style-next:Normal; margin:0pt; margin-bottom:.0001pt; mso-pagination:widow-orphan; mso-outline-level:1; font-size:18.0pt; mso-bidi-font-size:12.0pt; font-family:Arial; color:blue; mso-font-kerning:0pt; font-weight:normal;} a:link, span.MsoHyperlink {color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline; text-underline:single;} span.SpellE {mso-style-name:""; mso-spl-e:yes;} span.GramE {mso-style-name:""; mso-gram-e:yes;} @page Section1 {size:595.3pt 841.9pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.Section1 {page:Section1;} /* List Definitions */ @list l0 {mso-list-id:92438320; mso-list-type:hybrid; mso-list-template-ids:1363569478 1265507632 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l0:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:32.2pt; mso-level-number-position:left; margin-left:32.2pt; text-indent:-18.0pt; font-family:Symbol;} @list l0:level2 {mso-level-tab-stop:72.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l0:level3 {mso-level-tab-stop:108.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l0:level4 {mso-level-tab-stop:144.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l0:level5 {mso-level-tab-stop:180.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l0:level6 {mso-level-tab-stop:216.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l0:level7 {mso-level-tab-stop:252.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l0:level8 {mso-level-tab-stop:288.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l0:level9 {mso-level-tab-stop:324.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l1 {mso-list-id:323976523; mso-list-type:hybrid; mso-list-template-ids:-752812478 1265507632 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l1:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:32.2pt; mso-level-number-position:left; margin-left:32.2pt; text-indent:-18.0pt; font-family:Symbol;} @list l1:level2 {mso-level-tab-stop:72.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l1:level3 {mso-level-tab-stop:108.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l1:level4 {mso-level-tab-stop:144.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l1:level5 {mso-level-tab-stop:180.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l1:level6 {mso-level-tab-stop:216.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l1:level7 {mso-level-tab-stop:252.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l1:level8 {mso-level-tab-stop:288.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l1:level9 {mso-level-tab-stop:324.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l2 {mso-list-id:447353460; mso-list-type:hybrid; mso-list-template-ids:539260506 1265507632 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l2:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:32.2pt; mso-level-number-position:left; margin-left:32.2pt; text-indent:-18.0pt; font-family:Symbol;} @list l2:level2 {mso-level-tab-stop:72.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l2:level3 {mso-level-tab-stop:108.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l2:level4 {mso-level-tab-stop:144.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l2:level5 {mso-level-tab-stop:180.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l2:level6 {mso-level-tab-stop:216.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l2:level7 {mso-level-tab-stop:252.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l2:level8 {mso-level-tab-stop:288.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l2:level9 {mso-level-tab-stop:324.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l3 {mso-list-id:505559110; mso-list-type:hybrid; mso-list-template-ids:1184550384 1265507632 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l3:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:32.2pt; mso-level-number-position:left; margin-left:32.2pt; text-indent:-18.0pt; font-family:Symbol;} @list l3:level2 {mso-level-number-format:bullet; mso-level-text:o; mso-level-tab-stop:72.0pt; mso-level-number-position:left; text-indent:-18.0pt; font-family:"Courier New";} @list l3:level3 {mso-level-number-format:bullet; mso-level-text:\F0A7; mso-level-tab-stop:108.0pt; mso-level-number-position:left; text-indent:-18.0pt; font-family:Wingdings;} @list l3:level4 {mso-level-tab-stop:144.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l3:level5 {mso-level-tab-stop:180.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l3:level6 {mso-level-tab-stop:216.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l3:level7 {mso-level-tab-stop:252.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l3:level8 {mso-level-tab-stop:288.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l3:level9 {mso-level-tab-stop:324.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l4 {mso-list-id:1331177106; mso-list-type:hybrid; mso-list-template-ids:-969107164 1265507632 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l4:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:32.2pt; mso-level-number-position:left; margin-left:32.2pt; text-indent:-18.0pt; font-family:Symbol;} @list l4:level2 {mso-level-tab-stop:72.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l4:level3 {mso-level-tab-stop:108.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l4:level4 {mso-level-tab-stop:144.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l4:level5 {mso-level-tab-stop:180.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l4:level6 {mso-level-tab-stop:216.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l4:level7 {mso-level-tab-stop:252.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l4:level8 {mso-level-tab-stop:288.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l4:level9 {mso-level-tab-stop:324.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l5 {mso-list-id:1935019449; mso-list-type:hybrid; mso-list-template-ids:1773670054 1265507632 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l5:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:32.2pt; mso-level-number-position:left; margin-left:32.2pt; text-indent:-18.0pt; font-family:Symbol;} @list l5:level2 {mso-level-tab-stop:72.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l5:level3 {mso-level-tab-stop:108.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l5:level4 {mso-level-tab-stop:144.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l5:level5 {mso-level-tab-stop:180.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l5:level6 {mso-level-tab-stop:216.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l5:level7 {mso-level-tab-stop:252.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l5:level8 {mso-level-tab-stop:288.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l5:level9 {mso-level-tab-stop:324.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l6 {mso-list-id:2119524529; mso-list-type:hybrid; mso-list-template-ids:1421618172 1265507632 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l6:level1 {mso-level-number-format:bullet; mso-level-text:\F0B7; mso-level-tab-stop:32.2pt; mso-level-number-position:left; margin-left:32.2pt; text-indent:-18.0pt; font-family:Symbol;} @list l6:level2 {mso-level-tab-stop:72.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l6:level3 {mso-level-tab-stop:108.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l6:level4 {mso-level-tab-stop:144.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l6:level5 {mso-level-tab-stop:180.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l6:level6 {mso-level-tab-stop:216.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l6:level7 {mso-level-tab-stop:252.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l6:level8 {mso-level-tab-stop:288.0pt; mso-level-number-position:left; text-indent:-18.0pt;} @list l6:level9 {mso-level-tab-stop:324.0pt; mso-level-number-position:left; text-indent:-18.0pt;} ol {margin-bottom:0pt;} ul {margin-bottom:0pt;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0pt 5.4pt 0pt 5.4pt; mso-para-margin:0pt; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman";} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="4098"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]--> </head> <body lang=EN-US link=blue vlink=purple style='tab-interval:36.0pt'> <div class=Section1> <h1><span lang=EN-GB style='mso-ansi-language:EN-GB'>Real-Time Smoke Simulation and Visualization<o:p></o:p></span></h1> <p class=MsoNormal><span lang=EN-GB style='font-size:18.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;color:blue;mso-ansi-language:EN-GB'> <o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'>1. Introduction<o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'><br> </span><span lang=EN-GB style='mso-ansi-language:EN-GB'>This directory contains the code for the Real-Time Smoke Simulation and Visualization assignment. The code contains a real-time simulation of matter which flows under the influence of a user-controlled force field. The simulation follows the <span class=SpellE>Navier</span>-Stokes equations for fluid flow. This document describes briefly how to compile the code and the structure of the main program. This is not intended as an in-depth description of how to write or compile programs in C or another programming language, OpenGL, event-based programming, or how to build a real-time fluid simulation engine. However, starting here, you should be able to compile the code and add visualization features to the provided skeleton application.<o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'> <o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'>2. Structure of the code:<o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'> <o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>The provided software consists of three main parts: <o:p></o:p></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-size: 14.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;mso-fareast-font-family: Symbol;mso-bidi-font-family:Symbol;mso-ansi-language:EN-GB'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=GramE><span lang=EN-GB style='mso-ansi-language:EN-GB'>a</span></span></span><span lang=EN-GB style='mso-ansi-language:EN-GB'> <i>mathematical library</i>, called FFTW (standing for Fastest Fourier Transform in the West), is used to provide the numerical engine that simulates a fluid flow in two dimensions.</span><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:12.0pt;font-family:Arial; mso-ansi-language:EN-GB'><o:p></o:p></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-size: 14.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;mso-fareast-font-family: Symbol;mso-bidi-font-family:Symbol;mso-ansi-language:EN-GB'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=GramE><span lang=EN-GB style='mso-ansi-language:EN-GB'>the</span></span></span><span lang=EN-GB style='mso-ansi-language:EN-GB'> <i>GLUT library</i> (GL Utility Toolkit), used to provide simple OpenGL graphics, mouse, and keyboard support to the application.</span><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'><o:p></o:p></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l1 level1 lfo2; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-size: 14.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;mso-fareast-font-family: Symbol;mso-bidi-font-family:Symbol;mso-ansi-language:EN-GB'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=GramE><span lang=EN-GB style='mso-ansi-language:EN-GB'>a</span></span></span><span lang=EN-GB style='mso-ansi-language:EN-GB'> very simple <i>application skeleton </i>which shows how to call the FFTW simulation code, steer it interactively using the mouse, and do some basic visualization and graphics, using GLUT.</span><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:12.0pt;font-family:Arial; mso-ansi-language:EN-GB'><o:p></o:p></span></p> <p class=MsoNormal style='margin-left:14.2pt'><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>All the code is written in the C programming language. Although it helps if you understand C, you should be able to rewrite the application skeleton to use the FFTW library from the programming language of your choice (e.g. Java, Python)<o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>The provided code is structured in the following main components (files and folders):<o:p></o:p></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l5 level1 lfo4; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-size: 14.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;mso-fareast-font-family: Symbol;mso-bidi-font-family:Symbol;mso-ansi-language:EN-GB'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span lang=EN-GB style='mso-ansi-language: EN-GB'>fftw-2.1.3:<span style='mso-tab-count:1'> </span>Contains the sources of the FFTW library</span></span><span lang=EN-GB style='font-size: 14.0pt;mso-bidi-font-size:12.0pt;font-family:Arial;mso-ansi-language:EN-GB'><o:p></o:p></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l5 level1 lfo4; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-size: 14.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;mso-fareast-font-family: Symbol;mso-bidi-font-family:Symbol;mso-ansi-language:EN-GB'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=SpellE><span lang=EN-GB style='mso-ansi-language:EN-GB'>fluids.c</span></span></span><span lang=EN-GB style='mso-ansi-language:EN-GB'>: <span style='mso-tab-count:2'> </span>The application skeleton which calls the FFTW library</span><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:12.0pt;font-family:Arial;mso-ansi-language: EN-GB'><o:p></o:p></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l5 level1 lfo4; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-size: 14.0pt;mso-bidi-font-size:12.0pt;font-family:Symbol;mso-fareast-font-family: Symbol;mso-bidi-font-family:Symbol;mso-ansi-language:EN-GB'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span lang=EN-GB style='mso-ansi-language: EN-GB'>GLUT:<span style='mso-tab-count:2'> </span>Contains the GLUT (GL Utility Toolkit) library</span></span><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:12.0pt;font-family:Arial;mso-ansi-language: EN-GB'><o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>There are some other less important files and folders. These will be described in the building instructions below.</span><span lang=EN-GB style='font-size:14.0pt; mso-bidi-font-size:12.0pt;font-family:Arial;mso-ansi-language:EN-GB'><o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'>3. Building the code<o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'> <o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>Let us first assume you have a C compiler installed (e.g. Microsoft Visual C++ Express Edition, or GNU <span class=SpellE>gcc</span>, both which are freely available). To build the application, you have to compile all C files in <b>fftw-2.1.3/fftw</b>, <b>fftw-2.1.3/rfftw</b>, and <span class=SpellE><b>fluids.c</b></span> in a single executable, and link with the <b>GLUT/glut32.lib</b>.<o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>If you have the Microsoft Visual C++ compiler, you can compile by simply opening the <span class=SpellE><b>Smoke.sln</b></span> solution file and building it – either in <span class=GramE>debug</span> or release mode.<o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>The following directories contain Visual C++ project-related files:<o:p></o:p></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l4 level1 lfo6; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span lang=EN-GB style='mso-ansi-language: EN-GB'>FFTW:<span style='mso-tab-count:2'> </span>Contains the project for building the FFTW library<o:p></o:p></span></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l4 level1 lfo6; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span lang=EN-GB style='mso-ansi-language: EN-GB'>Smoke: <span style='mso-tab-count:2'> </span>Contains the project for building the complete application<o:p></o:p></span></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l4 level1 lfo6; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=GramE><span lang=EN-GB style='mso-ansi-language:EN-GB'>library</span></span></span><span lang=EN-GB style='mso-ansi-language:EN-GB'>:<span style='mso-tab-count:2'> </span>Contains the FFTW static library <span class=SpellE>FFTW.lib</span> that the application is linked against.<br style='mso-special-character:line-break'> <![if !supportLineBreakNewLine]><br style='mso-special-character:line-break'> <![endif]><o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>The final application, <b>Smoke.exe</b>, is created in the top-level directory. Note that, to run it, you must have the GLUT library <b>glut32.dll </b>in the same location as the executable. This library is provided with the code.<o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>Of course, you can build the code using different C compilers.<o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'>4. Running the code<o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>Just run the <b>smoke.exe</b> application. You will get a text window showing some help messages and a graphic window. Select the graphic window. To control the simulation, click and drag the mouse. To change the visualization and/or simulation options, press use the indicated keys in the graphical window. After a bit of experimenting, you should be able to create some images like the ones shown below:<o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal align=center style='text-align:center'><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size:12.0pt;font-family:Arial;mso-ansi-language: EN-GB'><!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter"/> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"/> <v:f eqn="sum @0 1 0"/> <v:f eqn="sum 0 0 @1"/> <v:f eqn="prod @2 1 2"/> <v:f eqn="prod @3 21600 pixelWidth"/> <v:f eqn="prod @3 21600 pixelHeight"/> <v:f eqn="sum @0 0 1"/> <v:f eqn="prod @6 1 2"/> <v:f eqn="prod @7 21600 pixelWidth"/> <v:f eqn="sum @8 21600 0"/> <v:f eqn="prod @7 21600 pixelHeight"/> <v:f eqn="sum @10 21600 0"/> </v:formulas> <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/> <o:lock v:ext="edit" aspectratio="t"/> </v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" style='width:225.75pt; height:234pt'> <v:imagedata src="README_files/image001.png" o:title=""/> </v:shape><![endif]--><![if !vml]><img width=301 height=312 src="README_files/image002.jpg" border=0 v:shapes="_x0000_i1025"><![endif]><span style='mso-spacerun:yes'> </span><!--[if gte vml 1]><v:shape id="_x0000_i1026" type="#_x0000_t75" style='width:226.5pt;height:234.75pt'> <v:imagedata src="README_files/image003.png" o:title=""/> </v:shape><![endif]--><![if !vml]><img width=302 height=313 src="README_files/image004.jpg" border=0 v:shapes="_x0000_i1026"><![endif]><span style='mso-spacerun:yes'> </span><!--[if gte vml 1]><v:shape id="_x0000_i1027" type="#_x0000_t75" style='width:225pt;height:233.25pt'> <v:imagedata src="README_files/image005.png" o:title=""/> </v:shape><![endif]--><![if !vml]><img width=300 height=311 src="README_files/image006.jpg" border=0 v:shapes="_x0000_i1027"><![endif]><span style='mso-spacerun:yes'> </span><!--[if gte vml 1]><v:shape id="_x0000_i1028" type="#_x0000_t75" style='width:225pt;height:233.25pt'> <v:imagedata src="README_files/image007.png" o:title=""/> </v:shape><![endif]--><![if !vml]><img width=300 height=311 src="README_files/image008.jpg" border=0 v:shapes="_x0000_i1028"><![endif]></span><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'>5. The application <o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'> <o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>The main application is a single file, <span class=SpellE><b>fluids.c</b></span>. The structure of this file is described briefly below. See also the comments embedded in the source code. The purpose of these explanations is to help you understanding how you can start modifying the code, to add new visual functionality to it, or how you can start porting the code, if you want to write your assignment in a different programming language than C or C++.<o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>As a general note: Do not worry too much if you do not understand the numerical code. This is not the purpose of the assignment. You can use that code as a simulation ‘black-box’. The purpose is to focus on building new visualization methods atop of that simulation code.<o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>A list of the most important data structures and functions in the program follows. The functions are divided into three groups: simulation, visualization, and interaction. They are listed in inverse order of importance to the program’s functionality.<o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>Global data structures:<o:p></o:p></span></b></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l3 level1 lfo8; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=SpellE><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>plan_rc</span></b></span></span><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>, <span class=SpellE>plan_cr</span>:<span style='mso-tab-count:2'> </span></span></b><span lang=EN-GB style='mso-ansi-language:EN-GB'>The 2D uniform n*n grid on which the simulation takes place. The actual data type for these structures comes from the FFTW library – you do not have to use these directly.<b><o:p></o:p></b></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l3 level1 lfo8; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=SpellE><span class=GramE><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>fx</span></b></span></span></span><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>, <span class=SpellE>fy</span>:<span style='mso-tab-count:4'> </span></span></b><span lang=EN-GB style='mso-ansi-language:EN-GB'>The components of the 2D force vectors that drive (steer) the simulation. These are directly controlled by the user via the mouse.<b><o:p></o:p></b></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l3 level1 lfo8; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=GramE><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>rho,</span></b></span></span><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>rho0:<span style='mso-tab-count: 3'> </span></span></b><span lang=EN-GB style='mso-ansi-language:EN-GB'>The density of the matter which flows in. As the flow direction and speed changes, so does the density. See below.<b><o:p></o:p></b></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l3 level1 lfo8; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=GramE><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>vx,</span></b></span></span><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>vy,vx0,vy0:<span style='mso-tab-count: 3'> </span></span></b><span lang=EN-GB style='mso-ansi-language:EN-GB'>The components of the 2D velocity field which is simulated. The simulation computes <span class=SpellE><b>v<span class=GramE>,rho</span></b></span> (velocity and density) out of <b>v0,rho0</b> (their previous values one time-step ago) and <b>f</b> (the forces).<br> <span style='mso-spacerun:yes'> </span><span style='mso-tab-count:4'> </span>In a functional notation:<b><o:p></o:p></b></span></p> <p class=MsoNormal style='margin-left:14.2pt'><b><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></b></p> <p class=MsoNormal style='margin-left:158.2pt;text-indent:21.8pt'><span lang=EN-GB style='mso-ansi-language:EN-GB'>(<span class=SpellE><span class=GramE>vx</span></span>, <span class=SpellE>vy</span>, <span class=SpellE>rho</span>) = <span class=SpellE>do_one_simulation_<span class=GramE>step</span></span><span class=GramE>(</span>vx0, vy0, rho0, <span class=SpellE>fx</span>, <span class=SpellE>fy</span>) <span style='mso-tab-count:1'> </span><span style='mso-spacerun:yes'> </span><o:p></o:p></span></p> <p class=MsoNormal style='margin-left:158.2pt;text-indent:21.8pt'><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal style='margin-left:158.2pt;text-indent:21.8pt'><span class=GramE><span lang=EN-GB style='mso-ansi-language:EN-GB'>or</span></span><span lang=EN-GB style='mso-ansi-language:EN-GB'> in a more mathematical notation (bold denote vectors):<o:p></o:p></span></p> <p class=MsoNormal style='margin-left:158.2pt;text-indent:21.8pt'><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal style='margin-left:158.2pt;text-indent:21.8pt'><span lang=EN-GB style='mso-ansi-language:EN-GB'>(<span class=GramE><b>v</b></span> (<span class=SpellE>t+<span style='font-family:Symbol'>D</span>t</span>), <span class=SpellE>rho</span>(<span class=SpellE>t+<span style='font-family:Symbol'>D</span>t</span>)) = <span class=SpellE>do_one_simulation_<span class=GramE>step</span></span><span class=GramE>(</span><b>v</b>(t), <span class=SpellE>rho</span>(t), <b>f</b>(<span class=SpellE>t+<span style='font-family:Symbol'>D</span>t</span>))<o:p></o:p></span></p> <p class=MsoNormal><b><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></b></p> <p class=MsoNormal><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>Simulation functions:<o:p></o:p></span></b></p> <p class=MsoNormal><b><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></b></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l2 level1 lfo10; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=SpellE><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>do_one_simulation_step</span></b></span></span><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>:<span style='mso-tab-count:1'> </span></span></b><span lang=EN-GB style='mso-ansi-language:EN-GB'>Does one single step of the fluid flow simulation. This involves passing the mouse-controlled forces to the FFTW library, executing one simulation step to compute the new velocity and density values, and visualizing all these.<b><o:p></o:p></b></span></p> <p class=MsoNormal style='margin-left:180.0pt'><span lang=EN-GB style='mso-ansi-language:EN-GB'>This function is called repeatedly to keep on the simulation running forever. This is the <i>first</i> of the two functions calling the FFTW library.<o:p></o:p></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l2 level1 lfo10; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=GramE><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>solve</span></b></span></span><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>, <span class=SpellE>diffuse_matter</span>:</span></b><span lang=EN-GB style='mso-ansi-language:EN-GB'><span style='mso-spacerun:yes'> </span>These functions contain the actual numerical simulation code which computes <span class=SpellE>vx</span>, <span class=SpellE>vy</span>, <span class=SpellE>rho</span> out of vx0, vy0, rho0, and <span class=SpellE>fx</span>, <span class=SpellE>fy</span>.<b><o:p></o:p></b></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l2 level1 lfo10; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=SpellE><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>init_simulation</span></b></span></span><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>:<span style='mso-tab-count:2'> </span></span></b><span lang=EN-GB style='mso-ansi-language:EN-GB'>Initialize the various global data structures as function of the grid size. This is the <i>second</i> of the two functions calling the FFTW library.<b><o:p></o:p></b></span></p> <p class=MsoNormal><b><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></b></p> <p class=MsoNormal><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>Visualization functions:<o:p></o:p></span></b></p> <p class=MsoNormal><b><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></b></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l0 level1 lfo12; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=GramE><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>visualize</span></b></span></span><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>:<span style='mso-tab-count:3'> </span></span></b><span lang=EN-GB style='mso-ansi-language:EN-GB'>Contains all the visualization code which draws the velocities <span class=SpellE>vx,vy</span>, and the density <span class=SpellE>rho</span>. This is the main visualization function.<b><o:p></o:p></b></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l0 level1 lfo12; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=GramE><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>rainbow</span></b></span></span><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>:<span style='mso-tab-count:3'> </span></span></b><span lang=EN-GB style='mso-ansi-language:EN-GB'>Maps a floating-point value to a RGB <span class=SpellE>color</span> using a blue-to-red (rainbow) <span class=SpellE>colormap</span>.<b><o:p></o:p></b></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l0 level1 lfo12; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=SpellE><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>direction_to_color</span></b></span></span><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>:<span style='mso-tab-count:2'> </span></span></b><span lang=EN-GB style='mso-ansi-language:EN-GB'>Maps a vector’s direction to a RGB <span class=SpellE>color</span> using a directional hue-based <span class=SpellE>colormap</span>.<b><o:p></o:p></b></span></p> <p class=MsoNormal style='margin-left:14.2pt'><b><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></b></p> <p class=MsoNormal><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>Interaction functions:<o:p></o:p></span></b></p> <p class=MsoNormal><b><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p> </o:p></span></b></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l6 level1 lfo14; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=GramE><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>main</span></b></span></span><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>:<span style='mso-tab-count:4'> </span></span></b><span lang=EN-GB style='mso-ansi-language:EN-GB'>The main program. Prints some help messages and sets up GLUT to perform the display and interaction.<b><o:p></o:p></b></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l6 level1 lfo14; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=GramE><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>drag</span></b></span></span><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>:<span style='mso-tab-count:4'> </span></span></b><span lang=EN-GB style='mso-ansi-language:EN-GB'>Called when the user clicks-and-drags the mouse in the visualization window. This sets up the force (<span class=SpellE>fx<span class=GramE>,fy</span></span>) and density (<span class=SpellE>rho</span>) at the mouse location, effectively steering the simulation.<b><o:p></o:p></b></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l6 level1 lfo14; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=GramE><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>keyboard</span></b></span></span><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>:</span></b><span lang=EN-GB style='mso-ansi-language:EN-GB'><span style='mso-tab-count:3'> </span>Changes the simulation and visualization parameters based on keyboard input.<b><o:p></o:p></b></span></p> <p class=MsoNormal style='margin-left:32.2pt;text-indent:-18.0pt;mso-list:l6 level1 lfo14; tab-stops:list 32.2pt'><![if !supportLists]><span lang=EN-GB style='font-family: Symbol;mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol;mso-ansi-language: EN-GB;mso-bidi-font-weight:bold'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span dir=LTR><span class=GramE><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>display</span></b></span></span><b><span lang=EN-GB style='mso-ansi-language:EN-GB'>:</span></b><span lang=EN-GB style='mso-ansi-language:EN-GB'> <span style='mso-tab-count:3'> </span>Draws a new visualization frame, whenever the simulation is ready with producing a new step.<b><o:p></o:p></b></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'>6. Further reading<o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;font-family:Arial;mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='mso-ansi-language:EN-GB'>If you are interested to study the above topics in more depth, there is additional documentation in the fftw-2.1.3 directory on the FFTW library implementation. The overall simulation algorithm is described in the paper “A Simple Fluid Solver based on the FFT” by <span class=SpellE>Jos</span> <span class=SpellE>Stam</span> (Journal of Graphics Tools, volume 6, number 2, 2001, pages 43-52). You can find the paper online e.g. at <a href="http://www.dgp.utoronto.ca/people/stam/reality/Research/pub.html">http://www.dgp.utoronto.ca/people/stam/reality/Research/pub.html</a> or other sites (Google for it).<o:p></o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;mso-ansi-language:EN-GB'><o:p> </o:p></span></p> <p class=MsoNormal><span lang=EN-GB style='font-size:14.0pt;mso-bidi-font-size: 12.0pt;mso-ansi-language:EN-GB'><o:p> </o:p></span></p> </div> </body> </html>
graphics-smoke's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.