GradientRobustMultiPhysics.jl

Finite Element Module for Julia that focusses on gradient-robust discretisations and multiphysics problems
Author chmerdon
Popularity
5 Stars
Updated Last
1 Year Ago
Started In
December 2019

Build status DOI

GradientRobustMultiPhysics.jl

finite element module for Julia focussing on gradient-robust finite element methods and multiphysics applications, part of the meta-package PDELIB.jl

Features/Limitations:

  • solves 1D, 2D and 3D problems in Cartesian coordinates
  • uses type-treed FiniteElements (scalar or vector-valued)
    • H1 elements (so far P1, P2, P2B, P3, MINI, CR, BR)
    • Hdiv elements (so far RT0, BDM1, RT1)
    • Hcurl elements (so far N0)
  • finite elements can be broken (e.g. piecewise Hdiv) or live on faces or edges (experimental feature)
  • grids by ExtendableGrids.jl, allows mixed element geometries in the grid (simplices and quads atm)
  • PDEDescription module for easy and close-to-physics problem description and discretisation setup
  • PDEDescription recognizes nonlinear operators and automatically devises fixed-point or Newton algorithms by automatic differentation (experimental feature)
  • time-dependent solvers by own backward Euler implementation or via external module DifferentialEquations.jl (experimental)
  • reconstruction operators for gradient-robust Stokes discretisations (BR>RT0/BDM1 in 2D/3D, or CR>RT0 in 2D, more in progress)
  • plotting via GridVisualize.jl
  • export into csv or vtk datafiles possible for external plotting

Example

The following example demonstrates how to setup a Poisson problem. More extensive examples can be found in the documentation.

using GradientRobustMultiPhysics

# build/load any grid (here: a uniform-refined 2D unit square into triangles)
xgrid = uniform_refine(grid_unitsquare(Triangle2D),4)

# create empty PDE description
Problem = PDEDescription("Poisson problem")

# add unknown(s) (here: "u" that gets id 1 for later reference)
add_unknown!(Problem; unknown_name = "u", equation_name = "Poisson equation")

# add left-hand side PDEoperator(s) (here: only Laplacian)
add_operator!(Problem, [1,1], LaplaceOperator(diffusion; AT = ON_CELLS))

# add right-hand side data (here: f = [1] in region(s) [1])
add_rhsdata!(Problem, 1, RhsOperator(Identity, [1], DataFunction([1]; name = "f"); AT = ON_CELLS))

# add boundary data (here: zero data for boundary regions 1:4)
add_boundarydata!(Problem, 1, [1,2,3,4], HomogeneousDirichletBoundary)

# discretise = choose FEVector with appropriate FESpaces
FEType = H1P2{1,2} # quadratic element with 1 component in 2D
Solution = FEVector{Float64}("u_h",FESpace{FEType}(xgrid))

# inspect problem and Solution vector structure
@show Problem Solution

# solve
solve!(Solution, Problem)

Installation

via Julia package manager in Julia 1.5 or above:

# latest stable version
(@v1.5) pkg> add GradientRobustMultiPhysics
# latest version
(@v1.5) pkg> add GradientRobustMultiPhysics#master

Dependencies on other Julia packages:

ExtendableGrids.jl
GridVisualize.jl
ExtendableSparse.jl
DocStringExtensions.jl
ForwardDiff.jl
DiffResults.jl
WriteVTK.jl
StaticArrays.jl

Used By Packages