Many initial boundary value problems require solving for unknown vector fields, such as solving for displacements in a mechanical problem. Discretization of weak forms of such problems leads to higher-order linear systems which need to be reshaped to be solved by regular linear solvers. There are also more indices involved than a scalar problem, which can be confusing. In this post, I’ll try to elucidate the procedure by deriving for a basic higher-order system and giving an example.

The weak formulation of a linear vectorial problem reads

Find uV such that

a(u,v)=b(v)

for all vV.

Discretizations of vectorial problems requires the expansion of vectorial quantities as linear combinations of the basis vectors ei:

u=ndi=1uiei

where {ui}ndi=1 are the components corresponding to the basis vectors and nd=dimV. Here, we chose Cartesian basis vectors for simplicity.

We can therefore express its discretization as

uh=nnI=1uINI=nnI=1ndi=1uIieiNI.

Substituting discretized functions in the weak formulation, we obtain

a(uh,vh)=ndi=1ndj=1a(uh,jej,vh,iei)=nnI=1nnJ=1ndi=1ndj=1uJjvIia(ejNJ,eiNI)

and

b(vh)=ndi=1b(vh,iei)=nnI=1ndi=1vIib(eiNI).

We define the following arrays

AIJij=a(ejNJ,eiNI)bIi=b(eiNI).

Hence we can express the linear system

a(uh,vh)=b(vh)

as

nnI=1nnJ=1ndi=1ndj=1uJjvIiAIJij=nnI=1ndi=1vIibIi.

For arbitrary vh, this yields the following system of equations

nnJ=1ndj=1AIJijuJj=bIi

for i=1,,nd and I=1,,nn.

We reshape this higher-order system as shown in the previous post Reshaping Higher Order Linear Systems:

ˆAˆu=ˆb

by defining a map id that maps original indices to the reshaped indices

id:={[1,nn]×[1,nd][1,nnnd](I,i)nd(I1)+i

where we used 1-based indexing of the arrays. We set

α:=id(I,i)=nd(I1)+iβ:=id(J,j)=nd(J1)+j

and write

ˆAαβ=AIJij,ˆuβ=uJjandˆbα=bIi

The inverse index mapping can be obtained as shown in the previous post.

Example: Linear Elasticity

Our initial-boundary value problem is

divσ=ργinΩu=ˉuonΩut=ˉtonΩt

The weak formulation reads

Find uV such that

Ωdivσvdv=Ωργvdv

for all vV where V=H1(Ω).

We apply integration by parts on the left-hand side

Ωdivσvdv=Ωdiv(σv)dvΩσ:vdv

and apply the divergence theorem to the first resulting term:

Ωdiv(σv)dv=Ωtˉtvda

Substituting the linear stress σ=C:ε=C:u, we obtain the following variational forms:

a(u,v)=Ωv:C:udvb(v)=Ωργvdv+Ωtˉtvda

We have the following discretizations of the unknown function and test function

uh=nnJ=1uJNJandvh=nnI=1vINI.

With the given discretizations, the matrix corresponding to (18) can be calculated as

AIJij=a(ejNJ,eiNI)=Ω(eiNI):C:(ejNJ)dv=Ω(eiNI):C:(ejNJ)dv=ΩNIxkCikjlNJxldv,

and finally obtain

AIJij=ΩBIkCikjlBJldv.

The vector corresponding to (19) is calculated as

bIi=b(eiNI)=Ωtˉt(eiNI)da+Ωργ(eiNI)dv

which yields

bIi=ΩtˉtiNIda+ΩργiNIdv