Skip to content

Commit

Permalink
Merge pull request #85 from Bruno02468/upstream-main
Browse files Browse the repository at this point in the history
MYSTRAN Update 15.2.1
  • Loading branch information
Bruno02468 authored Aug 30, 2024
2 parents f3dd4de + dd54d94 commit 48d8bd1
Show file tree
Hide file tree
Showing 26 changed files with 450 additions and 351 deletions.
45 changes: 45 additions & 0 deletions Build_Test_Cases/buckling/bar.bdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
ID BAR BUCKLING
SOL 5
CEND
$TITLE = EULER BUCKLING OF A CANTILEVERED-FREE BEAM
$SUBTI = 10 CBAR ELEMENTS ALONG X AXIS, END LOAD
ECHO = UNSORT
DISP = ALL
$ELFORCE(BOTH) = ALL
$GPFORCE = ALL
$MPCFORCE = ALL
$OLOAD = ALL
$SPCFORCE = ALL
$STRESS = ALL
$ELDATA(0,PRINT) = ALL
$ELDATA(1,PRINT) = ALL
$ELDATA(2,PRINT) = ALL
$ELDATA(3,PRINT) = ALL
$ELDATA(4,PRINT) = ALL
$ELDATA(5,PRINT) = ALL
SUBCASE 1
LOAD = 10
SUBCASE 2
METHOD = 20
BEGIN BULK
$
FORCE 10 2 -1. 1. 0. 0.
$
EIGRL 20 2 10. MAX +E1
+E1 DGB
$
GRID 1 90. 0. 0. 123456
GRID 2 100. 0. 0.
$
CBAR 10 1 1 2 0. 1. 0.
$
PBAR* 1 1 .500 .041666666666667*
* 104.16666666667
$
MAT1 1 10.+6 .33 0.1 20.-6 0.
$
PARAM SOLLIB BANDED
PARAM POST -1
DEBUG 200 1
$
ENDDATA
41 changes: 41 additions & 0 deletions Build_Test_Cases/statics/bar_static_large.bdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
ID BAR BUCKLING
SOL 101
CEND
$TITLE = EULER BUCKLING OF A CANTILEVERED-FREE BEAM
$SUBTI = 10 CBAR ELEMENTS ALONG X AXIS, END LOAD
ECHO = UNSORT
DISP = ALL
$ELFORCE(BOTH) = ALL
$GPFORCE = ALL
$MPCFORCE = ALL
$OLOAD = ALL
$SPCFORCE = ALL
$STRESS = ALL
$ELDATA(0,PRINT) = ALL
$ELDATA(1,PRINT) = ALL
$ELDATA(2,PRINT) = ALL
$ELDATA(3,PRINT) = ALL
$ELDATA(4,PRINT) = ALL
$ELDATA(5,PRINT) = ALL
SUBCASE 1
LOAD = 10
BEGIN BULK
$
FORCE 10 2 -1. 1. 0. 0.
$
GRID 1 90. 0. 0. 123456
GRID 2 100. 0. 0.
$
CBAR 10 1 1 2 0. 1. 0.
$
$1 2 3 4 5 6
PBAR* 1 1 .500 .041666666666667*
* 104.16666666667
$
MAT1 1 10.+6 .33 0.1 20.-6 0.
$
PARAM SOLLIB BANDED
PARAM POST -1
DEBUG 200 1
$
ENDDATA
48 changes: 42 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# set up basic project info
cmake_minimum_required(VERSION 3.18)
include(CheckFunctionExists)

enable_language(Fortran)
project(Mystran)

Expand Down Expand Up @@ -139,7 +141,7 @@ if (WIN32)
set(CMAKE_EXE_LINKER_FLAGS "-static")
endif()

# build the SuperLU and BLAS static libs!
# build the SuperLU (and CBLAS if needed) static libs!
add_subdirectory(${SUPERLU_DIR})

# collect modules and interfaces into a module called MODULES
Expand All @@ -156,29 +158,63 @@ set(
MODULES_ALL_FILES ${USE_IFs_FILES} ${Interfaces_FILES} ${Modules_FILES}
${Modules_LAPACK_FILES} ${Modules_ARPACK_FILES}
)
add_library(MODULES ${MODULES_ALL_FILES})
add_library(MODULES OBJECT ${MODULES_ALL_FILES})

# collect modules
list(APPEND modules_names ARPACK BANDIT LK1 LK2 LK3 LK4 LK5 LK6 LK9 EMG)
foreach (modname IN LISTS modules_names)
file(GLOB_RECURSE TMP_MOD_FILES "${CMAKE_SOURCE_DIR}/${modname}/*.f*")
add_library(${modname} ${TMP_MOD_FILES} ${TMP_MOD_FILES_PP})
add_library(${modname} OBJECT ${TMP_MOD_FILES} ${TMP_MOD_FILES_PP})
target_link_libraries(${modname} MODULES)
endforeach()

