Skip to content
Snippets Groups Projects
Commit aec943fd authored by Sander, Oliver's avatar Sander, Oliver
Browse files

Replace hand-written identity matrix by ScaledIdentityMatrix

Yes, it is debatable whether that change makes the code more readable.
parent d22ab424
No related branches found
No related tags found
No related merge requests found
......@@ -9,13 +9,6 @@ namespace MatrixOperations {
using std::sin;
using std::cos;
static MatrixRT Id (){
MatrixRT Id(0);
for (int i=0;i<3;i++)
Id[i][i]=1.0;
return Id;
}
// static MatrixRT sym (MatrixRT M) { // 1/2 (M^T + M)
// MatrixRT ret(0);
// for (int i = 0; i< 3; i++)
......@@ -168,7 +161,7 @@ namespace MatrixOperations {
// //
static double linearizedStVenantKirchhoffDensity(double mu, double lambda, MatrixRT E1, MatrixRT E2) // CHANGED
{
auto t1 = 2.0 * mu * sym(E1) + lambda * trace(sym(E1)) * Id();
auto t1 = 2.0 * mu * sym(E1) + MatrixRT(Dune::ScaledIdentityMatrix<double,3>(lambda * trace(sym(E1))));
auto tmp1 = scalarProduct(t1,sym(E2));
// auto tmp1 = scalarProduct(t1,E2);
// auto t2 = 2.0 * mu * sym(E2) + lambda * trace(sym(E2)) * Id();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment