Skip to content

Commit 0deab59

Browse files
committed
Improve failed projection error message
Made failed projection message more informative, by printing the number of faces and the face ids.
1 parent 4142457 commit 0deab59

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

VERSIONS

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
New in 4.8.2-2 (06 Feb 2024):
2-
- module -T: added -transform "cut(cube)", improved -transform "cut(cubei)".
1+
New in 4.8.2-3 (13 Feb 2024):
2+
- module -T: added -transform "cut(cube)", improved -transform "cut(cubei)",
3+
made minor improvements.
34

45
New in 4.8.1 (02 Feb 2024):
56
- general: fixed compatibility with Gmsh (version 4.12.2).

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import sphinx_rtd_theme
1212

1313
project = u'Neper'
14-
version = u'4.8.2-2'
15-
release = u'4.8.2-2'
14+
version = u'4.8.2-3'
15+
release = u'4.8.2-3'
1616
author = u'Romain Quey'
1717
copyright = u'Romain Quey'
1818
language = 'en'

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if(POLICY CMP0077)
77
cmake_policy(SET CMP0077 NEW)
88
endif()
99

10-
set(NEPER_VERSION \"4.8.2-2\")
10+
set(NEPER_VERSION \"4.8.2-3\")
1111
project(neper)
1212

1313
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8.1)

src/neper_m/nem_meshing_para/nem_meshing_para_faceproj/nem_meshing_para_faceproj1.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ nem_meshing_para_faceproj (struct TESS Tess, struct NODES RNodes,
1010
{
1111
int i, j, status, facecpy_qty;
1212
char *message = ut_alloc_1d_char (8);
13+
int *failed = ut_alloc_1d_int (Tess.FaceQty + 1);
14+
int failed_sum;
1315

1416
(*pMeshPara).face_eq = ut_alloc_2d (Tess.FaceQty + 1, 4);
1517

@@ -36,13 +38,26 @@ nem_meshing_para_faceproj (struct TESS Tess, struct NODES RNodes,
3638
if (!strcmp ((*pMeshPara).face_op[i], "meshproj"))
3739
ut_string_string ("copy", (*pMeshPara).face_op + i);
3840
else
39-
ut_print_message (2, 2, "Failed to project face %d.\n", i);
41+
failed[i] = 1;
4042
}
4143

4244
ut_print_progress (stdout, i, Tess.FaceQty, "%3.0f%%", message);
4345
fflush (stdout);
4446
}
4547

48+
failed_sum = ut_array_1d_int_sum (failed + 1, Tess.FaceQty);
49+
if (failed_sum)
50+
{
51+
ut_print_lineheader (2);
52+
ut_print_level (2);
53+
printf ("Failed to project %d face%s:", failed_sum, (failed_sum == 1) ? "" : "s");
54+
for (i = 1; i <= Tess.FaceQty; i++)
55+
if (failed[i])
56+
printf (" %d", i);
57+
printf (".\n");
58+
abort ();
59+
}
60+
4661
facecpy_qty = 0;
4762
for (i = 1; i <= Tess.FaceQty; i++)
4863
if (!strcmp ((*pMeshPara).face_op[i], "copy"))
@@ -58,6 +73,7 @@ nem_meshing_para_faceproj (struct TESS Tess, struct NODES RNodes,
5873
facecpy_qty, (facecpy_qty > 1) ? "s" : "");
5974

6075
ut_free_1d_char (&message);
76+
ut_free_1d_int (&failed);
6177

6278
return;
6379
}

0 commit comments

Comments
 (0)