Skip to content

Add finite element or spectral element simulation capability #82

Closed as not planned

Description

@namurphy

Finite difference methods work really well for a lot of problems, but there are some problems that they are not well suited for. Finite element and spectral element schemes have the advantage of considerable geometric flexibility, which makes them highly suitable for simulating toroidal confinement devices with round-ish/triangular-ish cross sections or otherwise non-trivial geometry. It would be great if we had finite element plasma simulation capabilities in addition to finite difference capabilities. I am sure we will need multiple methods since different methods will be most suitable for different problems (e.g., finite elements are not the greatest at capturing shocks).

It would be advantageous if we could build upon an existing package. Possibilities include (but are not limited to):

  • FEnicS: "FEniCS is a popular open-source (LGPLv3) computing platform for solving partial differential equations (PDEs). FEniCS enables users to quickly translate scientific models into efficient finite element code."
  • MFEM: "a free, lightweight, scalable C++ library for finite element methods" with python bindings though PyMFEM. This was suggested in Discretization/Solver Libraries #66.

The package(s) that we use should have the following qualities:

  • Easy to use
  • Open source under a permissive license
  • Really well integrated into Python
    • Can be installed easily using tools like conda (which was easy to do for FEnicS, at least)
  • Allows users to produce highly readable/maintainable code
  • High performance on devices ranging from laptops (or cell phones?) to gigantic megacomputers from science fiction that for some reason still use punchcards
  • Flexible, so that it is easy to change the system of equations
  • Stable API
  • Well suited to handling stiff systems of equations
    • As an example, semi-implicit schemes can use an implicit time advance to cover the shortest timescale behavior, with an explicit time advance for longer timescale behavior
  • Has an active user/developer community
  • Easy to use (repeating here, but I'd say this is even more important than performance)

We can also learn from existing really powerful plasma simulation codes that are written in Fortran, including:

Some of these codes can be used in Python via OMFIT, though I believe most or all of these codes and OMFIT require signing a user agreement form before getting access.

This is a very long term project, so this might be best saved until v0.2 or later.

Activity

  1. added
    effort: highRequiring perhaps ∼1–2 weeks. Can this be split up into multiple smaller/focused issues?
    feature requestIssues requesting a new feature or enhancement
    wish list 🌠Desired but not planned features or improvements
    on Aug 3, 2017
  2. added this to the milestone on Aug 3, 2017
  3. tulasinandan commented on Aug 22, 2017

    @tulasinandan

    I'm working on a spectral Hall-MHD code.

  4. added
    effort: very highRequiring ≳2 weeks. Can this be split up into multiple smaller/focused issues?
    and removed
    effort: highRequiring perhaps ∼1–2 weeks. Can this be split up into multiple smaller/focused issues?
    on Sep 19, 2017
  5. StanczakDominik commented on Oct 31, 2017

    @StanczakDominik
    Member

    There's a MOOC on edX on FEniCS I'm looking to participate in. I'll see how hard it would be to get something working with that.

  6. Cadair commented on Oct 31, 2017

    @Cadair
    Contributor

    fwiw, I met a FEniCS person recently, it looks very cool and is also a NumFOCUS project.

  7. modified the milestones: v0.2.0, Future on Oct 16, 2018
  8. github-actions commented on Dec 16, 2023

    @github-actions

    This issue will be closed in 90 days due to five years of inactivity unless the stale label or comment is removed.

  9. added
    StaleDormant issues & PRs which will be automatically closed if the label is not removed.
    on Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleDormant issues & PRs which will be automatically closed if the label is not removed.effort: very highRequiring ≳2 weeks. Can this be split up into multiple smaller/focused issues?feature requestIssues requesting a new feature or enhancementplasmapy.formularyRelated to the plasmapy.formulary subpackagewish list 🌠Desired but not planned features or improvements

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions