MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / getPressureForceMatrix

Method getPressureForceMatrix

tools/Assembler/ref/Assembler.cpp:11–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include <Mesh.h>
10
11ZSparseMatrix 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
31ZSparseMatrix Assembler::getBdAreaMatrix() {
32 typedef Eigen::Triplet<double> T;

Callers

nothing calls this directly

Calls 7

ZSparseMatrixClass · 0.50
getNbrBoundaryNodesMethod · 0.45
getBoundaryNodeMethod · 0.45
getBoundaryNodeNormalMethod · 0.45
getNbrNodesMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected