everything you always wanted to know about 1oomph-lib but ......everything you always wanted to know...

206
Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan Boyle, Andy Gait, Richard Muddle, Cedric Ody, Floraine Cordier, ... School of Mathematics, University of Manchester http://www.oomph-lib.org Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but we

Upload: others

Post on 06-Aug-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Everything you always wanted to know aboutoomph-lib but were afraid to ask

Matthias Heil, Andrew L. Hazel

Jonathan Boyle, Andy Gait, Richard Muddle, Cedric Ody, Floraine Cordier, ...

School of Mathematics, University of Manchester

http://www.oomph-lib.org

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 2: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

OverviewI Background

I Theory

I Implementation

I Application

I How to get started

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 3: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

OverviewI Background

I Why did we write it?I What is it?

I Theory

I Implementation

I Application

I How to get started

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 4: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

OverviewI Background

I Why did we write it?I What is it?

I TheoryI The mathematical framework

I Implementation

I Application

I How to get started

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 5: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

OverviewI Background

I Why did we write it?I What is it?

I TheoryI The mathematical framework

I ImplementationI What is object-orientation and why is it good for you?

I Application

I How to get started

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 6: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

OverviewI Background

I Why did we write it?I What is it?

I TheoryI The mathematical framework

I ImplementationI What is object-orientation and why is it good for you?

I ApplicationI An example: Cedric Ody’s micro-fluidics problem.

I How to get started

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 7: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

OverviewI Background

I Why did we write it?I What is it?

I TheoryI The mathematical framework

I ImplementationI What is object-orientation and why is it good for you?

I ApplicationI An example: Cedric Ody’s micro-fluidics problem.

I How to get startedI Documentation and webpages.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 8: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Background

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 9: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Background: What we [used to] do...E.g.: Biologically-motivated, fluid-structure interaction problems

Steady flow in a collapsible tube. Surface-tension-driven airway collapse

I Code development is typically driven by the demands of aspecific physical/physiological problem ⇒ custom-made codeswith little systematic code reuse.

I No common codebase ⇒ lots of wasted timere-writing/adapting (and debugging!) code.

I Develop an object-oriented library (C++) to solve general,multi-physics problems: oomph-lib.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 10: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Background: What we [used to] do...E.g.: Biologically-motivated, fluid-structure interaction problems

Steady flow in a collapsible tube. Surface-tension-driven airway collapse

I Code development is typically driven by the demands of aspecific physical/physiological problem ⇒ custom-made codeswith little systematic code reuse.

I No common codebase ⇒ lots of wasted timere-writing/adapting (and debugging!) code.

I Develop an object-oriented library (C++) to solve general,multi-physics problems: oomph-lib.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 11: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Background: [Multi-physics] challengesI Interaction between field equations in the same domain.

I Interaction between field equations in different domains.

I “Non-standard” problems.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 12: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Background: [Multi-physics] challengesI Interaction between field equations in the same domain.

I Examples: Thermo-elasticity, thermal convection,reaction-diffusion, ...

I Source terms/coefficients in one system of PDEs depend onthe solution of another system of PDEs and vice versa.

I Interaction between field equations in different domains.

I “Non-standard” problems.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 13: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Background: [Multi-physics] challengesI Interaction between field equations in the same domain.

I Examples: Thermo-elasticity, thermal convection,reaction-diffusion, ...

I Source terms/coefficients in one system of PDEs depend onthe solution of another system of PDEs and vice versa.

I Interaction between field equations in different domains.I Examples: Fluid-structure interaction, free-surface

Navier-Stokes, ....I Deformation of an elastic structure affects the geometry of the

fluid domain; fluid flow affects the deformation of the elasticstructure.

I “Non-standard” problems.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 14: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Background: [Multi-physics] challengesI Interaction between field equations in the same domain.

I Examples: Thermo-elasticity, thermal convection,reaction-diffusion, ...

I Source terms/coefficients in one system of PDEs depend onthe solution of another system of PDEs and vice versa.

I Interaction between field equations in different domains.I Examples: Fluid-structure interaction, free-surface

Navier-Stokes, ....I Deformation of an elastic structure affects the geometry of the

fluid domain; fluid flow affects the deformation of the elasticstructure.

I “Non-standard” problems.I Examples: Coupling asymptotic approximations to the

“full” equationsI Outflow boundary conditions for Navier-Stokes, based on

long-wave approximation for flow downstream.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 15: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Background: [Multi-physics] challengesI Interaction between field equations in the same domain.

I Interaction between field equations in different domains.

I “Non-standard” problems.

Want to provide a framework that faciliates the formulation of suchproblems within a modern scientific computing environment, offering

I spatial and temporal adaptivity

I capability to deal with free-boundary problems

I parallelisation

I sophisticated solvers

I ...

while allowing maximum code-reuse.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 16: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

oomph-lib

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 17: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

oomph-lib: What is it?oomph-lib is:

I an object-oriented, open-source finite-element library for thesimulation of multi-physics problems.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 18: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

oomph-lib: What is it?oomph-lib is:

I an object-oriented, open-source finite-element library for thesimulation of multi-physics problems.

oomph-lib is not:

I a GUI-based, mouse-driven ”package”.

I You must write your own C++ driver codes to specify yourproblem, using oomph-lib’s high-level objects.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 19: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

oomph-lib: What is it?oomph-lib is:

I an object-oriented, open-source finite-element library for thesimulation of multi-physics problems.

oomph-lib is not:

I a GUI-based, mouse-driven ”package”.

I You must write your own C++ driver codes to specify yourproblem, using oomph-lib’s high-level objects.

oomph-lib provides the infrastructure for the problem formulationand solution.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 20: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

oomph-lib: What is it?oomph-lib is:

I an object-oriented, open-source finite-element library for thesimulation of multi-physics problems.

oomph-lib is not:

I a GUI-based, mouse-driven ”package”.

I You must write your own C++ driver codes to specify yourproblem, using oomph-lib’s high-level objects.

oomph-lib provides the infrastructure for the problem formulationand solution.

The library contains a large number of elements, meshes, timestep-pers, solvers, etc. which can be combined to solve “any” problem.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 21: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

General Approach/Design PhilosophyI Robustness

I Generality

I Simple top-level “user” interfaces

I Efficiency

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 22: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

General Approach/Design PhilosophyI Robustness

I “Robust algorithms are better than fast-but-flaky ones”I Extensive optional self-tests (via PARANOID flags)I Installation based on GNU autotools

I Generality

I Simple top-level “user” interfaces

I Efficiency

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 23: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

General Approach/Design PhilosophyI RobustnessI Generality

I Easy to formulate “exotic” problemsI Easy to combine single-physics capabilities in multi-physics

problems

I Simple top-level “user” interfaces

I Efficiency

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 24: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

General Approach/Design PhilosophyI Robustness

I Generality

I Simple top-level “user” interfacesint main()

{// Create problem

MyReallyHardProblem problem;

// Solve

problem.newton solve();

// Post process

problem.doc solution();

}I Efficiency

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 25: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

General Approach/Design PhilosophyI Robustness

I Generality

I Simple top-level “user” interfacesI Efficiency

I “Raw speed” is less important than robustness. However, thisis not an excuse for inefficiency!

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 26: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

General Approach/Design PhilosophyI Robustness

