Home

Awesome

GridapGmsh <img src="https://github.com/gridap/Gridap.jl/blob/master/images/color-logo-only.png" width="40" title="Gridap logo">

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

SetFactory("OpenCASCADE");
//+
Disk(1) = {0, 0, 0, 0.5, 0.5};
Physical Surface("disk", 3) = {1};
Physical Curve("boundary", 4) = {1};
Physical Point("boundary", 5) = {1};

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.