Update facet connectivity.
Vertices occurrencies list must be already computed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(facet_object), | intent(inout) | :: | self | Facet. |
pure subroutine update_connectivity(self)
!< Update facet connectivity.
!<
!< @note Vertices occurrencies list must be already computed.
class(facet_object), intent(inout) :: self !< Facet.
self%fcon_edge_12 = facet_connected(occurrence_1=self%vertex_1_occurrence, occurrence_2=self%vertex_2_occurrence)
self%fcon_edge_23 = facet_connected(occurrence_1=self%vertex_2_occurrence, occurrence_2=self%vertex_3_occurrence)
self%fcon_edge_31 = facet_connected(occurrence_1=self%vertex_3_occurrence, occurrence_2=self%vertex_1_occurrence)
contains
pure function facet_connected(occurrence_1, occurrence_2)
!< Return the facet ID connected by the edge. If no facet is found 0 is returned.
!<
!< @note Within two vertices occurrencies, namely one edge, there could be only two connected facets.
integer(I4P), allocatable, intent(in) :: occurrence_1(:) !< Occurrences list of vertex 1.
integer(I4P), allocatable, intent(in) :: occurrence_2(:) !< Occurrences list of vertex 2.
integer(I4P) :: facet_connected !< ID of connected connected.
integer(I4P) :: i1, i2 !< Counter.
facet_connected = 0
if (allocated(occurrence_1).and.allocated(occurrence_2)) then
loop_1: do i1=1, size(occurrence_1, dim=1)
do i2=1, size(occurrence_2, dim=1)
if (occurrence_1(i1) == occurrence_2(i2)) then
facet_connected = occurrence_1(i1)
exit loop_1
endif
enddo
enddo loop_1
endif
endfunction facet_connected
endsubroutine update_connectivity