I Generality

I Simple top-level “user” interfacesI Efficiency

I =⇒ Spatial and temporal adaptivity are essential and must beimplemented in “user-friendly” fashion:int main()

{[...]

// Solve the problem, allowing for up to

// 4 rounds of spatial adaptation

unsigned max adapt=4;

problem.newton solve(max adapt);

[...]

}

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 27: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Theory

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 28: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Theory: The overall framework

I Spatial/[implicit] temporal discretisation of “any” problemleads to a system of (non)linear algebraic equations.

I All problems are treated “monolithically” and are assumed tobe nonlinear.

I Use Newton’s method as default solver.

unew = uold + δu, where J · δu = −R

and J is the Jacobian matrix Jij ≡∂Ri

∂uj.

I Solves linear problems in one step.I Quadratic convergence for non-linear problems.I =⇒ Robust if used together with continuation or timestepping.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 29: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Theory: The overall framework

I Spatial/[implicit] temporal discretisation of “any” problemleads to a system of (non)linear algebraic equations.

I All problems are treated “monolithically” and are assumed tobe nonlinear.

I Use Newton’s method as default solver.

unew = uold + δu, where J · δu = −R

and J is the Jacobian matrix Jij ≡∂Ri

∂uj.

I Solves linear problems in one step.I Quadratic convergence for non-linear problems.I =⇒ Robust if used together with continuation or timestepping.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 30: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Theory: The overall framework

I Spatial/[implicit] temporal discretisation of “any” problemleads to a system of (non)linear algebraic equations.

I All problems are treated “monolithically” and are assumed tobe nonlinear.

I Use Newton’s method as default solver.

unew = uold + δu, where J · δu = −R

and J is the Jacobian matrix Jij ≡∂Ri

∂uj.

I Solves linear problems in one step.I Quadratic convergence for non-linear problems.I =⇒ Robust if used together with continuation or timestepping.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 31: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Theory: The overall frameworkI Finite-element-type framework, based on element-by-element

assembly of the discretised problem’s residual vector R andJacobian matrix J

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 32: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Theory: The overall frameworkI Finite-element-type framework, based on element-by-element

assembly of the discretised problem’s residual vector R andJacobian matrix J

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 33: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Theory: The overall framework“Solving the problem” requires:

1. “Assembly” of the Jacobian matrix and residual vector

2. Solution of the linear system(s)

3. Error estimation/problem adaptation.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 34: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Theory: The overall framework1. “Assembly” of the Jacobian matrix and residual vector

I This is oomph-lib’s main task.I Fully parallelised (MPI).

2. Solution of the linear system(s)

3. Error estimation/problem adaptation.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 35: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Theory: The overall framework1. “Assembly” of the Jacobian matrix and residual vector

I This is oomph-lib’s main task.I Fully parallelised (MPI).

2. Solution of the linear system(s)I oomph-lib provides LinearSolver objects – wrappers to

state-of-the-art linear system solvers (HSL frontal solvers;SuperLU serial and parallel sparse matrix solvers; Hypre andTrilinos iterative solvers, both with “black-box”preconditioning strategies).

3. Error estimation/problem adaptation.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 36: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Theory: The overall framework1. “Assembly” of the Jacobian matrix and residual vector

I This is oomph-lib’s main task.I Fully parallelised (MPI).

2. Solution of the linear system(s)I oomph-lib provides LinearSolver objects – wrappers to

state-of-the-art linear system solvers (HSL frontal solvers;SuperLU serial and parallel sparse matrix solvers; Hypre andTrilinos iterative solvers, both with “black-box”preconditioning strategies).

I oomph-lib has its own IterativeLinearSolvers andproblem-specific Preconditioner classes, e.g. for FSIproblems (Jonathan Boyle, Richard Muddle).

3. Error estimation/problem adaptation.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 37: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Theory: The overall framework1. “Assembly” of the Jacobian matrix and residual vector

I This is oomph-lib’s main task.I Fully parallelised (MPI).

2. Solution of the linear system(s)I oomph-lib provides LinearSolver objects – wrappers to

state-of-the-art linear system solvers (HSL frontal solvers;SuperLU serial and parallel sparse matrix solvers; Hypre andTrilinos iterative solvers, both with “black-box”preconditioning strategies).

I oomph-lib has its own IterativeLinearSolvers andproblem-specific Preconditioner classes, e.g. for FSIproblems (Jonathan Boyle, Richard Muddle).

3. Error estimation/problem adaptation.I Z2 error estimator available for a wide range of equations.I Fully automatic mesh adaptation, based on generalised

QuadTree and OcTree procedures (parallelisation in progress[Andy Gait]).

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 38: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Implementation

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 39: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Implementation and object-orientationObservation:

I Huge code (≈ 280,000 lines of C++ code; this is notunusual).

I Multiple authors, simultaneously working on the same code.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 40: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Implementation and object-orientationObservation:

I Huge code (≈ 280,000 lines of C++ code; this is notunusual).

I Multiple authors, simultaneously working on the same code.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 41: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Implementation and object-orientationObservation:

I Huge code (≈ 280,000 lines of C++ code; this is notunusual).

I Multiple authors, simultaneously working on the same code.(if not, the project dies with each graduating PhD studentand has to be re-invented with/by the next one...)

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 42: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Implementation and object-orientationObservation:

I Huge code (≈ 280,000 lines of C++ code; this is notunusual).

I Multiple authors, simultaneously working on the same code.(if not, the project dies with each graduating PhD studentand has to be re-invented with/by the next one...)

=⇒ The challenge:

1. Code complexity: How does one manage code of this size (i.e.“keep its structure in one’s head”).

2. Code maintenance: How can you work on (improve!) one partof the code without affecting everybody else?

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 43: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Implementation and object-orientationObservation:

I Huge code (≈ 280,000 lines of C++ code; this is notunusual).

I Multiple authors, simultaneously working on the same code.(if not, the project dies with each graduating PhD studentand has to be re-invented with/by the next one...)

=⇒ The challenge:

1. Code complexity: How does one manage code of this size (i.e.“keep its structure in one’s head”).

2. Code maintenance: How can you work on (improve!) one partof the code without affecting everybody else?

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 44: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Implementation and object-orientation=⇒ The challenge:

1. Code complexity: How does one manage code of this size (i.e.“keep its structure in one’s head”).

2. Code maintenance: How can you work on (improve!) one partof the code without affecting everybody else?

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 45: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Implementation and object-orientation=⇒ The challenge:

1. Code complexity: How does one manage code of this size (i.e.“keep its structure in one’s head”).

2. Code maintenance: How can you work on (improve!) one partof the code without affecting everybody else?

The solution: Object-orientation

I Encapsulation: Combine data into small logical units(objects) and allow the “user” to interact with these (only!)via clearly defined interfaces.

I Inheritance: Construct more complex objects by adding newfunctionality to already existing simpler ones, leading to ahierarchical data structure.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 46: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Implementation and object-orientation=⇒ The challenge:

1. Code complexity: How does one manage code of this size (i.e.“keep its structure in one’s head”).

2. Code maintenance: How can you work on (improve!) one partof the code without affecting everybody else?

The solution: Object-orientation

I Encapsulation: Combine data into small logical units(objects) and allow the “user” to interact with these (only!)via clearly defined interfaces.

