<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <journal-title-group>
        <journal-title>Steffen Weißmann. Schrödi
smoke. // Journal ACM Transactions on Graphics (TOG) Vol. 35 Issue 4</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>GPGPU IMPLEMENTATION OF SCHRÖDINGER'S SMOKE FOR UNITY3D</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Oleg Iakushkin</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Anastasia Iashnikova</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Olga Sedova</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Saint Petersburg State University</institution>
          ,
          <addr-line>7/9 Universitetskaya nab., St. Petersburg, 199034</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2018</year>
      </pub-date>
      <volume>35</volume>
      <issue>4</issue>
      <fpage>467</fpage>
      <lpage>469</lpage>
      <abstract>
        <p>The paper describes an algorithm for Eulerian simulation of incompressible fluids - Schrödinger's Smoke. The algorithm is based on representing models as a system of particles. Each particle represents a small portion of a fluid or amorphous material. A particle has a certain 'lifespan', during which it may undergo various changes. The Schrdöinger's Smoke solver algorithm was im plemented in Unity3D environment. We used ArrayFire library to transfer the bulk of computational load relating to simulation of physical processes to GPGPU - it allowed real-time interaction with the model. The solution we developed allows to model interactions between vortex rings - i.e., their collisions and overlapping - with a high degree of physical accuracy.</p>
      </abstract>
      <kwd-group>
        <kwd>particle system</kwd>
        <kwd>GPGPU</kwd>
        <kwd>Unity3D</kwd>
        <kwd>ArrayFire</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>2. Approach</title>
      <p>We examined the work on Schrödinger’s Smoke [1] that demonstrates a new approach to
modelling Eulerian incompressible fluids. We transferred its algorithm to the multi-platform Unity3D
development environment using ArrayFire, a library for transferring computing to GPGPU.</p>
      <p>Initially, we wanted to use the Compute Shader technology available in Unity3D as the main
computational tool in order to transfer most of the algorithm calculations to the GPGPU. However, we
had to abandon this idea because Compute Shader turns out to be unreasonably complicated when it
comes to working with the FFT and IFFT methods for three-dimensional arrays of points in a complex
space. To solve the problem, we chose the ArrayFire cross-platform library—it limited our ability to
compile a Unity3D project for WebGL and mobile platforms, but still allowed to target Mac OS,
Linux and Windows that support OpenCL, CPU and CUDA backends.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Implementation Details</title>
      <p>We used two main frameworks to implement our idea:
• Unity3D — a cross-platform engine that provides Shuriken programmable particle
control system;</p>
      <p>• ArrayFire — a library for accelerated computation of mathematical operations that supports
parallel computing on various GPGPU coprocessors.</p>
      <sec id="sec-3-1">
        <title>3.1. Particle System</title>
        <p>We used the Unity3D Particle System component to visualize the results of the Schrödinger’s
Smoke algorithm.</p>
        <p>The particle system is a method used in computer graphics and interactive simulations to
represent objects that do not have clear geometric boundaries. This makes it possible to create
practically any type of natural effects—e.g., explosions, jets of steam, nebulae, rain, snow, water
splashes, fire smoke, etc.</p>
        <p>The particle system controls groups of particles—that is, small flat images or mesh objects.
Any particle has a certain ‘lifetime’ (usually a few seconds) during which the particle may undergo
various changes.</p>
      </sec>
      <sec id="sec-3-2">
        <title>3.2. ArrayFire Library</title>
        <p>The ArrayFire library provides a simplified interface that allows to run different mathematical
computations in parallel on various GPU devices. It is an open source universal computing tool that
facilitates the development of software for parallel and massively parallel architectures, including
processors, graphics processors, and other hardware accelerators.</p>
        <p>The library has a number of features that are important for our task:
 its basic implementation in C, C ++, and CUDA has a c # shutter;



it integrates and extends many mathematical methods available in CUDA and
OpenCL, including FFT, BLAS and LAPACK implementations, as well as signal and
image processing;
it speeds up code development by allowing to replace a large number of code lines in
CUDA or OpenCL with just a few lines of the ArrayFire code;
it allows author to choose the platform where the calculations are performed by
providing CUDA, OpenCL and CPU implementations for most of its mathematical
methods;</p>
        <p>it supports manipulation of vectors, matrices and three-dimensional arrays.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Our GPGPU Implementation Speed-Up</title>
      <p>We implemented the Schrödinger's Smoke algorithm and tested it on CPU and GPU.</p>
      <p>The test results shown in Figure 1 demonstrate that the Schrdöinger's Smoke algorithm can be
accelerated even for the use on embedded GPUs without any drastic modifications of its logic.</p>
    </sec>
    <sec id="sec-5">
      <title>5. Acknowledgement</title>
      <p>This research was supported by SPbU (Saint Petersburg State University) grant no.
AAAAA18-118071790047-9 (id: 28612502). The authors would like to acknowledge the reviewers for the
valuable recommendations that helped improve this paper.</p>
    </sec>
    <sec id="sec-6">
      <title>6. Conclusion References</title>
      <p>
        We developed a solution that allows us to simulate particle systems with high physical
accuracy using real-time GPGPU technologies. This solution makes it possible to simulate the
interaction of two vortex rings—their collisions and intersections. In future work, we will test our
implementation on a supercomputing system and further refine its performance. We will also integrate
our current results into an archaeological modelling project [
        <xref ref-type="bibr" rid="ref1">2, 3</xref>
        ].
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Iakushkin</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fatkina</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Plaksin</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sedova</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Degtyarev</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Uteshev</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          /
          <article-title>Reconstruction of stone walls in form of polygonal meshes from archaeological studies</article-title>
          .
          <source>Lecture Notes in Computer Science</source>
          , Springer,
          <year>2018</year>
          , Vol.
          <volume>10963</volume>
          , pp.
          <fpage>136</fpage>
          -
          <lpage>148</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>