| 9 | #include <Mesh.h> |
| 10 | |
| 11 | ZSparseMatrix Assembler::getPressureForceMatrix() { |
| 12 | typedef Eigen::Triplet<double> T; |
| 13 | std::vector<T> triplets; |
| 14 | size_t dim = getDim(); |
| 15 | |
| 16 | for (size_t i=0; i<m_mesh->getNbrBoundaryNodes(); i++) { |
| 17 | size_t glob_idx = m_mesh->getBoundaryNode(i); |
| 18 | VectorF normal = m_mesh->getBoundaryNodeNormal(i); |
| 19 | |
| 20 | for (size_t j=0; j<dim; j++) { |
| 21 | triplets.push_back(T(glob_idx*dim+j , i, normal[j])); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | Eigen::SparseMatrix<double> P = Eigen::SparseMatrix<double>( |
| 26 | dim*m_mesh->getNbrNodes(), m_mesh->getNbrBoundaryNodes()); |
| 27 | P.setFromTriplets(triplets.begin(), triplets.end()); |
| 28 | return ZSparseMatrix(P); |
| 29 | } |
| 30 | |
| 31 | ZSparseMatrix Assembler::getBdAreaMatrix() { |
| 32 | typedef Eigen::Triplet<double> T; |
nothing calls this directly
no test coverage detected