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

how to build matrices for the lib #281

Open
nibblelab opened this issue Nov 26, 2024 · 2 comments
Open

how to build matrices for the lib #281

nibblelab opened this issue Nov 26, 2024 · 2 comments

Comments

@nibblelab
Copy link

Hi,

I'm trying to build new matrices to use in amgcl. In the code, the lib reads matrices in CRS/CSR format in a binary file using the method amgcl::io::read_crs while the RHS vector, also in a binary file, is read with amgcl::io::read_dense.

How are those binary files organized?

For example, the matrix file could have an integer number describing the number of columns, followed by an integer number describing the number of rows, followed by a sequence of doubles describing the values of size non-zeros (a parameter), followed by a sequence of integers describing the column index, followed by a sequence of integers describing the row index. With that organization, the file would be structured like: int|int|double ..... double|double .... double|double

Are there any tutorials or instructions regarding how to create the matrices and RHS vectors for use in amgcl::io::read_crs and amgcl::io::read_dense?

@ddemidov
Copy link
Owner

See the poisson equation assembly example here: https://amgcl.readthedocs.io/en/latest/examples.html. The binary format used with read_dense is not standard in any way, it just reads the CRS vectors (ptr, col, and val) from a raw binary file.

@nibblelab
Copy link
Author

Thank you.

I'll take a look at the example you listed.

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