fargopy 0.4.0__py3-none-any.whl → 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fargopy/__init__.py +8 -346
- fargopy/base.py +377 -0
- fargopy/bin/ifargopy +91 -0
- fargopy/bin/vfargopy +2111 -0
- fargopy/data/fargopy_logo.png +0 -0
- fargopy/fields.py +1400 -415
- fargopy/flux.py +809 -723
- fargopy/plot.py +553 -8
- fargopy/simulation.py +1548 -577
- fargopy/sys.py +116 -65
- fargopy/tests/test_base.py +8 -0
- fargopy/tests/test_flux.py +76 -0
- fargopy/tests/test_interp.py +132 -0
- fargopy-1.0.0.data/scripts/ifargopy +91 -0
- fargopy-1.0.0.data/scripts/vfargopy +2111 -0
- fargopy-1.0.0.dist-info/METADATA +425 -0
- fargopy-1.0.0.dist-info/RECORD +21 -0
- {fargopy-0.4.0.dist-info → fargopy-1.0.0.dist-info}/WHEEL +1 -1
- fargopy-1.0.0.dist-info/licenses/LICENSE +661 -0
- fargopy/fsimulation.py +0 -429
- fargopy/tests/test___init__.py +0 -0
- fargopy/util.py +0 -21
- fargopy/version.py +0 -1
- fargopy-0.4.0.data/scripts/ifargopy +0 -15
- fargopy-0.4.0.dist-info/METADATA +0 -492
- fargopy-0.4.0.dist-info/RECORD +0 -17
- fargopy-0.4.0.dist-info/licenses/LICENSE +0 -21
- {fargopy-0.4.0.dist-info → fargopy-1.0.0.dist-info}/entry_points.txt +0 -0
- {fargopy-0.4.0.dist-info → fargopy-1.0.0.dist-info}/top_level.txt +0 -0
fargopy-0.4.0.dist-info/METADATA
DELETED
|
@@ -1,492 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: fargopy
|
|
3
|
-
Version: 0.4.0
|
|
4
|
-
Summary: FARGO3D Wrapping
|
|
5
|
-
Home-page: https://pypi.org/project/fargopy
|
|
6
|
-
Author: Jorge Zuluaga, Alejandro Murillo-González, Matias Montesinos
|
|
7
|
-
Author-email: jorge.zuluaga@gmail.com
|
|
8
|
-
License: MIT
|
|
9
|
-
Keywords: astronomy MHD CFD
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
-
Classifier: Operating System :: OS Independent
|
|
13
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
License-File: LICENSE
|
|
15
|
-
Requires-Dist: scipy
|
|
16
|
-
Requires-Dist: matplotlib
|
|
17
|
-
Requires-Dist: tqdm
|
|
18
|
-
Requires-Dist: numpy
|
|
19
|
-
Requires-Dist: ipython
|
|
20
|
-
Requires-Dist: joblib
|
|
21
|
-
Requires-Dist: celluloid
|
|
22
|
-
Requires-Dist: psutil
|
|
23
|
-
Requires-Dist: gdown
|
|
24
|
-
Requires-Dist: pandas
|
|
25
|
-
Requires-Dist: plotly
|
|
26
|
-
Requires-Dist: ipywidgets
|
|
27
|
-
Requires-Dist: nbformat
|
|
28
|
-
Dynamic: author
|
|
29
|
-
Dynamic: author-email
|
|
30
|
-
Dynamic: classifier
|
|
31
|
-
Dynamic: description
|
|
32
|
-
Dynamic: description-content-type
|
|
33
|
-
Dynamic: home-page
|
|
34
|
-
Dynamic: keywords
|
|
35
|
-
Dynamic: license
|
|
36
|
-
Dynamic: license-file
|
|
37
|
-
Dynamic: requires-dist
|
|
38
|
-
Dynamic: summary
|
|
39
|
-
|
|
40
|
-
# FARGOpy
|
|
41
|
-
## Wrapping FRAGO3D
|
|
42
|
-
|
|
43
|
-
<!-- This are visual tags that you may add to your package at the beginning with useful information on your package -->
|
|
44
|
-
[](https://pypi.org/project/fargopy/)
|
|
45
|
-
[](https://pypi.org/project/fargopy/)
|
|
46
|
-
<a target="_blank" href="https://colab.research.google.com/github/seap-udea/fargopy/blob/main/README.ipynb">
|
|
47
|
-
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
|
|
48
|
-
</a>
|
|
49
|
-
|
|
50
|
-
`FARGOpy` is a python wrapping for [`FARGO3D`](https://fargo3d.bitbucket.io/intro.html), the well-knwon hydrodynamics and magnetohydrodynamics parallel code. This wrapping is intended to facillitate the interaction with FARGO3D, especially for those starting using the code. `FARGOpy` may be also useful for teaching and training purposes. For advanced users, `FARGOpy` provides useful functionalities in the postprocessing of simulation results, derivative calculations and plots.
|
|
51
|
-
|
|
52
|
-
This is an animation created with a few lines of code using `FARGOpy`.
|
|
53
|
-
<p align="center"><img src="https://github.com/seap-udea/fargopy/blob/main/gallery/fargo-animation.gif?raw=true" alt="Animation""/></p>
|
|
54
|
-
|
|
55
|
-
For the code used to generate this animation see the tutorial notebook [animations with `FARGOpy`](https://github.com/seap-udea/fargopy/blob/main/examples/fargopy-tutorial-animations.ipynb). For other examples and a full tutorial see the [examples repository](https://github.com/seap-udea/fargopy/blob/main/examples).
|
|
56
|
-
|
|
57
|
-
## Installing `FARGOpy`
|
|
58
|
-
|
|
59
|
-
`FARGOpy` is available at the `Python` package index and can be installed using:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
$ sudo pip install fargopy
|
|
63
|
-
```
|
|
64
|
-
as usual this command will install all dependencies (excluding `FARGO3D` which must be installed indepently as explained before) and download some useful data, scripts and constants.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
> **NOTE**: If you don't have access to `sudo`, you can install `FARGOpy` in your local environmen (usually at `~/.local/`). In that case you need to add to your `PATH` environmental variable the location of the local python installation. Add to `~/.bashrc` the line `export PATH=$HOME/.local/bin:$PATH`
|
|
69
|
-
|
|
70
|
-
Since `FARGOpy` is a python wrap for `FARGO3D` the ideal environment to work with the package is `IPython`/`Jupyter`. It works really fine in `Google Colab` ensuing training and demonstration purposes. This README, for instance, can be ran in `Google Colab`:
|
|
71
|
-
|
|
72
|
-
<a target="_blank" href="https://colab.research.google.com/github/seap-udea/fargopy/blob/main/README.ipynb">
|
|
73
|
-
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
|
|
74
|
-
</a>
|
|
75
|
-
|
|
76
|
-
This code only works in Colab and it is intended to install the latest version of `FARGOpy`
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
```python
|
|
80
|
-
import sys
|
|
81
|
-
if 'google.colab' in sys.modules:
|
|
82
|
-
!sudo pip install -Uq fargopy
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
If you are working in `Jupyter` or in `Google Colab`, the configuration directory and its content will be crated the first time you import the package:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
```python
|
|
89
|
-
import fargopy as fp
|
|
90
|
-
|
|
91
|
-
# These lines are intented for developing purposes; drop them in your code
|
|
92
|
-
%load_ext autoreload
|
|
93
|
-
%autoreload 2
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
Running FARGOpy version 0.3.6
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
If you are working on a remote Linux server, it is better to run the package using `IPython`. For this purpose, after installation, `FARGOpy` provides a special initialization command:
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
$ ifargopy
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
The first time you run this script, it will create a configuration directory `~/.fargopy` (with `~` the abbreviation for the home directory). This directory contains a set of basic configuration variables which are stored in the file `~/.fargopy/fargopyrc`. You may change this file if you want to customize the installation. The configuration directory also contains the `IPython` initialization script `~/.fargopy/ifargopy.py`.
|
|
106
|
-
|
|
107
|
-
## Downloading and installing FARGO3D
|
|
108
|
-
|
|
109
|
-
It is important to understand that `FARGO3D` works especially well on Linux plaforms (including `MacOS`). The same condition applies for `FARGOpy`. Because of that, most of the internal as well as the public features of the packages are designed to work in a `Linux` environment. For working in other operating systems, especially on MS Windows, please consider using virtual machines ow WSL.
|
|
110
|
-
|
|
111
|
-
Being an independent project, `FARGOpy` is not provided with a working version of `FARGO3D`. You need to download the C package and their prerequisites (compilers, third-party libraries, etc.) and configure them, by yourself. For a detailed guide please see the [FARGO3D documentation](https://fargo3d.bitbucket.io/index.html) or the [project repo at bitbucket](https://bitbucket.org/fargo3d/public/src/ae0fcdc67bb7c83aed85fc9a4d4a2d5061324597/?at=release%2Fpublic).
|
|
112
|
-
|
|
113
|
-
Still `FARGOpy` provides a simple way to get the latest version of the source code of `FARGO3D` from its public GitHub repository. The source code will be downloaded into the home directory and stored as `~/fargo3d/`.
|
|
114
|
-
|
|
115
|
-
> **WARNING**: If you want to change the final location of the source code or the name of the `FARGO3D` directory, before executing the following command, please change the corresponding configuration variables in `~/.fargopy/fargopyrc`
|
|
116
|
-
|
|
117
|
-
To download the `FARGO3D` source code execute:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
```python
|
|
121
|
-
fp.initialize('download',force=True)
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
Downloading FARGOpy...
|
|
125
|
-
Directory '/home/jzuluaga/fargo3d/' already exists. Removing it...
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
Cloning into 'fargo3d'...
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
FARGO3D downloaded to /home/jzuluaga/fargo3d/
|
|
132
|
-
Header file for FARGO3D found in the fargo directory /home/jzuluaga/fargo3d/
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
Once download it you may check if the source code is compiling in your machine. For that purpose run:
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
```python
|
|
139
|
-
fp.initialize('check',regular=1,gpu=0,parallel=0)
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
Test compilation of FARGO3D
|
|
143
|
-
Checking normal compilation.
|
|
144
|
-
Running 'make -C /home/jzuluaga/fargo3d/ clean mrproper all PARALLEL=0 GPU=0 2>&1 |tee /tmp/fargo_regular.log':
|
|
145
|
-
Compilation in mode regular successful.
|
|
146
|
-
Skipping gpu compilation
|
|
147
|
-
Skipping parallel compilation
|
|
148
|
-
Summary of compilation modes:
|
|
149
|
-
Regular: 1
|
|
150
|
-
GPU: 0
|
|
151
|
-
Parallel: 0
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
If you have some error at compiling `FARGO3D` in some of the possible modes (regular, gpu and/or parallel) please check the corresponding logfile and correct the problems. Compiling problems will normally arise because of a lacking of an important dependency, for instance a compiler, a driver (in the case of GPU) or a third-party library or tool (eg. openmpi).
|
|
155
|
-
|
|
156
|
-
## Quickstart
|
|
157
|
-
|
|
158
|
-
Here we will illustrate the minimal commands you may run to test the package. A more detailed set of examples can be found exploring [the tutorial notebooks](https://github.com/seap-udea/fargopy/blob/main/examples). Other in depth examples are also available in the [examples repository](https://github.com/seap-udea/fargopy/tree/main/examples) of the `GitHub` repository.
|
|
159
|
-
|
|
160
|
-
There are two complimentary modes when using `FARGOpy`:
|
|
161
|
-
|
|
162
|
-
- **Control mode**: Using this mode you can run and control `FARGO3D` from your notebook. This mode requires a working copy of `FARGO3D` ready to be compiled and run. This mode is ideal for training or testing purposes.
|
|
163
|
-
|
|
164
|
-
- **Postprocessing mode**: Using `FARGOpy` in this mode allows you to process some of the output files produced by a `FARGO3D` simulation. This mode does not necesarily requires that a working copy of `FARGO3D` be installed in the machine where you are performing the postprocessing analysis. This mode is ideal for advanced users.
|
|
165
|
-
|
|
166
|
-
### Control mode
|
|
167
|
-
|
|
168
|
-
Create a simulation:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
```python
|
|
172
|
-
sim = fp.Simulation(setup='fargo')
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
Your simulation is now connected with '/home/jzuluaga/fargo3d/'
|
|
176
|
-
Now your simulation setup is at '/home/jzuluaga/fargo3d/setups/fargo'
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
Compile the `FARGO3D` binary to run the simulation:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
```python
|
|
183
|
-
sim.compile(parallel=0,gpu=0)
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
Compiling fargo3d_SETUP-fargo_PARALLEL-0_GPU-0...
|
|
187
|
-
Succesful compilation of FARGO3D binary fargo3d_SETUP-fargo_PARALLEL-0_GPU-0
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
Run the simulation:
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
```python
|
|
194
|
-
sim.run(cleanrun=True)
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
Cleaning output directory /home/jzuluaga/fargo3d/outputs/fargo
|
|
198
|
-
Running asynchronously (test = False): ./fargo3d_SETUP-fargo_PARALLEL-0_GPU-0 -m -t setups/fargo/fargo.par
|
|
199
|
-
Now you are connected with output directory '/home/jzuluaga/fargo3d/outputs/fargo'
|
|
200
|
-
Found a variables.par file in '/home/jzuluaga/fargo3d/outputs/fargo', loading properties
|
|
201
|
-
Loading variables
|
|
202
|
-
84 variables loaded
|
|
203
|
-
Simulation in 2 dimensions
|
|
204
|
-
Loading domain in cylindrical coordinates:
|
|
205
|
-
Variable phi: 384 [[0, -3.1334114227210694], [-1, 3.1334114227210694]]
|
|
206
|
-
Variable r: 128 [[0, 0.408203125], [-1, 2.491796875]]
|
|
207
|
-
Variable z: 1 [[0, 0.0], [-1, 0.0]]
|
|
208
|
-
Number of snapshots in output directory: 1
|
|
209
|
-
Configuration variables and domains load into the object. See e.g. <sim>.vars
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
You may check the status:
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
```python
|
|
216
|
-
sim.status()
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
################################################################################
|
|
221
|
-
Running status of the process:
|
|
222
|
-
The process is running.
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
Or check the progress of the simulation:
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
```python
|
|
229
|
-
sim.status('progress')
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
Progress of the simulation (numstatus = 5, interrupting may stop the process):
|
|
233
|
-
1:OUTPUTS 3 at date t = 18.849556 OK [output pace = 0.1 secs]
|
|
234
|
-
2:OUTPUTS 4 at date t = 25.132741 OK [output pace = 0.1 secs]
|
|
235
|
-
3:OUTPUTS 5 at date t = 31.415927 OK [output pace = 0.9 secs]
|
|
236
|
-
4:OUTPUTS 6 at date t = 37.699112 OK [output pace = 1.8 secs]
|
|
237
|
-
5:OUTPUTS 7 at date t = 43.982297 OK [output pace = 1.9 secs]
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
You may stop the simulation at any time using:
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
```python
|
|
244
|
-
sim.stop()
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
Stopping FARGO3D process (pid = 26257)
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
Check the status of the simulation using:
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
```python
|
|
254
|
-
sim.status('summary')
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
The simulation has been ran for 9 time-steps (including the initial one).
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
Once stopped you may resume the simulation at any snapshot or at the latest resumable snapshot:
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
```python
|
|
264
|
-
sim.resume()
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
Resuming from snapshot 7...
|
|
268
|
-
Running asynchronously (test = False): ./fargo3d_SETUP-fargo_PARALLEL-0_GPU-0 -m -t -S 7 -t setups/fargo/fargo.par
|
|
269
|
-
Now you are connected with output directory '/home/jzuluaga/fargo3d/outputs/fargo'
|
|
270
|
-
Found a variables.par file in '/home/jzuluaga/fargo3d/outputs/fargo', loading properties
|
|
271
|
-
Loading variables
|
|
272
|
-
84 variables loaded
|
|
273
|
-
Simulation in 2 dimensions
|
|
274
|
-
Loading domain in cylindrical coordinates:
|
|
275
|
-
Variable phi: 384 [[0, -3.1334114227210694], [-1, 3.1334114227210694]]
|
|
276
|
-
Variable r: 128 [[0, 0.408203125], [-1, 2.491796875]]
|
|
277
|
-
Variable z: 1 [[0, 0.0], [-1, 0.0]]
|
|
278
|
-
Number of snapshots in output directory: 9
|
|
279
|
-
Configuration variables and domains load into the object. See e.g. <sim>.vars
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
Once the simulation has been completed you will notice by ran:
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
```python
|
|
286
|
-
sim.stop()
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
The process has finished. Check logfile /home/jzuluaga/fargo3d/setups/fargo/fargo.log.
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
### Postprocessing mode
|
|
293
|
-
|
|
294
|
-
Now that you have some results to process, it is time to use the functionalities that `FARGOpy` provides for this purpose.
|
|
295
|
-
|
|
296
|
-
Create the simulation and connect it to the output directory:
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
```python
|
|
300
|
-
sim = fp.Simulation(output_dir = fp.Conf.FP_FARGO3D_DIR + '/outputs/fargo')
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
Your simulation is now connected with '/home/jzuluaga/fargo3d/'
|
|
304
|
-
Now you are connected with output directory '/home/jzuluaga/fargo3d//outputs/fargo'
|
|
305
|
-
Found a variables.par file in '/home/jzuluaga/fargo3d//outputs/fargo', loading properties
|
|
306
|
-
Loading variables
|
|
307
|
-
84 variables loaded
|
|
308
|
-
Simulation in 2 dimensions
|
|
309
|
-
Loading domain in cylindrical coordinates:
|
|
310
|
-
Variable phi: 384 [[0, -3.1334114227210694], [-1, 3.1334114227210694]]
|
|
311
|
-
Variable r: 128 [[0, 0.408203125], [-1, 2.491796875]]
|
|
312
|
-
Variable z: 1 [[0, 0.0], [-1, 0.0]]
|
|
313
|
-
Number of snapshots in output directory: 21
|
|
314
|
-
Configuration variables and domains load into the object. See e.g. <sim>.vars
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
```python
|
|
319
|
-
sim.load_properties()
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
Loading variables
|
|
323
|
-
84 variables loaded
|
|
324
|
-
Simulation in 2 dimensions
|
|
325
|
-
Loading domain in cylindrical coordinates:
|
|
326
|
-
Variable phi: 384 [[0, -3.1334114227210694], [-1, 3.1334114227210694]]
|
|
327
|
-
Variable r: 128 [[0, 0.408203125], [-1, 2.491796875]]
|
|
328
|
-
Variable z: 1 [[0, 0.0], [-1, 0.0]]
|
|
329
|
-
Number of snapshots in output directory: 22
|
|
330
|
-
Configuration variables and domains load into the object. See e.g. <sim>.vars
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
Load gas density field from a given snapshot:
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
```python
|
|
337
|
-
gasdens = sim.load_field('gasdens',snapshot=20)
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
Create a `meshslice` of the field:
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
```python
|
|
344
|
-
gasdens_r, mesh = gasdens.meshslice(slice='z=0,phi=0')
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
Plot the slice:
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
```python
|
|
351
|
-
import matplotlib.pyplot as plt
|
|
352
|
-
if not fp.IN_COLAB:plt.ioff() # Drop this out of this tutorial
|
|
353
|
-
fig,ax = plt.subplots()
|
|
354
|
-
|
|
355
|
-
ax.semilogy(mesh.r,gasdens_r)
|
|
356
|
-
|
|
357
|
-
ax.set_xlabel(r"$r$ [cu]")
|
|
358
|
-
ax.set_ylabel(r"$\rho$ [cu]")
|
|
359
|
-
fp.Plot.fargopy_mark(ax)
|
|
360
|
-
if not fp.IN_COLAB:fig.savefig('gallery/example-dens_r.png') # Drop this out of this tutorial
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
<p align="center"><img src="https://github.com/seap-udea/fargopy/blob/main/gallery/example-dens_r.png?raw=true" alt="Animation""/></p>
|
|
364
|
-
|
|
365
|
-
You may also create a 2-dimensional `meshslice`:
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
```python
|
|
369
|
-
gasdens_plane, mesh = gasdens.meshslice(slice='z=0')
|
|
370
|
-
```
|
|
371
|
-
|
|
372
|
-
And plot it:
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
```python
|
|
376
|
-
if not fp.IN_COLAB:plt.ioff() # Drop this out of this tutorial
|
|
377
|
-
fig,axs = plt.subplots(1,2,figsize=(12,6))
|
|
378
|
-
|
|
379
|
-
ax = axs[0]
|
|
380
|
-
|
|
381
|
-
ax.pcolormesh(mesh.phi,mesh.r,gasdens_plane,cmap='prism')
|
|
382
|
-
|
|
383
|
-
ax.set_xlabel('$\phi$ [rad]')
|
|
384
|
-
ax.set_ylabel('$r$ [UL]')
|
|
385
|
-
fp.Plot.fargopy_mark(ax)
|
|
386
|
-
|
|
387
|
-
ax = axs[1]
|
|
388
|
-
|
|
389
|
-
ax.pcolormesh(mesh.x,mesh.y,gasdens_plane,cmap='prism')
|
|
390
|
-
|
|
391
|
-
ax.set_xlabel('$x$ [UL]')
|
|
392
|
-
ax.set_ylabel('$y$ [UL]')
|
|
393
|
-
fp.Plot.fargopy_mark(ax)
|
|
394
|
-
ax.axis('equal')
|
|
395
|
-
if not fp.IN_COLAB:fig.savefig('gallery/example-dens_disk.png') # Drop this out of this tutorial
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
<p align="center"><img src="https://github.com/seap-udea/fargopy/blob/main/gallery/example-dens_disk.png?raw=true" alt="Animation""/></p>
|
|
399
|
-
|
|
400
|
-
### Working with precomputed simulations
|
|
401
|
-
|
|
402
|
-
If you don't have the resources to compile or run `FARGO3D` and still you want to test the postprocessing functionalities of the package you may download a precomputed simulation:
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
```python
|
|
406
|
-
fp.Simulation.download_precomputed(setup='fargo')
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
Downloading fargo.tgz from cloud (compressed size around 55 MB) into /tmp
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
Downloading...
|
|
413
|
-
From: https://docs.google.com/uc?export=download&id=1YXLKlf9fCGHgLej2fSOHgStD05uFB2C3
|
|
414
|
-
To: /tmp/fargo.tgz
|
|
415
|
-
100%|██████████| 54.7M/54.7M [00:02<00:00, 19.1MB/s]
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
Uncompressing fargo.tgz into /tmp/fargo
|
|
419
|
-
Done.
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
Once downloaded you may connect with simulation using:
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
```python
|
|
426
|
-
sim = fp.Simulation(output_dir = '/tmp/fargo')
|
|
427
|
-
```
|
|
428
|
-
|
|
429
|
-
Your simulation is now connected with '/home/jzuluaga/fargo3d/'
|
|
430
|
-
Now you are connected with output directory '/tmp/fargo'
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
and perform the postprocessing as explained before.
|
|
434
|
-
|
|
435
|
-
We have prepared a set of precomputed simulations covering some interesting scientific cases. You may see the list of precomputed simulations available in the `FARGOpy` [cloud repository](https://drive.google.com/drive/folders/1NRdNOcmxRK-pHv_8vR-aAAJGWXxIOY0J?usp=sharing):
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
```python
|
|
439
|
-
fp.Simulation.list_precomputed()
|
|
440
|
-
```
|
|
441
|
-
|
|
442
|
-
fargo:
|
|
443
|
-
Description: Protoplanetary disk with a Jovian planet [2D]
|
|
444
|
-
Size: 55 MB
|
|
445
|
-
p3diso:
|
|
446
|
-
Description: Protoplanetary disk with a Super earth planet [3D]
|
|
447
|
-
Size: 220 MB
|
|
448
|
-
p3disoj:
|
|
449
|
-
Description: Protoplanetary disk with a Jovian planet [3D]
|
|
450
|
-
Size: 84 MB
|
|
451
|
-
fargo_multifluid:
|
|
452
|
-
Description: Protoplanetary disk with several fluids (dust) and a Jovian planet in 2D
|
|
453
|
-
Size: 100 MB
|
|
454
|
-
binary:
|
|
455
|
-
Description: Disk around a binary with the properties of Kepler-38 in 2D
|
|
456
|
-
Size: 140 MB
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
You may find in the [examples directory](https://github.com/seap-udea/fargopy/tree/main/examples) of the `GitHub` repository, example notebooks illustrating how to use `FARGOpy` for processing the output of this precomputed simulations.
|
|
460
|
-
|
|
461
|
-
## What's new
|
|
462
|
-
|
|
463
|
-
Version 0.4.*:
|
|
464
|
-
- Interpolation and flux computations.
|
|
465
|
-
|
|
466
|
-
Version 0.3.*:
|
|
467
|
-
|
|
468
|
-
- Refactoring of initializing routines.
|
|
469
|
-
- Improvements in documentation of basic classes in `__init__.py`.
|
|
470
|
-
- Precomputed simulations uploaded to FARGOpy Cloud Repository and available usnig `download_precomputed` static method.
|
|
471
|
-
|
|
472
|
-
Version 0.2.*:
|
|
473
|
-
|
|
474
|
-
- First real applications tested with FARGOpy.
|
|
475
|
-
- All basic routines for reading output created.
|
|
476
|
-
- Major refactoring.
|
|
477
|
-
|
|
478
|
-
Version 0.1.*:
|
|
479
|
-
|
|
480
|
-
- Package is now provided with a script 'ifargopy' to run 'ipython' with fargopy initialized.
|
|
481
|
-
- A new 'progress' mode has been added to status method.
|
|
482
|
-
- All the dynamics of loading/compiling/running/stoppìng/resuming FARGO3D has been developed.
|
|
483
|
-
|
|
484
|
-
Version 0.0.*:
|
|
485
|
-
|
|
486
|
-
- First classes created.
|
|
487
|
-
- The project is started!
|
|
488
|
-
|
|
489
|
-
------------
|
|
490
|
-
|
|
491
|
-
This package has been designed and written mostly by Jorge I. Zuluaga and Alejandro Murillo-González with advising and contributions by Matías Montesinos (C) 2023, 2024, 2025
|
|
492
|
-
|
fargopy-0.4.0.dist-info/RECORD
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
fargopy/__init__.py,sha256=LXTuWtqxWCDPWGG9mO20NpK1WtQPWmDhET08OXJ82lE,12526
|
|
2
|
-
fargopy/fields.py,sha256=yHenVK2AdEFDggF6-mZ9O33Q18mJQ-ccP1RaBAjI6Tw,36896
|
|
3
|
-
fargopy/flux.py,sha256=7nSFkX2rKQo4NI-c_GnhXpRhgRv6COvxsUyaNIODqRY,32480
|
|
4
|
-
fargopy/fsimulation.py,sha256=Lo2METd7Qa05A8tvp5GaJss8cQFBCJS0w7gFFve8ySI,18657
|
|
5
|
-
fargopy/plot.py,sha256=T2xhVQnBU9NVebxgMgegcuBc0YZSei12VC6OzD5JihI,1583
|
|
6
|
-
fargopy/simulation.py,sha256=NQIjJ2wu4E7CXHSro3zFEhefRXjQqAw8AaRH5evGJys,50304
|
|
7
|
-
fargopy/sys.py,sha256=O53WNHU3EL3GIrpxuK4mi2er929f6Ztdf5Fej62DDs8,5055
|
|
8
|
-
fargopy/util.py,sha256=Bbll0TwJjFp5hv2luoBu9ogNiepp4oErPFcuty7YqdY,672
|
|
9
|
-
fargopy/version.py,sha256=oa-4RrMgexZC4mIb7ovFgKJij15qqFFtuczJifkJeU0,16
|
|
10
|
-
fargopy/tests/test___init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
fargopy-0.4.0.data/scripts/ifargopy,sha256=t5E07jKzOLtNnlNyElQZbzjCW6wnR0bc8uCaZpw9yS8,382
|
|
12
|
-
fargopy-0.4.0.dist-info/licenses/LICENSE,sha256=aIckKnNVrkXQMqEKlzGn_REfTwc82TF35BHMCRwPXCI,1097
|
|
13
|
-
fargopy-0.4.0.dist-info/METADATA,sha256=nkII7w-W0HNHKE3I4DuEygV6X6Nb3Z1vsqZPyXld_HM,17837
|
|
14
|
-
fargopy-0.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
15
|
-
fargopy-0.4.0.dist-info/entry_points.txt,sha256=555NPKYbLCN0fgJbdW4b4azZ5sqjhqVqTUxujBBYEJY,49
|
|
16
|
-
fargopy-0.4.0.dist-info/top_level.txt,sha256=_r66v1_-9T7dB5sQa12AdxaAdsv9-OTwtR-vft4OPBU,8
|
|
17
|
-
fargopy-0.4.0.dist-info/RECORD,,
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 Solar, Earth and Planetary Physics Group
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
File without changes
|
|
File without changes
|