Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@
ignore = all
update = checkout
branch = master

[submodule "metis/GKlib"]
path = submodules/GKlib
url = https://github.com/KarypisLab/GKlib.git
ignore = all
update = checkout
branch = master

[submodule "metis/METIS"]
path = submodules/metis
url = https://github.com/KarypisLab/METIS.git
ignore = all
update = checkout
branch = master

[submodule "Source/lapack"]
path = submodules/lapack
url = https://github.com/Reference-LAPACK/lapack.git
Expand Down
44 changes: 44 additions & 0 deletions Source/Interfaces/FMT_ES14_6_Interface.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
! ###############################################################################################################################
! Begin MIT license text.
! _______________________________________________________________________________________________________

! Copyright 2022 Dr William R Case, Jr (mystransolver@gmail.com)

! Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
! associated documentation files (the "Software"), to deal in the Software without restriction, including
! without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
! copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to
! the following conditions:

! The above copyright notice and this permission notice shall be included in all copies or substantial
! portions of the Software and documentation.

! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
! OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
! AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
! LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
! OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
! THE SOFTWARE.
! _______________________________________________________________________________________________________

! End MIT license text.

MODULE FMT_ES14_6_Interface

INTERFACE

SUBROUTINE FMT_ES14_6 ( V, OUT )

USE PENTIUM_II_KIND, ONLY : BYTE, DOUBLE

IMPLICIT NONE

REAL(DOUBLE), INTENT(IN) :: V ! Real value to format
CHARACTER(14*BYTE), INTENT(OUT) :: OUT ! 14-char formatted result

END SUBROUTINE FMT_ES14_6

END INTERFACE

END MODULE FMT_ES14_6_Interface
44 changes: 44 additions & 0 deletions Source/Interfaces/FMT_I8_RJ_Interface.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
! ###############################################################################################################################
! Begin MIT license text.
! _______________________________________________________________________________________________________

! Copyright 2022 Dr William R Case, Jr (mystransolver@gmail.com)

! Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
! associated documentation files (the "Software"), to deal in the Software without restriction, including
! without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
! copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to
! the following conditions:

! The above copyright notice and this permission notice shall be included in all copies or substantial
! portions of the Software and documentation.

! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
! OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
! FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
! AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
! LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
! OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
! THE SOFTWARE.
! _______________________________________________________________________________________________________

! End MIT license text.

MODULE FMT_I8_RJ_Interface

INTERFACE

SUBROUTINE FMT_I8_RJ ( V, OUT )

USE PENTIUM_II_KIND, ONLY : BYTE, LONG

IMPLICIT NONE

INTEGER(LONG), INTENT(IN) :: V ! Integer value to format
CHARACTER(8*BYTE), INTENT(OUT) :: OUT ! 8-char right-justified result

END SUBROUTINE FMT_I8_RJ

END INTERFACE

END MODULE FMT_I8_RJ_Interface
23 changes: 20 additions & 3 deletions Source/LK9/L91/WRITE_ELEM_STRAINS.f90
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ SUBROUTINE WRITE_ELEM_STRAINS ( JSUB, NUM, IHDR, NUM_PTS, ITABLE )
INTEGER(LONG) :: I,J,L ! DO loop indices
INTEGER(LONG) :: K ! Counter
INTEGER(LONG) :: NCOLS ! Num of cols to write out

CHARACTER(139*BYTE) :: CLINE_BUF ! Pre-assembled CENTER line for solid strains (matches FORMAT 1303)
CHARACTER(139*BYTE) :: GLINE_BUF ! Pre-assembled GRD line for solid strains (matches FORMAT 1306)

REAL(DOUBLE) :: ABS_ANS(11) ! Max ABS for all element output
REAL(DOUBLE) :: MAX_ANS(11) ! Max for all element output
Expand Down Expand Up @@ -445,15 +446,31 @@ SUBROUTINE WRITE_ELEM_STRAINS ( JSUB, NUM, IHDR, NUM_PTS, ITABLE )
NCOLS = 8
ENDIF

