tem_mesh_out Subroutine

public subroutine tem_mesh_out(me, conf)

write mesh information into lua file.

This routine is specially need for write restart to write mesh info for predefined mesh such that read restart will generate predefined mesh

Arguments

Type IntentOptional Attributes Name
type(tem_global_type), intent(in) :: me

Structure to store header in

type(aot_out_type), intent(inout) :: conf

aotus lua state to write output


Calls

proc~~tem_mesh_out~~CallsGraph proc~tem_mesh_out tem_mesh_out proc~aot_out_open_table aot_out_open_table proc~tem_mesh_out->proc~aot_out_open_table proc~aot_out_val aot_out_val proc~tem_mesh_out->proc~aot_out_val proc~aot_out_close_table aot_out_close_table proc~tem_mesh_out->proc~aot_out_close_table

Called by

proc~~tem_mesh_out~~CalledByGraph proc~tem_mesh_out tem_mesh_out proc~tem_restart_writeheader tem_restart_writeHeader proc~tem_restart_writeheader->proc~tem_mesh_out proc~tem_restart_openwrite tem_restart_openWrite proc~tem_restart_openwrite->proc~tem_restart_writeheader proc~tem_restart_closewrite tem_restart_closeWrite proc~tem_restart_closewrite->proc~tem_restart_writeheader proc~hvs_output_open hvs_output_open proc~hvs_output_open->proc~tem_restart_openwrite proc~hvs_output_close hvs_output_close proc~hvs_output_close->proc~tem_restart_closewrite proc~tem_tracker tem_tracker proc~tem_tracker->proc~hvs_output_open proc~tem_tracker->proc~hvs_output_close

Contents

Source Code


Source Code

  subroutine tem_mesh_out( me, conf )
    ! -------------------------------------------------------------------- !
    !> Structure to store header in
    type(tem_global_type), intent(in) :: me
    !> aotus lua state to write output
    type(aot_out_type), intent(inout) :: conf
    ! -------------------------------------------------------------------- !
    real(kind=rk) :: lineLength
    ! -------------------------------------------------------------------- !

    select case(trim(me%predefined))
      case('cube','slice','line')
        call aot_out_open_table(conf, 'mesh')

        call aot_out_val( put_conf = conf,                &
          &               val      = trim(me%predefined), &
          &               vname    = 'predefined'         )
        call aot_out_val( put_conf = conf,      &
          &               val      = me%Origin, &
          &               vname    = 'origin'   )
        if (me%nElems < 2**me%maxlevel) then
          lineLength = me%BoundingCubeLength*0.5_rk**me%maxLevel*me%nElems
          call aot_out_val( put_conf = conf,       &
            &               val      = lineLength, &
            &               vname    = 'length'    )
          call aot_out_val( put_conf = conf,           &
            &               val      = me%nElems,      &
            &               vname    = 'element_count' )
        else
          call aot_out_val( put_conf = conf,                  &
            &               val      = me%BoundingCubeLength, &
            &               vname    = 'length'               )
          call aot_out_val( put_conf = conf,             &
            &               val      = me%maxLevel,      &
            &               vname    = 'refinementLevel' )
        end if

        call aot_out_close_table(conf)

      case('line_bounded')
        lineLength = me%BoundingCubeLength*0.5_rk**me%maxLevel*me%nElems
        call aot_out_open_table(conf, 'mesh')

        call aot_out_val( put_conf = conf,                &
          &               val      = trim(me%predefined), &
          &               vname    = 'predefined'         )
        call aot_out_val( put_conf = conf,      &
          &               val      = me%Origin, &
          &               vname    = 'origin'   )
        call aot_out_val( put_conf = conf,       &
          &               val      = lineLength, &
          &               vname    = 'length'    )
        call aot_out_val( put_conf = conf,           &
          &               val      = me%nElems,      &
          &               vname    = 'element_count' )

        call aot_out_close_table(conf)

      case('single')
        call aot_out_open_table(conf, 'mesh')

        call aot_out_val( put_conf = conf,                &
          &               val      = trim(me%predefined), &
          &               vname    = 'predefined'         )
        call aot_out_val( put_conf = conf,      &
          &               val      = me%Origin, &
          &               vname    = 'origin'   )
        call aot_out_val( put_conf = conf,                  &
          &               val      = me%BoundingCubeLength, &
          &               vname    = 'length'               )
        call aot_out_close_table(conf)

      case default
        call aot_out_val( put_conf = conf,             &
          &               val      = trim(me%dirName), &
          &               vname    = 'mesh'            )

    end select

  end subroutine tem_mesh_out