# add the DTRSV and DGSSV C modules.
# add the DGSSV C module from SuperLU and link it against SuperLU's BLAS
add_library(dgssv "${SUPERLU_DIR}/FORTRAN/c_fortran_dgssv.c")
#add_library(dtrsv "${SUPERLU_DIR}/SRC/dtrsv.c")
target_link_libraries(dgssv blas)

# if (and only if) SuperLU is compiled with its internal CBLAS, some subrs will
# be missing, so we compile our own.
# first, we check for the missing subroutines
list(
APPEND blas_fns dgemm dgemv dlamch dlanst dscal dsteqr dsterf dswap dtrsm
dtrtri ilaenv lsame xerbla
)
foreach (fname IN LISTS blas_fns)
check_function_exists(${fname} BLAS_FN_EXISTS)
if (NOT BLAS_FN_EXISTS)
string(TOUPPER ${fname} fname_upper)
list(APPEND missing_blas_src "${CMAKE_SOURCE_DIR}/BLAS/${fname_upper}.f")
list(APPEND missing_blas_fns ${fname})
endif()
endforeach()
# if any subroutines have bene found, create an inner blas library
list(LENGTH missing_blas_fns MISSING_FNS_TOTAL)
if (MISSING_FNS_TOTAL GREATER 0)
if (MISSING_FNS_TOTAL GREATER 1)
message(
STATUS
"BLAS subrs (${missing_blas_fns}) are absent and will be built locally."
)
else()
message(
STATUS
"BLAS subr ${missing_blas_fns} is absent and will be built locally."
)
endif()
add_library(my_blas OBJECT ${missing_blas_src})
target_link_libraries(my_blas MODULES)
endif()

