Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/Test_TetMesh.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Tetrahedral Mesh"
"# Tetrahedral Mesh"
]
},
{
Expand All @@ -20,7 +20,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"First, instead of loading, we define a small tetrahedral mesh represening a cube with a center vertex and twelve tetrahedra."
"First, instead of loading, we define a small tetrahedral mesh representing a cube with a center vertex and twelve tetrahedra."
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions examples/Test_TriaMesh_Geodesics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# TriaMesh Geodesics"
"# TriaMesh Geodesics"
]
},
{
Expand Down Expand Up @@ -352,7 +352,7 @@
"b0=divx\n",
" \n",
"# solve H x = b0\n",
"# we don't need the B matrix here, as divx is the intgrated divergence \n",
"# we don't need the B matrix here, as divx is the integrated divergence \n",
"print(\"Matrix Format now: \"+H.getformat())\n",
"if useCholmod:\n",
" print(\"Solver: cholesky decomp - performance optimal ...\")\n",
Expand Down Expand Up @@ -593,7 +593,7 @@
"version": "3"
},
"nbsphinx": {
"execute": "always"
"execute": "always"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion lapy/tria_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ def boundary_loops(self):
firstcol = np.nonzero(adj.indptr)[0][0] - 1
loops = []
# loop while we have more first columns:
while not firstcol == []:
while np.size(firstcol) > 0:
# start the new loop with this index
loop = [firstcol]
# delete this entry from matrix (visited)
Expand Down
155 changes: 155 additions & 0 deletions lapy/utils/tests/expected_outcomes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
{
"expected_outcomes": {
"test_tria_mesh": {
"expected_euler_value": 2,
"expected_area": [
0.5,
0.5,
0.5,
0.5,
0.5,
0.5,
0.5,
0.5,
0.5,
0.5,
0.5,
0.5
],
"expected_mesh_area": 5.999999999999998,
"expected_vertex_degrees": [6, 4, 4, 4, 4, 4, 6, 4],
"expected_vertex_area": [
1.0,
0.66666667,
0.66666667,
0.66666667,
0.66666667,
0.66666667,
1.0,
0.66666667
],
"expected_edge_length": 1.1380711874576983,
"expected_triangle_normals": [
[0.0, 0.0, -1.0],
[0.0, -0.0, -1.0],
[0.0, 0.0, -1.0],
[0.0, -0.0, -1.0],
[0.0, 1.0, 0.0],
[0.0, 1.0, 0.0],
[-1.0, 0.0, 0.0],
[-1.0, 0.0, -0.0],
[0.0, 1.0, 0.0],
[0.0, 1.0, 0.0],
[-1.0, 0.0, 0.0],
[-1.0, 0.0, -0.0]
],
"expected_triangle": [
0.8660254,
0.8660254,
0.8660254,
0.8660254,
0.8660254,
0.8660254,
0.8660254,
0.8660254,
0.8660254,
0.8660254,
0.8660254,
0.8660254
],
"expected_vertices": [0, 1, 2, 3, 4, 5, 6, 7],
"expected_flips": 6,
"expected_result": [
[-0.57735027, -0.57735027, -0.57735027],
[-0.40824829, 0.81649658, -0.40824829],
[0.40824829, 0.40824829, -0.81649658],
[0.81649658, -0.40824829, -0.40824829],
[-0.40824829, -0.40824829, 0.81649658],
[-0.81649658, 0.40824829, 0.40824829],
[0.57735027, 0.57735027, 0.57735027],
[0.40824829, -0.81649658, 0.40824829]
],
"expected_result_offset": [
[-0.57735027, -0.57735027, -0.57735027],
[-0.40824829, 0.81649658, -0.40824829],
[0.40824829, 0.40824829, -0.81649658],
[0.81649658, -0.40824829, -0.40824829],
[-0.40824829, -0.40824829, 0.81649658],
[-0.81649658, 0.40824829, 0.40824829],
[0.57735027, 0.57735027, 0.57735027],
[0.40824829, -0.81649658, 0.40824829]
],
"expected_boundary_loop": [0, 8, 1, 13, 2, 16, 3, 9]
},
"test_tet_mesh": {"expected_vertices": [0, 1, 2, 3, 4, 5, 6, 7, 8]},
"test_compute_shapedna": {
"expected_eigenvalues": [-4.0165149e-05, 4.169641, 4.1704664],
"tolerance": 1e-4
},
"test_normalize_ev_geometry": {
"expected_normalized_values": [-0.00024099089, 25.017845, 25.022799],
"tolerance": 1e-4
},
"test_reweight_ev": {
"expected_reweighted_values": [
-4.01651487e-05,
2.08482051e00,
1.39015547e00
],
"tolerance": 1e-4
},
"test_compute_distance": {"expected_compute_distance": 0.0},
"test_compute_shapedna_tet": {
"expected_eigen_values": [8.4440224e-05, 9.8897915e00, 9.8898811e00],
"tolerance": 1e-4
},
"test_normalize_ev_geometry_tet": {
"expected_normalized_values": [8.4440224e-05, 9.8897915e00, 9.8898811e00],
"tolerance": 1e-4
},
"test_reweight_ev_tet": {
"expected_reweighted_values": [
8.44402239e-05,
4.94489574e00,
3.29662704e00
],
"tolerance": 1e-4
},
"test_compute_distance_tet": {"exp_compute_distance": 0.0},
"test_triangle_mesh_visualization_using_checksum": {
"real_img_checksum": "abaaa757a1e5c1f42a8302fbfe068f49"
},
"test_TriaMesh_Geodesics": {
"real_img_checksum": "8166f546e6630f017d3ec1f655c0ac85"
},
"test_Laplace_Geodesics": {
"real_img_checksum": "25f9b10a5d417de3854cf8b8faf77001"
},
"test_Geodesics_format": {
"expected_matrix_format": "csc",
"max_distance": 0.60497826,
"expected_sqrt_2_div_2": 0.7071067811865476,
"expected_max_abs_diff": 0.0
},
"test_TetMesh_Geodesics": {
"expected_evals_len": 10,
"expected_max_col_values": [1.0, 1.0, 1.0],
"expected_min_col_values": [-1.0, -1.0, -1.0],
"expected_matrix_format": "csc",
"max_distance": 0.69931495,
"expected_sqrt": 0.8660254037844386,
"expected_divx": [
5.9999948,
6.0000215,
6.0000215,
5.999988,
6.000053,
5.999975,
5.9999676,
6.000024,
6.000013,
6.000008
]
}
}
}
Loading