Skip to content

Commit 42ea74a

Browse files
committed
Fix remeshing
- Fixed remeshing case where the mesh as a lower dimension than the tess (discussion #540). - Made minor other improvements.
1 parent 48b34f4 commit 42ea74a

File tree

11 files changed

+1157
-13
lines changed

11 files changed

+1157
-13
lines changed

VERSIONS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
New in 4.4.2-33 (19 Jul 2022):
1+
New in 4.4.2-34 (25 Aug 2022):
22
- module -T: fixed -morpho cube, made minor fixes, added -statcell and -statvox
33
<orientation_descriptor>, added -ori :flat, added -transform ori, made minor
44
fix to the objective function for tesr (does not change the result), made
55
minor fixes to -statface and -statpoly.
66
- module -M: added -transform node and ori, fixed -stateltco and -statelsetco,
77
made minor fix to inp output, made minor fixes, added -stat{elt,elset}{1d,2d}
88
theta, added -statelt and -statelset <orientation_descriptor>, added
9-
-statelset* elts,nodenb,nodes.
9+
-statelset* elts,nodenb,nodes, made minor fixes.
1010
- module -S: fixed various bugs related to the initial state, made minor other
1111
fixes.
1212
- module -V: made minor fixes.

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.4.2-33'
15-
release = u'4.4.2-33'
14+
version = u'4.4.2-34'
15+
release = u'4.4.2-34'
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.4.2-33\")
10+
set(NEPER_VERSION \"4.4.2-34\")
1111
project(neper)
1212

1313
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8.1)

src/neper_m/nem_meshing_para/nem_meshing_para_cl/nem_meshing_para_cl1.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,15 @@ nem_meshing_para_cl (struct IN_M In, struct TESS Tess, struct TESR *pTesr,
7979
}
8080
else if ((*pMeshPara).input == 'm')
8181
{
82-
nem_meshing_para_cl_poly_mesh (clstring, pMeshPara, RNodes, Mesh, Tess);
82+
// if the mesh of max dimension is available, we use it
83+
if (!neut_mesh_isvoid (Mesh[Tess.Dim]))
84+
nem_meshing_para_cl_poly_mesh (clstring, pMeshPara, RNodes, Mesh, Tess);
85+
// otherwise, we use the tessellation
86+
else
87+
{
88+
nem_meshing_para_cl_cell (clstring, pMeshPara, Tess);
89+
ut_print_message (1, 3, "empty %dD mesh - used tess to compute cl.\n", Tess.Dim);
90+
}
8391

8492
if (!strcmp ((*pMeshPara).elttype, "tri"))
8593
{

src/neper_m/nem_meshing_para/nem_meshing_para_cl/nem_meshing_para_cl2.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,20 @@ nem_meshing_para_cl_poly_mesh (char *clstring, struct MESHPARA *pMeshPara,
9999
struct NODES Nodes, struct MESH *Mesh,
100100
struct TESS Tess)
101101
{
102+
char *elset = ut_alloc_1d_char (100);
103+
104+
sprintf (elset, "elset%dd", Tess.Dim);
105+
102106
(*pMeshPara).poly_cl = ut_alloc_1d (Tess.PolyQty + 1);
103107
neut_mesh_entity_expr_val (Nodes, Mesh[0], Mesh[1], Mesh[2], Mesh[3], Mesh[4],
104-
Tess, NULL, NULL, NULL, NULL, "elset3d",
108+
Tess, NULL, NULL, NULL, NULL, elset,
105109
clstring, (*pMeshPara).poly_cl, NULL);
106110

107111
if (!strcmp ((*pMeshPara).cltype, "rel"))
108112
nem_meshing_para_rcl2cl (pMeshPara, Tess.CellQty, Tess.Dim,
109113
(*pMeshPara).poly_cl);
110114

115+
ut_free_1d_char (&elset);
116+
111117
return 0;
112118
}

src/neper_m/nem_meshing_para/nem_meshing_para_param/nem_meshing_para_param1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ nem_meshing_para_param (struct IN_M In, struct TESS Tess, struct TESR *pTesr,
2323
ut_string_string (In.elttype, &(*pMeshPara).elttype); // needed by quad9
2424

2525
// Testing type of input: tess or tesr or mesh
26-
if (In.mesh)
26+
if (In.mesh && !neut_mesh_isvoid (RMesh[Tess.Dim]))
2727
{
2828
(*pMeshPara).input = 'm';
2929
dim = 3;

src/neper_m/nem_reconstruct/nem_reconstruct_mesh/nem_reconstruct_mesh2.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ nem_reconstruct_mesh_2d (struct NODES Nodes, struct MESH *Mesh, int mode,
3333
neut_mesh_init_eltelset (Mesh + 2, NULL);
3434
neut_mesh_orderelsets (Mesh + 2);
3535

36-
if (mode == 2)
36+
if (mode == 2 && pTess)
3737
{
3838
(*pTess).FaceQty = FaceQty;
3939
(*pTess).FacePoly = ut_alloc_2d_int ((*pTess).FaceQty + 1, 2);
@@ -43,7 +43,7 @@ nem_reconstruct_mesh_2d (struct NODES Nodes, struct MESH *Mesh, int mode,
4343
}
4444
else
4545
{
46-
if (mode == 2)
46+
if (mode == 2 && pTess)
4747
{
4848
(*pTess).FaceQty = Mesh[2].ElsetQty;
4949
neut_mesh_facepoly (Nodes, Mesh[2], Mesh[3], &((*pTess).FacePoly));
@@ -69,10 +69,11 @@ nem_reconstruct_mesh_2d (struct NODES Nodes, struct MESH *Mesh, int mode,
6969
// Setting up Tess face information
7070
if (mode == 2)
7171
{
72-
if (!(*pTess).FaceState)
73-
(*pTess).FaceState = ut_alloc_1d_int ((*pTess).FaceQty + 1);
74-
72+
(*pTess).FaceState = ut_realloc_1d_int ((*pTess).FaceState, (*pTess).FaceQty + 1);
7573
ut_array_1d_int_set ((*pTess).FaceState + 1, (*pTess).FaceQty, 1);
74+
75+
(*pTess).FacePt = ut_realloc_1d_int ((*pTess).FacePt, (*pTess).FaceQty + 1);
76+
ut_array_1d_int_set ((*pTess).FacePt + 1, (*pTess).FaceQty, -1);
7677
}
7778

7879
if (mode >= 1)

0 commit comments

Comments
 (0)