Hello everyone,
We are solving a coupled problem in FEniCSx with the functions (u,vg), where u comes from elasticity and vg is like an internal variable.
We need to set the initial guess of vg as 1, otherwise the Newton solver crashes at the first iteration.
The code for the functions is this:
Q_el = element("CG", domain.basix_cell(), 1, shape=(domain.geometry.dim,))
P_el = element("Lagrange", domain.basix_cell(), 1)
V_el = mixed_element([Q_el, P_el])
W = fem.functionspace(domain, V_el)
w = fem.Function(W)
dW = ufl.TrialFunctions(W)
while we are using the following to specify the initial guess:
sub_func = w.sub(1)
with sub_func.vector.localForm() as local_vec:
local_vec.set(1.0)
we also tried the following:
sub_func = w.sub(1)
sub_func.x.array[:] = 1.0
But in the end, it seems, this code is applying 1.0 as initial guess for both functions u and vg, which is wrong.
How should we properly set the initial guess for a specific variable when using a mixed formulation in the new FEniCSx?
Thanks.
Bernardo