Feature eigen
Compare changes
Files
3- Adrien Crovato authored
This MR replaces gmm by Eigen.
Eigen is newer, easier to use, has a larger community and could possibly be faster than gmm. Furthermore, Eigen has an interface to the Intel's Pardiso solver, which might be more efficient than MUMPS.
For now, the code has merely been translated, but not really refactored nor optimized.
To-do list:
gmm::matrix<double>
by Eigen::Matrix<double>
std::vector<double>
by Eigen::(Row)Vector<double>
, where applicable and usefultbox::Element:build()
methods), especially clean the thermo-mechanical matricesvoid build(Matrix const &A, Matrix &K)
should become Matrix K build(Matrix const &A)
, where applicable (mainly tbox::Element
)tbox::Pt
by Eigen::VectorXd
The unchecked tasks will be dealt with in the next MR.
Eigen uses the method of co-factors to inverse a matrix, whose size is fixed and up to 4x4.For now, the matrices in Mem are dynamically sized, but there should be a way to force Eigen to use the method of co-factors for MemTri3, MemQuad4 and MemTetr4. This could partly address #27.
I replaced std::vector<double>
by Eigen::VectorXd
where those vectors were used for linear algebra. There are some exceptions, check the comments in my commits.
The main exception is that some vectors are public and hold variables and results. I decided to keep std::vector
for such cases in order to have more flexibility when interfacing in python (SWIG already already fully interfaces std::vector). For linear algebra on the C++ side, these std::vector
are mapped with Eigen::Map<Eigen::Vector>
, which holds a reference to std::vector to keep it up to date, and can be manipulated as Eigen::Vector
.
Passed on ubuntu18.04 (python 2.7.15), debian4.9 (python 2.7.13), msys2 (python 3.8.1).
@R.Boman and @Kim.Liegeois: Please double check that the solvers you implemented still give accurate results, particularly using multithreading. The battery is passing, but I did not run and check each test individually (only some of them)!