• Stars
    star
    469
  • Rank 92,904 (Top 2 %)
  • Language
    Julia
  • License
    MIT License
  • Created about 4 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Trixi.jl: Adaptive high-order numerical simulations of conservation laws in Julia

Trixi.jl

Docs-stable Docs-dev Slack Youtube Build Status Codecov Coveralls Aqua QA License: MIT DOI Downloads

Trixi.jl is a numerical simulation framework for hyperbolic conservation laws written in Julia. A key objective for the framework is to be useful to both scientists and students. Therefore, next to having an extensible design with a fast implementation, Trixi.jl is focused on being easy to use for new or inexperienced users, including the installation and postprocessing procedures. Its features include:

  • 1D, 2D, and 3D simulations on line/quad/hex/simplex meshes
    • Cartesian and curvilinear meshes
    • Conforming and non-conforming meshes
    • Structured and unstructured meshes
    • Hierarchical quadtree/octree grid with adaptive mesh refinement
    • Forests of quadtrees/octrees with p4est via P4est.jl
  • High-order accuracy in space and time
  • Discontinuous Galerkin methods
  • Compatible with the SciML ecosystem for ordinary differential equations
  • Native support for differentiable programming
  • Periodic and weakly-enforced boundary conditions
  • Multiple governing equations:
    • Compressible Euler equations
    • Magnetohydrodynamics (MHD) equations
    • Multi-component compressible Euler and MHD equations
    • Linearized Euler and acoustic perturbation equations
    • Hyperbolic diffusion equations for elliptic problems
    • Lattice-Boltzmann equations (D2Q9 and D3Q27 schemes)
    • Shallow water equations
    • Several scalar conservation laws (e.g., linear advection, Burgers' equation)
  • Multi-physics simulations
  • Shared-memory parallelization via multithreading
  • Visualization and postprocessing of the results
    • In-situ and a posteriori visualization with Plots.jl
    • Interactive visualization with Makie.jl
    • Postprocessing with ParaView/VisIt via Trixi2Vtk

Installation

If you have not yet installed Julia, please follow the instructions for your operating system. Trixi.jl works with Julia v1.8 and newer. We recommend using the latest stable release of Julia.

For users

Trixi.jl and its related tools are registered Julia packages. Hence, you can install Trixi.jl, the visualization tool Trixi2Vtk, OrdinaryDiffEq.jl, and Plots.jl by executing the following commands in the Julia REPL:

julia> using Pkg

julia> Pkg.add(["Trixi", "Trixi2Vtk", "OrdinaryDiffEq", "Plots"])

You can copy and paste all commands to the REPL including the leading julia> prompts - they will automatically be stripped away by Julia. The package OrdinaryDiffEq.jl provides time integration schemes used by Trixi.jl, while Plots.jl can be used to directly visualize Trixi.jl's results from the REPL.

Note on package versions: If some of the examples for how to use Trixi.jl do not work, verify that you are using a recent Trixi.jl release by comparing the installed Trixi.jl version from

julia> using Pkg; Pkg.update("Trixi"); Pkg.status("Trixi")

to the latest release. If the installed version does not match the current release, please check the Troubleshooting section in the documentation.

The commands above can also be used to update Trixi.jl. A brief list of notable changes to Trixi.jl is available in NEWS.md.

For developers

If you plan on editing Trixi.jl itself, you can download Trixi.jl locally and use the code from the cloned directory:

git clone [email protected]:trixi-framework/Trixi.jl.git
cd Trixi.jl
mkdir run
cd run
julia --project=. -e 'using Pkg; Pkg.develop(PackageSpec(path=".."))' # Install local Trixi.jl clone
julia --project=. -e 'using Pkg; Pkg.add(["OrdinaryDiffEq", "Trixi2Vtk", "Plots"])' # Install additional packages

Note that the postprocessing tools Trixi2Vtk.jl and Plots.jl are optional and can be omitted.

If you installed Trixi.jl this way, you always have to start Julia with the --project flag set to your run directory, e.g.,

julia --project=.

if already inside the run directory. Further details can be found in the documentation.

Usage

In the Julia REPL, first load the package Trixi.jl

julia> using Trixi

Then start a simulation by executing

julia> trixi_include(default_example())

Please be patient since Julia will compile the code just before running it. To visualize the results, load the package Plots

julia> using Plots

and generate a heatmap plot of the results with

julia> plot(sol) # No trailing semicolon, otherwise no plot is shown

This will open a new window with a 2D visualization of the final solution:

The method trixi_include(...) expects a single string argument with the path to a Trixi.jl elixir, i.e., a text file containing Julia code necessary to set up and run a simulation. To quickly see Trixi.jl in action, default_example() returns the path to an example elixir with a short, two-dimensional problem setup. A list of all example elixirs packaged with Trixi.jl can be obtained by running get_examples(). Alternatively, you can also browse the examples/ subdirectory. If you want to modify one of the elixirs to set up your own simulation, download it to your machine, edit the configuration, and pass the file path to trixi_include(...).

Note on performance: Julia uses just-in-time compilation to transform its source code to native, optimized machine code at the time of execution and caches the compiled methods for further use. That means that the first execution of a Julia method is typically slow, with subsequent runs being much faster. For instance, in the example above the first execution of trixi_include takes about 20 seconds, while subsequent runs require less than 60 milliseconds.

Showcase of advanced features

The presentation From Mesh Generation to Adaptive Simulation: A Journey in Julia, originally given as part of JuliaCon 2022, outlines how to use Trixi.jl for an adaptive simulation of the compressible Euler equations in two spatial dimensions on a complex domain. More details as well as code to run the simulation presented can be found at the reproducibility repository for the presentation.

Documentation

Additional documentation is available that contains more information on how to modify/extend Trixi.jl's implementation, how to visualize output files etc. It also includes a section on our preferred development workflow and some tips for using Git. The latest documentation can be accessed either online or under docs/src.

Referencing

If you use Trixi.jl in your own research or write a paper using results obtained with the help of Trixi.jl, please cite the following articles:

@article{ranocha2022adaptive,
  title={Adaptive numerical simulations with {T}rixi.jl:
         {A} case study of {J}ulia for scientific computing},
  author={Ranocha, Hendrik and Schlottke-Lakemper, Michael and Winters, Andrew Ross
          and Faulhaber, Erik and Chan, Jesse and Gassner, Gregor},
  journal={Proceedings of the JuliaCon Conferences},
  volume={1},
  number={1},
  pages={77},
  year={2022},
  doi={10.21105/jcon.00077},
  eprint={2108.06476},
  eprinttype={arXiv},
  eprintclass={cs.MS}
}

@article{schlottkelakemper2021purely,
  title={A purely hyperbolic discontinuous {G}alerkin approach for
         self-gravitating gas dynamics},
  author={Schlottke-Lakemper, Michael and Winters, Andrew R and
          Ranocha, Hendrik and Gassner, Gregor J},
  journal={Journal of Computational Physics},
  pages={110467},
  year={2021},
  month={06},
  volume={442},
  publisher={Elsevier},
  doi={10.1016/j.jcp.2021.110467},
  eprint={2008.10593},
  eprinttype={arXiv},
  eprintclass={math.NA}
}

In addition, you can also refer to Trixi.jl directly as

@misc{schlottkelakemper2020trixi,
  title={{T}rixi.jl: {A}daptive high-order numerical simulations
         of hyperbolic {PDE}s in {J}ulia},
  author={Schlottke-Lakemper, Michael and Gassner, Gregor J and
          Ranocha, Hendrik and Winters, Andrew R and Chan, Jesse},
  year={2021},
  month={09},
  howpublished={\url{https://github.com/trixi-framework/Trixi.jl}},
  doi={10.5281/zenodo.3996439}
}

Authors

Trixi.jl was initiated by Michael Schlottke-Lakemper (RWTH Aachen University/High-Performance Computing Center Stuttgart (HLRS), Germany) and Gregor Gassner (University of Cologne, Germany). Together with Hendrik Ranocha (Johannes Gutenberg University Mainz, Germany), Andrew Winters (Linköping University, Sweden), and Jesse Chan (Rice University, US), they are the principal developers of Trixi.jl. The full list of contributors can be found in AUTHORS.md.

License and contributing

Trixi.jl is licensed under the MIT license (see LICENSE.md). Since Trixi.jl is an open-source project, we are very happy to accept contributions from the community. Please refer to CONTRIBUTING.md for more details. Note that we strive to be a friendly, inclusive open-source community and ask all members of our community to adhere to our CODE_OF_CONDUCT.md. To get in touch with the developers, join us on Slack or create an issue.

Acknowledgments

This project has benefited from funding by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany's Excellence Strategy EXC 2044-390685587, Mathematics Münster: Dynamics-Geometry-Structure.

This project has benefited from funding by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) through the research unit FOR 5409 "Structure-Preserving Numerical Methods for Bulk- and Interface Coupling of Heterogeneous Models (SNuBIC)" (project number 463312734).

This project has benefited from funding from the European Research Council through the ERC Starting Grant "An Exascale aware and Un-crashable Space-Time-Adaptive Discontinuous Spectral Element Solver for Non-Linear Conservation Laws" (Extreme), ERC grant agreement no. 714487.

This project has benefited from funding from Vetenskapsrådet (VR, Swedish Research Council), Sweden through the VR Starting Grant "Shallow water flows including sediment transport and morphodynamics", VR grant agreement 2020-03642 VR.

This project has benefited from funding from the United States National Science Foundation under awards DMS-1719818 and DMS-1943186.

This project has benefited from funding from the German Federal Ministry of Education and Research through the project grant "Adaptive earth system modeling with significantly reduced computation time for exascale supercomputers (ADAPTEX)" (funding id: 16ME0668K).

More Repositories

1

HOHQMesh

High Order Hex-Quad Mesh (HOHQMesh) package to automatically generate all-quadrilateral meshes with high order boundary information.
Fortran
46
star
2

P4est.jl

P4est.jl is lightweight Julia wrapper for the p4est C library, which allows to manage multiple connected adaptive quadtrees/octrees in parallel.
Julia
35
star
3

HOHQMesh.jl

HOHQMesh.jl is a Julia wrapper for the HOHQMesh mesh generator, which allows to produce curved quadrilateral and hexahedral meshes for high-order numerical simulations.
Julia
28
star
4

TrixiParticles.jl

TrixiParticles.jl: Particle-based multiphysics simulations in Julia
Julia
23
star
5

ReadVTK.jl

Julia package for reading VTK XML files
Julia
17
star
6

paper-self-gravitating-gas-dynamics

A purely hyperbolic discontinuous Galerkin approach for self-gravitating gas dynamics
MATLAB
9
star
7

Trixi2Vtk.jl

Convert output files generated with Trixi.jl to VTK.
Julia
9
star
8

talk-2022-juliacon_toolchain

From Mesh Generation to Adaptive Simulation: A Journey in Julia at JuliaCon 2022
7
star
9

TrixiAtmo.jl

Simulation package for atmospheric models based on Trixi.jl
Julia
7
star
10

paper-2021-juliacon

Adaptive numerical simulations with Trixi.jl: A case study of Julia for scientific computing
TeX
6
star
11

TrixiShallowWater.jl

Shallow water simulations with Trixi.jl
Julia
6
star
12

PointNeighbors.jl

Julia
6
star
13

talk-2021-juliacon

Adaptive and extendable numerical simulations with Trixi.jl at JuliaCon 2021
Jupyter Notebook
6
star
14

tutorial-2021-icosahom

Trixi.jl: High-Order Numerical Simulations of Hyperbolic PDEs in Julia
Jupyter Notebook
5
star
15

talk-2021-julia-adaptive-multi-physics-simulations

Julia for adaptive high-order multi-physics simulations
Jupyter Notebook
4
star
16

TrixiStartup.jl

Experimental startup package for Trixi.jl to reduce latency for new users
Julia
4
star
17

TrixiBase.jl

Common functionality used by multiple Julia packages in the Trixi Framework
Julia
4
star
18

KROME.jl

KROME.jl is a lightweight Julia wrapper for KROME, a Fortran library for including chemistry and microphysics in astrophysics simulations.
Julia
3
star
19

TrixiBottomTopography.jl

Approximating real world data for bottom topographies
Julia
3
star
20

talk-2021-Introduction_to_Julia_and_Trixi

Introduction to Julia and Trixi, a numerical simulation framework for hyperbolic PDEs
Jupyter Notebook
3
star
21

Trixi2Img.jl

Create PDF/PNG images from 2D output files generated by Trixi.jl.
Julia
2
star
22

libtrixi

Interface library for using Trixi.jl from C/C++/Fortran
Julia
2
star
23

tutorial-2023-kassel

Companion repository for a tutorial on the Julia programming language and Trixi.jl, a Julia package for adaptive high-order numerical simulations of hyperbolic PDEs
Jupyter Notebook
2
star
24

smesh

A simple Fortran package for generating and handling unstructured triangular and polygonal meshes
Fortran
2
star
25

Smesh.jl

Smesh.jl is a lightweight wrapper of the Fortran package smesh for generation and handling of unstructured meshes
Julia
2
star
26

TrixiDebug.jl

Repository for debugging CI runs of Trixi.jl
Julia
1
star
27

add-pr-review-checklist

GitHub Action for adding a review checklist to newly created pull requests
1
star
28

Trixi2Vtk_reference_files

Reference VTK files for testing of Trixi2Vtk.jl
1
star
29

p4est-bindings-clang-jl

An attempt to create p4est bindings using Clang.jl
Julia
1
star
30

paper-2022-robustness-entropy-projection

Reproducibility repository for the paper "On the entropy projection and the robustness of high order entropy stable discontinuous Galerkin schemes for under-resolved flows"
Julia
1
star
31

FTObjectLibrary

A Fortran library for reference counted object and container classes.
Fortran
1
star
32

P4est_jll_bindings

Generate and host Julia bindings for the p4est library provided by P4est_jll.jl
Julia
1
star
33

trixi-with-different-julia-versions

Roff
1
star
34

TrixiTutorials

Tutorials for Trixi.jl
Julia
1
star
35

trixi-framework.github.io

JavaScript
1
star
36

tutorial-2023-snubic

Companion repository for a tutorial on the Julia programming language and Trixi.jl
Jupyter Notebook
1
star
37

TrixiTestCI.jl

Repo for CI testing
Julia
1
star
38

Trixi_IndicatorNeuralNetwork_networks

Pre-trained neural networks for the IndicatorNeuralNetwork shock indicator in Trixi.jl
1
star
39

paper-2022-stepsize_control

Reproducibility repository for "On error-based step size control for discontinuous Galerkin methods for compressible fluid dynamics"
Julia
1
star
40

paper-2021-EC_performance

Reproducibility repository for "Efficient implementation of modern entropy stable and kinetic energy preserving discontinuous Galerkin methods for conservation laws"
Julia
1
star
41

paper-EC-KEP-PEP

Reproducibility: Preventing pressure oscillations does not fix local linear stability issues of entropy-based split-form high-order schemes
Jupyter Notebook
1
star
42

SmartShockFinder.jl

Create troubled cell indicators for Trixi.jl using artificial neural networks
Julia
1
star
43

paper-2024-generalized-upwind-sbp

Reproducibility repository for the paper "Generalized upwind summation-by-parts operators and their application to nodal discontinuous Galerkin methods"
Julia
1
star