tem_load_shapes Subroutine

private subroutine tem_load_shapes(me, conf, parent, key, iError, reqSegments)

Read in an arbitrary shapes from a lua file defined as multiple tables

read a shape like for example inside a tracking table

 tracking = {
             {variable = { 'velocity' },
              shape = { kind = 'canoND',
                        object = { origin = { 1.0, 1.0, 1.0 },
                                   vec = { 2.0, 2.0, 2.0 },
                                   segments = { 10, 20, 30 } }
                      }}
            } -- tracking table

elements that has a certain property can also be tracked. This feature enables us to track boundary elements.

 tracking = {
              { variable = { 'velocity' },
                shape = { kind = 'property',
                          property = {'boundary'} },
                      }
              }
            } -- tracking table

Arguments

Type IntentOptional Attributes Name
type(tem_shape_type), intent(out), allocatable :: me(:)

array of shape type defined in a lua file

type(flu_State) :: conf

lua config file to load shape from

integer, intent(in), optional :: parent

optional parent handle

character(len=*), intent(in), optional :: key

optional key to load from

integer, intent(out), optional :: iError

error flag

logical, intent(in), optional :: reqSegments

Is true if use_get_point is true in output table


Calls

proc~~tem_load_shapes~~CallsGraph proc~tem_load_shapes tem_load_shapes proc~aot_table_open aot_table_open proc~tem_load_shapes->proc~aot_table_open proc~aot_table_close aot_table_close proc~tem_load_shapes->proc~aot_table_close proc~tem_load_shape_single tem_load_shape_single proc~tem_load_shapes->proc~tem_load_shape_single proc~aot_table_length aot_table_length proc~tem_load_shapes->proc~aot_table_length proc~tem_load_shape_single->proc~aot_table_open proc~tem_load_shape_single->proc~aot_table_close proc~tem_load_transformation tem_load_transformation proc~tem_load_shape_single->proc~tem_load_transformation proc~tem_load_stl tem_load_stl proc~tem_load_shape_single->proc~tem_load_stl tem_load_triangle tem_load_triangle proc~tem_load_shape_single->tem_load_triangle interface~tem_load_canonicalnd tem_load_canonicalND proc~tem_load_shape_single->interface~tem_load_canonicalnd tem_load_sphere tem_load_sphere proc~tem_load_shape_single->tem_load_sphere tem_load_ellipsoid tem_load_ellipsoid proc~tem_load_shape_single->tem_load_ellipsoid proc~aot_get_val aot_get_val proc~tem_load_shape_single->proc~aot_get_val tem_load_cylinder tem_load_cylinder proc~tem_load_shape_single->tem_load_cylinder proc~tem_shape_load_proplabel tem_shape_load_propLabel proc~tem_load_shape_single->proc~tem_shape_load_proplabel proc~tem_shape_load_level tem_shape_load_level proc~tem_load_shape_single->proc~tem_shape_load_level proc~tem_shape_load_bclabels tem_shape_load_bcLabels proc~tem_load_shape_single->proc~tem_shape_load_bclabels proc~tem_abort tem_abort proc~tem_load_shape_single->proc~tem_abort proc~tem_load_transformation->proc~aot_table_open proc~tem_load_transformation->proc~aot_table_close proc~tem_load_translation tem_load_translation proc~tem_load_transformation->proc~tem_load_translation proc~tem_load_deformation tem_load_deformation proc~tem_load_transformation->proc~tem_load_deformation proc~tem_read_stlfiles tem_read_stlFiles proc~tem_load_stl->proc~tem_read_stlfiles proc~tem_load_stlhead tem_load_stlHead proc~tem_load_stl->proc~tem_load_stlhead proc~tem_load_canonicalnd_vec tem_load_canonicalND_vec interface~tem_load_canonicalnd->proc~tem_load_canonicalnd_vec proc~tem_load_onecanonicalnd tem_load_oneCanonicalND interface~tem_load_canonicalnd->proc~tem_load_onecanonicalnd proc~tem_shape_load_proplabel->proc~aot_table_open proc~tem_shape_load_proplabel->proc~aot_table_close proc~tem_shape_load_proplabel->proc~aot_table_length proc~tem_shape_load_proplabel->proc~aot_get_val proc~tem_shape_load_level->proc~aot_table_open proc~tem_shape_load_level->proc~aot_table_close proc~tem_shape_load_level->proc~aot_table_length proc~tem_shape_load_level->proc~aot_get_val interface~tem_tostr tem_toStr proc~tem_shape_load_level->interface~tem_tostr interface~tem_log tem_log proc~tem_shape_load_level->interface~tem_log proc~tem_shape_load_bclabels->proc~aot_table_open proc~tem_shape_load_bclabels->proc~aot_table_close proc~tem_shape_load_bclabels->proc~aot_table_length proc~tem_shape_load_bclabels->proc~aot_get_val mpi_abort mpi_abort proc~tem_abort->mpi_abort

Called by

