Home

Awesome

Build status DOI

Note

This package is not further developed. There is a new package in development called ExtendableFEM.jl that incorporates all functionality and offers a more flexible API and generally faster assembly times. Please inform the developers or open an issue there if some functionality is missing or in case you have problems to transition an old project to the new code. The low level finite element structures were outsourced to the new package ExtendableFEMBase.jl.

GradientRobustMultiPhysics.jl

finite element module for Julia focussing on gradient-robust finite element methods and multiphysics applications

Features/Limitations:

Quick Example

The following minimal example demonstrates how to setup a Poisson problem.

using GradientRobustMultiPhysics
using ExtendableGrids

# 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 with diffusion coefficient 1e-3)
add_operator!(Problem, [1,1], LaplaceOperator(1e-3))

# define right-hand side function (as a constant DataFunction, x and t dependency explained in documentation)
f = DataFunction([1]; name = "f")

# add right-hand side data (here: f = [1] in region(s) [1])
add_rhsdata!(Problem, 1, LinearForm(Identity, f; regions = [1]))

# 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(FESpace{FEType}(xgrid); name = "u_h")

# inspect problem and Solution vector structure
@show Problem Solution

# solve
solve!(Solution, Problem)

Other Examples

More extensive examples can be found in the documentation and interactive Pluto notebooks can be found in the subfolder examples/pluto for download.

Installation

via Julia package manager in Julia 1.6 or above:

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

Dependencies on other Julia packages:

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