Questions tagged [petsc]

PETSc is an open source suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations.

Filter by
Sorted by
Tagged with
2
votes
1answer
51 views

What method to solve a sparse complex symmetric (non-Hermitian) system?

I have a sparse system (about 78% of zero entries) that is complex and symmetric (but not Hermitian). The following figure shows the structure of the problem. The off-diagonal blocks are incidence ...
0
votes
1answer
35 views

Why PETSc/MPI uses only 1 processor a number of times, rather than using several as prescribed by mpiexec [closed]

I am a beginner to PETSc and MPI, so after installing PETSc I was compiling some basic tutorial. But whenever I give the number of processors i.e mpiexec -n 4 ./ex1 ...
1
vote
1answer
116 views

Solving nonlinear PDE with finite difference based on Newton-Krylov

I am now working on solving MHD equations with finite difference method, which include nonlinear equations: $$ \frac{\partial\rho}{\partial t}+\nabla\cdot\left[\left(\rho_0+\rho\right){v}\right]-\...
1
vote
1answer
409 views

Assembling sparse matrix in PETSC for Poisson equation

I am a novice at PETSC, and I have been trying to write an FVM code for steady heat conduction in 2D using PETSC (square, regular grid, Dirichlet boundaries) Since the large matrix , say A, will be ...
0
votes
1answer
39 views

Access PETSc data in totalview?

