fargopy 0.2.0__tar.gz → 0.3.0__tar.gz
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-0.2.0 → fargopy-0.3.0}/LICENSE +0 -0
- fargopy-0.3.0/PKG-INFO +243 -0
- fargopy-0.3.0/README.md +220 -0
- fargopy-0.3.0/fargopy/__init__.py +285 -0
- {fargopy-0.2.0/fargopy → fargopy-0.3.0/fargopy/bin}/ifargopy +0 -0
- fargopy-0.3.0/fargopy/fields.py +221 -0
- fargopy-0.3.0/fargopy/simulation.py +845 -0
- {fargopy-0.2.0 → fargopy-0.3.0}/fargopy/sys.py +41 -18
- {fargopy-0.2.0 → fargopy-0.3.0}/fargopy/util.py +4 -0
- fargopy-0.3.0/fargopy/version.py +1 -0
- fargopy-0.3.0/fargopy.egg-info/PKG-INFO +243 -0
- {fargopy-0.2.0 → fargopy-0.3.0}/fargopy.egg-info/SOURCES.txt +4 -5
- {fargopy-0.2.0 → fargopy-0.3.0}/fargopy.egg-info/requires.txt +2 -0
- fargopy-0.3.0/pyproject.toml +5 -0
- {fargopy-0.2.0 → fargopy-0.3.0}/setup.py +4 -3
- fargopy-0.2.0/PKG-INFO +0 -470
- fargopy-0.2.0/README.md +0 -449
- fargopy-0.2.0/fargopy/__cycle1.py +0 -880
- fargopy-0.2.0/fargopy/__init__.py +0 -170
- fargopy-0.2.0/fargopy/conf.py +0 -20
- fargopy-0.2.0/fargopy/fargo3d.py +0 -505
- fargopy-0.2.0/fargopy/version.py +0 -1
- fargopy-0.2.0/fargopy.egg-info/PKG-INFO +0 -470
- fargopy-0.2.0/pyproject.toml +0 -5
- {fargopy-0.2.0 → fargopy-0.3.0}/fargopy.egg-info/dependency_links.txt +0 -0
- {fargopy-0.2.0 → fargopy-0.3.0}/fargopy.egg-info/entry_points.txt +0 -0
- {fargopy-0.2.0 → fargopy-0.3.0}/fargopy.egg-info/top_level.txt +0 -0
- {fargopy-0.2.0 → fargopy-0.3.0}/setup.cfg +0 -0
|
File without changes
|
fargopy-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: fargopy
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: FARGO3D Wrapping
|
|
5
|
+
Home-page: https://pypi.org/project/fargopy
|
|
6
|
+
Author: Jorge Zuluaga, 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: celluloid
|
|
21
|
+
Requires-Dist: psutil
|
|
22
|
+
Requires-Dist: gdown
|
|
23
|
+
|
|
24
|
+
# FARGOpy
|
|
25
|
+
## Wrapping FRAGO3D
|
|
26
|
+
|
|
27
|
+
<!-- This are visual tags that you may add to your package at the beginning with useful information on your package -->
|
|
28
|
+
[](https://pypi.org/project/fargopy/)
|
|
29
|
+
[](https://pypi.org/project/fargopy/)
|
|
30
|
+
|
|
31
|
+
`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 ensue the interaction with FARGO3D especially for those starting using the code, for instance for teaching and training purposes, but also provide functionalities for most advanced users in tasks related to the postprocessing of output files and plotting.
|
|
32
|
+
|
|
33
|
+
This is an example of what can be done using `FARGOpy`:
|
|
34
|
+
|
|
35
|
+
<p align="center"><img src="https://github.com/seap-udea/fargopy/blob/main/gallery/fargo-animation.gif?raw=true" alt="Animation""/></p>
|
|
36
|
+
|
|
37
|
+
## Install `FARGOpy`
|
|
38
|
+
|
|
39
|
+
To install the package run:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
$ pip3 install fargopy
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Since `FARGOpy` is a python wrap for `FARGO3D` the ideal environment to work with the package is `IPython` or other similar environments such as `jupyter-lab`, `Google Colab`, etc.
|
|
46
|
+
|
|
47
|
+
If you are working on a Linux server it is better to run the package for the first time using the `IPython` initialization command:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
$ ifargopy
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The first time you run this command, it will create the configuration directory `$HOME/.fargopy`. This directory contains a set of basic configuration variables `$HOME/.fargopy/fargopyrc`, that can be customized, and the `IPython` initialization script `$HOME/.fargopy/ifargopy.py`.
|
|
54
|
+
|
|
55
|
+
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:
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
import fargopy as fp
|
|
60
|
+
%load_ext autoreload
|
|
61
|
+
%autoreload 2
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Running FARGOpy version 0.2.1
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
## Download and install FARGO3D
|
|
68
|
+
|
|
69
|
+
`FARGOpy` can be used either to *control* `FARGO3D`, ie. download, compile and run it, and/or read and manipulate the output of simulations. In either case it would be convenient to obtain a copy of the package and all its prerequisites. For a detailed guide please see the [FARGO documentation](https://fargo3d.bitbucket.io/index.html) or the [project repo at bitbucket](https://bitbucket.org/fargo3d/public/src/ae0fcdc67bb7c83aed85fc9a4d4a2d5061324597/?at=release%2Fpublic).
|
|
70
|
+
|
|
71
|
+
> **NOTE**: 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 internal as well as public features of the packages are designed to work in a `Linux` environment. For working in another operating systems, for instance for teaching or training purposes, please consider to use virtual machines.
|
|
72
|
+
|
|
73
|
+
`FARGOpy` provides a simple way to get the latest version of `FARGO3D`. In the terminal run:
|
|
74
|
+
|
|
75
|
+
```shell
|
|
76
|
+
$ ifargopy download
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
A copy of `FARGO3D` will be download in the HOME directory `~/fargo3d/`.
|
|
80
|
+
|
|
81
|
+
If you are working in a `Jupyter` environment you may run:
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
fp.initialize('download')
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Downloading FARGOpy...
|
|
89
|
+
FARGO3D directory already present in '/home/jzuluaga/fargo3d/'
|
|
90
|
+
Header file for FARGO3D is in the fargo directory /home/jzuluaga/fargo3d/
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
> **NOTE**: As you may see the default directory where FARGO3D is download is `~/` and the name of the directory is `fargo3d`. You may change this by setting the configuration variables `FP_FARGO3D_BASEDIR` or `FP_FARGO3D_PACKDIR` brefore downloading the package.
|
|
94
|
+
|
|
95
|
+
## Quickstart
|
|
96
|
+
|
|
97
|
+
Here we will illustrate the minimal commands you may run to test the package. A more detailed set of examples can be found in [this file](TUTORIAL.md).
|
|
98
|
+
|
|
99
|
+
For this example we will assume that you already have a set of FARGO3D simulation results. You may download a precomputed set of results prepared by the developers of `FARGOpy` using the command:
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
fp.Simulation.download_precomputed(setup='fargo')
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Precomputed output directory '/tmp/fargo' already exist
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
'/tmp/fargo'
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
Create a simulation object:
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
sim = fp.Simulation()
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Your simulation is now connected with '/home/jzuluaga/fargo3d/'
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
Set the output directory (in this case, the directory where the precomputed simulation has been stored):
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
sim.set_output_dir('/tmp/fargo')
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Now you are connected with output directory '/tmp/fargo'
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
Load the properties of the simulation:
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
sim.load_properties()
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Loading variables
|
|
144
|
+
84 variables loaded
|
|
145
|
+
Simulation in 2 dimensions
|
|
146
|
+
Loading domain in cylindrical coordinates:
|
|
147
|
+
Variable phi: 384 [[0, -3.1334114227210694], [-1, 3.1334114227210694]]
|
|
148
|
+
Variable r: 128 [[0, 0.408203125], [-1, 2.491796875]]
|
|
149
|
+
Variable z: 1 [[0, 0.0], [-1, 0.0]]
|
|
150
|
+
Number of snapshots in output directory: 51
|
|
151
|
+
Configuration variables and domains load into the object. See e.g. <sim>.vars
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
Load gas density from a given snapshot:
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
```python
|
|
158
|
+
gasdens = sim.load_field('gasdens',snapshot=20)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Create a `meshslice` of the field:
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
```python
|
|
165
|
+
gasdens_r, mesh = gasdens.meshslice(slice='z=0,phi=0')
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
And plot the slice:
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
```python
|
|
172
|
+
import matplotlib.pyplot as plt
|
|
173
|
+
plt.ioff() # Drop this out of this tutorial
|
|
174
|
+
fig,ax = plt.subplots()
|
|
175
|
+
ax.semilogy(mesh.r,gasdens_r)
|
|
176
|
+
ax.set_xlabel(r"$r$ [cu]")
|
|
177
|
+
ax.set_ylabel(r"$\rho$ [cu]")
|
|
178
|
+
fp.Util.fargopy_mark(ax)
|
|
179
|
+
fig.savefig('gallery/example-dens_r.png') # Drop this out of this tutorial
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
<p align="center"><img src="https://github.com/seap-udea/fargopy/blob/main/gallery/example-dens_r.png?raw=true" alt="Animation""/></p>
|
|
183
|
+
|
|
184
|
+
You may also create a 2-dimensional slice:
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
```python
|
|
188
|
+
gasdens_plane, mesh = gasdens.meshslice(slice='z=0')
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
And plot it:
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
```python
|
|
195
|
+
plt.ioff() # Drop this out of this tutorial
|
|
196
|
+
fig,axs = plt.subplots(1,2,figsize=(12,6))
|
|
197
|
+
|
|
198
|
+
ax = axs[0]
|
|
199
|
+
ax.pcolormesh(mesh.phi,mesh.r,gasdens_plane,cmap='prism')
|
|
200
|
+
ax.set_xlabel('$\phi$ [rad]')
|
|
201
|
+
ax.set_ylabel('$r$ [UL]')
|
|
202
|
+
fp.Util.fargopy_mark(ax)
|
|
203
|
+
|
|
204
|
+
ax = axs[1]
|
|
205
|
+
ax.pcolormesh(mesh.x,mesh.y,gasdens_plane,cmap='prism')
|
|
206
|
+
ax.set_xlabel('$x$ [UL]')
|
|
207
|
+
ax.set_ylabel('$y$ [UL]')
|
|
208
|
+
fp.Util.fargopy_mark(ax)
|
|
209
|
+
ax.axis('equal')
|
|
210
|
+
fig.savefig('gallery/example-dens_disk.png') # Drop this out of this tutorial
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
<p align="center"><img src="https://github.com/seap-udea/fargopy/blob/main/gallery/example-dens_disk.png?raw=true" alt="Animation""/></p>
|
|
214
|
+
|
|
215
|
+
## What's new
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
Version 0.3.*:
|
|
219
|
+
|
|
220
|
+
- Refactoring of initializing routines.
|
|
221
|
+
- Improvements in documentation of basic classes in `__init__.py`.
|
|
222
|
+
|
|
223
|
+
Version 0.2.*:
|
|
224
|
+
|
|
225
|
+
- First real applications tested with FARGOpy.
|
|
226
|
+
- All basic routines for reading output created.
|
|
227
|
+
- Major refactoring.
|
|
228
|
+
|
|
229
|
+
Version 0.1.*:
|
|
230
|
+
|
|
231
|
+
- Package is now provided with a script 'ifargopy' to run 'ipython' with fargopy initialized.
|
|
232
|
+
- A new 'progress' mode has been added to status method.
|
|
233
|
+
- All the dynamics of loading/compiling/running/stoppìng/resuming FARGO3D has been developed.
|
|
234
|
+
|
|
235
|
+
Version 0.0.*:
|
|
236
|
+
|
|
237
|
+
- First classes created.
|
|
238
|
+
- The project is started!
|
|
239
|
+
|
|
240
|
+
------------
|
|
241
|
+
|
|
242
|
+
This package has been designed and written mostly by Jorge I. Zuluaga with advising and contributions by Matías Montesinos (C) 2023
|
|
243
|
+
|
fargopy-0.3.0/README.md
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# FARGOpy
|
|
2
|
+
## Wrapping FRAGO3D
|
|
3
|
+
|
|
4
|
+
<!-- This are visual tags that you may add to your package at the beginning with useful information on your package -->
|
|
5
|
+
[](https://pypi.org/project/fargopy/)
|
|
6
|
+
[](https://pypi.org/project/fargopy/)
|
|
7
|
+
|
|
8
|
+
`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 ensue the interaction with FARGO3D especially for those starting using the code, for instance for teaching and training purposes, but also provide functionalities for most advanced users in tasks related to the postprocessing of output files and plotting.
|
|
9
|
+
|
|
10
|
+
This is an example of what can be done using `FARGOpy`:
|
|
11
|
+
|
|
12
|
+
<p align="center"><img src="https://github.com/seap-udea/fargopy/blob/main/gallery/fargo-animation.gif?raw=true" alt="Animation""/></p>
|
|
13
|
+
|
|
14
|
+
## Install `FARGOpy`
|
|
15
|
+
|
|
16
|
+
To install the package run:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
$ pip3 install fargopy
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Since `FARGOpy` is a python wrap for `FARGO3D` the ideal environment to work with the package is `IPython` or other similar environments such as `jupyter-lab`, `Google Colab`, etc.
|
|
23
|
+
|
|
24
|
+
If you are working on a Linux server it is better to run the package for the first time using the `IPython` initialization command:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
$ ifargopy
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The first time you run this command, it will create the configuration directory `$HOME/.fargopy`. This directory contains a set of basic configuration variables `$HOME/.fargopy/fargopyrc`, that can be customized, and the `IPython` initialization script `$HOME/.fargopy/ifargopy.py`.
|
|
31
|
+
|
|
32
|
+
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:
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
import fargopy as fp
|
|
37
|
+
%load_ext autoreload
|
|
38
|
+
%autoreload 2
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Running FARGOpy version 0.2.1
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
## Download and install FARGO3D
|
|
45
|
+
|
|
46
|
+
`FARGOpy` can be used either to *control* `FARGO3D`, ie. download, compile and run it, and/or read and manipulate the output of simulations. In either case it would be convenient to obtain a copy of the package and all its prerequisites. For a detailed guide please see the [FARGO documentation](https://fargo3d.bitbucket.io/index.html) or the [project repo at bitbucket](https://bitbucket.org/fargo3d/public/src/ae0fcdc67bb7c83aed85fc9a4d4a2d5061324597/?at=release%2Fpublic).
|
|
47
|
+
|
|
48
|
+
> **NOTE**: 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 internal as well as public features of the packages are designed to work in a `Linux` environment. For working in another operating systems, for instance for teaching or training purposes, please consider to use virtual machines.
|
|
49
|
+
|
|
50
|
+
`FARGOpy` provides a simple way to get the latest version of `FARGO3D`. In the terminal run:
|
|
51
|
+
|
|
52
|
+
```shell
|
|
53
|
+
$ ifargopy download
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
A copy of `FARGO3D` will be download in the HOME directory `~/fargo3d/`.
|
|
57
|
+
|
|
58
|
+
If you are working in a `Jupyter` environment you may run:
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
fp.initialize('download')
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Downloading FARGOpy...
|
|
66
|
+
FARGO3D directory already present in '/home/jzuluaga/fargo3d/'
|
|
67
|
+
Header file for FARGO3D is in the fargo directory /home/jzuluaga/fargo3d/
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
> **NOTE**: As you may see the default directory where FARGO3D is download is `~/` and the name of the directory is `fargo3d`. You may change this by setting the configuration variables `FP_FARGO3D_BASEDIR` or `FP_FARGO3D_PACKDIR` brefore downloading the package.
|
|
71
|
+
|
|
72
|
+
## Quickstart
|
|
73
|
+
|
|
74
|
+
Here we will illustrate the minimal commands you may run to test the package. A more detailed set of examples can be found in [this file](TUTORIAL.md).
|
|
75
|
+
|
|
76
|
+
For this example we will assume that you already have a set of FARGO3D simulation results. You may download a precomputed set of results prepared by the developers of `FARGOpy` using the command:
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
fp.Simulation.download_precomputed(setup='fargo')
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Precomputed output directory '/tmp/fargo' already exist
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
'/tmp/fargo'
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
Create a simulation object:
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
sim = fp.Simulation()
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Your simulation is now connected with '/home/jzuluaga/fargo3d/'
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
Set the output directory (in this case, the directory where the precomputed simulation has been stored):
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
sim.set_output_dir('/tmp/fargo')
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Now you are connected with output directory '/tmp/fargo'
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
Load the properties of the simulation:
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
```python
|
|
117
|
+
sim.load_properties()
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Loading variables
|
|
121
|
+
84 variables loaded
|
|
122
|
+
Simulation in 2 dimensions
|
|
123
|
+
Loading domain in cylindrical coordinates:
|
|
124
|
+
Variable phi: 384 [[0, -3.1334114227210694], [-1, 3.1334114227210694]]
|
|
125
|
+
Variable r: 128 [[0, 0.408203125], [-1, 2.491796875]]
|
|
126
|
+
Variable z: 1 [[0, 0.0], [-1, 0.0]]
|
|
127
|
+
Number of snapshots in output directory: 51
|
|
128
|
+
Configuration variables and domains load into the object. See e.g. <sim>.vars
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
Load gas density from a given snapshot:
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
gasdens = sim.load_field('gasdens',snapshot=20)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Create a `meshslice` of the field:
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
```python
|
|
142
|
+
gasdens_r, mesh = gasdens.meshslice(slice='z=0,phi=0')
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
And plot the slice:
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
```python
|
|
149
|
+
import matplotlib.pyplot as plt
|
|
150
|
+
plt.ioff() # Drop this out of this tutorial
|
|
151
|
+
fig,ax = plt.subplots()
|
|
152
|
+
ax.semilogy(mesh.r,gasdens_r)
|
|
153
|
+
ax.set_xlabel(r"$r$ [cu]")
|
|
154
|
+
ax.set_ylabel(r"$\rho$ [cu]")
|
|
155
|
+
fp.Util.fargopy_mark(ax)
|
|
156
|
+
fig.savefig('gallery/example-dens_r.png') # Drop this out of this tutorial
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
<p align="center"><img src="https://github.com/seap-udea/fargopy/blob/main/gallery/example-dens_r.png?raw=true" alt="Animation""/></p>
|
|
160
|
+
|
|
161
|
+
You may also create a 2-dimensional slice:
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
```python
|
|
165
|
+
gasdens_plane, mesh = gasdens.meshslice(slice='z=0')
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
And plot it:
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
```python
|
|
172
|
+
plt.ioff() # Drop this out of this tutorial
|
|
173
|
+
fig,axs = plt.subplots(1,2,figsize=(12,6))
|
|
174
|
+
|
|
175
|
+
ax = axs[0]
|
|
176
|
+
ax.pcolormesh(mesh.phi,mesh.r,gasdens_plane,cmap='prism')
|
|
177
|
+
ax.set_xlabel('$\phi$ [rad]')
|
|
178
|
+
ax.set_ylabel('$r$ [UL]')
|
|
179
|
+
fp.Util.fargopy_mark(ax)
|
|
180
|
+
|
|
181
|
+
ax = axs[1]
|
|
182
|
+
ax.pcolormesh(mesh.x,mesh.y,gasdens_plane,cmap='prism')
|
|
183
|
+
ax.set_xlabel('$x$ [UL]')
|
|
184
|
+
ax.set_ylabel('$y$ [UL]')
|
|
185
|
+
fp.Util.fargopy_mark(ax)
|
|
186
|
+
ax.axis('equal')
|
|
187
|
+
fig.savefig('gallery/example-dens_disk.png') # Drop this out of this tutorial
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
<p align="center"><img src="https://github.com/seap-udea/fargopy/blob/main/gallery/example-dens_disk.png?raw=true" alt="Animation""/></p>
|
|
191
|
+
|
|
192
|
+
## What's new
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
Version 0.3.*:
|
|
196
|
+
|
|
197
|
+
- Refactoring of initializing routines.
|
|
198
|
+
- Improvements in documentation of basic classes in `__init__.py`.
|
|
199
|
+
|
|
200
|
+
Version 0.2.*:
|
|
201
|
+
|
|
202
|
+
- First real applications tested with FARGOpy.
|
|
203
|
+
- All basic routines for reading output created.
|
|
204
|
+
- Major refactoring.
|
|
205
|
+
|
|
206
|
+
Version 0.1.*:
|
|
207
|
+
|
|
208
|
+
- Package is now provided with a script 'ifargopy' to run 'ipython' with fargopy initialized.
|
|
209
|
+
- A new 'progress' mode has been added to status method.
|
|
210
|
+
- All the dynamics of loading/compiling/running/stoppìng/resuming FARGO3D has been developed.
|
|
211
|
+
|
|
212
|
+
Version 0.0.*:
|
|
213
|
+
|
|
214
|
+
- First classes created.
|
|
215
|
+
- The project is started!
|
|
216
|
+
|
|
217
|
+
------------
|
|
218
|
+
|
|
219
|
+
This package has been designed and written mostly by Jorge I. Zuluaga with advising and contributions by Matías Montesinos (C) 2023
|
|
220
|
+
|