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

Method pre_process

tools/IGL/HarmonicSolver.cpp:41–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void HarmonicSolver::pre_process() {
42 const size_t dim = m_nodes.cols();
43 const size_t simplex_size = m_elements.cols();
44 if (dim == 2) {
45 if (simplex_size != 3) {
46 throw RuntimeError("In 2D, harmonic solver only supports triangle meshes");
47 }
48 } else if (dim == 3) {
49 if ((simplex_size != 4) && (simplex_size != 3)) {
50 throw RuntimeError("In 3D, harmonic solver only supports tet meshes (volume) or triangle meshes (surface).");
51 }
52 } else {
53 throw NotImplementedError("Harmonic solver does not support mesh with dimension " +
54 std::to_string(dim));
55 }
56}
57
58void HarmonicSolver::solve() {
59 igl::harmonic(m_nodes, m_elements, m_bd_indices, m_bd_values, m_order, m_solution);

Callers 5

createMethod · 0.80
test_linear_functionMethod · 0.80
test_radial_functionMethod · 0.80
test_2DMethod · 0.80
mainFunction · 0.80

Calls 2

RuntimeErrorClass · 0.85
NotImplementedErrorClass · 0.85

Tested by 3

test_linear_functionMethod · 0.64
test_radial_functionMethod · 0.64
test_2DMethod · 0.64