Is it possible to view the data stored in the various PETSc data types from within totalview? Ordinarily, PETSc types are integers which act as pointers to the actual data (obviously my understanding ...
1
vote
0answers
21 views

Orientation of cones and transitive closures of a dmplex in Petsc

From the Petsc manual pages, I fail to understand what the orientations of cones and transitive closures mean. In particular, how can I relate these numbers to the orientation of the length/area/...
1
vote
1answer
30 views

Send Petsc sequential matrix to another MPI rank

I am doing specific tests on matrices, so forgive me if this question doesn't seem related to Petsc typical use. I have a SEQAIJ matrix on one process and I need ...
3
votes
1answer
48 views

PETSc - Manipulate BAIJ matrix locally

My program loads a parallel PETSc matrix $A$ on several MPI processes, each holding a block submatrix $A_i$. I would like to retrieve the local submatrix $A_i$, the one corresponding to the current ...
9
votes
1answer
1k views

preconditioner for a matrix-free method to solve Ax=b

I need to solve Ax=b, but I realize that even if it is sparse, storing the matrix coefficients of my problem will take too much memory. So now I'm considering using a matrix-free method, because the ...
3
votes
0answers
456 views

How do I configure PETSc to run long double precision or some other precision that is greater than default? [closed]

I'm installing PETSc for complex numbers with the C99 standard. I'd like to have it installed using a higher precision than the default (double, I presume) since that will most likely make the LU ...
0
votes
1answer
45 views

PCJACOBI works but the default PCBJACOBI failed in PETSc

I am using PETSc and libmesh to solve a simple linear elastic problem with quite complicated geometry, using linear tetrahedral elements. I am always using the KSP CG as the solver. I noticed that ...
22
votes
1answer
11k views

Why is Newton's method not converging?

I am using PETSc's nonlinear solver package SNES to solve a system of nonlinear equations obtained by discretizing a partial differential equation. How can I determine why the solver is not converging ...
1
vote
3answers
271 views

Practical reference on sparse linear solvers for PDEs (Navier-Stokes, Poisson) and on learning PETSc

My background is mainly engineering and applied research and I have been a developer or some CFD software, but mostly at high level without worrying about linear solvers and the like. This has been ...
2
votes
1answer
434 views

How to convert MPIAIJ to SEQAIJ matrix in petsc/petsc4py?

I am curious, if there is a function to convert MPIAIJ (distributed matrices in AIJ format) to a SEQAIJ matrix that lie on a single processor. It is possible to do such an operation for PETSc vectors ...
1
vote
1answer
201 views

What is the default smoother for the “PCMG” preconditioner in PETSc?

For a large parallel sparse matrix (mpiaij type matrix) in my code, I was experimenting with various preconditioners to see which one would do best with GMRES/BiCGSTAB. I tried the PCMG ...
4
votes
2answers
753 views

Outputting a distributed vector in PETSc

I'm working with someone else's code that uses PETSc 3.0.0-p9. They have a vector at the end of the computation that is distributed among a number of different processors, and I want to output that ...
7
votes
2answers
224 views

How can I tell which options PETSc was compiled with?

I'm working on a machine with a version of PETSc compiled by someone else. Is there a straightforward way to find out which options were used at compile time from the installation itself? For example,...
8
votes
1answer
999 views

How can I compute the Schur complement in PETSc?

How can I compute the Schur complement: $$ S = K_{bb} - K_{ba} K_{aa}^{-1} K_{ab} $$ where $$ K=\begin{pmatrix} K_{aa} & K_{ab} \\ K_{ba} & K_{bb} \end{pmatrix} $$ (in some ordering) is a ...
2
votes
1answer
83 views

is it more efficient to use ghosted vector in PETSC for PDE solving on unstructured mesh?

In a traditional PDE solver on unstructured meshes, we know exactly the sparse pattern of the Jacobian matrix, and we know that the amount of data to communicate is far smaller than the amount of ...
0
votes
1answer
60 views

How to access solution to linear system in PETSc?

I have just started with PETSc hence it might seem like a very stupid question but I couldn't find any answer in manual. After Calling KSPSolve, where can I access the soluition for my linear system? ...
3
votes
0answers
70 views

PETSc SNES for user defined state

How to use PETSc SNES (scalable nonlinear equation solver), when the solution is not a vector but a user defined state? I am implementing a non-linear mechanics problem (geometrically exact shell 5-...
9
votes
3answers
2k views

Are there any “light-weight” FEM packages around?

Basically, FEM seems to be a problem that is pretty much "solved". There are numerous powerful frameworks existing, like Trilinos, PETSc, FEniCS, Libmesh or MOOSE. One thing they have in common: They ...
2
votes
1answer
434 views

Distributed (MPI) matrix matrix multiplication

I perform matrix matrix multiplications (between rank-3 and rank-2 arrays) in fortran using following subroutine, ...
1
vote
0answers
141 views

Getting started with FEM: Ill-conditioned matrix when evaluating flux terms in conservation law?

I have a system of conservation laws of the form $$ \frac{\partial \mathbf{q}}{\partial t} + \nabla \cdot \mathbf{F}\!\left(\mathbf{q}\right) = 0 $$ I want to use finite elements to solve this ...
1
vote
1answer
158 views

Efficiency of parallel direct linear solver

I am currently working on solving a positive definite symmetric systems in parallel. The parallel direct solver I used is MUMPS. However, the performance and efficiency of the parallel direct solver ...
2
votes
2answers
777 views

Which python library for GPU sparse linear system solver library

I have a fluid dynamic solver written in python which I want to accelerate by moving the most expensive computations to the GPU. Ideally all arrays and sparse matrices used in my code should remain on ...
0
votes
1answer
240 views

setting COMM_WORLD size from petsc4py without mpiexec command line

I would like to create a parallel solver using petsc4py as one component of a larger application. I can easily get PETSc.COMM_WORLD.getSize() to be 4 by calling mpiexec -n 4 python my_prog.py ...
3
votes
1answer
118 views

Get a matrix with absolute values in PETSc [closed]

Is there any function to create or change a matrix, to have $A_{ij} = \text{abs}(A_{ij})$ in PETSc? If possible it should work with MPIAIJ matrices, not only local.
2
votes
1answer
115 views

Which iterative method and preconditioner from petsc should be used when solving linear algebra in parallel?

I am currently trying to parallelize the incompressible flow solver code. However, when I run the code I realise that the parallel code takes much longer time than sequential code to finish one ...
1
vote
0answers
204 views

Why does PETSc take unexpectedly long to set up its KSP solver with a custom preconditioner? [closed]

I am attempting to solve a large system, $\bf{Ax} = \bf{b}$ with the help of PETSc. Due to the size of the problem, I'm using a matrix-free approach, where $\bf{A}$ is just a shell. I'm also providing ...
9
votes
4answers
1k views

What is a robust, iterative solver for large 3-d linear-elastic problems?

I'm diving into the fascinating world of finite element analysis and would like to solve a large thermo-mechanical problem (only thermal $\rightarrow$ mechanical, no feedback). For the mechanical ...
1
vote
0answers
58 views

Parallel dense solve with submatrices from mesh refinement with Petsc

For a Bounday Element Method problem I require the solution of a system of linear equations with multiple right-hand sides. Though this is a dense system, I still want to do it via Petsc in parallel. ...
1
vote
1answer
76 views

How to deal with multi-region problems (in PETSc)

Consider a problem where space is filled with a liquid and a solid phase, with a large, complicated geometry. On each of the phases, there's an electrical potential/poisson equation. The equations are ...
1
vote
2answers
573 views

Linear solvers: How to deal with a singular system? (Poisson equation with Neumann boundary conditions)

The question is in the context of iterative numerical solution of large PDE systems with Finite Differences or Finite Elements: Stating the Poisson equation with Neumann boundary conditions will lead ...
1
vote
1answer
291 views

Algebraic multigrid in PETSc

Consider a potential/poisson equation on a very large, complicated geometry. Currently, an self-written FEM and linear solvers from NumPy are used. Performance is, of course, not good enough for ...
1
vote
1answer
285 views

Why does PETSc matrix memory allocation improve performance so much?

Context In the Portable, Extensible Toolkit for Scientific Computing (PETSc), the user often creates matrices and vectors. These objects are then used as input for other routines like iterative ...
10
votes
3answers
2k views

Thrust for GPU programming

I'm very new to GPGPU programming so please forgive me if the question is not particularly appropriate. From what I understand GPU programming is a very intricate piece of engineering work when ...
3
votes
1answer
225 views

SLEPc eigensolvers take long time to converge for large sparse symmetric matrices

I am leveraging the SLEPc library for solving the first $k$ (where $k = 3$ or $4$) eigenvalues and their corresponding vectors for a matrix of size 200,000. The matrix is sparse and symmetric. I ...
7
votes
2answers
292 views

Comparing various implementations/software packages for large-scale finite element simulations

I currently use FEniCS and Deal.II to solve various FEM problems. I am also writing my own implementation of these problems by directly implementing the data structures, routines, and solvers within ...
2
votes
1answer
6k views

Compiling and running a “hello world” program in PETSc

I'm trying to compile a hello world program using PETSc, based off of this tutorial, slide 33 . How would I compile this? I know that I can't use a simple 'mpicc' command. When running the program, ...
5
votes
2answers
410 views

PetSc vs Sundials for serial numerical computations?

I am currently working on a physics problem that turns into a non-linear boundary value problem. I need an efficient numerical solver that I could run on my laptop with i5 dual core CPU. I am ...
2
votes
1answer
376 views

PETSc: Blocking matrices using MatCreateSeqBAIJ and MatSetValuesBlocked

I am a little confused with PETSc's documentation for MatSetValuesBlocked. The code below works fine for matrices when I choose small block sizes, but I get errors ...
1
vote
1answer
190 views

The alternative to using PETSc's SNES solvers in parallel without using the DMDA methods

I am using the PETSc libraries, in particular using the SNES solver package to solve a nonlinear matrix equation. Is there a way of parallelising the solution to this problem problem without using ...
1
vote
0answers
93 views

PETSc - difference between PetscNew and PetscMalloc

I wonder what is the difference between both functions. In C++, the difference between new and malloc is easier: new allocates memory by calling the constructor. What about PETSc ? In the example, ...
1
vote
1answer
89 views

PETCs - How should one initialize PetscRandom?

The documentation of PETSc shows an example of usage: ...
0
votes
1answer
86 views

PETSc - how computing a random number between 0 and 1?

In PETSc, I need to generate a random number between 1 and 0. With the include cstdlib, the classical trick is: ...
2
votes
0answers
161 views

Is it worth switching to timesteppers provided by PETSc if I can't write down a Jacobian for my problem? Case study with “the amoeba” toy problem

I am considering using petsc4py instead of scipy.integrate.odeint (which is a wrapper for Fortran solvers) for a problem ...
3
votes
1answer
567 views

Why is MPI/PETSc only showing 1 processor even though it works for helloworld?

I am a beginner with Unix and MPI. For the serial program, I run the program by typing make in /directory/buildagain and then <...
5
votes
1answer
123 views

Can Variational Inequalities handle non-symmetric matrices?

I am trying to enforce the discrete maximum principle (i.e., ensuring non-negative concentrations) for diffusion-type problems that have an anisotropic diffusivity tensor (e.g., tensor dispersion from ...
2
votes
0answers
149 views

preconditioned Uzawa method with Petsc

I am trying to improve the resolution of a Stokes problem (P2/P1 on unstructured mesh) defined by the matrix $M$: $M= \begin{pmatrix} A_u & 0 & B_u \\ 0 & A_v & B_v\\ B_u^T & B_v^...