Skip to content

xkykai/TwoDG.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

183 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TwoDG.jl

Build Status License: MIT

A high-performance Julia framework for solving 2D partial differential equations using advanced finite element methods.

Cool Visuals


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)

Overview

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.

Key Features

  • 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

What Can You Do With It?

  • 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

Quick Example

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)

Getting Started

Explore the example scripts in src/Apps/ to see the solvers in action:

  • runhdg_poisson.jl - Poisson equation convergence studies
  • runwavescattering.jl - Wave scattering on circular domains
  • runeulerchannel.jl - Compressible Euler equations with shocks
  • runconvection.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.

About

2D Discontinuous Galerkin Method in Julia

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors