ginkgo-project / ginkgo

Numerical linear algebra software package
https://ginkgo-project.github.io/
BSD 3-Clause "New" or "Revised" License
414 stars 88 forks source link

Electrostatic amir #1714

Closed amirbous closed 3 weeks ago

amirbous commented 1 month ago

example

Further work on code provided by @pratikvn going along with progress for using ginkgo in electrostatic

Structure and changes - all changes are done under example/electrostatic-abb: Added new utils.hpp file to include user defined methods: read input from matrix file, read config file .... . And moved some of the already existing functions to it added readme.md for electrstatic specific usage

Purpose Added Support for binary matrix files: added reader Added config file (electrto.config) parser , to read parameters for Ginkgo configuration Ginkgo configuration parameters are set in electro.config. More in the readme page for the electrostatic example

!! Warning !!: Still uncertain about double and single precision as output files seem to be double precision in ascii format and single precision in binary format. For now when reading binary, reading as float and casting to double.

pratikvn commented 1 month ago

Thanks @amirbous! I think the explicit cast to double should not be necessary, but shouldn't hurt. The matrix_data object is templated and should implicitly cast to its value_type.

So, you should be able to automatically run different solvers for both float and double by changing the using ValueType = ... in the electrostatic_abb.cpp file and compiling it again.

upsj commented 1 month ago

@amirbous What you describe with respect to gko::write sounds like it might be a bug - can you confirm that the output format changes based only on the value type?

pratikvn commented 1 month ago

@upsj , I think he is not using gko::write, but using the write functionality in the casopt library.

amirbous commented 1 month ago

@upsj, @pratikvn Thank you for the check. The input files I am using are generated externally from another fortran script, seperate from ginkgo, and are using different precision based on the format. I made sure to note it down, so whenever other files are being used. I will proceed as described by @pratikvn where the user is aware of the datatype being used, and can speicify it in the ValueType.

amirbous commented 1 month ago

. To reissue

amirbous commented 3 weeks ago

I guess it should be ready now