I Inheritance: Construct more complex objects by adding newfunctionality to already existing simpler ones, leading to ahierarchical data structure.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 47: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Object-orientation: Astraightforward example

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 48: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structureI The ultimate purpose of most scientific computations is to

compute a large set of (double precision) numbers.

I How do we “package” these up in a sensible way?

I Data as an example of straightforward inheritance.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 49: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structureI The ultimate purpose of most scientific computations is to

compute a large set of (double precision) numbers.

I How do we “package” these up in a sensible way?

I Data as an example of straightforward inheritance.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 50: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structureI The ultimate purpose of most scientific computations is to

compute a large set of (double precision) numbers.

I How do we “package” these up in a sensible way?

I Data as an example of straightforward inheritance.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 51: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structure

DataDataDataI Has Value (double precision number)

I Has associated (global) equation numbers

I Has associated “History values”

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 52: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structure

DataDataDataI Has Values (double precision numbers)

I Has associated (global) equation numbers

I Has associated “History values”

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 53: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structure

DataDataDataI Has Values (double precision numbers)

I Has associated (global) equation numbers

I Has associated “History values”

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 54: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structure

DataDataDataI Has Values (double precision numbers)

I Has associated (global) equation numbers

I Has associated “History values”

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 55: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structure

DataDataDataI Has Values (double precision numbers)

I Has associated (global) equation numbers

I Has associated “History values”

Some member functions:

Data::nvalue()Data::value(j)Data::eqn number(j)Data::pin(j)

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 56: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structure

DataDataDataI Has Values (double precision numbers)

I Has associated (global) equation numbers

I Has associated “History values”

Some member functions:

Data::nvalue()Data::value(j)Data::eqn number(j)Data::pin(j)

Important:

I “User” interacts with objects only through the member functions.

I Internal implementation is irrelevant (and deliberately hidden!).

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 57: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structure

DataDataDataI Has Values (double precision numbers)

I Has associated (global) equation numbers

I Has associated “History values”

Some member functions:

Data::nvalue()Data::value(j)Data::eqn number(j)Data::pin(j)

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 58: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structure

NodeNodeNodeI Is Data.

I Has a Position

↑↑↑

DataDataDataI Has Values (double precision numbers)

I Has associated (global) equation numbers

I Has associated “History values”

Some member functions:

Data::nvalue()Data::value(j)Data::eqn number(j)Data::pin(j)

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 59: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structure

NodeNodeNodeI Is Data.

I Has a Position

↑↑↑

DataDataDataI Has Values (double precision numbers)

I Has associated (global) equation numbers

I Has associated “History values”

Some member functions:

Data::nvalue()Data::value(j)Data::eqn number(j)Data::pin(j)

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 60: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structure

NodeNodeNodeI Is Data.

I Has a Position

Some member functions:

Node::dim()Node::x(i)

↑↑↑DataDataData

I Has Values (double precision numbers)

I Has associated (global) equation numbers

I Has associated “History values”

Some member functions:

Data::nvalue()Data::value(j)Data::eqn number(j)Data::pin(j)

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 61: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structure

SolidNodeSolidNodeSolidNodeI Is Node.

I Position represented by Data.

↑↑↑

NodeNodeNodeI Is Data.

I Has a Position

Some member functions:

Node::dim()Node::x(i)

↑↑↑DataDataData

I Has Values (double precision numbers)

I Has associated (global) equation numbers

I Has associated “History values”

Some member functions:

Data::nvalue()Data::value(j)Data::eqn number(j)Data::pin(j)

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 62: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structure

SolidNodeSolidNodeSolidNodeI Is Node.

I Position represented by Data.

↑↑↑

NodeNodeNodeI Is Data.

I Has a Position

Some member functions:

Node::dim()Node::x(i)

↑↑↑DataDataData

I Has Values (double precision numbers)

I Has associated (global) equation numbers

I Has associated “History values”

Some member functions:

Data::nvalue()Data::value(j)Data::eqn number(j)Data::pin(j)

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 63: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structure

SolidNodeSolidNodeSolidNodeI Is Node.

I Position represented by Data.

Some member functions:

SolidNode::x(i)SolidNode::pin position(i)

↑↑↑NodeNodeNode

I Is Data.

I Has a Position

Some member functions:

Node::dim()Node::x(i)

↑↑↑DataDataData

I Has Values (double precision numbers)

I Has associated (global) equation numbers

I Has associated “History values”

Some member functions:

Data::nvalue()Data::value(j)Data::eqn number(j)Data::pin(j)

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 64: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structureImportant features:

I Hierarchical data structure.

I Implementation is hidden.

I Derived classes “inherit” existing functionality.

I Derived classes can “overload” existing functionality.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 65: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structureImportant features:

I Hierarchical data structure.

I Implementation is hidden.

I Derived classes “inherit” existing functionality.

I Derived classes can “overload” existing functionality.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 66: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structureImportant features:

I Hierarchical data structure.

I Implementation is hidden.

I Derived classes “inherit” existing functionality.

I Derived classes can “overload” existing functionality.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 67: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example of oomph-lib’s object-oriented data structureImportant features:

I Hierarchical data structure.

I Implementation is hidden.

I Derived classes “inherit” existing functionality.

I Derived classes can “overload” existing functionality.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 68: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

oomph-lib’s overall datastructure

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 69: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

oomph-lib’s overall data structure

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 70: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

oomph-lib’s overall data structure

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 71: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

oomph-lib’s overall data structure

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 72: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

oomph-lib’s overall data structure

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 73: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

oomph-lib’s overall data structure

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 74: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

oomph-lib’s overall data structure

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 75: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

oomph-lib’s overall data structure

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 76: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

oomph-lib’s overall data structure

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 77: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

oomph-lib’s overall data structure

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 78: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

oomph-lib’s overall data structure

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 79: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Object-orientation: A moresophisticated example

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 80: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Virtual inheritance for (Finite)ElementsI (Virtual) base classes establish the required common

functionality and implement generic tasks.

I Specific implementations are delayed to derived classes whichoften use templating for dimension-independent formulation ofentire families of objects (elements).

Example:

I Every “element” must be able to compute its contribution tothe global residual vector and Jacobian matrix.

I Define the interfaces in the base class GeneralisedElement:

GeneralisedElement::get residual(...)GeneralisedElement::get jacobian(...)

...but delay their implementation to a specific derived element.

I Geometry is isolated from equations.I “Drop” new geometric elements into the overall framework,

“recycling” existing equations.I “Drop” your own equations into the overall framework,

“recycling” hundreds of (wo)man hours already invested intothe development and validation (!) of geometric elements,mesh generation, problem assembly, solution, etc.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 81: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Virtual inheritance for (Finite)ElementsI (Virtual) base classes establish the required common

functionality and implement generic tasks.

I Specific implementations are delayed to derived classes whichoften use templating for dimension-independent formulation ofentire families of objects (elements).

Example:

I Every “element” must be able to compute its contribution tothe global residual vector and Jacobian matrix.

I Define the interfaces in the base class GeneralisedElement:

GeneralisedElement::get residual(...)GeneralisedElement::get jacobian(...)

...but delay their implementation to a specific derived element.

I Geometry is isolated from equations.I “Drop” new geometric elements into the overall framework,