proc~~tem_load_shapes~~CalledByGraph proc~tem_load_shapes tem_load_shapes interface~tem_load_shape tem_load_shape interface~tem_load_shape->proc~tem_load_shapes proc~load_spatial_parabol load_spatial_parabol proc~load_spatial_parabol->interface~tem_load_shape proc~tem_load_convergenceheader tem_load_convergenceHeader proc~tem_load_convergenceheader->interface~tem_load_shape proc~tem_load_spacetime_single tem_load_spacetime_single proc~tem_load_spacetime_single->interface~tem_load_shape proc~tem_load_spacetime_single->proc~tem_load_spacetime_single proc~tem_load_trackingconfig tem_load_trackingConfig proc~tem_load_trackingconfig->interface~tem_load_shape proc~load_spatial_predefined load_spatial_predefined proc~load_spatial_predefined->proc~load_spatial_parabol proc~tem_load_spacetime_table tem_load_spacetime_table proc~tem_load_spacetime_table->proc~tem_load_spacetime_single interface~tem_load_spacetime tem_load_spacetime interface~tem_load_spacetime->proc~tem_load_spacetime_single interface~tem_load_spacetime->proc~tem_load_spacetime_table proc~tem_convergence_load tem_convergence_load proc~tem_convergence_load->proc~tem_load_convergenceheader proc~tem_load_tracking tem_load_tracking proc~tem_load_tracking->proc~tem_load_trackingconfig proc~tem_load_spatial tem_load_spatial proc~tem_load_spatial->proc~load_spatial_predefined proc~tem_variable_load_single tem_variable_load_single proc~tem_variable_load_single->interface~tem_load_spacetime proc~tem_variable_loadmapping_single tem_variable_loadMapping_single proc~tem_variable_loadmapping_single->interface~tem_load_spacetime proc~tem_abortcriteria_load tem_abortCriteria_load proc~tem_abortcriteria_load->proc~tem_convergence_load

Contents

Source Code


Source Code

  subroutine tem_load_shapes( me, conf, parent, key, iError, reqSegments )
    !---------------------------------------------------------------------------
    !> array of shape type defined in a lua file
    type(tem_shape_type), allocatable, intent(out) :: me(:)
    !> lua config file to load shape from
    type(flu_state) :: conf
    !> optional parent handle
    integer, optional, intent(in) :: parent
    !> optional key to load from
    character(len=*), optional, intent(in) :: key
    !> error flag
    integer, intent(out), optional :: iError
    !> Is true if use_get_point is true in output table
    logical, optional, intent(in) :: reqSegments
    !---------------------------------------------------------------------------
    character(len=32) :: localKey
    integer :: nShapes  ! number of shape table entries
    integer :: iShape, shape_table, sub_table
    !---------------------------------------------------------------------------
    if( present( key )) then
      localKey = key
    else
      localKey = 'shape'
    endif

    ! open the table
    ! shape = {}
    call aot_table_open( L       = conf,                                       &
      &                  thandle = shape_table,                                &
      &                  parent  = parent,                                     &
      &                  key     = trim( localKey ))

    call aot_table_open( L       = conf,                                       &
      &                  parent  = shape_table,                                &
      &                  thandle = sub_table,                                  &
      &                  pos     = 1 )

    ! no shape table is defined return 0-sized array
    if ( shape_table == 0 ) then
      write(logUnit(2),*) ' Shape table is not defined'
      write(logunit(2),*) ' ... using global mesh'
      allocate(me(1))
      me(1)%kind = 'all'
      me(1)%shapeID = tem_global_shape
      if(present(iError)) iError = ibset(0, aoterr_NonExistent)
    else if ( sub_table == 0 ) then ! shape is a single table
      ! load table from parent shape_table
      call aot_table_close(L=conf, thandle=sub_table)
      allocate( me( 1 ))
      call tem_load_shape_single( me          = me(1),       &
        &                         conf        = conf,        &
        &                         sub_table   = shape_table, &
        &                         iError      = iError,      &
        &                         reqSegments = reqSegments  )
    else ! multiple table
      call aot_table_close( L=conf, thandle=sub_table )
      ! open the first entry in the shape table
      ! shape = {{this entry}, {second entry}}
      ! get the number of entries in  the shape table
      nShapes = aot_table_length( L=conf, thandle=shape_table )
      write(logUnit(1),*) 'Number of shapes defined: ', nShapes
      allocate( me( nShapes ))
      do iShape = 1, nShapes
        call aot_table_open( L       = conf,                                   &
          &                  thandle = sub_table,                              &
          &                  parent  = shape_table,                            &
          &                  pos     = iShape )
        call tem_load_shape_single( me          = me(iShape), &
          &                         conf        = conf,       &
          &                         sub_table   = sub_table,  &
          &                         iError      = iError,     &
          &                         reqSegments = reqSegments )
        call aot_table_close( L = conf, thandle = sub_table )
      end do
    end if

    call aot_table_close( L=conf, thandle=shape_table )

  end subroutine tem_load_shapes