Coder Social home page Coder Social logo

gridapgmsh.jl's Introduction

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

  • Gmsh does not allow to include entities of different dimension in the same physical group. In order to overcome this limitation, all physical groups defined in Gmesh with the same name will be merged in the same physical tag independently of their dimension.

  • Conceptually closed domains such as circles or sphere-shells may require explicit addition of the technical boundary to the physical group. Example: For a properly functioning 2D disk mesh with labelled circumference write

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};
  • Vertices are always assigned to the corresponding CAD entity. However, this is not true for higher dimensional objects (i.e., edges, faces, cells). The later objects are associated with the right CAD entity if and only if they are present in a physical group of the same dimension of the object. If the object does not belong to a physical group of the same dimension, but it belongs to the closure of a higher dimensional object appearing in a physical group, then the low dimensional object receives the CAD id of the high dimensional object. If several high dimensional objects fulfill this requirement, we choose one arbitrary of the lowest dimension possible. This ensures, that edges and faces are assigned to the right CAD entity if the are in the interior of the CAD entity. The same is not true if the object is on the boundary of the CAD entity. In this case, include the corresponding object in a physical group if the right CAD ids are required.

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.

gridapgmsh.jl's People

Contributors

fverdugo avatar victorsndvg avatar santiagobadia avatar eschnett avatar amartinhuertas avatar c-schubert avatar github-actions[bot] avatar ericneiva avatar jonasisensee avatar juliatagbot avatar

Watchers

James Cloos avatar

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.