Re: [petsc-users] Solving singular systems with petsc

2020-08-17 Thread Nidish
both are slightly different questions. But I understand now that the whole thing boils down to obtaining the nullspaces. Thank you, Nidish On 8/17/20 1:33 PM, zakaryah wrote: Hi Nidish, I may not fully understand your problem, but it sounds like you could benefit from continuation methods. Have y

Re: [petsc-users] Solving singular systems with petsc

2020-08-17 Thread Nidish
Thankfully for this step, the matrix is not dense. But thank you. Nidish On 8/17/20 8:52 AM, Jose E. Roman wrote: El 17 ago 2020, a las 14:27, Barry Smith escribió: Nidish, Your matrix is dense, correct? MUMPS is for sparse matrices. Then I guess you could use Scalapack

[petsc-users] Possible bug in PETSc4py Mat().CreateAIJ with rectangular matrices?

2020-08-16 Thread Nidish
teAIJ(size=M.T.shape, csr =(M.indptr, M.indices, M.data)) i.e., I need to use the shape of the transpose of the matrix. Does this have something to do with the way the csr format is interpreted in the petsc4py wrappings or in PETSc itself? -- Nidish

Re: [petsc-users] Solving singular systems with petsc

2020-08-16 Thread Nidish
Oh damn. Alright, I'll keep trying out the different options. Thank you, Nidish On 8/16/20 8:05 PM, Barry Smith wrote:   SVD is enormously expensive, needs to be done on a full dense matrix so completely impractical. You need the best tuned iterative method, Jose is the by far the

Re: [petsc-users] Singular Eigenproblem with SLEPc

2020-08-16 Thread Nidish
ably). I'm not sure what factorization or solver I should use in this case. TLDR: I have K.v=lam*M.v where BOTH K and M are singular. The nullspace of M is a subset of the nullspace of K. Thank you, Nidish On 8/16/20 1:50 AM, Jose E. Roman wrote: Nothing special is required for solv

Re: [petsc-users] Solving singular systems with petsc

2020-08-16 Thread Nidish
t, but I'm wondering if you could provide me insights into whether this will. Thanks, Nidish On 8/16/20 2:50 PM, Barry Smith wrote:   If you know part of your null space explicitly (for example the rigid body modes) I would recommend you always use that information explicitly since

Re: [petsc-users] Solving singular systems with petsc

2020-08-16 Thread Nidish
Could you have me the suggested solver configurations to get this type of eigenvectors in slepc? Nidish On Aug 16, 2020, 00:17, at 00:17, Jed Brown wrote: >It's possible to use this or a similar algorithm in SLEPc, but keep in >mind that it's more expensive to compute these eigenv

Re: [petsc-users] Solving singular systems with petsc

2020-08-15 Thread Nidish
I just use the standard eigs function (https://www.mathworks.com/help/matlab/ref/eigs.html) as a black box. I think it uses a lanczos type method under the hood. Nidish On Aug 15, 2020, 21:42, at 21:42, Barry Smith wrote: > >Exactly what algorithm are you using in Matlab to get

[petsc-users] Solving singular systems with petsc

2020-08-15 Thread Nidish
itive semi-definite (contains a few "rigid body modes") and M is strictly positive definite. I'd appreciate any assistance you may provide with this. Thank you, Nidish

[petsc-users] Singular Eigenproblem with SLEPc

2020-08-15 Thread Nidish
o much. Is there any example code for such a case with a singular matrix where these procedures are carried out? Or could you provide references/guidances for approaching the problem? Thank you, Nidish

Re: [petsc-users] Performance differences between PETSc4py and PETSc on C

2020-08-13 Thread Nidish
Thank you, Nidish On 8/13/20 11:51 PM, Jed Brown wrote: Nidish writes: Does that mean one can choose to develop code using the petc4py wrappers without having to sacrifice any performance? Roughly, yes. Though assembly of residuals and Jacobians is still your business and its performance

Re: [petsc-users] Performance differences between PETSc4py and PETSc on C

2020-08-13 Thread Nidish
Does that mean one can choose to develop code using the petc4py wrappers without having to sacrifice any performance? Apologies if this question is too basic, I'm just trying to understand what I would be sacrificing if I chose to completely write my application on Python. Nidish On

[petsc-users] Performance differences between PETSc4py and PETSc on C

2020-08-13 Thread Nidish
r for code development. Thank you, Nidish

Re: [petsc-users] MatSetValues vs MatSetValuesBlocked

2020-08-10 Thread Nidish
Oh that makes sense - I just need to use the first element's address. Thank you! On 8/10/20 6:00 PM, Jed Brown wrote: Nidish writes: Urgh I must've been blind - flycheck was throwing warnings only if I didn't cast elstiff[][] into const PetscScalar* . You don't have

Re: [petsc-users] MatSetValues vs MatSetValuesBlocked

2020-08-10 Thread Nidish
Urgh I must've been blind - flycheck was throwing warnings only if I didn't cast elstiff[][] into const PetscScalar* . Thanks for the responses! Nidish On 8/10/20 5:35 PM, Jed Brown wrote: Nidish writes: Ah I get it now, MatSetBlocked has to be set node-wise. I tried this an

Re: [petsc-users] MatSetValues vs MatSetValuesBlocked

2020-08-10 Thread Nidish
Ah I get it, thanks! On 8/10/20 5:40 PM, Matthew Knepley wrote: On Mon, Aug 10, 2020 at 6:26 PM Nidish <mailto:n...@rice.edu>> wrote: Ah I get it now, MatSetBlocked has to be set node-wise. I tried this and it works, thank you. The other question I had was wh

Re: [petsc-users] MatSetValues vs MatSetValuesBlocked

2020-08-10 Thread Nidish
typecast there so my flycheck doesn't keep throwing me warnings on emacs ;) Thank You, Nidish On 8/10/20 5:16 PM, Jed Brown wrote: Nidish writes: It's a 1D model with displacements and rotations as DoFs at each node. I couldn't find much in the manual on MatSetBlockSize - co

Re: [petsc-users] MatSetValues vs MatSetValuesBlocked

2020-08-10 Thread Nidish
a stencil width of 1 there), the matrix object should have the nonzero elements preallocated. Here's the call to DMDACreate1d: DMDACreate1d(PETSC_COMM_WORLD, DM_BOUNDARY_NONE, N, 2, 1, NULL, &mshdm); Thank you, Nidish On 8/10/20 4:55 PM, Jed Brown wrote: It looks like you haven't

