Hot answers tagged

11 votes
Accepted

PETSc-like library for Julia

Julia is built in such a way that you will never see a full PETSc-like library, and that's on purpose. PETSc is not a single thing: it is an HPC library with some utility functions, linear solvers, ...
user avatar
10 votes

Are there any "light-weight" FEM packages around?

I've been developing a lightweight finite element library in Python 2.7 harnessing the power of NumPy arrays and SciPy sparse matrices. The general idea is that given a mesh and a finite element, you ...
user avatar
  • 1,877
8 votes

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

As one of the library's authors, I would of course love for deal.II to come out on top with this comparison. But I suspect it may not, and the answer lies in a factor you omit from your comparison: ...
user avatar
6 votes
Accepted

Efficiency of parallel direct linear solver

Your problem is too small. You have to consider that to get good efficiency, each processor has to have enough work to offset the cost of communication. In other words, there is a threshold how many ...
user avatar
5 votes

Distributed (MPI) matrix matrix multiplication

You say that you want an MPI version. Then you need to study the literature, as the distributed memory variant of matrix-matrix product are not a simple parallellization of the sequential version. ...
user avatar
4 votes
Accepted

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

Unfortunately there's no tool for this. You can run each on a variety of input sizes to establish the computational complexity they appear to have, i.e. the $f$ in the $O(f(n))$ that characterizes ...
user avatar
  • 10.8k
4 votes
Accepted

Choosing hardware to use with PETSc

If you're using iterative methods with assembled matrices, just buy DDR channels. Don't pay attention to number of cores when loooking at the spec sheet. Within the same class of processors (e.g., a ...
user avatar
  • 25.3k
4 votes
Accepted

Applying Dirichlet b.c. to the Eigenvalue-Problem

I like this formulation for implementing Dirichlet boundary conditions in cases where elimination of boundary dofs is not convenient. If you apply effectively the same procedure to $M$, the rows and ...
user avatar
  • 25.3k
4 votes
Accepted

Finite Elements Weak Formulation generalization

Continuous weak form Though I think the weak form is more fundamental, suppose we start with the strong divergence-form representation for a (first- or) second-order quasilinear PDE: find the $m$-...
user avatar
  • 25.3k
4 votes

Are there any "light-weight" FEM packages around?

I think you have some confusion. PETSc is not in the same league as Fenics, Libmesh, Moose etc. In fact, all of these (heavyweight) packages use PETSc for linear algebra. IMHO PETSc is as lightweight ...
user avatar
  • 1,769
4 votes

Are there any "light-weight" FEM packages around?

I can recommend nutils. nutils meets at least a few your "light-weight" requirements. it is pure python and easy to install since it only depends on standard Python libraries numpy, scipy, and ...
user avatar
  • 3,408
4 votes
Accepted

Can Variational Inequalities handle non-symmetric matrices?

It is indeed possible to write an obstacle problem for an advection-diffusion equation as a variational inequality: If $a(u,v)$ is the bilinear form corresponding to your advection-diffusion equation, ...
user avatar
4 votes

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

Wow! A question that I can answer! I have been using PETSc for the past year and a half to solve the Navier-Stokes equations (with some hard-coded MPI). The best way to learn PETSc is to (1) read ...
user avatar
4 votes
Accepted

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

Such problems can be solved using an $LDL^T$ factorization (similar in memory and time cost to Cholesky). Your matrix is not very sparse so treating it as such may have limited benefit. I would ...
user avatar
  • 25.3k
4 votes
Accepted

How to solve a linear problem A x = b in PETSC when matrix A has zero diagonal enteries?

Use of Lagrange multipliers produces a saddle-point problem, $$ \begin{pmatrix} A & B^T \\ B & 0 \end{pmatrix} \begin{pmatrix} u \\ \lambda \end{pmatrix} = \begin{pmatrix} b \\ 0 \end{pmatrix} ...
user avatar
  • 25.3k
3 votes

PETSc or Trilinos for GPU?

As of writing this answer (October 2014), Trilinos does not have this capability throughout its code base. There are two packages (Kokkos and Tpetra) that will provide this functionality to Trilinos, ...
user avatar
3 votes

PetSc vs Sundials for serial numerical computations?

As mentioned in Geoff Oxberry's more complete answer, it should be noted that PETSc includes TSSUNDIALS, an interface to SUNDIALS. If you configure PETSc with the ...
user avatar
3 votes

PetSc vs Sundials for serial numerical computations?

In general, you can do more with PETSc. SUNDIALS is a collection of ODE solvers (in CVODE, Adams-Bashforth and BDF methods; in ARKODE, ARKIMEX methods) and DAE solvers (IDAS implements a BDF method) ...
user avatar
3 votes

Any recommendations for unit-testing frameworks compatible with code/libraries that use MPI?

The Teuchos Unit test harness in Trilinos natively supports unit tests that use MPI. Things like controlling output from multiple processes and aggregating pass/fail over all processes is automatic. ...
user avatar
3 votes
Accepted

Construct a preconditioner for the linear system $Ax = b$ from a different matrix

Since nobody is stepping up to answer this question, let me point to a paper that contains an example of why one would want to do this: http://www.math.tamu.edu/~bangerth/publications.html#...
user avatar
3 votes

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

Krylov solvers have no problem converging if the system is consistent, i.e., if the right-hand side is in the image of the system matrix $A$; see, e.g., Iterative Krylov Methods for Large Linear ...
user avatar
3 votes
Accepted

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

If you're looking for a book and are happy with finite element discretizations, you can check out Elman, Silvester, and Wather, "Finite Elements and Fast Iterative Solvers". If you prefer finite ...
user avatar
  • 25.3k
3 votes
Accepted

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

There are many methods for solving linear systems in parallel, but fundamentally what works and what doesn't depends crucially on the properties of the linear system you are trying to solve. Among ...
user avatar
3 votes
Accepted

Send Petsc sequential matrix to another MPI rank

I don't think PETSc supports it. PETSc really thinks in parallel, so it converts at most between distributed matrices and sequential matrices through submatrix taking operations. I would MatGetArray ...
user avatar
2 votes

Parallel Monte Carlo simulation using PETSc

If you have an idea about how to statically partition your problem into subgroups, you could try partitioning the MPI processes into these subgroups, and then creating an MPI communicator for each ...
user avatar
2 votes

Efficiently swap vectors in PETSC

What if one Vec was created by VecCreateSeqWithArray and the other not? How would the user know which Vec holds the memory they allocated? There is a dirty ...
user avatar
  • 25.3k
2 votes

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

There is nothing about SNES that requires DMDA. Create a Vec distributed however you would ...
user avatar
  • 25.3k
2 votes
Accepted

Why does PETSc matrix memory allocation improve performance so much?

Warning: this answer is only going to give a brief overview, for the real details, the one source that won't be wrong is the source code. The core matrix AIJ format is basically the same as the one ...
user avatar
  • 2,199
2 votes

Writing a 3D array from Petsc

It depends on the object representation of your 3D array. If it's a PETSc Mat, you want to look at MatView; if it's a ...
user avatar
2 votes

Algebraic multigrid in PETSc

AMG can be used with all examples in PETSc. There are three robust implementations that you might want to use -pc_type gamg is a native (smoothed) aggregation ...
user avatar
  • 25.3k

Only top scored, non community-wiki answers of a minimum length are eligible