Skip to content

Commit 38b57d2

Browse files
committed
Add new capabilities
- Overhaul source code. - Overhaul configuration file. - Overhaul output, now .sim format (compatible with Neper). - Added parallelized multi-point constraints and periodic boundary conditions. - Added 2-parameter anisotropic hardening (diagonal + off-diagonal values). - Generalize code to take arbitrary domain shapes and boundary conditions. - Added ability for 112-type slip in BCC crystals, added ability to specify anisotropic initial slip strengths, improved precipitate strengthening model (Orowan looping). - Made various other changes and improvements.
1 parent a7dbc30 commit 38b57d2

File tree

5,804 files changed

+467248
-82077
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,804 files changed

+467248
-82077
lines changed

.gitignore

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*.x
55
*~
66
*.x.dSYM
7-
*.cp*
87
*.fn*
98
*.ky*
109
*.pg*
@@ -14,17 +13,22 @@
1413
*.dvi
1514
*.info
1615
*.swp
16+
fort.75
1717

1818
# Ignore FEPX build files
1919
/lib/libf95/modules
2020
/lib/libparallel/modules_serial
2121
/lib/libparallel/modules_parallel
2222
/src/build/
23+
/src/build.sim
2324
/build/
2425
/doc/build/
2526

2627
# Ignore FEPX post files
28+
/tests/*/simulation.sim
2729
post.*
30+
rst*.*
31+
FAILED
2832

2933
# Ignore AppleDouble files and Mac .DS_Store files
3034
._*
@@ -69,3 +73,6 @@ docs
6973

7074
# Sphinx files
7175
__pycache__
76+
77+
doxygen
78+

CMakeLists.txt

+218
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
# This file is part of the FEPX software package.
2+
# Copyright (C) 1996-2023, DPLab, ACME Lab.
3+
# See the COPYING file in the top-level directory.
4+
5+
# Top-level CMakeLists.txt for building FEPX
6+
cmake_minimum_required(VERSION 3.0)
7+
project(fepx Fortran)
8+
set(FEPX_VERSION \"1.3.1-1553-devel\")
9+
10+
# Prepare CMake for Fortran and locate MPI package
11+
enable_language(Fortran)
12+
find_package(MPI REQUIRED)
13+
14+
# Set the build type for appropriate compile flags
15+
if(NOT CMAKE_BUILD_TYPE)
16+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build: Debug Release" FORCE)
17+
endif()
18+
19+
set(BUILD_TESTING_MODE "Normal" CACHE STRING "Choose the testing mode: Normal Minimal Writing")
20+
set(BUILD_TESTING_DIFF "Exact" CACHE STRING "Choose the testing method: Exact Neper")
21+
22+
# Option for verbose build
23+
option(VERBOSE "Build verbose Makefiles" OFF)
24+
if(VERBOSE)
25+
set(CMAKE_VERBOSE_MAKEFILE ON)
26+
else(VERBOSE)
27+
set(CMAKE_VERBOSE_MAKEFILE OFF)
28+
endif(VERBOSE)
29+
30+
# Option to suppress IEEE warnings on program exit
31+
option(IEEE_SUPPRESS "Suppress IEEE signals on program exit" ON)
32+
if(IEEE_SUPPRESS)
33+
set(CMAKE_Fortran_FLAGS "-ffpe-summary='none'")
34+
else(IEEE_SUPPRESS)
35+
set(CMAKE_Fortran_FLAGS "")
36+
endif(IEEE_SUPPRESS)
37+
38+
# Code to silence warnings from RANLIB on OSX
39+
# From https://stackoverflow.com/questions/4929255/building-static-libraries-on-mac-using-cmake-and-gcc
40+
if (APPLE)
41+
SET(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
42+
SET(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
43+
endif ()
44+
45+
# Check that this machine supports F90 compilation
46+
if(NOT CMAKE_Fortran_COMPILER_SUPPORTS_F90)
47+
message(FATAL_ERROR "Fortran compiler does not support F90")
48+
endif(NOT CMAKE_Fortran_COMPILER_SUPPORTS_F90)
49+
50+
if((${CMAKE_Fortran_COMPILER_ID} MATCHES Intel) OR (${CMAKE_Fortran_COMPILER_ID} MATCHES GNU))
51+
message(STATUS "Fortran compiler: ${CMAKE_Fortran_COMPILER}, ${CMAKE_Fortran_COMPILER_ID}")
52+
else()
53+
message(FATAL_ERROR "Unsupported Fortran compiler (use Intel or GNU).")
54+
endif()
55+
56+
# Set compiler flag options depending on the compiler located
57+
if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
58+
set(CMAKE_Fortran_MODDIR_FLAG "-J")
59+
# set(CMAKE_Fortran_FLAGS "")
60+
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -fcheck=all -fbacktrace -fbounds-check -Wall")
61+
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -ftree-vectorize -funroll-loops")
62+
# IFORT is currently not supported, but will be in the future
63+
#ELSEIF(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
64+
# set(CMAKE_Fortran_MODDIR_FLAG "")
65+
# set(CMAKE_Fortran_FLAGS "")
66+
# set(CMAKE_Fortran_FLAGS_DEBUG "")
67+
# set(CMAKE_Fortran_FLAGS_RELEASE "")
68+
endif()
69+
70+
# Set directories for CMake to access files
71+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
72+
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/mod)
73+
74+
# Preamble info
75+
STRING(TIMESTAMP CONFIG_DATE "%Y-%m-%d")
76+
message(STATUS "Configuring Makefiles for the FEPX software package...")
77+
message(STATUS "Built date: (${CONFIG_DATE})")
78+
message(STATUS "OS: ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}")
79+
message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}") # Need to grab input cache here?
80+
message(STATUS "Version: ${VERSION}")
81+
82+
# configure a header file to pass some of the CMake settings to the
83+
# source code
84+
configure_file(
85+
"${PROJECT_SOURCE_DIR}/fepx_config.f90.in"
86+
"${PROJECT_BINARY_DIR}/fepx_config.f90"
87+
)
88+
89+
# Add in the subdirectories and includes
90+
91+
file(GLOB fepx
92+
${PROJECT_BINARY_DIR}/fepx_config.f90
93+
fepx.f90
94+
fepx2.f90
95+
read_input/read_input.f90
96+
read_input/read_input_cfg.f90
97+
read_input/read_input_msh.f90
98+
read_input/read_input_msh2.f90
99+
read_input/boundary_conditions_mod1.f90
100+
read_input/boundary_conditions_mod2.f90
101+
read_input/boundary_conditions_mod3.f90
102+
read_input/boundary_conditions_mod2_legacy.f90
103+
read_input/read_input_mpcs/multi_point_constraints_mod1.f90
104+
read_input/read_input_mpcs/multi_point_constraints_mod2.f90
105+
general/crys_type_mod.f90
106+
general/crys_type_mod2.f90
107+
general/crys_type_mod3.f90
108+
general/general_mod.f90
109+
general/types_mod.f90
110+
general/printing_type_mod.f90
111+
general/exec_type_mod.f90
112+
general/loading_type_mod1.f90
113+
general/loading_type_mod2.f90
114+
general/loading_options_type_mod.f90
115+
general/mesh_type_mod.f90
116+
general/utils.f90
117+
general/orientation_conversion_mod.f90
118+
parallel/gather_scatter_mod.f90
119+
parallel/parallel_mod.f90
120+
res_init/res_init_mod1.f90
121+
res_init/res_init_mod2.f90
122+
123+
triaxial/driver_triaxclr_mod.f90
124+
triaxial/driver_triaxcsr_mod.f90
125+
triaxial/driver_triax_utilities_mod.f90
126+
127+
libfepx/driver_uniaxial_control_mod1.f90
128+
libfepx/driver_uniaxial_control_mod2.f90
129+
130+
libfepx/solveit_isovp/solveit_isovp_mod1.f90
131+
libfepx/solveit_isovp/solveit_isovp_mod2.f90
132+
libfepx/solveit_isovp/solveit_isovp_mod3.f90
133+
libfepx/solveit_isovp/solveit_isovp_mod4.f90
134+
135+
libfepx/solveit_evp/solveit_evp_mod1.f90
136+
libfepx/solveit_evp/solveit_evp_mod2.f90
137+
libfepx/solveit_evp/solveit_evp_mod3.f90
138+
libfepx/solveit_evp/solveit_evp_mod4.f90
139+
140+
libfepx/solveit_evp/solve_evp/solve_evp_mod1.f90
141+
libfepx/solveit_evp/solve_evp/solve_evp_mod2.f90
142+
143+
libfepx/solveit_evp/solve_evp/solve_evp_vpstress/solve_evp_vpstress_mod1.f90
144+
libfepx/solveit_evp/solve_evp/solve_evp_vpstress/solve_evp_vpstress_mod2.f90
145+
libfepx/solveit_evp/solve_evp/solve_evp_vpstress/solve_evp_vpstress_mod3.f90
146+
147+
libfepx/solveit_evp/solve_evp/solve_evp_stress/solve_evp_stress_mod1.f90
148+
libfepx/solveit_evp/solve_evp/solve_evp_stress/solve_evp_stress_mod2.f90
149+
libfepx/solveit_evp/solve_evp/solve_evp_stress/solve_evp_stress_mod3.f90
150+
151+
libfepx/solveit_evp/solve_evp/solve_evp_rstar/solve_evp_rstar_mod1.f90
152+
libfepx/solveit_evp/solve_evp/solve_evp_rstar/solve_evp_rstar_mod2.f90
153+
libfepx/solveit_evp/solve_evp/solve_evp_rstar/update_hardening/hardening_mod1.f90
154+
libfepx/solveit_evp/solve_evp/solve_evp_rstar/update_hardening/hardening_mod2.f90
155+
libfepx/solveit_evp/solve_evp/solve_evp_rstar/update_hardening/hardening_mod3.f90
156+
libfepx/solveit_evp/solve_evp/solve_evp_rstar/update_hardening/hardening_mod4.f90
157+
158+
libfepx/solveit_evp/finalize_res/finalize_res_mod1.f90
159+
160+
libfepx/restart/restart.f90
161+
162+
libfepx/aniso_vp_lag.f90
163+
libfepx/conjugate_gradient_mod.f90
164+
libfepx/kinematics_mod.f90
165+
libfepx/kinematics_mod_bis.f90
166+
167+
general/matrix_operations_mod.f90
168+
general/shape_2d_mod.f90
169+
general/shape_3d_mod.f90
170+
general/quadrature_mod.f90
171+
general/units_mod.f90
172+
173+
libfepx/stiffness_mod.f90
174+
libfepx/surf_mod.f90
175+
libfepx/write_res/write_res_mod1.f90
176+
libfepx/write_res/write_res_mod2.f90
177+
)
178+
179+
include_directories(${CMAKE_Fortran_MODULE_DIRECTORY} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
180+
181+
# Prepare MPI Fortan compiler for compilation of executable
182+
set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER})
183+
message(STATUS "Switching to MPI Fortran compiler: ${CMAKE_Fortran_COMPILER}, ${CMAKE_Fortran_COMPILER_ID}")
184+
185+
message(STATUS "Preparing executable: fepx")
186+
add_executable(fepx ${fepx})
187+
188+
189+
# Install FEPX into bin on the local machine
190+
install(TARGETS fepx DESTINATION bin
191+
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
192+
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
193+
194+
# Notify the user how to continue after `cmake ..`
195+
message(STATUS "FEPX is set to be installed in: ${CMAKE_INSTALL_PREFIX}/bin")
196+
197+
# Testing ######################################################################
198+
199+
include(CTest)
200+
201+
file(GLOB_RECURSE tests ../tests/*/*.cmake)
202+
203+
if(BUILD_TESTING)
204+
foreach(test ${tests})
205+
get_filename_component(test_name ${test} NAME)
206+
string(REPLACE ".cmake" "" test_name ${test_name})
207+
get_filename_component(test_dir ${test} DIRECTORY)
208+
get_filename_component(test_path ${test} PATH)
209+
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/../tests/" "" test_label ${test_dir})
210+
add_test(NAME ${test_label}
211+
COMMAND ${CMAKE_COMMAND}
212+
-Dtest_prog=$<TARGET_FILE:fepx>
213+
-Dtest_mode=${BUILD_TESTING_MODE}
214+
-Dtest_diff=${BUILD_TESTING_DIFF}
215+
-P ${test}
216+
WORKING_DIRECTORY ${test_dir})
217+
endforeach()
218+
endif()

0 commit comments

Comments
 (0)