| 29 | } |
| 30 | |
| 31 | ZSparseMatrix Assembler::getBdAreaMatrix() { |
| 32 | typedef Eigen::Triplet<double> T; |
| 33 | std::vector<T> triplets; |
| 34 | size_t dim = getDim(); |
| 35 | |
| 36 | size_t num_bd_vertices = m_mesh->getNbrBoundaryNodes(); |
| 37 | for (size_t i=0; i<num_bd_vertices; i++) { |
| 38 | VectorI bd_faces = m_mesh->getBoundaryNodeAdjacentBoundaryFaces(i); |
| 39 | double area = 0.0; |
| 40 | for (size_t j=0; j<bd_faces.size(); j++) { |
| 41 | area += m_mesh->getBoundaryFaceArea(bd_faces[j]); |
| 42 | } |
| 43 | area /= double(dim); |
| 44 | triplets.push_back(T(i, i, area)); |
| 45 | } |
| 46 | |
| 47 | Eigen::SparseMatrix<double> Pb = Eigen::SparseMatrix<double>(num_bd_vertices, num_bd_vertices); |
| 48 | Pb.setFromTriplets(triplets.begin(), triplets.end()); |
| 49 | return ZSparseMatrix(Pb); |
| 50 | } |
| 51 | |
| 52 | // Item is basically a <key, value> pair. |
| 53 | typedef std::pair<int, double> Item; |
nothing calls this directly
no test coverage detected