Add vertex occurrence.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(facet_object), | intent(inout) | :: | self | Facet. |
||
| integer(kind=I4P), | intent(in) | :: | vertex_id | Vertex ID in local numeration, 1, 2 or 3. |
||
| integer(kind=I4P), | intent(in) | :: | facet_id | Other facet ID containing vertex. |
elemental subroutine add_vertex_occurrence(self, vertex_id, facet_id)
!< Add vertex occurrence.
class(facet_object), intent(inout) :: self !< Facet.
integer(I4P), intent(in) :: vertex_id !< Vertex ID in local numeration, 1, 2 or 3.
integer(I4P), intent(in) :: facet_id !< Other facet ID containing vertex.
select case(vertex_id)
case(1)
call add_occurrence(occurrence=self%vertex_1_occurrence)
case(2)
call add_occurrence(occurrence=self%vertex_2_occurrence)
case(3)
call add_occurrence(occurrence=self%vertex_3_occurrence)
endselect
contains
pure subroutine add_occurrence(occurrence)
!< Add new occurrence into a generic occurrencies array.
integer(I4P), allocatable, intent(inout) :: occurrence(:) !< Occurrences array.
integer(I4P), allocatable :: occurrence_tmp(:) !< Temporary occurences array.
integer(I4P) :: no !< Occurrences number.
if (allocated(occurrence)) then
no = size(occurrence, dim=1)
allocate(occurrence_tmp(1:no+1))
occurrence_tmp(1:no) = occurrence
occurrence_tmp(no+1) = facet_id
call move_alloc(from=occurrence_tmp, to=occurrence)
else
allocate(occurrence(1))
occurrence(1) = facet_id
endif
endsubroutine add_occurrence
endsubroutine add_vertex_occurrence