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

Method getElementCenter

tools/Assembler/Elements/TetrahedronElements.cpp:48–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48VectorF TetrahedronElements::getElementCenter(size_t ei) const {
49 VectorI elem = m_mesh->get_voxel(ei);
50 VectorF v1 = m_mesh->get_vertex(elem[0]);
51 VectorF v2 = m_mesh->get_vertex(elem[1]);
52 VectorF v3 = m_mesh->get_vertex(elem[2]);
53 VectorF v4 = m_mesh->get_vertex(elem[3]);
54 return 0.25 * (v1 + v2 + v3 + v4);
55}
56
57void TetrahedronElements::check_mesh() {
58 if (m_mesh->get_dim() != 3) {

Callers

nothing calls this directly

Calls 2

get_voxelMethod · 0.80
get_vertexMethod · 0.45

Tested by

no test coverage detected