Git Product home page Git Product logo

esvm's Introduction

JOSS : status License : GPLv3 Contributor Covenant Clones : 14 days Compilation check Tests check Plotting tools check Open issues Closed issues Open pull requests Closed pull requests

Written by Michaël J TOUATI

ESVM (ElectroStatic Vlasov-Maxwell) is a Vlasov-Maxwell Fortran 95 standard-compliant code, parallelized with OpenMP and using Python 3 for post-processing, that allows for the study of collisionless plasmas. Vlasov equation is coupled with the self-consistent Maxwell-Gauss equation, or equivalently with the Maxwell-Ampere equation with Maxwell-Gauss equation computed at the first time step, only. Both absorbing and periodic boundary conditions for both the particles and the fields are implemented. More pieces of information can be found in the readme.pdf peer-reviewed article draft. Python scripts, using the Matplotlib and Numpy packages, are provided to automatically extract and plot the stored simulation results. The simulation parameters are described in the input-deck and they can be modified without having to recompile the code. Compilation rules can be modified in the makefile depending on the user compiler preferences. Classical Plasma Physics academic case simulations that need less than one CPUxhour each, tools for testing the compilation of the code and tools for checking the simulation parameters are provided.

Simulation plot examples

Code units

The code units consist in the commonly used electrostatic units : the electron mass for masses, the elementary charge for electrical charges, the inverse of the Langmuir plasma electron angular frequency for times, the Debye electron screening length for spaces and the average plasma electron density for spatial densities. The initial plasma electron velocity distribution standard deviation is therefore an important unit parameter of normalization since it fixes indirectly the spatial unit.

Compiling the code

Modify the makefile as a function of the wished compilation options and the Fortran compiler installed on your computer and then type

make

The compilation can be tested by typing

make test

The tests consist in comparing file1 and file2 where :

  • file1 is one test simulation terminal output performed with an input deck located in the directory 'test-cases/Tests/' and
  • file2 is the terminal output of the corresponding simulation already performed by the developper also located in 'test-cases/Tests/'.

Running a simulation

Fill the wished input-deck (all parameters are described inside), eventually check them by typing

./check-input-deck

or

make check

and then type

./esvm

or

make run

to run the simulation.

Plotting the simulation results

All simulation results are stored in files located in the directory 'results'. Python scripts allowing to extract and plot the simulation results are located in the directory 'sources/plot'. They can be used by simply typing :

make plot

to plot all the results, even when the simulation is still running. The resulting plots will be stored in the directory 'figures'. It can also be plotted separately :

  • the energies scalar plots by typing :
make plot_energies

or

python3 sources/plot/plot_logfe.py
  • the 1D plasma electron hydrodynamic moments space-time density maps by typing :
make plot_hydro2D

or

python3 sources/plot/plot_hydro2d.py
  • the 1D plasma electron hydrodynamic moments scalar plots by typing :
make plot_hydro1D

or

python3 sources/plot/plot_hydro1d.py
  • or the 1D1V plasma electron distribution function phase-space density maps by typing :
make plot_fe

or

python3 sources/plot/plot_fe.py

If you need to plot the 1D1V plasma electron distribution function phase-space density maps in logarithmic scale instead, type :

make plot_logfe

or

python3 sources/plot/plot_logfe.py

Cleaning the directory

If you want to remove from the ESVM directory :

  • the compilation files and executables, type :
make distclean
  • the directory 'figures' containing all simulations results plots, type :
make figclean
  • the directory 'results' containing all simulations results data files, type :
make resclean
  • the three previous ones, type :
make clean

Be careful, the three latters will remove all simulations results and or figures. Store them elsewhere if you don't want to lose them.

License

ESVM is distributed under the terms of the GPLv3 license.

esvm's People

Contributors

actions-user avatar danielskatz avatar michaeltouati avatar nzeal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

nzeal tclune rouson

esvm's Issues

Improvements to JOSS Paper

Part of openjournals/joss-reviews#3618

I'd like to suggest a few minor improvements to the paper:

  • Captilise "Beam-Warming", inline with other eponymous schemes.
  • Add references to similar codes in the "Statement of Need" section. This section currently reads as a description of the code, and future development plans, whereas for the JOSS review requires a statement of need which makes clear what the need for the code is, as well as a "State of the field".
  • I'm not familiar with the use of "linear" and "non-linear" to describe the two lists of solvers they use. From my perspective they appear to be schemes without and with TVD limiters. Perhaps this could be clarified.
  • Move the list of proposed additions to the code to a later point in the paper.
  • Expand on the description of each of the Figures. Currently there's only a list. For example, are these run with the input decks as provided (if so, include a git hash in case they change), how can the user verify these results are correct?
  • In the discussion of velocity bins, perhaps an example and explanation as used in the production of one of the figures might be useful to a novice user.

No automated tests

This issue is part of the openjournal review.

Ideally there should be a step like make tests that checks that correct values are returned for some test case that covers a reasonable fraction of the software.

Referencing: openjournals/joss-reviews#3618

Floating-point exception when compiled in debug mode

Having modified the Makefile to compile with debug flags:

$ git diff makefile
diff --git a/makefile b/makefile
index 2ee2fed..db00548 100755
--- a/makefile
+++ b/makefile
@@ -30,13 +30,13 @@ F90 = gfortran
 # openMP #
 ##########

