Giter Club home page Giter Club logo

gradientrobustmultiphysics.jl's Introduction

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

!!! note

This package is not further developed. There is a new package in development called [ExtendableFEM.jl](https://github.com/chmerdon/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/chmerdon/ExtendableFEMBase.jl).

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 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
  • 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 (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
  • export into csv files (or vtk files via WriteVTK.jl interface of ExtendableGrids.jl)

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.