tem_shape_initPropElements Subroutine

private subroutine tem_shape_initPropElements(propBits, inTree, countElems, map2global)

This routine identify all the elements in inTree that has a certain property bit, save their positions in inTree into array: map2global, save the number of these elements into level wise array: countElems (e.g. for shape kind='property').

Arguments

Type IntentOptional Attributes Name
integer(kind=long_k), intent(in) :: propBits

shape objects on which to work

type(treelmesh_type), intent(in) :: inTree

Global mesh from which the elements are identified and then stored to

integer, intent(out) :: countElems(globalMaxLevels)

How many elements there will be for each level in the track

type(dyn_intarray_type), intent(inout) :: map2global

growing array. Elements positions in inTree%treeID


Calls

proc~~tem_shape_initpropelements~~CallsGraph proc~tem_shape_initpropelements tem_shape_initPropElements interface~append~29 append proc~tem_shape_initpropelements->interface~append~29 proc~tem_levelof tem_LevelOf proc~tem_shape_initpropelements->proc~tem_levelof proc~append_da_label append_da_label interface~append~29->proc~append_da_label proc~append_da_veclabel append_da_veclabel interface~append~29->proc~append_da_veclabel interface~expand~27 expand proc~append_da_label->interface~expand~27 interface~sortedposofval~5 sortedposofval proc~append_da_label->interface~sortedposofval~5 proc~append_da_veclabel->interface~expand~27 proc~expand_da_label expand_da_label interface~expand~27->proc~expand_da_label proc~sortposofval_label sortposofval_label interface~sortedposofval~5->proc~sortposofval_label

Called by

proc~~tem_shape_initpropelements~~CalledByGraph proc~tem_shape_initpropelements tem_shape_initPropElements proc~tem_shape2subtree tem_shape2subTree proc~tem_shape2subtree->proc~tem_shape_initpropelements proc~tem_create_subtree_of tem_create_subTree_of proc~tem_create_subtree_of->proc~tem_shape2subtree proc~tem_create_subtree_of_st_funlist tem_create_subTree_of_st_funList proc~tem_create_subtree_of_st_funlist->proc~tem_create_subtree_of proc~tem_init_convergence tem_init_convergence proc~tem_init_convergence->proc~tem_create_subtree_of proc~tem_init_tracker_subtree tem_init_tracker_subTree proc~tem_init_tracker_subtree->proc~tem_create_subtree_of proc~tem_write_debugmesh tem_write_debugMesh proc~tem_write_debugmesh->proc~tem_create_subtree_of

Source Code

  subroutine tem_shape_initPropElements( propBits, inTree, countElems, map2global )
    ! ---------------------------------------------------------------------------
    !> shape objects on which to work
    integer( kind=long_k ), intent(in) :: propBits
    !> Global mesh from which the elements are identified and then stored to
    type( treelmesh_type ), intent(in) :: inTree
    !> How many elements there will be for each level in the track
    integer, intent( out ) :: countElems( globalMaxLevels )
    !> growing array. Elements positions in inTree%treeID
    type(dyn_intArray_type), intent(inout) :: map2global
    ! ---------------------------------------------------------------------------
    integer(kind=long_k)  :: elemProp, match
    integer :: tLevel, dPos, iElem
    logical :: wasAdded
    ! ---------------------------------------------------------------------------

    write(logUnit(1),*) 'Initializing shapes of elements that have a ' &
      &                 // 'certain property'

    ! Loop over all elements in inTree
    do iElem = 1, inTree%nElems

      ! get its property bits
      elemProp = inTree%elemPropertyBits( iElem )

      ! check whether its property
      match =  iand( propBits, elemProp )

      if( match > 0_long_k ) then

        ! Append to treeID list (note that already existing ones are
        ! omitted)
        call append( me       = map2global, &
          &          pos      = dPos,       &
          &          val      = iElem,      &
          &          wasAdded = wasAdded    )

        ! Count up if it was added
        if( wasAdded ) then
          tLevel   = tem_levelOf( inTree%treeID(iElem) )
          countElems( tLevel ) = countElems( tLevel ) + 1
        end if ! wasAdded

      end if ! match > 0

    end do ! iElem

  end subroutine tem_shape_initPropElements