Giter VIP home page Giter VIP logo

alps's Introduction

DOI build

ALPS: The Arbitrary Linear Plasma Solver

This is the ALPS code: the Arbitrary Linear Plasma Solver.

drawing

drawing

Authors

Kristopher Klein ([email protected])
Daniel Verscharen ([email protected])

Contents

  1. What is ALPS?
  2. Acknowledgements
  3. Installing the ALPS Code
  4. Running the ALPS Code
  5. License

1. What is ALPS?

ALPS is a parallelised numerical code that solves the Vlasov-Maxwell dispersion relation in hot (even relativistic) magnetised plasma. ALPS allows for any number of particle species with arbitrary gyrotropic background distribution functions supporting waves with any direction of propagation with respect to the background magnetic field.

If you use the code for a science publication,

  1. please provide the code website github.com/danielver02/ALPS in the acknowledgements,
  2. cite the DOI of the code:
@software{alps_2023_8075682,
  author       = {{Klein}, K. G. and
                  {Verscharen}, D. and
                  {Koskela}, T. and
                  {Stansby}, D.},
  title        = {danielver02/ALPS: Zenodo release},
  month        = jun,
  year         = 2023,
  publisher    = {Zenodo},
  version      = {v1.0.1},
  doi          = {10.5281/zenodo.8075682},
  url          = {https://doi.org/10.5281/zenodo.8075682}
}
  1. and cite the code paper:

Verscharen, D., Klein, K. G., Chandran, B. D. G., Stevens, M. L., Salem, C. S., and Bale, S. D.: ALPS: the Arbitrary Linear Plasma Solver, J. Plasma Phys. 84, 905840403, 2018, doi: 10.1017/S0022377818000739

The documentation of the code can be found on alps.space.

2. Acknowledgements

The development of the ALPS code was supported by NASA Grant NNX16AG81G. The code developers appreciate support from the UK Science and Technology Facilities Council (STFC) Ernest Rutherford Fellowship ST/P003826/1, STFC Consolidated Grants ST/S000240/1 and ST/W001004/1, and the Open Source Software Sustainability Funding programme from UCL's Advanced Research Computing Centre and UCL's eResearch Domain. We appreciate software engineering support by David Stansby and Tuomas Koskela from UCL.

3. Installing the ALPS code

For advice on the installation of the code, please check INSTALL.md

4. Running the ALPS code

ALPS works with input files that specify the plasma and numerical parameters for the calculation. We recommend that you start by checking out the provided test cases as a guidance for the creation of input files. These test cases are listed in the scripts run_test.sh and run_test_suite.sh in the subfolder ./tests. All associated input files have a name starting with test_.

You can execute the ALPS code through the following command:

mpirun -np <NP> ./src/ALPS <input_file.in>

where <NP> is the number of processors you want to use. This number must be greater than or equal to 4, and it must be an even number. <input_file.in> is the input file that includes all parameters for your run.

On some systems, depending on the MPI configuration, the oversubscribe flag is required. In this case, the above command must be replaced with

mpirun -np <NP> --oversubscribe ./src/ALPS <input_file.in>

For first-time users, we recommend working through our ALPS Tutorial. The key input parameters for ALPS are described on the ALPS Input page. The output format of ALPS is described on the ALPS Output page.

5. License

BSD 2-Clause License

Copyright (c) 2023, Kristopher G. Klein and Daniel Verscharen All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

alps's People

Contributors

aarontran avatar danielver02 avatar dstansby avatar joejiang2023 avatar kgklein avatar t-young31 avatar tkoskela avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

alps's Issues

Improved Root Tracing

Add a flag that will allow the root tracing algorithm to use an extrapolation method to guess the next frequency value, rather than simply using the previous frequency value.

Alternative Analytic Continuation Method

Add a functionality to allow for orthogonal polynomials to be used for the analytic continuation, rather than the prescribed fit functions.
This is to be done with a general linear least squares method, and it currently being tested in the polynomial_v00 branch of the code.

Log-fitting is not working correctly

The log-fitting takes the log of f0, but then it fits the normal functions to it. The problem happens in ALPS_analyt.f90 in the function determine_JT. The derivatives of the function with respect to the fit parameters must be taken of the log of the function if logfit is set to TRUE.

Set boundaries to LM fit

At the moment, the LM fitting routine for the analytic continuation is free to find any values for the fit parameters. If possible, we should allow the user to set a boundary on the fit parameters. For instance, they may want to choose that only positive density values are permitted. With positive density values only, the logfit would not return NaN when applied during the fit evaluation.

Check correctness of tests

Currently my understanding is the tests run but no check is made, other than the executable exited with status 0 (ie. didn't crash). We should add some checks on the correctness of the results. You could rewrite the tests using an unit testing framework (pFunit is a popular framework), but setting it up can be a bit heavy. An easier option is to store reference output files and when the tests run, compare values from the output to those in the reference. The comparison script can be written in any language, as an example I've set up a testsuite with a shell script to run tests and a python script to check correctness in a different Fortran project.

Create Tutorial

Write a mark down file that explains the basic steps to run ALPS.

Jumps in dispersion relation at high kperp

At high kperp, the dispersion relation sometimes exhibits jumps in the frequency and growth rate solutions. A change to positions_principal and n_resonance_interval does not mitigate this significantly.

If these jumps occur, they usually occur at the same kperp, independently of kpar. This suggests that they are related to the Bessel function routine at high kperp.

This problem primarily occurs when the code calculates high-frequency electron waves. It especially occurs also when working in electron mode for these solutions.

Remove unused routines

Look for routines that we actually don’t use anywhere anymore (like old secant method) and remove when necessary. Also remove the use_secant flag in all input files.
Check any licensing issues with code from external sources.

Solutions diverge due to domegadk extrapolation

Under some conditions, the new domegadk feature, which extrapolates the new initial guess based on the previous solution in of the dispersion relation, diverges. The code then loses a given mode and presents a diverging solution for which the frequency goes to +/- infinity until the code crashes.

We should include a safeguard to check that the derivative domegadk does not lead to such a diverging solution.

We could also add a user command that allows to turn the feature on or off as needed. In some examples, the code works much better with this feature, especially when crossing through gamma=0.

The feature has been disabled for now.

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.