forked from python-hydro/pyro2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpaper.tex
More file actions
391 lines (336 loc) · 14.1 KB
/
Copy pathpaper.tex
File metadata and controls
391 lines (336 loc) · 14.1 KB
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
\documentclass[10pt,a4paper,onecolumn]{article}
\usepackage{marginnote}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{authblk,etoolbox}
\usepackage{titlesec}
\usepackage{calc}
\usepackage{tikz}
\usepackage{hyperref}
\hypersetup{colorlinks,breaklinks,
urlcolor=[rgb]{0.0, 0.5, 1.0},
linkcolor=[rgb]{0.0, 0.5, 1.0}}
\usepackage{caption}
\usepackage{tcolorbox}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{seqsplit}
\usepackage{xstring}
\usepackage{fixltx2e} % provides \textsubscript
\usepackage[
backend=biber,
% style=alphabetic,
% citestyle=numeric
]{biblatex}
\bibliography{paper.bib}
% --- Splitting \texttt --------------------------------------------------
\let\textttOrig=\texttt
\def\texttt#1{\expandafter\textttOrig{\seqsplit{#1}}}
\renewcommand{\seqinsert}{\ifmmode
\allowbreak
\else\penalty6000\hspace{0pt plus 0.02em}\fi}
% --- Pandoc does not distinguish between links like [foo](bar) and
% --- [foo](foo) -- a simplistic Markdown model. However, this is
% --- wrong: in links like [foo](foo) the text is the url, and must
% --- be split correspondingly.
% --- Here we detect links \href{foo}{foo}, and also links starting
% --- with https://doi.org, and use path-like splitting (but not
% --- escaping!) with these links.
% --- Another vile thing pandoc does is the different escaping of
% --- foo and bar. This may confound our detection.
% --- This problem we do not try to solve at present, with the exception
% --- of doi-like urls, which we detect correctly.
\makeatletter
\let\href@Orig=\href
\def\href@Urllike#1#2{\href@Orig{#1}{\begingroup
\def\Url@String{#2}\Url@FormatString
\endgroup}}
\def\href@Notdoi#1#2{\def\tempa{#1}\def\tempb{#2}%
\ifx\tempa\tempb\relax\href@Urllike{#1}{#2}\else
\href@Orig{#1}{#2}\fi}
\def\href#1#2{%
\IfBeginWith{#1}{https://doi.org}%
{\href@Urllike{#1}{#2}}{\href@Notdoi{#1}{#2}}}
\makeatother
% --- Page layout -------------------------------------------------------------
\usepackage[top=3.5cm, bottom=3cm, right=1.5cm, left=1.0cm,
headheight=2.2cm, reversemp, includemp, marginparwidth=4.5cm]{geometry}
% --- Default font ------------------------------------------------------------
% \renewcommand\familydefault{\sfdefault}
% --- Style -------------------------------------------------------------------
\renewcommand{\bibfont}{\small \sffamily}
\renewcommand{\captionfont}{\small\sffamily}
\renewcommand{\captionlabelfont}{\bfseries}
% --- Section/SubSection/SubSubSection ----------------------------------------
\titleformat{\section}
{\normalfont\sffamily\Large\bfseries}
{}{0pt}{}
\titleformat{\subsection}
{\normalfont\sffamily\large\bfseries}
{}{0pt}{}
\titleformat{\subsubsection}
{\normalfont\sffamily\bfseries}
{}{0pt}{}
\titleformat*{\paragraph}
{\sffamily\normalsize}
% --- Header / Footer ---------------------------------------------------------
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
%\renewcommand{\headrulewidth}{0.50pt}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[L]{\hspace{-0.75cm}\includegraphics[width=5.5cm]{joss-logo.png}}
\fancyhead[C]{}
\fancyhead[R]{}
\renewcommand{\footrulewidth}{0.25pt}
\fancyfoot[L]{\parbox[t]{0.98\headwidth}{\footnotesize{\sffamily Harpole et al., (2019). pyro: a framework for hydrodynamics explorations and prototyping. \textit{Journal of Open Source Software}, 4(34), 1265. \url{https://doi.org/10.21105/joss.01265}}}}
\fancyfoot[R]{\sffamily \thepage}
\makeatletter
\let\ps@plain\ps@fancy
\fancyheadoffset[L]{4.5cm}
\fancyfootoffset[L]{4.5cm}
% --- Macros ---------
\definecolor{linky}{rgb}{0.0, 0.5, 1.0}
\newtcolorbox{repobox}
{colback=red, colframe=red!75!black,
boxrule=0.5pt, arc=2pt, left=6pt, right=6pt, top=3pt, bottom=3pt}
\newcommand{\ExternalLink}{%
\tikz[x=1.2ex, y=1.2ex, baseline=-0.05ex]{%
\begin{scope}[x=1ex, y=1ex]
\clip (-0.1,-0.1)
--++ (-0, 1.2)
--++ (0.6, 0)
--++ (0, -0.6)
--++ (0.6, 0)
--++ (0, -1);
\path[draw,
line width = 0.5,
rounded corners=0.5]
(0,0) rectangle (1,1);
\end{scope}
\path[draw, line width = 0.5] (0.5, 0.5)
-- (1, 1);
\path[draw, line width = 0.5] (0.6, 1)
-- (1, 1) -- (1, 0.6);
}
}
% --- Title / Authors ---------------------------------------------------------
% patch \maketitle so that it doesn't center
\patchcmd{\@maketitle}{center}{flushleft}{}{}
\patchcmd{\@maketitle}{center}{flushleft}{}{}
% patch \maketitle so that the font size for the title is normal
\patchcmd{\@maketitle}{\LARGE}{\LARGE\sffamily}{}{}
% patch the patch by authblk so that the author block is flush left
\def\maketitle{{%
\renewenvironment{tabular}[2][]
{\begin{flushleft}}
{\end{flushleft}}
\AB@maketitle}}
\makeatletter
\renewcommand\AB@affilsepx{ \protect\Affilfont}
%\renewcommand\AB@affilnote[1]{{\bfseries #1}\hspace{2pt}}
\renewcommand\AB@affilnote[1]{{\bfseries #1}\hspace{3pt}}
\renewcommand{\affil}[2][]%
{\newaffiltrue\let\AB@blk@and\AB@pand
\if\relax#1\relax\def\AB@note{\AB@thenote}\else\def\AB@note{#1}%
\setcounter{Maxaffil}{0}\fi
\begingroup
\let\href=\href@Orig
\let\texttt=\textttOrig
\let\protect\@unexpandable@protect
\def\thanks{\protect\thanks}\def\footnote{\protect\footnote}%
\@temptokena=\expandafter{\AB@authors}%
{\def\\{\protect\\\protect\Affilfont}\xdef\AB@temp{#2}}%
\xdef\AB@authors{\the\@temptokena\AB@las\AB@au@str
\protect\\[\affilsep]\protect\Affilfont\AB@temp}%
\gdef\AB@las{}\gdef\AB@au@str{}%
{\def\\{, \ignorespaces}\xdef\AB@temp{#2}}%
\@temptokena=\expandafter{\AB@affillist}%
\xdef\AB@affillist{\the\@temptokena \AB@affilsep
\AB@affilnote{\AB@note}\protect\Affilfont\AB@temp}%
\endgroup
\let\AB@affilsep\AB@affilsepx
}
\makeatother
\renewcommand\Authfont{\sffamily\bfseries}
\renewcommand\Affilfont{\sffamily\small\mdseries}
\setlength{\affilsep}{1em}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\else % if luatex or xelatex
\ifxetex
\usepackage{mathspec}
\else
\usepackage{fontspec}
\fi
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
\fi
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
% use microtype if available
\IfFileExists{microtype.sty}{%
\usepackage{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\usepackage{hyperref}
\hypersetup{unicode=true,
pdftitle={pyro: a framework for hydrodynamics explorations and prototyping},
pdfborder={0 0 0},
breaklinks=true}
\urlstyle{same} % don't use monospace font for urls
% --- We redefined \texttt, but in sections and captions we want the
% --- old definition
\let\addcontentslineOrig=\addcontentsline
\def\addcontentsline#1#2#3{\bgroup
\let\texttt=\textttOrig\addcontentslineOrig{#1}{#2}{#3}\egroup}
\let\markbothOrig\markboth
\def\markboth#1#2{\bgroup
\let\texttt=\textttOrig\markbothOrig{#1}{#2}\egroup}
\let\markrightOrig\markright
\def\markright#1{\bgroup
\let\texttt=\textttOrig\markrightOrig{#1}\egroup}
\usepackage{graphicx,grffile}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{0}
% Redefines (sub)paragraphs to behave more like sections
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi
\title{pyro: a framework for hydrodynamics explorations and prototyping}
\author[1]{Alice Harpole}
\author[1]{Michael Zingale}
\author[2]{Ian Hawke}
\author[3]{Taher Chegini}
\affil[1]{Department of Physics and Astronomy, Stony Brook University}
\affil[2]{University of Southampton}
\affil[3]{University of Houston}
\date{\vspace{-5ex}}
\begin{document}
\maketitle
\marginpar{
%\hrule
\sffamily\small
{\bfseries DOI:} \href{https://doi.org/10.21105/joss.01265}{\color{linky}{10.21105/joss.01265}}
\vspace{2mm}
{\bfseries Software}
\begin{itemize}
\setlength\itemsep{0em}
\item \href{https://github.com/openjournals/joss-reviews/issues/588}{\color{linky}{Review}} \ExternalLink
\item \href{https://github.com/python-hydro/pyro2}{\color{linky}{Repository}} \ExternalLink
\item \href{http://dx.doi.org/10.5281/zenodo.2575565}{\color{linky}{Archive}} \ExternalLink
\end{itemize}
\vspace{2mm}
{\bfseries Submitted:} 15 February 2019\\
{\bfseries Published:} 22 March 2019
\vspace{2mm}
{\bfseries License}\\
Authors of papers retain copyright and release the work under a Creative Commons Attribution 4.0 International License (\href{http://creativecommons.org/licenses/by/4.0/}{\color{linky}{CC-BY}}).
}
\section{Summary}\label{summary}
\texttt{pyro} is a Python-based simulation framework designed for ease
of implementation and exploration of hydrodynamics methods. It is built
in a object-oriented fashion, allowing for the reuse of the core
components and fast prototyping of new methods.
The original goal of \texttt{pyro} was to learn hydrodynamics methods
through example, and it still serves this goal. At Stony Brook,
\texttt{pyro} is used with new undergraduate researchers in our group to
introduce them to the ideas of computational hydrodynamics. But the
current framework has evolved to the point where \texttt{pyro} is used
for prototyping hydrodynamics solvers before implementing them into
science codes. An example of this is the 4th-order compressible solver
built on the ideas of spectral deferred corrections (the
\texttt{compressible\_sdc} solver). This implementation was used as the
model for the development of higher-order schemes in the Castro
hydrodynamics code (Almgren et al. 2010). The low Mach number
atmospheric solver (\texttt{lm\_atm}) is based on the Maestro code
(Nonaka et al. 2010) and the \texttt{pyro} implementation will be used
to prototype new low Mach number algorithms before porting them to
science codes.
In the time since the first \texttt{pyro} paper (Zingale 2014), the code
has undergone considerable development, gained a large number of
solvers, adopted unit testing through pytest and documentation through
sphinx, and a number of new contributors. \texttt{pyro}'s functionality
can now be accessed directly through a \texttt{Pyro()} class, in
addition to the original commandline script interface. This new
interface in particular allows for easy use within Jupyter notebooks. We
also now use HDF5 for output instead of Python's \texttt{pickle()}
function. Previously, we used Fortran to speed up some
performance-critical portions of the code. These routines could be
called by the main Python code by first compiling them using
\texttt{f2py}. In the new version, we have replaced these Fortran
routines by Python functions that are compiled at runtime by
\texttt{numba}. Consequently, \texttt{pyro} is now written entirely in
Python.
The current \texttt{pyro} solvers are:
\begin{itemize}
\item
linear advection (including a second-order unsplit CTU scheme, a
method-of-lines piecewise linear solver\(^\star\), a 4th-order
finite-volume scheme\(^\star\), a WENO method\(^\star\), and advection
with a non-uniform velocity field\(^\star\))
\item
compressible hydrodynamics (including a second-order unsplit CTU
scheme, a method-of-lines piecewise linear solver\(^\star\), and two
4th-order finite-volume schemes, one with Runge-Kutta integration and
the other using a spectral deferred corrections method\(^\star\))
\item
diffusion using a second-order implicit discretization
\item
incompressible hydrodynamics using a second-order approximate
projection method.
\item
low Mach number atmospheric solver\(^\star\), using an approximate
projection method.
\item
shallow water equations solver\(^\star\)
\end{itemize}
(solvers since the first \texttt{pyro} paper are marked with a
\(^\star\)). Also, new is support for Lagrangian tracer particles, which
can be added to any solver that has a velocity field.
\section{Acknowledgements}\label{acknowledgements}
The work at Stony Brook was supported by DOE/Office of Nuclear Physics
grant DE-FG02-87ER40317 and DOE grant DE-SC0017955.
\section*{References}\label{references}
\addcontentsline{toc}{section}{References}
\hypertarget{refs}{}
\hypertarget{ref-castro}{}
Almgren, A. S., V. E. Beckner, J. B. Bell, M. S. Day, L. H. Howell, C.
C. Joggerst, M. J. Lijewski, A. Nonaka, M. Singer, and M. Zingale. 2010.
``CASTRO: A New Compressible Astrophysical Solver. I. Hydrodynamics and
Self-gravity.'' \emph{Astrophysical Journal} 715 (June): 1221--38.
doi:\href{https://doi.org/10.1088/0004-637X/715/2/1221}{10.1088/0004-637X/715/2/1221}.
\hypertarget{ref-maestro}{}
Nonaka, A., A. S. Almgren, J. B. Bell, M. J. Lijewski, C. M. Malone, and
M. Zingale. 2010. ``MAESTRO: An Adaptive Low Mach Number Hydrodynamics
Algorithm for Stellar Flows.'' \emph{Astrophysical Journal Supplement}
188 (June): 358--83.
doi:\href{https://doi.org/10.1088/0067-0049/188/2/358}{10.1088/0067-0049/188/2/358}.
\hypertarget{ref-pyroI}{}
Zingale, M. 2014. ``pyro: A teaching code for computational
astrophysical hydrodynamics.'' \emph{Astronomy and Computing} 6
(October): 52--62.
doi:\href{https://doi.org/10.1016/j.ascom.2014.07.003}{10.1016/j.ascom.2014.07.003}.
\end{document}