Re: [petsc-users] [tao] General L1,L2 optimization

2019-01-25 Thread Jed Brown via petsc-users
I don't think Tristan is looking for users just yet, but he has an LM that he's using for bundle adjustment (comparing with Ceres) here. We hope to merge this once it's better tested. https://bitbucket.org/tristankonolie/petsc/commits/all "Dener, Alp via petsc-users" writes: > Hi Hansol, >

Re: [petsc-users] Printing parallel matrix

2019-01-23 Thread Jed Brown via petsc-users
Evan Um via petsc-users writes: > Dear PETSC users, > > I try to verify a matrix by printing a PETSC matrix and comparing its > elements with reference values. Below is my test code. > > It works well when a single process is used. The output file is created > quickly. In contrast, when multiple

Re: [petsc-users] Help with petsc4py and PC Python type

2019-01-22 Thread Jed Brown via petsc-users
My preference is to put this auxiliary information on the Mat (or the Mat's DM; see MatGetDM()). It's really declarative information about the operator, not algorithmic parameters for the PC (like a threshold in AMG, number of smoothing iterations, etc.). Justin Chang writes: > As of right

Re: [petsc-users] Help with petsc4py and PC Python type

2019-01-22 Thread Jed Brown via petsc-users
Justin Chang via petsc-users writes: > Hi all, > > I am attempting to write my own scour preconditioner for a FEniCS/petsc4py. > I managed to attach a DMShell to the KSP so that I can employ command-line > options for field splitting. Suppose I want to solve the Navier-Stokes > equation and have

Re: [petsc-users] ASM Interface (Additive Schwarz Method)

2019-01-18 Thread Jed Brown via petsc-users
Mark Adams via petsc-users writes: >> This works perfectly as long as I use PC_ASM_BASIC for the PCASMType. If I >> switch to PC_ASM_RESTRICT, my GMRES algorithm, does not converge anymore. >> Why is this? >> > > PC_ASM_RESTRICT specifies the use of a different algorithm. It is a cheaper >

Re: [petsc-users] Using real and complex matrices together

2019-01-13 Thread Jed Brown via petsc-users
It is not supported, sorry. Some users do it with careful linking via multiple shared libraries, but that is fragile and doesn't interoperate. Evan Um via petsc-users writes: > Hi PETSC users, > > Inside my codes, I have both complex and real matrices. To solve complex > matrices, I build and

Re: [petsc-users] Example for adaptive high-order FEM in PETSc

2019-01-13 Thread Jed Brown via petsc-users
Mark Adams via petsc-users writes: >> The following is still unclear and I would appreciate some guidance: >> >> — A implicit DG solve of the inviscid Euler equations would require >> Jacobian contributions from the Riemann Solver at element interfaces. I do >> not see the ability to define

Re: [petsc-users] Data types for local ID's and global ID's for large problems

2019-01-09 Thread Jed Brown via petsc-users
"Weston, Brian Thomas via petsc-users" writes: > Matt, > > Thanks for the quick reply. Users of our ALE3D hydro code at LLNL run very > large problems , which I believe can pass in large amounts of local integer > data to solver packages like HYPRE and PETSc for global solves. All of our >

Re: [petsc-users] In a 2D DMDA object, how to convert (i, j) to a global index?

2019-01-08 Thread Jed Brown via petsc-users
Fande Kong writes: > Thanks Barry and Jed, > > I think I understood now. > > One more question. We usually have a code pattern in some PETSc DMDA > examples as follows: > > DMDAVecGetArrayRead(da,localU,); > DMDAVecGetArray(da,F,); > > DMDAGetCorners(da,,,NULL,,,NULL); > > for (j=ys; j for

Re: [petsc-users] In a 2D DMDA object, how to convert (i, j) to a global index?

2019-01-08 Thread Jed Brown via petsc-users
"Smith, Barry F. via petsc-users" writes: >> On Jan 8, 2019, at 4:11 PM, Fande Kong via petsc-users >> wrote: >> >> Hi All, >> >> I was wondering how to convert a regular (2D DMDA) grid coordinate (i,j) to >> a global index that is used for global matrices and vectors. Do we have any >>

Re: [petsc-users] basis functions of high order approximation (FE)

2019-01-08 Thread Jed Brown via petsc-users
Yes, tensor product of Lagrange polynomials, often written as Q_k. Degrees of freedom associated with Dirichlet boundary conditions have been removed in the systems you're looking at. Yann Jobic via petsc-users writes: > Dear Petsc Users, > > I've been playing with the option "space_degree", in

Re: [petsc-users] Problems about Picard and NolinearGS

2019-01-04 Thread Jed Brown via petsc-users
Yingjie Wu writes: > Thank you very much for your answer. > I tried to use the quasi-Newton method to solve some examples, except > ex48(in src/snes/example/tutorial), the ex3 and the ex19 will produce the > same error information. The error information is as follows. Is there > anything I

Re: [petsc-users] Check vector for zeros

2019-01-03 Thread Jed Brown via petsc-users
Florian Lindner via petsc-users writes: > I get a vector from a linear solve and is used a divisor in > VecPointwiseDivide. Clearly, I must check for zero entries before doing the > division. Note that VecPointwiseDivide does not divide by values that are identically zero. for (i=0; i What

Re: [petsc-users] Problems about Picard and NolinearGS

2018-12-27 Thread Jed Brown via petsc-users
Yingjie Wu via petsc-users writes: > I my opinion, the difficulty in constructing my Jacobian matrix is complex > coefficient.(eg, thermal conductivity* λ* , density ) > For example, in temperature equation(T): > ∇(*λ*∇T) - ∇(ρ* Cp* u ) + Q = 0 > *λ* is thermal conductivity , ρ*

Re: [petsc-users] GAMG scaling

2018-12-24 Thread Jed Brown via petsc-users
Mark Adams writes: > On Mon, Dec 24, 2018 at 4:56 PM Jed Brown wrote: > >> Mark Adams via petsc-users writes: >> >> > Anyway, my data for this is in my SC 2004 paper (MakeNextMat_private in >> > attached, NB, this is code that I wrote in grad school). It is memory >> > efficient and simple,

Re: [petsc-users] GAMG scaling

2018-12-24 Thread Jed Brown via petsc-users
Mark Adams via petsc-users writes: > Anyway, my data for this is in my SC 2004 paper (MakeNextMat_private in > attached, NB, this is code that I wrote in grad school). It is memory > efficient and simple, just four nested loops i,j,I,J: C(I,J) = > P(i,I)*A(i,j)*P(j,J). In eyeballing the numbers

Re: [petsc-users] Can I use TAO for embarrassingly parallel problems with multiple threads?

2018-12-20 Thread Jed Brown via petsc-users
This isn't thread-safe, but in a "simple" (if these things ever are) way because the operation could complete eagerly. "Dener, Alp via petsc-users" writes: > Hi Krys, > > On Dec 20, 2018, at 10:59 AM, Krzysztof Kamieniecki via petsc-users > mailto:petsc-users@mcs.anl.gov>> wrote: > > That

Re: [petsc-users] Dropping single entries in matrix insertion for block matrices

2018-12-10 Thread Jed Brown via petsc-users
"Smith, Barry F." writes: >> On Dec 10, 2018, at 7:58 PM, Jed Brown wrote: >> >> "Smith, Barry F. via petsc-users" writes: >> >>> Well the thing is the indices you pass in are currently always >>> "blocked base", they work automatically for both blocked and non >>> blocked versions of

Re: [petsc-users] Dropping single entries in matrix insertion for block matrices

2018-12-10 Thread Jed Brown via petsc-users
"Smith, Barry F. via petsc-users" writes: >Well the thing is the indices you pass in are currently always >"blocked base", they work automatically for both blocked and non >blocked versions of MatSetValuesLocal(). What do you mean? You pass block indices to MatSetValuesBlocked and

Re: [petsc-users] Is it possible to start MPI with n processes from within the code so it takes only effect on the petsc code?

2018-12-04 Thread Jed Brown via petsc-users
See MPI_Comm_spawn(). https://www.mpi-forum.org/docs/mpi-3.1/mpi31-report/node240.htm#Node240 Note that it may interact poorly (or not at all) with resource managers and other HPC infrastructure (relative to using mpiexec or similar to spawn the jobs, which does not give you the

Re: [petsc-users] RAW binary write

2018-12-04 Thread Jed Brown via petsc-users
Matthew Knepley via petsc-users writes: > On Tue, Dec 4, 2018 at 11:11 AM Lisandro Dalcin via petsc-users < > petsc-users@mcs.anl.gov> wrote: > >> PetscByteSwap ? But be careful, you should (1) vec get array, byteswap, >> vec restore array, (2) view, (3) vec get array, byteswap, vec restore >>

Re: [petsc-users] chelosky vs multigrid

2018-12-03 Thread Jed Brown via petsc-users
Fazlul Huq writes: > Thanks. > > I have tried with large problem also (10^7 X 10^7). Even then I got > cholesky faster than multigrid. > But, the problem is 1D. May be that's the reason. Exactly. Cholesky is O(n) with a very small constant in 1D, O(n^{3/2}) in 2D, and O(n^2) in 3D.

Re: [petsc-users] chelosky vs multigrid

2018-12-03 Thread Jed Brown via petsc-users
Fazlul Huq via petsc-users writes: > Hello PETSc Developers, > > I am trying to solve a poisson equation using "-pc_type cholesky" and > "-pc_type hypre -pc_hypre_type boomeramg" and I got that cholesky > decomposition method takes > less time then multigrid method. > Is this expected? For

Re: [petsc-users] Implementing of a variable block size BILU preconditioner

2018-12-01 Thread Jed Brown via petsc-users
This would use the blocks as indicated by MatSetVariableBlockSizes, not by using a matrix format that explicitly blocks? The information it needs is too big/complex to yield to the preconditioner via a call like MatInvertVariableBlockDiagonal. Instead, I would model it off MatFactor and the ILU

Re: [petsc-users] Problem with large grid size

2018-11-30 Thread Jed Brown via petsc-users
"Smith, Barry F. via petsc-users" writes: >You need to run it on more processors, this one processor doesn't have > enough memory to fit the vectors (which by the way are huge 1,614,907,707,076) This is just a tridiagonal problem; I don't know why the vectors would be huge when the problem

Re: [petsc-users] Question about DMDAGetElements

2018-11-13 Thread Jed Brown via petsc-users
Sajid Ali writes: > I'm still confused and have the following questions : > > 1) Suppose as in the case above a DM object (created using DMCreate1D) is > used to created a matrix A using DMCreateMatrix, how does one convert the > indices obtained from DMDAGetElements to the row and column

Re: [petsc-users] Question about DMDAGetElements

2018-11-12 Thread Jed Brown via petsc-users
Sajid Ali via petsc-users writes: > Hi, > > I'm trying to understand this example > > from a tutorial. DM is used as an alternative to setting up the matrix and > vector separately (as was done in the previous example >

Re: [petsc-users] Turn off "Error on nonconvergence" for KSP solve

2018-11-09 Thread Jed Brown via petsc-users
Justin Chang via petsc-users writes: > Hi all, > > When using KSP, is it possible to not thrown in error (i.e., DIVERGED_ITS) > when -ksp_max_it is reached? You can use KSPConvergedSkip or KSP_NORM_NONE to exit with KSP_CONVERGED_ITS. Note that setting the reason to DIVERGED_ITS is not

Re: [petsc-users] Combine PETSc with CVode example

2018-11-08 Thread Jed Brown via petsc-users
All PETSc TS examples can be run with -ts_type sundials. Aroli Marcellinus via petsc-users writes: > Hi, > > > Is there any simple example about using CVode in PETSc properly? Like > solving ODE in each node at some 3D-mesh? > > Thank you. > > Aroli Marcellinus > > *Kumoh Institute of

Re: [petsc-users] Vec, Mat and binaryfiles.

2018-11-08 Thread Jed Brown via petsc-users
Sal Am writes: > Yes I was just hoping there'd be more than that. > > I have tried using one of them as basis: > > import PetscBinaryIO > import numpy as np > import scipy.sparse > > b_vector = np.array(np.fromfile('Vector_b.bin' > ,dtype=np.dtype((np.float64,2; > A_matrix = >

Re: [petsc-users] Vec, Mat and binaryfiles.

2018-11-07 Thread Jed Brown via petsc-users
Please always use "reply-all" so that your messages go to the list. This is standard mailing list etiquette. It is important to preserve threading for people who find this discussion later and so that we do not waste our time re-answering the same questions that have already been answered in

Re: [petsc-users] Vec, Mat and binaryfiles.

2018-11-05 Thread Jed Brown via petsc-users
Sal Am via petsc-users writes: > Hi, > > I am trying to solve a Ax=b complex system. the vector b and "matrix" A are > both binary and NOT created by PETSc. So I keep getting error messages that > they are not correct format when I read the files with PetscViewBinaryOpen, > after some digging it

Re: [petsc-users] Problems about Assemble DMComposite Precondition Matrix

2018-11-05 Thread Jed Brown via petsc-users
Yingjie Wu via petsc-users writes: > Thank you very much for your reply. > My equation is a neutron diffusion equation with eigenvalues, which is why > I use DMConposite because there is a single non-physical field variable, > eigenvalue. I am not very familiar with FieldSplit. I can understand

Re: [petsc-users] Some Problems about SNES EX19.c

2018-11-04 Thread Jed Brown via petsc-users
Yingjie Wu via petsc-users writes: > Dear Petsc developer: > Hi, > Recently, I am very interested in the ex19 example in SNES, which uses NGS > method to solve the non-linear equations, which may be the method I need to > use in the future. I have some doubts about the program. > 1. > > 82:

Re: [petsc-users] Solution "jumps" after setting timestep

2018-11-03 Thread Jed Brown via petsc-users
What is the index of your DAE? Can you show us code that exhibits this behavior? "Moritz.Huck--- via petsc-users" writes: > Hi, > > I am using the IMEX Runge Kutta to solve an implicit DAE (G=0). > > When I manually set the time step (TSSetTimestep) my solution jumps. > > If I go from a

[petsc-users] Assistant Professorship in Computational Earth-Surface Process Modeling at CU Boulder

2018-11-02 Thread Jed Brown via petsc-users
The Institute of Arctic and Alpine Research (INSTAAR) and Community Surface Dynamics Modeling System (CSDMS) at the University of Colorado invite applications for a tenure-track assistant professor position in Computational Earth-Surface Process Modeling, with an August 2019 start. CSDMS is an

Re: [petsc-users] DIVERGED_NANORING with PC GAMG

2018-11-01 Thread Jed Brown via petsc-users
"Appel, Thibaut" writes: > Jed, Mark, > > Attached are the equations I’m solving. > p is perturbation pressure (unknown) > \bar{u} is a base flow (KNOWN) that carries the perturbation velocity field > we’re solving for too: u (unknown) This looks like a frequency domain problem associated with

Re: [petsc-users] DIVERGED_NANORING with PC GAMG

2018-11-01 Thread Jed Brown via petsc-users
"Appel, Thibaut via petsc-users" writes: > What does "low frequency (indefinite) Helmholtz" mean exactly? (How is my > problem low-frequency helmholtz) What equation are you solving? Mark probably means "high frequency" because that is the difficult case. The low frequency limit is not so

Re: [petsc-users] PetscFinalize at root processor only

2018-11-01 Thread Jed Brown via petsc-users
PetscFinalize is collective, similar to MPI_Finalize. You could MPI_Bcast the result if you want to cleanly exit. If you want to raise an error, you could use SETERRA as in other PETSc Fortran examples. Paula Sanematsu via petsc-users writes: > Hi, > > I have a Fortran code that calls an

<    1   2