This subroutine creates a subTree based on a provided map or list of treeids (in case a local shape is used) to the corresponding tree. This routine shall be called from a single process only, it is not intended to communicate and broadcast its information. requires the setting of me%global before hand.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_subTree_type), | intent(inout) | :: | me |
subTree to be created from list of elements (map2global) |
||
integer, | intent(in), | optional | :: | map2global(:) |
position of the treeID in the global treeID list |
|
integer(kind=long_k), | intent(in), | optional | :: | treeID(:) |
list of treeIDs only use this in case a local shape is set |
subroutine tem_local_subTree_from( me, map2global, treeID ) ! --------------------------------------------------------------------------- !> subTree to be created from list of elements (map2global) type(tem_subTree_type), intent(inout) :: me !> position of the treeID in the global treeID list integer, optional, intent(in) :: map2global(:) !> list of treeIDs only use this in case a local shape is set integer(kind=long_k), optional, intent(in) :: treeID(:) ! --------------------------------------------------------------------------- integer :: nElemsList ! --------------------------------------------------------------------------- nElemsList = -9999 ! determine number of elements in the provided map2global if(present(map2global) .and. .not. present(treeID))then nElemsList = size(map2global) allocate(me%map2global( nElemsList )) ! copy the map2global me%map2global = map2global else if(present(treeID) .and. .not. present(map2global))then nElemsList = size(treeID) allocate(me%treeID( nElemsList )) ! copy the list of treeID me%treeID = treeID ! in case a treeID is set we have to set uselocalmesh to true me%useLocalMesh = .true. else write(logUnit(1),*)'error:either none or both of treeID or map2global ' write(logUnit(1),*)' are passed to tem_subTree_from. '// & & 'only one of them is allowed' call tem_abort() end if ! allocate the different arrays in the subTree type allocate(me%Property(me%global%nproperties)) allocate(me%elemPropertyBits(nElemsList)) ! assign treeID list to the new mesh. sort first me%nElems = nElemsList me%global%nElems = nElemsList ! reset properties. not needed me%elempropertybits = 0 end subroutine tem_local_subTree_from