[petsc-users] MatSetValues vs MatSetValuesBlocked

2020-08-10 Thread Nidish
works, while     MatSetValuesBlocked(jac, 4, (const PetscInt*)idx, 4, (const PetscInt*)idx,(const PetscScalar*)elstiff, ADD_VALUES); does NOT work. Also from the documentation I could not really understand what the difference was between these two. Thank you, Nidish static char help[] = &quo

Re: [petsc-users] [Closed] Using MatSetValuesBlocked to build Finite Element Matrices with variable coefficients

2020-08-09 Thread Nidish
Update: It was a type error (idx and idy below were declared as PetscScalar* instead of PetscInt*), I'm sorry. Guess I'm being punished for not paying attention to types. Nidish On 8/9/20 10:05 PM, Nidish wrote: Update: I had made some mistakes in the assembly in the previou

Re: [petsc-users] Using MatSetValuesBlocked to build Finite Element Matrices with variable coefficients

2020-08-09 Thread Nidish
Update: I had made some mistakes in the assembly in the previous version. They're fixed now (see below). On 8/9/20 9:13 PM, Nidish wrote: I'm trying to write a simple 1D finite element test case (linear elasticity). It was given in the manual that using an appropriate DM a

[petsc-users] Using MatSetValuesBlocked to build Finite Element Matrices with variable coefficients

2020-08-09 Thread Nidish
I'm trying to write a simple 1D finite element test case (linear elasticity). It was given in the manual that using an appropriate DM and calling MatSetValuesBlocked(). I'm however unable to do this for cases where I want to take runtime inputs for physical constants in the matrices. One thing

Re: [petsc-users] Parallelizing Nonlinear Algebraic systems without DM

2020-08-09 Thread Nidish
Alright, thank you. Nidish On 8/9/20 1:43 PM, Matthew Knepley wrote: On Sun, Aug 9, 2020 at 2:37 PM Nidish <mailto:n...@rice.edu>> wrote: On 8/9/20 1:45 AM, Barry Smith wrote: On Aug 9, 2020, at 1:14 AM, Nidish <mailto:n...@rice.edu> wrote: Hello, My ques

Re: [petsc-users] Parallelizing Nonlinear Algebraic systems without DM

2020-08-09 Thread Nidish
On 8/9/20 1:45 AM, Barry Smith wrote: On Aug 9, 2020, at 1:14 AM, Nidish wrote: Hello, My question is related to solving a generic nonlinear algebraic system in parallel. I'm using the word generic to point to the fact that the system may or may not be from a finite element/mesh

[petsc-users] Parallelizing Nonlinear Algebraic systems without DM

2020-08-08 Thread Nidish
with this email. TL;DR Version: What modifications must be made in "$PETSC_DIR/src/snes/tutorials/ex1.c" to make it work in Parallel? Is it possible to make minimal modifications to make it run in parallel too? Thank You, Nidish static char help[] = "Nonlinear Solution

Re: [petsc-users] Best practices for solving Dense Linear systems

2020-08-08 Thread Nidish
On 8/7/20 12:55 PM, Barry Smith wrote: On Aug 7, 2020, at 12:26 PM, Nidish <mailto:n...@rice.edu>> wrote: On 8/7/20 8:52 AM, Barry Smith wrote: On Aug 7, 2020, at 1:25 AM, Nidish <mailto:n...@rice.edu>> wrote: Indeed - I was just using the default solver (GMRES with

Re: [petsc-users] Best practices for solving Dense Linear systems

2020-08-07 Thread Nidish
On 8/7/20 8:52 AM, Barry Smith wrote: On Aug 7, 2020, at 1:25 AM, Nidish <mailto:n...@rice.edu>> wrote: Indeed - I was just using the default solver (GMRES with ILU). Using just standard LU (direct solve with "-pc_type lu -ksp_type preonly"), I find elemental to be extr

Re: [petsc-users] Best practices for solving Dense Linear systems

2020-08-06 Thread Nidish
$> mpirun -n 4 ./ksps -N 1000 -mat_type mpiaij -pc_type lu -ksp_type preonly $> mpirun -n 4 ./ksps -N 1000 -mat_type elemental -pc_type lu -ksp_type preonly elemental seems to perform poorly in both cases. Nidish On 8/7/20 12:50 AM, Barry Smith wrote:   What is the output of -ksp_

Re: [petsc-users] Best practices for solving Dense Linear systems

2020-08-06 Thread Nidish
lemental. I have not been able to make the elemental version finish up for 2e4 so far (my patience runs out faster). What's going on here? I thought elemental was supposed to be superior for dense matrices. I can share the code if that's appropriate for this forum (sorry, I'm new h

[petsc-users] Best practices for solving Dense Linear systems

2020-08-06 Thread Nidish
ly shoots up. 2. Are there any specific guidelines on when I can expect elemental to perform better in parallel than in serial? Of course, I'm interesting in any other details that may be important in this regard. Thank you, Nidish