Comparing between a PETSc matrix and a standard fortran array in compressed row format

2007-08-03 Thread Ben Tay
Hi, I used 2 packages to solve my poisson eqn, which is part of my NS unsteady solver. One is the NSPCG solver package which uses the compressed row format to store the A matrix. The other is PETSc. I found that using both solvers gave me similar answers for a number of time step. However,

Scattering context options

2007-08-03 Thread Graham Kells
--- Ok, thanks to you both. It looks like I will have to rethink this one :-/ Regards, Graham On Fri, 27 Jul 2007, Barry Smith wrote: Graham, It seems unlike the matrix was preallocated; this will definitely slow things down a great deal. Pluse

Comparing between a PETSc matrix and a standard fortran array in compressed row format

2007-08-03 Thread Matthew Knepley
I am guessing that you are using MATAIJ format in PETSc, so both matrices are in the same format. How about using MatView()? Or reading in the NSPCG matrix and subtracting as you indicate? Matt On 8/2/07, Ben Tay zonexo at gmail.com wrote: Hi, I used 2 packages to solve my poisson eqn,

Comparing between a PETSc matrix and a standard fortran array in compressed row format

2007-08-03 Thread Barry Smith
You can use MatCreateSeqAIJWithArrays() to convert the NSPCG matrix into PETSc format and then MatAXPY() to difference them and then MatNorm() to see how large the result is. Make sure the PETSc or hypre solver is always converging. Run with -ksp_converged_reason and or -ksp_monitor. My

Comparing between a PETSc matrix and a standard fortran array in compressed row format

2007-08-03 Thread Barry Smith
Unless the matrix values are huge then this is a big difference. All you can do is print the difference matrix with ASCII MatView and look for large entries. This will tell you the locations of the trouble entries. Barry On Sat, 4 Aug 2007, Ben Tay wrote: Hi, I realised that the