“recycling” existing equations.I “Drop” your own equations into the overall framework,

“recycling” hundreds of (wo)man hours already invested intothe development and validation (!) of geometric elements,mesh generation, problem assembly, solution, etc.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 82: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Virtual inheritance for (Finite)ElementsI (Virtual) base classes establish the required common

functionality and implement generic tasks.

I Specific implementations are delayed to derived classes whichoften use templating for dimension-independent formulation ofentire families of objects (elements).

Example:

I Every “element” must be able to compute its contribution tothe global residual vector and Jacobian matrix.

I Define the interfaces in the base class GeneralisedElement:

GeneralisedElement::get residual(...)GeneralisedElement::get jacobian(...)

...but delay their implementation to a specific derived element.

I Geometry is isolated from equations.I “Drop” new geometric elements into the overall framework,

“recycling” existing equations.I “Drop” your own equations into the overall framework,

“recycling” hundreds of (wo)man hours already invested intothe development and validation (!) of geometric elements,mesh generation, problem assembly, solution, etc.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 83: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Virtual inheritance for (Finite)ElementsI (Virtual) base classes establish the required common

functionality and implement generic tasks.

I Specific implementations are delayed to derived classes whichoften use templating for dimension-independent formulation ofentire families of objects (elements).

Example:

I Every “element” must be able to compute its contribution tothe global residual vector and Jacobian matrix.

I Define the interfaces in the base class GeneralisedElement:

GeneralisedElement::get residual(...)GeneralisedElement::get jacobian(...)

...but delay their implementation to a specific derived element.

I Geometry is isolated from equations.I “Drop” new geometric elements into the overall framework,

“recycling” existing equations.I “Drop” your own equations into the overall framework,

“recycling” hundreds of (wo)man hours already invested intothe development and validation (!) of geometric elements,mesh generation, problem assembly, solution, etc.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 84: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Virtual inheritance for (Finite)Elements

I Geometry is isolated from equations.I “Drop” new geometric elements into the overall framework,

“recycling” existing equations.I “Drop” your own equations into the overall framework,

“recycling” hundreds of (wo)man hours already invested intothe development and validation (!) of geometric elements,mesh generation, problem assembly, solution, etc.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 85: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Virtual inheritance for (Finite)Elements

I Geometry is isolated from equations.

I “Drop” new geometric elements into the overall framework,“recycling” existing equations.

I “Drop” your own equations into the overall framework,“recycling” hundreds of (wo)man hours already invested intothe development and validation (!) of geometric elements,mesh generation, problem assembly, solution, etc.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 86: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Virtual inheritance for (Finite)Elements

I Geometry is isolated from equations.

I “Drop” new geometric elements into the overall framework,“recycling” existing equations.

I “Drop” your own equations into the overall framework,“recycling” hundreds of (wo)man hours already invested intothe development and validation (!) of geometric elements,mesh generation, problem assembly, solution, etc.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 87: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Virtual inheritance for (Finite)Elements

I Geometry is isolated from equations.I “Drop” new geometric elements into the overall framework,

“recycling” existing equations.

I “Drop” your own equations into the overall framework,“recycling” hundreds of (wo)man hours already invested intothe development and validation (!) of geometric elements,mesh generation, problem assembly, solution, etc.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 88: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Equation classesI Some existing equation classes

I PoissonEquations<DIM>I UnsteadyHeatEquations<DIM>I LinearWaveEquations<DIM>I AdvectionDiffusionEquations<DIM>I NavierStokesEquations<DIM>I AxisymmetricNavierStokesEquationsI PVDEquations<DIM> (general displacement-based solid

mechanics; based on principle of virtual displacements)I KirchhoffLoveBeamEquationsI KirchhoffLoveShellEquationsI ...

I Clear instructions and numerous “worked examples” explainhow to formulate new equations.

I All equations classes can be combined to multi-physicselements, e.g. “Navier-Stokes + Advection Diffusion” =“Boussinesq”, etc.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 89: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Equation classesI Some existing equation classes

I PoissonEquations<DIM>I UnsteadyHeatEquations<DIM>I LinearWaveEquations<DIM>I AdvectionDiffusionEquations<DIM>I NavierStokesEquations<DIM>I AxisymmetricNavierStokesEquationsI PVDEquations<DIM> (general displacement-based solid

mechanics; based on principle of virtual displacements)I KirchhoffLoveBeamEquationsI KirchhoffLoveShellEquationsI ...

I Clear instructions and numerous “worked examples” explainhow to formulate new equations.

I All equations classes can be combined to multi-physicselements, e.g. “Navier-Stokes + Advection Diffusion” =“Boussinesq”, etc.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 90: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Equation classesI Some existing equation classes

I PoissonEquations<DIM>I UnsteadyHeatEquations<DIM>I LinearWaveEquations<DIM>I AdvectionDiffusionEquations<DIM>I NavierStokesEquations<DIM>I AxisymmetricNavierStokesEquationsI PVDEquations<DIM> (general displacement-based solid

mechanics; based on principle of virtual displacements)I KirchhoffLoveBeamEquationsI KirchhoffLoveShellEquationsI ...

I Clear instructions and numerous “worked examples” explainhow to formulate new equations.

I All equations classes can be combined to multi-physicselements, e.g. “Navier-Stokes + Advection Diffusion” =“Boussinesq”, etc.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 91: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Applications: An exampleproblem

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 92: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationCedric Ody’s (micro-fluidics) problem:

I Liquid plug propagating through a micro-fluidics network:What happens at the junction?

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 93: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationCedric Ody’s (micro-fluidics) problem:

I Liquid plug propagating through a micro-fluidics network:What happens at the junction?

Rupture

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 94: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationCedric Ody’s (micro-fluidics) problem:

I Liquid plug propagating through a micro-fluidics network:What happens at the junction?

Splitting

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 95: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationCedric Ody’s (micro-fluidics) problem:

I Liquid plug propagating through a micro-fluidics network:What happens at the junction?

Blockage

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 96: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationCedric Ody’s (micro-fluidics) problem:

I What is the largest pressure that a static meniscus at theend of an arbitrarily shaped parent tube can withstand?

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 97: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equation

I What is the largest pressure that a static meniscus at theend of an arbitrarily shaped parent tube can withstand?

I Governing equation

∆p = κ = const.

(∆p on the capillary scale, κ mean curvature).

I Approach: Prescribe ∆p (and thus κ) and compute shape ofmeniscus.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 98: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationI Governing equation

∆p = κ = const.

I Example: Rectangular channels

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 99: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationI Governing equation

∆p = κ = const.

I Example: Rectangular channels

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 100: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationI Governing equation

∆p = κ = const.

I Example: Rectangular channels

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 101: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationI Governing equation

∆p = κ = const.

I Example: Rectangular channels

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 102: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationI Governing equation

∆p = κ = const.

I Example: Rectangular channels

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 103: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationI Governing equation

∆p = κ = const.

I Example: Rectangular channels

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 104: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationI Governing equation

∆p = κ = const.

I Example: Rectangular channels

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 105: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationI Governing equation

∆p = κ = const.

I Challenges:

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 106: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationI Governing equation

∆p = κ = const.

I Challenges:

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 107: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationI Governing equation

∆p = κ = const.

I Challenges:

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 108: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationI Governing equation

∆p = κ = const.

I Challenges:

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 109: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationI Governing equation

∆p = κ = const.

I Challenges:

H(κ) is generally not single-valued .

Example: 90o contact angle at “side wall” =⇒ “Barrel-shaped”solution.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 110: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationI Governing equation

∆p = κ = const.

I Challenges:

H(κ) is generally not single-valued .

Example: 90o contact angle at “side wall” =⇒ “Barrel-shaped”solution.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 111: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

An example: The Young-Laplace equationI Governing equation

∆p = κ = const.

I Challenges:

H(κ) is generally not single-valued .

Example: 90o contact angle at “side wall” =⇒ “Barrel-shaped”solution.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 112: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage I: Poisson

I For small deflections from “flat” state

∆p = κ ≈ −∇2h(x , y) = const.

I =⇒ Solve∇2h(x , y) = −κ

for given constant κ (i.e. imposed pressure drop).

I =⇒ A Poisson problem; trivial with existing oomph-libfunctionality.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 113: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage I: Poisson

I For small deflections from “flat” state

∆p = κ ≈ −∇2h(x , y) = const.

I =⇒ Solve∇2h(x , y) = −κ

for given constant κ (i.e. imposed pressure drop).

I =⇒ A Poisson problem; trivial with existing oomph-libfunctionality.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 114: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage I: Poisson

I For small deflections from “flat” state

∆p = κ ≈ −∇2h(x , y) = const.

I =⇒ Solve∇2h(x , y) = −κ

for given constant κ (i.e. imposed pressure drop).

I =⇒ A Poisson problem; trivial with existing oomph-libfunctionality.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 115: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage I: Poisson

I For small deflections from “flat” state

∆p = κ ≈ −∇2h(x , y) = const.

I =⇒ Solve∇2h(x , y) = −κ

for given constant κ (i.e. imposed pressure drop).

I =⇒ A Poisson problem; trivial with existing oomph-libfunctionality.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 116: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage I: Poisson

I For small deflections from “flat” state

∆p = κ ≈ −∇2h(x , y) = const.

I =⇒ Solve∇2h(x , y) = −κ

for given constant κ (i.e. imposed pressure drop).

I =⇒ A Poisson problem; trivial with existing oomph-libfunctionality.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 117: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage I: Poisson

I For small deflections from “flat” state

∆p = κ ≈ −∇2h(x , y) = const.

I =⇒ Solve∇2h(x , y) = −κ

for given constant κ (i.e. imposed pressure drop).

I =⇒ A Poisson problem; trivial with existing oomph-libfunctionality.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 118: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage I: Poisson

I For small deflections from “flat” state

∆p = κ ≈ −∇2h(x , y) = const.

I =⇒ Solve∇2h(x , y) = −κ

for given constant κ (i.e. imposed pressure drop).

I =⇒ A Poisson problem; trivial with existing oomph-libfunctionality.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 119: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage I: Poisson

I For small deflections from “flat” state

∆p = κ ≈ −∇2h(x , y) = const.

I =⇒ Solve∇2h(x , y) = −κ

for given constant κ (i.e. imposed pressure drop).

I =⇒ A Poisson problem; trivial with existing oomph-libfunctionality.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 120: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage I: Poisson

I For small deflections from “flat” state

∆p = κ ≈ −∇2h(x , y) = const.

I =⇒ Solve∇2h(x , y) = −κ

for given constant κ (i.e. imposed pressure drop).

I =⇒ A Poisson problem; trivial with existing oomph-libfunctionality.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 121: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage II: Cartesian Young-Laplace

I For finite deflections from “flat” state

∆p = κ = −∇ · ∇h√1 + |∇h|2

= const.

I =⇒ Solve

∇ · ∇h√1 + |∇h|2

= −κ

for given constant κ (i.e. imposed pressure drop).

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 122: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage II: Cartesian Young-Laplace

I For finite deflections from “flat” state

∆p = κ = −∇ · ∇h√1 + |∇h|2

= const.

I =⇒ Solve

∇ · ∇h√1 + |∇h|2

= −κ

for given constant κ (i.e. imposed pressure drop).

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 123: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage II: Cartesian Young-Laplace

I For finite deflections from “flat” state

∆p = κ = −∇ · ∇h√1 + |∇h|2

= const.

I =⇒ Solve

∇ · ∇h√1 + |∇h|2

= −κ

for given constant κ (i.e. imposed pressure drop).

I Highly nonlinear but (algorithmically) trivial modification toPoisson problem. Easy to implement in oomph-lib via new“equation class”.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 124: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage II: Cartesian Young-Laplace

I For finite deflections from “flat” state

∆p = κ = −∇ · ∇h√1 + |∇h|2

= const.

I =⇒ Solve

∇ · ∇h√1 + |∇h|2

= −κ

for given constant κ (i.e. imposed pressure drop).

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 125: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage II: Cartesian Young-Laplace

I For finite deflections from “flat” state

∆p = κ = −∇ · ∇h√1 + |∇h|2

= const.

I =⇒ Solve

∇ · ∇h√1 + |∇h|2

= −κ

for given constant κ (i.e. imposed pressure drop).

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 126: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage II: Cartesian Young-Laplace

I For finite deflections from “flat” state

∆p = κ = −∇ · ∇h√1 + |∇h|2

= const.

I =⇒ Solve

∇ · ∇h√1 + |∇h|2

= −κ

for given constant κ (i.e. imposed pressure drop).

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 127: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage II: Cartesian Young-Laplace

I For finite deflections from “flat” state

∆p = κ = −∇ · ∇h√1 + |∇h|2

= const.

I =⇒ Solve

∇ · ∇h√1 + |∇h|2

= −κ

for given constant κ (i.e. imposed pressure drop).

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 128: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage II: Cartesian Young-Laplace

I For finite deflections from “flat” state

∆p = κ = −∇ · ∇h√1 + |∇h|2

= const.

I =⇒ Solve

∇ · ∇h√1 + |∇h|2

= −κ

for given constant κ (i.e. imposed pressure drop).

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 129: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage II: Cartesian Young-Laplace

I For finite deflections from “flat” state

∆p = κ = −∇ · ∇h√1 + |∇h|2

= const.

I =⇒ Solve

∇ · ∇h√1 + |∇h|2

= −κ

for given constant κ (i.e. imposed pressure drop).

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 130: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage II: Cartesian Young-Laplace

I For finite deflections from “flat” state

∆p = κ = −∇ · ∇h√1 + |∇h|2

= const.

I =⇒ Solve

∇ · ∇h√1 + |∇h|2

= −κ

for given constant κ (i.e. imposed pressure drop).

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 131: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage III: Spine-based Young-Laplace

I For non-one-to-one solutions: Use intrinsic representation ofmeniscus

R(ζ1, ζ2)

I Shape governed by variational principle

I Surface parametrisation by “Method of Spines”:

R(ζ1, ζ2) = B(ζ1, ζ2) + h(ζ1, ζ2) S(ζ1, ζ2)

I Can’t do H(∆p) because of limit point. Treat ∆p as an unknownand prescribe height via an additional equation:

R(ζ1 = ζ[ctrl ]1 , ζ2 = ζ

[ctrl ]2 ) · ez = Hctrl

