| 39 | } |
| 40 | |
| 41 | void Assembler2D::precomputeShapeFunctionDerivatives() { |
| 42 | Eigen::MatrixXd selector = Eigen::MatrixXd::Zero(3,2); |
| 43 | selector << 0.0, 0.0, |
| 44 | 1.0, 0.0, |
| 45 | 0.0, 1.0; |
| 46 | |
| 47 | m_DN.resize(m_mesh->getNbrElements()); |
| 48 | for (size_t i=0; i<m_mesh->getNbrElements(); ++i) |
| 49 | { |
| 50 | VectorI idx = m_mesh->getElement(i); |
| 51 | assert(idx.size() == 3); |
| 52 | VectorF u[3]; |
| 53 | u[0] = m_mesh->getNode(idx[0]); |
| 54 | u[1] = m_mesh->getNode(idx[1]); |
| 55 | u[2] = m_mesh->getNode(idx[2]); |
| 56 | |
| 57 | Eigen::MatrixXd P = Eigen::MatrixXd::Zero(3,3); |
| 58 | P << 1.0, 1.0, 1.0, |
| 59 | u[0][0], u[1][0], u[2][0], |
| 60 | u[0][1], u[1][1], u[2][1]; |
| 61 | |
| 62 | // DN is a 4x3 matrix containing the gradients of the |
| 63 | // 4 shape functions (one for each node) |
| 64 | // |
| 65 | m_DN[i] = P.inverse() * selector /* * -1.0 */; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | ZSparseMatrix Assembler2D::getMassMatrix(bool lumped, int repeats) { |
| 70 | double p = m_density; |
nothing calls this directly
no test coverage detected