2017-02-04 03:53:55 +05:30
|
|
|
# special flags for some files
|
2018-05-24 10:43:12 +05:30
|
|
|
if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
|
2016-03-05 04:02:26 +05:30
|
|
|
SET_SOURCE_FILES_PROPERTIES( "lattice.f90" PROPERTIES
|
|
|
|
COMPILE_FLAGS "-ffree-line-length-240")
|
2017-02-04 03:53:55 +05:30
|
|
|
# long lines for interaction matrix
|
2016-03-08 04:30:12 +05:30
|
|
|
endif()
|
2017-02-04 03:53:55 +05:30
|
|
|
|
2016-05-21 18:36:01 +05:30
|
|
|
# The dependency detection in CMake is not functioning for Fortran,
|
|
|
|
# hence we declare the dependencies from top to bottom in the following
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(C_ROUTINES OBJECT "C_routines.c")
|
|
|
|
set(OBJECTFILES $<TARGET_OBJECTS:C_ROUTINES>)
|
2016-05-21 18:36:01 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(SYSTEM_ROUTINES OBJECT "system_routines.f90")
|
|
|
|
add_dependencies(SYSTEM_ROUTINES C_ROUTINES)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:SYSTEM_ROUTINES>)
|
2016-05-21 18:36:01 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(PREC OBJECT "prec.f90")
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:PREC>)
|
2016-03-05 01:13:29 +05:30
|
|
|
|
2018-09-27 23:39:59 +05:30
|
|
|
add_library(QUIT OBJECT "quit.f90")
|
|
|
|
add_dependencies(QUIT PREC)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:QUIT>)
|
|
|
|
|
2018-08-20 19:39:40 +05:30
|
|
|
add_library(DAMASK_INTERFACE OBJECT "DAMASK_interface.f90")
|
2018-09-27 23:39:59 +05:30
|
|
|
add_dependencies(DAMASK_INTERFACE QUIT SYSTEM_ROUTINES)
|
2016-05-25 01:05:16 +05:30
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DAMASK_INTERFACE>)
|
2016-03-05 01:13:29 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(IO OBJECT "IO.f90")
|
|
|
|
add_dependencies(IO DAMASK_INTERFACE)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:IO>)
|
2016-03-05 01:13:29 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(NUMERICS OBJECT "numerics.f90")
|
2018-11-18 15:54:55 +05:30
|
|
|
add_dependencies(NUMERICS IO)
|
2016-05-25 01:05:16 +05:30
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:NUMERICS>)
|
2016-03-05 01:13:29 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(DEBUG OBJECT "debug.f90")
|
2018-11-18 16:02:53 +05:30
|
|
|
add_dependencies(DEBUG NUMERICS)
|
2016-05-25 01:05:16 +05:30
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DEBUG>)
|
2016-03-05 01:13:29 +05:30
|
|
|
|
2018-11-18 15:51:43 +05:30
|
|
|
add_library(DAMASK_CONFIG OBJECT "config.f90")
|
|
|
|
add_dependencies(DAMASK_CONFIG DEBUG)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DAMASK_CONFIG>)
|
2018-06-10 10:35:25 +05:30
|
|
|
|
2018-11-18 16:02:53 +05:30
|
|
|
add_library(HDF5_UTILITIES OBJECT "HDF5_utilities.f90")
|
|
|
|
add_dependencies(HDF5_UTILITIES DAMASK_CONFIG)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:HDF5_UTILITIES>)
|
|
|
|
|
|
|
|
add_library(RESULTS OBJECT "results.f90")
|
|
|
|
add_dependencies(RESULTS HDF5_UTILITIES)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:RESULTS>)
|
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(FEsolving OBJECT "FEsolving.f90")
|
2018-11-18 16:02:53 +05:30
|
|
|
add_dependencies(FEsolving RESULTS)
|
2016-05-25 01:05:16 +05:30
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:FEsolving>)
|
2016-03-05 01:13:29 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(DAMASK_MATH OBJECT "math.f90")
|
2017-02-04 03:53:55 +05:30
|
|
|
add_dependencies(DAMASK_MATH FEsolving)
|
2016-05-25 01:05:16 +05:30
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DAMASK_MATH>)
|
2016-03-05 01:13:29 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
# SPECTRAL solver and FEM solver use different mesh files
|
2018-05-24 10:43:12 +05:30
|
|
|
if (PROJECT_NAME STREQUAL "DAMASK_spectral")
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(MESH OBJECT "mesh.f90")
|
|
|
|
add_dependencies(MESH DAMASK_MATH)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:MESH>)
|
2018-05-24 10:43:12 +05:30
|
|
|
elseif (PROJECT_NAME STREQUAL "DAMASK_FEM")
|
2018-08-17 14:53:24 +05:30
|
|
|
add_library(FEZoo OBJECT "FEM_zoo.f90")
|
2016-05-25 01:05:16 +05:30
|
|
|
add_dependencies(FEZoo DAMASK_MATH)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:FEZoo>)
|
2019-01-24 14:19:21 +05:30
|
|
|
add_library(MESH OBJECT "mesh_FEM.f90")
|
2016-05-25 01:05:16 +05:30
|
|
|
add_dependencies(MESH FEZoo)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:MESH>)
|
2016-05-20 15:21:50 +05:30
|
|
|
endif()
|
2016-03-05 01:13:29 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(MATERIAL OBJECT "material.f90")
|
2018-11-18 15:51:43 +05:30
|
|
|
add_dependencies(MATERIAL MESH DAMASK_CONFIG)
|
2016-05-25 01:05:16 +05:30
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:MATERIAL>)
|
2016-03-05 01:13:29 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(DAMASK_HELPERS OBJECT "lattice.f90")
|
|
|
|
add_dependencies(DAMASK_HELPERS MATERIAL)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DAMASK_HELPERS>)
|
2016-03-05 01:13:29 +05:30
|
|
|
|
|
|
|
# For each modular section
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library (PLASTIC OBJECT
|
2016-05-21 18:36:01 +05:30
|
|
|
"plastic_dislotwin.f90"
|
|
|
|
"plastic_disloUCLA.f90"
|
|
|
|
"plastic_isotropic.f90"
|
|
|
|
"plastic_phenopowerlaw.f90"
|
2017-09-30 04:06:28 +05:30
|
|
|
"plastic_kinematichardening.f90"
|
2016-05-21 18:36:01 +05:30
|
|
|
"plastic_nonlocal.f90"
|
2017-10-08 17:11:54 +05:30
|
|
|
"plastic_none.f90")
|
2016-05-25 01:05:16 +05:30
|
|
|
add_dependencies(PLASTIC DAMASK_HELPERS)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:PLASTIC>)
|
2016-05-21 18:36:01 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library (KINEMATICS OBJECT
|
2016-05-21 18:36:01 +05:30
|
|
|
"kinematics_cleavage_opening.f90"
|
|
|
|
"kinematics_slipplane_opening.f90"
|
2018-12-22 13:30:57 +05:30
|
|
|
"kinematics_thermal_expansion.f90")
|
2016-05-25 01:05:16 +05:30
|
|
|
add_dependencies(KINEMATICS DAMASK_HELPERS)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:KINEMATICS>)
|
2016-05-21 18:36:01 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library (SOURCE OBJECT
|
2016-05-21 18:36:01 +05:30
|
|
|
"source_thermal_dissipation.f90"
|
|
|
|
"source_thermal_externalheat.f90"
|
|
|
|
"source_damage_isoBrittle.f90"
|
|
|
|
"source_damage_isoDuctile.f90"
|
|
|
|
"source_damage_anisoBrittle.f90"
|
2018-12-22 13:30:57 +05:30
|
|
|
"source_damage_anisoDuctile.f90")
|
2016-05-25 01:05:16 +05:30
|
|
|
add_dependencies(SOURCE DAMASK_HELPERS)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:SOURCE>)
|
2016-05-21 18:36:01 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(CONSTITUTIVE OBJECT "constitutive.f90")
|
|
|
|
add_dependencies(CONSTITUTIVE PLASTIC KINEMATICS SOURCE)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:CONSTITUTIVE>)
|
2016-05-21 18:36:01 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(CRYSTALLITE OBJECT "crystallite.f90")
|
|
|
|
add_dependencies(CRYSTALLITE CONSTITUTIVE)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:CRYSTALLITE>)
|
2016-05-21 18:36:01 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(HOMOGENIZATION OBJECT
|
2016-05-21 18:36:01 +05:30
|
|
|
"homogenization_RGC.f90"
|
|
|
|
"homogenization_isostrain.f90"
|
|
|
|
"homogenization_none.f90")
|
2016-05-25 01:05:16 +05:30
|
|
|
add_dependencies(HOMOGENIZATION CRYSTALLITE)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:HOMOGENIZATION>)
|
2016-05-21 18:36:01 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(DAMAGE OBJECT
|
2016-05-21 18:36:01 +05:30
|
|
|
"damage_none.f90"
|
|
|
|
"damage_local.f90"
|
|
|
|
"damage_nonlocal.f90")
|
2016-05-25 01:05:16 +05:30
|
|
|
add_dependencies(DAMAGE CRYSTALLITE)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DAMAGE>)
|
2016-05-21 18:36:01 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(THERMAL OBJECT
|
2016-05-21 18:36:01 +05:30
|
|
|
"thermal_isothermal.f90"
|
|
|
|
"thermal_adiabatic.f90"
|
|
|
|
"thermal_conduction.f90")
|
2016-05-25 01:05:16 +05:30
|
|
|
add_dependencies(THERMAL CRYSTALLITE)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:THERMAL>)
|
2016-03-05 01:13:29 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(DAMASK_ENGINE OBJECT "homogenization.f90")
|
2018-12-22 13:30:57 +05:30
|
|
|
add_dependencies(DAMASK_ENGINE THERMAL DAMAGE HOMOGENIZATION)
|
2016-05-25 01:05:16 +05:30
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DAMASK_ENGINE>)
|
2016-05-21 18:36:01 +05:30
|
|
|
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(DAMASK_CPFE OBJECT "CPFEM2.f90")
|
|
|
|
add_dependencies(DAMASK_CPFE DAMASK_ENGINE)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:DAMASK_CPFE>)
|
2016-05-21 18:36:01 +05:30
|
|
|
|
2018-05-24 10:43:12 +05:30
|
|
|
if (PROJECT_NAME STREQUAL "DAMASK_spectral")
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(SPECTRAL_UTILITIES OBJECT "spectral_utilities.f90")
|
|
|
|
add_dependencies(SPECTRAL_UTILITIES DAMASK_CPFE)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:SPECTRAL_UTILITIES>)
|
|
|
|
|
|
|
|
add_library(SPECTRAL_SOLVER OBJECT
|
|
|
|
"spectral_thermal.f90"
|
|
|
|
"spectral_damage.f90"
|
|
|
|
"spectral_mech_Polarisation.f90"
|
|
|
|
"spectral_mech_Basic.f90")
|
|
|
|
add_dependencies(SPECTRAL_SOLVER SPECTRAL_UTILITIES)
|
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:SPECTRAL_SOLVER>)
|
2018-08-18 19:28:42 +05:30
|
|
|
|
2018-05-24 10:43:12 +05:30
|
|
|
if(NOT CMAKE_BUILD_TYPE STREQUAL "SYNTAXONLY")
|
2017-02-04 05:31:42 +05:30
|
|
|
add_executable(DAMASK_spectral "DAMASK_spectral.f90" ${OBJECTFILES})
|
2017-05-25 01:46:35 +05:30
|
|
|
else()
|
|
|
|
add_library(DAMASK_spectral OBJECT "DAMASK_spectral.f90")
|
2017-02-04 05:31:42 +05:30
|
|
|
endif()
|
2018-08-18 19:28:42 +05:30
|
|
|
|
2017-05-25 01:46:35 +05:30
|
|
|
add_dependencies(DAMASK_spectral SPECTRAL_SOLVER)
|
2018-05-24 10:43:12 +05:30
|
|
|
elseif (PROJECT_NAME STREQUAL "DAMASK_FEM")
|
2016-05-25 01:05:16 +05:30
|
|
|
add_library(FEM_UTILITIES OBJECT "FEM_utilities.f90")
|
|
|
|
add_dependencies(FEM_UTILITIES DAMASK_CPFE)
|
2018-08-18 19:28:42 +05:30
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:FEM_UTILITIES>)
|
2016-05-25 01:05:16 +05:30
|
|
|
|
|
|
|
add_library(FEM_SOLVER OBJECT
|
|
|
|
"FEM_mech.f90")
|
|
|
|
add_dependencies(FEM_SOLVER FEM_UTILITIES)
|
2018-08-18 19:28:42 +05:30
|
|
|
list(APPEND OBJECTFILES $<TARGET_OBJECTS:FEM_SOLVER>)
|
2016-03-05 01:13:29 +05:30
|
|
|
|
2018-08-18 19:28:42 +05:30
|
|
|
add_executable(DAMASK_FEM "DAMASK_FEM.f90" ${OBJECTFILES})
|
2016-05-25 01:05:16 +05:30
|
|
|
add_dependencies(DAMASK_FEM FEM_SOLVER)
|
2016-05-21 18:36:01 +05:30
|
|
|
endif()
|