On Tue, Jan 28, 2014 at 12:49 PM, Konstantinos Kontzialis < [email protected]> wrote:
> Dear all, > > I'm trying to solve the magnetic induction equation on a 3D finite > element mesh. > I'm coding the following: > > call TSCreate (petsc_comm_world, ts_mhd, ierpetsc) > > call TSSetIFunction ( ts_mhd, res_mhd, residual_mag, > @ PETSC_NULL_OBJECT, ierpetsc ) > > call TSSetSolution( ts_mhd, Bmagnetic_pet, ierpetsc ) > > call TSGetSNES (ts_mhd, snes_mhd, ierpetsc ) > > call MatCreateSNESMF ( snes_mhd, J_mf, ierpetsc ) > > call TSSetMaxSNESFailures ( ts_mhd,-1,ierpetsc ) > > call SNESSetJacobian ( snes_mhd, J_mf, M_mhd, > @ PETSC_NULL_FUNCTION, PETSC_NULL_OBJECT, ierpetsc ) > > call TSSetFromOptions ( ts_mhd, ierpetsc ) > > call TSSolve ( ts_mhd, PETSC_NULL_OBJECT, ierpetsc) > > and I run with the following options: > > -ts_dt 1.0e-2 > -ts_type beuler > -ts_final_time 1.0 > -ts_view > > But, when my code reaches TSSolve it gives an error: > > ERROR: [0 mhdsol] Segmentation fault - (Invalid memory reference) > > Any ideas or suggestions on what to do? > Run with valgrind. Matt > Regards, > > Kostas > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener
