tjhei / cracks

pfm-cracks: A Finite Element code for crack propagation
GNU General Public License v2.0
82 stars 47 forks source link

Swapped eigenvectors for proper order #2

Closed prashantmital closed 9 years ago

prashantmital commented 9 years ago

For the case of zero off-diagonal terms consider the following matrix:

5    0
0    0

The current setup will recognize e1=5, e2=0 and populate the eigenvectors as:

ev1 = (0,1)
ev2 = (1,0)

Thus making (0,1) the eigenvector associated with the eigenvalue 5. In reality, this should be the other way around. A simple swap fixes it.

tjhei commented 9 years ago

It is a bit more complicated because it depends on the signs of the diagonal values. I think I fixed this now (see 420a0cc and tests introduced in d37eabd). Do you agree?

prashantmital commented 9 years ago

@tjhei Yes, your edits make more sense than my simplistic suggestion. However, I am not familiar with this unittest framework in C++ is this taken from Boost? Working with Python has made me quite used to unittests so I must thank you for informing me that C++ has some similar support.

prashantmital commented 9 years ago

Closing #2

tjhei commented 9 years ago

No this is https://github.com/philsquared/Catch