-
Notifications
You must be signed in to change notification settings - Fork 7
/
first_run.html
270 lines (257 loc) · 13.7 KB
/
first_run.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<title>Running an example — Clawpack 5.10.x documentation</title>
<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/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/flasky.css" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></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.10.x documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">Running an example</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<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 heading">¶</a></h1>
<p>Many examples of Clawpack simulations can be seen in the <a class="reference internal" href="galleries.html#galleries"><span class="std std-ref">Clawpack Gallery</span></a>.</p>
<p>See also <span class="xref std std-ref">first_tests</span>.</p>
<section id="pyclaw">
<h2>PyClaw<a class="headerlink" href="#pyclaw" title="Permalink to this heading">¶</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>
</section>
<section id="classic">
<h2>Classic<a class="headerlink" href="#classic" title="Permalink to this heading">¶</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="https://www.clawpack.org/gallery/_static/classic/examples/acoustics_1d_example1/README.html">$CLAW/classic/examples/acoustics_1d_example1</a>, as
illustrated in the <a class="reference external" href="https://www.clawpack.org/gallery/gallery/gallery_classic_amrclaw.html">Gallery of Classic and AMRClaw applications</a></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>
</section>
</section>
<div class="clearer"></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.10.x</h2>
</p>
<div>
<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>
</div><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" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>document.getElementById('searchbox').style.display = "block"</script>
<h4>Latest Version</h4>
<ul>
<li><a href="./dev/first_run.html">dev</a></li>
<li><a href="first_run.html">v5.10.x</a></li>
</ul>
<h4>Older Versions</h4>
<ul>
<li><a href="./v5.7.x/first_run.html">v5.7.x</a></li>
<li><a href="./v5.8.x/first_run.html">v5.8.x</a></li>
<li><a href="./v5.9.x/first_run.html">v5.9.x</a></li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
© Copyright CC-BY 2024, 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>