<commit_before>!======================================================================!
!                                                                      !
! Software Name : FrontISTR Ver. 3.6                                   !
!                                                                      !
!      Module Name : Static Analysis                                   !
!                                                                      !
!            Written by <NAME>(Advancesoft)                       !
!                                                                      !
!      Contact address :  IIS,The University of Tokyo, CISS            !
!                                                                      !
!      "Structural Analysis for Large Scale Assembly"                  !
!                                                                      !
!======================================================================!

!> This module provide a function to prepare output of dynamic analysis
module m_dynamic_make_result
  implicit none
  contains

!C***
!>  OUTPUT result file for dynamic analysis
!C***
      subroutine fstr_write_dynamic_result( hecMESH, fstrSOLID, fstrDYNAMIC, maxstep, istep )
      use m_fstr
      use m_out
      use m_static_lib
      use m_static_make_result
      type (hecmwST_local_mesh) :: hecMESH
      type (fstr_solid)         :: fstrSOLID
      type (fstr_dynamic)       :: fstrDYNAMIC
      integer(kind=kint)        :: maxstep, istep
      real(kind=kreal), pointer :: tnstrain(:), testrain(:)

      character(len=HECMW_HEADER_LEN) :: header
      character(len=HECMW_NAME_LEN)   :: label, s, nameID
      integer(kind=kint) :: i, j, k, ndof, mdof, id, nitem, nn, idx, ngauss
      integer(kind=kint) :: n_lyr, ntot_lyr, is_33shell, is_33beam
      real(kind=kreal), allocatable   :: work(:), unode(:)

      tnstrain => fstrSOLID%TNSTRAIN
      testrain => fstrSOLID%TESTRAIN

      if( fstrDYNAMIC%idx_eqa==1 .and. istep>0 ) then
        idx = 2
      else
        idx = 1
      endif

      ndof = hecMESH%n_dof
      nn = hecMESH%n_node
      if( hecMESH%n_elem>hecMESH%n_node ) nn = hecMESH%n_elem
      if( ndof==2 ) mdof = 3
      if( ndof==3 ) mdof = 6
      if( ndof==6 ) mdof = 6

      ntot_lyr   = fstrSOLID%max_lyr
      is_33shell = fstrSOLID%is_33shell
      is_33beam  = fstrSOLID%is_33beam

      nn = nn * mdof
      allocate( work(nn) )

! --- INITIALIZE
        header = '*fstrresult'
        call hecmw_result_init( hecMESH, maxstep, istep, header )
! --- DISPLACEMENT
        if( fstrSOLID%output_ctrl(3)%outinfo%on(1) ) then
          id = 1
          nitem = n_comp_valtype( fstrSOLID%output_ctrl(3)%outinfo%vtype(1), ndof )
          allocate( unode(ndof*nn) )
          unode = 0.0d0
          unode(:) = fstrDYNAMIC%DISP(:,idx)
          label = 'DISPLACEMENT'
          if(is_33beam == 1)then
            call fstr_reorder_node_beam(fstrSOLID, hecMESH, unode)
          endif
          if(is_33shell == 1)then
            call fstr_reorder_node_shell(fstrSOLID, hecMESH, unode)
          endif
          call hecmw_result_add( id, nitem, label, unode )
          deallocate( unode )
        endif<commit_msg>Fixed dynamic make result routine #2<commit_after>!======================================================================!
!                                                                      !
! Software Name : FrontISTR Ver. 3.6                                   !
!                                                                      !
!      Module Name : Static Analysis                                   !
!                                                                      !
!            Written by <NAME>(Advancesoft)                       !
!                                                                      !
!      Contact address :  IIS,The University of Tokyo, CISS            !
!                                                                      !
!      "Structural Analysis for Large Scale Assembly"                  !
!                                                                      !
!======================================================================!

!> This module provide a function to prepare output of dynamic analysis
module m_dynamic_make_result
  implicit none
  contains

!C***
!>  OUTPUT result file for dynamic analysis
!C***
      subroutine fstr_write_dynamic_result( hecMESH, fstrSOLID, fstrDYNAMIC, maxstep, istep )
      use m_fstr
      use m_out
      use m_static_lib
      use m_static_make_result
      type (hecmwST_local_mesh) :: hecMESH
      type (fstr_solid)         :: fstrSOLID
      type (fstr_dynamic)       :: fstrDYNAMIC
      integer(kind=kint)        :: maxstep, istep
      real(kind=kreal), pointer :: tnstrain(:), testrain(:)

      character(len=HECMW_HEADER_LEN) :: header
      character(len=HECMW_NAME_LEN)   :: label, s, nameID
      integer(kind=kint) :: i, j, k, ndof, mdof, id, nitem, nn, idx, ngauss
      integer(kind=kint) :: n_lyr, ntot_lyr, is_33shell, is_33beam
      real(kind=kreal), allocatable   :: work(:), unode(:)

      tnstrain => fstrSOLID%TNSTRAIN
      testrain => fstrSOLID%TESTRAIN

      if( fstrDYNAMIC%idx_eqa==1 .and. istep>0 ) then
        idx = 2
      else
        idx = 1
      endif

      ndof = hecMESH%n_dof
      nn = hecMESH%n_node
      if( hecMESH%n_elem>hecMESH%n_node ) nn = hecMESH%n_elem
      if( ndof==2 ) mdof = 3
      if( ndof==3 ) mdof = 6
      if( ndof==6 ) mdof = 6

      ntot_lyr   = fstrSOLID%max_lyr
      is_33shell = fstrSOLID%is_33shell
      is_33beam  = fstrSOLID%is_33beam

      nn = nn * mdof
      allocate( work(nn) )

! --- INITIALIZE
        header = '*fstrresult'
        call hecmw_result_init( hecMESH, maxstep, istep, header )
! --- DISPLACEMENT
        if( fstrSOLID%output_ctrl(3)%outinfo%on(1) ) then
          id = 1
          nitem = n_comp_valtype( fstrSOLID%output_ctrl(3)%outinfo%vtype(1), ndof )
          allocate( unode(hecMESH%n_dof*hecMESH%n_node) )
          unode = 0.0d0
          unode(:) = fstrDYNAMIC%DISP(:,idx)
          label = 'DISPLACEMENT'
          if(is_33beam == 1)then
            call fstr_reorder_node_beam(fstrSOLID, hecMESH, unode)
          endif
          if(is_33shell == 1)then
            call fstr_reorder_node_shell(fstrSOLID, hecMESH, unode)
          endif
          call hecmw_result_add( id, nitem, label, unode )
          deallocate( unode )
        endif
{'fraction_non_alphanumeric': 0.12778121137206427, 'fraction_numerical': 0.011897404202719406, 'mean_word_length': 1.5424194815396701, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5561252', 'n_tokens_mistral': 2065, 'n_tokens_neox': 1916, 'n_words': 410}