Skip to content
Merged
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
42 changes: 21 additions & 21 deletions src/pre_process/m_model.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@
tri(k, 2) = model%trs(i)%v(k, 2)
tri(k, 3) = model%trs(i)%v(k, 3)
end do
tri_area = f_tri_area(tri)
call f_tri_area(tri, tri_area)

Check warning on line 953 in src/pre_process/m_model.fpp

View check run for this annotation

Codecov / codecov/patch

src/pre_process/m_model.fpp#L953

Added line #L953 was not covered by tests

if (tri_area > threshold_bary*cell_area_min) then
num_inner_vertices = Ifactor_bary_3D*ceiling(tri_area/cell_area_min)
Expand Down Expand Up @@ -1012,7 +1012,7 @@
tri(k, 2) = model%trs(i)%v(k, 2)
tri(k, 3) = model%trs(i)%v(k, 3)
end do
tri_area = f_tri_area(tri)
call f_tri_area(tri, tri_area)

Check warning on line 1015 in src/pre_process/m_model.fpp

View check run for this annotation

Codecov / codecov/patch

src/pre_process/m_model.fpp#L1015

Added line #L1015 was not covered by tests

if (tri_area > threshold_bary*cell_area_min) then
num_inner_vertices = Ifactor_bary_3D*ceiling(tri_area/cell_area_min)
Expand Down Expand Up @@ -1168,6 +1168,25 @@

end subroutine f_normals

!> This procedure calculates the barycentric facet area
pure subroutine f_tri_area(tri, tri_area)

Check warning on line 1172 in src/pre_process/m_model.fpp

View check run for this annotation

Codecov / codecov/patch

src/pre_process/m_model.fpp#L1172

Added line #L1172 was not covered by tests
real(wp), dimension(1:3, 1:3), intent(in) :: tri
real(wp), intent(out) :: tri_area
t_vec3 :: AB, AC, cross
integer :: i !< Loop iterator

do i = 1, 3
AB(i) = tri(2, i) - tri(1, i)
AC(i) = tri(3, i) - tri(1, i)

Check warning on line 1180 in src/pre_process/m_model.fpp

View check run for this annotation

Codecov / codecov/patch

src/pre_process/m_model.fpp#L1178-L1180

Added lines #L1178 - L1180 were not covered by tests
end do

cross(1) = AB(2)*AC(3) - AB(3)*AC(2)
cross(2) = AB(3)*AC(1) - AB(1)*AC(3)
cross(3) = AB(1)*AC(2) - AB(2)*AC(1)
tri_area = 0.5_wp*sqrt(cross(1)**2 + cross(2)**2 + cross(3)**2)

Check warning on line 1186 in src/pre_process/m_model.fpp

View check run for this annotation

Codecov / codecov/patch

src/pre_process/m_model.fpp#L1183-L1186

Added lines #L1183 - L1186 were not covered by tests

end subroutine f_tri_area

Check warning on line 1188 in src/pre_process/m_model.fpp

View check run for this annotation

Codecov / codecov/patch

src/pre_process/m_model.fpp#L1188

Added line #L1188 was not covered by tests

!> This procedure determines the levelset of interpolated 2D models.
!! @param interpolated_boundary_v Group of all the boundary vertices of the interpolated 2D model
!! @param total_vertices Total number of vertices after interpolation
Expand Down Expand Up @@ -1200,23 +1219,4 @@

end function f_interpolated_distance

!> This procedure calculates the barycentric facet area
pure function f_tri_area(tri) result(tri_area)
real(wp), dimension(1:3, 1:3), intent(in) :: tri
t_vec3 :: AB, AC, cross
real(wp) :: tri_area
integer :: i !< Loop iterator

do i = 1, 3
AB(i) = tri(2, i) - tri(1, i)
AC(i) = tri(3, i) - tri(1, i)
end do

cross(1) = AB(2)*AC(3) - AB(3)*AC(2)
cross(2) = AB(3)*AC(1) - AB(1)*AC(3)
cross(3) = AB(1)*AC(2) - AB(2)*AC(1)
tri_area = 0.5_wp*sqrt(cross(1)**2 + cross(2)**2 + cross(3)**2)

end function f_tri_area

end module m_model
Loading