[ANN] Gridap.jl 0.15 comes with major enhancements!

After months of work, the Gridap developers are happy to announce the Gridap v0.15 release :rocket:!

This new version comes with major improvements in the user API (and also in the library internals). The most exciting novelty is how the user writes the weak form. Now, it should be as easy as “copying” it from the paper. Gridap will automatically generate an efficient Finite Element assembly loop for you, thanks to the awesome Julia JIT compiler.

Examples

Here is how the weak form of some well-known PDEs can be specified with the new Gridap API.

Poisson equation with a source term and a Neumann boundary condition

(see complete code here)

f(x) = 1.0
h(x) = 3.0
a(u,v) = ∫( ∇(v)⋅∇(u) )*dΩ
l(v) = ∫( v*f )*dΩ + ∫( v*h )*dΓ

Linear elasticity without body forces

(see complete code here)

E = 70.0e9;
ν = 0.33
λ = (E*ν)/((1+ν)*(1-2*ν))
μ = E/(2*(1+ν))
σ(ε) = λ*tr(ε)*one(ε) + 2*μ*ε
a(u,v) = ∫( ε(v) ⊙ (σ∘ε(u)) )*dΩ
l(v) = 0

Incompressible Navier-Stokes equation

(see complete code here)

Re = 10.0
res((u,p),(v,q)) = ∫( v⋅(Re*u⋅∇(u)) + ∇(v)⊙∇(u) - (∇⋅v)*p + q*(∇⋅u) )*dΩ

Poisson equation discretized with DG

(see complete code here)

a(u,v) =
  ∫( ∇(v)⋅∇(u) )*dΩ +
  ∫( (γ/h)*v*u  - v*(n_Γ⋅∇(u)) - (n_Γ⋅∇(v))*u )*dΓ +
  ∫( (γ/h)*jump(v*n_Λ)⋅jump(u*n_Λ) -
    jump(v*n_Λ)⋅mean(∇(u)) -
    mean(∇(v))⋅jump(u*n_Λ) )*dΛ

l(v) =
  ∫( v*f )*dΩ +
  ∫( (γ/h)*v*u - (n_Γ⋅∇(v))*u )*dΓ

Stokes equation with an equal order DG

(see complete code here)

a((u,p),(v,q)) =
  ∫( ∇(v)⊙∇(u) - ∇(q)⋅u + v⋅∇(p) )*dΩ +
  ∫( (γ/h)*v⋅u - v⋅(n_Γ⋅∇(u)) - (n_Γ⋅∇(v))⋅u + 2*(q*n_Γ)⋅u )*dΓ +
  ∫( (γ/h)*jump(v⊗n_Λ)⊙jump(u⊗n_Λ) -
      jump(v⊗n_Λ)⊙mean(∇(u)) -
      mean(∇(v))⊙jump(u⊗n_Λ)  +
      (γ0*h)*jump(q*n_Λ)⋅jump(p*n_Λ) +
      jump(q*n_Λ)⋅mean(u) -
      mean(v)⋅jump(p*n_Λ)
   )*dΛ

l((v,q)) =
  ∫( v⋅f + q*g )*dΩ +
  ∫( (γ/h)*v⋅u - (n_Γ⋅∇(v))⋅u + (q*n_Γ)⋅u )*dΓ

How to get started?

If you are further interested in the project, visit the Gridap.jl repository. Consider to give us an :star:!

If you want to start learning how to solve PDEs with Gridap.jl, visit our Tutorials repository.

You are welcome to interact with the Gridap community via our Gitter chat.

Do you want to collaborate?

We are open to scientific collaborations with research groups willing to use Gridap for their research. We can collaborate, e.g., to add new functionality to the library and to write scientific publications resulting from it.

50 Likes

Just stumbled onto this… Just wanted to say that this looks brilliant!

Quick question: A lot of epidemic models are naturally written as integro-differential equations e.g. time since infection models where the rate of infectious contacts might be proportional to

R(t) \int_0^\infty I(t,\tau) w(\tau) d\tau

Where the generation time distribution w(\tau) governs how infectious contacts distribute over time since an individual was infected \tau, and the instantaneous reproductive number R(t) covers changes in transmission over calendar time.

Do you think that Gridap.jl can easily solve these models?

Hi @SamBrand!

Gridap is designed to solve PDEs via various types of Finite Element methods.

For ODEs check out DifferentialEquations.jl

Offtopic, but do you have a particular resource in studying integro-differential equations within the context of epidemiology?

I’d say no. You can. try ApproxFun though

Cheers!

DifferentialEquations.jl ecosystem is brilliant, but the time-since-infection model sort of falls inbetween ODEs and PDEs.

A vanilla version of time-since-infection could be written as:

\partial_t S(t) = - \frac{S(t)}{N} R(t) \int_0^\infty I(t,\tau) w(\tau) d \tau, \\ \partial_t I(t,\tau) + \partial_\tau I(t,\tau) = 0, \\ I(t,0) = \frac{S(t)}{N} R(t) \int_0^\infty I(t,\tau)w(\tau) d \tau .

I have solved these sorts of equations using just standard discretisation. But always wondered if you could just drop them into a more sophisticated FEM solver…

1 Like

Hi @affans .

The classic reference for me wrt to this sort of epi model is O. Diekmann, J. A. P. Heesterbeek, Mathematical epidemiology of infectious diseases (Wiley, 2000).

Although, just for your awareness, they use the equivalent formulation where you model the incidence (i.e. rate of new infections) and integrate over the past rather than the current density of people who were infected in the past. So the the equations look slightly different.

3 Likes