! Pre-fill the fixed-text positions of the line buffers; variable fields (EID/GID and the
! per-point values) are overwritten in the loop below. Layouts:
! CLINE_BUF: FORMAT 1303 = (1X,I8,2X,'CENTER ',8X,8(1ES14.6))
! GLINE_BUF: FORMAT 1306 = (1X,A,10X,'GRD',I8,5X,8(1ES14.6)) with A = FILL(1:0) (empty)
CLINE_BUF = ' '
CLINE_BUF(12:19) = 'CENTER '
GLINE_BUF = ' '
GLINE_BUF(12:14) = 'GRD'
K = 0
DO I=1,NUM,NUM_PTS
K = K + 1
! Center
WRITE(F06,1303) EID_OUT_ARRAY(I,1),(OGEL(K,J),J=1,NCOLS)
CALL FMT_I8_RJ ( EID_OUT_ARRAY(I,1), CLINE_BUF(2:9) )
DO J=1,NCOLS
CALL FMT_ES14_6 ( OGEL(K,J), CLINE_BUF(28 + (J-1)*14 : 27 + J*14) )
ENDDO
WRITE(F06,'(A)') CLINE_BUF(1 : 27 + NCOLS*14)
! Corner
DO L=1,NUM_PTS-1
K = K + 1
WRITE(F06,1306) FILL(1: 0), GID_OUT_ARRAY(I,L+1),(OGEL(K,J),J=1,NCOLS)
CALL FMT_I8_RJ ( GID_OUT_ARRAY(I,L+1), GLINE_BUF(15:22) )
DO J=1,NCOLS
CALL FMT_ES14_6 ( OGEL(K,J), GLINE_BUF(28 + (J-1)*14 : 27 + J*14) )
ENDDO
WRITE(F06,'(A)') GLINE_BUF(1 : 27 + NCOLS*14)
ENDDO
ENDDO

Expand Down
22 changes: 20 additions & 2 deletions Source/LK9/L91/WRITE_ELEM_STRESSES.f90
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ SUBROUTINE WRITE_ELEM_STRESSES ( JSUB, NUM, IHEADER, NUM_PTS, ITABLE )
INTEGER(LONG) :: ISUBCASE_INDEX ! the index into SCNUM
INTEGER(LONG) :: CID ! coordinate system
CHARACTER(4*BYTE) :: CEN_WORD ! the word "CEN/" (we need to cast the length)
CHARACTER(139*BYTE) :: CLINE_BUF ! Pre-assembled CENTER line for solid stresses (matches FORMAT 1303)
CHARACTER(139*BYTE) :: GLINE_BUF ! Pre-assembled GRD line for solid stresses (matches FORMAT 1306)



Expand Down Expand Up @@ -462,15 +464,31 @@ SUBROUTINE WRITE_ELEM_STRESSES ( JSUB, NUM, IHEADER, NUM_PTS, ITABLE )
ENDIF

