Skip to main content
. Author manuscript; available in PMC: 2024 Mar 15.
Published in final edited form as: J Comput Phys. 2023 Jan 13;477:111890. doi: 10.1016/j.jcp.2022.111890

Algorithm 2.

Elemental Coupling Scheme

1: Define the adaptive quadrature rule as a composite Gauss rule such that
Aq={(Xq,wq)}in whichXΩ0s,minqχh(X)χh(Xq)CAΔx (68)
in which typically CA=1/2
2: procedure Velocity Interpolation (χh,uh,δh) ▹ Interpolate and project uh in the FE space
3:  Compute the components of UIB, for each (Xq,wq)Aq, as
UIB,1(Xq)=i,j,kui+12,j,k1δh(xi+12,j,kχh(Xq))Δx3 (69a)
UIB,2(Xq)=i,j,kui,j+12,k2δh(xi,j+12,kχh(Xq))Δx3 (69b)
UIB,3(Xq)=i,j,kui,j,k+123δh(xi,j,k+12χh(Xq))Δx3 (69c)
4:  Set up the projection right-hand side LIB with entries
LiIB=(Xq,wq)AqUIB(Xq)ϕi(Xq)wq (70)
5:  Solve MU=LIB for U M is the standard mass matrix
6: return U ▹ vector of FE velocity coefficients
7: end procedure
8: procedure Force Spreading (χh,δh)
9:  Calculate L with
Li=(Xq,wq)Hqe(Xq,t):Xϕi(Xq)wq (71)
10:  Solve MF=L for F M is the standard mass matrix
11:  Define Fh(X)=iFiϕi(X)
12:  Spread Fh(X) with into fh with
fi+12,j,k1=(Xq,wq)AqF1(Xq)δh(xi+12,j,kχh(Xq))wq (72a)
fi,j+12,k2=(Xq,wq)AqF2(Xq)δh(xi,j+12,kχh(Xq))wq (72b)
fi,j,k+123=(Xq,wq)AqF3(Xq)δh(xi,j,k+12χh(Xq))wq (72c)
13: return fh ▹ Cartesian grid force representation
14: end procedure