I Implement as GeneralisedElement.

I

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 132: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage III: Spine-based Young-Laplace

I For non-one-to-one solutions: Use intrinsic representation ofmeniscus

R(ζ1, ζ2)

I Shape governed by variational principle

δ

∫dA =

∫∆pN · δR dA +

∮Tn · δR dS .

I Surface parametrisation by “Method of Spines”:

R(ζ1, ζ2) = B(ζ1, ζ2) + h(ζ1, ζ2) S(ζ1, ζ2)

I Can’t do H(∆p) because of limit point. Treat ∆p as an unknownand prescribe height via an additional equation:

R(ζ1 = ζ[ctrl ]1 , ζ2 = ζ

[ctrl ]2 ) · ez = Hctrl

I Implement as GeneralisedElement.

I

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 133: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage III: Spine-based Young-Laplace

I For non-one-to-one solutions: Use intrinsic representation ofmeniscus

R(ζ1, ζ2)

I Shape governed by variational principle

δ

∫dA︸ ︷︷ ︸

Variationin

surfaceenergy

=

∫∆pN · δR dA︸ ︷︷ ︸

Virtualwork

done bypressure

+

∮Tn · δR dS︸ ︷︷ ︸Virtualwork

done atmoving

contact line

I Surface parametrisation by “Method of Spines”:

R(ζ1, ζ2) = B(ζ1, ζ2) + h(ζ1, ζ2) S(ζ1, ζ2)

I Can’t do H(∆p) because of limit point. Treat ∆p as an unknownand prescribe height via an additional equation:

R(ζ1 = ζ[ctrl ]1 , ζ2 = ζ

[ctrl ]2 ) · ez = Hctrl

I Implement as GeneralisedElement.

I

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 134: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage III: Spine-based Young-Laplace

I For non-one-to-one solutions: Use intrinsic representation ofmeniscus

R(ζ1, ζ2)

I Shape governed by variational principle

δ

∫dA =

∫∆pN · δR dA +

∮Tn · δR dS .

I Surface parametrisation by “Method of Spines”:

R(ζ1, ζ2) = B(ζ1, ζ2) + h(ζ1, ζ2) S(ζ1, ζ2)

I Can’t do H(∆p) because of limit point. Treat ∆p as an unknownand prescribe height via an additional equation:

R(ζ1 = ζ[ctrl ]1 , ζ2 = ζ

[ctrl ]2 ) · ez = Hctrl

I Implement as GeneralisedElement.

I

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 135: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage III: Spine-based Young-Laplace

I For non-one-to-one solutions: Use intrinsic representation ofmeniscus

R(ζ1, ζ2)

I Shape governed by variational principle

δ

∫dA =

∫∆pN · δR dA +

∮Tn · δR dS .

I Surface parametrisation by “Method of Spines”:

R(ζ1, ζ2) = B(ζ1, ζ2) + h(ζ1, ζ2) S(ζ1, ζ2)

I Can’t do H(∆p) because of limit point. Treat ∆p as an unknownand prescribe height via an additional equation:

R(ζ1 = ζ[ctrl ]1 , ζ2 = ζ

[ctrl ]2 ) · ez = Hctrl

I Implement as GeneralisedElement.

I

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 136: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage III: Spine-based Young-Laplace

I For non-one-to-one solutions: Use intrinsic representation ofmeniscus

R(ζ1, ζ2)

I Shape governed by variational principle

δ

∫dA =

∫∆pN · δR dA +

∮Tn · δR dS .

I Surface parametrisation by “Method of Spines”:

R(ζ1, ζ2) = B(ζ1, ζ2) + h(ζ1, ζ2) S(ζ1, ζ2)

I Can’t do H(∆p) because of limit point. Treat ∆p as an unknownand prescribe height via an additional equation:

R(ζ1 = ζ[ctrl ]1 , ζ2 = ζ

[ctrl ]2 ) · ez = Hctrl

I Implement as GeneralisedElement.

I

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 137: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage III: Spine-based Young-Laplace

I For non-one-to-one solutions: Use intrinsic representation ofmeniscus

R(ζ1, ζ2)

I Shape governed by variational principle

δ

∫dA =

∫∆pN · δR dA +

∮Tn · δR dS .

I Surface parametrisation by “Method of Spines”:

R(ζ1, ζ2) = B(ζ1, ζ2) + h(ζ1, ζ2) S(ζ1, ζ2)

I Can’t do H(∆p) because of limit point. Treat ∆p as an unknownand prescribe height via an additional equation:

R(ζ1 = ζ[ctrl ]1 , ζ2 = ζ

[ctrl ]2 ) · ez = Hctrl

I Implement as GeneralisedElement.

I

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 138: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage III: Spine-based Young-Laplace

I For non-one-to-one solutions: Use intrinsic representation ofmeniscus

R(ζ1, ζ2)

I Shape governed by variational principle

δ

∫dA =

∫∆pN · δR dA +

∮Tn · δR dS .

I Surface parametrisation by “Method of Spines”:

R(ζ1, ζ2) = B(ζ1, ζ2) + h(ζ1, ζ2) S(ζ1, ζ2)

I Can’t do H(∆p) because of limit point. Treat ∆p as an unknownand prescribe height via an additional equation:

R(ζ1 = ζ[ctrl ]1 , ζ2 = ζ

[ctrl ]2 ) · ez = Hctrl

I Implement as GeneralisedElement.

IMatthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 139: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage III: Spine-based Young-Laplace

I For non-one-to-one solutions: Use intrinsic representation ofmeniscus

R(ζ1, ζ2)

I Shape governed by variational principle

δ

∫dA =

∫∆pN · δR dA +

∮Tn · δR dS .

I Surface parametrisation by “Method of Spines”:

R(ζ1, ζ2) = B(ζ1, ζ2) + h(ζ1, ζ2) S(ζ1, ζ2)

I Can’t do H(∆p) because of limit point. Treat ∆p as an unknownand prescribe height via an additional equation:

R(ζ1 = ζ[ctrl ]1 , ζ2 = ζ

[ctrl ]2 ) · ez = Hctrl

I Implement as GeneralisedElement.

IMatthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 140: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage III: Spine-based Young-Laplace

I For non-one-to-one solutions: Use intrinsic representation ofmeniscus

R(ζ1, ζ2)

I Shape governed by variational principle

δ

∫dA =

∫∆pN · δR dA +

∮Tn · δR dS .

I Surface parametrisation by “Method of Spines”:

R(ζ1, ζ2) = B(ζ1, ζ2) + h(ζ1, ζ2) S(ζ1, ζ2)

I Can’t do H(∆p) because of limit point. Treat ∆p as an unknownand prescribe height via an additional equation:

R(ζ1 = ζ[ctrl ]1 , ζ2 = ζ

[ctrl ]2 ) · ez = Hctrl

I Implement as GeneralisedElement.

IMatthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 141: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage III: Spine-based Young-Laplace

I For non-one-to-one solutions: Use intrinsic representation ofmeniscus

R(ζ1, ζ2)

I Shape governed by variational principle

δ

∫dA =

∫∆pN · δR dA +

∮Tn · δR dS .

I Surface parametrisation by “Method of Spines”:

R(ζ1, ζ2) = B(ζ1, ζ2) + h(ζ1, ζ2) S(ζ1, ζ2)

I Can’t do H(∆p) because of limit point. Treat ∆p as an unknownand prescribe height via an additional equation:

R(ζ1 = ζ[ctrl ]1 , ζ2 = ζ

[ctrl ]2 ) · ez = Hctrl

I Implement as GeneralisedElement.

IMatthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 142: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Stage III: Spine-based Young-Laplace

I For non-one-to-one solutions: Use intrinsic representation ofmeniscus

R(ζ1, ζ2)

I Shape governed by variational principle

δ

∫dA =

∫∆pN · δR dA +

∮Tn · δR dS .

I Surface parametrisation by “Method of Spines”:

R(ζ1, ζ2) = B(ζ1, ζ2) + h(ζ1, ζ2) S(ζ1, ζ2)

I Can’t do H(∆p) because of limit point. Treat ∆p as an unknownand prescribe height via an additional equation:

R(ζ1 = ζ[ctrl ]1 , ζ2 = ζ

[ctrl ]2 ) · ez = Hctrl

I Implement as GeneralisedElement.

IMatthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 143: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Meniscus in T-junction

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 144: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Meniscus in T-junction

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 145: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Meniscus in T-junction

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 146: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Meniscus in T-junction

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 147: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Meniscus in T-junction

I Note (automatic) mesh adaptation.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 148: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Mesh generation

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 149: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Mesh generation

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 150: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Mesh generation

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 151: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Mesh generationStrategy:

I Start with coarse mesh and refine it automatically

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 152: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Mesh generationStrategy:

I Start with coarse mesh and refine it automatically

Example: Poisson equation in a fish-shaped domain

∇2u = 1 in Dfish

subject to

u = 0 on ∂Dfish

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 153: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Mesh generationStrategy:

I Start with coarse mesh and refine it automatically

Example: Poisson equation in a fish-shaped domain

∇2u = 1 in Dfish

subject to

u = 0 on ∂Dfish

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 154: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Mesh generationStrategy:

I Start with coarse mesh and refine it automatically

Example: Poisson equation in a fish-shaped domain

∇2u = 1 in Dfish

subject to

u = 0 on ∂Dfish

unsigned max adapt=3;

for (unsigned i=0;i<max adapt;i++)

{problem.newton solve();

problem.doc solution();

problem.adapt();

}Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 155: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Mesh generationStrategy:

I Start with coarse mesh and refine it automatically

Example: Poisson equation in a fish-shaped domain

∇2u = 1 in Dfish

subject to

u = 0 on ∂Dfish

unsigned max adapt=3;

for (unsigned i=0;i<max adapt;i++)

{problem.newton solve();

problem.doc solution();

problem.adapt();

}Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 156: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Mesh generationStrategy:

I Start with coarse mesh and refine it automatically

Example: Poisson equation in a fish-shaped domain

∇2u = 1 in Dfish

subject to

u = 0 on ∂Dfish

unsigned max adapt=3;

for (unsigned i=0;i<max adapt;i++)

{problem.newton solve();

problem.doc solution();

problem.adapt();

}Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 157: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Mesh generationStrategy:

I Start with coarse mesh and refine it automatically

Example: Poisson equation in a fish-shaped domain

∇2u = 1 in Dfish

subject to

u = 0 on ∂Dfish

unsigned max adapt=3;

for (unsigned i=0;i<max adapt;i++)

{problem.newton solve();

problem.doc solution();

problem.adapt();

}Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 158: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Adaptive mesh refinement: Implementation

I Generic implementation of non-uniform refinement in two andthree dimensions

I High-level functions are part of RefineableMesh objects.

I Generalised QuadTree and OcTree data structures used forneighbour finding & determination of weights for hangingnode constraints.

I Z2 (flux recovery) is default error estimator.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 159: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

3D Navier-Stokes: Developing flow in a pipe

• Inlet flow: 1− r20

becomes parabolic

Poiseuille profile

1− r2

• Re = 200

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 160: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

3D Navier-Stokes: Developing flow in a pipe

• Inlet flow: 1− r20

becomes parabolic

Poiseuille profile

1− r2

• Re = 200

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 161: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

3D Navier-Stokes: Developing flow in a pipe

• Inlet flow: 1− r20

becomes parabolic

Poiseuille profile

1− r2

• Re = 200

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 162: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

3D Navier-Stokes: Developing flow in a pipe

• Inlet flow: 1− r20

becomes parabolic

Poiseuille profile

1− r2

• Re = 200

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 163: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

3D Navier-Stokes: Developing flow in a pipe

• Inlet flow: 1− r20

becomes parabolic

Poiseuille profile

1− r2

• Re = 200

Note how the mesh refinement picks up the curvilinear boundary!

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 164: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Interfaces to third-party mesh generatorsI For most of “our own” problems, hand-coded meshes are easy

to write.

I For very complex geometries this is not feasible.I oomph-lib provides interfaces to (open-source) third-party

mesh generators:I J.R. Shewchuk’s TriangleI Hang Si’s TetGenI Barry Joe’s Geompack++

I Interfaces to other (commercial) mesh generators could easilybe developed.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 165: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Interfaces to third-party mesh generatorsI For most of “our own” problems, hand-coded meshes are easy

to write.

I For very complex geometries this is not feasible.

I oomph-lib provides interfaces to (open-source) third-partymesh generators:

I J.R. Shewchuk’s TriangleI Hang Si’s TetGenI Barry Joe’s Geompack++

I Interfaces to other (commercial) mesh generators could easilybe developed.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 166: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Interfaces to third-party mesh generatorsI For most of “our own” problems, hand-coded meshes are easy

to write.

I For very complex geometries this is not feasible.I oomph-lib provides interfaces to (open-source) third-party

mesh generators:I J.R. Shewchuk’s TriangleI Hang Si’s TetGenI Barry Joe’s Geompack++

I Interfaces to other (commercial) mesh generators could easilybe developed.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 167: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Interfaces to third-party mesh generatorsI For most of “our own” problems, hand-coded meshes are easy

to write.

I For very complex geometries this is not feasible.I oomph-lib provides interfaces to (open-source) third-party

mesh generators:I J.R. Shewchuk’s TriangleI Hang Si’s TetGenI Barry Joe’s Geompack++

I Interfaces to other (commercial) mesh generators could easilybe developed.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 168: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Third-party mesh generators: Triangle + xfigI During a rainy Sunday afternoon we developed an interface

between xfig and Triangle:

1. Draw domain boundaries in xfig and save as hole.fig, say.

2. Run conversion script ./fig2poly hole.fig to convert intoinput file for Triangle.

3. Run Triangle.

4. Read Triangle mesh file from oomph-lib to create mesh:

5. Solve problem with oomph-lib:

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 169: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Third-party mesh generators: Triangle + xfigI During a rainy Sunday afternoon we developed an interface

between xfig and Triangle:

1. Draw domain boundaries in xfig and save as hole.fig, say.

2. Run conversion script ./fig2poly hole.fig to convert intoinput file for Triangle.

3. Run Triangle.

4. Read Triangle mesh file from oomph-lib to create mesh:

5. Solve problem with oomph-lib:

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 170: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Third-party mesh generators: Triangle + xfigI During a rainy Sunday afternoon we developed an interface

between xfig and Triangle:

