Skip to content

Commit

Permalink
Fix unittests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrper committed Oct 27, 2016
1 parent c68550e commit 09db3ff
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 1 deletion.
4 changes: 4 additions & 0 deletions femtools/Supermesh.F90
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ subroutine construct_supermesh(new_positions, ele_B, old_positions, map_BA, supe
assert(continuity(intersection(j)) < 0)
else
intersection(j) = intersect_elements(old_positions, ele_A, pos_B, supermesh_shape)
if (.not. has_references(intersection(j))) then
llnode => llnode%next
cycle
end if
assert(continuity(intersection(j)) < 0)
end if

Expand Down
4 changes: 4 additions & 0 deletions femtools/tests/test_intersection_finder_completeness.F90
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ subroutine test_intersection_finder_completeness
do while(associated(llnode))
ele_A = llnode%value
intersection = intersect_elements(positionsA, ele_A, ele_val(positionsB, ele_B), ele_shape(positionsB, ele_B))
if (.not. has_references(intersection)) then
llnode => llnode%next
cycle
end if
do ele_C=1,ele_count(intersection)
call transform_to_physical(intersection, ele_C, detwei=detwei)
vols_C = vols_C + sum(detwei)
Expand Down
4 changes: 4 additions & 0 deletions femtools/tests/test_intersection_finder_completeness_3d.F90
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ subroutine test_intersection_finder_completeness_3d
do while(associated(llnode))
ele_A = llnode%value
intersection = intersect_elements(positionsA, ele_A, ele_val(positionsB, ele_B), ele_shape(positionsB, ele_B))
if (.not. has_references(intersection)) then
llnode => llnode%next
cycle
end if
do ele_C=1,ele_count(intersection)
call transform_to_physical(intersection, ele_C, detwei=detwei)
vols_C = vols_C + sum(detwei)
Expand Down
4 changes: 4 additions & 0 deletions femtools/tests/test_quad_supermesh.F90
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ subroutine test_quad_supermesh
do while(associated(llnode))
ele_A = llnode%value
intersection = intersect_elements(positionsA, ele_A, ele_val(positionsB, ele_B), supermesh_shape)
if (.not. has_references(intersection)) then
llnode => llnode%next
cycle
end if
#define DUMP_SUPERMESH_INTERSECTIONS
#ifdef DUMP_SUPERMESH_INTERSECTIONS
if (ele_count(intersection) /= 0) then
Expand Down
4 changes: 3 additions & 1 deletion femtools/tests/test_tet_intersector.F90
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ subroutine test_tet_intersector
fail = (vol_libwm .fne. vol_fort)
call report_test("[tet_intersector volumes]", fail, .false., "Should give the same volumes of intersection")

call deallocate(libwm)
if (has_references(libwm)) then
call deallocate(libwm)
end if
if (stat == 0) then
call deallocate(fort)
end if
Expand Down
5 changes: 5 additions & 0 deletions femtools/tests/test_unify_meshes.F90
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ subroutine test_unify_meshes
do while(associated(llnode))
ele_A = llnode%value
intersection = intersect_elements(positionsA, ele_A, ele_val(positionsB, ele_B), supermesh_shape)
if (.not. has_references(intersection)) then
llnode => llnode%next
cycle
end if

call unify_meshes_quadratic(accum_positions, intersection, accum_positions_tmp)
call deallocate(accum_positions)
accum_positions = accum_positions_tmp
Expand Down

0 comments on commit 09db3ff

Please sign in to comment.