Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrix Assembly #245

Open
karabelaselias opened this issue Nov 10, 2022 · 1 comment
Open

Matrix Assembly #245

karabelaselias opened this issue Nov 10, 2022 · 1 comment

Comments

@karabelaselias
Copy link

I'm recently saw this amazing lib for AMG. Tried the examples and they perform very well so I wanted to use the lib for my own FE implementation as solver backend, however up til now I was using Petsc for matrix assembly, and I was wondering if there is a possibility to assemble a distributed matrix also with this code, as all the examples used to read in a MatrixMarket format?

To formulate it more precise: Is there an equivalent to https://petsc.org/release/docs/manualpages/Mat/MatSetValues/ from Petsc?

@ddemidov
Copy link
Owner

Matrix assembly is outside of the library scope, the library expect the user to provide assembled matrices in CSR format. The MM reader is only provided to facilitate examples and experimenting. Here is an example of direct assembly:

https://github.com/ddemidov/amgcl/blob/master/examples/mpi/mpi_solver.cpp#L47

There is also trilinos.epetra adapter that allows using matrices in epetra format as input:

https://github.com/ddemidov/amgcl/blob/master/amgcl/adapter/epetra.hpp

There are other adapters (e.g. eigen adapter) that allow to use assembled matrices in third-party formats.

If PETSc provides direct access to the underlying CSR format, it should be possible to use a similar approach for PETSc matrices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants