Skip to content

Commit 48d8bd1

Browse files
authored
Merge pull request #85 from Bruno02468/upstream-main
MYSTRAN Update 15.2.1
2 parents f3dd4de + dd54d94 commit 48d8bd1

26 files changed

Lines changed: 450 additions & 351 deletions

Build_Test_Cases/buckling/bar.bdf

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
ID BAR BUCKLING
2+
SOL 5
3+
CEND
4+
$TITLE = EULER BUCKLING OF A CANTILEVERED-FREE BEAM
5+
$SUBTI = 10 CBAR ELEMENTS ALONG X AXIS, END LOAD
6+
ECHO = UNSORT
7+
DISP = ALL
8+
$ELFORCE(BOTH) = ALL
9+
$GPFORCE = ALL
10+
$MPCFORCE = ALL
11+
$OLOAD = ALL
12+
$SPCFORCE = ALL
13+
$STRESS = ALL
14+
$ELDATA(0,PRINT) = ALL
15+
$ELDATA(1,PRINT) = ALL
16+
$ELDATA(2,PRINT) = ALL
17+
$ELDATA(3,PRINT) = ALL
18+
$ELDATA(4,PRINT) = ALL
19+
$ELDATA(5,PRINT) = ALL
20+
SUBCASE 1
21+
LOAD = 10
22+
SUBCASE 2
23+
METHOD = 20
24+
BEGIN BULK
25+
$
26+
FORCE 10 2 -1. 1. 0. 0.
27+
$
28+
EIGRL 20 2 10. MAX +E1
29+
+E1 DGB
30+
$
31+
GRID 1 90. 0. 0. 123456
32+
GRID 2 100. 0. 0.
33+
$
34+
CBAR 10 1 1 2 0. 1. 0.
35+
$
36+
PBAR* 1 1 .500 .041666666666667*
37+
* 104.16666666667
38+
$
39+
MAT1 1 10.+6 .33 0.1 20.-6 0.
40+
$
41+
PARAM SOLLIB BANDED
42+
PARAM POST -1
43+
DEBUG 200 1
44+
$
45+
ENDDATA
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
ID BAR BUCKLING
2+
SOL 101
3+
CEND
4+
$TITLE = EULER BUCKLING OF A CANTILEVERED-FREE BEAM
5+
$SUBTI = 10 CBAR ELEMENTS ALONG X AXIS, END LOAD
6+
ECHO = UNSORT
7+
DISP = ALL
8+
$ELFORCE(BOTH) = ALL
9+
$GPFORCE = ALL
10+
$MPCFORCE = ALL
11+
$OLOAD = ALL
12+
$SPCFORCE = ALL
13+
$STRESS = ALL
14+
$ELDATA(0,PRINT) = ALL
15+
$ELDATA(1,PRINT) = ALL
16+
$ELDATA(2,PRINT) = ALL
17+
$ELDATA(3,PRINT) = ALL
18+
$ELDATA(4,PRINT) = ALL
19+
$ELDATA(5,PRINT) = ALL
20+
SUBCASE 1
21+
LOAD = 10
22+
BEGIN BULK
23+
$
24+
FORCE 10 2 -1. 1. 0. 0.
25+
$
26+
GRID 1 90. 0. 0. 123456
27+
GRID 2 100. 0. 0.
28+
$
29+
CBAR 10 1 1 2 0. 1. 0.
30+
$
31+
$1 2 3 4 5 6
32+
PBAR* 1 1 .500 .041666666666667*
33+
* 104.16666666667
34+
$
35+
MAT1 1 10.+6 .33 0.1 20.-6 0.
36+
$
37+
PARAM SOLLIB BANDED
38+
PARAM POST -1
39+
DEBUG 200 1
40+
$
41+
ENDDATA

CMakeLists.txt

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
# set up basic project info
66
cmake_minimum_required(VERSION 3.18)
7+
include(CheckFunctionExists)
8+
79
enable_language(Fortran)
810
project(Mystran)
911

@@ -139,7 +141,7 @@ if (WIN32)
139141
set(CMAKE_EXE_LINKER_FLAGS "-static")
140142
endif()
141143

142-
# build the SuperLU and BLAS static libs!
144+
# build the SuperLU (and CBLAS if needed) static libs!
143145
add_subdirectory(${SUPERLU_DIR})
144146

145147
# collect modules and interfaces into a module called MODULES
@@ -156,29 +158,63 @@ set(
156158
MODULES_ALL_FILES ${USE_IFs_FILES} ${Interfaces_FILES} ${Modules_FILES}
157159
${Modules_LAPACK_FILES} ${Modules_ARPACK_FILES}
158160
)
159-
add_library(MODULES ${MODULES_ALL_FILES})
161+
add_library(MODULES OBJECT ${MODULES_ALL_FILES})
160162

161163
# collect modules
162164
list(APPEND modules_names ARPACK BANDIT LK1 LK2 LK3 LK4 LK5 LK6 LK9 EMG)
163165
foreach (modname IN LISTS modules_names)
164166
file(GLOB_RECURSE TMP_MOD_FILES "${CMAKE_SOURCE_DIR}/${modname}/*.f*")
165-
add_library(${modname} ${TMP_MOD_FILES} ${TMP_MOD_FILES_PP})
167+
add_library(${modname} OBJECT ${TMP_MOD_FILES} ${TMP_MOD_FILES_PP})
166168
target_link_libraries(${modname} MODULES)
167169
endforeach()
168170

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

175+
# if (and only if) SuperLU is compiled with its internal CBLAS, some subrs will
176+
# be missing, so we compile our own.
177+
# first, we check for the missing subroutines
178+
list(
179+
APPEND blas_fns dgemm dgemv dlamch dlanst dscal dsteqr dsterf dswap dtrsm
180+
dtrtri ilaenv lsame xerbla
181+
)
182+
foreach (fname IN LISTS blas_fns)
183+
check_function_exists(${fname} BLAS_FN_EXISTS)
184+
if (NOT BLAS_FN_EXISTS)
185+
string(TOUPPER ${fname} fname_upper)
186+
list(APPEND missing_blas_src "${CMAKE_SOURCE_DIR}/BLAS/${fname_upper}.f")
187+
list(APPEND missing_blas_fns ${fname})
188+
endif()
189+
endforeach()
190+
# if any subroutines have bene found, create an inner blas library
191+
list(LENGTH missing_blas_fns MISSING_FNS_TOTAL)
192+
if (MISSING_FNS_TOTAL GREATER 0)
193+
if (MISSING_FNS_TOTAL GREATER 1)
194+
message(
195+
STATUS
196+
"BLAS subrs (${missing_blas_fns}) are absent and will be built locally."
197+
)
198+
else()
199+
message(
200+
STATUS
201+
"BLAS subr ${missing_blas_fns} is absent and will be built locally."
202+
)
203+
endif()
204+
add_library(my_blas OBJECT ${missing_blas_src})
205+
target_link_libraries(my_blas MODULES)
206+
endif()
174207

175208
# prepare the main executable, linked against the specifics and the m
176209
# it appears utils used to be a module, but that is no longer the case?
177210
file(GLOB_RECURSE UTIL_FILES "${CMAKE_SOURCE_DIR}/UTIL/*.f*")
178211
file(GLOB_RECURSE MAIN_FILES "${CMAKE_SOURCE_DIR}/MAIN/*.[fF]*")
179212
add_executable(mystran ${MAIN_FILES} ${MODULES_ALL_FILES} ${UTIL_FILES})
180213
target_link_libraries(mystran ${modules_names})
181-
target_link_libraries(mystran dgssv superlu f2c)
214+
target_link_libraries(mystran dgssv superlu f2c blas)
215+
if (MISSING_FNS_TOTAL GREATER 0)
216+
target_link_libraries(mystran my_blas)
217+
endif()
182218
set_target_properties(
183219
mystran PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}
184220
)

Source/Modules/LAPACK/Unresolved_Externals_Problem/DGEMM.f renamed to Source/BLAS/DGEMM.f

File renamed without changes.

Source/Modules/LAPACK/Unresolved_Externals_Problem/DGEMV.f renamed to Source/BLAS/DGEMV.f

File renamed without changes.

Source/Modules/LAPACK/Unresolved_Externals_Problem/DLAMCH.f renamed to Source/BLAS/DLAMCH.f

File renamed without changes.

Source/Modules/LAPACK/Unresolved_Externals_Problem/DLANST.f renamed to Source/BLAS/DLANST.f

File renamed without changes.

Source/Modules/LAPACK/Unresolved_Externals_Problem/DSCAL.f renamed to Source/BLAS/DSCAL.f

File renamed without changes.

Source/Modules/LAPACK/Unresolved_Externals_Problem/DSTEQR.f renamed to Source/BLAS/DSTEQR.f

File renamed without changes.

Source/Modules/LAPACK/Unresolved_Externals_Problem/DSTERF.f renamed to Source/BLAS/DSTERF.f

File renamed without changes.

0 commit comments

Comments
 (0)