# prepare the main executable, linked against the specifics and the m
# it appears utils used to be a module, but that is no longer the case?
file(GLOB_RECURSE UTIL_FILES "${CMAKE_SOURCE_DIR}/UTIL/*.f*")
file(GLOB_RECURSE MAIN_FILES "${CMAKE_SOURCE_DIR}/MAIN/*.[fF]*")
add_executable(mystran ${MAIN_FILES} ${MODULES_ALL_FILES} ${UTIL_FILES})
target_link_libraries(mystran ${modules_names})
target_link_libraries(mystran dgssv superlu f2c)
target_link_libraries(mystran dgssv superlu f2c blas)
if (MISSING_FNS_TOTAL GREATER 0)
target_link_libraries(mystran my_blas)
endif()
set_target_properties(
mystran PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
116 changes: 55 additions & 61 deletions Source/LK1/L1A-BD/BD_CBAR.f90
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@

SUBROUTINE BD_CBAR ( CARD, LARGE_FLD_INP )

! Processes CBAR and CBEAM Bulk Data Cards:

! Processes CBAR and CBEAM Bulk Data Cards:
USE PENTIUM_II_KIND, ONLY : BYTE, LONG, DOUBLE
USE IOUNT1, ONLY : WRT_ERR, WRT_LOG, ERR, F04, F06
USE SCONTR, ONLY : BLNK_SUB_NAM, FATAL_ERR, IERRFL, JCARD_LEN, JF, LBAROFF, LVVEC, MEDAT_CBAR, &
Expand Down Expand Up @@ -80,55 +79,50 @@ SUBROUTINE BD_CBAR ( CARD, LARGE_FLD_INP )
ENDIF

! **********************************************************************************************************************************
! CBAR element Bulk Data Card routine

! FIELD ITEM ARRAY ELEMENT
! ----- ------------ -------------
! 1 Element type ETYPE(nele) =B1 for CBAR
! 2 Element ID EDAT(nedat+1)
! 3 Property ID EDAT(nedat+2)
! 4 Grid A EDAT(nedat+3)
! 5 Grid B EDAT(nedat+4)
! 6-8 V-Vector (see VVEC explanation below)
! V vector key goes in EDAT(nedat+5)
! on optional second card:
! 2 Pin Flag A EDAT(nedat+6)
! 3 Pin Flag B EDAT(nedat+7)
! 4-9 Offsets (see BAROFF explanation below)
! Offset key goes in EDAT(nedat+8)

! NOTES:

! If fields 3, 6-8 are blank, they are loaded with the data from the BAROR/BEAMOR entry (these will remain blank if
! no BAROR/BEAMOR card exists). If V-vector is specfied via a grid point then EDAT(nedat+5) is set to that grid number.
! If V-vector is specified via an actual vector, the vector is loaded into array VVEC(NVVEC,J) (J=1,2,3) unless
! a vector equal to it has been put in VVEC. EDAT(nedat+5) is set equal to -NVVEC, where NVVEC is the row number
! in array VVEC.

! Offsets are in fields 4 - 9 of the first continuation card. If there are any offsets for this element, they are written to
! array BAROFF in row NBAROFF and NBAROFF is written in EDAT(nedat+8). If there are no offsets for this element, a zero is entered
! in array EDAT(nedat+8).

! CBAR element Bulk Data Card routine

! FIELD ITEM ARRAY ELEMENT
! ----- ------------ -------------
! 1 Element type ETYPE(nele) =B1 for CBAR
! 2 Element ID EDAT(nedat+1)
! 3 Property ID EDAT(nedat+2)
! 4 Grid A EDAT(nedat+3)
! 5 Grid B EDAT(nedat+4)
! 6-8 V-Vector (see VVEC explanation below)
! V vector key goes in EDAT(nedat+5)
! on optional second card:
! 2 Pin Flag A EDAT(nedat+6)
! 3 Pin Flag B EDAT(nedat+7)
! 4-9 Offsets (see BAROFF explanation below)
! Offset key goes in EDAT(nedat+8)

! NOTES:

! If fields 3, 6-8 are blank, they are loaded with the data from the BAROR/BEAMOR entry (these will remain blank if
! no BAROR/BEAMOR card exists). If V-vector is specfied via a grid point then EDAT(nedat+5) is set to that grid number.
! If V-vector is specified via an actual vector, the vector is loaded into array VVEC(NVVEC,J) (J=1,2,3) unless
! a vector equal to it has been put in VVEC. EDAT(nedat+5) is set equal to -NVVEC, where NVVEC is the row number
! in array VVEC.

! Offsets are in fields 4 - 9 of the first continuation card. If there are any offsets for this element, they are written to
! array BAROFF in row NBAROFF and NBAROFF is written in EDAT(nedat+8). If there are no offsets for this element, a zero is entered
! in array EDAT(nedat+8).
EPS1 = EPSIL(1)

! Make JCARD from CARD

! Make JCARD from CARD
CALL MKJCARD ( SUBR_NAME, CARD, JCARD )
BAR_OR_BEAM = JCARD(1)
ELID = JCARD(2)

! Set JCARD_EDAT to JCARD

! Set JCARD_EDAT to JCARD
DO I=1,10
JCARD_EDAT(I) = JCARD(I)
ENDDO

! Initialize variables

! Initialize variables
VVEC_TYPE = 'UNDEFINED'

! Check property ID field. Set to BAROR prop ID, if present, or to this elem ID, if not

! Check property ID field. Set to BAROR prop ID, if present, or to this elem ID, if not
IF (JCARD(3)(1:) == ' ') THEN ! Prop ID field is blank, so use one of the following:
IF (BAR_OR_BEAM(1:4) == 'CBAR') THEN
IF (BAROR_PID /= 0) THEN ! Use BAROR prop ID for this CBAR prop ID
Expand All @@ -145,8 +139,7 @@ SUBROUTINE BD_CBAR ( CARD, LARGE_FLD_INP )
ENDIF
ENDIF

! Call ELEPRO to increment NELE and load some of the connection data into array EDAT

! Call ELEPRO to increment NELE and load some of the connection data into array EDAT
IF (BAR_OR_BEAM(1:4) == 'CBAR') THEN
CALL ELEPRO ( 'Y', JCARD_EDAT, 4, MEDAT_CBAR , 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'N', 'N' )
NCBAR = NCBAR+1
Expand All @@ -157,9 +150,9 @@ SUBROUTINE BD_CBAR ( CARD, LARGE_FLD_INP )
ETYPE(NELE) = 'BEAM '
ENDIF

! Get the V vector for this CBAR/CBEAM (either from this CBAR/CBEAM or from BAROR/BEAMOR values, if present)

DO J=1,3 ! Null all components. Some may be read from CBAR card
! Get the V vector for this CBAR/CBEAM (either from this CBAR/CBEAM or from BAROR/BEAMOR values, if present)
! Null all components. Some may be read from CBAR card
DO J=1,3
VV(J) = ZERO
ENDDO

Expand All @@ -178,7 +171,8 @@ SUBROUTINE BD_CBAR ( CARD, LARGE_FLD_INP )
ENDIF ! check case where fields 6, 7, 8 are blank below
ENDIF
ELSE
IF (NBEAMOR > 0) THEN ! Set VVEC fields to BEAMOR values if this CBEAM's VVEC fields are blank
IF (NBEAMOR > 0) THEN
! Set VVEC fields to BEAMOR values if this CBEAM's VVEC fields are blank
IF ((JCARD(6)(1:) == ' ') .AND. (JCARD(7)(1:) == ' ') .AND. (JCARD(8)(1:) == ' ')) THEN
IF (BEAMOR_VVEC_TYPE == 'GRID ') THEN
VVEC_TYPE = 'BEAMOR_GRD'
Expand All @@ -200,7 +194,8 @@ SUBROUTINE BD_CBAR ( CARD, LARGE_FLD_INP )
EXIT
ENDIF
ENDDO
IF (VVEC_TYPE == 'VECTOR ') THEN ! If there is an actual V vector, get components
IF (VVEC_TYPE == 'VECTOR ') THEN
! If there is an actual V vector, get components
LVVEC = LVVEC + 1
JERR = 0
DO J=1,3
Expand Down Expand Up @@ -244,8 +239,7 @@ SUBROUTINE BD_CBAR ( CARD, LARGE_FLD_INP )
ENDIF
ENDIF

! Load V vector data into EDAT and into VVEC, if not already there

! Load V vector data into EDAT and into VVEC, if not already there
IF ((VVEC_TYPE == 'GRID ') .OR. (VVEC_TYPE == 'BAROR_GRD')) THEN

NEDAT = NEDAT + 1
Expand Down Expand Up @@ -278,27 +272,25 @@ SUBROUTINE BD_CBAR ( CARD, LARGE_FLD_INP )

NEDAT = NEDAT + 1
EDAT(NEDAT) = -VVEC_NUM

ENDIF

! Write warnings and errors if any

! Write warnings and errors if any
CALL BD_IMBEDDED_BLANK ( JCARD,2,3,4,5,6,7,8,0 ) ! Make sure that there are no imbedded blanks in fields 2-8
CALL CARD_FLDS_NOT_BLANK ( JCARD,0,0,0,0,0,0,0,9 )
CALL CRDERR ( CARD ) ! CRDERR prints errors found when reading fields

! Optional Second Card:

! Optional Second Card:
IF (LARGE_FLD_INP == 'N') THEN
CALL NEXTC ( CARD, ICONT, IERR )
ELSE
CALL NEXTC2 ( CARD, ICONT, IERR, CHILD )
CARD = CHILD
ENDIF
CALL MKJCARD ( SUBR_NAME, CARD, JCARD )
IF (ICONT == 1) THEN

DO J = 2,3 ! Get pin flag data, if present
IF (ICONT == 1) THEN
DO J = 2,3
! Get pin flag data, if present
IF (JCARD(J)(1:) /= ' ') THEN
CALL IP6CHK ( JCARD(J), JCARDO, IP6TYP, IDUM )
IF (IP6TYP == 'COMP NOS') THEN
Expand All @@ -313,19 +305,22 @@ SUBROUTINE BD_CBAR ( CARD, LARGE_FLD_INP )
WRITE(F06,1130) JCARD(J) ,J, JCARD(1), ELID
ENDIF
ELSE
NEDAT = NEDAT + 1 ! Null EDAT for this pin flag
! Null EDAT for this pin flag
NEDAT = NEDAT + 1
EDAT(NEDAT) = 0
ENDIF
ENDDO
! Get offsets, if present

! Get offsets, if present
IF ((JCARD(4)(1:) /= ' ') .OR. (JCARD(5)(1:) /= ' ') .AND. (JCARD(6)(1:) /= ' ') .OR. (JCARD(7)(1:) /= ' ') .AND. &
(JCARD(8)(1:) /= ' ') .OR. (JCARD(9)(1:) /= ' ')) THEN
NBAROFF = NBAROFF + 1
IF (NBAROFF > LBAROFF) THEN
! Coding error, so quit
FATAL_ERR = FATAL_ERR + 1
WRITE(ERR,1161) SUBR_NAME, JCARD(1), LBAROFF
WRITE(F06,1161) SUBR_NAME, JCARD(1), LBAROFF
CALL OUTA_HERE ( 'Y' ) ! Coding error, so quit
CALL OUTA_HERE ( 'Y' )
ENDIF
NEDAT = NEDAT + 1
EDAT(NEDAT) = NBAROFF
Expand All @@ -336,10 +331,9 @@ SUBROUTINE BD_CBAR ( CARD, LARGE_FLD_INP )
ENDIF
ENDDO
ELSE

NEDAT = NEDAT + 1 ! Null EDAT for the offset flag
! Null EDAT for the offset flag
NEDAT = NEDAT + 1
EDAT(NEDAT) = 0

ENDIF

CALL BD_IMBEDDED_BLANK ( JCARD,0,0,4,5,6,7,8,9 ) ! Make sure that there are no imbedded blanks in fields 4-9
Expand Down
Loading

0 comments on commit 48d8bd1

Please sign in to comment.