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

remove old, overly complicated implementation of the director derivatives

[[Imported from SVN: r1708]]
parent 2c7cd089
No related branches found
No related tags found
No related merge requests found
...@@ -260,66 +260,6 @@ public: ...@@ -260,66 +260,6 @@ public:
} }
void getFirstDerivativesOfDirectors(Dune::array<Dune::array<Dune::FieldVector<double,3>, 3>, 3>& dd_dvj) const
{
const Quaternion<T>& q = (*this);
// Contains \partial q / \partial v^i_j at v = 0
Dune::array<Quaternion<double>,3> dq_dvj;
for (int j=0; j<3; j++) {
for (int m=0; m<4; m++)
dq_dvj[j][m] = (j==m) * 0.5;
}
// Contains \parder d \parder v_j
for (int j=0; j<3; j++) {
// d1
dd_dvj[0][j][0] = q[0]*(q.mult(dq_dvj[j]))[0] - q[1]*(q.mult(dq_dvj[j]))[1]
- q[2]*(q.mult(dq_dvj[j]))[2] + q[3]*(q.mult(dq_dvj[j]))[3];
dd_dvj[0][j][1] = (q.mult(dq_dvj[j]))[0]*q[1] + q[0]*(q.mult(dq_dvj[j]))[1]
+ (q.mult(dq_dvj[j]))[2]*q[3] + q[2]*(q.mult(dq_dvj[j]))[3];
dd_dvj[0][j][2] = (q.mult(dq_dvj[j]))[0]*q[2] + q[0]*(q.mult(dq_dvj[j]))[2]
- (q.mult(dq_dvj[j]))[1]*q[3] - q[1]*(q.mult(dq_dvj[j]))[3];
// d2
dd_dvj[1][j][0] = (q.mult(dq_dvj[j]))[0]*q[1] + q[0]*(q.mult(dq_dvj[j]))[1]
- (q.mult(dq_dvj[j]))[2]*q[3] - q[2]*(q.mult(dq_dvj[j]))[3];
dd_dvj[1][j][1] = - q[0]*(q.mult(dq_dvj[j]))[0] + q[1]*(q.mult(dq_dvj[j]))[1]
- q[2]*(q.mult(dq_dvj[j]))[2] + q[3]*(q.mult(dq_dvj[j]))[3];
dd_dvj[1][j][2] = (q.mult(dq_dvj[j]))[1]*q[2] + q[1]*(q.mult(dq_dvj[j]))[2]
+ (q.mult(dq_dvj[j]))[0]*q[3] + q[0]*(q.mult(dq_dvj[j]))[3];
// d3
dd_dvj[2][j][0] = (q.mult(dq_dvj[j]))[0]*q[2] + q[0]*(q.mult(dq_dvj[j]))[2]
+ (q.mult(dq_dvj[j]))[1]*q[3] + q[1]*(q.mult(dq_dvj[j]))[3];
dd_dvj[2][j][1] = (q.mult(dq_dvj[j]))[1]*q[2] + q[1]*(q.mult(dq_dvj[j]))[2]
- (q.mult(dq_dvj[j]))[0]*q[3] - q[0]*(q.mult(dq_dvj[j]))[3];
dd_dvj[2][j][2] = - q[0]*(q.mult(dq_dvj[j]))[0] - q[1]*(q.mult(dq_dvj[j]))[1]
+ q[2]*(q.mult(dq_dvj[j]))[2] + q[3]*(q.mult(dq_dvj[j]))[3];
dd_dvj[0][j] *= 2;
dd_dvj[1][j] *= 2;
dd_dvj[2][j] *= 2;
}
// Check: The derivatives of the directors must be orthogonal to the directors
for (int i=0; i<3; i++)
for (int j=0; j<3; j++)
assert (std::abs(q.director(i) * dd_dvj[i][j]) < 1e-7);
}
/** \brief Turn quaternion into a unit quaternion by dividing by its Euclidean norm */ /** \brief Turn quaternion into a unit quaternion by dividing by its Euclidean norm */
void normalize() { void normalize() {
(*this) /= this->two_norm(); (*this) /= this->two_norm();
......
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