Re: [petsc-users] DMCreateMatrix with some dense row

2015-10-27 Thread Barry Smith
> On Oct 27, 2015, at 9:42 PM, Sang pham van wrote: > > Hi Barry, > > In the original MatMPIAIJSetPreallocation(), PETSc determines column index > when preallocating the matrix: cols[cnt++] = l + nc*(slot + ii + gnx*jj + > gnx*gny*kk); If I understand correctly, while PETSc allocates the mat

Re: [petsc-users] DMCreateMatrix with some dense row

2015-10-27 Thread Sang pham van
Hi Barry, In the original MatMPIAIJSetPreallocation(), PETSc determines column index when preallocating the matrix: cols[cnt++] = l + nc*(slot + ii + gnx*jj + gnx*gny*kk); If I understand correctly, while PETSc allocates the matrix the value of cnt is important, entries value of the cols[] array i

Re: [petsc-users] DMCreateMatrix with some dense row

2015-10-27 Thread Barry Smith
> On Oct 27, 2015, at 8:55 PM, Sang pham van wrote: > > Hi Matt, > > Can you please answer my second question about the way PESCs understand the > column indies? : > > One more question I have is that, when preallocating for a node, as you can > see in my below code (based on original PETSc

Re: [petsc-users] DMCreateMatrix with some dense row

2015-10-27 Thread Sang pham van
Hi Matt, Can you please answer my second question about the way PESCs understand the column indies? : One more question I have is that, when preallocating for a node, as you can see in my below code (based on original PETSc code), since I have 3 equations, I preallocated 3 rows (in rows[l] array)

Re: [petsc-users] DMCreateMatrix with some dense row

2015-10-27 Thread Matthew Knepley
On Tue, Oct 27, 2015 at 8:18 PM, Sang pham van wrote: > Hi Barry, > > I made my function for preallocating the DM matrix. I am using immersed > boundary method to solve a problem of solid mechanics (3D, linear > elasticity). > At every solid nodes, I have 3 unknowns for displacement in 3 directio

Re: [petsc-users] ILU preconditioner hangs with some zero elements on the diagonal

2015-10-27 Thread Hong
I did a quick test: 1) ilu with any shift type does not converge 2) gmres/4 bjacobi/ilu + shift_type nonzero does not converge 3) mpiexec -n 4 ./ex10 -f0 $D/mat.bin -rhs 0 -ksp_monitor -sub_pc_type lu -sub_pc_factor_shift_type nonzero ... 0 KSP Residual norm 3.284826093129e+03 1 KSP Residual norm

Re: [petsc-users] soname seems to be absent in OS-X

