Hi, I read in the manual that I can use either call MatSetOption(A_mat_uv,MAT_NO_NEW_NONZERO_LOCATIONS,PETSC_TRUE,ierr) or call MatSetOption(A_mat,MAT_SYMMETRIC,PETSC_TRUE,ierr).
When I use MAT_NO_NEW_NONZERO_LOCATIONS for the matrix formed by my momentum eqn, I get the error on my home computer udring compiling: :\Myprojects2\imb_airfoil_x2_parallel\mom_disz.f90(356) : Error: This name does not have a type, and must have an explicit type. [MAT_NO_NEW_NONZERO_LOCATIONS] call MatSetOption(A_mat_uv,MAT_NO_NEW_NONZERO_LOCATIONS,PETSC_TRUE,ierr) Although this error does not happen when I compile in linux, I can this error during run: [0]PETSC ERROR: ------------------------------------------------------------------------ [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range [0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger [0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#Signal[0]PETSC ERROR: or try http://valgrind.org on linux or man libgmalloc on Apple to find memory corruption errors [0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run [0]PETSC ERROR: to get more information on the crash. [0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Signal received! [0]PETSC ERROR: ------------------------------------------------------------------------ I use KSPRICHARDSON and PCILU for my momentum eqn matrix. When I use MatSetOption(A_mat,MAT_SYMMETRIC,PETSC_TRUE,ierr) for my poisson eqn which is symmetric, I get the same error as above during run. Btw, I'm using hypre as the preconditioner and default solver. May I know why using these options give the error? Thank you very much. Regards.