1. Draw domain boundaries in xfig and save as hole.fig, say.

2. Run conversion script ./fig2poly hole.fig to convert intoinput file for Triangle.

3. Run Triangle.

4. Read Triangle mesh file from oomph-lib to create mesh:

5. Solve problem with oomph-lib:

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 171: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Third-party mesh generators: Triangle + xfigI During a rainy Sunday afternoon we developed an interface

between xfig and Triangle:

1. Draw domain boundaries in xfig and save as hole.fig, say.

2. Run conversion script ./fig2poly hole.fig to convert intoinput file for Triangle.

3. Run Triangle.

4. Read Triangle mesh file from oomph-lib to create mesh:

5. Solve problem with oomph-lib:

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 172: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Third-party mesh generators: Triangle + xfigI During a rainy Sunday afternoon we developed an interface

between xfig and Triangle:

1. Draw domain boundaries in xfig and save as hole.fig, say.

2. Run conversion script ./fig2poly hole.fig to convert intoinput file for Triangle.

3. Run Triangle.

4. Read Triangle mesh file from oomph-lib to create mesh:

5. Solve problem with oomph-lib:

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 173: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Third-party mesh generators: Triangle + xfigI During a rainy Sunday afternoon we developed an interface

between xfig and Triangle:

1. Draw domain boundaries in xfig and save as hole.fig, say.

2. Run conversion script ./fig2poly hole.fig to convert intoinput file for Triangle.

3. Run Triangle.

4. Read Triangle mesh file from oomph-lib to create mesh:

5. Solve problem with oomph-lib:

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 174: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Third-party mesh generators: Triangle + xfigI During a rainy Sunday afternoon we developed an interface

between xfig and Triangle:

I Also works for more complicated geometries:

I Finite-Reynolds-number flow past the oomph-lib logo.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 175: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Third-party mesh generators: Triangle + xfigI During a rainy Sunday afternoon we developed an interface

between xfig and Triangle:

I Also works for more complicated geometries:

I Finite-Reynolds-number flow past the oomph-lib logo.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 176: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Third-party mesh generators: Triangle + xfigI During a rainy Sunday afternoon we developed an interface

between xfig and Triangle:

I Also works for more complicated geometries:

I Finite-Reynolds-number flow past the oomph-lib logo.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 177: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Third-party mesh generators: TetgenI Tetgen mesh for a cube containing another cube

I Flow field induced by rising inner cube:

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 178: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Third-party mesh generators: TetgenI Tetgen mesh for a cube containing another cube

I Flow field induced by rising inner cube:

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 179: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Third-party mesh generators: TetgenI Tetgen mesh for a cube containing another cube

I Flow field induced by rising inner cube:

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 180: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Third-party mesh generators: TetgenI Tetgen mesh for a cube containing another cube

I Flow field induced by rising inner cube:

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 181: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Third-party mesh generators: TetgenI Tetgen mesh for a cube containing another cube

I Flow field induced by rising inner cube:

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 182: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Third-party mesh generators: TetgenI Tetgen mesh for a cube containing another cube

I Flow field induced by rising inner cube:

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 183: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Post-processing

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 184: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Visualisation of results...and now for the embarrasing bit:

I By default oomph-lib outputs data in tecplot format.

I Tecplot is a (fantastic) plotting package.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 185: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Visualisation of results...and now for the embarrasing bit:

I By default oomph-lib outputs data in tecplot format.

I Tecplot is a (fantastic) commerical plotting package.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 186: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Visualisation of results...and now for the embarrasing bit:

I By default oomph-lib outputs data in tecplot format.

I Tecplot is a (fantastic) commerical plotting package.

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 187: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Visualisation of results...and now for the embarrasing bit:

I By default oomph-lib outputs data in tecplot format.

I Tecplot is a (fantastic) commerical plotting package.

However,

I oomph-lib’s default output is in ascii format and is easy tounderstand.

I Data can be displayed in gnuplot.

I Data can be converted to other (open source) plottingpackages: Angelo Simone (TU Delft) has developed aconversion script to paraview.

I Output can be customised!

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 188: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Visualisation of results...and now for the embarrasing bit:

I By default oomph-lib outputs data in tecplot format.

I Tecplot is a (fantastic) commerical plotting package.

However,

I oomph-lib’s default output is in ascii format and is easy tounderstand.

I Data can be displayed in gnuplot.

I Data can be converted to other (open source) plottingpackages: Angelo Simone (TU Delft) has developed aconversion script to paraview.

I Output can be customised!

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 189: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Visualisation of results...and now for the embarrasing bit:

I By default oomph-lib outputs data in tecplot format.

I Tecplot is a (fantastic) commerical plotting package.

However,

I oomph-lib’s default output is in ascii format and is easy tounderstand.

I Data can be displayed in gnuplot.

I Data can be converted to other (open source) plottingpackages: Angelo Simone (TU Delft) has developed aconversion script to paraview.

I Output can be customised!

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 190: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Visualisation of results...and now for the embarrasing bit:

I By default oomph-lib outputs data in tecplot format.

I Tecplot is a (fantastic) commerical plotting package.

However,

I oomph-lib’s default output is in ascii format and is easy tounderstand.

I Data can be displayed in gnuplot.

I Data can be converted to other (open source) plottingpackages: Angelo Simone (TU Delft) has developed aconversion script to paraview.

I Output can be customised!

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 191: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

How to get started

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 192: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

How to get started

I Have a look around the oomph-lib webpage:

http://www.oomph-lib.org

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 193: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Navigating around http://www.oomph-lib.org

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 194: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Navigating around http://www.oomph-lib.org

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 195: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Navigating around http://www.oomph-lib.org

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 196: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Navigating around http://www.oomph-lib.org

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 197: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Navigating around http://www.oomph-lib.org

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 198: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Navigating around http://www.oomph-lib.org

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 199: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Navigating around http://www.oomph-lib.org

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 200: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Navigating around http://www.oomph-lib.org

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 201: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Navigating around http://www.oomph-lib.org

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 202: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Navigating around http://www.oomph-lib.org

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 203: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Navigating around http://www.oomph-lib.org

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 204: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Navigating around http://www.oomph-lib.org

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 205: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Navigating around http://www.oomph-lib.org

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask

Page 206: Everything you always wanted to know about 1oomph-lib but ......Everything you always wanted to know about oomph-lib but were afraid to ask Matthias Heil, Andrew L. Hazel Jonathan

Acknowledgements/Current WorkSome current/recent projects:

I Jonathan Boyle: Self-excited oscillations in 3D collapsible tube flow; FSI.

I Alberto Lozar: 3D Bubble propagation in rectangular tubes

I Phil Haines: Self-similar vs. Navier-Stokes solutions in Jeffrey Hamel flow

I Richard Muddle: Block preconditioning, biharmonic equations

I Andy Gait: Parallel mesh adaptation

I Angelo Simone: Biofilms

I Rich Hewitt: Simulation of Long’s vortex

I Natasha Willoughby: Homogenisation

I Chris Glasman: Maxwell’s equations

Ongoing work ([nearly] complete but not yet documented)

I Eigenvalue problems

I Continuation and bifurcation tracking

I Hartree-Fock

I ...

Matthias Heil, Andrew L. Hazel Everything you always wanted to know about oomph-lib but were afraid to ask