tem_prop_countelems Subroutine

public subroutine tem_prop_countelems(me, elempropertybits, comm)

Subroutine to (re-)count the global number of elements the property.

All elements with the given property are counted across all elements and the nElems setting is updated accordingly.

Arguments

Type IntentOptional Attributes Name
type(tem_prophead_type), intent(inout) :: me

Property to count and set the number of elements for.

integer(kind=long_k), intent(in) :: elempropertybits(:)

Propertybits of all elements.

integer, intent(in) :: comm

MPI communicator within which the mesh is distributed.


Calls

proc~~tem_prop_countelems~~CallsGraph proc~tem_prop_countelems tem_prop_countelems mpi_allreduce mpi_allreduce proc~tem_prop_countelems->mpi_allreduce

Called by

proc~~tem_prop_countelems~~CalledByGraph proc~tem_prop_countelems tem_prop_countelems proc~tem_create_tree_from_sub tem_create_tree_from_sub proc~tem_create_tree_from_sub->proc~tem_prop_countelems

Source Code

  subroutine tem_prop_countelems(me, elempropertybits, comm)
    ! -------------------------------------------------------------------- !
    !> Property to count and set the number of elements for.
    type(tem_prophead_type), intent(inout) :: me

    !> Propertybits of all elements.
    integer(kind=long_k), intent(in) :: elempropertybits(:)

    !> MPI communicator within which the mesh is distributed.
    integer, intent(in) :: comm
    ! -------------------------------------------------------------------- !
    integer(kind=long_k) :: localElems
    integer :: iError
    ! -------------------------------------------------------------------- !

    localElems = count(btest(elempropertybits, me%BitPos))

    ! MPI_ALLREDUCE(SENDBUF, RECVBUF, COUNT, DATATYPE, OP, COMM, IERROR)
    call MPI_Allreduce( localElems, me%nElems, 1, MPI_INTEGER8, MPI_SUM, &
      &                 comm, iError                                     )

  end subroutine tem_prop_countelems