IF (WRITE_F06) THEN
! Pre-fill the fixed-text positions of the line buffers; variable fields (EID/GID and the
! per-point values) are overwritten in the loop below. Layouts:
! CLINE_BUF: FORMAT 1303 = (1X,I8,2X,'CENTER ',8X,8(1ES14.6))
! GLINE_BUF: FORMAT 1306 = (1X,A,10X,'GRD',I8,5X,8(1ES14.6)) with A = FILL(1:0) (empty)
CLINE_BUF = ' '
CLINE_BUF(12:19) = 'CENTER '
GLINE_BUF = ' '
GLINE_BUF(12:14) = 'GRD'
K = 0
DO I=1,NUM,NUM_PTS
K = K + 1
! Center
WRITE(F06,1303) EID_OUT_ARRAY(I,1),(OGEL(K,J),J=1,NCOLS)
CALL FMT_I8_RJ ( EID_OUT_ARRAY(I,1), CLINE_BUF(2:9) )
DO J=1,NCOLS
CALL FMT_ES14_6 ( OGEL(K,J), CLINE_BUF(28 + (J-1)*14 : 27 + J*14) )
ENDDO
WRITE(F06,'(A)') CLINE_BUF(1 : 27 + NCOLS*14)
! Corner
DO L=1,NUM_PTS-1
K = K + 1
WRITE(F06,1306) FILL(1: 0), GID_OUT_ARRAY(I,L+1),(OGEL(K,J),J=1,NCOLS)
CALL FMT_I8_RJ ( GID_OUT_ARRAY(I,L+1), GLINE_BUF(15:22) )
DO J=1,NCOLS
CALL FMT_ES14_6 ( OGEL(K,J), GLINE_BUF(28 + (J-1)*14 : 27 + J*14) )
ENDDO
WRITE(F06,'(A)') GLINE_BUF(1 : 27 + NCOLS*14)
ENDDO
ENDDO
ENDIF
Expand Down
52 changes: 30 additions & 22 deletions Source/LK9/L91/WRITE_GRD_PRT_OUTPUTS.f90
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ SUBROUTINE WRITE_GRD_PRT_OUTPUTS ( JVEC, NUM, WHAT, IHDR, ALL_SAME_CID, WRITE_OG
CHARACTER(14*BYTE) :: MAX_ANS_CHAR(6) ! Character variable that contains the 6 grid max outputs
CHARACTER(14*BYTE) :: MIN_ANS_CHAR(6) ! Character variable that contains the 6 grid min outputs
CHARACTER(14*BYTE) :: TOTALS_CHAR(6) ! Character variable that contains the 6 grid tot outputs
CHARACTER(108*BYTE) :: LINE_BUF ! Pre-assembled per-grid output line (matches FORMAT 9902 layout)

INTEGER(LONG), INTENT(IN) :: JVEC ! Sol'n vector num. Can be internal subcase number or eigenvector number
INTEGER(LONG), INTENT(IN) :: NUM ! The number of rows of OGEL to write out
Expand Down Expand Up @@ -220,53 +221,60 @@ SUBROUTINE WRITE_GRD_PRT_OUTPUTS ( JVEC, NUM, WHAT, IHDR, ALL_SAME_CID, WRITE_OG
ENDDO

DO I=1,6

IF (ABS_ANS(I) == 0.0) THEN
WRITE(ABS_ANS_CHAR(I),'(A)') ' 0.0 '
IF (ABS(ABS_ANS(I)) == ZERO) THEN
ABS_ANS_CHAR(I) = ' 0.0 '
ELSE
WRITE(ABS_ANS_CHAR(I),'(1ES14.6)') ABS_ANS(I)
CALL FMT_ES14_6 ( ABS_ANS(I), ABS_ANS_CHAR(I) )
ENDIF

IF (MAX_ANS(I) == 0.0) THEN
WRITE(MAX_ANS_CHAR(I),'(A)') ' 0.0 '
IF (ABS(MAX_ANS(I)) == ZERO) THEN
MAX_ANS_CHAR(I) = ' 0.0 '
ELSE
WRITE(MAX_ANS_CHAR(I),'(1ES14.6)') MAX_ANS(I)
CALL FMT_ES14_6 ( MAX_ANS(I), MAX_ANS_CHAR(I) )
ENDIF

IF (MIN_ANS(I) == 0.0) THEN
WRITE(MIN_ANS_CHAR(I),'(A)') ' 0.0 '
IF (ABS(MIN_ANS(I)) == ZERO) THEN
MIN_ANS_CHAR(I) = ' 0.0 '
ELSE
WRITE(MIN_ANS_CHAR(I),'(1ES14.6)') MIN_ANS(I)
CALL FMT_ES14_6 ( MIN_ANS(I), MIN_ANS_CHAR(I) )
ENDIF

ENDDO

! Write accels, displ's, applied forces or SPC forces (also calc TOTALS for forces if that is being output)
! TOTALS(J) is summation of G.P. values of applied forces, SPC forces, or MFC forces, for each of the J=1,6 components.

DO J=1,6
TOTALS(J) = ZERO
ENDDO
TOTALS = ZERO

! Pre-fill the fixed-whitespace positions of LINE_BUF that match FORMAT 9902 = (6X,2(1X,I8),6A).
! Variable fields (GID, COORD, 6x14-char values) are overwritten per iteration in the loop below.
LINE_BUF = ' '

LINES_WRITTEN = 0
DO I=1,NUM

IF ((WHAT == 'OLOAD') .OR. (WHAT == 'SPCF') .OR. (WHAT == 'MPCF')) THEN
DO J=1,6
TOTALS(J) = TOTALS(J) + OGEL(I,J)
IF (TOTALS(J) == 0.0) THEN
WRITE(TOTALS_CHAR(J),'(A)') ' 0.0 '
IF (ABS(TOTALS(J)) == ZERO) THEN
TOTALS_CHAR(J) = ' 0.0 '
ELSE
WRITE(TOTALS_CHAR(J),'(1ES14.6)') TOTALS(J)
CALL FMT_ES14_6 ( TOTALS(J), TOTALS_CHAR(J) )
ENDIF
ENDDO
ENDIF

IF (WRITE_OGEL(I) == 'Y') THEN

CALL WRT_REAL_TO_CHAR_VAR ( OGEL, MAXREQ, MOGEL, I, OGEL_CHAR )

WRITE(F06,9902) GID_OUT_ARRAY(I,1),GID_OUT_ARRAY(I,2),(OGEL_CHAR(J),J=1,6)
! Assemble the per-grid output line directly into LINE_BUF, then emit with a single A-format WRITE.
! Layout (matches FORMAT 9902): 6X | 1X | I8 | 1X | I8 | 6 * A14 ==> 108 chars total.
CALL FMT_I8_RJ ( GID_OUT_ARRAY(I,1), LINE_BUF( 8:15) )
CALL FMT_I8_RJ ( GID_OUT_ARRAY(I,2), LINE_BUF(17:24) )
DO J=1,6
IF (ABS(OGEL(I,J)) == ZERO) THEN
LINE_BUF(25 + (J-1)*14 : 24 + J*14) = ' 0.0 '
ELSE
CALL FMT_ES14_6 ( OGEL(I,J), LINE_BUF(25 + (J-1)*14 : 24 + J*14) )
ENDIF
ENDDO
WRITE(F06,'(A)') LINE_BUF

IF (GID_OUT_ARRAY(I,MELGP+1) > 0) THEN
DO J=1,GID_OUT_ARRAY(I,MELGP+1)
Expand Down
11 changes: 5 additions & 6 deletions Source/LK9/L91/WRT_REAL_TO_CHAR_VAR.f90
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ SUBROUTINE WRT_REAL_TO_CHAR_VAR ( REAL_VAR, NROWS, NCOLS, ROW_NUM, CHAR_VAR )
REAL(DOUBLE) , INTENT(IN) :: REAL_VAR(NROWS,NCOLS)!

! **********************************************************************************************************************************
DO J=1,NCOLS
CHAR_VAR(J)(1:) = ' '
ENDDO
! FMT_ES14_6 produces the same 14-char output as Fortran's 1ES14.6 edit descriptor but avoids the
! per-value internal WRITE overhead. Exact zeros are then overwritten with this routine's historical
! ' 0.0 ' substitution so the F06 output stays bit-identical.
DO J=1,NCOLS
IF (ABS(REAL_VAR(ROW_NUM,J)) == ZERO) THEN
WRITE(CHAR_VAR(J),'(A)') ' 0.0 '
CHAR_VAR(J) = ' 0.0 '
ELSE
WRITE(CHAR_VAR(J),'(1ES14.6)') REAL_VAR(ROW_NUM,J)
CALL FMT_ES14_6 ( REAL_VAR(ROW_NUM,J), CHAR_VAR(J) )
ENDIF
ENDDO

Expand All @@ -65,4 +65,3 @@ SUBROUTINE WRT_REAL_TO_CHAR_VAR ( REAL_VAR, NROWS, NCOLS, ROW_NUM, CHAR_VAR )
! **********************************************************************************************************************************

END SUBROUTINE WRT_REAL_TO_CHAR_VAR

10 changes: 2 additions & 8 deletions Source/LK9/L92/OFP1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,10 @@ SUBROUTINE OFP1 ( JVEC, WHAT, SC_OUT_REQ, FEMAP_SET_ID, ITG, OT4_GROW, ITABLE, N


! **********************************************************************************************************************************
DO I=1,MAXREQ
DO J=1,MOGEL
OGEL(I,J) = ZERO
ENDDO
ENDDO
OGEL = ZERO

! Initialize WRITE_OGEL
DO I=1,NGRID
WRITE_OGEL(I) = 'Y'
ENDDO
WRITE_OGEL(1:NGRID) = 'Y'

! ---------------------------------------------------------------------------------------------------------------------------------
! Process acceleration output requests for CB sol.
Expand Down
10 changes: 2 additions & 8 deletions Source/LK9/L92/OFP2.f90
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,10 @@ SUBROUTINE OFP2 ( JVEC, WHAT, SC_OUT_REQ, ZERO_GEN_STIFF, FEMAP_SET_ID, ITG, OT4
WRITE_NEU = (PRTNEU == 'Y')

! **********************************************************************************************************************************
DO I=1,MAXREQ
DO J=1,MOGEL
OGEL(I,J) = ZERO
ENDDO
ENDDO
OGEL = ZERO

! Initialize WRITE_OGEL
DO I=1,NGRID
WRITE_OGEL(I) = 'Y'
ENDDO
WRITE_OGEL(1:NGRID) = 'Y'

! ---------------------------------------------------------------------------------------------------------------------------------
! Process SPC force requests
Expand Down
6 changes: 1 addition & 5 deletions Source/LK9/L92/OFP3.f90
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ SUBROUTINE OFP3 ( JVEC, FEMAP_SET_ID, ITE, OT4_EROW )
! **********************************************************************************************************************************
! Initialize

DO I=1,MAXREQ
DO J=1,MOGEL
OGEL(I,J) = ZERO
ENDDO
ENDDO
OGEL = ZERO

DO I=1,MERROR
IERROR(I) = 0
Expand Down
6 changes: 1 addition & 5 deletions Source/LK9/L92/OFP3_ELFE_1D.f90
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,7 @@ SUBROUTINE OFP3_ELFE_1D ( JVEC, FEMAP_SET_ID, ITE, OT4_EROW )
ENDDO
ENDDO

DO I=1,MAXREQ
DO J=1,MOGEL
OGEL(I,J) = ZERO
ENDDO
ENDDO
OGEL = ZERO

!xx IROW_MAT = 0
!xx IROW_TXT = 0
Expand Down
6 changes: 1 addition & 5 deletions Source/LK9/L92/OFP3_ELFE_2D.f90
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,7 @@ SUBROUTINE OFP3_ELFE_2D ( JVEC, FEMAP_SET_ID, ITE, OT4_EROW )
!xx ENDIF
!xx ENDDO

DO I=1,MAXREQ
DO J=1,MOGEL
OGEL(I,J) = ZERO
ENDDO
ENDDO
OGEL = ZERO

!xx IROW_MAT = 0
!xx IROW_TXT = 0
Expand Down
Loading
Loading