<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>I'm trying to copy the solution and functions vecs from a Newton SNES to a Shell SNES. I'm doing it like this:<br><br></div>  SNES newton_snes, shell_snes;<br></div>  Vec newton_function, newton_solution;<br></div>  Vec shell_function, shell_solution;<br>  .<br>  .<br></div>  Newton SNES initialized and solved here. Shell SNES initialized.<br><div><div>  .<br>  .<br><div><div><div>  SNESGetFunction(newton_snes, &newton_function, 0, 0);<br>  SNESGetFunction(shell_snes, &shell_function, 0, 0);<br>  VecDestroy(&shell_function);<br>  VecDuplicate(newton_function, &shell_function);<br><br>  SNESGetSolution(newton_snes, &newton_solution);<br>  SNESGetSolution(shell_snes, &shell_solution);<br>  VecDestroy(&shell_solution);<br>  VecDuplicate(newton_solution, &shell_solution);<br><br></div><div>But I get this error on first VecDuplicate line:<br><br>[0]PETSC ERROR: VecDuplicate() line 511 in /home/hsahasra/NEMO5/libs/petsc/build-real/src/vec/vec/interface/vector.c Null Object: Parameter # 1<br><br></div><div>Is there any other better way to do this?<br><br></div><div>Thanks,<br></div><div>Harshad<br></div></div></div></div></div></div>