Skip to content
Snippets Groups Projects
Commit 214a90df authored by Oliver Sander's avatar Oliver Sander Committed by sander@FU-BERLIN.DE
Browse files

finally a correct implementation of the third derivative

[[Imported from SVN: r7090]]
parent e7cdbc65
No related branches found
No related tags found
No related merge requests found
...@@ -241,23 +241,22 @@ public: ...@@ -241,23 +241,22 @@ public:
Pq[i][j] = (i==j) - q.globalCoordinates()[i]*q.globalCoordinates()[j]; Pq[i][j] = (i==j) - q.globalCoordinates()[i]*q.globalCoordinates()[j];
} }
Dune::FieldMatrix<double,N,N> PpPq;
Dune::FMatrixHelp::multMatrix(Pp,Pq,PpPq);
Dune::FieldVector<double,N> pProjected = q.projectOntoTangentSpace(p.globalCoordinates()); Dune::FieldVector<double,N> pProjected = q.projectOntoTangentSpace(p.globalCoordinates());
Dune::FieldVector<double,N> qProjected = p.projectOntoTangentSpace(q.globalCoordinates()); Dune::FieldVector<double,N> qProjected = p.projectOntoTangentSpace(q.globalCoordinates());
Dune::FieldMatrix<double,N,N> Pq_sp = Pq; Tensor3<double,N,N,N> derivativeOfPqOTimesPq;
Pq_sp *= sp; for (int i=0; i<N; i++)
for (int j=0; j<N; j++)
Dune::FieldVector<double,N> PpPqp; for (int k=0; k<N; k++) {
PpPq.mv(p.data_,PpPqp); derivativeOfPqOTimesPq[i][j][k] = 0;
for (int l=0; l<N; l++)
result = thirdDerivativeOfArcCosSquared(sp) * Tensor3<double,N,N,N>::product(qProjected,pProjected,pProjected) derivativeOfPqOTimesPq[i][j][k] += Pp[i][l] * (Pq[j][l]*pProjected[k] + pProjected[j]*Pq[k][l]);
+ secondDerivativeOfArcCosSquared(sp) * Tensor3<double,N,N,N>::product(PpPq,pProjected) }
+ secondDerivativeOfArcCosSquared(sp) * Tensor3<double,N,N,N>::product(PpPqp,Pq)
- secondDerivativeOfArcCosSquared(sp) * Tensor3<double,N,N,N>::product(qProjected,Pq_sp) result = thirdDerivativeOfArcCosSquared(sp) * Tensor3<double,N,N,N>::product(qProjected,pProjected,pProjected)
- derivativeOfArcCosSquared(sp) * Tensor3<double,N,N,N>::product(qProjected,Pq); + secondDerivativeOfArcCosSquared(sp) * derivativeOfPqOTimesPq
- secondDerivativeOfArcCosSquared(sp) * sp * Tensor3<double,N,N,N>::product(qProjected,Pq)
- derivativeOfArcCosSquared(sp) * Tensor3<double,N,N,N>::product(qProjected,Pq);
return result; return result;
} }
......
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