Skip to content

Commit 09db3ff

Browse files
committed
Fix unittests.
1 parent c68550e commit 09db3ff

6 files changed

+24
-1
lines changed

femtools/Supermesh.F90

+4
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ subroutine construct_supermesh(new_positions, ele_B, old_positions, map_BA, supe
290290
assert(continuity(intersection(j)) < 0)
291291
else
292292
intersection(j) = intersect_elements(old_positions, ele_A, pos_B, supermesh_shape)
293+
if (.not. has_references(intersection(j))) then
294+
llnode => llnode%next
295+
cycle
296+
end if
293297
assert(continuity(intersection(j)) < 0)
294298
end if
295299

femtools/tests/test_intersection_finder_completeness.F90

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ subroutine test_intersection_finder_completeness
3838
do while(associated(llnode))
3939
ele_A = llnode%value
4040
intersection = intersect_elements(positionsA, ele_A, ele_val(positionsB, ele_B), ele_shape(positionsB, ele_B))
41+
if (.not. has_references(intersection)) then
42+
llnode => llnode%next
43+
cycle
44+
end if
4145
do ele_C=1,ele_count(intersection)
4246
call transform_to_physical(intersection, ele_C, detwei=detwei)
4347
vols_C = vols_C + sum(detwei)

femtools/tests/test_intersection_finder_completeness_3d.F90

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ subroutine test_intersection_finder_completeness_3d
4141
do while(associated(llnode))
4242
ele_A = llnode%value
4343
intersection = intersect_elements(positionsA, ele_A, ele_val(positionsB, ele_B), ele_shape(positionsB, ele_B))
44+
if (.not. has_references(intersection)) then
45+
llnode => llnode%next
46+
cycle
47+
end if
4448
do ele_C=1,ele_count(intersection)
4549
call transform_to_physical(intersection, ele_C, detwei=detwei)
4650
vols_C = vols_C + sum(detwei)

femtools/tests/test_quad_supermesh.F90

+4
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ subroutine test_quad_supermesh
5959
do while(associated(llnode))
6060
ele_A = llnode%value
6161
intersection = intersect_elements(positionsA, ele_A, ele_val(positionsB, ele_B), supermesh_shape)
62+
if (.not. has_references(intersection)) then
63+
llnode => llnode%next
64+
cycle
65+
end if
6266
#define DUMP_SUPERMESH_INTERSECTIONS
6367
#ifdef DUMP_SUPERMESH_INTERSECTIONS
6468
if (ele_count(intersection) /= 0) then

femtools/tests/test_tet_intersector.F90

+3-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ subroutine test_tet_intersector
4747
fail = (vol_libwm .fne. vol_fort)
4848
call report_test("[tet_intersector volumes]", fail, .false., "Should give the same volumes of intersection")
4949

50-
call deallocate(libwm)
50+
if (has_references(libwm)) then
51+
call deallocate(libwm)
52+
end if
5153
if (stat == 0) then
5254
call deallocate(fort)
5355
end if

femtools/tests/test_unify_meshes.F90

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ subroutine test_unify_meshes
6464
do while(associated(llnode))
6565
ele_A = llnode%value
6666
intersection = intersect_elements(positionsA, ele_A, ele_val(positionsB, ele_B), supermesh_shape)
67+
if (.not. has_references(intersection)) then
68+
llnode => llnode%next
69+
cycle
70+
end if
71+
6772
call unify_meshes_quadratic(accum_positions, intersection, accum_positions_tmp)
6873
call deallocate(accum_positions)
6974
accum_positions = accum_positions_tmp

0 commit comments

Comments
 (0)