Hi,

I'm trying to copy the solution and functions vecs from a Newton SNES to a
Shell SNES. I'm doing it like this:

  SNES newton_snes, shell_snes;
  Vec newton_function, newton_solution;
  Vec shell_function, shell_solution;
  .
  .
  Newton SNES initialized and solved here. Shell SNES initialized.
  .
  .
  SNESGetFunction(newton_snes, &newton_function, 0, 0);
  SNESGetFunction(shell_snes, &shell_function, 0, 0);
  VecDestroy(&shell_function);
  VecDuplicate(newton_function, &shell_function);

  SNESGetSolution(newton_snes, &newton_solution);
  SNESGetSolution(shell_snes, &shell_solution);
  VecDestroy(&shell_solution);
  VecDuplicate(newton_solution, &shell_solution);

But I get this error on first VecDuplicate line:

[0]PETSC ERROR: VecDuplicate() line 511 in
/home/hsahasra/NEMO5/libs/petsc/build-real/src/vec/vec/interface/vector.c
Null Object: Parameter # 1

Is there any other better way to do this?

Thanks,
Harshad

Reply via email to