A high-performance Julia framework for solving 2D partial differential equations using advanced finite element methods.
Compressible flow through a channel with a bump computed with 2D Euler equations showing evolution of Mach number
Pressure coefficient of a potential flow solution (left) and convection-diffusion solution on an unstructured mesh with Hybridizable Discontinuous Galerkin (HDG) (right)
TwoDG.jl provides a unified implementation of three powerful discretization schemes for 2D PDEs:
- Continuous Galerkin (CG) - Traditional continuous finite elements
- Discontinuous Galerkin (DG) - High-order explicit time-stepping methods
- Hybridizable Discontinuous Galerkin (HDG) - Efficient implicit solvers with static condensation and parallel capabilities
Whether you're studying wave propagation, compressible flows, or convection-diffusion phenomena, TwoDG.jl offers the numerical tools to tackle these problems with arbitrary polynomial orders and sophisticated error analysis.
- Multiple PDE Types: Poisson, convection-diffusion, wave equations, and Euler equations
- High-Order Accuracy: Arbitrary polynomial order support (p-refinement) with Koornwinder orthogonal basis
- Efficient HDG: Static condensation dramatically reduces system size compared to standard DG
- Parallel HDG Solver: Multi-threaded assembly and solving for large-scale problems
- Rich Mesh Support: Built-in generators for squares, circles, L-shapes, NACA airfoils, and more
- Comprehensive Examples: Convergence studies, wave scattering, channel flows, and transport problems
- Performance Optimized: Inline functions and careful pre-allocation for computational efficiency
- Run convergence studies to verify optimal rates across different polynomial orders
- Compare discretization methods (CG vs DG vs HDG) on the same problems
- Simulate wave scattering on complex geometries with absorption boundaries
- Solve compressible flow problems including shock waves in channels
- Analyze convection-diffusion transport with various stabilization parameters
- Develop new numerical methods using the extensible master element framework
using TwoDG
# Generate a mesh for your domain
mesh = squaremesh_rsquare(1.0, 5) # 1x1 square, 5 elements per side
# Solve a Poisson problem with HDG
# (Check out examples in src/Apps/ for complete scripts)Explore the example scripts in src/Apps/ to see the solvers in action:
runhdg_poisson.jl- Poisson equation convergence studiesrunwavescattering.jl- Wave scattering on circular domainsruneulerchannel.jl- Compressible Euler equations with shocksrunconvection.jl- Pure convection with DG explicit time-stepping
Perfect for researchers in numerical analysis, students learning finite element methods, or anyone needing a flexible high-order PDE solver in Julia.