KratosMultiphysics / Kratos

Kratos Multiphysics (A.K.A Kratos) is a framework for building parallel multi-disciplinary simulation software. Modularity, extensibility and HPC are the main objectives. Kratos has BSD license and is written in C++ with extensive Python interface.
https://kratosmultiphysics.github.io/Kratos/
Other
1.01k stars 244 forks source link

[AMatrix] Preparation: Using SparseSpace for linear-solver tests #3004

Closed philbucher closed 4 years ago

philbucher commented 5 years ago

When compiling with AMatrix currently the linear-solver tests in the core are not working since the vectors and the matrix are directly constructed and not with the space as it is done e.g. in trilinos

I wanted to do the same for the tests in the core but unfortunately I cannot get the references from the Matrices/Vectors like it is possible for Trilinos thanks to the implementation of @rubenzorrilla => the AuxiliaryMatrixWrapper and AuxiliaryVectorWrapper

=> I suggest to template the wrappers of @rubenzorrilla with the Space and then we can solve the problems of the core linear-solver tests the same way as in Trilinos (possibly even having only one function then to test linear solvers, they are already now very similar.)

@oberbichler this should properly solve this problem, also it should work when porting to AMatrix-SparseSpace

RiccardoRossi commented 5 years ago

It should not be needed to use the wrapper mechanism for the ublas...

The big problem is that the amatrx vector and ublas sparse matrix are not yet compatible, so we still need ublas in the sparse space...(until amatrix has a sparse matrix implemented)

On Sat, 6 Oct 2018, 11:11 Philipp Bucher, notifications@github.com wrote:

When compiling with AMatrix currently the linear-solver tests in the core are not working since the vectors and the matrix are directly constructed https://github.com/KratosMultiphysics/Kratos/blob/master/kratos/tests/test_linear_solvers.py#L23-L29 and not with the space as it is done e.g. in trilinos https://github.com/KratosMultiphysics/Kratos/blob/master/applications/trilinos_application/tests/test_trilinos_linear_solvers.py#L27-L36

I wanted to do the same for the tests in the core but unfortunately I cannot get the references from the Matrices/Vectors like it is possible for Trilinos thanks to the implementation of @rubenzorrilla https://github.com/rubenzorrilla => the AuxiliaryMatrixWrapper https://github.com/KratosMultiphysics/Kratos/blob/master/applications/trilinos_application/custom_python/trilinos_pointer_wrapper.h#L62 and AuxiliaryVectorWrapper https://github.com/KratosMultiphysics/Kratos/blob/master/applications/trilinos_application/custom_python/trilinos_pointer_wrapper.h#L176

=> I suggest to template the wrappers of @rubenzorrilla https://github.com/rubenzorrilla with the Space and then we can solve the problems of the core linear-solver tests the same way as in Trilinos (possibly even having only one function then to test linear solvers, they are already now very similar.)

@oberbichler https://github.com/oberbichler this should properly solve this problem, also it should work when porting to AMatrix-SparseSpace

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/KratosMultiphysics/Kratos/issues/3004, or mute the thread https://github.com/notifications/unsubscribe-auth/AHr7Ea1nLNaxjHe5OUfLAukvL2-PUkBVks5uiHPIgaJpZM4XLQmN .

jcotela commented 5 years ago

@philbucher we discussed this at the @KratosMultiphysics/technical-committee, we agree about adding functions to get a new vector in the sparsespace, but we hope that the wrappers will not be necessary. We can look into the implementation together when we have some time.

philbucher commented 5 years ago

reminder to myself: maybe the solution used in #3137 can be used

jcotela commented 5 years ago

@philbucher I suspect that one is a different problem... The functions that use those arguments were some time ago changed to use pointers instead of references (or maybe it was the other way around, I don't remember the details), the linked PR is changing the variables to use the correct holder type.

jcotela commented 5 years ago

@philbucher what is the state of this? Maybe we can take a look when you have some time.

philbucher commented 5 years ago

I don't know, I only gave a suggestion on how the problem could be solved. We can have a look again, but last time I checked the core was not compiling with amatrix and I think the problem has not been solved (was the row-access issue I think)

philbucher commented 4 years ago

closing since long stale and probably no longer relevant