KikeM / romtime

Unsteady Finite Element Reduced Order Model for Time Moving Domains
1 stars 1 forks source link

BUG : Fragile definition of lifting expression #19

Closed KikeM closed 3 years ago

KikeM commented 3 years ago

The lifting operator is introduced as a linear combination of the boundary conditions.

Originally, this was the expression used:

f = fenics.Expression(
f"{right} * (x[0] / L) + {left} * (L - x[0]) / L",
degree=2,
L=L,
dLt_dt=dLt_dt,
t=t,
**mu,
)

This is a fragile definition, because it assumes the user will define right and left with parentheses.

The fixup is to include the parentheses by default.

f = fenics.Expression(
f"({right}) * (x[0] / L) + ({left}) * (L - x[0]) / L",
degree=2,
L=L,
dLt_dt=dLt_dt,
t=t,
**mu,
)

This showed up when I included a moving domain, because the RHS boundary condition is a sum of terms. So far all the boundary conditions were made out of products (sighs...)