Linear multipoint constraints in FEniCSx - FEniCS 2021

17
Linear multipoint constraints in FEniCSx FEniCS 2021 Jørgen S. Dokken Garth N. Wells Chris Richardson March 22, 2021 1/ 12

Transcript of Linear multipoint constraints in FEniCSx - FEniCS 2021

Page 1: Linear multipoint constraints in FEniCSx - FEniCS 2021

Linear multipoint constraints in FEniCSxFEniCS 2021

Jørgen S. Dokken Garth N. Wells Chris Richardson

March 22, 2021

1/ 12

Page 2: Linear multipoint constraints in FEniCSx - FEniCS 2021

What is a linear multipoint constraint (MPC)?

A linear combination of degrees of freedom:

• Periodic conditions: u(0, y , z) = u(L, y , z)

• Slip boundary conditions: u · n = 0

• Frictionless contact: u1 · n1 = u2 · n1, ui ∈ Ωi

2/ 12

Page 3: Linear multipoint constraints in FEniCSx - FEniCS 2021

What is a linear multipoint constraint (MPC)?

A linear combination of degrees of freedom:

• Periodic conditions: u(0, y , z) = u(L, y , z)

• Slip boundary conditions: u · n = 0

• Frictionless contact: u1 · n1 = u2 · n1, ui ∈ Ωi

2/ 12

Page 4: Linear multipoint constraints in FEniCSx - FEniCS 2021

What is a linear multipoint constraint (MPC)?

A linear combination of degrees of freedom:

• Periodic conditions: u(0, y , z) = u(L, y , z)

• Slip boundary conditions: u · n = 0

• Frictionless contact: u1 · n1 = u2 · n1, ui ∈ Ωi

2/ 12

Page 5: Linear multipoint constraints in FEniCSx - FEniCS 2021

To solve a system of linear equations, we eliminate degrees of freedom byusing the additional constraints

Find u = (u0, . . . , u3)T such that

Au = b u3 = ζu0

Define the prolongation matrix P

Pu =

1 0 00 1 00 0 1ζ 0 0

u0u1u2

= u

We solve the reduced system

(PTAP)u = PTb

where

(PTAP) =

ζ2a3,3 + ζa0,3 + ζa3,0 + a0,0 ζa3,1 + a0,1 ζa3,2 + a0,2ζa1,3 + a1,0 a1,1 a1,2ζa2,3 + a2,0 a2,1 a2,2

3/ 12

Page 6: Linear multipoint constraints in FEniCSx - FEniCS 2021

To solve a system of linear equations, we eliminate degrees of freedom byusing the additional constraints

Find u = (u0, . . . , u3)T such that

Au = b u3 = ζu0

Define the prolongation matrix P

Pu =

1 0 00 1 00 0 1ζ 0 0

u0u1u2

= u

We solve the reduced system

(PTAP)u = PTb

where

(PTAP) =

ζ2a3,3 + ζa0,3 + ζa3,0 + a0,0 ζa3,1 + a0,1 ζa3,2 + a0,2ζa1,3 + a1,0 a1,1 a1,2ζa2,3 + a2,0 a2,1 a2,2

3/ 12

Page 7: Linear multipoint constraints in FEniCSx - FEniCS 2021

To solve a system of linear equations, we eliminate degrees of freedom byusing the additional constraints

Find u = (u0, . . . , u3)T such that

Au = b u3 = ζu0

Define the prolongation matrix P

Pu =

1 0 00 1 00 0 1ζ 0 0

u0u1u2

= u

We solve the reduced system

(PTAP)u = PTb

where

(PTAP) =

ζ2a3,3 + ζa0,3 + ζa3,0 + a0,0 ζa3,1 + a0,1 ζa3,2 + a0,2ζa1,3 + a1,0 a1,1 a1,2ζa2,3 + a2,0 a2,1 a2,2

3/ 12

Page 8: Linear multipoint constraints in FEniCSx - FEniCS 2021

A linear combination gives rise to mixed terms between the master nodes

Au = b

u1 = αu0 + βu2

(PTAP)0,0 = α2a1,1 + αa0,1 + αa1,0 + a0,0

(PTAP)0,1 = αβa1,1 + αa1,2 + βa0,1 + a0,2

(PTAP)0,2 = αa1,3 + a0,3

(PTAP)1,0 = αβa1,1 + αa2,1 + βa1,0 + a2,0

(PTAP)1,1 = β2a1,1 + βa1,2 + βa2,1 + a2,2

(PTAP)1,2 = βa1,3 + a2,3

(PTAP)2,0 = αa3,1 + a3,0

(PTAP)2,1 = βa3,1 + a3,2

(PTAP)2,2 = a3,3

4/ 12

Page 9: Linear multipoint constraints in FEniCSx - FEniCS 2021

A linear combination gives rise to mixed terms between the master nodes

Au = b

u1 = αu0 + βu2

(PTAP)0,0 = α2a1,1 + αa0,1 + αa1,0 + a0,0

(PTAP)0,1 = αβa1,1 + αa1,2 + βa0,1 + a0,2

(PTAP)0,2 = αa1,3 + a0,3

(PTAP)1,0 = αβa1,1 + αa2,1 + βa1,0 + a2,0

(PTAP)1,1 = β2a1,1 + βa1,2 + βa2,1 + a2,2

(PTAP)1,2 = βa1,3 + a2,3

(PTAP)2,0 = αa3,1 + a3,0

(PTAP)2,1 = βa3,1 + a3,2

(PTAP)2,2 = a3,34/ 12

Page 10: Linear multipoint constraints in FEniCSx - FEniCS 2021

We apply both the conditions we have considered so far

Au = b

u1 = αu0 + βu2

u3 = ζu0

With prolongation matrix P

Pu =

1 0α β0 1ζ 0

(u0u2)

= u

5/ 12

Page 11: Linear multipoint constraints in FEniCSx - FEniCS 2021

We obtain cross terms between the two constraints

Au = b

u1 = αu0 + βu2

u3 = ζu0

(PTAP)0,0 =α2a1,1 + αa0,1 + αa1,0

+ζ2a3,3 + ζa0,3 + ζa3,0 + αζa1,3 + αζa3,1 + a0,0

(PTAP)0,1 =αβa1,1 + αa1,2 + βζa3,1 + βa0,1 + ζa3,2 + a0,2

(PTAP)1,0 =αβa1,1 + αa2,1 + βζa1,3 + βa1,0 + ζa2,3 + a2,0

(PTAP)1,1 =β2a1,1 + βa1,2 + βa2,1 + a2,2

6/ 12

Page 12: Linear multipoint constraints in FEniCSx - FEniCS 2021

To make the assembly feasible for large systems, we compute the productPTAeP

Compute element kernel Ae

Prepare Ae for Dirichlet BCs

Contains constrained DoFs?

Insert into Global A = A + Ae

Repeat for next cell

Local MPC modification

Ae = SMPC (Ae)

Insert adjustments into global

A = A + MMPC (Ae)

For each cell

n

y

7/ 12

Page 13: Linear multipoint constraints in FEniCSx - FEniCS 2021

Contact constraint between non-matching meshesLinear elasticity where a displacement is described on the top (coarse) cube, and thebottom (fine) cube has a slip condition.

8/ 12

Page 14: Linear multipoint constraints in FEniCSx - FEniCS 2021

The matrix reduction operation introduces new non-diagonal entries to thesparsity pattern

9/ 12

Page 15: Linear multipoint constraints in FEniCSx - FEniCS 2021

Strong scaling with 221 million cells

10/ 12

Page 16: Linear multipoint constraints in FEniCSx - FEniCS 2021

The implementation is written as an add-on to DOLFINx

# Slip constraint on space W using facet -markers

mpc = dolfinx_mpc.MultiPointConstraint(W)

mpc.create_slip_constraint ((mt , 1), n, ...)

mpc.finalize ()

# Define variational problem using UFL

# ...

# Assemble matrix and vector

A = dolfinx_mpc.assemble_matrix(a, mpc , bcs)

b = dolfinx_mpc.assemble_vector(L, mpc)

A.assemble ()

# Solve system using PETSc

# ...

# Backsubstitute from master to puppet dofs

mpc.backsubstitution(uh)11/ 12

Page 17: Linear multipoint constraints in FEniCSx - FEniCS 2021

Thank you for your attention

https://github.com/jorgensd/dolfinx_mpc

12/ 12