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 AttributesName
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 proc~tem_levelof tem_LevelOf proc~tem_shape_initpropelements->proc~tem_levelof interface~append~25 append proc~tem_shape_initpropelements->interface~append~25 proc~append_arrayga2d_real append_arrayga2d_real interface~append~25->proc~append_arrayga2d_real proc~append_singlega2d_real append_singlega2d_real interface~append~25->proc~append_singlega2d_real interface~expand~23 expand proc~append_arrayga2d_real->interface~expand~23 proc~append_singlega2d_real->interface~expand~23 proc~expand_ga2d_real expand_ga2d_real interface~expand~23->proc~expand_ga2d_real

Called by

proc~~tem_shape_initpropelements~~CalledByGraph proc~tem_shape_initpropelements tem_shape_initPropElements proc~tem_create_subtree_of tem_create_subTree_of proc~tem_create_subtree_of->proc~tem_shape_initpropelements 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_write_debugmesh tem_write_debugMesh proc~tem_write_debugmesh->proc~tem_create_subtree_of program~tem_varsys_test tem_varSys_test program~tem_varsys_test->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_init_convergence tem_init_convergence proc~tem_init_convergence->proc~tem_create_subtree_of program~tem_variable_evaltype_test tem_variable_evaltype_test program~tem_variable_evaltype_test->proc~tem_create_subtree_of_st_funlist program~tem_varsys_stfunvar_test tem_varSys_stfunVar_test program~tem_varsys_stfunvar_test->proc~tem_create_subtree_of_st_funlist program~tem_variable_extract_test tem_variable_extract_test program~tem_variable_extract_test->proc~tem_create_subtree_of_st_funlist proc~check_variableoperations check_variableOperations proc~check_variableoperations->proc~tem_create_subtree_of_st_funlist program~tem_variable_combine_test tem_variable_combine_Test program~tem_variable_combine_test->proc~tem_create_subtree_of_st_funlist program~tem_varsys_opvar_test tem_varSys_opVar_test program~tem_varsys_opvar_test->proc~tem_create_subtree_of_st_funlist program~tem_logical_opertor_test tem_logical_opertor_test program~tem_logical_opertor_test->proc~check_variableoperations

Contents


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