-OPTS = -fopenmp -O3 -ffixed-line-length-none  -fdefault-real-8
+#OPTS = -fopenmp -O3 -ffixed-line-length-none  -fdefault-real-8

 #########
 # debug #
 #########

-#OPTS = -g -fopenmp -fbacktrace -ffpe-trap=zero,overflow,underflow
+OPTS = -g -fopenmp -fbacktrace -ffpe-trap=zero,overflow,underflow

 #####################################
 #####################################

and running with the input-deck as provided I see floating-point errors:

...
 -----------------------------------------
 * Deduced parameters :
 N_x     =          205
 N_vx    =          801
 n0      =    1.0000000000000000E+019
 Te      =    11604258.709350331
 -----------------------------------------

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

Backtrace for this error:
#0  0x7f7becf1c2ed in ???
#1  0x7f7becf1b503 in ???
#2  0x7f7bec58203f in ???
#3  0x7f7becbe9ea4 in ???
#4  0x7f7becb721fe in ???
#5  0x55c2128020e5 in __library_MOD_init_simu
	at sources/library.f90:115
#6  0x55c212804e78 in esvm
	at sources/esvm.f90:47
#7  0x55c212805c8a in main
	at sources/esvm.f90:11
Floating point exception (core dumped)

Error when doing `make extract`

I got the following traceback with the latest version of the code. Apologies if this is due to an additional package that I need to install since my last attempt several weeks ago.

bash-3.2$ make extract
python3 sources/extract.py
Energy plot
Traceback (most recent call last):
  File "/Users/tclune/swdev/tmp/ESVM/sources/extract.py", line 77, in <module>
    fig.savefig('figures/energy_log.png',bbox_inches='tight')
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/figure.py", line 3015, in savefig
    self.canvas.print_figure(fname, **kwargs)
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/backend_bases.py", line 2230, in print_figure
    self.figure.draw(renderer)
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/artist.py", line 74, in draw_wrapper
    result = draw(artist, renderer, *args, **kwargs)
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/artist.py", line 51, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/figure.py", line 2790, in draw
    mimage._draw_list_compositing_images(
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/image.py", line 132, in _draw_list_compositing_images
    a.draw(renderer)
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/artist.py", line 51, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/_api/deprecation.py", line 431, in wrapper
    return func(*inner_args, **inner_kwargs)
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/axes/_base.py", line 2921, in draw
    mimage._draw_list_compositing_images(renderer, self, artists)
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/image.py", line 132, in _draw_list_compositing_images
    a.draw(renderer)
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/artist.py", line 51, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/axis.py", line 1142, in draw
    ticklabelBoxes, ticklabelBoxes2 = self._get_tick_bboxes(ticks_to_draw,
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/axis.py", line 1068, in _get_tick_bboxes
    return ([tick.label1.get_window_extent(renderer)
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/axis.py", line 1068, in <listcomp>
    return ([tick.label1.get_window_extent(renderer)
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/text.py", line 903, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/text.py", line 306, in _get_layout
    _, lp_h, lp_d = renderer.get_text_width_height_descent(
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/backends/backend_agg.py", line 229, in get_text_width_height_descent
    w, h, d = texmanager.get_text_width_height_descent(
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/texmanager.py", line 401, in get_text_width_height_descent
    page, = dvi
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/dviread.py", line 251, in __iter__
    while self._read():
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/dviread.py", line 331, in _read
    self._dtable[byte](self, byte)
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/dviread.py", line 174, in wrapper
    return method(self, *[f(self, byte-min) for f in get_args])
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/dviread.py", line 476, in _fnt_def
    self._fnt_def_real(k, c, s, d, a, l)
  File "/Users/tclune/installed/Core/homebrew/lib/python3.9/site-packages/matplotlib/dviread.py", line 483, in _fnt_def_real
    raise FileNotFoundError("missing font metrics file: %s" % fontname)
FileNotFoundError: missing font metrics file: cmss12
make: *** [extract] Error 1

Noisy output from `make extract`

This issue is part of the openjournal review.

make extract generates lots of output like:

/Users/tclune/swdev/tmp/ESVM/sources/extract.py:291: MatplotlibDeprecationWarning: shading='flat' when X and Y have the same dimensions as C is deprecated since 3.3.  Either specify the corners of the quadrilaterals with X and Y, or pass shading='auto', 'nearest' or 'gouraud', or set rcParams['pcolor.shading'].  This will become an error two minor releases later.
  plt.pcolormesh(X,VX,P,cmap=cmap,norm=norm,vmax=Maxval,vmin=Minval)

Not a deal breaker - just reporting to be thorough.

No references in paper?

Referencing: openjournals/joss-reviews#3618

JOSS wants: "References: Is the list of references complete, and is everything cited appropriately that should be cited (e.g., papers, datasets, software)? Do references in the text use the proper citation syntax?"

Statement of need

The statement of need does not explicitly state who the target audience is? All plasma researchers? Students? Researchers in a specific subdomain?

Missing community guidelines

Referencing: openjournals/joss-reviews#3618

JOSS wants: "Community guidelines: Are there clear guidelines for third parties wishing to 1) Contribute to the software 2) Report issues or problems with the software 3) Seek support" presumably in something like contrib.md. I think if you poke around at other projects you'll find some suitable boiler plate language for this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.