https://github.com/chmerdon/gradientrobustmultiphysics.jl
Finite Element Module for Julia that focusses on gradient-robust discretisations and multiphysics problems
https://github.com/chmerdon/gradientrobustmultiphysics.jl
finite-element-methods julia multiphysics
Last synced: 7 days ago
JSON representation
Finite Element Module for Julia that focusses on gradient-robust discretisations and multiphysics problems
- Host: GitHub
- URL: https://github.com/chmerdon/gradientrobustmultiphysics.jl
- Owner: chmerdon
- License: other
- Created: 2019-12-19T15:02:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T15:22:07.000Z (6 months ago)
- Last Synced: 2025-04-15T15:05:22.242Z (7 days ago)
- Topics: finite-element-methods, julia, multiphysics
- Language: Julia
- Homepage:
- Size: 143 MB
- Stars: 21
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://github.com/chmerdon/GradientRobustMultiPhysics.jl/actions)
[](https://chmerdon.github.io/GradientRobustMultiPhysics.jl/stable/index.html)
[](https://chmerdon.github.io/GradientRobustMultiPhysics.jl/dev/index.html)
[](https://zenodo.org/badge/latestdoi/229078096)# Note
This package is not further developed. There is a new package in development called [ExtendableFEM.jl](https://github.com/WIAS-PDELib/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](https://github.com/WIAS-PDELib/ExtendableFEMBase.jl).
## GradientRobustMultiPhysics.jl
finite element module for Julia focussing on gradient-robust finite element methods and multiphysics applications
### Features/Limitations:
- solves 1D, 2D and 3D problems in Cartesian coordinates
- several available finite elements (scalar and vector-valued, H1, Hdiv and Hcurl on different geometries), see [here](https://chmerdon.github.io/GradientRobustMultiPhysics.jl/stable/fems/) for a complete list
- finite elements can be broken (e.g. piecewise Hdiv) or live on faces or edges (experimental feature)
- grids by [ExtendableGrids.jl](https://github.com/j-fu/ExtendableGrids.jl)
- PDEDescription module for easy and close-to-physics problem description (as variational equations) independent from the actual discretisation
- Newton terms for nonlinear operators are added automatically by automatic differentiation (experimental feature)
- solver can run fixed-point iterations between subsets of equations of the PDEDescription
- time-dependent problems can be integrated in time by internal backward Euler or Crank-Nicolson implementation or via the external module [DifferentialEquations.jl](https://github.com/SciML/DifferentialEquations.jl) (experimental)
- reconstruction operators for gradient-robust Stokes discretisations (BR->RT0/BDM1 or CR->RT0 in 2D/3D, and P2B->RT1/BDM2 in 2D, more to come)
- plotting via functionality of [GridVisualize.jl](https://github.com/j-fu/GridVisualize.jl)
- export into csv files (or vtk files via [WriteVTK.jl](https://github.com/jipolanco/WriteVTK.jl) interface of [ExtendableGrids.jl](https://github.com/j-fu/ExtendableGrids.jl))### Quick Example
The following minimal example demonstrates how to setup a Poisson problem.
```julia
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](https://chmerdon.github.io/GradientRobustMultiPhysics.jl/stable/index.html)
and interactive [Pluto](https://github.com/fonsp/Pluto.jl) notebooks can be found in the subfolder examples/pluto for download.### Installation
via Julia package manager in Julia 1.6 or above:```@example
# latest stable version
(@v1.6) pkg> add GradientRobustMultiPhysics
# latest version
(@v1.6) pkg> add GradientRobustMultiPhysics#master
```### Dependencies on other Julia packages:
[ExtendableGrids.jl](https://github.com/j-fu/ExtendableGrids.jl)\
[GridVisualize.jl](https://github.com/j-fu/GridVisualize.jl)\
[ExtendableSparse.jl](https://github.com/j-fu/ExtendableSparse.jl)\
[DocStringExtensions.jl](https://github.com/JuliaDocs/DocStringExtensions.jl)\
[ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl)\
[DiffResults.jl](https://github.com/JuliaDiff/DiffResults.jl)\
[StaticArrays.jl](https://github.com/JuliaArrays/StaticArrays.jl)