/v5.5.x/first_run.html
HTML | 268 lines | 256 code | 11 blank | 1 comment | 0 complexity | 78229a2b4d0dcb76ed2644d583d0f0bd MD5 | raw file
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta charset="utf-8" />
- <title>Running an example — Clawpack 5.5.0 documentation</title>
- <link rel="stylesheet" href="_static/flasky.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
- <link rel="stylesheet" href="_static/base.css" type="text/css" />
- <link rel="stylesheet" href="_static/layout.css" type="text/css" />
- <link rel="stylesheet" type="text/css" href="_static/graphviz.css" />
- <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
- <script src="_static/jquery.js"></script>
- <script src="_static/underscore.js"></script>
- <script src="_static/doctools.js"></script>
- <script src="_static/language_data.js"></script>
- <script async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
- <link rel="shortcut icon" href="_static/clawicon.ico"/>
- <link rel="author" title="About these documents" href="about.html" />
- <link rel="index" title="Index" href="genindex.html" />
- <link rel="search" title="Search" href="search.html" />
- <link rel="next" title="Clawpack components" href="clawpack_components.html" />
- <link rel="prev" title="Set environment variables" href="setenv.html" />
- </head><body>
- <div id="main-wrapper" class="sphinx">
- <div id="header-wrapper">
- <section id="header">
- <!-- <h1><a href="http://clawpack.org/">Clawpack</a></h1> -->
- <h1><a href="http://clawpack.org/">Clawpack-5</a></h1>
- <nav>
- <ul>
- <li>
- <a href="contents.html">Docs</a>
- </li>
- <li>
- <a href="installing.html">Install</a>
- </li>
- <li>
- <a class="" href="http://clawpack.org/gallery/index.html">Gallery</a>
- </li>
- <li>
- <a href="about.html">Citation</a>
- </li>
- <li>
- <a class="active" href="http://github.com/clawpack">GitHub</a>
- </li>
- <li>
- <a class="" href="community.html">Community</a>
- </li>
- <li>
- <a class="" href="developers.html">Contribute</a>
- </li>
- </ul>
- </nav>
- </section>
- <div class="decoration"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="clawpack_components.html" title="Clawpack components"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="setenv.html" title="Set environment variables"
- accesskey="P">previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="contents.html">Clawpack 5.5.0 documentation</a> »</li>
- </ul>
- </div>
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="running-an-example">
- <span id="first-run"></span><h1>Running an example<a class="headerlink" href="#running-an-example" title="Permalink to this headline">¶</a></h1>
- <p>Many examples of Clawpack simulations can be seen in the <span class="xref std std-ref">galleries</span>.</p>
- <p>See also <span class="xref std std-ref">first_tests</span>.</p>
- <div class="section" id="pyclaw">
- <h2>PyClaw<a class="headerlink" href="#pyclaw" title="Permalink to this headline">¶</a></h2>
- <p>To run an example and plot the results using PyClaw, simply do the following
- (starting from your <cite>clawpack</cite> directory):</p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cd</span> <span class="n">pyclaw</span><span class="o">/</span><span class="n">examples</span><span class="o">/</span><span class="n">euler_2d</span>
- <span class="n">python</span> <span class="n">shock_bubble_interaction</span><span class="o">.</span><span class="n">py</span> <span class="n">iplot</span><span class="o">=</span><span class="mi">1</span>
- </pre></div>
- </div>
- <p>That’s it. For next steps with PyClaw, see <a class="reference internal" href="pyclaw/basics.html#basics"><span class="std std-ref">PyClaw Basics</span></a>.</p>
- </div>
- <div class="section" id="classic">
- <h2>Classic<a class="headerlink" href="#classic" title="Permalink to this headline">¶</a></h2>
- <p>First ensure that you have <a class="reference internal" href="setenv.html#setenv"><span class="std std-ref">Set environment variables</span></a>
- and that you have the <span class="xref std std-ref">install_prerequisites</span>.</p>
- <p>A simple 1-dimensional acoustics equations can be solved
- using the code in <a class="reference external" href="_static/classic/examples/acoustics_1d_example1/README.html">$CLAW/classic/examples/acoustics_1d_example1</a>, as
- illustrated in <span class="xref std std-ref">gallery_classic_amrclaw</span>.</p>
- <p>Move to this directory via:</p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>cd $CLAW/classic/examples/acoustics_1d_example1
- </pre></div>
- </div>
- <p>You can try the following test in this directory, or you may want to first
- make a copy of it (see the instructions in <a class="reference internal" href="newapp.html#copyex"><span class="std std-ref">Copying an existing example</span></a>).</p>
- <p>The Makefiles are set up to do dependency checking so that in many
- application directories you can simply type:</p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ make .plots
- </pre></div>
- </div>
- <p>and the Fortran code will be compiled, data files created, the code
- run, and the results plotted automatically, resulting in a set of webpages
- showing the results.</p>
- <p>However, if this is your first attempt to run a code, it is useful to go
- through these steps one at a time, both to understand the steps and so that
- any problems with your installation can be properly identified.</p>
- <p>You might want to start by examining the Makefile. This sets a number of
- variables, which at some point you might need to modify for other examples,
- see <a class="reference internal" href="makefiles.html#makefiles"><span class="std std-ref">Clawpack Makefiles</span></a> for more about this. At the bottom of the Makefile is
- an <cite>include</cite> statement that points to a common Makefile that is used by most
- applications, and where all the details of the make process can be found.</p>
- <p>To compile the code, type:</p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ make .exe
- </pre></div>
- </div>
- <p>If this gives an error, see <a class="reference internal" href="trouble.html#trouble-makeexe"><span class="std std-ref">Trouble running “make .exe”</span></a>.</p>
- <p>This should compile the example code (after first compiling the required
- library routines) and produce an executable named <cite>xclaw</cite> in this directory.</p>
- <p>Before running the code, it is necessary to also create a set of data files
- that are read in by the Fortran code. This can be done via:</p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ make .data
- </pre></div>
- </div>
- <p>If this gives an error, see <a class="reference internal" href="trouble.html#trouble-makedata"><span class="std std-ref">Trouble running “make .data”</span></a>.</p>
- <p>This uses the Python code in <cite>setrun.py</cite> to create data files that have the
- form <cite>*.data</cite>.</p>
- <p>Once the executable and the data files all exist, we can run the code. The
- recommended way to do this is to type:</p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ make .output
- </pre></div>
- </div>
- <p>If this gives an error, see <a class="reference internal" href="trouble.html#trouble-makeoutput"><span class="std std-ref">Trouble running “make .output”</span></a>.</p>
- <p>Before running the code a subdirectory <cite>_output</cite> is created
- and the output of the code (often a large number of files) is directed to
- this subdirectory. This is convenient if you want to do several runs with
- different parameter values and keep the results organized. After the code
- has run you can rename the subdirectory, or you can modify the variable
- <cite>OUTDIR</cite> in the Makefile to direct results to a different directory. See
- <a class="reference internal" href="makefiles.html#makefiles"><span class="std std-ref">Clawpack Makefiles</span></a> for more details. Copies of all the data files are also
- placed in the output directory for future reference.</p>
- <p><strong>Plotting the results.</strong>
- Once the code has run and the files listed above have been created, there are several
- options for plotting the results.</p>
- <p>To try the Python tools, type:</p>
- <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ make .plots
- </pre></div>
- </div>
- <p>If this gives an error, see <a class="reference internal" href="trouble.html#trouble-makeplots"><span class="std std-ref">Trouble running “make .plots”</span></a>.</p>
- <p>If this works, it will create a subdirectory named <cite>_plots</cite> that contains a number of
- image files (the <cite>*.png</cite> files) and a set of html files that can be used to view the
- results from a web browser. See <span class="xref std std-ref">plotting_makeplots</span> for more details.</p>
- <p>An alternative is to view the plots from an interactive Python session, as described in
- the section <a class="reference internal" href="plotting_python.html#plotting-iplotclaw"><span class="std std-ref">Interactive plotting with Iplotclaw</span></a>.</p>
- <p>If you wish to use Matlab instead, see <a class="reference internal" href="matlab_plotting.html#matlabplots"><span class="std std-ref">Plotting using Matlab</span></a>.</p>
- <p>Other visualization packages could also be used to display the results, but you will need
- to figure out how to read in the data. See <span class="xref std std-ref">fortfiles</span> for information about the
- format of the files produced by Clawpack.</p>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <p><a href="http://clawpack.org/">
- <img class="logo" src= "_static/clawlogo.jpg" alt="Logo"/>
- </a>
- <h2>Version 5.5.0</h2>
- </p>
- <h3><a href="contents.html">Table of Contents</a></h3>
- <ul>
- <li><a class="reference internal" href="#">Running an example</a><ul>
- <li><a class="reference internal" href="#pyclaw">PyClaw</a></li>
- <li><a class="reference internal" href="#classic">Classic</a></li>
- </ul>
- </li>
- </ul>
- <h3>Related Topics</h3>
- <ul>
- <li><a href="contents.html">Documentation overview</a><ul>
- <li>Previous: <a href="setenv.html" title="previous chapter">Set environment variables</a></li>
- <li>Next: <a href="clawpack_components.html" title="next chapter">Clawpack components</a></li>
- </ul></li>
- </ul>
- <div class="widget navlinks">
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="_sources/first_run.rst.txt"
- rel="nofollow"
- target="_blank">Source .rst</a></li>
- <li><a href="https://github.com/clawpack/doc/blob/dev/doc/first_run.rst"
- rel="nofollow"
- target="_blank">Source on GitHub</a></li>
- <li><a href="https://github.com/clawpack/doc/commits/dev/doc/first_run.rst"
- rel="nofollow"
- target="_blank">History</a></li>
- <li><a href="https://github.com/clawpack/doc/edit/dev/doc/first_run.rst"
- rel="nofollow"
- target="_blank">Suggest Edits</a></li>
- <li><a href="https://github.com/clawpack/doc/issues/new/choose"
- rel="nofollow"
- target="_blank">Raise an Issue</a></li>
- </ul>
- </div>
- <div id="searchbox" style="display: none" role="search">
- <h3 id="searchlabel">Quick search</h3>
- <div class="searchformwrapper">
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" aria-labelledby="searchlabel" />
- <input type="submit" value="Go" />
- </form>
- </div>
- </div>
- <script>$('#searchbox').show(0);</script>
- <h4>Latest Version</h4>
- <ul>
- <li><a href="../dev/first_run.html">dev</a></li>
- <li><a href="../v5.8.x/first_run.html">v5.8.x</a></li>
- </ul>
- <h4>Older Versions</h4>
- <ul>
- <li><a href="../v5.1.x/first_run.html">v5.1.x</a></li>
- <li><a href="../v5.2.x/first_run.html">v5.2.x</a></li>
- <li><a href="../v5.3.x/first_run.html">v5.3.x</a></li>
- <li><a href="../v5.4.x/first_run.html">v5.4.x</a></li>
- <li><a href="first_run.html">v5.5.x</a></li>
- <li><a href="../v5.6.x/first_run.html">v5.6.x</a></li>
- <li><a href="../v5.7.x/first_run.html">v5.7.x</a></li>
- </ul>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="footer">
- © Copyright CC-BY 2020, The Clawpack Development Team.
- Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
- </div>
- <script>
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
- ga('create', 'UA-44811544-1', 'auto');
- ga('send', 'pageview');
- </script>
-
- </body>
- </html>