2015-10-27 Thread Mohammad Mirzadeh
Denis, I use Homebrew to manage petsc and all related dependencies on OSX which uses .dylib for shared libs instead of .so. However, I have not had any issues linking against them just the usual way by passing -L/path/to/lib -lwhatever (you need to pass -Wl,-rpath,/path/to/lib as well if lib is no

Re: [petsc-users] ILU preconditioner hangs with some zero elements on the diagonal

2015-10-27 Thread Barry Smith
> On Oct 27, 2015, at 12:40 PM, Hong wrote: > > Here is the reason why it does not converge: > ./ex10 -f0 $D/mat.bin -rhs 0 -ksp_monitor_true_residual -ksp_view > -ksp_converged_reason > Linear solve did not converge due to DIVERGED_NANORINF iterations 0 This means it found a zero pivot eit

Re: [petsc-users] ILU preconditioner hangs with some zero elements on the diagonal

2015-10-27 Thread Hong
Here is the reason why it does not converge: ./ex10 -f0 $D/mat.bin -rhs 0 -ksp_monitor_true_residual -ksp_view -ksp_converged_reason Linear solve did not converge due to DIVERGED_NANORINF iterations 0 KSP Object: 1 MPI processes type: gmres GMRES: restart=30, using Classical (unmodified) Gra

Re: [petsc-users] ILU preconditioner hangs with some zero elements on the diagonal

2015-10-27 Thread Matthew Knepley
On Tue, Oct 27, 2015 at 12:36 PM, Hong wrote: > Matt: > >> On Tue, Oct 27, 2015 at 11:13 AM, Hong wrote: >> >>> Gary : >>> I tested your mat.bin using >>> petsc/src/ksp/ksp/examples/tutorials/ex10.c >>> ./ex10 -f0 $D/mat.bin -rhs 0 -ksp_monitor_true_residual -ksp_view >>> ... >>> Mat Object:

Re: [petsc-users] ILU preconditioner hangs with some zero elements on the diagonal

2015-10-27 Thread Hong
Matt: > On Tue, Oct 27, 2015 at 11:13 AM, Hong wrote: > >> Gary : >> I tested your mat.bin using >> petsc/src/ksp/ksp/examples/tutorials/ex10.c >> ./ex10 -f0 $D/mat.bin -rhs 0 -ksp_monitor_true_residual -ksp_view >> ... >> Mat Object: 1 MPI processes >> type: seqaij >> rows=588, cols=

Re: [petsc-users] Question - read text file

2015-10-27 Thread Matthew Knepley
On Fri, Oct 23, 2015 at 2:21 PM, Marcelo Xavier Guterres < m.guter...@gmail.com> wrote: > Dear friends, > > I need to read a matrix from a text file (txt). > > This matrix has a high dimension (2000 X 2000) . > > Example: date.txt - provision in the text file: > > 1 2 3 5 > 5 5 7 8 > 5 6 8 9 > > >

Re: [petsc-users] ILU preconditioner hangs with some zero elements on the diagonal

2015-10-27 Thread Matthew Knepley
On Tue, Oct 27, 2015 at 11:13 AM, Hong wrote: > Gary : > I tested your mat.bin using > petsc/src/ksp/ksp/examples/tutorials/ex10.c > ./ex10 -f0 $D/mat.bin -rhs 0 -ksp_monitor_true_residual -ksp_view > ... > Mat Object: 1 MPI processes > type: seqaij > rows=588, cols=588 > total: n

[petsc-users] soname seems to be absent in OS-X

2015-10-27 Thread Denis Davydov
Dear developers, It seems that the compiled PETSc library does not have a soname (-Wl,-install_name=xyz.dylib in OS-X). I compile PETSc/SLEPc using Homebrew both on OS-X and Linux and judging from ldd/otool there is indeed a difference: Linux (soname is there): $ ldd .linuxbrew_openblas/opt/sle

Re: [petsc-users] ILU preconditioner hangs with some zero elements on the diagonal

2015-10-27 Thread Hong
Gary : I tested your mat.bin using petsc/src/ksp/ksp/examples/tutorials/ex10.c ./ex10 -f0 $D/mat.bin -rhs 0 -ksp_monitor_true_residual -ksp_view ... Mat Object: 1 MPI processes type: seqaij rows=588, cols=588 total: nonzeros=11274, allocated nonzeros=11274 total number of malloc

Re: [petsc-users] [SLEPc] any restriction on the calling order of EPS functions?

2015-10-27 Thread Denis Davydov
Thanks Jose and Hong for the prompt reply. I will let you know if I encounter any issues due to calling function in different order. Kind regards, Denis > On 27 Oct 2015, at 15:39, Jose E. Roman wrote: > > Yes, in principle you can set options in any order. Let us know if anything > does no

Re: [petsc-users] [SLEPc] any restriction on the calling order of EPS functions?

2015-10-27 Thread Jose E. Roman
Yes, in principle you can set options in any order. Let us know if anything does not work for you. Jose > El 27/10/2015, a las 9:15, Denis Davydov escribió: > > Dear developers, > > I wonder if there are any restriction (apart from obvious) on the calling > order of EPS functions? > Is the

Re: [petsc-users] [SLEPc] any restriction on the calling order of EPS functions?

2015-10-27 Thread Hong
Denis: Your code looks fine to me. There are examples under slepc/src/eps/examples/tutorials using ST with SHELL, e.g., ex10.c Hong Dear developers, > > I wonder if there are any restriction (apart from obvious) on the calling > order of EPS functions? > Is the following logic correct: > > once I

Re: [petsc-users] ILU preconditioner hangs with some zero elements on the diagonal

2015-10-27 Thread Matthew Knepley
On Tue, Oct 27, 2015 at 9:10 AM, Matthew Knepley wrote: > On Tue, Oct 27, 2015 at 9:06 AM, Gary Rebt wrote: > >> Dear petsc-users, >> >> While using the FEniCS package to Solve a simple Stokes' flow problem, I >> have run into problems with PETSc preconditioners. In particular, I would >> like t

[petsc-users] ILU preconditioner hangs with some zero elements on the diagonal

2015-10-27 Thread Gary Rebt
Dear petsc-users,   While using the FEniCS package to Solve a simple Stokes' flow problem, I have run into problems with PETSc preconditioners. In particular, I would like to use ILU (no parallel version) along with GMRES to solve my linear system but the solver just hangs indefinitely at MatLUF

Re: [petsc-users] ILU preconditioner hangs with some zero elements on the diagonal

2015-10-27 Thread Matthew Knepley
On Tue, Oct 27, 2015 at 9:06 AM, Gary Rebt wrote: > Dear petsc-users, > > While using the FEniCS package to Solve a simple Stokes' flow problem, I > have run into problems with PETSc preconditioners. In particular, I would > like to use ILU (no parallel version) along with GMRES to solve my linea

[petsc-users] ILU preconditioner hangs with some zero elements on the diagonal

2015-10-27 Thread Gary Rebt
Dear petsc-users,   While using the FEniCS package to Solve a simple Stokes' flow problem, I have run into problems with PETSc preconditioners. In particular, I would like to use ILU (no parallel version) along with GMRES to solve my linear system but the solver just hangs indefinitely at MatLUFa

[petsc-users] [SLEPc] any restriction on the calling order of EPS functions?

2015-10-27 Thread Denis Davydov
Dear developers, I wonder if there are any restriction (apart from obvious) on the calling order of EPS functions? Is the following logic correct: once I create EPS object (and specified it’s type) ierr = EPSCreate (mpi_communicator, eps); ierr = EPSSetType (eps, const_cast(EPSKRYLOVSCHUR)

Re: [petsc-users] HDF5 vec output with DMPlex

2015-10-27 Thread Matthew Knepley
On Mon, Oct 26, 2015 at 10:03 PM, Adrian Croucher wrote: > hi > > When I read the HDF5 file back in again using PetscViewerHDF5Open() and > VecLoad(), is there any easy way to navigate to the last time step in the > results? > > Or, equivalently, to find how many timesteps there are in there, so