gridap / GridapGmsh.jl

Gmsh generated meshes for Gridap
MIT License
42 stars 20 forks source link

GridapGmsh

Build Status Codecov

Demo

Solve a Poisson problem with Gridap on top of a Finite Element mesh generated by GMSH. The mesh includes two physical groups, "boundary1" and "boundary2", which are used to define boundary conditions. This is just a simple demo. Once the GMSH mesh is read, all the magic of Gridap can be applied to it.

using Gridap
using GridapGmsh
model = GmshDiscreteModel("demo/demo.msh")
order = 1
reffe = ReferenceFE(lagrangian,Float64,order)
V = TestFESpace(model,reffe,dirichlet_tags=["boundary1","boundary2"])
U = TrialFESpace(V,[0,1])
Ω = Triangulation(model)
dΩ = Measure(Ω,2*order)
a(u,v) = ∫( ∇(v)⋅∇(u) )dΩ
l(v) = 0
op = AffineFEOperator(a,l,U,V)
uh = solve(op)
writevtk(Ω,"demo",cellfields=["uh"=>uh])

Installation

GridapGmsh is a registered package in the official Julia package registry. Thus, the installation is done using the Julia's package manager. Open the Julia REPL, type ] to enter package mode, and install as follows

pkg> add GridapGmsh

Installation requirements

GridapGmsh requires GMSH. There are two possible ways to install the GMSH dependency:

  1. [Recommended] Do nothing (automatically installation). GridapGmsh will download a GMSH binary via BinaryBuilder, which then is installed to your ~/.julia/artifacts directory, this should work fine in the most cases.

  2. [Fallback] Set an environment variable called GMSHROOT containing the path to the location of the root folder of a GMSH-SDK installation. The GMSH Software Development Kit (SDK) available at gmsh.info. Make sure that: $GMSHROOT/bin/gmsh is the path of the GMSH binary and $GMSHROOT/lib/gmsh.jl is the path of the GMSH Julia API.

Gotchas

How to cite Gridap

In order to give credit to the Gridap contributors, we simply ask you to cite the reference below in any publication in which you have made use of Gridap packages:

@article{Badia2020,
  doi = {10.21105/joss.02520},
  url = {https://doi.org/10.21105/joss.02520},
  year = {2020},
  publisher = {The Open Journal},
  volume = {5},
  number = {52},
  pages = {2520},
  author = {Santiago Badia and Francesc Verdugo},
  title = {Gridap: An extensible Finite Element toolbox in Julia},
  journal = {Journal of Open Source Software}
}

Contact

Please, contact the project administrators, Santiago Badia and Francesc Verdugo, for further questions about licenses and terms of use.