Merge branch 'development' into user_defined_add_calculation

This commit is contained in:
Martin Diehl 2020-07-31 16:15:31 +02:00
commit aadce1e554
131 changed files with 28419 additions and 2950 deletions

View File

@ -50,7 +50,6 @@ variables:
# Names of module files to load
# ===============================================================================================
# ++++++++++++ Compiler +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
IntelCompiler16_4: "Compiler/Intel/16.4 Libraries/IMKL/2016"
IntelCompiler17_8: "Compiler/Intel/17.8 Libraries/IMKL/2017"
IntelCompiler18_4: "Compiler/Intel/18.4 Libraries/IMKL/2018"
GNUCompiler8_2: "Compiler/GNU/8.2"
@ -70,10 +69,9 @@ variables:
PETSc_MPICH_Intel: "$PETSc3_10_3IMPI2018Intel18_4"
PETSc_MPICH_GNU: "$PETSc3_10_3MPICH3_3GNU8_2"
# ++++++++++++ commercial FEM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MSC2018_1: "FEM/MSC/2018.1"
MSC2019: "FEM/MSC/2019"
MSC2019_1: "FEM/MSC/2019.1"
# ------------ Defaults ----------------------------------------------
MSC: "$MSC2019"
MSC: "$MSC2019_1"
IntelMarc: "$IntelCompiler17_8"
HDF5Marc: "HDF5/1.10.5/Intel-17.8"
# ++++++++++++ Documentation ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

@ -1 +1 @@
Subproject commit 464a0ebaf2e842d50d84a32c740638b25ae11354
Subproject commit 3fc9d58a35614fd8ffa1179e634431eb457d0150

View File

@ -1 +1 @@
v2.0.3-2783-g1a8feab2
v2.0.3-2936-gade87308

6
env/CONFIG vendored
View File

@ -1,5 +1,5 @@
# "set"-syntax needed only for tcsh (but works with bash and zsh)
set DAMASK_NUM_THREADS = 4
set DAMASK_NUM_THREADS = 4
set MSC_ROOT = /opt/msc
set MARC_VERSION = 2019
set MSC_ROOT = /opt/msc
set MARC_VERSION = 2019.1

6
env/DAMASK.csh vendored
View File

@ -9,8 +9,8 @@ source $ENV_ROOT/CONFIG
set path = ($DAMASK_ROOT/bin $path)
set SOLVER=`which DAMASK_spectral`
if ( "x$DAMASK_NUM_THREADS" == "x" ) then
set SOLVER=`which DAMASK_grid`
if ( "x$DAMASK_NUM_THREADS" == "x" ) then
set DAMASK_NUM_THREADS=1
endif
@ -30,7 +30,7 @@ if ( $?prompt ) then
echo
echo Using environment with ...
echo "DAMASK $DAMASK_ROOT"
echo "Grid Solver $SOLVER"
echo "Grid Solver $SOLVER"
if ( $?PETSC_DIR) then
echo "PETSc location $PETSC_DIR"
endif

4
env/DAMASK.sh vendored
View File

@ -35,7 +35,7 @@ cd $DAMASK_ROOT >/dev/null; BRANCH=$(git branch 2>/dev/null| grep -E '^\* '); cd
PATH=${DAMASK_ROOT}/bin:$PATH
SOLVER=$(type -p DAMASK_spectral || true 2>/dev/null)
SOLVER=$(type -p DAMASK_grid || true 2>/dev/null)
[ "x$SOLVER" == "x" ] && SOLVER=$(blink 'Not found!')
[ "x$DAMASK_NUM_THREADS" == "x" ] && DAMASK_NUM_THREADS=1
@ -56,7 +56,7 @@ if [ ! -z "$PS1" ]; then
echo
echo Using environment with ...
echo "DAMASK $DAMASK_ROOT $BRANCH"
echo "Grid Solver $SOLVER"
echo "Grid Solver $SOLVER"
if [ "x$PETSC_DIR" != "x" ]; then
echo -n "PETSc location "
[ -d $PETSC_DIR ] && echo $PETSC_DIR || blink $PETSC_DIR

4
env/DAMASK.zsh vendored
View File

@ -27,7 +27,7 @@ cd $DAMASK_ROOT >/dev/null; BRANCH=$(git branch 2>/dev/null| grep -E '^\* '); cd
PATH=${DAMASK_ROOT}/bin:$PATH
SOLVER=$(which DAMASK_spectral || true 2>/dev/null)
SOLVER=$(which DAMASK_grid || true 2>/dev/null)
[[ "x$SOLVER" == "x" ]] && SOLVER=$(blink 'Not found!')
[[ "x$DAMASK_NUM_THREADS" == "x" ]] && DAMASK_NUM_THREADS=1
@ -48,7 +48,7 @@ if [ ! -z "$PS1" ]; then
echo
echo "Using environment with ..."
echo "DAMASK $DAMASK_ROOT $BRANCH"
echo "Grid Solver $SOLVER"
echo "Grid Solver $SOLVER"
if [ "x$PETSC_DIR" != "x" ]; then
echo -n "PETSc location "
[ -d $PETSC_DIR ] && echo $PETSC_DIR || blink $PETSC_DIR

View File

@ -1,24 +0,0 @@
### debugging parameters ###
# example:
# --------
# mesh basic extensive # switches on the "basic" and "extensive" debugging in mesh-related functions/subroutines
#
debug # debug.f90, possible values: basic, extensive
math # math.f90, possible value: basic
FEsolving # FEsolving.f90, possible value: basic
mesh # mesh.f90, possible value: basic, extensive
material # material.f90, possible values: basic, extensive
lattice # lattice.f90, possible value: basic
constitutive # constitutive_*.f90 possible values: basic, extensive, selective
crystallite # crystallite.f90 possible values: basic, extensive, selective
homogenization # homogenization_*.f90 possible values: basic, extensive, selective
CPFEM # CPFEM.f90 possible values: basic, extensive, selective
spectral # DAMASK_spectral.f90 possible values: basic, fft, restart, divergence, rotation, petsc
marc # MSC.MARC FEM solver possible values: basic
#
# Parameters for selective
element 1 # selected element for debugging (synonymous: "el", "e")
integrationpoint 1 # selected integration point for debugging (synonymous: "ip", "i")
grain 1 # selected grain at ip for debugging (synonymous: "gr", "g")

View File

@ -0,0 +1,20 @@
### debugging parameters ###
## case sensitive keys
# example:
# --------
# mesh: [basic, extensive] # switches on the "basic" and "extensive" debugging in mesh-related functions/subroutines
#
mesh: [basic,extensive] # mesh.f90, possible value: basic, extensive
material: [basic, extensive] # material.f90, possible values: basic, extensive
constitutive: [basic, extensive, selective] # constitutive_*.f90 possible values: basic, extensive, selective
crystallite: [basic, extensive, selective] # crystallite.f90 possible values: basic, extensive, selective
homogenization: [basic, extensive, selective] # homogenization_*.f90 possible values: basic, extensive, selective
cpfem: [basic, extensive, selective] # CPFEM.f90 possible values: basic, extensive, selective
grid: [basic, fft, restart, divergence, rotation, petsc] # DAMASK_spectral.f90 possible values: basic, fft, restart, divergence, rotation, petsc
marc: [basic] # MSC.MARC FEM solver possible values: basic
#
# Parameters for selective
element: 1 # selected element for debugging
integrationpoint: 1 # selected integration point for debugging
grain: 1 # selected grain at ip for debugging

View File

@ -1,75 +0,0 @@
### numerical parameters ###
relevantStrain 1.0e-7 # strain increment considered significant (used by crystallite to determine whether strain inc is considered significant)
defgradTolerance 1.0e-7 # deviation of deformation gradient that is still allowed (used by CPFEM to determine outdated ffn1)
iJacoStiffness 1 # frequency of stiffness update
iJacoLpresiduum 1 # frequency of Jacobian update of residuum in Lp
pert_Fg 1.0e-7 # deformation gradient perturbation for grain tangent
pert_method 1 # perturbation method (1 = forward, 2 = backward or 3 = central)
integrator 1 # integration method (1 = Fixed Point Iteration, 2 = Euler, 3 = Adaptive Euler, 4 = classical 4th order Runge-Kutta, 5 = 5th order Runge-Kutta Cash-Karp)
integratorStiffness 1 # integration method used for stiffness (1 = Fixed Point Iteration, 2 = Euler, 3 = Adaptive Euler, 4 = classical 4th order Runge-Kutta, 5 = 5th order Runge-Kutta Cash-Karp)
unitlength 1 # physical length of one computational length unit
usepingpong 1 # use the ping pong (collect <-> calc) scheme
## crystallite numerical parameters ##
nCryst 20 # crystallite loop limit (only for debugging info, loop limit is determined by "subStepMinCryst")
subStepMinCryst 1.0e-3 # minimum (relative) size of sub-step allowed during cutback in crystallite
subStepSizeCryst 0.25 # size of substep when cutback introduced in crystallite (value between 0 and 1)
stepIncreaseCryst 1.5 # increase of next substep size when previous substep converged in crystallite (value higher than 1)
nState 10 # state loop limit
nStress 40 # stress loop limit
rTol_crystalliteState 1.0e-6 # relative tolerance in crystallite state loop (abs tol provided by constitutive law)
rTol_crystalliteStress 1.0e-6 # relative tolerance in crystallite stress loop (Lp residuum)
aTol_crystalliteStress 1.0e-8 # absolute tolerance in crystallite stress loop (Lp residuum!)
rTol_crystalliteTemperature 1.0e-6 # relative tolerance in crystallite state/temperature loop
## homogenization numerical parameters ##
nHomog 20 # homogenization loop limit (only for debugging info, loop limit is determined by "subStepMinHomog")
subStepMinHomog 1.0e-3 # minimum (relative) size of sub-step allowed during cutback in homogenization
subStepSizeHomog 0.25 # size of substep when cutback introduced in homogenization (value between 0 and 1)
stepIncreaseHomog 1.5 # increase of next substep size when previous substep converged in homogenization (value higher than 1)
nMPstate 10 # materialpoint state loop limit
## RGC scheme numerical parameters ##
aTol_RGC 1.0e+4 # absolute tolerance of RGC residuum (in Pa)
rTol_RGC 1.0e-3 # relative ...
aMax_RGC 1.0e+10 # absolute upper-limit of RGC residuum (in Pa)
rMax_RGC 1.0e+2 # relative ...
perturbPenalty_RGC 1.0e-7 # perturbation for computing penalty tangent
maxRelaxation_RGC 1.0e+0 # threshold of maximum relaxation vector increment (if exceed this then cutback)
relevantMismatch_RGC 1.0e-5 # minimum threshold of mismatch
viscosityPower_RGC 1.0e+0 # power (sensitivity rate) of numerical viscosity in RGC scheme
viscosityModulus_RGC 0.0e+0 # stress modulus of RGC numerical viscosity (zero = without numerical viscosity)
# suggestion: larger than the aTol_RGC but still far below the expected flow stress of material
refRelaxationRate_RGC 1.0e-3 # reference rate of relaxation (about the same magnitude as straining rate, possibly a bit higher)
maxVolDiscrepancy_RGC 1.0e-5 # maximum allowable relative volume discrepancy
volDiscrepancyMod_RGC 1.0e+12
discrepancyPower_RGC 5.0
random_seed 0 # any integer larger than zero seeds the random generator, otherwise random seeding
## spectral parameters ##
err_div_tolAbs 1.0e-3 # absolute tolerance for fulfillment of stress equilibrium
err_div_tolRel 5.0e-4 # relative tolerance for fulfillment of stress equilibrium
err_curl_tolAbs 1.0e-12 # absolute tolerance for fulfillment of strain compatibility
err_curl_tolRel 5.0e-4 # relative tolerance for fulfillment of strain compatibility
err_stress_tolAbs 1.0e3 # absolute tolerance for fulfillment of stress BC
err_stress_tolRel 0.01 # relative tolerance for fulfillment of stress BC
fftw_timelimit -1.0 # timelimit of plan creation for FFTW, see manual on www.fftw.org, Default -1.0: disable timelimit
rotation_tol 1.0e-12 # tolerance of rotation specified in loadcase, Default 1.0e-12: first guess
fftw_plan_mode FFTW_PATIENT # reads the planing-rigor flag, see manual on www.fftw.org, Default FFTW_PATIENT: use patient planner flag
itmax 250 # Maximum iteration number
itmin 2 # Minimum iteration number
maxCutBack 3 # maximum cut back level (0: 1, 1: 0.5, 2: 0.25, etc)
memory_efficient 1 # Precalculate Gamma-operator (81 double per point)
update_gamma 0 # Update Gamma-operator with current dPdF (not possible if memory_efficient=1)
divergence_correction 2 # Use size-independent divergence criterion
spectralsolver basicPETSc # Type of spectral solver (basicPETSc/polarisation)
spectralfilter none # Type of filtering method to mitigate Gibb's phenomenon (none, cosine, ...)
petsc_options -snes_type ngmres -snes_ngmres_anderson # PetSc solver options
regridMode 0 # 0: no regrid; 1: regrid if DAMASK doesn't converge; 2: regrid if DAMASK or BVP Solver doesn't converge
polarAlpha 1.0 # polarization scheme parameter 0.0 < alpha < 2.0. alpha = 1.0 ==> AL scheme, alpha = 2.0 ==> accelerated scheme
polarBeta 1.0 # polarization scheme parameter 0.0 < beta < 2.0. beta = 1.0 ==> AL scheme, beta = 2.0 ==> accelerated scheme

View File

@ -0,0 +1,89 @@
# Available numerical parameters
# Case sensitive keys
homogenization:
mech:
RGC:
atol: 1.0e+4 # absolute tolerance of RGC residuum (in Pa)
rtol: 1.0e-3 # relative ...
amax: 1.0e+10 # absolute upper-limit of RGC residuum (in Pa)
rmax: 1.0e+2 # relative ...
perturbpenalty: 1.0e-7 # perturbation for computing penalty tangent
relevantmismatch: 1.0e-5 # minimum threshold of mismatch
viscositypower: 1.0e+0 # power (sensitivity rate) of numerical viscosity in RGC scheme
viscositymodulus: 0.0e+0 # stress modulus of RGC numerical viscosity (zero = without numerical viscosity)
# suggestion: larger than the aTol_RGC but still far below the expected flow stress of material
refrelaxationrate: 1.0e-3 # reference rate of relaxation (about the same magnitude as straining rate, possibly a bit higher)
maxrelaxationrate: 1.0e+0 # threshold of maximum relaxation vector increment (if exceed this then cutback)
maxvoldiscrepancy: 1.0e-5 # maximum allowable relative volume discrepancy
voldiscrepancymod: 1.0e+12
discrepancypower: 5.0
generic:
subStepMin: 1.0e-3 # minimum (relative) size of sub-step allowed during cutback in homogenization
subStepSize: 0.25 # size of substep when cutback introduced in homogenization (value between 0 and 1)
stepIncrease: 1.5 # increase of next substep size when previous substep converged in homogenization (value higher than 1)
nMPstate: 10 # materialpoint state loop limit
grid:
eps_div_atol: 1.0e-3 # absolute tolerance for fulfillment of stress equilibrium
eps_div_rtol: 5.0e-4 # relative tolerance for fulfillment of stress equilibrium
eps_curl_atol: 1.0e-12 # absolute tolerance for fulfillment of strain compatibility
eps_curl_rtol: 5.0e-4 # relative tolerance for fulfillment of strain compatibility
eps_stress_atol: 1.0e3 # absolute tolerance for fulfillment of stress BC
eps_stress_rtol: 0.01 # relative tolerance for fulfillment of stress BC
eps_damage_atol: 1.0e-2 # absolute tolerance for damage evolution
eps_damage_rtol: 1.0e-6 # relative tolerance for damage evolution
eps_thermal_atol: 1.0e-2 # absolute tolerance for thermal equilibrium
eps_thermal_rtol: 1.0e-6 # relative tolerance for thermal equilibrium
itmax: 250 # Maximum iteration number
itmin: 2 # Minimum iteration number
fftw_timelimit: -1.0 # timelimit of plan creation for FFTW, see manual on www.fftw.org, Default -1.0: disable timelimit
fftw_plan_mode: FFTW_PATIENT # reads the planing-rigor flag, see manual on www.fftw.org, Default FFTW_PATIENT: use patient planner flag
maxCutBack: 3 # maximum cut back level (0: 1, 1: 0.5, 2: 0.25, etc)
maxStaggeredIter: 10 # max number of field level staggered iterations
memory_efficient: 1 # Precalculate Gamma-operator (81 double per point)
update_gamma: false # Update Gamma-operator with current dPdF (not possible if memory_efficient=1)
divergence_correction: 2 # Use size-independent divergence criterion
derivative: continuous # Approximation used for derivatives in Fourier space
solver: Basic # Type of spectral solver (BasicPETSc/Polarisation/FEM)
petsc_options: -snes_type ngmres -snes_ngmres_anderson # PetSc solver options
alpha: 1.0 # polarization scheme parameter 0.0 < alpha < 2.0. alpha = 1.0 ==> AL scheme, alpha = 2.0 ==> accelerated scheme
beta: 1.0 # polarization scheme parameter 0.0 < beta < 2.0. beta = 1.0 ==> AL scheme, beta = 2.0 ==> accelerated scheme
mesh:
maxCutBack: 3 # maximum cut back level (0: 1, 1: 0.5, 2: 0.25, etc)
maxStaggeredIter: 10 # max number of field level staggered iterations
structorder: 2 # order of displacement shape functions (when mesh is defined)
bbarstabilisation: false
integrationorder: 2 # order of quadrature rule required (when mesh is defined)
itmax: 250 # Maximum iteration number
itmin: 2 # Minimum iteration number
eps_struct_atol: 1.0e-10 # absolute tolerance for mechanical equilibrium
eps_struct_rtol: 1.0e-4 # relative tolerance for mechanical equilibrium
crystallite:
subStepMin: 1.0e-3 # minimum (relative) size of sub-step allowed during cutback in crystallite
subStepSize: 0.25 # size of substep when cutback introduced in crystallite (value between 0 and 1)
stepIncrease: 1.5 # increase of next substep size when previous substep converged in crystallite (value higher than 1)
subStepSizeLp: 0.5 # size of first substep when cutback in Lp calculation
subStepSizeLi: 0.5 # size of first substep when cutback in Li calculation
nState: 10 # state loop limit
nStress: 40 # stress loop limit
rtol_State: 1.0e-6 # relative tolerance in crystallite state loop (abs tol provided by constitutive law)
rtol_Stress: 1.0e-6 # relative tolerance in crystallite stress loop (Lp residuum)
atol_Stress: 1.0e-8 # absolute tolerance in crystallite stress loop (Lp residuum!)
integrator: FPI # integration method (FPI = Fixed Point Iteration, Euler = Euler, AdaptiveEuler = Adaptive Euler, RK4 = classical 4th order Runge-Kutta, RKCK45 = 5th order Runge-Kutta Cash-Karp)
iJacoLpresiduum: 1 # frequency of Jacobian update of residuum in Lp
commercialFEM:
ijacostiffness: 1 # frequency of stiffness update
unitlength: 1 # physical length of one computational length unit
generic:
charLength: 1.0 # characteristic length scale for gradient problems.
random_seed: 0 # fixed seeding for pseudo-random number generator, Default 0: use random seed.
residualStiffness: 1.0e-6 # non-zero residual damage.

View File

@ -2,7 +2,7 @@
# Header: Project1::test1000::All data::Binned: Size=5.0, HW=5.0 4/15/2015
# Bin Size: 5.0º
# Gaussian Smoothing: 5.0º
phi1 Phi phi2 intensity
1_euler 2_euler 3_euler intensity
2.50 2.50 2.50 0.980476
2.50 2.50 7.50 0.773179
2.50 2.50 12.50 0.393272

View File

@ -1,2 +0,0 @@
itmin 4
itmax 40

View File

@ -0,0 +1,3 @@
grid:
itmin: 4
itmax: 40

View File

@ -49,4 +49,5 @@ echo "program: $program"
exit 1
}
/bin/rm $userobj
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.smod

View File

@ -49,4 +49,5 @@ echo "program: $program"
exit 1
}
/bin/rm $userobj
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.smod

View File

@ -49,4 +49,5 @@ echo "program: $program"
exit 1
}
/bin/rm $userobj
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.smod

View File

@ -63,7 +63,7 @@
# =1, element storage out-of-core #
# -dll run marc using shared library libmarc.so and exe_marc #
# =1, used #
# =2, do not free streaming input memory #
# =2, do not free streaming input memory #
# =3, run with marc input deck #
# -trk run marc for post-tracking #
# -gpuid run marc using GPGPU capability #
@ -177,16 +177,16 @@ fi
# MARC_MODE i8
# it can also be set by the environmental variable MARC_INTEGER_SIZE
# and by the command line option "-mo"
#
#
mode=
modeerror=
modeoption=
if test -f $DIRSCRIPT/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
echo
line=
fi
line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults`
@ -203,7 +203,7 @@ fi
if test -f $HOME/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $HOME/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
line=
@ -226,7 +226,7 @@ if test -z "$mode" ; then
mode=i8
fi
case $mode in
i4)
i4)
modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported."
modeoption=error
echo $modeerror
@ -246,7 +246,7 @@ for arg in $* ; do
if $setmode ; then
mode=$arg
case $mode in
i4)
i4)
modeerror="bad value for mode option; only i8 is supported."
modeoption=error
echo
@ -269,7 +269,7 @@ for arg in $* ; do
setmode=false
fi
if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then
echo
echo
echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available
echo
setmode=true
@ -333,7 +333,7 @@ case "`echo '\c'`" in
;;
esac
#
#
# Variables for the MARC environment
#
@ -388,7 +388,7 @@ LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH
export LD_LIBRARY_PATH
export LD_LIBRARY64_PATH
export LD_LIBRARYN32_PATH
atexit() {
kill -15 $$
#
@ -498,7 +498,7 @@ MDSRCLIB=$MARC_LIB/mdsrc.a
# or in the user's home directory
# format:
# MARC_MPI <mpiversion>
#
#
value=
file=
if test -f $DIRSCRIPT/run_marc_defaults; then
@ -523,7 +523,7 @@ if test -n "$value"; then
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
@ -543,7 +543,7 @@ if test -n "$value"; then
fi
fi
fi
#
#
#
# allow scratch directory to be specified with environmental variable
# MARCSCRATCH
@ -613,7 +613,7 @@ do
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
;;
-r* | -R*)
rid=`$BASENAME $value .t08`
@ -624,7 +624,7 @@ do
*)
DIRRID=`pwd`/$DIRRID
;;
esac
esac
;;
-si* | -SI*)
sid=$value
@ -635,7 +635,7 @@ do
*)
DIRSID=`pwd`/$DIRSID
;;
esac
esac
;;
-pi* | -PI*)
if test -f $value.t19
@ -651,7 +651,7 @@ do
*)
DIRPID=`pwd`/$DIRPID
;;
esac
esac
;;
-bdf | -BDF)
makebdf=1
@ -665,7 +665,7 @@ do
*)
DIRDID=`pwd`/$DIRDID
;;
esac
esac
;;
-vf | -VF)
vid=`$BASENAME $value .vfs`
@ -676,7 +676,7 @@ do
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
-u* | -U*)
user=$value
@ -847,7 +847,7 @@ do
*)
DIRSCR=`pwd`/$DIRSCR
;;
esac
esac
;;
-ho* | -HO*)
host=$value
@ -898,7 +898,7 @@ fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -934,7 +934,7 @@ fi
ntprint=$nt
nteprint=$nte
# copy from -nprocd[s]
if test $nprocdddm -gt 1
if test $nprocdddm -gt 1
then
nteprint=$nprocdddm
fi
@ -943,7 +943,7 @@ if test $nte -ne 0
then
nteprint=$nte
fi
# check for minimum 1 threads per processes for DDM
# check for minimum 1 threads per processes for DDM
if test $nprocdddm -gt 1
then
if test $nteprint -lt $nprocdddm
@ -998,24 +998,24 @@ export OMP_STACKSIZE=7M
# deprecate -nthread option at arugment of marc
nt=0
# Reset nprocdddmm, nsolver and threads if not given.
if test $nprocdddm -eq 0
then
if test $nprocdddm -eq 0
then
nprocdarg=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddmprint=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddm=
fi
fi
nsolverprint=$nsolver
if test $nsolver -eq 0
then
if test $nsolver -eq 0
then
nsolverprint=
fi
fi
# end of threads setting.
gpuoption=
if test "$gpuids" = "" ; then
@ -1030,7 +1030,7 @@ else
MARCCUDALIBS=$MARCCUDALIBS2
export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH
fi
# Linux 64 + HPMPI, Below code is taken from include_linux64
# Linux 64 + HPMPI, Below code is taken from include_linux64
if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64"
then
export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
@ -1059,7 +1059,7 @@ if test "$dllrun" -gt 0; then
fi
if test "$progdll"; then
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
rmdll=yes
pathdll=yes
progdll=${progdll}_$marcdll
@ -1093,14 +1093,14 @@ while test forever; do
if test $nprocdddm -gt 1 -a $icreated -eq 0; then
if test ! -f $DIRJID/1$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/1$jid$dotdat not accessible"
fi
fi
else
if test ! -f $DIRJID/$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/$jid$dotdat not accessible"
fi
fi
@ -1108,7 +1108,7 @@ fi
if test $nprocd -gt 1; then
if test "$host" ; then
if test ! -f $host; then
error="$error
error="$error
host name file $host not accessible"
fi
fi
@ -1222,11 +1222,11 @@ view factor file $DIRVID/$vid.vfs not accessible"
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)"
fi
fi
@ -1291,7 +1291,7 @@ defaults file $DIRDID/$did$dotdat not accessible"
then
if test $nauto -gt 2
then
error="$error
error="$error
incorrect option for auto restart "
fi
fi
@ -1299,7 +1299,7 @@ incorrect option for auto restart "
then
if test $ndcoup -gt 3
then
error="$error
error="$error
incorrect option for contact decoupling "
fi
fi
@ -1307,7 +1307,7 @@ incorrect option for contact decoupling "
then
if test $ndytran -gt 1
then
error="$error
error="$error
incorrect option for Marc-Dytran Switch "
fi
fi
@ -1315,7 +1315,7 @@ incorrect option for Marc-Dytran Switch "
then
if test ! -x $MARC_BIN/$exefile
then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE "
fi
fi
@ -1642,7 +1642,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
fi
$ECHO "User subroutine name ($user)? $ECHOTXT"
read value
@ -1660,7 +1660,7 @@ Program name ($prog)? $ECHOTXT"
*)
user=`pwd`/$user
;;
esac
esac
usernoext=$user
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F`
@ -1783,7 +1783,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
esac
fi
@ -1825,7 +1825,7 @@ Program name ($prog)? $ECHOTXT"
fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -1975,7 +1975,7 @@ Program name ($prog)? $ECHOTXT"
then
qid=$value
fi
case $qid in
case $qid in
s* | S* | l* | L* | v* | V* )
$ECHO "Queue priority ($priority)? $ECHOTXT"
read value
@ -2039,42 +2039,42 @@ esac
done
#
if test $nt -eq 0
then
if test $nt -eq 0
then
ntarg=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
ntprint=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
nt=
fi
if test $nte -eq 0
then
if test $nte -eq 0
then
ntearg=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nteprint=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nte=
fi
if test $nts -eq 0
then
if test $nts -eq 0
then
ntsarg=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
ntsprint=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
nts=
fi
#
@ -2327,7 +2327,7 @@ fi
execpath=$usernoext.marc
usersub=1
fi
export execpath
export execpath
execname=`$BASENAME $execpath`
if test "$host"
@ -2360,7 +2360,7 @@ fi
exit 1
fi
# check for Myrinet that the number of processes per host is
# check for Myrinet that the number of processes per host is
# less than number of available user ports, 5
# .gmpi directory must exist in user's home directory
# and must have write permission from remote hosts
@ -2474,9 +2474,9 @@ fi
then
# Intel MPI
if test -f $jid.mfile
then
then
/bin/rm $jid.mfile 2> /dev/null
fi
fi
/bin/cp $host $jid.host
grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile
# end Intel MPI for DMP
@ -2560,7 +2560,7 @@ fi
else
host=$jid.host
host_filt=$host
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
then
host_filt=$jid.mfile
fi
@ -2569,7 +2569,7 @@ fi
# or distributed and set the variable "dirstatus" accordingly.
# only perform the check if user subroutine is used
# or a user subroutine executable is used
numfield=1
if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware
then
@ -2729,7 +2729,7 @@ fi
fi
# modify new host file if NFS mounted heterogeneous machine
doit=
if test $program = $prog.marc
if test $program = $prog.marc
then
doit=yes
fi
@ -2753,23 +2753,23 @@ if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \
printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
/bin/mv $jid.host{$$} $jid.host
host=$jid.host
fi
fi
fi
done
done
fi
fi # if test $program = $prog.marc -o $user -o $obj
else # if test $host
# assume shared memory machine if no hostfile given and
# MPITYPE is set to mpich or Myrinet
# check for Myrinet that the total number of processes is
# check for Myrinet that the total number of processes is
# less than number of available user ports, 5
if test $MPITYPE = "mpich" -o $MPITYPE = "scali"
then
numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'`
echo `hostname` $numproc $execpath > $jid.host
host=$jid.host
elif test $MPITYPE = "myrinet"
elif test $MPITYPE = "myrinet"
then
if test $nprocd -gt 5
then
@ -2809,7 +2809,7 @@ printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
fi # if test $host
fi # if test $nprocd -gt 1
fi # if test $program = $exefile -o $program = $prog.marc
##############################################################################
@ -2859,7 +2859,7 @@ else
nsolverarg="$nsolverarg $nsolver"
fi
if test $nprocdddm -lt 2 -a $nsolver -eq 0
then
then
nprocd=0
fi
if test $nprocd -gt 0
@ -2870,7 +2870,7 @@ then
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -2975,7 +2975,7 @@ $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB "
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -3267,6 +3267,7 @@ else
fi
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3309,7 +3310,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
fi
else
if test $cpdll = yes; then
@ -3318,10 +3319,10 @@ else
fi
if test $rmdll = yes
then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
then
numdom=$nprocdddm
@ -3389,15 +3390,15 @@ else
#
QUENAME=qsub
SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid"
if test "$priority"
if test "$priority"
then
SUBMCMD=$SUBMCMD" -p $priority"
fi
if test "$att"
if test "$att"
then
SUBMCMD=$SUBMCMD" -a $att"
fi
if test "$cpu"
if test "$cpu"
then
SUBMCMD=$SUBMCMD" -lt $cpu"
fi
@ -3579,7 +3580,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3599,6 +3600,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3647,7 +3649,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
# for network run, remove executable on remote machines
# and executables with modified name
if test $nprocd -gt 1
@ -3696,7 +3698,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
@ -3913,7 +3915,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3933,6 +3935,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
# done if no job id given
if test -z "$jid"
then
@ -3972,7 +3975,7 @@ if test $ddm_arc -gt 0; then
RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc "
fi
$RUN_JOB
$RUN_JOB
if test $nprocd -gt 1
then
@ -4055,7 +4058,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi

View File

@ -63,7 +63,7 @@
# =1, element storage out-of-core #
# -dll run marc using shared library libmarc.so and exe_marc #
# =1, used #
# =2, do not free streaming input memory #
# =2, do not free streaming input memory #
# =3, run with marc input deck #
# -trk run marc for post-tracking #
# -gpuid run marc using GPGPU capability #
@ -177,16 +177,16 @@ fi
# MARC_MODE i8
# it can also be set by the environmental variable MARC_INTEGER_SIZE
# and by the command line option "-mo"
#
#
mode=
modeerror=
modeoption=
if test -f $DIRSCRIPT/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
echo
line=
fi
line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults`
@ -203,7 +203,7 @@ fi
if test -f $HOME/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $HOME/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
line=
@ -226,7 +226,7 @@ if test -z "$mode" ; then
mode=i8
fi
case $mode in
i4)
i4)
modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported."
modeoption=error
echo $modeerror
@ -246,7 +246,7 @@ for arg in $* ; do
if $setmode ; then
mode=$arg
case $mode in
i4)
i4)
modeerror="bad value for mode option; only i8 is supported."
modeoption=error
echo
@ -269,7 +269,7 @@ for arg in $* ; do
setmode=false
fi
if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then
echo
echo
echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available
echo
setmode=true
@ -333,7 +333,7 @@ case "`echo '\c'`" in
;;
esac
#
#
# Variables for the MARC environment
#
@ -388,7 +388,7 @@ LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH
export LD_LIBRARY_PATH
export LD_LIBRARY64_PATH
export LD_LIBRARYN32_PATH
atexit() {
kill -15 $$
#
@ -498,7 +498,7 @@ MDSRCLIB=$MARC_LIB/mdsrc.a
# or in the user's home directory
# format:
# MARC_MPI <mpiversion>
#
#
value=
file=
if test -f $DIRSCRIPT/run_marc_defaults; then
@ -523,7 +523,7 @@ if test -n "$value"; then
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
@ -543,7 +543,7 @@ if test -n "$value"; then
fi
fi
fi
#
#
#
# allow scratch directory to be specified with environmental variable
# MARCSCRATCH
@ -613,7 +613,7 @@ do
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
;;
-r* | -R*)
rid=`$BASENAME $value .t08`
@ -624,7 +624,7 @@ do
*)
DIRRID=`pwd`/$DIRRID
;;
esac
esac
;;
-si* | -SI*)
sid=$value
@ -635,7 +635,7 @@ do
*)
DIRSID=`pwd`/$DIRSID
;;
esac
esac
;;
-pi* | -PI*)
if test -f $value.t19
@ -651,7 +651,7 @@ do
*)
DIRPID=`pwd`/$DIRPID
;;
esac
esac
;;
-bdf | -BDF)
makebdf=1
@ -665,7 +665,7 @@ do
*)
DIRDID=`pwd`/$DIRDID
;;
esac
esac
;;
-vf | -VF)
vid=`$BASENAME $value .vfs`
@ -676,7 +676,7 @@ do
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
-u* | -U*)
user=$value
@ -847,7 +847,7 @@ do
*)
DIRSCR=`pwd`/$DIRSCR
;;
esac
esac
;;
-ho* | -HO*)
host=$value
@ -898,7 +898,7 @@ fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -934,7 +934,7 @@ fi
ntprint=$nt
nteprint=$nte
# copy from -nprocd[s]
if test $nprocdddm -gt 1
if test $nprocdddm -gt 1
then
nteprint=$nprocdddm
fi
@ -943,7 +943,7 @@ if test $nte -ne 0
then
nteprint=$nte
fi
# check for minimum 1 threads per processes for DDM
# check for minimum 1 threads per processes for DDM
if test $nprocdddm -gt 1
then
if test $nteprint -lt $nprocdddm
@ -998,24 +998,24 @@ export OMP_STACKSIZE=7M
# deprecate -nthread option at arugment of marc
nt=0
# Reset nprocdddmm, nsolver and threads if not given.
if test $nprocdddm -eq 0
then
if test $nprocdddm -eq 0
then
nprocdarg=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddmprint=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddm=
fi
fi
nsolverprint=$nsolver
if test $nsolver -eq 0
then
if test $nsolver -eq 0
then
nsolverprint=
fi
fi
# end of threads setting.
gpuoption=
if test "$gpuids" = "" ; then
@ -1030,7 +1030,7 @@ else
MARCCUDALIBS=$MARCCUDALIBS2
export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH
fi
# Linux 64 + HPMPI, Below code is taken from include_linux64
# Linux 64 + HPMPI, Below code is taken from include_linux64
if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64"
then
export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
@ -1059,7 +1059,7 @@ if test "$dllrun" -gt 0; then
fi
if test "$progdll"; then
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
rmdll=yes
pathdll=yes
progdll=${progdll}_$marcdll
@ -1093,14 +1093,14 @@ while test forever; do
if test $nprocdddm -gt 1 -a $icreated -eq 0; then
if test ! -f $DIRJID/1$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/1$jid$dotdat not accessible"
fi
fi
else
if test ! -f $DIRJID/$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/$jid$dotdat not accessible"
fi
fi
@ -1108,7 +1108,7 @@ fi
if test $nprocd -gt 1; then
if test "$host" ; then
if test ! -f $host; then
error="$error
error="$error
host name file $host not accessible"
fi
fi
@ -1222,11 +1222,11 @@ view factor file $DIRVID/$vid.vfs not accessible"
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)"
fi
fi
@ -1291,7 +1291,7 @@ defaults file $DIRDID/$did$dotdat not accessible"
then
if test $nauto -gt 2
then
error="$error
error="$error
incorrect option for auto restart "
fi
fi
@ -1299,7 +1299,7 @@ incorrect option for auto restart "
then
if test $ndcoup -gt 3
then
error="$error
error="$error
incorrect option for contact decoupling "
fi
fi
@ -1307,7 +1307,7 @@ incorrect option for contact decoupling "
then
if test $ndytran -gt 1
then
error="$error
error="$error
incorrect option for Marc-Dytran Switch "
fi
fi
@ -1315,7 +1315,7 @@ incorrect option for Marc-Dytran Switch "
then
if test ! -x $MARC_BIN/$exefile
then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE "
fi
fi
@ -1642,7 +1642,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
fi
$ECHO "User subroutine name ($user)? $ECHOTXT"
read value
@ -1660,7 +1660,7 @@ Program name ($prog)? $ECHOTXT"
*)
user=`pwd`/$user
;;
esac
esac
usernoext=$user
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F`
@ -1783,7 +1783,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
esac
fi
@ -1825,7 +1825,7 @@ Program name ($prog)? $ECHOTXT"
fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -1975,7 +1975,7 @@ Program name ($prog)? $ECHOTXT"
then
qid=$value
fi
case $qid in
case $qid in
s* | S* | l* | L* | v* | V* )
$ECHO "Queue priority ($priority)? $ECHOTXT"
read value
@ -2039,42 +2039,42 @@ esac
done
#
if test $nt -eq 0
then
if test $nt -eq 0
then
ntarg=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
ntprint=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
nt=
fi
if test $nte -eq 0
then
if test $nte -eq 0
then
ntearg=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nteprint=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nte=
fi
if test $nts -eq 0
then
if test $nts -eq 0
then
ntsarg=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
ntsprint=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
nts=
fi
#
@ -2327,7 +2327,7 @@ fi
execpath=$usernoext.marc
usersub=1
fi
export execpath
export execpath
execname=`$BASENAME $execpath`
if test "$host"
@ -2360,7 +2360,7 @@ fi
exit 1
fi
# check for Myrinet that the number of processes per host is
# check for Myrinet that the number of processes per host is
# less than number of available user ports, 5
# .gmpi directory must exist in user's home directory
# and must have write permission from remote hosts
@ -2474,9 +2474,9 @@ fi
then
# Intel MPI
if test -f $jid.mfile
then
then
/bin/rm $jid.mfile 2> /dev/null
fi
fi
/bin/cp $host $jid.host
grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile
# end Intel MPI for DMP
@ -2560,7 +2560,7 @@ fi
else
host=$jid.host
host_filt=$host
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
then
host_filt=$jid.mfile
fi
@ -2569,7 +2569,7 @@ fi
# or distributed and set the variable "dirstatus" accordingly.
# only perform the check if user subroutine is used
# or a user subroutine executable is used
numfield=1
if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware
then
@ -2729,7 +2729,7 @@ fi
fi
# modify new host file if NFS mounted heterogeneous machine
doit=
if test $program = $prog.marc
if test $program = $prog.marc
then
doit=yes
fi
@ -2753,23 +2753,23 @@ if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \
printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
/bin/mv $jid.host{$$} $jid.host
host=$jid.host
fi
fi
fi
done
done
fi
fi # if test $program = $prog.marc -o $user -o $obj
else # if test $host
# assume shared memory machine if no hostfile given and
# MPITYPE is set to mpich or Myrinet
# check for Myrinet that the total number of processes is
# check for Myrinet that the total number of processes is
# less than number of available user ports, 5
if test $MPITYPE = "mpich" -o $MPITYPE = "scali"
then
numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'`
echo `hostname` $numproc $execpath > $jid.host
host=$jid.host
elif test $MPITYPE = "myrinet"
elif test $MPITYPE = "myrinet"
then
if test $nprocd -gt 5
then
@ -2809,7 +2809,7 @@ printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
fi # if test $host
fi # if test $nprocd -gt 1
fi # if test $program = $exefile -o $program = $prog.marc
##############################################################################
@ -2859,7 +2859,7 @@ else
nsolverarg="$nsolverarg $nsolver"
fi
if test $nprocdddm -lt 2 -a $nsolver -eq 0
then
then
nprocd=0
fi
if test $nprocd -gt 0
@ -2870,7 +2870,7 @@ then
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -2975,7 +2975,7 @@ $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB "
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -3267,6 +3267,7 @@ else
fi
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3309,7 +3310,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
fi
else
if test $cpdll = yes; then
@ -3318,10 +3319,10 @@ else
fi
if test $rmdll = yes
then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
then
numdom=$nprocdddm
@ -3389,15 +3390,15 @@ else
#
QUENAME=qsub
SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid"
if test "$priority"
if test "$priority"
then
SUBMCMD=$SUBMCMD" -p $priority"
fi
if test "$att"
if test "$att"
then
SUBMCMD=$SUBMCMD" -a $att"
fi
if test "$cpu"
if test "$cpu"
then
SUBMCMD=$SUBMCMD" -lt $cpu"
fi
@ -3579,7 +3580,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3599,6 +3600,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3647,7 +3649,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
# for network run, remove executable on remote machines
# and executables with modified name
if test $nprocd -gt 1
@ -3696,7 +3698,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
@ -3913,7 +3915,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3933,6 +3935,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
# done if no job id given
if test -z "$jid"
then
@ -3972,7 +3975,7 @@ if test $ddm_arc -gt 0; then
RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc "
fi
$RUN_JOB
$RUN_JOB
if test $nprocd -gt 1
then
@ -4055,7 +4058,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi

View File

@ -63,7 +63,7 @@
# =1, element storage out-of-core #
# -dll run marc using shared library libmarc.so and exe_marc #
# =1, used #
# =2, do not free streaming input memory #
# =2, do not free streaming input memory #
# =3, run with marc input deck #
# -trk run marc for post-tracking #
# -gpuid run marc using GPGPU capability #
@ -177,16 +177,16 @@ fi
# MARC_MODE i8
# it can also be set by the environmental variable MARC_INTEGER_SIZE
# and by the command line option "-mo"
#
#
mode=
modeerror=
modeoption=
if test -f $DIRSCRIPT/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
echo
line=
fi
line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults`
@ -203,7 +203,7 @@ fi
if test -f $HOME/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $HOME/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
line=
@ -226,7 +226,7 @@ if test -z "$mode" ; then
mode=i8
fi
case $mode in
i4)
i4)
modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported."
modeoption=error
echo $modeerror
@ -246,7 +246,7 @@ for arg in $* ; do
if $setmode ; then
mode=$arg
case $mode in
i4)
i4)
modeerror="bad value for mode option; only i8 is supported."
modeoption=error
echo
@ -269,7 +269,7 @@ for arg in $* ; do
setmode=false
fi
if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then
echo
echo
echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available
echo
setmode=true
@ -333,7 +333,7 @@ case "`echo '\c'`" in
;;
esac
#
#
# Variables for the MARC environment
#
@ -388,7 +388,7 @@ LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH
export LD_LIBRARY_PATH
export LD_LIBRARY64_PATH
export LD_LIBRARYN32_PATH
atexit() {
kill -15 $$
#
@ -498,7 +498,7 @@ MDSRCLIB=$MARC_LIB/mdsrc.a
# or in the user's home directory
# format:
# MARC_MPI <mpiversion>
#
#
value=
file=
if test -f $DIRSCRIPT/run_marc_defaults; then
@ -523,7 +523,7 @@ if test -n "$value"; then
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
@ -543,7 +543,7 @@ if test -n "$value"; then
fi
fi
fi
#
#
#
# allow scratch directory to be specified with environmental variable
# MARCSCRATCH
@ -613,7 +613,7 @@ do
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
;;
-r* | -R*)
rid=`$BASENAME $value .t08`
@ -624,7 +624,7 @@ do
*)
DIRRID=`pwd`/$DIRRID
;;
esac
esac
;;
-si* | -SI*)
sid=$value
@ -635,7 +635,7 @@ do
*)
DIRSID=`pwd`/$DIRSID
;;
esac
esac
;;
-pi* | -PI*)
if test -f $value.t19
@ -651,7 +651,7 @@ do
*)
DIRPID=`pwd`/$DIRPID
;;
esac
esac
;;
-bdf | -BDF)
makebdf=1
@ -665,7 +665,7 @@ do
*)
DIRDID=`pwd`/$DIRDID
;;
esac
esac
;;
-vf | -VF)
vid=`$BASENAME $value .vfs`
@ -676,7 +676,7 @@ do
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
-u* | -U*)
user=$value
@ -847,7 +847,7 @@ do
*)
DIRSCR=`pwd`/$DIRSCR
;;
esac
esac
;;
-ho* | -HO*)
host=$value
@ -898,7 +898,7 @@ fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -934,7 +934,7 @@ fi
ntprint=$nt
nteprint=$nte
# copy from -nprocd[s]
if test $nprocdddm -gt 1
if test $nprocdddm -gt 1
then
nteprint=$nprocdddm
fi
@ -943,7 +943,7 @@ if test $nte -ne 0
then
nteprint=$nte
fi
# check for minimum 1 threads per processes for DDM
# check for minimum 1 threads per processes for DDM
if test $nprocdddm -gt 1
then
if test $nteprint -lt $nprocdddm
@ -998,24 +998,24 @@ export OMP_STACKSIZE=7M
# deprecate -nthread option at arugment of marc
nt=0
# Reset nprocdddmm, nsolver and threads if not given.
if test $nprocdddm -eq 0
then
if test $nprocdddm -eq 0
then
nprocdarg=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddmprint=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddm=
fi
fi
nsolverprint=$nsolver
if test $nsolver -eq 0
then
if test $nsolver -eq 0
then
nsolverprint=
fi
fi
# end of threads setting.
gpuoption=
if test "$gpuids" = "" ; then
@ -1030,7 +1030,7 @@ else
MARCCUDALIBS=$MARCCUDALIBS2
export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH
fi
# Linux 64 + HPMPI, Below code is taken from include_linux64
# Linux 64 + HPMPI, Below code is taken from include_linux64
if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64"
then
export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
@ -1059,7 +1059,7 @@ if test "$dllrun" -gt 0; then
fi
if test "$progdll"; then
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
rmdll=yes
pathdll=yes
progdll=${progdll}_$marcdll
@ -1093,14 +1093,14 @@ while test forever; do
if test $nprocdddm -gt 1 -a $icreated -eq 0; then
if test ! -f $DIRJID/1$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/1$jid$dotdat not accessible"
fi
fi
else
if test ! -f $DIRJID/$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/$jid$dotdat not accessible"
fi
fi
@ -1108,7 +1108,7 @@ fi
if test $nprocd -gt 1; then
if test "$host" ; then
if test ! -f $host; then
error="$error
error="$error
host name file $host not accessible"
fi
fi
@ -1222,11 +1222,11 @@ view factor file $DIRVID/$vid.vfs not accessible"
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)"
fi
fi
@ -1291,7 +1291,7 @@ defaults file $DIRDID/$did$dotdat not accessible"
then
if test $nauto -gt 2
then
error="$error
error="$error
incorrect option for auto restart "
fi
fi
@ -1299,7 +1299,7 @@ incorrect option for auto restart "
then
if test $ndcoup -gt 3
then
error="$error
error="$error
incorrect option for contact decoupling "
fi
fi
@ -1307,7 +1307,7 @@ incorrect option for contact decoupling "
then
if test $ndytran -gt 1
then
error="$error
error="$error
incorrect option for Marc-Dytran Switch "
fi
fi
@ -1315,7 +1315,7 @@ incorrect option for Marc-Dytran Switch "
then
if test ! -x $MARC_BIN/$exefile
then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE "
fi
fi
@ -1642,7 +1642,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
fi
$ECHO "User subroutine name ($user)? $ECHOTXT"
read value
@ -1660,7 +1660,7 @@ Program name ($prog)? $ECHOTXT"
*)
user=`pwd`/$user
;;
esac
esac
usernoext=$user
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F`
@ -1783,7 +1783,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
esac
fi
@ -1825,7 +1825,7 @@ Program name ($prog)? $ECHOTXT"
fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -1975,7 +1975,7 @@ Program name ($prog)? $ECHOTXT"
then
qid=$value
fi
case $qid in
case $qid in
s* | S* | l* | L* | v* | V* )
$ECHO "Queue priority ($priority)? $ECHOTXT"
read value
@ -2039,42 +2039,42 @@ esac
done
#
if test $nt -eq 0
then
if test $nt -eq 0
then
ntarg=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
ntprint=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
nt=
fi
if test $nte -eq 0
then
if test $nte -eq 0
then
ntearg=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nteprint=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nte=
fi
if test $nts -eq 0
then
if test $nts -eq 0
then
ntsarg=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
ntsprint=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
nts=
fi
#
@ -2327,7 +2327,7 @@ fi
execpath=$usernoext.marc
usersub=1
fi
export execpath
export execpath
execname=`$BASENAME $execpath`
if test "$host"
@ -2360,7 +2360,7 @@ fi
exit 1
fi
# check for Myrinet that the number of processes per host is
# check for Myrinet that the number of processes per host is
# less than number of available user ports, 5
# .gmpi directory must exist in user's home directory
# and must have write permission from remote hosts
@ -2474,9 +2474,9 @@ fi
then
# Intel MPI
if test -f $jid.mfile
then
then
/bin/rm $jid.mfile 2> /dev/null
fi
fi
/bin/cp $host $jid.host
grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile
# end Intel MPI for DMP
@ -2560,7 +2560,7 @@ fi
else
host=$jid.host
host_filt=$host
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
then
host_filt=$jid.mfile
fi
@ -2569,7 +2569,7 @@ fi
# or distributed and set the variable "dirstatus" accordingly.
# only perform the check if user subroutine is used
# or a user subroutine executable is used
numfield=1
if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware
then
@ -2729,7 +2729,7 @@ fi
fi
# modify new host file if NFS mounted heterogeneous machine
doit=
if test $program = $prog.marc
if test $program = $prog.marc
then
doit=yes
fi
@ -2753,23 +2753,23 @@ if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \
printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
/bin/mv $jid.host{$$} $jid.host
host=$jid.host
fi
fi
fi
done
done
fi
fi # if test $program = $prog.marc -o $user -o $obj
else # if test $host
# assume shared memory machine if no hostfile given and
# MPITYPE is set to mpich or Myrinet
# check for Myrinet that the total number of processes is
# check for Myrinet that the total number of processes is
# less than number of available user ports, 5
if test $MPITYPE = "mpich" -o $MPITYPE = "scali"
then
numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'`
echo `hostname` $numproc $execpath > $jid.host
host=$jid.host
elif test $MPITYPE = "myrinet"
elif test $MPITYPE = "myrinet"
then
if test $nprocd -gt 5
then
@ -2809,7 +2809,7 @@ printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
fi # if test $host
fi # if test $nprocd -gt 1
fi # if test $program = $exefile -o $program = $prog.marc
##############################################################################
@ -2859,7 +2859,7 @@ else
nsolverarg="$nsolverarg $nsolver"
fi
if test $nprocdddm -lt 2 -a $nsolver -eq 0
then
then
nprocd=0
fi
if test $nprocd -gt 0
@ -2870,7 +2870,7 @@ then
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -2975,7 +2975,7 @@ $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB "
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -3267,6 +3267,7 @@ else
fi
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3309,7 +3310,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
fi
else
if test $cpdll = yes; then
@ -3318,10 +3319,10 @@ else
fi
if test $rmdll = yes
then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
then
numdom=$nprocdddm
@ -3389,15 +3390,15 @@ else
#
QUENAME=qsub
SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid"
if test "$priority"
if test "$priority"
then
SUBMCMD=$SUBMCMD" -p $priority"
fi
if test "$att"
if test "$att"
then
SUBMCMD=$SUBMCMD" -a $att"
fi
if test "$cpu"
if test "$cpu"
then
SUBMCMD=$SUBMCMD" -lt $cpu"
fi
@ -3579,7 +3580,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3599,6 +3600,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3647,7 +3649,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
# for network run, remove executable on remote machines
# and executables with modified name
if test $nprocd -gt 1
@ -3696,7 +3698,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
@ -3913,7 +3915,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3933,6 +3935,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
# done if no job id given
if test -z "$jid"
then
@ -3972,7 +3975,7 @@ if test $ddm_arc -gt 0; then
RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc "
fi
$RUN_JOB
$RUN_JOB
if test $nprocd -gt 1
then
@ -4055,7 +4058,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi

View File

@ -49,4 +49,5 @@ echo "program: $program"
exit 1
}
/bin/rm $userobj
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.smod

View File

@ -49,4 +49,5 @@ echo "program: $program"
exit 1
}
/bin/rm $userobj
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.smod

View File

@ -49,4 +49,5 @@ echo "program: $program"
exit 1
}
/bin/rm $userobj
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.smod

View File

@ -63,7 +63,7 @@
# =1, element storage out-of-core #
# -dll run marc using shared library libmarc.so and exe_marc #
# =1, used #
# =2, do not free streaming input memory #
# =2, do not free streaming input memory #
# =3, run with marc input deck #
# -trk run marc for post-tracking #
# -gpuid run marc using GPGPU capability #
@ -177,16 +177,16 @@ fi
# MARC_MODE i8
# it can also be set by the environmental variable MARC_INTEGER_SIZE
# and by the command line option "-mo"
#
#
mode=
modeerror=
modeoption=
if test -f $DIRSCRIPT/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
echo
line=
fi
line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults`
@ -203,7 +203,7 @@ fi
if test -f $HOME/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $HOME/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
line=
@ -226,7 +226,7 @@ if test -z "$mode" ; then
mode=i8
fi
case $mode in
i4)
i4)
modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported."
modeoption=error
echo $modeerror
@ -246,7 +246,7 @@ for arg in $* ; do
if $setmode ; then
mode=$arg
case $mode in
i4)
i4)
modeerror="bad value for mode option; only i8 is supported."
modeoption=error
echo
@ -269,7 +269,7 @@ for arg in $* ; do
setmode=false
fi
if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then
echo
echo
echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available
echo
setmode=true
@ -333,7 +333,7 @@ case "`echo '\c'`" in
;;
esac
#
#
# Variables for the MARC environment
#
@ -388,7 +388,7 @@ LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH
export LD_LIBRARY_PATH
export LD_LIBRARY64_PATH
export LD_LIBRARYN32_PATH
atexit() {
kill -15 $$
#
@ -498,7 +498,7 @@ MDSRCLIB=$MARC_LIB/mdsrc.a
# or in the user's home directory
# format:
# MARC_MPI <mpiversion>
#
#
value=
file=
if test -f $DIRSCRIPT/run_marc_defaults; then
@ -523,7 +523,7 @@ if test -n "$value"; then
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
@ -543,7 +543,7 @@ if test -n "$value"; then
fi
fi
fi
#
#
#
# allow scratch directory to be specified with environmental variable
# MARCSCRATCH
@ -613,7 +613,7 @@ do
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
;;
-r* | -R*)
rid=`$BASENAME $value .t08`
@ -624,7 +624,7 @@ do
*)
DIRRID=`pwd`/$DIRRID
;;
esac
esac
;;
-si* | -SI*)
sid=$value
@ -635,7 +635,7 @@ do
*)
DIRSID=`pwd`/$DIRSID
;;
esac
esac
;;
-pi* | -PI*)
if test -f $value.t19
@ -651,7 +651,7 @@ do
*)
DIRPID=`pwd`/$DIRPID
;;
esac
esac
;;
-bdf | -BDF)
makebdf=1
@ -665,7 +665,7 @@ do
*)
DIRDID=`pwd`/$DIRDID
;;
esac
esac
;;
-vf | -VF)
vid=`$BASENAME $value .vfs`
@ -676,7 +676,7 @@ do
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
-u* | -U*)
user=$value
@ -847,7 +847,7 @@ do
*)
DIRSCR=`pwd`/$DIRSCR
;;
esac
esac
;;
-ho* | -HO*)
host=$value
@ -898,7 +898,7 @@ fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -934,7 +934,7 @@ fi
ntprint=$nt
nteprint=$nte
# copy from -nprocd[s]
if test $nprocdddm -gt 1
if test $nprocdddm -gt 1
then
nteprint=$nprocdddm
fi
@ -943,7 +943,7 @@ if test $nte -ne 0
then
nteprint=$nte
fi
# check for minimum 1 threads per processes for DDM
# check for minimum 1 threads per processes for DDM
if test $nprocdddm -gt 1
then
if test $nteprint -lt $nprocdddm
@ -998,24 +998,24 @@ export OMP_STACKSIZE=7M
# deprecate -nthread option at arugment of marc
nt=0
# Reset nprocdddmm, nsolver and threads if not given.
if test $nprocdddm -eq 0
then
if test $nprocdddm -eq 0
then
nprocdarg=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddmprint=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddm=
fi
fi
nsolverprint=$nsolver
if test $nsolver -eq 0
then
if test $nsolver -eq 0
then
nsolverprint=
fi
fi
# end of threads setting.
gpuoption=
if test "$gpuids" = "" ; then
@ -1030,7 +1030,7 @@ else
MARCCUDALIBS=$MARCCUDALIBS2
export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH
fi
# Linux 64 + HPMPI, Below code is taken from include_linux64
# Linux 64 + HPMPI, Below code is taken from include_linux64
if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64"
then
export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
@ -1059,7 +1059,7 @@ if test "$dllrun" -gt 0; then
fi
if test "$progdll"; then
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
rmdll=yes
pathdll=yes
progdll=${progdll}_$marcdll
@ -1093,14 +1093,14 @@ while test forever; do
if test $nprocdddm -gt 1 -a $icreated -eq 0; then
if test ! -f $DIRJID/1$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/1$jid$dotdat not accessible"
fi
fi
else
if test ! -f $DIRJID/$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/$jid$dotdat not accessible"
fi
fi
@ -1108,7 +1108,7 @@ fi
if test $nprocd -gt 1; then
if test "$host" ; then
if test ! -f $host; then
error="$error
error="$error
host name file $host not accessible"
fi
fi
@ -1222,11 +1222,11 @@ view factor file $DIRVID/$vid.vfs not accessible"
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)"
fi
fi
@ -1291,7 +1291,7 @@ defaults file $DIRDID/$did$dotdat not accessible"
then
if test $nauto -gt 2
then
error="$error
error="$error
incorrect option for auto restart "
fi
fi
@ -1299,7 +1299,7 @@ incorrect option for auto restart "
then
if test $ndcoup -gt 3
then
error="$error
error="$error
incorrect option for contact decoupling "
fi
fi
@ -1307,7 +1307,7 @@ incorrect option for contact decoupling "
then
if test $ndytran -gt 1
then
error="$error
error="$error
incorrect option for Marc-Dytran Switch "
fi
fi
@ -1315,7 +1315,7 @@ incorrect option for Marc-Dytran Switch "
then
if test ! -x $MARC_BIN/$exefile
then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE "
fi
fi
@ -1642,7 +1642,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
fi
$ECHO "User subroutine name ($user)? $ECHOTXT"
read value
@ -1660,7 +1660,7 @@ Program name ($prog)? $ECHOTXT"
*)
user=`pwd`/$user
;;
esac
esac
usernoext=$user
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F`
@ -1783,7 +1783,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
esac
fi
@ -1825,7 +1825,7 @@ Program name ($prog)? $ECHOTXT"
fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -1975,7 +1975,7 @@ Program name ($prog)? $ECHOTXT"
then
qid=$value
fi
case $qid in
case $qid in
s* | S* | l* | L* | v* | V* )
$ECHO "Queue priority ($priority)? $ECHOTXT"
read value
@ -2039,42 +2039,42 @@ esac
done
#
if test $nt -eq 0
then
if test $nt -eq 0
then
ntarg=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
ntprint=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
nt=
fi
if test $nte -eq 0
then
if test $nte -eq 0
then
ntearg=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nteprint=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nte=
fi
if test $nts -eq 0
then
if test $nts -eq 0
then
ntsarg=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
ntsprint=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
nts=
fi
#
@ -2327,7 +2327,7 @@ fi
execpath=$usernoext.marc
usersub=1
fi
export execpath
export execpath
execname=`$BASENAME $execpath`
if test "$host"
@ -2360,7 +2360,7 @@ fi
exit 1
fi
# check for Myrinet that the number of processes per host is
# check for Myrinet that the number of processes per host is
# less than number of available user ports, 5
# .gmpi directory must exist in user's home directory
# and must have write permission from remote hosts
@ -2474,9 +2474,9 @@ fi
then
# Intel MPI
if test -f $jid.mfile
then
then
/bin/rm $jid.mfile 2> /dev/null
fi
fi
/bin/cp $host $jid.host
grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile
# end Intel MPI for DMP
@ -2560,7 +2560,7 @@ fi
else
host=$jid.host
host_filt=$host
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
then
host_filt=$jid.mfile
fi
@ -2569,7 +2569,7 @@ fi
# or distributed and set the variable "dirstatus" accordingly.
# only perform the check if user subroutine is used
# or a user subroutine executable is used
numfield=1
if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware
then
@ -2729,7 +2729,7 @@ fi
fi
# modify new host file if NFS mounted heterogeneous machine
doit=
if test $program = $prog.marc
if test $program = $prog.marc
then
doit=yes
fi
@ -2753,23 +2753,23 @@ if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \
printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
/bin/mv $jid.host{$$} $jid.host
host=$jid.host
fi
fi
fi
done
done
fi
fi # if test $program = $prog.marc -o $user -o $obj
else # if test $host
# assume shared memory machine if no hostfile given and
# MPITYPE is set to mpich or Myrinet
# check for Myrinet that the total number of processes is
# check for Myrinet that the total number of processes is
# less than number of available user ports, 5
if test $MPITYPE = "mpich" -o $MPITYPE = "scali"
then
numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'`
echo `hostname` $numproc $execpath > $jid.host
host=$jid.host
elif test $MPITYPE = "myrinet"
elif test $MPITYPE = "myrinet"
then
if test $nprocd -gt 5
then
@ -2809,7 +2809,7 @@ printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
fi # if test $host
fi # if test $nprocd -gt 1
fi # if test $program = $exefile -o $program = $prog.marc
##############################################################################
@ -2859,7 +2859,7 @@ else
nsolverarg="$nsolverarg $nsolver"
fi
if test $nprocdddm -lt 2 -a $nsolver -eq 0
then
then
nprocd=0
fi
if test $nprocd -gt 0
@ -2870,7 +2870,7 @@ then
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -2975,7 +2975,7 @@ $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB "
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -3267,6 +3267,7 @@ else
fi
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3309,7 +3310,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
fi
else
if test $cpdll = yes; then
@ -3318,10 +3319,10 @@ else
fi
if test $rmdll = yes
then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
then
numdom=$nprocdddm
@ -3389,15 +3390,15 @@ else
#
QUENAME=qsub
SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid"
if test "$priority"
if test "$priority"
then
SUBMCMD=$SUBMCMD" -p $priority"
fi
if test "$att"
if test "$att"
then
SUBMCMD=$SUBMCMD" -a $att"
fi
if test "$cpu"
if test "$cpu"
then
SUBMCMD=$SUBMCMD" -lt $cpu"
fi
@ -3579,7 +3580,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3599,6 +3600,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3647,7 +3649,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
# for network run, remove executable on remote machines
# and executables with modified name
if test $nprocd -gt 1
@ -3696,7 +3698,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
@ -3913,7 +3915,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3933,6 +3935,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
# done if no job id given
if test -z "$jid"
then
@ -3972,7 +3975,7 @@ if test $ddm_arc -gt 0; then
RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc "
fi
$RUN_JOB
$RUN_JOB
if test $nprocd -gt 1
then
@ -4055,7 +4058,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi

View File

@ -63,7 +63,7 @@
# =1, element storage out-of-core #
# -dll run marc using shared library libmarc.so and exe_marc #
# =1, used #
# =2, do not free streaming input memory #
# =2, do not free streaming input memory #
# =3, run with marc input deck #
# -trk run marc for post-tracking #
# -gpuid run marc using GPGPU capability #
@ -177,16 +177,16 @@ fi
# MARC_MODE i8
# it can also be set by the environmental variable MARC_INTEGER_SIZE
# and by the command line option "-mo"
#
#
mode=
modeerror=
modeoption=
if test -f $DIRSCRIPT/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
echo
line=
fi
line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults`
@ -203,7 +203,7 @@ fi
if test -f $HOME/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $HOME/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
line=
@ -226,7 +226,7 @@ if test -z "$mode" ; then
mode=i8
fi
case $mode in
i4)
i4)
modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported."
modeoption=error
echo $modeerror
@ -246,7 +246,7 @@ for arg in $* ; do
if $setmode ; then
mode=$arg
case $mode in
i4)
i4)
modeerror="bad value for mode option; only i8 is supported."
modeoption=error
echo
@ -269,7 +269,7 @@ for arg in $* ; do
setmode=false
fi
if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then
echo
echo
echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available
echo
setmode=true
@ -333,7 +333,7 @@ case "`echo '\c'`" in
;;
esac
#
#
# Variables for the MARC environment
#
@ -388,7 +388,7 @@ LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH
export LD_LIBRARY_PATH
export LD_LIBRARY64_PATH
export LD_LIBRARYN32_PATH
atexit() {
kill -15 $$
#
@ -498,7 +498,7 @@ MDSRCLIB=$MARC_LIB/mdsrc.a
# or in the user's home directory
# format:
# MARC_MPI <mpiversion>
#
#
value=
file=
if test -f $DIRSCRIPT/run_marc_defaults; then
@ -523,7 +523,7 @@ if test -n "$value"; then
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
@ -543,7 +543,7 @@ if test -n "$value"; then
fi
fi
fi
#
#
#
# allow scratch directory to be specified with environmental variable
# MARCSCRATCH
@ -613,7 +613,7 @@ do
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
;;
-r* | -R*)
rid=`$BASENAME $value .t08`
@ -624,7 +624,7 @@ do
*)
DIRRID=`pwd`/$DIRRID
;;
esac
esac
;;
-si* | -SI*)
sid=$value
@ -635,7 +635,7 @@ do
*)
DIRSID=`pwd`/$DIRSID
;;
esac
esac
;;
-pi* | -PI*)
if test -f $value.t19
@ -651,7 +651,7 @@ do
*)
DIRPID=`pwd`/$DIRPID
;;
esac
esac
;;
-bdf | -BDF)
makebdf=1
@ -665,7 +665,7 @@ do
*)
DIRDID=`pwd`/$DIRDID
;;
esac
esac
;;
-vf | -VF)
vid=`$BASENAME $value .vfs`
@ -676,7 +676,7 @@ do
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
-u* | -U*)
user=$value
@ -847,7 +847,7 @@ do
*)
DIRSCR=`pwd`/$DIRSCR
;;
esac
esac
;;
-ho* | -HO*)
host=$value
@ -898,7 +898,7 @@ fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -934,7 +934,7 @@ fi
ntprint=$nt
nteprint=$nte
# copy from -nprocd[s]
if test $nprocdddm -gt 1
if test $nprocdddm -gt 1
then
nteprint=$nprocdddm
fi
@ -943,7 +943,7 @@ if test $nte -ne 0
then
nteprint=$nte
fi
# check for minimum 1 threads per processes for DDM
# check for minimum 1 threads per processes for DDM
if test $nprocdddm -gt 1
then
if test $nteprint -lt $nprocdddm
@ -998,24 +998,24 @@ export OMP_STACKSIZE=7M
# deprecate -nthread option at arugment of marc
nt=0
# Reset nprocdddmm, nsolver and threads if not given.
if test $nprocdddm -eq 0
then
if test $nprocdddm -eq 0
then
nprocdarg=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddmprint=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddm=
fi
fi
nsolverprint=$nsolver
if test $nsolver -eq 0
then
if test $nsolver -eq 0
then
nsolverprint=
fi
fi
# end of threads setting.
gpuoption=
if test "$gpuids" = "" ; then
@ -1030,7 +1030,7 @@ else
MARCCUDALIBS=$MARCCUDALIBS2
export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH
fi
# Linux 64 + HPMPI, Below code is taken from include_linux64
# Linux 64 + HPMPI, Below code is taken from include_linux64
if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64"
then
export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
@ -1059,7 +1059,7 @@ if test "$dllrun" -gt 0; then
fi
if test "$progdll"; then
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
rmdll=yes
pathdll=yes
progdll=${progdll}_$marcdll
@ -1093,14 +1093,14 @@ while test forever; do
if test $nprocdddm -gt 1 -a $icreated -eq 0; then
if test ! -f $DIRJID/1$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/1$jid$dotdat not accessible"
fi
fi
else
if test ! -f $DIRJID/$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/$jid$dotdat not accessible"
fi
fi
@ -1108,7 +1108,7 @@ fi
if test $nprocd -gt 1; then
if test "$host" ; then
if test ! -f $host; then
error="$error
error="$error
host name file $host not accessible"
fi
fi
@ -1222,11 +1222,11 @@ view factor file $DIRVID/$vid.vfs not accessible"
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)"
fi
fi
@ -1291,7 +1291,7 @@ defaults file $DIRDID/$did$dotdat not accessible"
then
if test $nauto -gt 2
then
error="$error
error="$error
incorrect option for auto restart "
fi
fi
@ -1299,7 +1299,7 @@ incorrect option for auto restart "
then
if test $ndcoup -gt 3
then
error="$error
error="$error
incorrect option for contact decoupling "
fi
fi
@ -1307,7 +1307,7 @@ incorrect option for contact decoupling "
then
if test $ndytran -gt 1
then
error="$error
error="$error
incorrect option for Marc-Dytran Switch "
fi
fi
@ -1315,7 +1315,7 @@ incorrect option for Marc-Dytran Switch "
then
if test ! -x $MARC_BIN/$exefile
then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE "
fi
fi
@ -1642,7 +1642,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
fi
$ECHO "User subroutine name ($user)? $ECHOTXT"
read value
@ -1660,7 +1660,7 @@ Program name ($prog)? $ECHOTXT"
*)
user=`pwd`/$user
;;
esac
esac
usernoext=$user
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F`
@ -1783,7 +1783,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
esac
fi
@ -1825,7 +1825,7 @@ Program name ($prog)? $ECHOTXT"
fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -1975,7 +1975,7 @@ Program name ($prog)? $ECHOTXT"
then
qid=$value
fi
case $qid in
case $qid in
s* | S* | l* | L* | v* | V* )
$ECHO "Queue priority ($priority)? $ECHOTXT"
read value
@ -2039,42 +2039,42 @@ esac
done
#
if test $nt -eq 0
then
if test $nt -eq 0
then
ntarg=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
ntprint=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
nt=
fi
if test $nte -eq 0
then
if test $nte -eq 0
then
ntearg=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nteprint=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nte=
fi
if test $nts -eq 0
then
if test $nts -eq 0
then
ntsarg=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
ntsprint=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
nts=
fi
#
@ -2327,7 +2327,7 @@ fi
execpath=$usernoext.marc
usersub=1
fi
export execpath
export execpath
execname=`$BASENAME $execpath`
if test "$host"
@ -2360,7 +2360,7 @@ fi
exit 1
fi
# check for Myrinet that the number of processes per host is
# check for Myrinet that the number of processes per host is
# less than number of available user ports, 5
# .gmpi directory must exist in user's home directory
# and must have write permission from remote hosts
@ -2474,9 +2474,9 @@ fi
then
# Intel MPI
if test -f $jid.mfile
then
then
/bin/rm $jid.mfile 2> /dev/null
fi
fi
/bin/cp $host $jid.host
grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile
# end Intel MPI for DMP
@ -2560,7 +2560,7 @@ fi
else
host=$jid.host
host_filt=$host
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
then
host_filt=$jid.mfile
fi
@ -2569,7 +2569,7 @@ fi
# or distributed and set the variable "dirstatus" accordingly.
# only perform the check if user subroutine is used
# or a user subroutine executable is used
numfield=1
if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware
then
@ -2729,7 +2729,7 @@ fi
fi
# modify new host file if NFS mounted heterogeneous machine
doit=
if test $program = $prog.marc
if test $program = $prog.marc
then
doit=yes
fi
@ -2753,23 +2753,23 @@ if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \
printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
/bin/mv $jid.host{$$} $jid.host
host=$jid.host
fi
fi
fi
done
done
fi
fi # if test $program = $prog.marc -o $user -o $obj
else # if test $host
# assume shared memory machine if no hostfile given and
# MPITYPE is set to mpich or Myrinet
# check for Myrinet that the total number of processes is
# check for Myrinet that the total number of processes is
# less than number of available user ports, 5
if test $MPITYPE = "mpich" -o $MPITYPE = "scali"
then
numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'`
echo `hostname` $numproc $execpath > $jid.host
host=$jid.host
elif test $MPITYPE = "myrinet"
elif test $MPITYPE = "myrinet"
then
if test $nprocd -gt 5
then
@ -2809,7 +2809,7 @@ printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
fi # if test $host
fi # if test $nprocd -gt 1
fi # if test $program = $exefile -o $program = $prog.marc
##############################################################################
@ -2859,7 +2859,7 @@ else
nsolverarg="$nsolverarg $nsolver"
fi
if test $nprocdddm -lt 2 -a $nsolver -eq 0
then
then
nprocd=0
fi
if test $nprocd -gt 0
@ -2870,7 +2870,7 @@ then
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -2975,7 +2975,7 @@ $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB "
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -3267,6 +3267,7 @@ else
fi
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3309,7 +3310,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
fi
else
if test $cpdll = yes; then
@ -3318,10 +3319,10 @@ else
fi
if test $rmdll = yes
then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
then
numdom=$nprocdddm
@ -3389,15 +3390,15 @@ else
#
QUENAME=qsub
SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid"
if test "$priority"
if test "$priority"
then
SUBMCMD=$SUBMCMD" -p $priority"
fi
if test "$att"
if test "$att"
then
SUBMCMD=$SUBMCMD" -a $att"
fi
if test "$cpu"
if test "$cpu"
then
SUBMCMD=$SUBMCMD" -lt $cpu"
fi
@ -3579,7 +3580,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3599,6 +3600,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3647,7 +3649,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
# for network run, remove executable on remote machines
# and executables with modified name
if test $nprocd -gt 1
@ -3696,7 +3698,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
@ -3913,7 +3915,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3933,6 +3935,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
# done if no job id given
if test -z "$jid"
then
@ -3972,7 +3975,7 @@ if test $ddm_arc -gt 0; then
RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc "
fi
$RUN_JOB
$RUN_JOB
if test $nprocd -gt 1
then
@ -4055,7 +4058,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi

View File

@ -63,7 +63,7 @@
# =1, element storage out-of-core #
# -dll run marc using shared library libmarc.so and exe_marc #
# =1, used #
# =2, do not free streaming input memory #
# =2, do not free streaming input memory #
# =3, run with marc input deck #
# -trk run marc for post-tracking #
# -gpuid run marc using GPGPU capability #
@ -177,16 +177,16 @@ fi
# MARC_MODE i8
# it can also be set by the environmental variable MARC_INTEGER_SIZE
# and by the command line option "-mo"
#
#
mode=
modeerror=
modeoption=
if test -f $DIRSCRIPT/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
echo
line=
fi
line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults`
@ -203,7 +203,7 @@ fi
if test -f $HOME/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $HOME/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
line=
@ -226,7 +226,7 @@ if test -z "$mode" ; then
mode=i8
fi
case $mode in
i4)
i4)
modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported."
modeoption=error
echo $modeerror
@ -246,7 +246,7 @@ for arg in $* ; do
if $setmode ; then
mode=$arg
case $mode in
i4)
i4)
modeerror="bad value for mode option; only i8 is supported."
modeoption=error
echo
@ -269,7 +269,7 @@ for arg in $* ; do
setmode=false
fi
if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then
echo
echo
echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available
echo
setmode=true
@ -333,7 +333,7 @@ case "`echo '\c'`" in
;;
esac
#
#
# Variables for the MARC environment
#
@ -388,7 +388,7 @@ LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH
export LD_LIBRARY_PATH
export LD_LIBRARY64_PATH
export LD_LIBRARYN32_PATH
atexit() {
kill -15 $$
#
@ -498,7 +498,7 @@ MDSRCLIB=$MARC_LIB/mdsrc.a
# or in the user's home directory
# format:
# MARC_MPI <mpiversion>
#
#
value=
file=
if test -f $DIRSCRIPT/run_marc_defaults; then
@ -523,7 +523,7 @@ if test -n "$value"; then
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
@ -543,7 +543,7 @@ if test -n "$value"; then
fi
fi
fi
#
#
#
# allow scratch directory to be specified with environmental variable
# MARCSCRATCH
@ -613,7 +613,7 @@ do
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
;;
-r* | -R*)
rid=`$BASENAME $value .t08`
@ -624,7 +624,7 @@ do
*)
DIRRID=`pwd`/$DIRRID
;;
esac
esac
;;
-si* | -SI*)
sid=$value
@ -635,7 +635,7 @@ do
*)
DIRSID=`pwd`/$DIRSID
;;
esac
esac
;;
-pi* | -PI*)
if test -f $value.t19
@ -651,7 +651,7 @@ do
*)
DIRPID=`pwd`/$DIRPID
;;
esac
esac
;;
-bdf | -BDF)
makebdf=1
@ -665,7 +665,7 @@ do
*)
DIRDID=`pwd`/$DIRDID
;;
esac
esac
;;
-vf | -VF)
vid=`$BASENAME $value .vfs`
@ -676,7 +676,7 @@ do
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
-u* | -U*)
user=$value
@ -847,7 +847,7 @@ do
*)
DIRSCR=`pwd`/$DIRSCR
;;
esac
esac
;;
-ho* | -HO*)
host=$value
@ -898,7 +898,7 @@ fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -934,7 +934,7 @@ fi
ntprint=$nt
nteprint=$nte
# copy from -nprocd[s]
if test $nprocdddm -gt 1
if test $nprocdddm -gt 1
then
nteprint=$nprocdddm
fi
@ -943,7 +943,7 @@ if test $nte -ne 0
then
nteprint=$nte
fi
# check for minimum 1 threads per processes for DDM
# check for minimum 1 threads per processes for DDM
if test $nprocdddm -gt 1
then
if test $nteprint -lt $nprocdddm
@ -998,24 +998,24 @@ export OMP_STACKSIZE=7M
# deprecate -nthread option at arugment of marc
nt=0
# Reset nprocdddmm, nsolver and threads if not given.
if test $nprocdddm -eq 0
then
if test $nprocdddm -eq 0
then
nprocdarg=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddmprint=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddm=
fi
fi
nsolverprint=$nsolver
if test $nsolver -eq 0
then
if test $nsolver -eq 0
then
nsolverprint=
fi
fi
# end of threads setting.
gpuoption=
if test "$gpuids" = "" ; then
@ -1030,7 +1030,7 @@ else
MARCCUDALIBS=$MARCCUDALIBS2
export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH
fi
# Linux 64 + HPMPI, Below code is taken from include_linux64
# Linux 64 + HPMPI, Below code is taken from include_linux64
if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64"
then
export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
@ -1059,7 +1059,7 @@ if test "$dllrun" -gt 0; then
fi
if test "$progdll"; then
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
rmdll=yes
pathdll=yes
progdll=${progdll}_$marcdll
@ -1093,14 +1093,14 @@ while test forever; do
if test $nprocdddm -gt 1 -a $icreated -eq 0; then
if test ! -f $DIRJID/1$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/1$jid$dotdat not accessible"
fi
fi
else
if test ! -f $DIRJID/$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/$jid$dotdat not accessible"
fi
fi
@ -1108,7 +1108,7 @@ fi
if test $nprocd -gt 1; then
if test "$host" ; then
if test ! -f $host; then
error="$error
error="$error
host name file $host not accessible"
fi
fi
@ -1222,11 +1222,11 @@ view factor file $DIRVID/$vid.vfs not accessible"
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)"
fi
fi
@ -1291,7 +1291,7 @@ defaults file $DIRDID/$did$dotdat not accessible"
then
if test $nauto -gt 2
then
error="$error
error="$error
incorrect option for auto restart "
fi
fi
@ -1299,7 +1299,7 @@ incorrect option for auto restart "
then
if test $ndcoup -gt 3
then
error="$error
error="$error
incorrect option for contact decoupling "
fi
fi
@ -1307,7 +1307,7 @@ incorrect option for contact decoupling "
then
if test $ndytran -gt 1
then
error="$error
error="$error
incorrect option for Marc-Dytran Switch "
fi
fi
@ -1315,7 +1315,7 @@ incorrect option for Marc-Dytran Switch "
then
if test ! -x $MARC_BIN/$exefile
then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE "
fi
fi
@ -1642,7 +1642,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
fi
$ECHO "User subroutine name ($user)? $ECHOTXT"
read value
@ -1660,7 +1660,7 @@ Program name ($prog)? $ECHOTXT"
*)
user=`pwd`/$user
;;
esac
esac
usernoext=$user
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F`
@ -1783,7 +1783,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
esac
fi
@ -1825,7 +1825,7 @@ Program name ($prog)? $ECHOTXT"
fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -1975,7 +1975,7 @@ Program name ($prog)? $ECHOTXT"
then
qid=$value
fi
case $qid in
case $qid in
s* | S* | l* | L* | v* | V* )
$ECHO "Queue priority ($priority)? $ECHOTXT"
read value
@ -2039,42 +2039,42 @@ esac
done
#
if test $nt -eq 0
then
if test $nt -eq 0
then
ntarg=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
ntprint=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
nt=
fi
if test $nte -eq 0
then
if test $nte -eq 0
then
ntearg=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nteprint=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nte=
fi
if test $nts -eq 0
then
if test $nts -eq 0
then
ntsarg=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
ntsprint=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
nts=
fi
#
@ -2327,7 +2327,7 @@ fi
execpath=$usernoext.marc
usersub=1
fi
export execpath
export execpath
execname=`$BASENAME $execpath`
if test "$host"
@ -2360,7 +2360,7 @@ fi
exit 1
fi
# check for Myrinet that the number of processes per host is
# check for Myrinet that the number of processes per host is
# less than number of available user ports, 5
# .gmpi directory must exist in user's home directory
# and must have write permission from remote hosts
@ -2474,9 +2474,9 @@ fi
then
# Intel MPI
if test -f $jid.mfile
then
then
/bin/rm $jid.mfile 2> /dev/null
fi
fi
/bin/cp $host $jid.host
grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile
# end Intel MPI for DMP
@ -2560,7 +2560,7 @@ fi
else
host=$jid.host
host_filt=$host
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
then
host_filt=$jid.mfile
fi
@ -2569,7 +2569,7 @@ fi
# or distributed and set the variable "dirstatus" accordingly.
# only perform the check if user subroutine is used
# or a user subroutine executable is used
numfield=1
if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware
then
@ -2729,7 +2729,7 @@ fi
fi
# modify new host file if NFS mounted heterogeneous machine
doit=
if test $program = $prog.marc
if test $program = $prog.marc
then
doit=yes
fi
@ -2753,23 +2753,23 @@ if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \
printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
/bin/mv $jid.host{$$} $jid.host
host=$jid.host
fi
fi
fi
done
done
fi
fi # if test $program = $prog.marc -o $user -o $obj
else # if test $host
# assume shared memory machine if no hostfile given and
# MPITYPE is set to mpich or Myrinet
# check for Myrinet that the total number of processes is
# check for Myrinet that the total number of processes is
# less than number of available user ports, 5
if test $MPITYPE = "mpich" -o $MPITYPE = "scali"
then
numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'`
echo `hostname` $numproc $execpath > $jid.host
host=$jid.host
elif test $MPITYPE = "myrinet"
elif test $MPITYPE = "myrinet"
then
if test $nprocd -gt 5
then
@ -2809,7 +2809,7 @@ printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
fi # if test $host
fi # if test $nprocd -gt 1
fi # if test $program = $exefile -o $program = $prog.marc
##############################################################################
@ -2859,7 +2859,7 @@ else
nsolverarg="$nsolverarg $nsolver"
fi
if test $nprocdddm -lt 2 -a $nsolver -eq 0
then
then
nprocd=0
fi
if test $nprocd -gt 0
@ -2870,7 +2870,7 @@ then
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -2975,7 +2975,7 @@ $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB "
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -3267,6 +3267,7 @@ else
fi
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3309,7 +3310,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
fi
else
if test $cpdll = yes; then
@ -3318,10 +3319,10 @@ else
fi
if test $rmdll = yes
then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
then
numdom=$nprocdddm
@ -3389,15 +3390,15 @@ else
#
QUENAME=qsub
SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid"
if test "$priority"
if test "$priority"
then
SUBMCMD=$SUBMCMD" -p $priority"
fi
if test "$att"
if test "$att"
then
SUBMCMD=$SUBMCMD" -a $att"
fi
if test "$cpu"
if test "$cpu"
then
SUBMCMD=$SUBMCMD" -lt $cpu"
fi
@ -3579,7 +3580,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3599,6 +3600,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3647,7 +3649,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
# for network run, remove executable on remote machines
# and executables with modified name
if test $nprocd -gt 1
@ -3696,7 +3698,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
@ -3913,7 +3915,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3933,6 +3935,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
# done if no job id given
if test -z "$jid"
then
@ -3972,7 +3975,7 @@ if test $ddm_arc -gt 0; then
RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc "
fi
$RUN_JOB
$RUN_JOB
if test $nprocd -gt 1
then
@ -4055,7 +4058,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi

View File

@ -0,0 +1,53 @@
#!/bin/ksh
# 1st arg: $DIR
# 2nd arg: $DIRJOB
# 3rd arg: $user
# 4th arg: $program
DIR=$1
user=$3
program=$4
usernoext=$user
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90`
# add BLAS options for linking
BLAS="%BLAS%"
. $DIR/tools/include
DIRJOB=$2
cd $DIRJOB
echo "Compiling and linking user subroutine $user on host `hostname`"
echo "program: $program"
$DFORTHIGHMP $user || \
{
echo "$0: compile failed for $user"
exit 1
}
/bin/rm $program 2>/dev/null
userobj=$usernoext.o
$LOAD ${program} $DIR/lib/main.o\
$DIR/lib/blkdta.o $DIR/lib/comm?.o \
${userobj-} \
$DIR/lib/srclib.a \
$MNFLIBS \
$MDUSER \
../lib/mdsrc.a \
../lib/mcvfit.a \
$STUBS \
${SOLVERLIBS} \
$TKLIBS \
$MRCLIBS \
$METISLIBS \
$BLAS \
$SYSLIBS || \
{
echo "$0: link failed for $usernoext.o on host `hostname`"
exit 1
}
/bin/rm $userobj
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.smod

View File

@ -0,0 +1,53 @@
#!/bin/ksh
# 1st arg: $DIR
# 2nd arg: $DIRJOB
# 3rd arg: $user
# 4th arg: $program
DIR=$1
user=$3
program=$4
usernoext=$user
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90`
# add BLAS options for linking
BLAS="%BLAS%"
. $DIR/tools/include
DIRJOB=$2
cd $DIRJOB
echo "Compiling and linking user subroutine $user on host `hostname`"
echo "program: $program"
$DFORTRANLOWMP $user || \
{
echo "$0: compile failed for $user"
exit 1
}
/bin/rm $program 2>/dev/null
userobj=$usernoext.o
$LOAD ${program} $DIR/lib/main.o\
$DIR/lib/blkdta.o $DIR/lib/comm?.o \
${userobj-} \
$DIR/lib/srclib.a \
$MNFLIBS \
$MDUSER \
../lib/mdsrc.a \
../lib/mcvfit.a \
$STUBS \
${SOLVERLIBS} \
$TKLIBS \
$MRCLIBS \
$METISLIBS \
$BLAS \
$SYSLIBS || \
{
echo "$0: link failed for $usernoext.o on host `hostname`"
exit 1
}
/bin/rm $userobj
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.smod

View File

@ -0,0 +1,53 @@
#!/bin/ksh
# 1st arg: $DIR
# 2nd arg: $DIRJOB
# 3rd arg: $user
# 4th arg: $program
DIR=$1
user=$3
program=$4
usernoext=$user
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .for`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f90`
# add BLAS options for linking
BLAS="%BLAS%"
. $DIR/tools/include
DIRJOB=$2
cd $DIRJOB
echo "Compiling and linking user subroutine $user on host `hostname`"
echo "program: $program"
$DFORTRANMP $user || \
{
echo "$0: compile failed for $user"
exit 1
}
/bin/rm $program 2>/dev/null
userobj=$usernoext.o
$LOAD ${program} $DIR/lib/main.o\
$DIR/lib/blkdta.o $DIR/lib/comm?.o \
${userobj-} \
$DIR/lib/srclib.a \
$MNFLIBS \
$MDUSER \
../lib/mdsrc.a \
../lib/mcvfit.a \
$STUBS \
${SOLVERLIBS} \
$TKLIBS \
$MRCLIBS \
$METISLIBS \
$BLAS \
$SYSLIBS || \
{
echo "$0: link failed for $usernoext.o on host `hostname`"
exit 1
}
/bin/rm $userobj
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.smod

View File

@ -0,0 +1,41 @@
#!/bin/ksh
# 1st arg: $DIR
# 2nd arg: $DIRJOB
# 3rd arg: $user
# 4th arg: $program
DIR=$1
user=$3
program=$4
. $DIR/tools/include
DIRJOB=$2
cd $DIRJOB
echo "Compiling and linking user subroutine $user.f on host `hostname`"
echo "program: $program"
$FORTRAN $user.f || \
{
echo "$0: compile failed for $user.f"
exit 1
}
/bin/rm $program 2>/dev/null
userobj=$user.o
$LOAD ${program} $DIR/lib/main.o\
$DIR/lib/blkdta.o $DIR/lib/comm?.o \
${userobj-} \
$DIR/lib/srclib.a \
$MNFLIBS \
$MDUSER \
../lib/mdsrc.a \
../lib/mcvfit.a \
$STUBS \
${SOLVERLIBS} \
$TKLIBS \
$MRCLIBS \
$METISLIBS \
$SYSLIBS || \
{
echo "$0: link failed for $user.o on host `hostname`"
exit 1
}
/bin/rm $userobj

View File

@ -0,0 +1,818 @@
#
# General definitions for the Marc 2019 FP1 version
#
# EM64T
#
# Linux RedHat 7.1, 7.3 / SuSE 11 SP4, 12 SP1
#
# 64 bit MPI version
#
# Intel(R) Fortran Intel(R) 64 Compiler XE for applications
# running on Intel(R) 64, Version 17.0.5.239 Build 20170817
#
# Intel(R) C Intel(R) 64 Compiler XE for applications
# running on Intel(R) 64, Version 17.0.5.239 Build 20170817
#
# To check the O/S level, type:
# uname -a
#
# Distributed parallel MPI libraries:
# 1) HP MPI 2.3
# To check the mpi version, type:
# mpirun -version
# 2) Intel MPI 2017.1
# To check the mpi version, type:
# mpiexec.hydra -version
#
# To check the Compiler level, type using the compiler
# installation path:
# ifort -V
# icc -V
#
# REMARKS : This file contains the definitions of variables used during
# compilation loading and use of the MARC programmes . The
# current machine type is identified by means of the variable
# MACHINE , defined below.
#
#
# MPI_ROOT: root directory in which mpi shared libraries, etc. are located
# DIRJOB : directory in which spawned jobs should look for Marc input
# MPI_ARCH: system architecture
# MPI_EPATH: path where executable resides
#
REVISION="VERSION, BUILD"
HOSTNAME=`hostname`
# find available memory in Mbyte on the machine
# can be set explicitly
MEMLIMIT=`free -m | awk '/Mem:/ {print $2}'`
# set _OEM_NASTRAN to 1 for MD Nastran build
# override _OEM_NASTRAN setting with MARC_MD_NASTRAN environment variable
_OEM_NASTRAN="${MARC_MD_NASTRAN:-0}"
# uncomment the following line for an autoforge build
#AUTOFORGE=1
AUTOFORGE=0
export AUTOFORGE
# integer size
if test "$MARC_INTEGER_SIZE" = "" ; then
INTEGER_PATH=
else
INTEGER_PATH=/$MARC_INTEGER_SIZE
fi
FCOMP=ifort
INTELPATH="/opt/intel/compilers_and_libraries_2017/linux"
# find the root directory of the compiler installation:
# - if ifort is found in $PATH, then the root directory is derived
# from the path to ifort
# - if ifort is not found in $PATH, the root directory is assumed
# to be $INTELPATH and the directory in which ifort is found is
# added to $PATH
FCOMPPATH=`which "$FCOMP" 2>/dev/null`
if test -n "$FCOMPPATH"; then
# derive the root directory from $FCOMPPATH
FCOMPROOT="${FCOMPPATH%/bin/intel64/$FCOMP}"
if test "$FCOMPROOT" = "$FCOMPPATH"; then
FCOMPROOT="${FCOMPPATH%/bin/$FCOMP}"
fi
if test "$FCOMPROOT" = "$FCOMPPATH"; then
FCOMPROOT=
fi
elif test -d "$INTELPATH"; then
# check for compiler in $INTELPATH
if test -d "$INTELPATH/bin/intel64" -a \
-x "$INTELPATH/bin/intel64/$FCOMP" ; then
FCOMPROOT="$INTELPATH"
PATH="$INTELPATH/bin/intel64:$PATH"
elif test -d "$INTELPATH/bin" -a \
-x "$INTELPATH/bin/$FCOMP"; then
FCOMPROOT="$INTELPATH"
PATH="$INTELPATH/bin:$PATH"
else
FCOMPROOT=
fi
else
FCOMPROOT=
fi
# DAMASK uses the HDF5 compiler wrapper around the Intel compiler
H5FC="$(h5fc -shlib -show)"
HDF5_LIB=${H5FC//ifort/}
FCOMP="$H5FC -DDAMASK_HDF5"
# AEM
if test "$MARCDLLOUTDIR" = ""; then
DLLOUTDIR="$MARC_LIB"
else
DLLOUTDIR="$MARCDLLOUTDIR"
fi
# settings for MKL
if test "$IMKLDIR" = ""; then
MARC_MKL="$FCOMPROOT/mkl/lib/intel64"
else
MARC_MKL=$IMKLDIR/lib/intel64
fi
#
# settings for Metis
#
METIS="-I$METIS_SOURCE/include"
METISLIBS="$METISLIB_DIR/libmarcddm.a $METISLIB_DIR/libmarcmetis.a "
#
# settings for MPI
#
# RCP and RSH are used for parallel network runs
# replace with similar commands like rsh if needed
RCP=/usr/bin/scp
RSH=/usr/bin/ssh
#
MPI_DEFAULT=intelmpi
MPI_OTHER=hpmpi
MPITYPE=$MPI_DEFAULT
if test $AUTOFORGE
then
if test $AUTOFORGE = 1
then
MPITYPE=none
fi
fi
# overrule MPITYPE setting with environmental variable MARC_MPITYPE
if test $MARC_MPITYPE
then
MPITYPE=$MARC_MPITYPE
fi
# always set MPITYPE to none for MD Nastran
if test "$_OEM_NASTRAN" -ne 0
then
MPITYPE=none
fi
# Edit following lines to build with GPGPU version of BCS Solver for
# NVIDIA platforms
#BCSGPUSOLVER=NONE
BCSGPUSOLVER=BCSGPU
# Edit following lines to set the openssl library
if test "$OPENSSL" != "NONE"
then
OPENSSL_LIB="$MARC_LIB/libcrypto.a"
fi
OPENSSL_INCLUDE=-I"$MARC_OPENSSL/include/"
MARCHDF_HDF=HDF
#MARCHDF_HDF=NONE
if test "$MARCHDF_HDF" = "HDF"; then
HDF_INCLUDE="-I$MARC_HDF/include"
HDF_LIBS="$MARC_LIB/libhdf5_fortran.so.100 $MARC_LIB/libhdf5.so.101"
fi
# activate contact component build if flagged
AEM_DLL=0
if test "$AEM_BUILD" = "ON" ; then
AEM_DLL=1
LINK_MARC_DLL="-shared -fPIC"
EXT_DLL="so"
MPITYPE=none
MPI_OTHER=
BCSGPUSOLVER=NONE
MUMPSSOLVER=NONE
CASISOLVER=NONE
fi
SOLVERFLAGS=
if test "$BCSGPUSOLVER" = BCSGPU
then
SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA"
BCS_DIR=bcsgpusolver
else
BCS_DIR=bcssolver
fi
#
# settings for MPI
#
DDM=
if test $MPITYPE != none
then
if test $MPITYPE = hpmpi
then
FCOMPMPI=mpif90
export MPI_ROOT=$MARC_HPMPI
export MPI_REMSH=$RSH
export MPI_F77=$FCOMP
ARCHITECTURE=linux_amd64
DDM="-I$MPI_ROOT/include/64 -DDDM -DHPMPI"
MPI_CLEAN=
export MPI_EPATH=$MARC_BIN
export LD_LIBRARY_PATH=$MPI_ROOT/lib/$ARCHITECTURE:$MARC_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH
export MPIHPSPECIAL="-e MPI_FLAGS=E,T,y1"
# Below line is moved in run_marc file
# export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
export MPIHPSPECIAL="$MPIHPSPECIAL -e BINDIR=$MARC_BIN"
if test -n "$MSC_LICENSE_FILE"
then
export MPIHPSPECIAL="$MPIHPSPECIAL -e MSC_LICENSE_FILE=$MSC_LICENSE_FILE"
fi
if test -n "$LM_LICENSE_FILE"
then
export MPIHPSPECIAL="$MPIHPSPECIAL -e LM_LICENSE_FILE=$LM_LICENSE_FILE"
fi
export MPIHPSPECIAL="$MPIHPSPECIAL -e MPI_LIC_CHECKER=$MPI_ROOT/bin/licensing/amd64_s8/lichk.x"
RUN_JOB2="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -f "
RUN_JOB1="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -w $MPIHPSPECIAL -np "
RUN_JOB0=
fi
if test $MPITYPE = intelmpi
then
INTELMPI_VERSION=HYDRA
FCOMPMPI=mpiifort
MPI_ROOT=$MARC_INTELMPI
DDM="-I${MPI_ROOT}/include -DDDM"
PATH=$MPI_ROOT/bin:$PATH
export PATH
LD_LIBRARY_PATH=$MPI_ROOT/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
if test $INTELMPI_VERSION = HYDRA
then
RUN_JOB1="${MPI_ROOT}/bin/mpiexec.hydra -genvall -n "
RUN_JOB2="${MPI_ROOT}/bin/mpiexec.hydra -genvall"
else
RUN_JOB1="${MPI_ROOT}/bin/mpiexec -n "
RUN_JOB2="${MPI_ROOT}/bin/mpiexec -configfile "
fi
RUN_JOB0=
MPI_CLEAN=
MPI_EPATH=$MARC_BIN
MPIR_HOME=$MPI_ROOT
MPICH_F77=$FCOMP
MPICH_F77LINKER=$FCOMP
export MPI_ROOT MPI_EPATH MPIR_HOME MPICH_F77 MPICH_F77LINKER
I_MPI_PIN_DOMAIN=node
export I_MPI_PIN_DOMAIN
fi
else
MPI_ROOT=$MARC_DUMMYMPI
export MPI_ROOT=$MARC_DUMMYMPI
DDM="-I$MPI_ROOT/include"
fi
#
# variables for the "maintain" script
#
MACHINENAME=LINUX
MACHINE64BIT=yes
MACHINE=Linux_EM64T
DEV=/dev/tape
GETLOG="whoami"
CLEAR="clear"
MY_UNAME=`uname -a`
# Edit following 2 lines to build with VKI Solver
#VKISOLVER=VKI
VKISOLVER=NONE
# Edit following 2 lines to build with CASI Solver
CASISOLVER=CASI
if test "$MARC_CASISOLVER" = "NONE" ; then
CASISOLVER=NONE
fi
#CASISOLVER=NONE
# Edit following 2 lines to build with MF2 Solver
MF2SOLVER=NONE
#MF2SOLVER=SERIAL
#MF2SOLVER=MF2PARALLEL
# Edit following lines to build with Intel(c) Multithreaded solver (PARDISO)
#INTELSOLVER=NONE
INTELSOLVER=PARDISO
# Edit following lines to build with MUMPS
if test "$MARC_INTEGER_SIZE" = "i4" ; then
#MUMPSSOLVER=NONE
MUMPSSOLVER=MUMPS
else
#MUMPSSOLVER=NONE
MUMPSSOLVER=MUMPS
fi
# Edit following 2 lines to build MARC dynamic shared library
MARC_DLL=MARC_DLL
MARC_DLL=NONE
# always set VKISOLVER, CASISOLVER, BCSGPUSOLVER, and MARC_DLL to NONE for MD Nastran
if test "$_OEM_NASTRAN" -ne 0
then
VKISOLVER=NONE
CASISOLVER=NONE
MF2SOLVER=NONE
INTELSOLVER=NONE
MUMPSSOLVER=NONE
BCSGPUSOLVER=NONE
MARC_DLL=NONE
fi
if test "$AEM_DLL" -eq 1
then
VKISOLVER=NONE
CASISOLVER=NONE
MF2SOLVER=NONE
INTELSOLVER=NONE
MUMPSSOLVER=NONE
BCSGPUSOLVER=NONE
fi
#
# define Fortran and C compile syntax
#
if test "$VKISOLVER" = VKI
then
SOLVERFLAGS="$SOLVERFLAGS -DVKI"
fi
if test "$CASISOLVER" = CASI
then
SOLVERFLAGS="$SOLVERFLAGS -DCASI"
fi
if test "$MF2SOLVER" = MF2PARALLEL
then
SOLVERFLAGS="$SOLVERFLAGS -DMF2PARALLEL"
fi
if test "$MF2SOLVER" = MF2SERIAL
then
SOLVERFLAGS="$SOLVERFLAGS -DMF2SERIAL"
fi
if test "$INTELSOLVER" = PARDISO
then
SOLVERFLAGS="$SOLVERFLAGS -DPARDISO"
fi
if test "$MUMPSSOLVER" = MUMPS
then
SOLVERFLAGS="$SOLVERFLAGS -DMUMPS"
fi
if test "$MARC_DLL" = MARC_DLL
then
SOLVERFLAGS="$SOLVERFLAGS -DMARC_DLL"
fi
LINK_OPT=
DEBUG_OPT=
C_DEBUG_OPT=
#Uncomment following line to build Marc in debuggable mode
MARCDEBUG=
#MARCDEBUG="ON"
if test "$MARCDEBUG" = "ON"
then
LINK_OPT="-debug -traceback"
DEBUG_OPT="-debug -traceback"
C_DEBUG_OPT="-debug -traceback"
fi
MARCCHECK=
#MARCCHECK="ON"
if test "$MARCCHECK" = "ON"
then
DEBUG_OPT="$DEBUG_OPT -fpe0 -fp-stack-check -check all -ftrapuv "
C_DEBUG_OPT="$C_DEBUG_OPT -fp-stack-check -check-uninit -Wformat -ftrapuv "
fi
MARCCODECOV=
#MARCCODECOV="ON"
MARCCODEPROF=
#MARCCODEPROF="ON"
if test "$MARC_INTEGER_SIZE" = "i4" ; then
I8FFLAGS=
I8DEFINES=
I8CDEFINES=
else
I8FFLAGS="-i8 -integer-size 64"
I8DEFINES="-DI64 -DINT=8"
I8CDEFINES="-U_DOUBLE -D_SINGLE"
fi
MTHREAD=OPENMP
if test "$MARC_OPENMP" = "NONE" ; then
MTHREAD=NONE
fi
#MTHREAD=NONE
if test "$_OEM_NASTRAN" -ne 0
then
MTHREAD=NONE
fi
if test "$AEM_DLL" -eq 1
then
MTHREAD=NONE
CASISOLVER=NONE
VKISOLVER=NONE
MF2SOLVER=NONE
INTELSOLVER=NONE
BCSGPUSOLVER=NONE
OPENSSL_LIB=
MARC_DLL=NONE
METISLIBS=
fi
OMP_COMPAT=NO
OMP_COMPAT=YES
if test "$MTHREAD" = "NONE"
then
OMP_COMPAT=NO
fi
CDEFINES=
FDEFINES=
if test "$_OEM_NASTRAN" -ne 0
then
CDEFINES="$CDEFINES -D_OEM_NASTRAN"
FDEFINES="$FDEFINES -D_OEM_NASTRAN"
fi
FDEFINES="$FDEFINES -D_IMPLICITNONE"
if test "$_OEM_NASTRAN" -eq 0
then
FDEFINES="$FDEFINES -DMKL -DOPENMP"
fi
if test "$OMP_COMPAT" = "YES"
then
FDEFINES="$FDEFINES -DOMP_COMPAT"
fi
# -D_MSCMARC
FDEFINES="$FDEFINES -D_MSCMARC $DEBUG_OPT $MARC_SIMUFACT"
CDEFINES="$CDEFINES -D_MSCMARC $C_DEBUG_OPT $I8CDEFINES"
if test "$AEM_DLL" -eq 1
then
FDEFINES="$FDEFINES -D_AEMNL -DAAA"
CDEFINES="$CDEFINES -D_AEMNL -DAAA"
fi
CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource $METIS -I$LAPI_IMPORTS/common/include"
if test "$_OEM_NASTRAN" -ne 0
then
CINCL="$CINCL -I../../include"
fi
CC_OPT=
if test "$MTHREAD" = "OPENMP"
then
CC_OPT=" $CC_OPT -qopenmp"
fi
CC="icc -c $CC_OPT -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE "
CCLOW="icc -c $CC_OPT -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE "
CCHIGH="icc -c $CC_OPT -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE "
if test "$MARCDEBUG" = "ON"
then
CC="icc -c $CC_OPT -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE "
CCLOW="icc $CC_OPT -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE "
CCHIGH="icc $CC_OPT -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE "
fi
LOAD_CC="icc $CC_OPT -O1 -DLinux -DLINUX -DLinux_intel"
CCT="$CC"
CCTLOW="$CCLOW"
CCTHIGH="$CCHIGH"
#PROFILE="-Mprof=func"
#PROFILE="-Mprof=lines"
#PROFILE="-Mprof=func,mpi"
PROFILE=
#PROFILE="-init=snan,arrays -CB -traceback -fpe0 -fp-stack-check -check all -check uninit -ftrapuv"
if test "$MARCCODECOV" = "ON"
then
PROFILE="-prof-gen=srcpos"
fi
if test "$MARCCODEPROF" = "ON"
then
PROFILE=" $PROFILE -pg"
fi
FORT_OPT="-c -implicitnone -stand f08 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr -mp1 -WB -fp-model source"
if test "$MTHREAD" = "OPENMP"
then
FORT_OPT=" $FORT_OPT -qopenmp"
if test "$OMP_COMPAT" = "YES"
then
FORT_OPT=" $FORT_OPT -qopenmp-threadprivate=compat"
fi
else
# FORT_OPT=" $FORT_OPT -auto "
FORT_OPT=" $FORT_OPT -save -zero"
fi
if test "$MARCHDF_HDF" = "HDF"; then
FORT_OPT="$FORT_OPT -DMARCHDF=$MARCHDF_HDF"
fi
FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD"
FORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD"
FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD"
FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM"
# for compiling free form f90 files. high opt, integer(4)
FORTF90="$FCOMP -c -O3"
# determine DAMASK version
if test -n "$DAMASK_USER"; then
DAMASKROOT=`dirname $DAMASK_USER`/..
read DAMASKVERSION < $DAMASKROOT/VERSION
DAMASKVERSION="'"$DAMASKVERSION"'"
else
DAMASKVERSION="'N/A'"
fi
# DAMASK compiler calls: additional flags are in line 2 OpenMP flags in line 3
DFORTLOWMP="$FCOMP -c -O0 -qno-offload -implicitnone -stand f08 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \
-fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2019 -DDAMASKVERSION=$DAMASKVERSION \
-qopenmp -qopenmp-threadprivate=compat\
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD"
DFORTRANMP="$FCOMP -c -O1 -qno-offload -implicitnone -stand f08 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \
-fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2019 -DDAMASKVERSION=$DAMASKVERSION \
-qopenmp -qopenmp-threadprivate=compat\
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD"
DFORTHIGHMP="$FCOMP -c -O3 -qno-offload -implicitnone -stand f08 -standard-semantics -assume nostd_mod_proc_name -safe_cray_ptr $PROFILE -zero -mp1 -WB $I8FFLAGS -I$MARC_SOURCE/common \
-fpp -ftz -diag-disable 5268 -warn declarations -warn general -warn usage -warn interfaces -warn ignore_loc -warn alignments -DMarc4DAMASK=2019 -DDAMASKVERSION=$DAMASKVERSION \
-qopenmp -qopenmp-threadprivate=compat\
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD"
if test "$MARCDEBUG" = "ON"
then
FORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD"
FORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD"
FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD"
FORTNA="$FCOMP $FORT_OPT -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM"
fi
FORTLOWT="$FORTLOW"
FORTRANT="$FORTRAN"
FORTHIGHT="$FORTHIGH"
FORTRANMNF="$FCOMP -c $FDEFINES "
CCMNF="icc -c -O1 -DLinux -DLINUX -DLinux_intel -Dport2egcs -I$MARC_SOURCE/marctoadams/mnf/include -D_LARGEFILE64_SOURCE"
if test $MPITYPE != none
then
if test $MPITYPE = hpmpi
then
LOAD="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o "
LOADT="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o "
fi
# Uncomment the following lines to turn on the tracer and commnet out the next 5 lines
# if test $MPITYPE = intelmpi
# then
# INCLUDEMPI="-I$MPI_ROOT/include -I$VT_ROOT/include"
# LOAD="$MPI_ROOT/bin/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o "
# LOADT="$MPI_ROOT/bin/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o "
# fi
if test $MPITYPE = intelmpi
then
LOAD="ifort $PROFILE $LINK_OPT -o "
LOADT="ifort $PROFILE $LINK_OPT -o "
fi
else
LOAD="$FCOMP $LINK_OPT -o "
LOADT="$FCOMP $LINK_OPT -o "
fi
if test "$MARC_DLL" = MARC_DLL
then
FORTLOW="$FORTLOW -fpp -fPIC"
FORTRAN="$FORTRAN -fpp -fPIC"
FORTHIGH="$FORTHIGH -fpp -fPIC"
FORTRANMNF="$FORTRANMNF -fpp -fPIC"
CC="$CC -fPIC"
CCMNF="$CCMNF -fPIC"
LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide -lpthread"
LINK_MARC_DLL="-shared -fPIC"
LOAD_DLL=$LOAD
LOADT_DLL=$LOADT
EXT_DLL="so"
fi
if test "$AEM_DLL" -eq 1
then
FORTLOW="$FORTLOW -fpp -fPIC"
FORTRAN="$FORTRAN -fpp -fPIC"
FORTHIGH="$FORTHIGH -fpp -fPIC"
FORTRANMNF="$FORTRANMNF -fpp -fPIC"
CC="$CC -fPIC"
CCMNF="$CCMNF -fPIC"
LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide"
LINK_MARC_DLL="-shared -fPIC"
LOAD_DLL=$LOAD
LOADT_DLL=$LOADT
EXT_DLL="so"
fi
XLIBS="-L/usr/X11/lib -lX11 "
#
# define archive and ranlib syntax
#
ARC="ar rvl"
ARD="ar dvl"
ARX="ar xl"
RAN=""
#
# choose which libraries you want to use ( e.g. blas )
#
if test "$VKISOLVER" = VKI
then
VKISOLVERLIBS="$MARC_LIB/vkisolver.a"
else
VKISOLVERLIBS=
fi
if test "$CASISOLVER" = CASI
then
CASISOLVERLIBS="$CASILIB_DIR/libmarccasi.a $CASILIB_DIR/libcasi.a"
else
CASISOLVERLIBS=
fi
MF2SOLVERLIBS=
if test "$MF2SOLVER" = MF2PARALLEL
then
MF2SOLVERLIBS="$MARC_LIB/mf2parallel/libseq.a \
$MARC_LIB/mf2parallel/libsym.a \
$MARC_LIB/mf2parallel/libmet.a \
$MARC_LIB/mf2parallel/libmf2.a \
$MARC_LIB/mf2parallel/libgauss.a \
$MARC_LIB/mf2parallel/libmf2.a \
$MARC_LIB/mf2parallel/libgauss.a \
$MARC_LIB/mf2parallel/libnum.a \
$MARC_LIB/mf2parallel/libutl.a \
$MARC_LIB/mf2parallel/libr8.a \
$MARC_LIB/mf2parallel/libz.a "
fi
if test "$MUMPSSOLVER" = MUMPS
then
MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps.a"
if test $MPITYPE = none
then
MUMPSSOLVERLIBS2=
echo hello > /dev/null
fi
if test $MPITYPE = intelmpi
then
MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.a"
if test "$MARC_INTEGER_SIZE" = "i4" ; then
MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_lp64.a "
else
MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a "
fi
fi
if test $MPITYPE = hpmpi
then
MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_hpmpi.a"
if test "$MARC_INTEGER_SIZE" = "i4" ; then
MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_lp64.a"
else
MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a"
fi
fi
else
MUMPSSOLVERLIBS=
MUMPSSOLVERLIBS2=
fi
if test "$BCSGPUSOLVER" = BCSGPU
then
BCSSOLVERLIBS="${BCSLIB_DIR}/bcsgpulib.a "
MARCCUDALIBS1="-L${BCSLIB_DIR}/cuda_dummy -lmarccuda "
MARCCUDALIBS2="-L${BCSLIB_DIR}/cuda -lmarccuda "
MARCCUDALIBS=$MARCCUDALIBS1
else
BCSSOLVERLIBS="${MARC_LIB}/bcslib.a "
fi
if test "$AEM_DLL" -eq 1
then
BCSSOLVERLIBS=
fi
if test "$MARC_INTEGER_SIZE" = "i4" ; then
MKLLIB="$MARC_MKL/libmkl_scalapack_lp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_lp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a $MARC_MKL/libmkl_blacs_intelmpi_lp64.a $MUMPSSOLVERLIBS2 -Wl,--end-group"
else
MKLLIB="$MARC_MKL/libmkl_scalapack_ilp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_ilp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a $MUMPSSOLVERLIBS2 -Wl,--end-group"
fi
SECLIBS="-L$MARC_LIB -llapi"
SOLVERLIBS="${BCSSOLVERLIBS} ${VKISOLVERLIBS} ${CASISOLVERLIBS} ${MF2SOLVERLIBS} \
$MKLLIB -L$MARC_MKL -liomp5 \
$MARC_LIB/blas_src.a ${ACSI_LIB}/ACSI_MarcLib.a $KDTREE2_LIB/kdtree2.a $HDF5_LIB"
SOLVERLIBS_DLL=${SOLVERLIBS}
if test "$AEM_DLL" -eq 1
then
SOLVERLIBS_DLL="$MKLLIB -L$MARC_MKL -liomp5 $MARC_LIB/blas_src.a"
fi
MRCLIBS="$MARC_LIB/clib.a ${CASISOLVERLIBS}"
MRCLIBSPAR="$MARC_LIB/clib.a"
STUBS="$MARC_LIB/stubs.a "
MNFLIBS="$MARC_LIB/libmnf.a"
MDUSER="$MARC_LIB/md_user.a"
if test "X$MARC_SIMUFACT" != "X"
then
SFLIB="-L$SFMATDIR -lMBA_Grain"
else
SFLIB=" "
fi
OPENMP="-qopenmp"
if test "$AEM_DLL" -eq 1
then
LOAD_DLL=$LOAD
OPENMP=
LIBMNF=
OPENSSL=NONE
fi
SYSLIBS=" $OPENMP -lpthread -cxxlib"
# Uncomment the following lines to turn on the trace and comment out the next 4 lines
# if test $MPITYPE = intelmpi
# then
# SYSLIBS="-L${VT_ROOT}/lib -lVT -ldwarf -lelf -lm -lpthread \
# -L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt"
# fi
if test $MPITYPE = intelmpi
then
SYSLIBS="-L${MPI_ROOT}/lib -lmpi_mt -lmpifort -lrt $OPENMP -threads -lpthread -cxxlib"
fi
SYSLIBSPAR=" "
MARC_DLL_CODES="runmarc.f"
BLAS_SRC="dzero.f icopy.f izero.f"
if test "$_OEM_NASTRAN" -ne 0
then
if test "$MARC_INTEGER_SIZE" = "i4" ; then
BLAS_SRC="$BLAS_SRC dsctr.f zsctr.f dzasum.f daxpyi.f zaxpyi.f dgthr.f zgthr.f"
else
BLAS_SRC="ALL"
fi
fi
LOW_OPT_CODES="are163.f contro.f ndext.f omarc.f omarca.f omarcb.f omarcc.f \
omars.f fixbc.f triang.f bet049.f norst3.f eldata.f \
elec*.f elct*.f fmeig.f oada00.f ogeig.f updtrbe2.f cycrota.f \
cordef.f ogpk.f ogtan.f eldam.f formrbe3.f \
inertie.f em_sso072.f cn_fol3d_qpatch6.f cosim_begin.f"
if test "$MARC_INTEGER_SIZE" = "i8" ; then
LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f"
fi
HIGH_OPT_CODES="dpsmsa1.f dpsmsa2.f dpsmsa3.f dpsmsa4.f dpsmsa5.f dpsmsa6.f \
dpsmsa7.f dpsmsa8.f dpsmsa9.f dpsmsa10.f dpsmsa11.f dpsmsa12.f \
dpsmsa13.f dpsmsa14.f dpsmsa15.f dpsmsa16.f dpsmsah.f tpsmsah.f cn_qsort4_11.f \
prei11.f prei12.f prei31.f prei32.f prei41.f prei42.f prei61.f prei62.f \
prei1n.f prei2n.f cgfullnts1.f cgfullnts2.f cg1n.f cg2n.f cg3n.f \
cg4n.f cg5n.f cg6n.f cgnn.f sortab.f sortab1.f triann1.f preinv_nts.f "
MAXNUM=1000000

View File

@ -0,0 +1,788 @@
#
# General definitions for the Marc 2019 FP1 version
#
# EM64T
#
# Linux RedHat 7.1, 7.3 / SuSE 11 SP4, 12 SP1
#
# 64 bit MPI version
#
# Intel(R) Fortran Intel(R) 64 Compiler XE for applications
# running on Intel(R) 64, Version 17.0.5.239 Build 20170817
#
# Intel(R) C Intel(R) 64 Compiler XE for applications
# running on Intel(R) 64, Version 17.0.5.239 Build 20170817
#
# To check the O/S level, type:
# uname -a
#
# Distributed parallel MPI libraries:
# 1) HP MPI 2.3
# To check the mpi version, type:
# mpirun -version
# 2) Intel MPI 2017.1
# To check the mpi version, type:
# mpiexec.hydra -version
#
# To check the Compiler level, type using the compiler
# installation path:
# ifort -V
# icc -V
#
# REMARKS : This file contains the definitions of variables used during
# compilation loading and use of the MARC programmes . The
# current machine type is identified by means of the variable
# MACHINE , defined below.
#
#
# MPI_ROOT: root directory in which mpi shared libraries, etc. are located
# DIRJOB : directory in which spawned jobs should look for Marc input
# MPI_ARCH: system architecture
# MPI_EPATH: path where executable resides
#
REVISION="VERSION, BUILD"
HOSTNAME=`hostname`
# find available memory in Mbyte on the machine
# can be set explicitly
MEMLIMIT=`free -m | awk '/Mem:/ {print $2}'`
# set _OEM_NASTRAN to 1 for MD Nastran build
# override _OEM_NASTRAN setting with MARC_MD_NASTRAN environment variable
_OEM_NASTRAN="${MARC_MD_NASTRAN:-0}"
# uncomment the following line for an autoforge build
#AUTOFORGE=1
AUTOFORGE=0
export AUTOFORGE
# integer size
if test "$MARC_INTEGER_SIZE" = "" ; then
INTEGER_PATH=
else
INTEGER_PATH=/$MARC_INTEGER_SIZE
fi
FCOMP=ifort
INTELPATH="/opt/intel/compilers_and_libraries_2017/linux"
# find the root directory of the compiler installation:
# - if ifort is found in $PATH, then the root directory is derived
# from the path to ifort
# - if ifort is not found in $PATH, the root directory is assumed
# to be $INTELPATH and the directory in which ifort is found is
# added to $PATH
FCOMPPATH=`which "$FCOMP" 2>/dev/null`
if test -n "$FCOMPPATH"; then
# derive the root directory from $FCOMPPATH
FCOMPROOT="${FCOMPPATH%/bin/intel64/$FCOMP}"
if test "$FCOMPROOT" = "$FCOMPPATH"; then
FCOMPROOT="${FCOMPPATH%/bin/$FCOMP}"
fi
if test "$FCOMPROOT" = "$FCOMPPATH"; then
FCOMPROOT=
fi
elif test -d "$INTELPATH"; then
# check for compiler in $INTELPATH
if test -d "$INTELPATH/bin/intel64" -a \
-x "$INTELPATH/bin/intel64/$FCOMP" ; then
FCOMPROOT="$INTELPATH"
PATH="$INTELPATH/bin/intel64:$PATH"
elif test -d "$INTELPATH/bin" -a \
-x "$INTELPATH/bin/$FCOMP"; then
FCOMPROOT="$INTELPATH"
PATH="$INTELPATH/bin:$PATH"
else
FCOMPROOT=
fi
else
FCOMPROOT=
fi
# AEM
if test "$MARCDLLOUTDIR" = ""; then
DLLOUTDIR="$MARC_LIB"
else
DLLOUTDIR="$MARCDLLOUTDIR"
fi
# settings for MKL
if test "$IMKLDIR" = ""; then
MARC_MKL="$FCOMPROOT/mkl/lib/intel64"
else
MARC_MKL=$IMKLDIR/lib/intel64
fi
#
# settings for Metis
#
METIS="-I$METIS_SOURCE/include"
METISLIBS="$METISLIB_DIR/libmarcddm.a $METISLIB_DIR/libmarcmetis.a "
#
# settings for MPI
#
# RCP and RSH are used for parallel network runs
# replace with similar commands like rsh if needed
RCP=/usr/bin/scp
RSH=/usr/bin/ssh
#
MPI_DEFAULT=intelmpi
MPI_OTHER=hpmpi
MPITYPE=$MPI_DEFAULT
if test $AUTOFORGE
then
if test $AUTOFORGE = 1
then
MPITYPE=none
fi
fi
# overrule MPITYPE setting with environmental variable MARC_MPITYPE
if test $MARC_MPITYPE
then
MPITYPE=$MARC_MPITYPE
fi
# always set MPITYPE to none for MD Nastran
if test "$_OEM_NASTRAN" -ne 0
then
MPITYPE=none
fi
# Edit following lines to build with GPGPU version of BCS Solver for
# NVIDIA platforms
#BCSGPUSOLVER=NONE
BCSGPUSOLVER=BCSGPU
# Edit following lines to set the openssl library
if test "$OPENSSL" != "NONE"
then
OPENSSL_LIB="$MARC_LIB/libcrypto.a"
fi
OPENSSL_INCLUDE=-I"$MARC_OPENSSL/include/"
MARCHDF_HDF=HDF
#MARCHDF_HDF=NONE
if test "$MARCHDF_HDF" = "HDF"; then
HDF_INCLUDE="-I$MARC_HDF/include"
HDF_LIBS="$MARC_LIB/libhdf5_fortran.so.100 $MARC_LIB/libhdf5.so.101"
fi
# activate contact component build if flagged
AEM_DLL=0
if test "$AEM_BUILD" = "ON" ; then
AEM_DLL=1
LINK_MARC_DLL="-shared -fPIC"
EXT_DLL="so"
MPITYPE=none
MPI_OTHER=
BCSGPUSOLVER=NONE
MUMPSSOLVER=NONE
CASISOLVER=NONE
fi
SOLVERFLAGS=
if test "$BCSGPUSOLVER" = BCSGPU
then
SOLVERFLAGS="$SOLVERFLAGS -DBCSGPU -DCUDA"
BCS_DIR=bcsgpusolver
else
BCS_DIR=bcssolver
fi
#
# settings for MPI
#
DDM=
if test $MPITYPE != none
then
if test $MPITYPE = hpmpi
then
FCOMPMPI=mpif90
export MPI_ROOT=$MARC_HPMPI
export MPI_REMSH=$RSH
export MPI_F77=$FCOMP
ARCHITECTURE=linux_amd64
DDM="-I$MPI_ROOT/include/64 -DDDM -DHPMPI"
MPI_CLEAN=
export MPI_EPATH=$MARC_BIN
export LD_LIBRARY_PATH=$MPI_ROOT/lib/$ARCHITECTURE:$MARC_LIB:$MARC_LIB_SHARED:$LD_LIBRARY_PATH
export MPIHPSPECIAL="-e MPI_FLAGS=E,T,y1"
# Below line is moved in run_marc file
# export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
export MPIHPSPECIAL="$MPIHPSPECIAL -e BINDIR=$MARC_BIN"
if test -n "$MSC_LICENSE_FILE"
then
export MPIHPSPECIAL="$MPIHPSPECIAL -e MSC_LICENSE_FILE=$MSC_LICENSE_FILE"
fi
if test -n "$LM_LICENSE_FILE"
then
export MPIHPSPECIAL="$MPIHPSPECIAL -e LM_LICENSE_FILE=$LM_LICENSE_FILE"
fi
export MPIHPSPECIAL="$MPIHPSPECIAL -e MPI_LIC_CHECKER=$MPI_ROOT/bin/licensing/amd64_s8/lichk.x"
RUN_JOB2="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -f "
RUN_JOB1="$MPI_ROOT/bin/mpirun ${MPIRUNOPTIONS} -prot -w $MPIHPSPECIAL -np "
RUN_JOB0=
fi
if test $MPITYPE = intelmpi
then
INTELMPI_VERSION=HYDRA
FCOMPMPI=mpiifort
MPI_ROOT=$MARC_INTELMPI
DDM="-I${MPI_ROOT}/include -DDDM"
PATH=$MPI_ROOT/bin:$PATH
export PATH
LD_LIBRARY_PATH=$MPI_ROOT/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
if test $INTELMPI_VERSION = HYDRA
then
RUN_JOB1="${MPI_ROOT}/bin/mpiexec.hydra -genvall -n "
RUN_JOB2="${MPI_ROOT}/bin/mpiexec.hydra -genvall"
else
RUN_JOB1="${MPI_ROOT}/bin/mpiexec -n "
RUN_JOB2="${MPI_ROOT}/bin/mpiexec -configfile "
fi
RUN_JOB0=
MPI_CLEAN=
MPI_EPATH=$MARC_BIN
MPIR_HOME=$MPI_ROOT
MPICH_F77=$FCOMP
MPICH_F77LINKER=$FCOMP
export MPI_ROOT MPI_EPATH MPIR_HOME MPICH_F77 MPICH_F77LINKER
I_MPI_PIN_DOMAIN=node
export I_MPI_PIN_DOMAIN
fi
else
MPI_ROOT=$MARC_DUMMYMPI
export MPI_ROOT=$MARC_DUMMYMPI
DDM="-I$MPI_ROOT/include"
fi
#
# variables for the "maintain" script
#
MACHINENAME=LINUX
MACHINE64BIT=yes
MACHINE=Linux_EM64T
DEV=/dev/tape
GETLOG="whoami"
CLEAR="clear"
MY_UNAME=`uname -a`
# Edit following 2 lines to build with VKI Solver
#VKISOLVER=VKI
VKISOLVER=NONE
# Edit following 2 lines to build with CASI Solver
CASISOLVER=CASI
if test "$MARC_CASISOLVER" = "NONE" ; then
CASISOLVER=NONE
fi
#CASISOLVER=NONE
# Edit following 2 lines to build with MF2 Solver
MF2SOLVER=NONE
#MF2SOLVER=SERIAL
#MF2SOLVER=MF2PARALLEL
# Edit following lines to build with Intel(c) Multithreaded solver (PARDISO)
#INTELSOLVER=NONE
INTELSOLVER=PARDISO
# Edit following lines to build with MUMPS
if test "$MARC_INTEGER_SIZE" = "i4" ; then
#MUMPSSOLVER=NONE
MUMPSSOLVER=MUMPS
else
#MUMPSSOLVER=NONE
MUMPSSOLVER=MUMPS
fi
# Edit following 2 lines to build MARC dynamic shared library
MARC_DLL=MARC_DLL
MARC_DLL=NONE
# always set VKISOLVER, CASISOLVER, BCSGPUSOLVER, and MARC_DLL to NONE for MD Nastran
if test "$_OEM_NASTRAN" -ne 0
then
VKISOLVER=NONE
CASISOLVER=NONE
MF2SOLVER=NONE
INTELSOLVER=NONE
MUMPSSOLVER=NONE
BCSGPUSOLVER=NONE
MARC_DLL=NONE
fi
if test "$AEM_DLL" -eq 1
then
VKISOLVER=NONE
CASISOLVER=NONE
MF2SOLVER=NONE
INTELSOLVER=NONE
MUMPSSOLVER=NONE
BCSGPUSOLVER=NONE
fi
#
# define Fortran and C compile syntax
#
if test "$VKISOLVER" = VKI
then
SOLVERFLAGS="$SOLVERFLAGS -DVKI"
fi
if test "$CASISOLVER" = CASI
then
SOLVERFLAGS="$SOLVERFLAGS -DCASI"
fi
if test "$MF2SOLVER" = MF2PARALLEL
then
SOLVERFLAGS="$SOLVERFLAGS -DMF2PARALLEL"
fi
if test "$MF2SOLVER" = MF2SERIAL
then
SOLVERFLAGS="$SOLVERFLAGS -DMF2SERIAL"
fi
if test "$INTELSOLVER" = PARDISO
then
SOLVERFLAGS="$SOLVERFLAGS -DPARDISO"
fi
if test "$MUMPSSOLVER" = MUMPS
then
SOLVERFLAGS="$SOLVERFLAGS -DMUMPS"
fi
if test "$MARC_DLL" = MARC_DLL
then
SOLVERFLAGS="$SOLVERFLAGS -DMARC_DLL"
fi
LINK_OPT=
DEBUG_OPT=
C_DEBUG_OPT=
#Uncomment following line to build Marc in debuggable mode
MARCDEBUG=
#MARCDEBUG="ON"
if test "$MARCDEBUG" = "ON"
then
LINK_OPT="-debug -traceback"
DEBUG_OPT="-debug -traceback"
C_DEBUG_OPT="-debug -traceback"
fi
MARCCHECK=
#MARCCHECK="ON"
if test "$MARCCHECK" = "ON"
then
DEBUG_OPT="$DEBUG_OPT -fpe0 -fp-stack-check -check all -ftrapuv "
C_DEBUG_OPT="$C_DEBUG_OPT -fp-stack-check -check-uninit -Wformat -ftrapuv "
fi
MARCCODECOV=
#MARCCODECOV="ON"
MARCCODEPROF=
#MARCCODEPROF="ON"
if test "$MARC_INTEGER_SIZE" = "i4" ; then
I8FFLAGS=
I8DEFINES=
I8CDEFINES=
else
I8FFLAGS="-i8"
I8DEFINES="-DI64"
I8CDEFINES="-U_DOUBLE -D_SINGLE"
fi
MTHREAD=OPENMP
if test "$MARC_OPENMP" = "NONE" ; then
MTHREAD=NONE
fi
#MTHREAD=NONE
if test "$_OEM_NASTRAN" -ne 0
then
MTHREAD=NONE
fi
if test "$AEM_DLL" -eq 1
then
MTHREAD=NONE
CASISOLVER=NONE
VKISOLVER=NONE
MF2SOLVER=NONE
INTELSOLVER=NONE
BCSGPUSOLVER=NONE
OPENSSL_LIB=
MARC_DLL=NONE
METISLIBS=
fi
OMP_COMPAT=NO
OMP_COMPAT=YES
if test "$MTHREAD" = "NONE"
then
OMP_COMPAT=NO
fi
CDEFINES=
FDEFINES=
if test "$_OEM_NASTRAN" -ne 0
then
CDEFINES="$CDEFINES -D_OEM_NASTRAN"
FDEFINES="$FDEFINES -D_OEM_NASTRAN"
fi
FDEFINES="$FDEFINES -D_IMPLICITNONE"
if test "$_OEM_NASTRAN" -eq 0
then
FDEFINES="$FDEFINES -DMKL -DOPENMP"
fi
if test "$OMP_COMPAT" = "YES"
then
FDEFINES="$FDEFINES -DOMP_COMPAT"
fi
# -D_MSCMARC
FDEFINES="$FDEFINES -D_MSCMARC $DEBUG_OPT $MARC_SIMUFACT"
CDEFINES="$CDEFINES -D_MSCMARC $C_DEBUG_OPT $I8CDEFINES"
if test "$AEM_DLL" -eq 1
then
FDEFINES="$FDEFINES -D_AEMNL -DAAA"
CDEFINES="$CDEFINES -D_AEMNL -DAAA"
fi
CINCL="-I$MARC_SOURCE/mdsrc -I$MARC_SOURCE/csource $METIS -I$LAPI_IMPORTS/common/include"
if test "$_OEM_NASTRAN" -ne 0
then
CINCL="$CINCL -I../../include"
fi
CC_OPT=
if test "$MTHREAD" = "OPENMP"
then
CC_OPT=" $CC_OPT -qopenmp"
fi
CC="icc -c $CC_OPT -O1 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE "
CCLOW="icc -c $CC_OPT -O0 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE "
CCHIGH="icc -c $CC_OPT -O3 $I8DEFINES -DLinux -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE "
if test "$MARCDEBUG" = "ON"
then
CC="icc -c $CC_OPT -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE "
CCLOW="icc $CC_OPT -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE "
CCHIGH="icc $CC_OPT -c -DLinux $I8DEFINES -DLINUX -DLinux_intel $CDEFINES $CINCL $SOLVERFLAGS $OPENSSL_INCLUDE "
fi
LOAD_CC="icc $CC_OPT -O1 -DLinux -DLINUX -DLinux_intel"
CCT="$CC"
CCTLOW="$CCLOW"
CCTHIGH="$CCHIGH"
#PROFILE="-Mprof=func"
#PROFILE="-Mprof=lines"
#PROFILE="-Mprof=func,mpi"
PROFILE=
#PROFILE="-init=snan,arrays -CB -traceback -fpe0 -fp-stack-check -check all -check uninit -ftrapuv"
if test "$MARCCODECOV" = "ON"
then
PROFILE="-prof-gen=srcpos"
fi
if test "$MARCCODEPROF" = "ON"
then
PROFILE=" $PROFILE -pg"
fi
FORT_OPT="-c -assume byterecl -safe_cray_ptr -mp1 -WB -fp-model source"
if test "$MTHREAD" = "OPENMP"
then
FORT_OPT=" $FORT_OPT -qopenmp"
if test "$OMP_COMPAT" = "YES"
then
FORT_OPT=" $FORT_OPT -qopenmp-threadprivate=compat"
fi
else
# FORT_OPT=" $FORT_OPT -auto "
FORT_OPT=" $FORT_OPT -save -zero"
fi
if test "$MARCHDF_HDF" = "HDF"; then
FORT_OPT="$FORT_OPT -DMARCHDF_HDF=$MARCHDF_HDF $HDF_INCLUDE"
fi
FORTLOW="$FCOMP $FORT_OPT $PROFILE -O0 $I8FFLAGS -I$MARC_SOURCE/common \
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD"
FORTRAN="$FCOMP $FORT_OPT $PROFILE -O1 $I8FFLAGS -I$MARC_SOURCE/common \
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD"
FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD"
FORTNA="$FCOMP $FORT_OPT -fno-alias -O3 $I8FFLAGS -I$MARC_SOURCE/common \
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM"
# for compiling free form f90 files. high opt, integer(4)
FORTF90="$FCOMP -c -O3"
if test "$MARCDEBUG" = "ON"
then
FORTLOW="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD"
FORTRAN="$FCOMP $FORT_OPT $PROFILE $I8FFLAGS -I$MARC_SOURCE/common \
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD"
FORTHIGH="$FCOMP $FORT_OPT $PROFILE -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM $SOLVERFLAGS -I$KDTREE2_MOD"
FORTNA="$FCOMP $FORT_OPT -fno-alias $I8FFLAGS -I$MARC_SOURCE/common \
$MUMPS_INCLUDE $I8DEFINES -DLinux -DLINUX -DLinux_intel $FDEFINES $DDM"
fi
FORTLOWT="$FORTLOW"
FORTRANT="$FORTRAN"
FORTHIGHT="$FORTHIGH"
FORTRANMNF="$FCOMP -c $FDEFINES "
CCMNF="icc -c -O1 -DLinux -DLINUX -DLinux_intel -Dport2egcs -I$MARC_SOURCE/marctoadams/mnf/include -D_LARGEFILE64_SOURCE"
if test $MPITYPE != none
then
if test $MPITYPE = hpmpi
then
LOAD="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o "
LOADT="$MPI_ROOT/bin/$FCOMPMPI ${LOADOPTIONS} -L$MPI_ROOT/lib/$ARCHITECTURE $PROFILE $LINK_OPT -o "
fi
# Uncomment the following lines to turn on the tracer and commnet out the next 5 lines
# if test $MPITYPE = intelmpi
# then
# INCLUDEMPI="-I$MPI_ROOT/include -I$VT_ROOT/include"
# LOAD="$MPI_ROOT/bin/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o "
# LOADT="$MPI_ROOT/bin/$FCOMPMPI $PROFILE $INCLUDEMPI -g -t=log $LINK_OPT -o "
# fi
if test $MPITYPE = intelmpi
then
LOAD="ifort $PROFILE $LINK_OPT -o "
LOADT="ifort $PROFILE $LINK_OPT -o "
fi
else
LOAD="$FCOMP $LINK_OPT -o "
LOADT="$FCOMP $LINK_OPT -o "
fi
if test "$MARC_DLL" = MARC_DLL
then
FORTLOW="$FORTLOW -fpp -fPIC"
FORTRAN="$FORTRAN -fpp -fPIC"
FORTHIGH="$FORTHIGH -fpp -fPIC"
FORTRANMNF="$FORTRANMNF -fpp -fPIC"
CC="$CC -fPIC"
CCMNF="$CCMNF -fPIC"
LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide -lpthread"
LINK_MARC_DLL="-shared -fPIC"
LOAD_DLL=$LOAD
LOADT_DLL=$LOADT
EXT_DLL="so"
fi
if test "$AEM_DLL" -eq 1
then
FORTLOW="$FORTLOW -fpp -fPIC"
FORTRAN="$FORTRAN -fpp -fPIC"
FORTHIGH="$FORTHIGH -fpp -fPIC"
FORTRANMNF="$FORTRANMNF -fpp -fPIC"
CC="$CC -fPIC"
CCMNF="$CCMNF -fPIC"
LINK_EXE_MARC="-L$MARC_LIB -lmarc -L$MARC_LIB_SHARED -lguide"
LINK_MARC_DLL="-shared -fPIC"
LOAD_DLL=$LOAD
LOADT_DLL=$LOADT
EXT_DLL="so"
fi
XLIBS="-L/usr/X11/lib -lX11 "
#
# define archive and ranlib syntax
#
ARC="ar rvl"
ARD="ar dvl"
ARX="ar xl"
RAN=""
#
# choose which libraries you want to use ( e.g. blas )
#
if test "$VKISOLVER" = VKI
then
VKISOLVERLIBS="$MARC_LIB/vkisolver.a"
else
VKISOLVERLIBS=
fi
if test "$CASISOLVER" = CASI
then
CASISOLVERLIBS="$CASILIB_DIR/libmarccasi.a $CASILIB_DIR/libcasi.a"
else
CASISOLVERLIBS=
fi
MF2SOLVERLIBS=
if test "$MF2SOLVER" = MF2PARALLEL
then
MF2SOLVERLIBS="$MARC_LIB/mf2parallel/libseq.a \
$MARC_LIB/mf2parallel/libsym.a \
$MARC_LIB/mf2parallel/libmet.a \
$MARC_LIB/mf2parallel/libmf2.a \
$MARC_LIB/mf2parallel/libgauss.a \
$MARC_LIB/mf2parallel/libmf2.a \
$MARC_LIB/mf2parallel/libgauss.a \
$MARC_LIB/mf2parallel/libnum.a \
$MARC_LIB/mf2parallel/libutl.a \
$MARC_LIB/mf2parallel/libr8.a \
$MARC_LIB/mf2parallel/libz.a "
fi
if test "$MUMPSSOLVER" = MUMPS
then
MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps.a"
if test $MPITYPE = none
then
MUMPSSOLVERLIBS2=
echo hello > /dev/null
fi
if test $MPITYPE = intelmpi
then
MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_intelmpi.a"
if test "$MARC_INTEGER_SIZE" = "i4" ; then
MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_lp64.a "
else
MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a "
fi
fi
if test $MPITYPE = hpmpi
then
MUMPSSOLVERLIBS="$MUMPSLIB_DIR/libmumps_hpmpi.a"
if test "$MARC_INTEGER_SIZE" = "i4" ; then
MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_lp64.a"
else
MUMPSSOLVERLIBS2=" $MARC_MKL/libmkl_blacs_intelmpi_ilp64.a"
fi
fi
else
MUMPSSOLVERLIBS=
MUMPSSOLVERLIBS2=
fi
if test "$BCSGPUSOLVER" = BCSGPU
then
BCSSOLVERLIBS="${BCSLIB_DIR}/bcsgpulib.a "
MARCCUDALIBS1="-L${BCSLIB_DIR}/cuda_dummy -lmarccuda "
MARCCUDALIBS2="-L${BCSLIB_DIR}/cuda -lmarccuda "
MARCCUDALIBS=$MARCCUDALIBS1
else
BCSSOLVERLIBS="${MARC_LIB}/bcslib.a "
fi
if test "$AEM_DLL" -eq 1
then
BCSSOLVERLIBS=
fi
if test "$MARC_INTEGER_SIZE" = "i4" ; then
MKLLIB="$MARC_MKL/libmkl_scalapack_lp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_lp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a $MUMPSSOLVERLIBS2 -Wl,--end-group"
else
MKLLIB="$MARC_MKL/libmkl_scalapack_ilp64.a -Wl,--start-group $MARC_MKL/libmkl_intel_ilp64.a $MARC_MKL/libmkl_intel_thread.a $MARC_MKL/libmkl_core.a $MUMPSSOLVERLIBS2 -Wl,--end-group"
fi
SECLIBS="-L$MARC_LIB -llapi"
SOLVERLIBS="${BCSSOLVERLIBS} ${VKISOLVERLIBS} ${CASISOLVERLIBS} ${MF2SOLVERLIBS} \
$MKLLIB -L$MARC_MKL -liomp5 \
$MARC_LIB/blas_src.a ${ACSI_LIB}/ACSI_MarcLib.a $KDTREE2_LIB/kdtree2.a $HDF_LIBS"
SOLVERLIBS_DLL=${SOLVERLIBS}
if test "$AEM_DLL" -eq 1
then
SOLVERLIBS_DLL="$MKLLIB -L$MARC_MKL -liomp5 $MARC_LIB/blas_src.a"
fi
MRCLIBS="$MARC_LIB/clib.a ${CASISOLVERLIBS}"
MRCLIBSPAR="$MARC_LIB/clib.a"
STUBS="$MARC_LIB/stubs.a "
MNFLIBS="$MARC_LIB/libmnf.a"
MDUSER="$MARC_LIB/md_user.a"
if test "X$MARC_SIMUFACT" != "X"
then
SFLIB="-L$SFMATDIR -lMBA_Grain"
else
SFLIB=" "
fi
OPENMP="-qopenmp"
if test "$AEM_DLL" -eq 1
then
LOAD_DLL=$LOAD
OPENMP=
LIBMNF=
OPENSSL=NONE
fi
SYSLIBS=" $OPENMP -lpthread -shared-intel -cxxlib"
# Uncomment the following lines to turn on the trace and comment out the next 4 lines
# if test $MPITYPE = intelmpi
# then
# SYSLIBS="-L${VT_ROOT}/lib -lVT -ldwarf -lelf -lm -lpthread \
# -L${MPI_ROOT}/lib64 -lmpi -lmpiif -lmpigi -lrt"
# fi
if test $MPITYPE = intelmpi
then
SYSLIBS="-L${MPI_ROOT}/lib -lmpi_mt -lmpifort -lrt $OPENMP -threads -lpthread -shared-intel -cxxlib"
fi
SYSLIBSPAR=" "
MARC_DLL_CODES="runmarc.f"
BLAS_SRC="dzero.f icopy.f izero.f"
if test "$_OEM_NASTRAN" -ne 0
then
if test "$MARC_INTEGER_SIZE" = "i4" ; then
BLAS_SRC="$BLAS_SRC dsctr.f zsctr.f dzasum.f daxpyi.f zaxpyi.f dgthr.f zgthr.f"
else
BLAS_SRC="ALL"
fi
fi
LOW_OPT_CODES="are163.f contro.f ndext.f omarc.f omarca.f omarcb.f omarcc.f \
omars.f fixbc.f triang.f bet049.f norst3.f eldata.f \
elec*.f elct*.f fmeig.f oada00.f ogeig.f updtrbe2.f cycrota.f \
cordef.f ogpk.f ogtan.f eldam.f formrbe3.f \
inertie.f em_sso072.f cn_fol3d_qpatch6.f cosim_begin.f"
if test "$MARC_INTEGER_SIZE" = "i8" ; then
LOW_OPT_CODES="$LOW_OPT_CODES bbcseg.f"
fi
HIGH_OPT_CODES="dpsmsa1.f dpsmsa2.f dpsmsa3.f dpsmsa4.f dpsmsa5.f dpsmsa6.f \
dpsmsa7.f dpsmsa8.f dpsmsa9.f dpsmsa10.f dpsmsa11.f dpsmsa12.f \
dpsmsa13.f dpsmsa14.f dpsmsa15.f dpsmsa16.f dpsmsah.f tpsmsah.f cn_qsort4_11.f \
prei11.f prei12.f prei31.f prei32.f prei41.f prei42.f prei61.f prei62.f \
prei1n.f prei2n.f cgfullnts1.f cgfullnts2.f cg1n.f cg2n.f cg3n.f \
cg4n.f cg5n.f cg6n.f cgnn.f sortab.f sortab1.f triann1.f preinv_nts.f "
MAXNUM=1000000

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
#!/bin/sh
# This script opens a window running an editor.
# The command to invoke the editor is specified during DAMASK installation
%EDITOR% $*

View File

@ -0,0 +1,18 @@
#!/bin/sh
# This script opens a window running an editor. The default window is an
# xterm, and the default editor is vi. These may be customized.
dir=
for d in /usr/bin /usr/bin/X11; do
if test -x "$d/xterm"; then
dir="$d"
break
fi
done
if test -z "$dir"; then
echo "$0: Could not find xterm"
exit 1
fi
"$dir/xterm" -T "vi $*" -n "vi $*" -e vi $*

View File

@ -0,0 +1,8 @@
#!/bin/sh
if [ "$1" = "" ]; then
echo "usage: $0 job_name"
exit 1
fi
echo STOP > $1.cnt

View File

@ -0,0 +1,8 @@
#!/bin/sh
if [ "$1" = "" ]; then
echo "usage: $0 job_name"
exit 1
fi
echo STOP > $1.cnt

View File

@ -0,0 +1,8 @@
#!/bin/sh
if [ "$1" = "" ]; then
echo "usage: $0 job_name"
exit 1
fi
echo STOP > $1.cnt

View File

@ -0,0 +1,8 @@
#!/bin/sh
if [ "$1" = "" ]; then
echo "usage: $0 job_name"
exit 1
fi
echo STOP > $1.cnt

View File

@ -0,0 +1,189 @@
#!/bin/sh
#
# The exit status of this script is read by Mentat.
# Normal exit status is 0.
#
DIR=/nethome/f.roters/temp/msc/marc2019.1
if test $MARCDIR1
then
DIR=$MARCDIR1
fi
if test -z "$DIR"; then
REALCOM="`ls -l $0 |awk '{ print $NF; }'`"
DIRSCRIPT=`dirname $REALCOM`
case $DIRSCRIPT in
\/*)
;;
*)
DIRSCRIPT=`pwd`/$DIRSCRIPT
;;
esac
. $DIRSCRIPT/getarch
DIR="$MENTAT_MARCDIR"
fi
SRCEXT=.f
SRCEXTC=.F
RSTEXT=.t08
PSTEXT=.t19
PSTEXTB=.t16
VWFCEXT=.vfs
slv=$1
version=$2
ndom_fea_solver=$3
ndom_preprocessor=$4
hostfile=$5
compat=$6
job=$7
srcfile=$8
srcmeth=$9
shift 9 # cannot use $10, $11, ...
restart=$1
postfile=$2
viewfactorsfile=$3
copy_datfile="-ci $4"
copy_postfile="-cr $5"
scr_dir=$6
dcoup=$7
assem_recov_nthread=$8
nthread=$9
shift 9 # cannot use $10, $11, ...
nsolver=$1
mode=$2
gpu=$3
if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then
slv="-iam sfm"
fi
if [ "$slv" == "marc" ]; then
slv=""
fi
if [ "$slv" == "datfit" ]; then
slv="-iam datfit"
fi
if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then
nprocds="-nprocds $ndom_fea_solver"
else
nprocd=""
if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then
nprocd="-nprocd $ndom_preprocessor"
else
nprocd=""
fi
fi
if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then
srcfile=`echo $srcfile | sed "s/$SRCEXT$//" | sed "s/$SRCEXTC$//"`
case "$srcmeth" in
-)
srcfile="-u $srcfile"
;;
compsave)
srcfile="-u $srcfile -save y"
;;
runsaved)
srcfile="-prog $srcfile"
;;
esac
else
srcfile=""
fi
if [ "$restart" != "" -a "$restart" != "-" ]; then
restart=`echo $restart | sed "s/$RSTEXT$//"`
restart="-r $restart"
else
restart=""
fi
if [ "$postfile" != "" -a "$postfile" != "-" ]; then
postfile=`echo $postfile | sed "s/$PSTEXT$//"`
postfile=`echo $postfile | sed "s/$PSTEXTB$//"`
postfile="-pid $postfile"
else
postfile=""
fi
if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then
viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"`
viewfactorsfile="-vf $viewfactorsfile"
else
viewfactorsfile=""
fi
if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then
hostfile="-ho $hostfile"
else
hostfile=""
fi
if [ "$compat" != "" -a "$compat" != "-" ]; then
compat="-co $compat"
else
compat=""
fi
if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then
scr_dir="-sd $scr_dir"
else
scr_dir=""
fi
if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then
dcoup="-dcoup $dcoup"
else
dcoup=""
fi
if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then
assem_recov_nthread="-nthread_elem $assem_recov_nthread"
else
assem_recov_nthread=""
fi
if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then
nthread="-nthread $nthread"
else
nthread=""
fi
if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then
nsolver="-nsolver $nsolver"
else
nsolver=""
fi
case "$mode" in
4) mode="-mo i4" ;;
8) mode="-mo i8" ;;
*) mode= ;;
esac
if [ "$gpu" != "" -a "$gpu" != "-" ]; then
gpu="-gpu $gpu"
else
gpu=""
fi
rm -f $job.cnt
rm -f $job.sts
rm -f $job.out
rm -f $job.log
# To prevent a mismatch with the python version used by the solver
# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH
# unset environment variables PYTHONHOME and PYTHONPATH
unset PYTHONHOME
unset PYTHONPATH
"${DIR}/tools/run_marc" $slv -j $job -v n -b y $nprocds $nprocd \
$srcfile $restart $postfile $viewfactorsfile $hostfile \
$compat $copy_datfile $copy_postfile $scr_dir $dcoup \
$assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1
sleep 1
exit 0

View File

@ -0,0 +1,191 @@
#!/bin/sh
#
# The exit status of this script is read by Mentat.
# Normal exit status is 0.
#
DIR=%INSTALLDIR%/marc%VERSION%
if test $MARCDIR1
then
DIR=$MARCDIR1
fi
if test -z "$DIR"; then
REALCOM="`ls -l $0 |awk '{ print $NF; }'`"
DIRSCRIPT=`dirname $REALCOM`
case $DIRSCRIPT in
\/*)
;;
*)
DIRSCRIPT=`pwd`/$DIRSCRIPT
;;
esac
. $DIRSCRIPT/getarch
DIR="$MENTAT_MARCDIR"
fi
SRCEXT=.f
SRCEXTC=.F
RSTEXT=.t08
PSTEXT=.t19
PSTEXTB=.t16
VWFCEXT=.vfs
slv=$1
version=$2
ndom_fea_solver=$3
ndom_preprocessor=$4
hostfile=$5
compat=$6
job=$7
srcfile=$8
srcmeth=$9
shift 9 # cannot use $10, $11, ...
restart=$1
postfile=$2
viewfactorsfile=$3
copy_datfile="-ci $4"
copy_postfile="-cr $5"
scr_dir=$6
dcoup=$7
assem_recov_nthread=$8
nthread=$9
shift 9 # cannot use $10, $11, ...
nsolver=$1
mode=$2
gpu=$3
if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then
slv="-iam sfm"
fi
if [ "$slv" = "marc" ]; then
slv=""
fi
if [ "$slv" = "datfit" ]; then
slv="-iam datfit"
fi
if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then
nprocds="-nprocds $ndom_fea_solver"
else
nprocd=""
if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then
nprocd="-nprocd $ndom_preprocessor"
else
nprocd=""
fi
fi
if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then
srcfile=`echo $srcfile | sed "s/$SRCEXT$//" | sed "s/$SRCEXTC$//"`
case "$srcmeth" in
-)
srcfile="-u $srcfile"
;;
compsave)
srcfile="-u $srcfile -save y"
;;
runsaved)
srcfile=${srcfile%.*}".marc"
srcfile="-prog $srcfile"
;;
esac
else
srcfile=""
fi
if [ "$restart" != "" -a "$restart" != "-" ]; then
restart=`echo $restart | sed "s/$RSTEXT$//"`
restart="-r $restart"
else
restart=""
fi
if [ "$postfile" != "" -a "$postfile" != "-" ]; then
postfile=`echo $postfile | sed "s/$PSTEXT$//"`
postfile=`echo $postfile | sed "s/$PSTEXTB$//"`
postfile="-pid $postfile"
else
postfile=""
fi
if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then
viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"`
viewfactorsfile="-vf $viewfactorsfile"
else
viewfactorsfile=""
fi
if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then
hostfile="-ho $hostfile"
else
hostfile=""
fi
if [ "$compat" != "" -a "$compat" != "-" ]; then
compat="-co $compat"
else
compat=""
fi
if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then
scr_dir="-sd $scr_dir"
else
scr_dir=""
fi
if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then
dcoup="-dcoup $dcoup"
else
dcoup=""
fi
if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then
assem_recov_nthread="-nthread_elem $assem_recov_nthread"
else
assem_recov_nthread=""
fi
if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then
nthread="-nthread $nthread"
else
nthread=""
fi
if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then
nsolver="-nsolver $nsolver"
else
nsolver=""
fi
case "$mode" in
4) mode="-mo i4" ;;
8) mode="-mo i8" ;;
*) mode= ;;
esac
if [ "$gpu" != "" -a "$gpu" != "-" ]; then
gpu="-gpu $gpu"
else
gpu=""
fi
rm -f $job.cnt
rm -f $job.sts
rm -f $job.out
rm -f $job.log
# To prevent a mismatch with the python version used by the solver
# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH
# unset environment variables PYTHONHOME and PYTHONPATH
unset PYTHONHOME
unset PYTHONPATH
"${DIR}/tools/run_damask_hmp" $slv -j $job -v n -b y $nprocds $nprocd \
$srcfile $restart $postfile $viewfactorsfile $hostfile \
$compat $copy_datfile $copy_postfile $scr_dir $dcoup \
$assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1
sleep 1
exit 0

View File

@ -0,0 +1,191 @@
#!/bin/sh
#
# The exit status of this script is read by Mentat.
# Normal exit status is 0.
#
DIR=%INSTALLDIR%/marc%VERSION%
if test $MARCDIR1
then
DIR=$MARCDIR1
fi
if test -z "$DIR"; then
REALCOM="`ls -l $0 |awk '{ print $NF; }'`"
DIRSCRIPT=`dirname $REALCOM`
case $DIRSCRIPT in
\/*)
;;
*)
DIRSCRIPT=`pwd`/$DIRSCRIPT
;;
esac
. $DIRSCRIPT/getarch
DIR="$MENTAT_MARCDIR"
fi
SRCEXT=.f
SRCEXTC=.F
RSTEXT=.t08
PSTEXT=.t19
PSTEXTB=.t16
VWFCEXT=.vfs
slv=$1
version=$2
ndom_fea_solver=$3
ndom_preprocessor=$4
hostfile=$5
compat=$6
job=$7
srcfile=$8
srcmeth=$9
shift 9 # cannot use $10, $11, ...
restart=$1
postfile=$2
viewfactorsfile=$3
copy_datfile="-ci $4"
copy_postfile="-cr $5"
scr_dir=$6
dcoup=$7
assem_recov_nthread=$8
nthread=$9
shift 9 # cannot use $10, $11, ...
nsolver=$1
mode=$2
gpu=$3
if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then
slv="-iam sfm"
fi
if [ "$slv" = "marc" ]; then
slv=""
fi
if [ "$slv" = "datfit" ]; then
slv="-iam datfit"
fi
if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then
nprocds="-nprocds $ndom_fea_solver"
else
nprocd=""
if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then
nprocd="-nprocd $ndom_preprocessor"
else
nprocd=""
fi
fi
if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then
srcfile=`echo $srcfile | sed "s/$SRCEXT$//" | sed "s/$SRCEXTC$//"`
case "$srcmeth" in
-)
srcfile="-u $srcfile"
;;
compsave)
srcfile="-u $srcfile -save y"
;;
runsaved)
srcfile=${srcfile%.*}".marc"
srcfile="-prog $srcfile"
;;
esac
else
srcfile=""
fi
if [ "$restart" != "" -a "$restart" != "-" ]; then
restart=`echo $restart | sed "s/$RSTEXT$//"`
restart="-r $restart"
else
restart=""
fi
if [ "$postfile" != "" -a "$postfile" != "-" ]; then
postfile=`echo $postfile | sed "s/$PSTEXT$//"`
postfile=`echo $postfile | sed "s/$PSTEXTB$//"`
postfile="-pid $postfile"
else
postfile=""
fi
if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then
viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"`
viewfactorsfile="-vf $viewfactorsfile"
else
viewfactorsfile=""
fi
if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then
hostfile="-ho $hostfile"
else
hostfile=""
fi
if [ "$compat" != "" -a "$compat" != "-" ]; then
compat="-co $compat"
else
compat=""
fi
if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then
scr_dir="-sd $scr_dir"
else
scr_dir=""
fi
if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then
dcoup="-dcoup $dcoup"
else
dcoup=""
fi
if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then
assem_recov_nthread="-nthread_elem $assem_recov_nthread"
else
assem_recov_nthread=""
fi
if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then
nthread="-nthread $nthread"
else
nthread=""
fi
if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then
nsolver="-nsolver $nsolver"
else
nsolver=""
fi
case "$mode" in
4) mode="-mo i4" ;;
8) mode="-mo i8" ;;
*) mode= ;;
esac
if [ "$gpu" != "" -a "$gpu" != "-" ]; then
gpu="-gpu $gpu"
else
gpu=""
fi
rm -f $job.cnt
rm -f $job.sts
rm -f $job.out
rm -f $job.log
# To prevent a mismatch with the python version used by the solver
# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH
# unset environment variables PYTHONHOME and PYTHONPATH
unset PYTHONHOME
unset PYTHONPATH
"${DIR}/tools/run_damask_mp" $slv -j $job -v n -b y $nprocds $nprocd \
$srcfile $restart $postfile $viewfactorsfile $hostfile \
$compat $copy_datfile $copy_postfile $scr_dir $dcoup \
$assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1
sleep 1
exit 0

View File

@ -0,0 +1,191 @@
#!/bin/sh
#
# The exit status of this script is read by Mentat.
# Normal exit status is 0.
#
DIR=%INSTALLDIR%/marc%VERSION%
if test $MARCDIR1
then
DIR=$MARCDIR1
fi
if test -z "$DIR"; then
REALCOM="`ls -l $0 |awk '{ print $NF; }'`"
DIRSCRIPT=`dirname $REALCOM`
case $DIRSCRIPT in
\/*)
;;
*)
DIRSCRIPT=`pwd`/$DIRSCRIPT
;;
esac
. $DIRSCRIPT/getarch
DIR="$MENTAT_MARCDIR"
fi
SRCEXT=.f
SRCEXTC=.F
RSTEXT=.t08
PSTEXT=.t19
PSTEXTB=.t16
VWFCEXT=.vfs
slv=$1
version=$2
ndom_fea_solver=$3
ndom_preprocessor=$4
hostfile=$5
compat=$6
job=$7
srcfile=$8
srcmeth=$9
shift 9 # cannot use $10, $11, ...
restart=$1
postfile=$2
viewfactorsfile=$3
copy_datfile="-ci $4"
copy_postfile="-cr $5"
scr_dir=$6
dcoup=$7
assem_recov_nthread=$8
nthread=$9
shift 9 # cannot use $10, $11, ...
nsolver=$1
mode=$2
gpu=$3
if [ "$slv" != "" -a "$slv" != "marc" -a "$slv" != "datfit" ]; then
slv="-iam sfm"
fi
if [ "$slv" = "marc" ]; then
slv=""
fi
if [ "$slv" = "datfit" ]; then
slv="-iam datfit"
fi
if [ "$ndom_fea_solver" != "" -a "$ndom_fea_solver" != "1" ]; then
nprocds="-nprocds $ndom_fea_solver"
else
nprocd=""
if [ "$ndom_preprocessor" != "" -a "$ndom_preprocessor" != "1" ]; then
nprocd="-nprocd $ndom_preprocessor"
else
nprocd=""
fi
fi
if [ "$srcfile" != "" -a "$srcfile" != "-" ]; then
srcfile=`echo $srcfile | sed "s/$SRCEXT$//" | sed "s/$SRCEXTC$//"`
case "$srcmeth" in
-)
srcfile="-u $srcfile"
;;
compsave)
srcfile="-u $srcfile -save y"
;;
runsaved)
srcfile=${srcfile%.*}".marc"
srcfile="-prog $srcfile"
;;
esac
else
srcfile=""
fi
if [ "$restart" != "" -a "$restart" != "-" ]; then
restart=`echo $restart | sed "s/$RSTEXT$//"`
restart="-r $restart"
else
restart=""
fi
if [ "$postfile" != "" -a "$postfile" != "-" ]; then
postfile=`echo $postfile | sed "s/$PSTEXT$//"`
postfile=`echo $postfile | sed "s/$PSTEXTB$//"`
postfile="-pid $postfile"
else
postfile=""
fi
if [ "$viewfactorsfile" != "" -a "$viewfactorsfile" != "-" ]; then
viewfactorsfile=`echo $viewfactorsfile | sed "s/$VWFCEXT$//"`
viewfactorsfile="-vf $viewfactorsfile"
else
viewfactorsfile=""
fi
if [ "$hostfile" != "" -a "$hostfile" != "-" ]; then
hostfile="-ho $hostfile"
else
hostfile=""
fi
if [ "$compat" != "" -a "$compat" != "-" ]; then
compat="-co $compat"
else
compat=""
fi
if [ "$scr_dir" != "" -a "$scr_dir" != "-" ]; then
scr_dir="-sd $scr_dir"
else
scr_dir=""
fi
if [ "$dcoup" != "" -a "$dcoup" != "0" ]; then
dcoup="-dcoup $dcoup"
else
dcoup=""
fi
if [ "$assem_recov_nthread" != "" -a "$assem_recov_nthread" != "1" ]; then
assem_recov_nthread="-nthread_elem $assem_recov_nthread"
else
assem_recov_nthread=""
fi
if [ "$nthread" != "" -a "$nthread" != "0" -a "$nthread" != "1" ]; then
nthread="-nthread $nthread"
else
nthread=""
fi
if [ "$nsolver" != "" -a "$nsolver" != "0" ]; then
nsolver="-nsolver $nsolver"
else
nsolver=""
fi
case "$mode" in
4) mode="-mo i4" ;;
8) mode="-mo i8" ;;
*) mode= ;;
esac
if [ "$gpu" != "" -a "$gpu" != "-" ]; then
gpu="-gpu $gpu"
else
gpu=""
fi
rm -f $job.cnt
rm -f $job.sts
rm -f $job.out
rm -f $job.log
# To prevent a mismatch with the python version used by the solver
# do *not* prepend $MENTAT_INSTALL_DIR/python/bin to environment variable PATH
# unset environment variables PYTHONHOME and PYTHONPATH
unset PYTHONHOME
unset PYTHONPATH
"${DIR}/tools/run_damask_lmp" $slv -j $job -v n -b y $nprocds $nprocd \
$srcfile $restart $postfile $viewfactorsfile $hostfile \
$compat $copy_datfile $copy_postfile $scr_dir $dcoup \
$assem_recov_nthread $nthread $nsolver $mode $gpu > /dev/null 2>&1
sleep 1
exit 0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -49,4 +49,5 @@ echo "program: $program"
exit 1
}
/bin/rm $userobj
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.smod

View File

@ -49,4 +49,5 @@ echo "program: $program"
exit 1
}
/bin/rm $userobj
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.smod

View File

@ -49,4 +49,5 @@ echo "program: $program"
exit 1
}
/bin/rm $userobj
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.mod
/bin/rm $DIRJOB/*.smod

View File

@ -62,7 +62,7 @@
# =1, element storage out-of-core #
# -dll run marc using shared library libmarc.so and exe_marc #
# =1, used #
# =2, do not free streaming input memory #
# =2, do not free streaming input memory #
# =3, run with marc input deck #
# -trk run marc for post-tracking #
# -gpuid run marc using GPGPU capability #
@ -176,16 +176,16 @@ fi
# MARC_MODE i8
# it can also be set by the environmental variable MARC_INTEGER_SIZE
# and by the command line option "-mo"
#
#
mode=
modeerror=
modeoption=
if test -f $DIRSCRIPT/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
echo
line=
fi
line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults`
@ -202,7 +202,7 @@ fi
if test -f $HOME/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $HOME/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
line=
@ -225,7 +225,7 @@ if test -z "$mode" ; then
mode=i8
fi
case $mode in
i4)
i4)
modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported."
modeoption=error
echo $modeerror
@ -245,7 +245,7 @@ for arg in $* ; do
if $setmode ; then
mode=$arg
case $mode in
i4)
i4)
modeerror="bad value for mode option; only i8 is supported."
modeoption=error
echo
@ -268,7 +268,7 @@ for arg in $* ; do
setmode=false
fi
if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then
echo
echo
echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available
echo
setmode=true
@ -332,7 +332,7 @@ case "`echo '\c'`" in
;;
esac
#
#
# Variables for the MARC environment
#
@ -387,7 +387,7 @@ LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH
export LD_LIBRARY_PATH
export LD_LIBRARY64_PATH
export LD_LIBRARYN32_PATH
atexit() {
kill -15 $$
#
@ -497,7 +497,7 @@ MDSRCLIB=$MARC_LIB/mdsrc.a
# or in the user's home directory
# format:
# MARC_MPI <mpiversion>
#
#
value=
file=
if test -f $DIRSCRIPT/run_marc_defaults; then
@ -522,7 +522,7 @@ if test -n "$value"; then
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
@ -542,7 +542,7 @@ if test -n "$value"; then
fi
fi
fi
#
#
#
# allow scratch directory to be specified with environmental variable
# MARCSCRATCH
@ -612,7 +612,7 @@ do
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
;;
-r* | -R*)
rid=`$BASENAME $value .t08`
@ -623,7 +623,7 @@ do
*)
DIRRID=`pwd`/$DIRRID
;;
esac
esac
;;
-si* | -SI*)
sid=$value
@ -634,7 +634,7 @@ do
*)
DIRSID=`pwd`/$DIRSID
;;
esac
esac
;;
-pi* | -PI*)
if test -f $value.t19
@ -650,7 +650,7 @@ do
*)
DIRPID=`pwd`/$DIRPID
;;
esac
esac
;;
-bdf | -BDF)
makebdf=1
@ -664,7 +664,7 @@ do
*)
DIRDID=`pwd`/$DIRDID
;;
esac
esac
;;
-vf | -VF)
vid=`$BASENAME $value .vfs`
@ -675,7 +675,7 @@ do
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
-u* | -U*)
user=$value
@ -777,7 +777,7 @@ do
;;
-au* | -AU*)
nauto=$value
echo
echo
echo warning: the option -au is no longer supported and will be ignored
echo
;;
@ -849,7 +849,7 @@ do
*)
DIRSCR=`pwd`/$DIRSCR
;;
esac
esac
;;
-ho* | -HO*)
host=$value
@ -900,7 +900,7 @@ fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -936,7 +936,7 @@ fi
ntprint=$nt
nteprint=$nte
# copy from -nprocd[s]
if test $nprocdddm -gt 1
if test $nprocdddm -gt 1
then
nteprint=$nprocdddm
fi
@ -945,7 +945,7 @@ if test $nte -ne 0
then
nteprint=$nte
fi
# check for minimum 1 threads per processes for DDM
# check for minimum 1 threads per processes for DDM
if test $nprocdddm -gt 1
then
if test $nteprint -lt $nprocdddm
@ -1000,24 +1000,24 @@ export OMP_STACKSIZE=7M
# deprecate -nthread option at arugment of marc
nt=0
# Reset nprocdddmm, nsolver and threads if not given.
if test $nprocdddm -eq 0
then
if test $nprocdddm -eq 0
then
nprocdarg=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddmprint=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddm=
fi
fi
nsolverprint=$nsolver
if test $nsolver -eq 0
then
if test $nsolver -eq 0
then
nsolverprint=
fi
fi
# end of threads setting.
gpuoption=
if test "$gpuids" = "" ; then
@ -1032,7 +1032,7 @@ else
MARCCUDALIBS=$MARCCUDALIBS2
export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH
fi
# Linux 64 + HPMPI, Below code is taken from include_linux64
# Linux 64 + HPMPI, Below code is taken from include_linux64
if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64"
then
export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
@ -1061,7 +1061,7 @@ if test "$dllrun" -gt 0; then
fi
if test "$progdll"; then
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
rmdll=yes
pathdll=yes
progdll=${progdll}_$marcdll
@ -1095,14 +1095,14 @@ while test forever; do
if test $nprocdddm -gt 1 -a $icreated -eq 0; then
if test ! -f $DIRJID/1$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/1$jid$dotdat not accessible"
fi
fi
else
if test ! -f $DIRJID/$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/$jid$dotdat not accessible"
fi
fi
@ -1110,7 +1110,7 @@ fi
if test $nprocd -gt 1; then
if test "$host" ; then
if test ! -f $host; then
error="$error
error="$error
host name file $host not accessible"
fi
fi
@ -1224,11 +1224,11 @@ view factor file $DIRVID/$vid.vfs not accessible"
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)"
fi
fi
@ -1293,7 +1293,7 @@ defaults file $DIRDID/$did$dotdat not accessible"
then
if test $ndcoup -gt 3
then
error="$error
error="$error
incorrect option for contact decoupling "
fi
fi
@ -1301,7 +1301,7 @@ incorrect option for contact decoupling "
then
if test $ndytran -gt 1
then
error="$error
error="$error
incorrect option for Marc-Dytran Switch "
fi
fi
@ -1309,7 +1309,7 @@ incorrect option for Marc-Dytran Switch "
then
if test ! -x $MARC_BIN/$exefile
then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE "
fi
fi
@ -1626,7 +1626,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
fi
$ECHO "User subroutine name ($user)? $ECHOTXT"
read value
@ -1644,7 +1644,7 @@ Program name ($prog)? $ECHOTXT"
*)
user=`pwd`/$user
;;
esac
esac
usernoext=$user
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F`
@ -1767,7 +1767,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
esac
fi
@ -1809,7 +1809,7 @@ Program name ($prog)? $ECHOTXT"
fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -1959,7 +1959,7 @@ Program name ($prog)? $ECHOTXT"
then
qid=$value
fi
case $qid in
case $qid in
s* | S* | l* | L* | v* | V* )
$ECHO "Queue priority ($priority)? $ECHOTXT"
read value
@ -2017,42 +2017,42 @@ esac
done
#
if test $nt -eq 0
then
if test $nt -eq 0
then
ntarg=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
ntprint=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
nt=
fi
if test $nte -eq 0
then
if test $nte -eq 0
then
ntearg=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nteprint=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nte=
fi
if test $nts -eq 0
then
if test $nts -eq 0
then
ntsarg=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
ntsprint=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
nts=
fi
#
@ -2305,7 +2305,7 @@ fi
execpath=$usernoext.marc
usersub=1
fi
export execpath
export execpath
execname=`$BASENAME $execpath`
if test "$host"
@ -2338,7 +2338,7 @@ fi
exit 1
fi
# check for Myrinet that the number of processes per host is
# check for Myrinet that the number of processes per host is
# less than number of available user ports, 5
# .gmpi directory must exist in user's home directory
# and must have write permission from remote hosts
@ -2452,9 +2452,9 @@ fi
then
# Intel MPI
if test -f $jid.mfile
then
then
/bin/rm $jid.mfile 2> /dev/null
fi
fi
/bin/cp $host $jid.host
grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile
# end Intel MPI for DMP
@ -2538,7 +2538,7 @@ fi
else
host=$jid.host
host_filt=$host
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
then
host_filt=$jid.mfile
fi
@ -2547,7 +2547,7 @@ fi
# or distributed and set the variable "dirstatus" accordingly.
# only perform the check if user subroutine is used
# or a user subroutine executable is used
numfield=1
if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware
then
@ -2707,7 +2707,7 @@ fi
fi
# modify new host file if NFS mounted heterogeneous machine
doit=
if test $program = $prog.marc
if test $program = $prog.marc
then
doit=yes
fi
@ -2731,23 +2731,23 @@ if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \
printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
/bin/mv $jid.host{$$} $jid.host
host=$jid.host
fi
fi
fi
done
done
fi
fi # if test $program = $prog.marc -o $user -o $obj
else # if test $host
# assume shared memory machine if no hostfile given and
# MPITYPE is set to mpich or Myrinet
# check for Myrinet that the total number of processes is
# check for Myrinet that the total number of processes is
# less than number of available user ports, 5
if test $MPITYPE = "mpich" -o $MPITYPE = "scali"
then
numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'`
echo `hostname` $numproc $execpath > $jid.host
host=$jid.host
elif test $MPITYPE = "myrinet"
elif test $MPITYPE = "myrinet"
then
if test $nprocd -gt 5
then
@ -2787,7 +2787,7 @@ printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
fi # if test $host
fi # if test $nprocd -gt 1
fi # if test $program = $exefile -o $program = $prog.marc
##############################################################################
@ -2837,7 +2837,7 @@ else
nsolverarg="$nsolverarg $nsolver"
fi
if test $nprocdddm -lt 2 -a $nsolver -eq 0
then
then
nprocd=0
fi
if test $nprocd -gt 0
@ -2848,7 +2848,7 @@ then
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -2953,7 +2953,7 @@ $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB "
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -3241,6 +3241,7 @@ else
fi
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3283,7 +3284,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
fi
else
if test $cpdll = yes; then
@ -3292,10 +3293,10 @@ else
fi
if test $rmdll = yes
then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
then
numdom=$nprocdddm
@ -3363,15 +3364,15 @@ else
#
QUENAME=qsub
SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid"
if test "$priority"
if test "$priority"
then
SUBMCMD=$SUBMCMD" -p $priority"
fi
if test "$att"
if test "$att"
then
SUBMCMD=$SUBMCMD" -a $att"
fi
if test "$cpu"
if test "$cpu"
then
SUBMCMD=$SUBMCMD" -lt $cpu"
fi
@ -3553,7 +3554,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3573,6 +3574,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3621,7 +3623,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
# for network run, remove executable on remote machines
# and executables with modified name
if test $nprocd -gt 1
@ -3670,7 +3672,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
@ -3887,7 +3889,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3907,6 +3909,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
# done if no job id given
if test -z "$jid"
then
@ -3946,7 +3949,7 @@ if test $ddm_arc -gt 0; then
RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc "
fi
$RUN_JOB
$RUN_JOB
if test $nprocd -gt 1
then
@ -4029,7 +4032,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi

View File

@ -62,7 +62,7 @@
# =1, element storage out-of-core #
# -dll run marc using shared library libmarc.so and exe_marc #
# =1, used #
# =2, do not free streaming input memory #
# =2, do not free streaming input memory #
# =3, run with marc input deck #
# -trk run marc for post-tracking #
# -gpuid run marc using GPGPU capability #
@ -176,16 +176,16 @@ fi
# MARC_MODE i8
# it can also be set by the environmental variable MARC_INTEGER_SIZE
# and by the command line option "-mo"
#
#
mode=
modeerror=
modeoption=
if test -f $DIRSCRIPT/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
echo
line=
fi
line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults`
@ -202,7 +202,7 @@ fi
if test -f $HOME/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $HOME/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
line=
@ -225,7 +225,7 @@ if test -z "$mode" ; then
mode=i8
fi
case $mode in
i4)
i4)
modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported."
modeoption=error
echo $modeerror
@ -245,7 +245,7 @@ for arg in $* ; do
if $setmode ; then
mode=$arg
case $mode in
i4)
i4)
modeerror="bad value for mode option; only i8 is supported."
modeoption=error
echo
@ -268,7 +268,7 @@ for arg in $* ; do
setmode=false
fi
if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then
echo
echo
echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available
echo
setmode=true
@ -332,7 +332,7 @@ case "`echo '\c'`" in
;;
esac
#
#
# Variables for the MARC environment
#
@ -387,7 +387,7 @@ LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH
export LD_LIBRARY_PATH
export LD_LIBRARY64_PATH
export LD_LIBRARYN32_PATH
atexit() {
kill -15 $$
#
@ -497,7 +497,7 @@ MDSRCLIB=$MARC_LIB/mdsrc.a
# or in the user's home directory
# format:
# MARC_MPI <mpiversion>
#
#
value=
file=
if test -f $DIRSCRIPT/run_marc_defaults; then
@ -522,7 +522,7 @@ if test -n "$value"; then
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
@ -542,7 +542,7 @@ if test -n "$value"; then
fi
fi
fi
#
#
#
# allow scratch directory to be specified with environmental variable
# MARCSCRATCH
@ -612,7 +612,7 @@ do
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
;;
-r* | -R*)
rid=`$BASENAME $value .t08`
@ -623,7 +623,7 @@ do
*)
DIRRID=`pwd`/$DIRRID
;;
esac
esac
;;
-si* | -SI*)
sid=$value
@ -634,7 +634,7 @@ do
*)
DIRSID=`pwd`/$DIRSID
;;
esac
esac
;;
-pi* | -PI*)
if test -f $value.t19
@ -650,7 +650,7 @@ do
*)
DIRPID=`pwd`/$DIRPID
;;
esac
esac
;;
-bdf | -BDF)
makebdf=1
@ -664,7 +664,7 @@ do
*)
DIRDID=`pwd`/$DIRDID
;;
esac
esac
;;
-vf | -VF)
vid=`$BASENAME $value .vfs`
@ -675,7 +675,7 @@ do
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
-u* | -U*)
user=$value
@ -777,7 +777,7 @@ do
;;
-au* | -AU*)
nauto=$value
echo
echo
echo warning: the option -au is no longer supported and will be ignored
echo
;;
@ -849,7 +849,7 @@ do
*)
DIRSCR=`pwd`/$DIRSCR
;;
esac
esac
;;
-ho* | -HO*)
host=$value
@ -900,7 +900,7 @@ fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -936,7 +936,7 @@ fi
ntprint=$nt
nteprint=$nte
# copy from -nprocd[s]
if test $nprocdddm -gt 1
if test $nprocdddm -gt 1
then
nteprint=$nprocdddm
fi
@ -945,7 +945,7 @@ if test $nte -ne 0
then
nteprint=$nte
fi
# check for minimum 1 threads per processes for DDM
# check for minimum 1 threads per processes for DDM
if test $nprocdddm -gt 1
then
if test $nteprint -lt $nprocdddm
@ -1000,24 +1000,24 @@ export OMP_STACKSIZE=7M
# deprecate -nthread option at arugment of marc
nt=0
# Reset nprocdddmm, nsolver and threads if not given.
if test $nprocdddm -eq 0
then
if test $nprocdddm -eq 0
then
nprocdarg=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddmprint=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddm=
fi
fi
nsolverprint=$nsolver
if test $nsolver -eq 0
then
if test $nsolver -eq 0
then
nsolverprint=
fi
fi
# end of threads setting.
gpuoption=
if test "$gpuids" = "" ; then
@ -1032,7 +1032,7 @@ else
MARCCUDALIBS=$MARCCUDALIBS2
export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH
fi
# Linux 64 + HPMPI, Below code is taken from include_linux64
# Linux 64 + HPMPI, Below code is taken from include_linux64
if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64"
then
export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
@ -1061,7 +1061,7 @@ if test "$dllrun" -gt 0; then
fi
if test "$progdll"; then
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
rmdll=yes
pathdll=yes
progdll=${progdll}_$marcdll
@ -1095,14 +1095,14 @@ while test forever; do
if test $nprocdddm -gt 1 -a $icreated -eq 0; then
if test ! -f $DIRJID/1$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/1$jid$dotdat not accessible"
fi
fi
else
if test ! -f $DIRJID/$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/$jid$dotdat not accessible"
fi
fi
@ -1110,7 +1110,7 @@ fi
if test $nprocd -gt 1; then
if test "$host" ; then
if test ! -f $host; then
error="$error
error="$error
host name file $host not accessible"
fi
fi
@ -1224,11 +1224,11 @@ view factor file $DIRVID/$vid.vfs not accessible"
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)"
fi
fi
@ -1293,7 +1293,7 @@ defaults file $DIRDID/$did$dotdat not accessible"
then
if test $ndcoup -gt 3
then
error="$error
error="$error
incorrect option for contact decoupling "
fi
fi
@ -1301,7 +1301,7 @@ incorrect option for contact decoupling "
then
if test $ndytran -gt 1
then
error="$error
error="$error
incorrect option for Marc-Dytran Switch "
fi
fi
@ -1309,7 +1309,7 @@ incorrect option for Marc-Dytran Switch "
then
if test ! -x $MARC_BIN/$exefile
then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE "
fi
fi
@ -1626,7 +1626,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
fi
$ECHO "User subroutine name ($user)? $ECHOTXT"
read value
@ -1644,7 +1644,7 @@ Program name ($prog)? $ECHOTXT"
*)
user=`pwd`/$user
;;
esac
esac
usernoext=$user
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F`
@ -1767,7 +1767,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
esac
fi
@ -1809,7 +1809,7 @@ Program name ($prog)? $ECHOTXT"
fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -1959,7 +1959,7 @@ Program name ($prog)? $ECHOTXT"
then
qid=$value
fi
case $qid in
case $qid in
s* | S* | l* | L* | v* | V* )
$ECHO "Queue priority ($priority)? $ECHOTXT"
read value
@ -2017,42 +2017,42 @@ esac
done
#
if test $nt -eq 0
then
if test $nt -eq 0
then
ntarg=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
ntprint=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
nt=
fi
if test $nte -eq 0
then
if test $nte -eq 0
then
ntearg=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nteprint=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nte=
fi
if test $nts -eq 0
then
if test $nts -eq 0
then
ntsarg=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
ntsprint=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
nts=
fi
#
@ -2305,7 +2305,7 @@ fi
execpath=$usernoext.marc
usersub=1
fi
export execpath
export execpath
execname=`$BASENAME $execpath`
if test "$host"
@ -2338,7 +2338,7 @@ fi
exit 1
fi
# check for Myrinet that the number of processes per host is
# check for Myrinet that the number of processes per host is
# less than number of available user ports, 5
# .gmpi directory must exist in user's home directory
# and must have write permission from remote hosts
@ -2452,9 +2452,9 @@ fi
then
# Intel MPI
if test -f $jid.mfile
then
then
/bin/rm $jid.mfile 2> /dev/null
fi
fi
/bin/cp $host $jid.host
grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile
# end Intel MPI for DMP
@ -2538,7 +2538,7 @@ fi
else
host=$jid.host
host_filt=$host
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
then
host_filt=$jid.mfile
fi
@ -2547,7 +2547,7 @@ fi
# or distributed and set the variable "dirstatus" accordingly.
# only perform the check if user subroutine is used
# or a user subroutine executable is used
numfield=1
if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware
then
@ -2707,7 +2707,7 @@ fi
fi
# modify new host file if NFS mounted heterogeneous machine
doit=
if test $program = $prog.marc
if test $program = $prog.marc
then
doit=yes
fi
@ -2731,23 +2731,23 @@ if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \
printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
/bin/mv $jid.host{$$} $jid.host
host=$jid.host
fi
fi
fi
done
done
fi
fi # if test $program = $prog.marc -o $user -o $obj
else # if test $host
# assume shared memory machine if no hostfile given and
# MPITYPE is set to mpich or Myrinet
# check for Myrinet that the total number of processes is
# check for Myrinet that the total number of processes is
# less than number of available user ports, 5
if test $MPITYPE = "mpich" -o $MPITYPE = "scali"
then
numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'`
echo `hostname` $numproc $execpath > $jid.host
host=$jid.host
elif test $MPITYPE = "myrinet"
elif test $MPITYPE = "myrinet"
then
if test $nprocd -gt 5
then
@ -2787,7 +2787,7 @@ printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
fi # if test $host
fi # if test $nprocd -gt 1
fi # if test $program = $exefile -o $program = $prog.marc
##############################################################################
@ -2837,7 +2837,7 @@ else
nsolverarg="$nsolverarg $nsolver"
fi
if test $nprocdddm -lt 2 -a $nsolver -eq 0
then
then
nprocd=0
fi
if test $nprocd -gt 0
@ -2848,7 +2848,7 @@ then
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -2953,7 +2953,7 @@ $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB "
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -3241,6 +3241,7 @@ else
fi
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3283,7 +3284,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
fi
else
if test $cpdll = yes; then
@ -3292,10 +3293,10 @@ else
fi
if test $rmdll = yes
then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
then
numdom=$nprocdddm
@ -3363,15 +3364,15 @@ else
#
QUENAME=qsub
SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid"
if test "$priority"
if test "$priority"
then
SUBMCMD=$SUBMCMD" -p $priority"
fi
if test "$att"
if test "$att"
then
SUBMCMD=$SUBMCMD" -a $att"
fi
if test "$cpu"
if test "$cpu"
then
SUBMCMD=$SUBMCMD" -lt $cpu"
fi
@ -3553,7 +3554,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3573,6 +3574,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3621,7 +3623,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
# for network run, remove executable on remote machines
# and executables with modified name
if test $nprocd -gt 1
@ -3670,7 +3672,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
@ -3887,7 +3889,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3907,6 +3909,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
# done if no job id given
if test -z "$jid"
then
@ -3946,7 +3949,7 @@ if test $ddm_arc -gt 0; then
RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc "
fi
$RUN_JOB
$RUN_JOB
if test $nprocd -gt 1
then
@ -4029,7 +4032,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi

View File

@ -62,7 +62,7 @@
# =1, element storage out-of-core #
# -dll run marc using shared library libmarc.so and exe_marc #
# =1, used #
# =2, do not free streaming input memory #
# =2, do not free streaming input memory #
# =3, run with marc input deck #
# -trk run marc for post-tracking #
# -gpuid run marc using GPGPU capability #
@ -176,16 +176,16 @@ fi
# MARC_MODE i8
# it can also be set by the environmental variable MARC_INTEGER_SIZE
# and by the command line option "-mo"
#
#
mode=
modeerror=
modeoption=
if test -f $DIRSCRIPT/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $DIRSCRIPT/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
echo
line=
fi
line=`$AWK '{if ($1 == "MARC_MODE") {print $2}}' $DIRSCRIPT/run_marc_defaults`
@ -202,7 +202,7 @@ fi
if test -f $HOME/run_marc_defaults; then
line=`$AWK '{if ($1 == "MARC_MODE") {print $1}}' $HOME/run_marc_defaults`
if test "$line" = "MARC_MODE"; then
echo
echo
echo warning: the option MARC_MODE is deprecated, as of Marc 2015, only the integer*8 version is available
echo
line=
@ -225,7 +225,7 @@ if test -z "$mode" ; then
mode=i8
fi
case $mode in
i4)
i4)
modeerror="bad value for MARC_INTEGER_SIZE variable; only i8 is supported."
modeoption=error
echo $modeerror
@ -245,7 +245,7 @@ for arg in $* ; do
if $setmode ; then
mode=$arg
case $mode in
i4)
i4)
modeerror="bad value for mode option; only i8 is supported."
modeoption=error
echo
@ -268,7 +268,7 @@ for arg in $* ; do
setmode=false
fi
if [ ${arg}X = -moX -o ${arg}X = -MOX ] ; then
echo
echo
echo warning: the option -mo is deprecated, as of Marc 2015, only the integer*8 version is available
echo
setmode=true
@ -332,7 +332,7 @@ case "`echo '\c'`" in
;;
esac
#
#
# Variables for the MARC environment
#
@ -387,7 +387,7 @@ LD_LIBRARYN32_PATH=$MARC_LIB:$LD_LIBRARYN32_PATH
export LD_LIBRARY_PATH
export LD_LIBRARY64_PATH
export LD_LIBRARYN32_PATH
atexit() {
kill -15 $$
#
@ -497,7 +497,7 @@ MDSRCLIB=$MARC_LIB/mdsrc.a
# or in the user's home directory
# format:
# MARC_MPI <mpiversion>
#
#
value=
file=
if test -f $DIRSCRIPT/run_marc_defaults; then
@ -522,7 +522,7 @@ if test -n "$value"; then
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
@ -542,7 +542,7 @@ if test -n "$value"; then
fi
fi
fi
#
#
#
# allow scratch directory to be specified with environmental variable
# MARCSCRATCH
@ -612,7 +612,7 @@ do
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
;;
-r* | -R*)
rid=`$BASENAME $value .t08`
@ -623,7 +623,7 @@ do
*)
DIRRID=`pwd`/$DIRRID
;;
esac
esac
;;
-si* | -SI*)
sid=$value
@ -634,7 +634,7 @@ do
*)
DIRSID=`pwd`/$DIRSID
;;
esac
esac
;;
-pi* | -PI*)
if test -f $value.t19
@ -650,7 +650,7 @@ do
*)
DIRPID=`pwd`/$DIRPID
;;
esac
esac
;;
-bdf | -BDF)
makebdf=1
@ -664,7 +664,7 @@ do
*)
DIRDID=`pwd`/$DIRDID
;;
esac
esac
;;
-vf | -VF)
vid=`$BASENAME $value .vfs`
@ -675,7 +675,7 @@ do
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
-u* | -U*)
user=$value
@ -777,7 +777,7 @@ do
;;
-au* | -AU*)
nauto=$value
echo
echo
echo warning: the option -au is no longer supported and will be ignored
echo
;;
@ -849,7 +849,7 @@ do
*)
DIRSCR=`pwd`/$DIRSCR
;;
esac
esac
;;
-ho* | -HO*)
host=$value
@ -900,7 +900,7 @@ fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -936,7 +936,7 @@ fi
ntprint=$nt
nteprint=$nte
# copy from -nprocd[s]
if test $nprocdddm -gt 1
if test $nprocdddm -gt 1
then
nteprint=$nprocdddm
fi
@ -945,7 +945,7 @@ if test $nte -ne 0
then
nteprint=$nte
fi
# check for minimum 1 threads per processes for DDM
# check for minimum 1 threads per processes for DDM
if test $nprocdddm -gt 1
then
if test $nteprint -lt $nprocdddm
@ -1000,24 +1000,24 @@ export OMP_STACKSIZE=7M
# deprecate -nthread option at arugment of marc
nt=0
# Reset nprocdddmm, nsolver and threads if not given.
if test $nprocdddm -eq 0
then
if test $nprocdddm -eq 0
then
nprocdarg=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddmprint=
fi
if test $nprocdddm -eq 0
then
fi
if test $nprocdddm -eq 0
then
nprocdddm=
fi
fi
nsolverprint=$nsolver
if test $nsolver -eq 0
then
if test $nsolver -eq 0
then
nsolverprint=
fi
fi
# end of threads setting.
gpuoption=
if test "$gpuids" = "" ; then
@ -1032,7 +1032,7 @@ else
MARCCUDALIBS=$MARCCUDALIBS2
export LD_LIBRARY_PATH=$CUDALIB2:$LD_LIBRARY_PATH
fi
# Linux 64 + HPMPI, Below code is taken from include_linux64
# Linux 64 + HPMPI, Below code is taken from include_linux64
if test $MPITYPE = hpmpi -a "$ARCHITECTURE" = "linux_amd64"
then
export MPIHPSPECIAL="$MPIHPSPECIAL -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
@ -1061,7 +1061,7 @@ if test "$dllrun" -gt 0; then
fi
if test "$progdll"; then
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
/bin/cp ${progdll}_$marcdll $DIRJOB/$marcdll
rmdll=yes
pathdll=yes
progdll=${progdll}_$marcdll
@ -1095,14 +1095,14 @@ while test forever; do
if test $nprocdddm -gt 1 -a $icreated -eq 0; then
if test ! -f $DIRJID/1$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/1$jid$dotdat not accessible"
fi
fi
else
if test ! -f $DIRJID/$jid$dotdat; then
if test "$jid" != "" ; then
error="$error
error="$error
input file $DIRJID/$jid$dotdat not accessible"
fi
fi
@ -1110,7 +1110,7 @@ fi
if test $nprocd -gt 1; then
if test "$host" ; then
if test ! -f $host; then
error="$error
error="$error
host name file $host not accessible"
fi
fi
@ -1224,11 +1224,11 @@ view factor file $DIRVID/$vid.vfs not accessible"
notok=false
fi
done
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
if test "$MARC_MPITYPE" = "$MPI_DEFAULT"; then
notok=false
fi
if $notok; then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE (valid: $MPI_OTHER)"
fi
fi
@ -1293,7 +1293,7 @@ defaults file $DIRDID/$did$dotdat not accessible"
then
if test $ndcoup -gt 3
then
error="$error
error="$error
incorrect option for contact decoupling "
fi
fi
@ -1301,7 +1301,7 @@ incorrect option for contact decoupling "
then
if test $ndytran -gt 1
then
error="$error
error="$error
incorrect option for Marc-Dytran Switch "
fi
fi
@ -1309,7 +1309,7 @@ incorrect option for Marc-Dytran Switch "
then
if test ! -x $MARC_BIN/$exefile
then
error="$error
error="$error
incorrect option for -mpi option: $MARC_MPITYPE "
fi
fi
@ -1626,7 +1626,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRJID=`pwd`/$DIRJID
;;
esac
esac
fi
$ECHO "User subroutine name ($user)? $ECHOTXT"
read value
@ -1644,7 +1644,7 @@ Program name ($prog)? $ECHOTXT"
*)
user=`pwd`/$user
;;
esac
esac
usernoext=$user
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .f`
usernoext=`dirname $usernoext`/`$BASENAME $usernoext .F`
@ -1767,7 +1767,7 @@ Program name ($prog)? $ECHOTXT"
*)
DIRVID=`pwd`/$DIRVID
;;
esac
esac
;;
esac
fi
@ -1809,7 +1809,7 @@ Program name ($prog)? $ECHOTXT"
fi
if test $nsolver -gt 0
then
if test $nsolver -gt $nprocd
if test $nsolver -gt $nprocd
then
nprocd=$nsolver
fi
@ -1959,7 +1959,7 @@ Program name ($prog)? $ECHOTXT"
then
qid=$value
fi
case $qid in
case $qid in
s* | S* | l* | L* | v* | V* )
$ECHO "Queue priority ($priority)? $ECHOTXT"
read value
@ -2017,42 +2017,42 @@ esac
done
#
if test $nt -eq 0
then
if test $nt -eq 0
then
ntarg=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
ntprint=
fi
if test $nt -eq 0
then
fi
if test $nt -eq 0
then
nt=
fi
if test $nte -eq 0
then
if test $nte -eq 0
then
ntearg=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nteprint=
fi
if test $nte -eq 0
then
fi
if test $nte -eq 0
then
nte=
fi
if test $nts -eq 0
then
if test $nts -eq 0
then
ntsarg=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
ntsprint=
fi
if test $nts -eq 0
then
fi
if test $nts -eq 0
then
nts=
fi
#
@ -2305,7 +2305,7 @@ fi
execpath=$usernoext.marc
usersub=1
fi
export execpath
export execpath
execname=`$BASENAME $execpath`
if test "$host"
@ -2338,7 +2338,7 @@ fi
exit 1
fi
# check for Myrinet that the number of processes per host is
# check for Myrinet that the number of processes per host is
# less than number of available user ports, 5
# .gmpi directory must exist in user's home directory
# and must have write permission from remote hosts
@ -2452,9 +2452,9 @@ fi
then
# Intel MPI
if test -f $jid.mfile
then
then
/bin/rm $jid.mfile 2> /dev/null
fi
fi
/bin/cp $host $jid.host
grep -v '^#' $host | $AWK '{host=$1;num=$2;for (i=1;i<=num;i++) print host}' > $jid.mfile
# end Intel MPI for DMP
@ -2538,7 +2538,7 @@ fi
else
host=$jid.host
host_filt=$host
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
if test $MACHINENAME = "LINUX" -a $MPITYPE = "intelmpi"
then
host_filt=$jid.mfile
fi
@ -2547,7 +2547,7 @@ fi
# or distributed and set the variable "dirstatus" accordingly.
# only perform the check if user subroutine is used
# or a user subroutine executable is used
numfield=1
if test $MPITYPE = hpmpi -o $MACHINENAME = HP -a $MPITYPE = hardware
then
@ -2707,7 +2707,7 @@ fi
fi
# modify new host file if NFS mounted heterogeneous machine
doit=
if test $program = $prog.marc
if test $program = $prog.marc
then
doit=yes
fi
@ -2731,23 +2731,23 @@ if ($1 ~ hst) {if ( fnr == 1 ) printf("%s\n",$0); else \
printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
/bin/mv $jid.host{$$} $jid.host
host=$jid.host
fi
fi
fi
done
done
fi
fi # if test $program = $prog.marc -o $user -o $obj
else # if test $host
# assume shared memory machine if no hostfile given and
# MPITYPE is set to mpich or Myrinet
# check for Myrinet that the total number of processes is
# check for Myrinet that the total number of processes is
# less than number of available user ports, 5
if test $MPITYPE = "mpich" -o $MPITYPE = "scali"
then
numproc=`echo $nprocd | $AWK '{sum=$1-1}; {print sum}'`
echo `hostname` $numproc $execpath > $jid.host
host=$jid.host
elif test $MPITYPE = "myrinet"
elif test $MPITYPE = "myrinet"
then
if test $nprocd -gt 5
then
@ -2787,7 +2787,7 @@ printf("%s %s %s_%s\n",$1,$2,$3,$1) } else print}' $jid.host > $jid.host{$$}
fi # if test $host
fi # if test $nprocd -gt 1
fi # if test $program = $exefile -o $program = $prog.marc
##############################################################################
@ -2837,7 +2837,7 @@ else
nsolverarg="$nsolverarg $nsolver"
fi
if test $nprocdddm -lt 2 -a $nsolver -eq 0
then
then
nprocd=0
fi
if test $nprocd -gt 0
@ -2848,7 +2848,7 @@ then
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -2953,7 +2953,7 @@ $ntearg $nte $ntsarg $nts $gpuoption -dirjob $DIRJOB "
then
echo " "
echo "error: parallel job attempted on non-parallel version,"
echo " or, if parallel version is installed, the include "
echo " or, if parallel version is installed, the include "
echo " file is probably corrupted"
echo " "
if test "$deletelog" = no
@ -3241,6 +3241,7 @@ else
fi
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3283,7 +3284,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
fi
else
if test $cpdll = yes; then
@ -3292,10 +3293,10 @@ else
fi
if test $rmdll = yes
then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
then
numdom=$nprocdddm
@ -3363,15 +3364,15 @@ else
#
QUENAME=qsub
SUBMCMD="-q $qid -o /dev/null -e $jid.batch_err_log -x -r $jid"
if test "$priority"
if test "$priority"
then
SUBMCMD=$SUBMCMD" -p $priority"
fi
if test "$att"
if test "$att"
then
SUBMCMD=$SUBMCMD" -a $att"
fi
if test "$cpu"
if test "$cpu"
then
SUBMCMD=$SUBMCMD" -lt $cpu"
fi
@ -3553,7 +3554,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3573,6 +3574,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
#
# run marc
@ -3621,7 +3623,7 @@ fi
if test $dllrun -eq 0; then
if test $prgsav = no
then
/bin/rm -f $bd$program 2>/dev/null
/bin/rm -f $bd$program 2>/dev/null
# for network run, remove executable on remote machines
# and executables with modified name
if test $nprocd -gt 1
@ -3670,7 +3672,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi
if test $nprocdddm -gt 1
@ -3887,7 +3889,7 @@ then
then
counter=$((counter+1))
if test ${dirstatus[$counter]} = "local" -a ${compstatus[$counter]} = "yes"
then
then
DIR1=$DIRJOB
line=`grep -v '^#' $userhost | grep "^$ibase "`
workdir=`echo $line | $AWK '{print $3}'`
@ -3907,6 +3909,7 @@ else # if test $link
fi # if test $link
/bin/rm $userobj 2>/dev/null
/bin/rm $DIRJOB/*.mod 2>/dev/null
/bin/rm $DIRJOB/*.smod 2>/dev/null
# done if no job id given
if test -z "$jid"
then
@ -3946,7 +3949,7 @@ if test $ddm_arc -gt 0; then
RUN_JOB="$MESHERDIR/sf_exeddm $RUN_JOB -ddm $ddm_arc "
fi
$RUN_JOB
$RUN_JOB
if test $nprocd -gt 1
then
@ -4029,7 +4032,7 @@ else
/bin/cp $DIRJOB/$marcdll $DIRJOB/${filename}_$marcdll 2>/dev/null
fi
if test $rmdll = yes;then
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
/bin/rm -f $DIRJOB/$marcdll 2>/dev/null
fi
fi

View File

@ -0,0 +1,65 @@
#!/usr/bin/env python3
import os
import glob
import argparse
from pathlib import Path
import damask
marc_version = float(damask.environment.options['MARC_VERSION'])
msc_root = Path(damask.environment.options['MSC_ROOT'])
damask_root = damask.environment.root_dir
parser = argparse.ArgumentParser(
description='Apply DAMASK modification to MSC.Marc/Mentat',
epilog = f'MSC_ROOT={msc_root} and MARC_VERSION={marc_version} (from {damask_root}/env/CONFIG)')
parser.add_argument('--editor', dest='editor', metavar='string', default='vi',
help='Name of the editor for MSC.Mentat (executable)')
def copy_and_replace(in_file,dst):
with open(in_file) as f:
content = f.read()
content = content.replace('%INSTALLDIR%',str(damask_root/'bin'))
content = content.replace('%VERSION%',str(marc_version).replace('.0',''))
content = content.replace('%EDITOR%', parser.parse_args().editor)
with open(dst/Path(in_file).name,'w') as f:
f.write(content)
print('adapting Marc tools...\n')
src = damask_root/f'installation/mods_MarcMentat/{marc_version}/Marc_tools'
dst = msc_root/f'marc{marc_version}/tools'
for in_file in glob.glob(str(src/'*damask*')) + [str(src/'include_linux64')]:
copy_and_replace(in_file,dst)
print('adapting Mentat scripts and menus...\n')
src = damask_root/f'installation/mods_MarcMentat/{marc_version}/Mentat_bin'
dst = msc_root/f'mentat{marc_version}/bin'
for in_file in glob.glob(str(src/'*[!.original]')):
copy_and_replace(in_file,dst)
src = damask_root/f'installation/mods_MarcMentat/{marc_version}/Mentat_menus'
dst = msc_root/f'mentat{marc_version}/menus'
for in_file in glob.glob(str(src/'job_run.ms')):
copy_and_replace(in_file,dst)
print('compiling Mentat menu binaries...')
executable = str(msc_root/f'mentat{marc_version}/bin/mentat')
menu_file = str(msc_root/f'mentat{marc_version}/menus/linux64/main.msb')
os.system(f'xvfb-run {executable} -compile {menu_file}')
print('setting file access rights...\n')
for pattern in [msc_root/f'marc{marc_version}/tools/*damask*',
msc_root/f'mentat{marc_version}/bin/submit?',
msc_root/f'mentat{marc_version}/bin/kill?']:
for f in glob.glob(str(pattern)):
os.chmod(f,0o755)

View File

@ -1,144 +0,0 @@
#!/usr/bin/env bash
SCRIPTLOCATION="$( cd "$( dirname "$0" )" && pwd )"
DAMASK_ROOT=$SCRIPTLOCATION/../../
if [ "x$MSC_ROOT" != "x" ]; then
DEFAULT_DIR=$MSC_ROOT
fi
if [ "x$MARC_VERSION" != "x" ]; then
DEFAULT_VERSION=$MARC_VERSION
fi
if [ "x$DAMASK_BIN" != "x" ]; then
BIN_DIR=$DAMASK_ROOT/bin
fi
while [ ! -d "$SCRIPTLOCATION/$VERSION" ] || [ -z "$VERSION" ]
do
echo "Input version of MARC/MENTAT installation: [${DEFAULT_VERSION}]"
read VERSION
if [ -z "$VERSION" ]; then
VERSION=${DEFAULT_VERSION}
fi
[[ -d "$SCRIPTLOCATION/$VERSION" ]] || echo -e "$VERSION not supported..!\n"
done
echo "MSC version: $VERSION"
while [ ! -d "$INSTALLDIR" ] || [ -z "$INSTALLDIR" ]
do
echo "Input path of MARC/MENTAT installation: [${DEFAULT_DIR}]"
read INSTALLDIR
if [ -z "$INSTALLDIR" ]; then
INSTALLDIR=${DEFAULT_DIR}
fi
[[ -d "$INSTALLDIR" ]] || echo -e "$INSTALLDIR not found..!\n"
done
INSTALLDIR=${INSTALLDIR%/} # remove trailing slash
echo "MSC installation path: $INSTALLDIR"
DEFAULT_EDITOR='vi'
EDITOR=''
while [ -z "$EDITOR" ]
do
echo "Input command to invoke your preferred editor: [${DEFAULT_EDITOR}]"
read EDITOR
if [ -z "$EDITOR" ]; then
EDITOR=${DEFAULT_EDITOR}
fi
done
echo "Editor: $EDITOR"
# tools
echo ''
echo 'adapting Marc tools...'
theDIR=$INSTALLDIR/marc$VERSION/tools
for filename in 'comp_damask_mp' \
'comp_damask_lmp' \
'comp_damask_hmp' \
'run_damask_mp' \
'run_damask_lmp' \
'run_damask_hmp' \
'include_linux64'; do
cp $SCRIPTLOCATION/$VERSION/Marc_tools/$filename $theDIR
echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g"
echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g"
echo $filename
done
# Mentat scripts
echo ''
echo 'adapting Mentat scripts...'
theDIR=$INSTALLDIR/mentat$VERSION/bin
for filename in 'edit_window' \
'submit4' \
'submit5' \
'submit6' \
'kill4' \
'kill5' \
'kill6'; do
cp $SCRIPTLOCATION/$VERSION/Mentat_bin/$filename $theDIR
echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g"
echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g"
echo $theDIR/$filename | xargs perl -pi -e "s:%EDITOR%:${EDITOR}:g"
echo $filename
done
# Mentat scripts
echo -e '\nadapting Mentat menus...'
theDIR=$INSTALLDIR/mentat$VERSION/menus
for filename in 'job_run.ms'; do
cp $SCRIPTLOCATION/$VERSION/Mentat_menus/$filename $theDIR
echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g"
echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g"
echo $filename
done
# compile menus
echo ''
echo 'compiling Mentat menu binaries...'
$(which xvfb-run 2>/dev/null) $INSTALLDIR/mentat$VERSION/bin/mentat -compile $INSTALLDIR/mentat$VERSION/menus/linux64/main.msb
[[ $? != 0 ]] && echo '...failed. Try installing xvfb-run on your system.'
# setting access rights
echo ''
echo 'setting file access rights...'
for filename in marc$VERSION/tools/run_damask* \
marc$VERSION/tools/comp_damask* \
mentat$VERSION/bin/submit{4..6} \
mentat$VERSION/bin/kill{4..6} ; do
chmod 755 $INSTALLDIR/${filename}
done
#creating symlinks for run_damask_scripts
if [ -d "$BIN_DIR" ]; then
echo ''
echo "Do you want to create symlinks for run_damask scripts in ${BIN_DIR} [YES/no] ?"
read YESNO
if [ -z "$YESNO" ]; then
YESNO=yes
fi
case $YESNO in
y* | Y* )
echo''
echo 'creating symlinks ...'
echo''
theDIR=$INSTALLDIR/marc$VERSION/tools
for filename in 'run_damask_mp' \
'run_damask_lmp' \
'run_damask_hmp'; do
echo ${filename:4}$VERSION
[ -f $BIN_DIR/${filename:4}$VERSION ] && rm $BIN_DIR/${filename:4}$VERSION
ln -s $theDIR/$filename $BIN_DIR/${filename:4}$VERSION
done
;;
esac
fi
# precompiling user subroutine
echo ''
echo 'precompiling $VERSION HYPELA2 user subroutine...'
echo 'not yet implemented..!'
echo -e '\ndone.'

View File

@ -11,7 +11,7 @@ The Intel Fortran compiler needs to be installed.
1) Install Marc, Mentat and Documentation as usual
Run the test example including subroutines to confirm that the installation of both Marc/Mentat and the Intel Fortran Compiler is ok!
2) Run the apply_DAMASK_modifications.sh script from this directory.
2) Run the apply_DAMASK_modifications.py script from this directory.
APPENDIX:

View File

@ -5,9 +5,11 @@ import re as _re
name = 'damask'
with open(_Path(__file__).parent/_Path('VERSION')) as _f:
version = _re.sub(r'^v','',_f.readline().strip())
__version__ = version
# make classes directly accessible as damask.Class
from ._environment import Environment # noqa
from ._environment import Environment as _ # noqa
environment = _()
from ._table import Table # noqa
from ._vtk import VTK # noqa
from ._colormap import Colormap # noqa
@ -19,6 +21,7 @@ from ._geom import Geom # noqa
from . import solver # noqa
# deprecated
Environment = _
from ._asciitable import ASCIItable # noqa
from ._test import Test # noqa
from .config import Material # noqa

View File

@ -1,8 +1,11 @@
import os
import json
import functools
import numpy as np
import matplotlib as mpl
if os.name == 'posix' and 'DISPLAY' not in os.environ:
mpl.use('Agg')
import matplotlib.pyplot as plt
from matplotlib import cm

View File

@ -3,7 +3,6 @@ from pathlib import Path
class Environment:
# ToDo: Probably, we don't need a class (just a module with a few functions)
def __init__(self):
"""Do Nothing."""
pass

View File

@ -6,9 +6,9 @@ from functools import partial
import numpy as np
from scipy import ndimage,spatial
import damask
from . import VTK
from . import util
from . import Environment
from . import grid_filters
@ -362,7 +362,7 @@ class Geom:
seeds_p = seeds
coords = grid_filters.cell_coord0(grid,size).reshape(-1,3)
pool = multiprocessing.Pool(processes = int(Environment().options['DAMASK_NUM_THREADS']))
pool = multiprocessing.Pool(processes = int(damask.environment.options['DAMASK_NUM_THREADS']))
result = pool.map_async(partial(Geom._find_closest_seed,seeds_p,weights_p), [coord for coord in coords])
pool.close()
pool.join()

View File

@ -1,11 +1,9 @@
import numpy as np
from . import Rotation
class Symmetry:
"""
Symmetry operations for lattice systems.
Symmetry-related operations for crystal systems.
References
----------
@ -13,34 +11,34 @@ class Symmetry:
"""
lattices = [None,'orthorhombic','tetragonal','hexagonal','cubic',]
crystal_systems = [None,'orthorhombic','tetragonal','hexagonal','cubic']
def __init__(self, symmetry = None):
def __init__(self, system = None):
"""
Symmetry Definition.
Parameters
----------
symmetry : str, optional
label of the crystal system
system : {None,'orthorhombic','tetragonal','hexagonal','cubic'}, optional
Name of the crystal system. Defaults to 'None'.
"""
if symmetry is not None and symmetry.lower() not in Symmetry.lattices:
raise KeyError(f'Symmetry/crystal system "{symmetry}" is unknown')
if system is not None and system.lower() not in self.crystal_systems:
raise KeyError(f'Crystal system "{system}" is unknown')
self.lattice = symmetry.lower() if isinstance(symmetry,str) else symmetry
self.system = system.lower() if isinstance(system,str) else system
def __copy__(self):
"""Copy."""
return self.__class__(self.lattice)
return self.__class__(self.system)
copy = __copy__
def __repr__(self):
"""Readable string."""
return f'{self.lattice}'
return f'{self.system}'
def __eq__(self, other):
@ -53,7 +51,7 @@ class Symmetry:
Symmetry to check for equality.
"""
return self.lattice == other.lattice
return self.system == other.system
def __neq__(self, other):
"""
@ -77,14 +75,16 @@ class Symmetry:
Symmetry to check for for order.
"""
myOrder = Symmetry.lattices.index(self.lattice)
otherOrder = Symmetry.lattices.index(other.lattice)
myOrder = self.crystal_systems.index(self.system)
otherOrder = self.crystal_systems.index(other.system)
return (myOrder > otherOrder) - (myOrder < otherOrder)
def symmetryOperations(self,members=[]):
"""List (or single element) of symmetry operations as rotations."""
if self.lattice == 'cubic':
symQuats = [
@property
def symmetry_operations(self):
"""Symmetry operations as quaternions."""
if self.system == 'cubic':
sym_quats = [
[ 1.0, 0.0, 0.0, 0.0 ],
[ 0.0, 1.0, 0.0, 0.0 ],
[ 0.0, 0.0, 1.0, 0.0 ],
@ -110,8 +110,8 @@ class Symmetry:
[-0.5*np.sqrt(2), 0.5*np.sqrt(2), 0.0, 0.0 ],
[-0.5*np.sqrt(2),-0.5*np.sqrt(2), 0.0, 0.0 ],
]
elif self.lattice == 'hexagonal':
symQuats = [
elif self.system == 'hexagonal':
sym_quats = [
[ 1.0, 0.0, 0.0, 0.0 ],
[-0.5*np.sqrt(3), 0.0, 0.0, -0.5 ],
[ 0.5, 0.0, 0.0, 0.5*np.sqrt(3) ],
@ -125,8 +125,8 @@ class Symmetry:
[ 0.0, -0.5, -0.5*np.sqrt(3), 0.0 ],
[ 0.0, 0.5*np.sqrt(3), 0.5, 0.0 ],
]
elif self.lattice == 'tetragonal':
symQuats = [
elif self.system == 'tetragonal':
sym_quats = [
[ 1.0, 0.0, 0.0, 0.0 ],
[ 0.0, 1.0, 0.0, 0.0 ],
[ 0.0, 0.0, 1.0, 0.0 ],
@ -136,64 +136,54 @@ class Symmetry:
[ 0.5*np.sqrt(2), 0.0, 0.0, 0.5*np.sqrt(2) ],
[-0.5*np.sqrt(2), 0.0, 0.0, 0.5*np.sqrt(2) ],
]
elif self.lattice == 'orthorhombic':
symQuats = [
elif self.system == 'orthorhombic':
sym_quats = [
[ 1.0,0.0,0.0,0.0 ],
[ 0.0,1.0,0.0,0.0 ],
[ 0.0,0.0,1.0,0.0 ],
[ 0.0,0.0,0.0,1.0 ],
]
else:
symQuats = [
sym_quats = [
[ 1.0,0.0,0.0,0.0 ],
]
symOps = list(map(Rotation,
np.array(symQuats)[np.atleast_1d(members) if members != [] else range(len(symQuats))]))
try:
iter(members) # asking for (even empty) list of members?
except TypeError:
return symOps[0] # no, return rotation object
else:
return symOps # yes, return list of rotations
return np.array(sym_quats)
def inFZ(self,rodrigues):
def in_FZ(self,rho):
"""
Check whether given Rodrigues-Frank vector falls into fundamental zone of own symmetry.
Check whether given Rodrigues-Frank vector falls into fundamental zone.
Fundamental zone in Rodrigues space is point symmetric around origin.
"""
if (len(rodrigues) != 3):
raise ValueError('Input is not a Rodrigues-Frank vector.\n')
if(rho.shape[-1] != 3):
raise ValueError('Input is not a Rodrigues-Frank vector field.')
if np.any(rodrigues == np.inf): return False
rho_abs = np.abs(rho)
Rabs = abs(rodrigues)
if self.lattice == 'cubic':
return np.sqrt(2.0)-1.0 >= Rabs[0] \
and np.sqrt(2.0)-1.0 >= Rabs[1] \
and np.sqrt(2.0)-1.0 >= Rabs[2] \
and 1.0 >= Rabs[0] + Rabs[1] + Rabs[2]
elif self.lattice == 'hexagonal':
return 1.0 >= Rabs[0] and 1.0 >= Rabs[1] and 1.0 >= Rabs[2] \
and 2.0 >= np.sqrt(3)*Rabs[0] + Rabs[1] \
and 2.0 >= np.sqrt(3)*Rabs[1] + Rabs[0] \
and 2.0 >= np.sqrt(3) + Rabs[2]
elif self.lattice == 'tetragonal':
return 1.0 >= Rabs[0] and 1.0 >= Rabs[1] \
and np.sqrt(2.0) >= Rabs[0] + Rabs[1] \
and np.sqrt(2.0) >= Rabs[2] + 1.0
elif self.lattice == 'orthorhombic':
return 1.0 >= Rabs[0] and 1.0 >= Rabs[1] and 1.0 >= Rabs[2]
else:
return True
with np.errstate(invalid='ignore'):
# using '*'/prod for 'and'
if self.system == 'cubic':
return np.where(np.prod(np.sqrt(2)-1. >= rho_abs,axis=-1) * \
(1. >= np.sum(rho_abs,axis=-1)),True,False)
elif self.system == 'hexagonal':
return np.where(np.prod(1. >= rho_abs,axis=-1) * \
(2. >= np.sqrt(3)*rho_abs[...,0] + rho_abs[...,1]) * \
(2. >= np.sqrt(3)*rho_abs[...,1] + rho_abs[...,0]) * \
(2. >= np.sqrt(3) + rho_abs[...,2]),True,False)
elif self.system == 'tetragonal':
return np.where(np.prod(1. >= rho_abs[...,:2],axis=-1) * \
(np.sqrt(2) >= rho_abs[...,0] + rho_abs[...,1]) * \
(np.sqrt(2) >= rho_abs[...,2] + 1.),True,False)
elif self.system == 'orthorhombic':
return np.where(np.prod(1. >= rho_abs,axis=-1),True,False)
else:
return np.where(np.all(np.isfinite(rho_abs),axis=-1),True,False)
def inDisorientationSST(self,rodrigues):
def in_disorientation_SST(self,rho):
"""
Check whether given Rodrigues-Frank vector (of misorientation) falls into standard stereographic triangle of own symmetry.
Check whether given Rodrigues-Frank vector (of misorientation) falls into standard stereographic triangle.
References
----------
@ -201,27 +191,33 @@ class Symmetry:
https://doi.org/10.1107/S0108767391006864
"""
if (len(rodrigues) != 3):
raise ValueError('Input is not a Rodrigues-Frank vector.\n')
R = rodrigues
if(rho.shape[-1] != 3):
raise ValueError('Input is not a Rodrigues-Frank vector field.')
epsilon = 0.0
if self.lattice == 'cubic':
return R[0] >= R[1]+epsilon and R[1] >= R[2]+epsilon and R[2] >= epsilon
elif self.lattice == 'hexagonal':
return R[0] >= np.sqrt(3)*(R[1]-epsilon) and R[1] >= epsilon and R[2] >= epsilon
elif self.lattice == 'tetragonal':
return R[0] >= R[1]-epsilon and R[1] >= epsilon and R[2] >= epsilon
elif self.lattice == 'orthorhombic':
return R[0] >= epsilon and R[1] >= epsilon and R[2] >= epsilon
else:
return True
with np.errstate(invalid='ignore'):
# using '*' for 'and'
if self.system == 'cubic':
return np.where((rho[...,0] >= rho[...,1]) * \
(rho[...,1] >= rho[...,2]) * \
(rho[...,2] >= 0),True,False)
elif self.system == 'hexagonal':
return np.where((rho[...,0] >= rho[...,1]*np.sqrt(3)) * \
(rho[...,1] >= 0) * \
(rho[...,2] >= 0),True,False)
elif self.system == 'tetragonal':
return np.where((rho[...,0] >= rho[...,1]) * \
(rho[...,1] >= 0) * \
(rho[...,2] >= 0),True,False)
elif self.system == 'orthorhombic':
return np.where((rho[...,0] >= 0) * \
(rho[...,1] >= 0) * \
(rho[...,2] >= 0),True,False)
else:
return np.ones_like(rho[...,0],dtype=bool)
def inSST(self,
vector,
proper = False,
color = False):
#ToDo: IPF color in separate function
def in_SST(self,vector,proper=False,color=False):
"""
Check whether given vector falls into standard stereographic triangle of own symmetry.
@ -244,7 +240,10 @@ class Symmetry:
... }
"""
if self.lattice == 'cubic':
if(vector.shape[-1] != 3):
raise ValueError('Input is not a 3D vector field.')
if self.system == 'cubic':
basis = {'improper':np.array([ [-1. , 0. , 1. ],
[ np.sqrt(2.) , -np.sqrt(2.) , 0. ],
[ 0. , np.sqrt(3.) , 0. ] ]),
@ -252,7 +251,7 @@ class Symmetry:
[-np.sqrt(2.) , np.sqrt(2.) , 0. ],
[ np.sqrt(3.) , 0. , 0. ] ]),
}
elif self.lattice == 'hexagonal':
elif self.system == 'hexagonal':
basis = {'improper':np.array([ [ 0. , 0. , 1. ],
[ 1. , -np.sqrt(3.) , 0. ],
[ 0. , 2. , 0. ] ]),
@ -260,7 +259,7 @@ class Symmetry:
[-1. , np.sqrt(3.) , 0. ],
[ np.sqrt(3.) , -1. , 0. ] ]),
}
elif self.lattice == 'tetragonal':
elif self.system == 'tetragonal':
basis = {'improper':np.array([ [ 0. , 0. , 1. ],
[ 1. , -1. , 0. ],
[ 0. , np.sqrt(2.) , 0. ] ]),
@ -268,7 +267,7 @@ class Symmetry:
[-1. , 1. , 0. ],
[ np.sqrt(2.) , 0. , 0. ] ]),
}
elif self.lattice == 'orthorhombic':
elif self.system == 'orthorhombic':
basis = {'improper':np.array([ [ 0., 0., 1.],
[ 1., 0., 0.],
[ 0., 1., 0.] ]),
@ -278,43 +277,41 @@ class Symmetry:
}
else: # direct exit for unspecified symmetry
if color:
return (True,np.zeros(3,'d'))
return (np.ones_like(vector[...,0],bool),np.zeros_like(vector))
else:
return True
return np.ones_like(vector[...,0],bool)
v = np.array(vector,dtype=float)
if proper: # check both improper ...
theComponents = np.around(np.dot(basis['improper'],v),12)
inSST = np.all(theComponents >= 0.0)
if not inSST: # ... and proper SST
theComponents = np.around(np.dot(basis['proper'],v),12)
inSST = np.all(theComponents >= 0.0)
b_i = np.broadcast_to(basis['improper'],vector.shape+(3,))
if proper:
b_p = np.broadcast_to(basis['proper'], vector.shape+(3,))
improper = np.all(np.around(np.einsum('...ji,...i',b_i,vector),12)>=0.0,axis=-1,keepdims=True)
theComponents = np.where(np.broadcast_to(improper,vector.shape),
np.around(np.einsum('...ji,...i',b_i,vector),12),
np.around(np.einsum('...ji,...i',b_p,vector),12))
else:
v[2] = abs(v[2]) # z component projects identical
theComponents = np.around(np.dot(basis['improper'],v),12) # for positive and negative values
inSST = np.all(theComponents >= 0.0)
vector_ = np.block([vector[...,0:2],np.abs(vector[...,2:3])]) # z component projects identical
theComponents = np.around(np.einsum('...ji,...i',b_i,vector_),12)
in_SST = np.all(theComponents >= 0.0,axis=-1)
if color: # have to return color array
if inSST:
rgb = np.power(theComponents/np.linalg.norm(theComponents),0.5) # smoothen color ramps
rgb = np.minimum(np.ones(3,dtype=float),rgb) # limit to maximum intensity
rgb /= max(rgb) # normalize to (HS)V = 1
else:
rgb = np.zeros(3,dtype=float)
return (inSST,rgb)
with np.errstate(invalid='ignore',divide='ignore'):
rgb = (theComponents/np.linalg.norm(theComponents,axis=-1,keepdims=True))**0.5 # smoothen color ramps
rgb = np.minimum(1.,rgb) # limit to maximum intensity
rgb /= np.max(rgb,axis=-1,keepdims=True) # normalize to (HS)V = 1
rgb[np.broadcast_to(~in_SST.reshape(vector[...,0].shape+(1,)),vector.shape)] = 0.0
return (in_SST,rgb)
else:
return inSST
# code derived from https://github.com/ezag/pyeuclid
# suggested reading: http://web.mit.edu/2.998/www/QuaternionReport1.pdf
return in_SST
# ******************************************************************************************
class Lattice:
class Lattice: # ToDo: Make a subclass of Symmetry!
"""
Lattice system.
Bravais lattice.
Currently, this contains only a mapping from Bravais lattice to symmetry
This contains only a mapping from Bravais lattice to symmetry
and orientation relationships. It could include twin and slip systems.
References
@ -324,15 +321,15 @@ class Lattice:
"""
lattices = {
'triclinic':{'symmetry':None},
'bct':{'symmetry':'tetragonal'},
'hex':{'symmetry':'hexagonal'},
'fcc':{'symmetry':'cubic','c/a':1.0},
'bcc':{'symmetry':'cubic','c/a':1.0},
'triclinic':{'system':None},
'bct': {'system':'tetragonal'},
'hex': {'system':'hexagonal'},
'fcc': {'system':'cubic','c/a':1.0},
'bcc': {'system':'cubic','c/a':1.0},
}
def __init__(self, lattice):
def __init__(self,lattice,c_over_a=None):
"""
New lattice of given type.
@ -343,18 +340,23 @@ class Lattice:
"""
self.lattice = lattice
self.symmetry = Symmetry(self.lattices[lattice]['symmetry'])
self.symmetry = Symmetry(self.lattices[lattice]['system'])
# transition to subclass
self.system = self.symmetry.system
self.in_SST = self.symmetry.in_SST
self.in_FZ = self.symmetry.in_FZ
self.in_disorientation_SST = self.symmetry.in_disorientation_SST
def __repr__(self):
"""Report basic lattice information."""
return f'Bravais lattice {self.lattice} ({self.symmetry} symmetry)'
return f'Bravais lattice {self.lattice} ({self.symmetry} crystal system)'
# Kurdjomov--Sachs orientation relationship for fcc <-> bcc transformation
# from S. Morito et al., Journal of Alloys and Compounds 577:s587-s592, 2013
# also see K. Kitahara et al., Acta Materialia 54:1279-1288, 2006
KS = {'mapping':{'fcc':0,'bcc':1},
_KS = {'mapping':{'fcc':0,'bcc':1},
'planes': np.array([
[[ 1, 1, 1],[ 0, 1, 1]],
[[ 1, 1, 1],[ 0, 1, 1]],
@ -408,7 +410,7 @@ class Lattice:
# Greninger--Troiano orientation relationship for fcc <-> bcc transformation
# from Y. He et al., Journal of Applied Crystallography 39:72-81, 2006
GT = {'mapping':{'fcc':0,'bcc':1},
_GT = {'mapping':{'fcc':0,'bcc':1},
'planes': np.array([
[[ 1, 1, 1],[ 1, 0, 1]],
[[ 1, 1, 1],[ 1, 1, 0]],
@ -462,7 +464,7 @@ class Lattice:
# Greninger--Troiano' orientation relationship for fcc <-> bcc transformation
# from Y. He et al., Journal of Applied Crystallography 39:72-81, 2006
GTprime = {'mapping':{'fcc':0,'bcc':1},
_GTprime = {'mapping':{'fcc':0,'bcc':1},
'planes': np.array([
[[ 7, 17, 17],[ 12, 5, 17]],
[[ 17, 7, 17],[ 17, 12, 5]],
@ -516,7 +518,7 @@ class Lattice:
# Nishiyama--Wassermann orientation relationship for fcc <-> bcc transformation
# from H. Kitahara et al., Materials Characterization 54:378-386, 2005
NW = {'mapping':{'fcc':0,'bcc':1},
_NW = {'mapping':{'fcc':0,'bcc':1},
'planes': np.array([
[[ 1, 1, 1],[ 0, 1, 1]],
[[ 1, 1, 1],[ 0, 1, 1]],
@ -546,7 +548,7 @@ class Lattice:
# Pitsch orientation relationship for fcc <-> bcc transformation
# from Y. He et al., Acta Materialia 53:1179-1190, 2005
Pitsch = {'mapping':{'fcc':0,'bcc':1},
_Pitsch = {'mapping':{'fcc':0,'bcc':1},
'planes': np.array([
[[ 0, 1, 0],[ -1, 0, 1]],
[[ 0, 0, 1],[ 1, -1, 0]],
@ -576,7 +578,7 @@ class Lattice:
# Bain orientation relationship for fcc <-> bcc transformation
# from Y. He et al., Journal of Applied Crystallography 39:72-81, 2006
Bain = {'mapping':{'fcc':0,'bcc':1},
_Bain = {'mapping':{'fcc':0,'bcc':1},
'planes': np.array([
[[ 1, 0, 0],[ 1, 0, 0]],
[[ 0, 1, 0],[ 0, 1, 0]],
@ -586,7 +588,8 @@ class Lattice:
[[ 0, 0, 1],[ 1, 0, 1]],
[[ 1, 0, 0],[ 1, 1, 0]]],dtype='float')}
def relationOperations(self,model):
def relation_operations(self,model):
"""
Crystallographic orientation relationships for phase transformations.
@ -608,8 +611,8 @@ class Lattice:
https://doi.org/10.1016/j.actamat.2004.11.021
"""
models={'KS':self.KS, 'GT':self.GT, 'GT_prime':self.GTprime,
'NW':self.NW, 'Pitsch': self.Pitsch, 'Bain':self.Bain}
models={'KS':self._KS, 'GT':self._GT, 'GT_prime':self._GTprime,
'NW':self._NW, 'Pitsch': self._Pitsch, 'Bain':self._Bain}
try:
relationship = models[model]
except KeyError :
@ -635,6 +638,8 @@ class Lattice:
otherDir = miller[otherDir_id]/ np.linalg.norm(miller[otherDir_id])
otherMatrix = np.array([otherDir,np.cross(otherPlane,otherDir),otherPlane])
r['rotations'].append(Rotation.from_matrix(np.dot(otherMatrix.T,myMatrix)))
r['rotations'].append(np.dot(otherMatrix.T,myMatrix))
r['rotations'] = np.array(r['rotations'])
return r

View File

@ -3,7 +3,7 @@ import numpy as np
from . import Lattice
from . import Rotation
class Orientation:
class Orientation: # ToDo: make subclass of lattice and Rotation?
"""
Crystallographic orientation.
@ -39,9 +39,12 @@ class Orientation:
else:
self.rotation = Rotation.from_quaternion(rotation) # assume quaternion
if self.rotation.quaternion.shape != (4,):
raise NotImplementedError('Support for multiple rotations missing')
def __getitem__(self,item):
"""Iterate over leading/leftmost dimension of Orientation array."""
return self.__class__(self.rotation[item],self.lattice)
# ToDo: Discuss vectorization/calling signature
def disorientation(self,
other,
SST = True,
@ -58,8 +61,8 @@ class Orientation:
if self.lattice.symmetry != other.lattice.symmetry:
raise NotImplementedError('disorientation between different symmetry classes not supported yet.')
mySymEqs = self.equivalentOrientations() if SST else self.equivalentOrientations([0]) # take all or only first sym operation
otherSymEqs = other.equivalentOrientations()
mySymEqs = self.equivalent if SST else self.equivalent[0] #ToDo: This is just me! # take all or only first sym operation
otherSymEqs = other.equivalent
for i,sA in enumerate(mySymEqs):
aInv = sA.rotation.inversed()
@ -68,8 +71,8 @@ class Orientation:
r = b*aInv
for k in range(2):
r.inverse()
breaker = self.lattice.symmetry.inFZ(r.as_Rodrigues(vector=True)) \
and (not SST or other.lattice.symmetry.inDisorientationSST(r.as_Rodrigues(vector=True)))
breaker = self.lattice.in_FZ(r.as_Rodrigues(vector=True)) \
and (not SST or other.lattice.in_disorientation_SST(r.as_Rodrigues(vector=True)))
if breaker: break
if breaker: break
if breaker: break
@ -77,79 +80,123 @@ class Orientation:
return (Orientation(r,self.lattice), i,j, k == 1) if symmetries else r # disorientation ...
# ... own sym, other sym,
# self-->other: True, self<--other: False
def inFZ(self):
return self.lattice.symmetry.inFZ(self.rotation.as_Rodrigues(vector=True))
@property
def in_FZ(self):
"""Check if orientations fall into Fundamental Zone."""
return self.lattice.in_FZ(self.rotation.as_Rodrigues(vector=True))
def equivalentOrientations(self,members=[]):
"""List of orientations which are symmetrically equivalent."""
try:
iter(members) # asking for (even empty) list of members?
except TypeError:
return self.__class__(self.lattice.symmetry.symmetryOperations(members)*self.rotation,self.lattice) # no, return rotation object
else:
return [self.__class__(q*self.rotation,self.lattice) \
for q in self.lattice.symmetry.symmetryOperations(members)] # yes, return list of rotations
@property
def equivalent(self):
"""
Orientations which are symmetrically equivalent.
def relatedOrientations(self,model):
"""List of orientations related by the given orientation relationship."""
r = self.lattice.relationOperations(model)
return [self.__class__(o*self.rotation,r['lattice']) for o in r['rotations']]
One dimension (length according to number of symmetrically equivalent orientations)
is added to the left of the Rotation array.
"""
o = self.lattice.symmetry.symmetry_operations
o = o.reshape(o.shape[:1]+(1,)*len(self.rotation.shape)+(4,))
o = Rotation(np.broadcast_to(o,o.shape[:1]+self.rotation.quaternion.shape))
s = np.broadcast_to(self.rotation.quaternion,o.shape[:1]+self.rotation.quaternion.shape)
return self.__class__(o@Rotation(s),self.lattice)
def related(self,model):
"""
Orientations related by the given orientation relationship.
One dimension (length according to number of related orientations)
is added to the left of the Rotation array.
"""
o = Rotation.from_matrix(self.lattice.relation_operations(model)['rotations']).as_quaternion()
o = o.reshape(o.shape[:1]+(1,)*len(self.rotation.shape)+(4,))
o = Rotation(np.broadcast_to(o,o.shape[:1]+self.rotation.quaternion.shape))
s = np.broadcast_to(self.rotation.quaternion,o.shape[:1]+self.rotation.quaternion.shape)
return self.__class__(o@Rotation(s),self.lattice.relation_operations(model)['lattice'])
@property
def reduced(self):
"""Transform orientation to fall into fundamental zone according to symmetry."""
for me in self.equivalentOrientations():
if self.lattice.symmetry.inFZ(me.rotation.as_Rodrigues(vector=True)): break
eq = self.equivalent
in_FZ = eq.in_FZ
return self.__class__(me.rotation,self.lattice)
# remove duplicates (occur for highly symmetric orientations)
found = np.zeros_like(in_FZ[0],dtype=bool)
q = self.rotation.quaternion[0]
for s in range(in_FZ.shape[0]):
#something fishy... why does q needs to be initialized?
q = np.where(np.expand_dims(np.logical_and(in_FZ[s],~found),-1),eq.rotation.quaternion[s],q)
found = np.logical_or(in_FZ[s],found)
return self.__class__(q,self.lattice)
def inversePole(self,
axis,
proper = False,
SST = True):
def inverse_pole(self,axis,proper=False,SST=True):
"""Axis rotated according to orientation (using crystal symmetry to ensure location falls into SST)."""
if SST: # pole requested to be within SST
for i,o in enumerate(self.equivalentOrientations()): # test all symmetric equivalent quaternions
pole = o.rotation*axis # align crystal direction to axis
if self.lattice.symmetry.inSST(pole,proper): break # found SST version
if SST:
eq = self.equivalent
pole = eq.rotation @ np.broadcast_to(axis/np.linalg.norm(axis),eq.rotation.shape+(3,))
in_SST = self.lattice.in_SST(pole,proper=proper)
# remove duplicates (occur for highly symmetric orientations)
found = np.zeros_like(in_SST[0],dtype=bool)
p = pole[0]
for s in range(in_SST.shape[0]):
p = np.where(np.expand_dims(np.logical_and(in_SST[s],~found),-1),pole[s],p)
found = np.logical_or(in_SST[s],found)
return p
else:
pole = self.rotation*axis # align crystal direction to axis
return (pole,i if SST else 0)
return self.rotation @ np.broadcast_to(axis/np.linalg.norm(axis),self.rotation.shape+(3,))
def IPFcolor(self,axis):
def IPF_color(self,axis): #ToDo axis or direction?
"""TSL color of inverse pole figure for given axis."""
color = np.zeros(3,'d')
eq = self.equivalent
pole = eq.rotation @ np.broadcast_to(axis/np.linalg.norm(axis),eq.rotation.shape+(3,))
in_SST, color = self.lattice.in_SST(pole,color=True)
for o in self.equivalentOrientations():
pole = o.rotation*axis # align crystal direction to axis
inSST,color = self.lattice.symmetry.inSST(pole,color=True)
if inSST: break
# remove duplicates (occur for highly symmetric orientations)
found = np.zeros_like(in_SST[0],dtype=bool)
c = color[0]
for s in range(in_SST.shape[0]):
c = np.where(np.expand_dims(np.logical_and(in_SST[s],~found),-1),color[s],c)
found = np.logical_or(in_SST[s],found)
return color
return c
# ToDo: Discuss vectorization/calling signature
@staticmethod
def fromAverage(orientations,
def from_average(orientations,
weights = []):
"""Create orientation from average of list of orientations."""
# further read: Orientation distribution analysis in deformed grains
# https://doi.org/10.1107/S0021889801003077
if not all(isinstance(item, Orientation) for item in orientations):
raise TypeError("Only instances of Orientation can be averaged.")
closest = []
ref = orientations[0]
for o in orientations:
closest.append(o.equivalentOrientations(
closest.append(o.equivalent[
ref.disorientation(o,
SST = False, # select (o[ther]'s) sym orientation
symmetries = True)[2]).rotation) # with lowest misorientation
symmetries = True)[2]].rotation) # with lowest misorientation
return Orientation(Rotation.fromAverage(closest,weights),ref.lattice)
return Orientation(Rotation.from_average(closest,weights),ref.lattice)
# ToDo: Discuss vectorization/calling signature
def average(self,other):
"""Calculate the average rotation."""
return Orientation.fromAverage([self,other])
return Orientation.from_average([self,other])

View File

@ -11,13 +11,13 @@ from functools import partial
import h5py
import numpy as np
from numpy.lib import recfunctions as rfn
import damask
from . import VTK
from . import Table
from . import Rotation
from . import Orientation
from . import Environment
from . import grid_filters
from . import mechanics
from . import util
@ -736,29 +736,23 @@ class Result:
@staticmethod
def _add_IPFcolor(q,l):
d = np.array(l)
d_unit = d/np.linalg.norm(d)
m = util.scale_to_coprime(d)
colors = np.empty((len(q['data']),3),np.uint8)
def _add_IPF_color(q,l):
m = util.scale_to_coprime(np.array(l))
lattice = q['meta']['Lattice']
for i,qu in enumerate(q['data']):
o = Orientation(np.array([qu['w'],qu['x'],qu['y'],qu['z']]),lattice).reduced()
colors[i] = np.uint8(o.IPFcolor(d_unit)*255)
o = Orientation(Rotation(rfn.structured_to_unstructured(q['data'])),
lattice = q['meta']['Lattice'])
return {
'data': colors,
'data': np.uint8(o.IPF_color(l)*255),
'label': 'IPFcolor_[{} {} {}]'.format(*m),
'meta' : {
'Unit': 'RGB (8bit)',
'Lattice': lattice,
'Unit': '8-bit RGB',
'Lattice': q['meta']['Lattice'],
'Description': 'Inverse Pole Figure (IPF) colors along sample direction [{} {} {}]'.format(*m),
'Creator': inspect.stack()[0][3][1:]
}
}
def add_IPFcolor(self,q,l):
def add_IPF_color(self,q,l):
"""
Add RGB color tuple of inverse pole figure (IPF) color.
@ -770,7 +764,7 @@ class Result:
Lab frame direction for inverse pole figure.
"""
self._add_generic_pointwise(self._add_IPFcolor,{'q':q},{'l':l})
self._add_generic_pointwise(self._add_IPF_color,{'q':q},{'l':l})
@staticmethod
@ -1070,7 +1064,7 @@ class Result:
Arguments parsed to func.
"""
num_threads = Environment().options['DAMASK_NUM_THREADS']
num_threads = damask.environment.options['DAMASK_NUM_THREADS']
pool = mp.Pool(int(num_threads) if num_threads is not None else None)
lock = mp.Manager().Lock()

View File

@ -53,6 +53,8 @@ class Rotation:
Use .from_quaternion to perform a sanity check.
"""
if quaternion.shape[-1] != 4:
raise ValueError('Not a quaternion')
self.quaternion = quaternion.copy()
@ -61,6 +63,7 @@ class Rotation:
return self.quaternion.shape[:-1]
# ToDo: Check difference __copy__ vs __deepcopy__
def __copy__(self):
"""Copy."""
return self.__class__(self.quaternion)
@ -71,7 +74,7 @@ class Rotation:
def __repr__(self):
"""Orientation displayed as unit quaternion, rotation matrix, and Bunge-Euler angles."""
if self.quaternion.shape != (4,):
raise NotImplementedError('Support for multiple rotations missing')
return 'Quaternions:\n'+str(self.quaternion) # ToDo: could be nicer ...
return '\n'.join([
'Quaternion: (real={:.3f}, imag=<{:+.3f}, {:+.3f}, {:+.3f}>)'.format(*(self.quaternion)),
'Matrix:\n{}'.format(np.round(self.as_matrix(),8)),
@ -79,6 +82,19 @@ class Rotation:
])
def __getitem__(self,item):
"""Iterate over leading/leftmost dimension of Rotation array."""
if self.shape == (): return self.copy()
if isinstance(item,tuple) and len(item) >= len(self):
raise IndexError('Too many indices')
return self.__class__(self.quaternion[item])
def __len__(self):
"""Length of leading/leftmost dimension of Rotation array."""
return 0 if self.shape == () else self.shape[0]
def __matmul__(self, other):
"""
Rotation of vector, second or fourth order tensor, or rotation object.
@ -88,6 +104,11 @@ class Rotation:
other : numpy.ndarray or Rotation
Vector, second or fourth order tensor, or rotation object that is rotated.
Returns
-------
other_rot : numpy.ndarray or Rotation
Rotated vector, second or fourth order tensor, or rotation object.
"""
if isinstance(other, Rotation):
q_m = self.quaternion[...,0:1]
@ -178,7 +199,7 @@ class Rotation:
"""
if self.quaternion.shape != (4,) or other.quaternion.shape != (4,):
raise NotImplementedError('Support for multiple rotations missing')
return Rotation.fromAverage([self,other])
return Rotation.from_average([self,other])
################################################################################################
@ -273,7 +294,11 @@ class Rotation:
"""
ro = Rotation._qu2ro(self.quaternion)
return ro[...,:3]*ro[...,3] if vector else ro
if vector:
with np.errstate(invalid='ignore'):
return ro[...,:3]*ro[...,3:4]
else:
return ro
def as_homochoric(self):
"""
@ -299,6 +324,7 @@ class Rotation:
"""
return Rotation._qu2cu(self.quaternion)
@property
def M(self): # ToDo not sure about the name: as_M or M? we do not have a from_M
"""
Intermediate representation supporting quaternion averaging.
@ -555,7 +581,7 @@ class Rotation:
@staticmethod
def fromAverage(rotations,weights = None):
def from_average(rotations,weights = None):
"""
Average rotation.
@ -580,8 +606,8 @@ class Rotation:
weights = np.ones(N,dtype='i')
for i,(r,n) in enumerate(zip(rotations,weights)):
M = r.M() * n if i == 0 \
else M + r.M() * n # noqa add (multiples) of this rotation to average noqa
M = r.M * n if i == 0 \
else M + r.M * n # noqa add (multiples) of this rotation to average noqa
eig, vec = np.linalg.eig(M/N)
return Rotation.from_quaternion(np.real(vec.T[eig.argmax()]),accept_homomorph = True)
@ -593,7 +619,7 @@ class Rotation:
elif hasattr(shape, '__iter__'):
r = np.random.random(tuple(shape)+(3,))
else:
r = np.random.random((shape,3))
r = np.random.rand(shape,3)
A = np.sqrt(r[...,2])
B = np.sqrt(1.0-r[...,2])
@ -604,11 +630,9 @@ class Rotation:
return Rotation(q.reshape(r.shape[:-1]+(4,)) if shape is not None else q)._standardize()
# for compatibility (old names do not follow convention)
asM = M
fromQuaternion = from_quaternion
fromEulers = from_Eulers
fromQuaternion = from_quaternion
asAxisAngle = as_axis_angle
__mul__ = __matmul__
@ -781,7 +805,7 @@ class Rotation:
"""Rotation matrix to Bunge-Euler angles."""
with np.errstate(invalid='ignore',divide='ignore'):
zeta = 1.0/np.sqrt(1.0-om[...,2,2:3]**2)
eu = np.where(np.isclose(np.abs(om[...,2,2:3]),1.0,1e-9),
eu = np.where(np.isclose(np.abs(om[...,2,2:3]),1.0,0.0),
np.block([np.arctan2(om[...,0,1:2],om[...,0,0:1]),
np.pi*0.5*(1-om[...,2,2:3]),
np.zeros(om.shape[:-2]+(1,)),

View File

@ -180,7 +180,7 @@ class Test:
def fileInRoot(self,dir,file):
"""Path to a file in the root directory of DAMASK."""
return os.path.join(damask.Environment().rootDir(),dir,file)
return str(damask.environment.root_dir/dir/file)
def fileInReference(self,file):

View File

@ -9,7 +9,6 @@ from vtk.util.numpy_support import numpy_to_vtkIdTypeArray as np_to_vtkIdTypeArr
import damask
from . import Table
from . import Environment
class VTK:
@ -258,7 +257,7 @@ class VTK:
ren.AddActor(actor)
ren.SetBackground(0.2,0.2,0.2)
window.SetSize(Environment().screen_size[0],Environment().screen_size[1])
window.SetSize(damask.environment.screen_size[0],damask.environment.screen_size[1])
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(window)

View File

@ -3,12 +3,12 @@ import shlex
import string
from pathlib import Path
from .._environment import Environment
import damask
class Marc:
"""Wrapper to run DAMASK with MSCMarc."""
def __init__(self,version=Environment().options['MARC_VERSION']):
def __init__(self,version=damask.environment.options['MARC_VERSION']):
"""
Create a Marc solver object.
@ -24,7 +24,7 @@ class Marc:
@property
def library_path(self):
path_MSC = Environment().options['MSC_ROOT']
path_MSC = damask.environment.options['MSC_ROOT']
path_lib = Path(f'{path_MSC}/mentat{self.version}/shlib/linux64')
return path_lib if path_lib.is_dir() else None
@ -33,7 +33,7 @@ class Marc:
@property
def tools_path(self):
path_MSC = Environment().options['MSC_ROOT']
path_MSC = damask.environment.options['MSC_ROOT']
path_tools = Path(f'{path_MSC}/marc{self.version}/tools')
return path_tools if path_tools.is_dir() else None
@ -49,9 +49,8 @@ class Marc:
):
env = Environment()
usersub = env.root_dir/Path(f'src/DAMASK_marc{self.version}').with_suffix('.f90' if compile else '.marc')
usersub = damask.environment.root_dir/'src/DAMASK_marc'
usersub = usersub.parent/(usersub.name + ('.f90' if compile else '.marc'))
if not usersub.is_file():
raise FileNotFoundError("DAMASK4Marc ({}) '{}' not found".format(('source' if compile else 'binary'),usersub))

View File

@ -1,8 +1,8 @@
import setuptools
import os
from pathlib import Path
import re
with open(os.path.join(os.path.dirname(__file__),'damask/VERSION')) as f:
with open(Path(__file__).parent/'damask/VERSION') as f:
version = re.sub(r'(-([^-]*)).*$',r'.\2',re.sub(r'^v(\d+\.\d+(\.\d+)?)',r'\1',f.readline().strip()))
setuptools.setup(

View File

@ -1,4 +1,5 @@
from pathlib import Path
import numpy as np
import pytest
@ -21,3 +22,92 @@ def update(request):
def reference_dir_base():
"""Directory containing reference results."""
return Path(__file__).parent/'reference'
@pytest.fixture
def set_of_quaternions():
"""A set of n random rotations."""
def random_quaternions(N):
r = np.random.rand(N,3)
A = np.sqrt(r[:,2])
B = np.sqrt(1.0-r[:,2])
qu = np.column_stack([np.cos(2.0*np.pi*r[:,0])*A,
np.sin(2.0*np.pi*r[:,1])*B,
np.cos(2.0*np.pi*r[:,1])*B,
np.sin(2.0*np.pi*r[:,0])*A])
qu[:,0]*=np.sign(qu[:,0])
return qu
n = 1100
scatter=1.e-2
specials = np.array([
[1.0, 0.0, 0.0, 0.0],
#----------------------
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0],
[0.0,-1.0, 0.0, 0.0],
[0.0, 0.0,-1.0, 0.0],
[0.0, 0.0, 0.0,-1.0],
#----------------------
[1.0, 1.0, 0.0, 0.0],
[1.0, 0.0, 1.0, 0.0],
[1.0, 0.0, 0.0, 1.0],
[0.0, 1.0, 1.0, 0.0],
[0.0, 1.0, 0.0, 1.0],
[0.0, 0.0, 1.0, 1.0],
#----------------------
[1.0,-1.0, 0.0, 0.0],
[1.0, 0.0,-1.0, 0.0],
[1.0, 0.0, 0.0,-1.0],
[0.0, 1.0,-1.0, 0.0],
[0.0, 1.0, 0.0,-1.0],
[0.0, 0.0, 1.0,-1.0],
#----------------------
[0.0, 1.0,-1.0, 0.0],
[0.0, 1.0, 0.0,-1.0],
[0.0, 0.0, 1.0,-1.0],
#----------------------
[0.0,-1.0,-1.0, 0.0],
[0.0,-1.0, 0.0,-1.0],
[0.0, 0.0,-1.0,-1.0],
#----------------------
[1.0, 1.0, 1.0, 0.0],
[1.0, 1.0, 0.0, 1.0],
[1.0, 0.0, 1.0, 1.0],
[1.0,-1.0, 1.0, 0.0],
[1.0,-1.0, 0.0, 1.0],
[1.0, 0.0,-1.0, 1.0],
[1.0, 1.0,-1.0, 0.0],
[1.0, 1.0, 0.0,-1.0],
[1.0, 0.0, 1.0,-1.0],
[1.0,-1.0,-1.0, 0.0],
[1.0,-1.0, 0.0,-1.0],
[1.0, 0.0,-1.0,-1.0],
#----------------------
[0.0, 1.0, 1.0, 1.0],
[0.0, 1.0,-1.0, 1.0],
[0.0, 1.0, 1.0,-1.0],
[0.0,-1.0, 1.0, 1.0],
[0.0,-1.0,-1.0, 1.0],
[0.0,-1.0, 1.0,-1.0],
[0.0,-1.0,-1.0,-1.0],
#----------------------
[1.0, 1.0, 1.0, 1.0],
[1.0,-1.0, 1.0, 1.0],
[1.0, 1.0,-1.0, 1.0],
[1.0, 1.0, 1.0,-1.0],
[1.0,-1.0,-1.0, 1.0],
[1.0,-1.0, 1.0,-1.0],
[1.0, 1.0,-1.0,-1.0],
[1.0,-1.0,-1.0,-1.0],
])
specials /= np.linalg.norm(specials,axis=1).reshape(-1,1)
specials_scatter = specials + np.broadcast_to((np.random.rand(4)*2.-1.)*scatter,specials.shape)
specials_scatter /= np.linalg.norm(specials_scatter,axis=1).reshape(-1,1)
specials_scatter[specials_scatter[:,0]<0]*=-1
return np.array([s for s in specials] + \
[s for s in specials_scatter] + \
[s for s in random_quaternions(n-2*len(specials))])

View File

@ -3,38 +3,154 @@ import random
import pytest
import numpy as np
from damask import Rotation
from damask import Symmetry
def in_FZ(system,rho):
"""Non-vectorized version of 'in_FZ'."""
rho_abs = abs(rho)
if system == 'cubic':
return np.sqrt(2.0)-1.0 >= rho_abs[0] \
and np.sqrt(2.0)-1.0 >= rho_abs[1] \
and np.sqrt(2.0)-1.0 >= rho_abs[2] \
and 1.0 >= rho_abs[0] + rho_abs[1] + rho_abs[2]
elif system == 'hexagonal':
return 1.0 >= rho_abs[0] and 1.0 >= rho_abs[1] and 1.0 >= rho_abs[2] \
and 2.0 >= np.sqrt(3)*rho_abs[0] + rho_abs[1] \
and 2.0 >= np.sqrt(3)*rho_abs[1] + rho_abs[0] \
and 2.0 >= np.sqrt(3) + rho_abs[2]
elif system == 'tetragonal':
return 1.0 >= rho_abs[0] and 1.0 >= rho_abs[1] \
and np.sqrt(2.0) >= rho_abs[0] + rho_abs[1] \
and np.sqrt(2.0) >= rho_abs[2] + 1.0
elif system == 'orthorhombic':
return 1.0 >= rho_abs[0] and 1.0 >= rho_abs[1] and 1.0 >= rho_abs[2]
else:
return np.all(np.isfinite(rho_abs))
def in_disorientation_SST(system,rho):
"""Non-vectorized version of 'in_Disorientation_SST'."""
epsilon = 0.0
if system == 'cubic':
return rho[0] >= rho[1]+epsilon and rho[1] >= rho[2]+epsilon and rho[2] >= epsilon
elif system == 'hexagonal':
return rho[0] >= np.sqrt(3)*(rho[1]-epsilon) and rho[1] >= epsilon and rho[2] >= epsilon
elif system == 'tetragonal':
return rho[0] >= rho[1]-epsilon and rho[1] >= epsilon and rho[2] >= epsilon
elif system == 'orthorhombic':
return rho[0] >= epsilon and rho[1] >= epsilon and rho[2] >= epsilon
else:
return True
def in_SST(system,vector,proper = False):
"""Non-vectorized version of 'in_SST'."""
if system == 'cubic':
basis = {'improper':np.array([ [-1. , 0. , 1. ],
[ np.sqrt(2.) , -np.sqrt(2.) , 0. ],
[ 0. , np.sqrt(3.) , 0. ] ]),
'proper':np.array([ [ 0. , -1. , 1. ],
[-np.sqrt(2.) , np.sqrt(2.) , 0. ],
[ np.sqrt(3.) , 0. , 0. ] ]),
}
elif system == 'hexagonal':
basis = {'improper':np.array([ [ 0. , 0. , 1. ],
[ 1. , -np.sqrt(3.) , 0. ],
[ 0. , 2. , 0. ] ]),
'proper':np.array([ [ 0. , 0. , 1. ],
[-1. , np.sqrt(3.) , 0. ],
[ np.sqrt(3.) , -1. , 0. ] ]),
}
elif system == 'tetragonal':
basis = {'improper':np.array([ [ 0. , 0. , 1. ],
[ 1. , -1. , 0. ],
[ 0. , np.sqrt(2.) , 0. ] ]),
'proper':np.array([ [ 0. , 0. , 1. ],
[-1. , 1. , 0. ],
[ np.sqrt(2.) , 0. , 0. ] ]),
}
elif system == 'orthorhombic':
basis = {'improper':np.array([ [ 0., 0., 1.],
[ 1., 0., 0.],
[ 0., 1., 0.] ]),
'proper':np.array([ [ 0., 0., 1.],
[-1., 0., 0.],
[ 0., 1., 0.] ]),
}
else:
return True
v = np.array(vector,dtype=float)
if proper:
theComponents = np.around(np.dot(basis['improper'],v),12)
inSST = np.all(theComponents >= 0.0)
if not inSST:
theComponents = np.around(np.dot(basis['proper'],v),12)
inSST = np.all(theComponents >= 0.0)
else:
v[2] = abs(v[2])
theComponents = np.around(np.dot(basis['improper'],v),12)
inSST = np.all(theComponents >= 0.0)
return inSST
@pytest.fixture
def set_of_rodrigues(set_of_quaternions):
return Rotation(set_of_quaternions).as_Rodrigues(vector=True)[:200]
class TestSymmetry:
@pytest.mark.parametrize('system',Symmetry.crystal_systems)
def test_in_FZ_vectorize(self,set_of_rodrigues,system):
result = Symmetry(system).in_FZ(set_of_rodrigues.reshape(50,4,3)).reshape(200)
for i,r in enumerate(result):
assert r == in_FZ(system,set_of_rodrigues[i])
@pytest.mark.parametrize('system',Symmetry.crystal_systems)
def test_in_disorientation_SST_vectorize(self,set_of_rodrigues,system):
result = Symmetry(system).in_disorientation_SST(set_of_rodrigues.reshape(50,4,3)).reshape(200)
for i,r in enumerate(result):
assert r == in_disorientation_SST(system,set_of_rodrigues[i])
@pytest.mark.parametrize('proper',[True,False])
@pytest.mark.parametrize('system',Symmetry.crystal_systems)
def test_in_SST_vectorize(self,system,proper):
vecs = np.random.rand(20,4,3)
result = Symmetry(system).in_SST(vecs,proper).reshape(20*4)
for i,r in enumerate(result):
assert r == in_SST(system,vecs.reshape(20*4,3)[i],proper)
@pytest.mark.parametrize('invalid_symmetry',['fcc','bcc','hello'])
def test_invalid_symmetry(self,invalid_symmetry):
with pytest.raises(KeyError):
s = Symmetry(invalid_symmetry) # noqa
def test_equal(self):
symmetry = random.choice(Symmetry.lattices)
symmetry = random.choice(Symmetry.crystal_systems)
print(symmetry)
assert Symmetry(symmetry) == Symmetry(symmetry)
def test_not_equal(self):
symmetries = random.sample(Symmetry.lattices,k=2)
symmetries = random.sample(Symmetry.crystal_systems,k=2)
assert Symmetry(symmetries[0]) != Symmetry(symmetries[1])
@pytest.mark.parametrize('lattice',Symmetry.lattices)
def test_inFZ(self,lattice):
assert Symmetry(lattice).inFZ(np.zeros(3))
@pytest.mark.parametrize('system',Symmetry.crystal_systems)
def test_in_FZ(self,system):
assert Symmetry(system).in_FZ(np.zeros(3))
@pytest.mark.parametrize('lattice',Symmetry.lattices)
def test_inDisorientationSST(self,lattice):
assert Symmetry(lattice).inDisorientationSST(np.zeros(3))
@pytest.mark.parametrize('system',Symmetry.crystal_systems)
def test_in_disorientation_SST(self,system):
assert Symmetry(system).in_disorientation_SST(np.zeros(3))
@pytest.mark.parametrize('lattice',Symmetry.lattices)
@pytest.mark.parametrize('system',Symmetry.crystal_systems)
@pytest.mark.parametrize('proper',[True,False])
def test_inSST(self,lattice,proper):
assert Symmetry(lattice).inSST(np.zeros(3),proper)
def test_in_SST(self,system,proper):
assert Symmetry(system).in_SST(np.zeros(3),proper)
@pytest.mark.parametrize('function',['inFZ','inDisorientationSST'])
@pytest.mark.parametrize('function',['in_FZ','in_disorientation_SST','in_SST'])
def test_invalid_argument(self,function):
s = Symmetry() # noqa
with pytest.raises(ValueError):

View File

@ -11,6 +11,25 @@ from damask import Lattice
n = 1000
def IPF_color(orientation,direction):
"""TSL color of inverse pole figure for given axis (non-vectorized)."""
for o in orientation.equivalent:
pole = o.rotation@direction
inSST,color = orientation.lattice.in_SST(pole,color=True)
if inSST: break
return color
def inverse_pole(orientation,axis,proper=False,SST=True):
if SST:
for eq in orientation.equivalent:
pole = eq.rotation @ axis/np.linalg.norm(axis)
if orientation.lattice.in_SST(pole,proper=proper):
return pole
else:
return orientation.rotation @ axis/np.linalg.norm(axis)
@pytest.fixture
def reference_dir(reference_dir_base):
"""Directory containing reference results."""
@ -19,6 +38,31 @@ def reference_dir(reference_dir_base):
class TestOrientation:
@pytest.mark.parametrize('model',['Bain','KS','GT','GT_prime','NW','Pitsch'])
@pytest.mark.parametrize('lattice',['fcc','bcc'])
def test_relationship_vectorize(self,set_of_quaternions,lattice,model):
result = Orientation(set_of_quaternions[:200].reshape(50,4,4),lattice).related(model)
ref_qu = result.rotation.quaternion.reshape(-1,200,4)
for i in range(200):
single = Orientation(set_of_quaternions[i],lattice).related(model).rotation.quaternion
assert np.allclose(ref_qu[:,i,:],single)
@pytest.mark.parametrize('lattice',Lattice.lattices)
def test_IPF_vectorize(self,set_of_quaternions,lattice):
direction = np.random.random(3)*2.0-1
oris = Orientation(Rotation(set_of_quaternions),lattice)[:200]
for i,color in enumerate(oris.IPF_color(direction)):
assert np.allclose(color,IPF_color(oris[i],direction))
@pytest.mark.parametrize('SST',[False,True])
@pytest.mark.parametrize('proper',[True,False])
@pytest.mark.parametrize('lattice',Lattice.lattices)
def test_inverse_pole_vectorize(self,set_of_quaternions,lattice,SST,proper):
axis = np.random.random(3)*2.0-1
oris = Orientation(Rotation(set_of_quaternions),lattice)[:200]
for i,pole in enumerate(oris.inverse_pole(axis,SST=SST)):
assert np.allclose(pole,inverse_pole(oris[i],axis,SST=SST))
@pytest.mark.parametrize('color',[{'label':'red', 'RGB':[1,0,0],'direction':[0,0,1]},
{'label':'green','RGB':[0,1,0],'direction':[0,1,1]},
{'label':'blue', 'RGB':[0,0,1],'direction':[1,1,1]}])
@ -26,35 +70,63 @@ class TestOrientation:
def test_IPF_cubic(self,color,lattice):
cube = damask.Orientation(damask.Rotation(),lattice)
for direction in set(permutations(np.array(color['direction']))):
assert np.allclose(cube.IPFcolor(np.array(direction)),np.array(color['RGB']))
assert np.allclose(cube.IPF_color(np.array(direction)),np.array(color['RGB']))
@pytest.mark.parametrize('lattice',Lattice.lattices)
def test_IPF(self,lattice):
def test_IPF_equivalent(self,set_of_quaternions,lattice):
direction = np.random.random(3)*2.0-1
for rot in [Rotation.from_random() for r in range(n//100)]:
R = damask.Orientation(rot,lattice)
color = R.IPFcolor(direction)
for equivalent in R.equivalentOrientations():
assert np.allclose(color,R.IPFcolor(direction))
for ori in Orientation(Rotation(set_of_quaternions),lattice)[:200]:
color = ori.IPF_color(direction)
for equivalent in ori.equivalent:
assert np.allclose(color,equivalent.IPF_color(direction))
@pytest.mark.parametrize('lattice',Lattice.lattices)
def test_reduced(self,set_of_quaternions,lattice):
oris = Orientation(Rotation(set_of_quaternions),lattice)
reduced = oris.reduced
assert np.all(reduced.in_FZ) and oris.rotation.shape == reduced.rotation.shape
@pytest.mark.parametrize('model',['Bain','KS','GT','GT_prime','NW','Pitsch'])
@pytest.mark.parametrize('lattice',['fcc','bcc'])
def test_relationship_forward_backward(self,model,lattice):
ori = Orientation(Rotation.from_random(),lattice)
for i,r in enumerate(ori.relatedOrientations(model)):
ori2 = r.relatedOrientations(model)[i]
for i,r in enumerate(ori.related(model)):
ori2 = r.related(model)[i]
misorientation = ori.rotation.misorientation(ori2.rotation)
assert misorientation.asAxisAngle(degrees=True)[3]<1.0e-5
assert misorientation.as_axis_angle(degrees=True)[3]<1.0e-5
@pytest.mark.parametrize('model',['Bain','KS','GT','GT_prime','NW','Pitsch'])
@pytest.mark.parametrize('lattice',['fcc','bcc'])
def test_relationship_reference(self,update,reference_dir,model,lattice):
reference = os.path.join(reference_dir,f'{lattice}_{model}.txt')
ori = Orientation(Rotation(),lattice)
eu = np.array([o.rotation.as_Eulers(degrees=True) for o in ori.relatedOrientations(model)])
eu = np.array([o.rotation.as_Eulers(degrees=True) for o in ori.related(model)])
if update:
coords = np.array([(1,i+1) for i,x in enumerate(eu)])
table = damask.Table(eu,{'Eulers':(3,)})
table.add('pos',coords)
table.to_ASCII(reference)
assert np.allclose(eu,damask.Table.from_ASCII(reference).get('Eulers'))
@pytest.mark.parametrize('lattice',Lattice.lattices)
def test_disorientation360(self,lattice):
R_1 = Orientation(Rotation(),lattice)
R_2 = Orientation(damask.Rotation.from_Eulers([360,0,0],degrees=True),lattice)
assert np.allclose(R_1.disorientation(R_2).as_matrix(),np.eye(3))
@pytest.mark.parametrize('lattice',Lattice.lattices)
@pytest.mark.parametrize('angle',[10,20,30,40])
def test_average(self,angle,lattice):
R_1 = Orientation(Rotation.from_axis_angle([0,0,1,10],degrees=True),lattice)
R_2 = Orientation(Rotation.from_axis_angle([0,0,1,angle],degrees=True),lattice)
avg_angle = R_1.average(R_2).rotation.as_axis_angle(degrees=True,pair=True)[1]
assert np.isclose(avg_angle,10+(angle-10)/2.)
@pytest.mark.parametrize('lattice',Lattice.lattices)
def test_from_average(self,lattice):
R_1 = Orientation(Rotation.from_random(),lattice)
eqs = [r for r in R_1.equivalent]
R_2 = damask.Orientation.from_average(eqs)
assert np.allclose(R_1.rotation.quaternion,R_2.rotation.quaternion)

View File

@ -153,16 +153,16 @@ class TestResult:
assert np.allclose(in_memory,in_file)
@pytest.mark.parametrize('d',[[1,0,0],[0,1,0],[0,0,1]])
def test_add_IPFcolor(self,default,d):
default.add_IPFcolor('orientation',d)
def test_add_IPF_color(self,default,d):
default.add_IPF_color('orientation',d)
loc = {'orientation': default.get_dataset_location('orientation'),
'color': default.get_dataset_location('IPFcolor_[{} {} {}]'.format(*d))}
qu = default.read_dataset(loc['orientation']).view(np.double).reshape(-1,4)
crystal_structure = default.get_crystal_structure()
in_memory = np.empty((qu.shape[0],3),np.uint8)
for i,q in enumerate(qu):
o = damask.Orientation(q,crystal_structure).reduced()
in_memory[i] = np.uint8(o.IPFcolor(np.array(d))*255)
o = damask.Orientation(q,crystal_structure).reduced
in_memory[i] = np.uint8(o.IPF_color(np.array(d))*255)
in_file = default.read_dataset(loc['color'])
assert np.allclose(in_memory,in_file)
@ -319,4 +319,4 @@ class TestResult:
def test_XDMF(self,tmp_path,single_phase):
os.chdir(tmp_path)
single_phase.write_XDMF
single_phase.write_XDMF()

View File

@ -6,94 +6,21 @@ import numpy as np
from damask import Rotation
from damask import _rotation
n = 1100
atol=1.e-4
scatter=1.e-2
@pytest.fixture
def default():
"""A set of n rotations (corner cases and random)."""
specials = np.array([
[1.0, 0.0, 0.0, 0.0],
#----------------------
[0.0, 1.0, 0.0, 0.0],
[0.0, 0.0, 1.0, 0.0],
[0.0, 0.0, 0.0, 1.0],
[0.0,-1.0, 0.0, 0.0],
[0.0, 0.0,-1.0, 0.0],
[0.0, 0.0, 0.0,-1.0],
#----------------------
[1.0, 1.0, 0.0, 0.0],
[1.0, 0.0, 1.0, 0.0],
[1.0, 0.0, 0.0, 1.0],
[0.0, 1.0, 1.0, 0.0],
[0.0, 1.0, 0.0, 1.0],
[0.0, 0.0, 1.0, 1.0],
#----------------------
[1.0,-1.0, 0.0, 0.0],
[1.0, 0.0,-1.0, 0.0],
[1.0, 0.0, 0.0,-1.0],
[0.0, 1.0,-1.0, 0.0],
[0.0, 1.0, 0.0,-1.0],
[0.0, 0.0, 1.0,-1.0],
#----------------------
[0.0, 1.0,-1.0, 0.0],
[0.0, 1.0, 0.0,-1.0],
[0.0, 0.0, 1.0,-1.0],
#----------------------
[0.0,-1.0,-1.0, 0.0],
[0.0,-1.0, 0.0,-1.0],
[0.0, 0.0,-1.0,-1.0],
#----------------------
[1.0, 1.0, 1.0, 0.0],
[1.0, 1.0, 0.0, 1.0],
[1.0, 0.0, 1.0, 1.0],
[1.0,-1.0, 1.0, 0.0],
[1.0,-1.0, 0.0, 1.0],
[1.0, 0.0,-1.0, 1.0],
[1.0, 1.0,-1.0, 0.0],
[1.0, 1.0, 0.0,-1.0],
[1.0, 0.0, 1.0,-1.0],
[1.0,-1.0,-1.0, 0.0],
[1.0,-1.0, 0.0,-1.0],
[1.0, 0.0,-1.0,-1.0],
#----------------------
[0.0, 1.0, 1.0, 1.0],
[0.0, 1.0,-1.0, 1.0],
[0.0, 1.0, 1.0,-1.0],
[0.0,-1.0, 1.0, 1.0],
[0.0,-1.0,-1.0, 1.0],
[0.0,-1.0, 1.0,-1.0],
[0.0,-1.0,-1.0,-1.0],
#----------------------
[1.0, 1.0, 1.0, 1.0],
[1.0,-1.0, 1.0, 1.0],
[1.0, 1.0,-1.0, 1.0],
[1.0, 1.0, 1.0,-1.0],
[1.0,-1.0,-1.0, 1.0],
[1.0,-1.0, 1.0,-1.0],
[1.0, 1.0,-1.0,-1.0],
[1.0,-1.0,-1.0,-1.0],
])
specials /= np.linalg.norm(specials,axis=1).reshape(-1,1)
specials_scatter = specials + np.broadcast_to(np.random.rand(4)*scatter,specials.shape)
specials_scatter /= np.linalg.norm(specials_scatter,axis=1).reshape(-1,1)
specials_scatter[specials_scatter[:,0]<0]*=-1
return [Rotation.from_quaternion(s) for s in specials] + \
[Rotation.from_quaternion(s) for s in specials_scatter] + \
[Rotation.from_random() for _ in range(n-len(specials)-len(specials_scatter))]
@pytest.fixture
def reference_dir(reference_dir_base):
"""Directory containing reference results."""
return os.path.join(reference_dir_base,'Rotation')
@pytest.fixture
def set_of_rotations(set_of_quaternions):
return [Rotation.from_quaternion(s) for s in set_of_quaternions]
####################################################################################################
# Code below available according to the following conditions on https://github.com/MarDiehl/3Drotations
# Code below available according to the following conditions
####################################################################################################
# Copyright (c) 2017-2019, Martin Diehl/Max-Planck-Institut für Eisenforschung GmbH
# Copyright (c) 2013-2014, Marc De Graef/Carnegie Mellon University
@ -203,27 +130,27 @@ def qu2ho(qu):
#---------- Rotation matrix ----------
def om2qu(a):
trace = a[0,0] + a[1,1] + a[2,2]
def om2qu(om):
trace = om.trace()
if trace > 0:
s = 0.5 / np.sqrt(trace+ 1.0)
qu = np.array([0.25 / s,( a[2,1] - a[1,2] ) * s,( a[0,2] - a[2,0] ) * s,( a[1,0] - a[0,1] ) * s])
qu = np.array([0.25 / s,( om[2,1] - om[1,2] ) * s,( om[0,2] - om[2,0] ) * s,( om[1,0] - om[0,1] ) * s])
else:
if ( a[0,0] > a[1,1] and a[0,0] > a[2,2] ):
s = 2.0 * np.sqrt( 1.0 + a[0,0] - a[1,1] - a[2,2])
qu = np.array([ (a[2,1] - a[1,2]) / s,0.25 * s,(a[0,1] + a[1,0]) / s,(a[0,2] + a[2,0]) / s])
elif (a[1,1] > a[2,2]):
s = 2.0 * np.sqrt( 1.0 + a[1,1] - a[0,0] - a[2,2])
qu = np.array([ (a[0,2] - a[2,0]) / s,(a[0,1] + a[1,0]) / s,0.25 * s,(a[1,2] + a[2,1]) / s])
if ( om[0,0] > om[1,1] and om[0,0] > om[2,2] ):
s = 2.0 * np.sqrt( 1.0 + om[0,0] - om[1,1] - om[2,2])
qu = np.array([ (om[2,1] - om[1,2]) / s,0.25 * s,(om[0,1] + om[1,0]) / s,(om[0,2] + om[2,0]) / s])
elif (om[1,1] > om[2,2]):
s = 2.0 * np.sqrt( 1.0 + om[1,1] - om[0,0] - om[2,2])
qu = np.array([ (om[0,2] - om[2,0]) / s,(om[0,1] + om[1,0]) / s,0.25 * s,(om[1,2] + om[2,1]) / s])
else:
s = 2.0 * np.sqrt( 1.0 + a[2,2] - a[0,0] - a[1,1] )
qu = np.array([ (a[1,0] - a[0,1]) / s,(a[0,2] + a[2,0]) / s,(a[1,2] + a[2,1]) / s,0.25 * s])
s = 2.0 * np.sqrt( 1.0 + om[2,2] - om[0,0] - om[1,1] )
qu = np.array([ (om[1,0] - om[0,1]) / s,(om[0,2] + om[2,0]) / s,(om[1,2] + om[2,1]) / s,0.25 * s])
if qu[0]<0: qu*=-1
return qu*np.array([1.,_P,_P,_P])
def om2eu(om):
"""Rotation matrix to Bunge-Euler angles."""
if not np.isclose(np.abs(om[2,2]),1.0,1.e-9):
if not np.isclose(np.abs(om[2,2]),1.0,0.0):
zeta = 1.0/np.sqrt(1.0-om[2,2]**2)
eu = np.array([np.arctan2(om[2,0]*zeta,-om[2,1]*zeta),
np.arccos(om[2,2]),
@ -236,7 +163,6 @@ def om2eu(om):
def om2ax(om):
"""Rotation matrix to axis angle pair."""
#return qu2ax(om2qu(om)) # HOTFIX
ax=np.empty(4)
# first get the rotation angle
@ -519,11 +445,6 @@ def mul(me, other):
other : numpy.ndarray or Rotation
Vector, second or fourth order tensor, or rotation object that is rotated.
Todo
----
Document details active/passive)
consider rotation of (3,3,3,3)-matrix
"""
if me.quaternion.shape != (4,):
raise NotImplementedError('Support for multiple rotations missing')
@ -567,9 +488,9 @@ class TestRotation:
(Rotation._qu2ro,Rotation._ro2qu),
(Rotation._qu2ho,Rotation._ho2qu),
(Rotation._qu2cu,Rotation._cu2qu)])
def test_quaternion_internal(self,default,forward,backward):
def test_quaternion_internal(self,set_of_rotations,forward,backward):
"""Ensure invariance of conversion from quaternion and back."""
for rot in default:
for rot in set_of_rotations:
m = rot.as_quaternion()
o = backward(forward(m))
ok = np.allclose(m,o,atol=atol)
@ -584,9 +505,9 @@ class TestRotation:
(Rotation._om2ro,Rotation._ro2om),
(Rotation._om2ho,Rotation._ho2om),
(Rotation._om2cu,Rotation._cu2om)])
def test_matrix_internal(self,default,forward,backward):
def test_matrix_internal(self,set_of_rotations,forward,backward):
"""Ensure invariance of conversion from rotation matrix and back."""
for rot in default:
for rot in set_of_rotations:
m = rot.as_matrix()
o = backward(forward(m))
ok = np.allclose(m,o,atol=atol)
@ -599,9 +520,9 @@ class TestRotation:
(Rotation._eu2ro,Rotation._ro2eu),
(Rotation._eu2ho,Rotation._ho2eu),
(Rotation._eu2cu,Rotation._cu2eu)])
def test_Eulers_internal(self,default,forward,backward):
def test_Eulers_internal(self,set_of_rotations,forward,backward):
"""Ensure invariance of conversion from Euler angles and back."""
for rot in default:
for rot in set_of_rotations:
m = rot.as_Eulers()
o = backward(forward(m))
u = np.array([np.pi*2,np.pi,np.pi*2])
@ -619,9 +540,9 @@ class TestRotation:
(Rotation._ax2ro,Rotation._ro2ax),
(Rotation._ax2ho,Rotation._ho2ax),
(Rotation._ax2cu,Rotation._cu2ax)])
def test_axis_angle_internal(self,default,forward,backward):
def test_axis_angle_internal(self,set_of_rotations,forward,backward):
"""Ensure invariance of conversion from axis angle angles pair and back."""
for rot in default:
for rot in set_of_rotations:
m = rot.as_axis_angle()
o = backward(forward(m))
ok = np.allclose(m,o,atol=atol)
@ -636,10 +557,10 @@ class TestRotation:
(Rotation._ro2ax,Rotation._ax2ro),
(Rotation._ro2ho,Rotation._ho2ro),
(Rotation._ro2cu,Rotation._cu2ro)])
def test_Rodrigues_internal(self,default,forward,backward):
def test_Rodrigues_internal(self,set_of_rotations,forward,backward):
"""Ensure invariance of conversion from Rodrigues-Frank vector and back."""
cutoff = np.tan(np.pi*.5*(1.-1e-4))
for rot in default:
for rot in set_of_rotations:
m = rot.as_Rodrigues()
o = backward(forward(m))
ok = np.allclose(np.clip(m,None,cutoff),np.clip(o,None,cutoff),atol=atol)
@ -653,9 +574,9 @@ class TestRotation:
(Rotation._ho2ax,Rotation._ax2ho),
(Rotation._ho2ro,Rotation._ro2ho),
(Rotation._ho2cu,Rotation._cu2ho)])
def test_homochoric_internal(self,default,forward,backward):
def test_homochoric_internal(self,set_of_rotations,forward,backward):
"""Ensure invariance of conversion from homochoric vector and back."""
for rot in default:
for rot in set_of_rotations:
m = rot.as_homochoric()
o = backward(forward(m))
ok = np.allclose(m,o,atol=atol)
@ -668,9 +589,9 @@ class TestRotation:
(Rotation._cu2ax,Rotation._ax2cu),
(Rotation._cu2ro,Rotation._ro2cu),
(Rotation._cu2ho,Rotation._ho2cu)])
def test_cubochoric_internal(self,default,forward,backward):
def test_cubochoric_internal(self,set_of_rotations,forward,backward):
"""Ensure invariance of conversion from cubochoric vector and back."""
for rot in default:
for rot in set_of_rotations:
m = rot.as_cubochoric()
o = backward(forward(m))
ok = np.allclose(m,o,atol=atol)
@ -684,9 +605,9 @@ class TestRotation:
(Rotation._qu2ax,qu2ax),
(Rotation._qu2ro,qu2ro),
(Rotation._qu2ho,qu2ho)])
def test_quaternion_vectorization(self,default,vectorized,single):
def test_quaternion_vectorization(self,set_of_quaternions,vectorized,single):
"""Check vectorized implementation for quaternion against single point calculation."""
qu = np.array([rot.as_quaternion() for rot in default])
qu = np.array(set_of_quaternions)
vectorized(qu.reshape(qu.shape[0]//2,-1,4))
co = vectorized(qu)
for q,c in zip(qu,co):
@ -697,9 +618,9 @@ class TestRotation:
@pytest.mark.parametrize('vectorized, single',[(Rotation._om2qu,om2qu),
(Rotation._om2eu,om2eu),
(Rotation._om2ax,om2ax)])
def test_matrix_vectorization(self,default,vectorized,single):
def test_matrix_vectorization(self,set_of_rotations,vectorized,single):
"""Check vectorized implementation for rotation matrix against single point calculation."""
om = np.array([rot.as_matrix() for rot in default])
om = np.array([rot.as_matrix() for rot in set_of_rotations])
vectorized(om.reshape(om.shape[0]//2,-1,3,3))
co = vectorized(om)
for o,c in zip(om,co):
@ -710,9 +631,9 @@ class TestRotation:
(Rotation._eu2om,eu2om),
(Rotation._eu2ax,eu2ax),
(Rotation._eu2ro,eu2ro)])
def test_Eulers_vectorization(self,default,vectorized,single):
def test_Eulers_vectorization(self,set_of_rotations,vectorized,single):
"""Check vectorized implementation for Euler angles against single point calculation."""
eu = np.array([rot.as_Eulers() for rot in default])
eu = np.array([rot.as_Eulers() for rot in set_of_rotations])
vectorized(eu.reshape(eu.shape[0]//2,-1,3))
co = vectorized(eu)
for e,c in zip(eu,co):
@ -723,9 +644,9 @@ class TestRotation:
(Rotation._ax2om,ax2om),
(Rotation._ax2ro,ax2ro),
(Rotation._ax2ho,ax2ho)])
def test_axis_angle_vectorization(self,default,vectorized,single):
def test_axis_angle_vectorization(self,set_of_rotations,vectorized,single):
"""Check vectorized implementation for axis angle pair against single point calculation."""
ax = np.array([rot.as_axis_angle() for rot in default])
ax = np.array([rot.as_axis_angle() for rot in set_of_rotations])
vectorized(ax.reshape(ax.shape[0]//2,-1,4))
co = vectorized(ax)
for a,c in zip(ax,co):
@ -735,9 +656,9 @@ class TestRotation:
@pytest.mark.parametrize('vectorized, single',[(Rotation._ro2ax,ro2ax),
(Rotation._ro2ho,ro2ho)])
def test_Rodrigues_vectorization(self,default,vectorized,single):
def test_Rodrigues_vectorization(self,set_of_rotations,vectorized,single):
"""Check vectorized implementation for Rodrigues-Frank vector against single point calculation."""
ro = np.array([rot.as_Rodrigues() for rot in default])
ro = np.array([rot.as_Rodrigues() for rot in set_of_rotations])
vectorized(ro.reshape(ro.shape[0]//2,-1,4))
co = vectorized(ro)
for r,c in zip(ro,co):
@ -746,9 +667,9 @@ class TestRotation:
@pytest.mark.parametrize('vectorized, single',[(Rotation._ho2ax,ho2ax),
(Rotation._ho2cu,ho2cu)])
def test_homochoric_vectorization(self,default,vectorized,single):
def test_homochoric_vectorization(self,set_of_rotations,vectorized,single):
"""Check vectorized implementation for homochoric vector against single point calculation."""
ho = np.array([rot.as_homochoric() for rot in default])
ho = np.array([rot.as_homochoric() for rot in set_of_rotations])
vectorized(ho.reshape(ho.shape[0]//2,-1,3))
co = vectorized(ho)
for h,c in zip(ho,co):
@ -756,9 +677,9 @@ class TestRotation:
assert np.allclose(single(h),c) and np.allclose(single(h),vectorized(h))
@pytest.mark.parametrize('vectorized, single',[(Rotation._cu2ho,cu2ho)])
def test_cubochoric_vectorization(self,default,vectorized,single):
def test_cubochoric_vectorization(self,set_of_rotations,vectorized,single):
"""Check vectorized implementation for cubochoric vector against single point calculation."""
cu = np.array([rot.as_cubochoric() for rot in default])
cu = np.array([rot.as_cubochoric() for rot in set_of_rotations])
vectorized(cu.reshape(cu.shape[0]//2,-1,3))
co = vectorized(cu)
for u,c in zip(cu,co):
@ -766,8 +687,8 @@ class TestRotation:
assert np.allclose(single(u),c) and np.allclose(single(u),vectorized(u))
@pytest.mark.parametrize('degrees',[True,False])
def test_Eulers(self,default,degrees):
for rot in default:
def test_Eulers(self,set_of_rotations,degrees):
for rot in set_of_rotations:
m = rot.as_quaternion()
o = Rotation.from_Eulers(rot.as_Eulers(degrees),degrees).as_quaternion()
ok = np.allclose(m,o,atol=atol)
@ -779,9 +700,9 @@ class TestRotation:
@pytest.mark.parametrize('P',[1,-1])
@pytest.mark.parametrize('normalise',[True,False])
@pytest.mark.parametrize('degrees',[True,False])
def test_axis_angle(self,default,degrees,normalise,P):
def test_axis_angle(self,set_of_rotations,degrees,normalise,P):
c = np.array([P*-1,P*-1,P*-1,1.])
for rot in default:
for rot in set_of_rotations:
m = rot.as_Eulers()
o = Rotation.from_axis_angle(rot.as_axis_angle(degrees)*c,degrees,normalise,P).as_Eulers()
u = np.array([np.pi*2,np.pi,np.pi*2])
@ -793,8 +714,8 @@ class TestRotation:
print(m,o,rot.as_quaternion())
assert ok and (np.zeros(3)-1.e-9 <= o).all() and (o <= np.array([np.pi*2.,np.pi,np.pi*2.])+1.e-9).all()
def test_matrix(self,default):
for rot in default:
def test_matrix(self,set_of_rotations):
for rot in set_of_rotations:
m = rot.as_axis_angle()
o = Rotation.from_axis_angle(rot.as_axis_angle()).as_axis_angle()
ok = np.allclose(m,o,atol=atol)
@ -805,9 +726,9 @@ class TestRotation:
@pytest.mark.parametrize('P',[1,-1])
@pytest.mark.parametrize('normalise',[True,False])
def test_Rodrigues(self,default,normalise,P):
def test_Rodrigues(self,set_of_rotations,normalise,P):
c = np.array([P*-1,P*-1,P*-1,1.])
for rot in default:
for rot in set_of_rotations:
m = rot.as_matrix()
o = Rotation.from_Rodrigues(rot.as_Rodrigues()*c,normalise,P).as_matrix()
ok = np.allclose(m,o,atol=atol)
@ -815,9 +736,9 @@ class TestRotation:
assert ok and np.isclose(np.linalg.det(o),1.0)
@pytest.mark.parametrize('P',[1,-1])
def test_homochoric(self,default,P):
def test_homochoric(self,set_of_rotations,P):
cutoff = np.tan(np.pi*.5*(1.-1e-4))
for rot in default:
for rot in set_of_rotations:
m = rot.as_Rodrigues()
o = Rotation.from_homochoric(rot.as_homochoric()*P*-1,P).as_Rodrigues()
ok = np.allclose(np.clip(m,None,cutoff),np.clip(o,None,cutoff),atol=atol)
@ -826,8 +747,8 @@ class TestRotation:
assert ok and np.isclose(np.linalg.norm(o[:3]),1.0)
@pytest.mark.parametrize('P',[1,-1])
def test_cubochoric(self,default,P):
for rot in default:
def test_cubochoric(self,set_of_rotations,P):
for rot in set_of_rotations:
m = rot.as_homochoric()
o = Rotation.from_cubochoric(rot.as_cubochoric()*P*-1,P).as_homochoric()
ok = np.allclose(m,o,atol=atol)
@ -836,9 +757,9 @@ class TestRotation:
@pytest.mark.parametrize('P',[1,-1])
@pytest.mark.parametrize('accept_homomorph',[True,False])
def test_quaternion(self,default,P,accept_homomorph):
def test_quaternion(self,set_of_rotations,P,accept_homomorph):
c = np.array([1,P*-1,P*-1,P*-1]) * (-1 if accept_homomorph else 1)
for rot in default:
for rot in set_of_rotations:
m = rot.as_cubochoric()
o = Rotation.from_quaternion(rot.as_quaternion()*c,accept_homomorph,P).as_cubochoric()
ok = np.allclose(m,o,atol=atol)
@ -848,8 +769,8 @@ class TestRotation:
assert ok and o.max() < np.pi**(2./3.)*0.5+1.e-9
@pytest.mark.parametrize('reciprocal',[True,False])
def test_basis(self,default,reciprocal):
for rot in default:
def test_basis(self,set_of_rotations,reciprocal):
for rot in set_of_rotations:
om = rot.as_matrix() + 0.1*np.eye(3)
rot = Rotation.from_basis(om,False,reciprocal=reciprocal)
assert np.isclose(np.linalg.det(rot.as_matrix()),1.0)
@ -923,8 +844,8 @@ class TestRotation:
@pytest.mark.parametrize('data',[np.random.rand(5,3),
np.random.rand(5,3,3),
np.random.rand(5,3,3,3,3)])
def test_rotate_vectorization(self,default,data):
for rot in default:
def test_rotate_vectorization(self,set_of_rotations,data):
for rot in set_of_rotations:
v = rot.broadcast_to((5,)) @ data
for i in range(data.shape[0]):
print(i-data[i])
@ -978,3 +899,15 @@ class TestRotation:
def test_misorientation(self):
R = Rotation.from_random()
assert np.allclose(R.misorientation(R).as_matrix(),np.eye(3))
def test_misorientation360(self):
R_1 = Rotation()
R_2 = Rotation.from_Eulers([360,0,0],degrees=True)
assert np.allclose(R_1.misorientation(R_2).as_matrix(),np.eye(3))
@pytest.mark.parametrize('angle',[10,20,30,40,50,60,70,80,90,100,120])
def test_average(self,angle):
R_1 = Rotation.from_axis_angle([0,0,1,10],degrees=True)
R_2 = Rotation.from_axis_angle([0,0,1,angle],degrees=True)
avg_angle = R_1.average(R_2).as_axis_angle(degrees=True,pair=True)[1]
assert np.isclose(avg_angle,10+(angle-10)/2.)

View File

@ -50,7 +50,19 @@ module CPFEM
end type tNumerics
type(tNumerics), private :: num
type, private :: tDebugOptions
logical :: &
basic, &
extensive, &
selective
integer:: &
element, &
ip
end type tDebugOptions
type(tDebugOptions), private :: debugCPFEM
public :: &
CPFEM_general, &
CPFEM_initAll, &
@ -93,7 +105,8 @@ end subroutine CPFEM_initAll
subroutine CPFEM_init
class(tNode), pointer :: &
num_commercialFEM
num_commercialFEM, &
debug_CPFEM
write(6,'(/,a)') ' <<<+- CPFEM init -+>>>'
flush(6)
@ -107,9 +120,18 @@ subroutine CPFEM_init
num_commercialFEM => numerics_root%get('commercialFEM',defaultVal=emptyDict)
num%iJacoStiffness = num_commercialFEM%get_asInt('ijacostiffness',defaultVal=1)
if (num%iJacoStiffness < 1) call IO_error(301,ext_msg='iJacoStiffness')
!------------------------------------------------------------------------------
if (iand(debug_level(debug_CPFEM), debug_levelBasic) /= 0) then
!------------------------------------------------------------------------------
! read debug options
debug_CPFEM => debug_root%get('cpfem',defaultVal=emptyList)
debugCPFEM%basic = debug_CPFEM%contains('basic')
debugCPFEM%extensive = debug_CPFEM%contains('extensive')
debugCPFEM%selective = debug_CPFEM%contains('selective')
debugCPFEM%element = debug_root%get_asInt('element',defaultVal = 1)
debugCPFEM%ip = debug_root%get_asInt('integrationpoint',defaultVal = 1)
if(debugCPFEM%basic) then
write(6,'(a32,1x,6(i8,1x))') 'CPFEM_cs: ', shape(CPFEM_cs)
write(6,'(a32,1x,6(i8,1x))') 'CPFEM_dcsdE: ', shape(CPFEM_dcsdE)
write(6,'(a32,1x,6(i8,1x),/)') 'CPFEM_dcsdE_knownGood: ', shape(CPFEM_dcsdE_knownGood)
@ -150,8 +172,7 @@ subroutine CPFEM_general(mode, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyS
elCP = mesh_FEM2DAMASK_elem(elFE)
if (iand(debug_level(debug_CPFEM), debug_levelBasic) /= 0_pInt &
.and. elCP == debug_e .and. ip == debug_i) then
if (debugCPFEM%basic .and. elCP == debugCPFEM%element .and. ip == debugCPFEM%ip) then
write(6,'(/,a)') '#############################################'
write(6,'(a1,a22,1x,i8,a13)') '#','element', elCP, '#'
write(6,'(a1,a22,1x,i8,a13)') '#','ip', ip, '#'
@ -189,7 +210,7 @@ subroutine CPFEM_general(mode, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyS
updateJaco = mod(cycleCounter,num%iJacoStiffness) == 0
FEsolving_execElem = elCP
FEsolving_execIP = ip
if (iand(debug_level(debug_CPFEM), debug_levelExtensive) /= 0_pInt) &
if (debugCPFEM%extensive) &
write(6,'(a,i8,1x,i2)') '<< CPFEM >> calculation for elFE ip ',elFE,ip
call materialpoint_stressAndItsTangent(updateJaco, dt)
@ -226,9 +247,8 @@ subroutine CPFEM_general(mode, ffn, ffn1, temperature_inp, dt, elFE, ip, cauchyS
endif terminalIllness
endif validCalculation
if ((iand(debug_level(debug_CPFEM), debug_levelExtensive) /= 0_pInt) &
.and. ((debug_e == elCP .and. debug_i == ip) &
.or. .not. iand(debug_level(debug_CPFEM), debug_levelSelective) /= 0_pInt)) then
if (debugCPFEM%extensive &
.and. ((debugCPFEM%element == elCP .and. debugCPFEM%ip == ip) .or. .not. debugCPFEM%selective)) then
write(6,'(a,i8,1x,i2,/,12x,6(f10.3,1x)/)') &
'<< CPFEM >> stress/MPa at elFE ip ', elFE, ip, CPFEM_cs(1:6,ip,elCP)*1.0e-6_pReal
write(6,'(a,i8,1x,i2,/,6(12x,6(f10.3,1x)/))') &

View File

@ -2,11 +2,10 @@
#include <stdio.h>
#include <unistd.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
/* http://stackoverflow.com/questions/30279228/is-there-an-alternative-to-getcwd-in-fortran-2003-2008 */

View File

@ -176,6 +176,7 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, &
use prec
use DAMASK_interface
use numerics
use YAML_types
use FEsolving
use debug
use discretization_marc
@ -252,9 +253,12 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, &
logical, save :: &
lastIncConverged = .false., & !< needs description
outdatedByNewInc = .false., & !< needs description
CPFEM_init_done = .false. !< remember whether init has been done already
if (iand(debug_level(debug_MARC),debug_LEVELBASIC) /= 0) then
CPFEM_init_done = .false., & !< remember whether init has been done already
debug_basic = .true.
class(tNode), pointer :: &
debug_Marc ! pointer to Marc debug options
if(debug_basic) then
write(6,'(a,/,i8,i8,i2)') ' MSC.MARC information on shape of element(2), IP:', m, nn
write(6,'(a,2(i1))') ' Jacobian: ', ngens,ngens
write(6,'(a,i1)') ' Direct stress: ', ndi
@ -275,6 +279,8 @@ subroutine hypela2(d,g,e,de,s,t,dt,ngens,m,nn,kcus,matus,ndi,nshear,disp, &
if (.not. CPFEM_init_done) then
CPFEM_init_done = .true.
call CPFEM_initAll
debug_Marc => debug_root%get('marc',defaultVal=emptyList)
debug_basic = debug_Marc%contains('basic')
endif
computationMode = 0 ! save initialization value, since it does not result in any calculation

View File

@ -1 +0,0 @@
DAMASK_marc.f90

View File

@ -1 +0,0 @@
DAMASK_marc.f90

View File

@ -1 +0,0 @@
DAMASK_marc.f90

View File

@ -529,6 +529,8 @@ subroutine IO_error(error_ID,el,ip,g,instance,ext_msg)
msg = 'unknown material parameter:'
case (211)
msg = 'material parameter out of bounds:'
case (212)
msg = 'nonlocal model not supported'
!--------------------------------------------------------------------------------------------------
! numerics error messages

View File

@ -26,16 +26,8 @@
#endif
#include "material.f90"
#include "lattice.f90"
#include "source_thermal_dissipation.f90"
#include "source_thermal_externalheat.f90"
#include "source_damage_isoBrittle.f90"
#include "source_damage_isoDuctile.f90"
#include "source_damage_anisoBrittle.f90"
#include "source_damage_anisoDuctile.f90"
#include "kinematics_cleavage_opening.f90"
#include "kinematics_slipplane_opening.f90"
#include "kinematics_thermal_expansion.f90"
#include "constitutive.f90"
#include "constitutive_plastic.f90"
#include "constitutive_plastic_none.f90"
#include "constitutive_plastic_isotropic.f90"
#include "constitutive_plastic_phenopowerlaw.f90"
@ -43,6 +35,17 @@
#include "constitutive_plastic_dislotwin.f90"
#include "constitutive_plastic_disloUCLA.f90"
#include "constitutive_plastic_nonlocal.f90"
#include "constitutive_thermal.f90"
#include "source_thermal_dissipation.f90"
#include "source_thermal_externalheat.f90"
#include "kinematics_thermal_expansion.f90"
#include "constitutive_damage.f90"
#include "source_damage_isoBrittle.f90"
#include "source_damage_isoDuctile.f90"
#include "source_damage_anisoBrittle.f90"
#include "source_damage_anisoDuctile.f90"
#include "kinematics_cleavage_opening.f90"
#include "kinematics_slipplane_opening.f90"
#include "crystallite.f90"
#include "thermal_isothermal.f90"
#include "thermal_adiabatic.f90"

View File

@ -4,7 +4,6 @@
!> @details Reads the material configuration file, where solverJobName.materialConfig takes
!! precedence over material.config. Stores the raw strings and the positions of delimiters for the
!! parts 'homogenization', 'crystallite', 'phase', 'texture', and 'microstucture'
!! Reads numerics.config and debug.config
!--------------------------------------------------------------------------------------------------
module config
use prec
@ -24,10 +23,7 @@ module config
config_homogenization, &
config_texture, &
config_crystallite
type(tPartitionedStringList), public, protected :: &
config_debug
character(len=pStringLen), public, protected, allocatable, dimension(:) :: &
config_name_phase, & !< name of each phase
config_name_homogenization, & !< name of each homogenization
@ -53,11 +49,14 @@ subroutine config_init
line, &
part
character(len=pStringLen), dimension(:), allocatable :: fileContent
logical :: fileExists
class(tNode), pointer :: &
debug_material
logical :: fileExists
write(6,'(/,a)') ' <<<+- config init -+>>>'; flush(6)
verbose = iand(debug_level(debug_material),debug_levelBasic) /= 0
debug_material => debug_root%get('material',defaultVal=emptyList)
verbose = debug_material%contains('basic')
inquire(file=trim(getSolverJobName())//'.materialConfig',exist=fileExists)
if(fileExists) then
@ -109,13 +108,6 @@ subroutine config_init
if (.not. allocated(config_texture) .or. size(config_texture) < 1) &
call IO_error(160,ext_msg='<texture>')
inquire(file='debug.config', exist=fileExists)
if (fileExists) then
write(6,'(/,a)') ' reading debug.config'; flush(6)
fileContent = IO_read_ASCII('debug.config')
call parse_debugAndNumericsConfig(config_debug,fileContent)
endif
contains
@ -238,23 +230,6 @@ subroutine parse_materialConfig(sectionNames,part,line, &
end subroutine parse_materialConfig
!--------------------------------------------------------------------------------------------------
!> @brief parses the material.config file
!--------------------------------------------------------------------------------------------------
subroutine parse_debugAndNumericsConfig(config_list, &
fileContent)
type(tPartitionedStringList), intent(out) :: config_list
character(len=pStringLen), dimension(:), intent(in) :: fileContent
integer :: i
do i = 1, size(fileContent)
call config_list%add(trim(adjustl(fileContent(i))))
enddo
end subroutine parse_debugAndNumericsConfig
end subroutine config_init
@ -279,9 +254,6 @@ subroutine config_deallocate(what)
case('material.config/texture')
deallocate(config_texture)
case('debug.config')
call config_debug%free
case default
call IO_error(0,ext_msg='config_deallocate')

View File

@ -1,7 +1,7 @@
!--------------------------------------------------------------------------------------------------
!> @author Franz Roters, Max-Planck-Institut für Eisenforschung GmbH
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
!> @brief elasticity, plasticity, internal microstructure state
!> @brief elasticity, plasticity, damage & thermal internal microstructure state
!--------------------------------------------------------------------------------------------------
module constitutive
use prec
@ -15,16 +15,8 @@ module constitutive
use results
use lattice
use discretization
use geometry_plastic_nonlocal
use source_thermal_dissipation
use source_thermal_externalheat
use source_damage_isoBrittle
use source_damage_isoDuctile
use source_damage_anisoBrittle
use source_damage_anisoDuctile
use kinematics_cleavage_opening
use kinematics_slipplane_opening
use kinematics_thermal_expansion
use geometry_plastic_nonlocal, only: &
geometry_plastic_nonlocal_disable
implicit none
private
@ -35,128 +27,14 @@ module constitutive
interface
module subroutine plastic_none_init
end subroutine plastic_none_init
module subroutine plastic_init
end subroutine plastic_init
module subroutine plastic_isotropic_init
end subroutine plastic_isotropic_init
module subroutine damage_init
end subroutine damage_init
module subroutine plastic_phenopowerlaw_init
end subroutine plastic_phenopowerlaw_init
module subroutine plastic_kinehardening_init
end subroutine plastic_kinehardening_init
module subroutine plastic_dislotwin_init
end subroutine plastic_dislotwin_init
module subroutine plastic_disloUCLA_init
end subroutine plastic_disloUCLA_init
module subroutine plastic_nonlocal_init
end subroutine plastic_nonlocal_init
module subroutine plastic_isotropic_LpAndItsTangent(Lp,dLp_dMp,Mp,instance,of)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLp_dMp !< derivative of Lp with respect to the Mandel stress
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
integer, intent(in) :: &
instance, &
of
end subroutine plastic_isotropic_LpAndItsTangent
pure module subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dMp,Mp,instance,of)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLp_dMp !< derivative of Lp with respect to the Mandel stress
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
integer, intent(in) :: &
instance, &
of
end subroutine plastic_phenopowerlaw_LpAndItsTangent
pure module subroutine plastic_kinehardening_LpAndItsTangent(Lp,dLp_dMp,Mp,instance,of)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLp_dMp !< derivative of Lp with respect to the Mandel stress
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
integer, intent(in) :: &
instance, &
of
end subroutine plastic_kinehardening_LpAndItsTangent
module subroutine plastic_dislotwin_LpAndItsTangent(Lp,dLp_dMp,Mp,T,instance,of)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLp_dMp !< derivative of Lp with respect to the Mandel stress
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T
integer, intent(in) :: &
instance, &
of
end subroutine plastic_dislotwin_LpAndItsTangent
pure module subroutine plastic_disloUCLA_LpAndItsTangent(Lp,dLp_dMp,Mp,T,instance,of)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLp_dMp !< derivative of Lp with respect to the Mandel stress
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T
integer, intent(in) :: &
instance, &
of
end subroutine plastic_disloUCLA_LpAndItsTangent
module subroutine plastic_nonlocal_LpAndItsTangent(Lp,dLp_dMp, &
Mp,Temperature,instance,of,ip,el)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLp_dMp !< derivative of Lp with respect to the Mandel stress
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
Temperature
integer, intent(in) :: &
instance, &
of, &
ip, & !< current integration point
el !< current element number
end subroutine plastic_nonlocal_LpAndItsTangent
module subroutine plastic_isotropic_LiAndItsTangent(Li,dLi_dMi,Mi,instance,of)
real(pReal), dimension(3,3), intent(out) :: &
Li !< inleastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLi_dMi !< derivative of Li with respect to Mandel stress
real(pReal), dimension(3,3), intent(in) :: &
Mi !< Mandel stress
integer, intent(in) :: &
instance, &
of
end subroutine plastic_isotropic_LiAndItsTangent
module subroutine thermal_init
end subroutine thermal_init
module subroutine plastic_isotropic_dotState(Mp,instance,of)
@ -204,8 +82,8 @@ module constitutive
end subroutine plastic_disloUCLA_dotState
module subroutine plastic_nonlocal_dotState(Mp, F, Fp, Temperature,timestep, &
instance,of,ip,el)
real(pReal), dimension(3,3), intent(in) ::&
instance,of,ip,el)
real(pReal), dimension(3,3), intent(in) :: &
Mp !< MandelStress
real(pReal), dimension(3,3,homogenization_maxNgrains,discretization_nIP,discretization_nElem), intent(in) :: &
F, & !< deformation gradient
@ -220,31 +98,136 @@ module constitutive
el !< current element number
end subroutine plastic_nonlocal_dotState
module subroutine source_damage_anisoBrittle_dotState(S, ipc, ip, el)
integer, intent(in) :: &
ipc, & !< component-ID of integration point
ip, & !< integration point
el !< element
real(pReal), intent(in), dimension(3,3) :: &
S
end subroutine source_damage_anisoBrittle_dotState
module subroutine plastic_dislotwin_dependentState(T,instance,of)
integer, intent(in) :: &
instance, &
module subroutine source_damage_anisoDuctile_dotState(ipc, ip, el)
integer, intent(in) :: &
ipc, & !< component-ID of integration point
ip, & !< integration point
el !< element
end subroutine source_damage_anisoDuctile_dotState
module subroutine source_damage_isoDuctile_dotState(ipc, ip, el)
integer, intent(in) :: &
ipc, & !< component-ID of integration point
ip, & !< integration point
el !< element
end subroutine source_damage_isoDuctile_dotState
module subroutine source_thermal_externalheat_dotState(phase, of)
integer, intent(in) :: &
phase, &
of
real(pReal), intent(in) :: &
end subroutine source_thermal_externalheat_dotState
module subroutine constitutive_damage_getRateAndItsTangents(phiDot, dPhiDot_dPhi, phi, ip, el)
integer, intent(in) :: &
ip, & !< integration point number
el !< element number
real(pReal), intent(in) :: &
phi !< damage parameter
real(pReal), intent(inout) :: &
phiDot, &
dPhiDot_dPhi
end subroutine constitutive_damage_getRateAndItsTangents
module subroutine constitutive_thermal_getRateAndItsTangents(TDot, dTDot_dT, T, S, Lp, ip, el)
integer, intent(in) :: &
ip, & !< integration point number
el !< element number
real(pReal), intent(in) :: &
T
end subroutine plastic_dislotwin_dependentState
real(pReal), intent(in), dimension(:,:,:,:,:) :: &
S, & !< current 2nd Piola Kitchoff stress vector
Lp !< plastic velocity gradient
real(pReal), intent(inout) :: &
TDot, &
dTDot_dT
end subroutine constitutive_thermal_getRateAndItsTangents
module subroutine plastic_disloUCLA_dependentState(instance,of)
integer, intent(in) :: &
instance, &
of
end subroutine plastic_disloUCLA_dependentState
module function plastic_dislotwin_homogenizedC(ipc,ip,el) result(homogenizedC)
real(pReal), dimension(6,6) :: &
homogenizedC
integer, intent(in) :: &
ipc, & !< component-ID of integration point
ip, & !< integration point
el !< element
end function plastic_dislotwin_homogenizedC
module subroutine plastic_nonlocal_dependentState(F, Fp, instance, of, ip, el)
real(pReal), dimension(3,3), intent(in) :: &
F, &
Fp
pure module function kinematics_thermal_expansion_initialStrain(homog,phase,offset) result(initialStrain)
integer, intent(in) :: &
phase, &
homog, &
offset
real(pReal), dimension(3,3) :: &
initialStrain
end function kinematics_thermal_expansion_initialStrain
module subroutine plastic_nonlocal_updateCompatibility(orientation,instance,i,e)
integer, intent(in) :: &
instance, &
of, &
ip, &
el
end subroutine plastic_nonlocal_dependentState
i, &
e
type(rotation), dimension(1,discretization_nIP,discretization_nElem), intent(in) :: &
orientation !< crystal orientation
end subroutine plastic_nonlocal_updateCompatibility
module subroutine plastic_isotropic_LiAndItsTangent(Li,dLi_dMi,Mi,instance,of)
real(pReal), dimension(3,3), intent(out) :: &
Li !< inleastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLi_dMi !< derivative of Li with respect to Mandel stress
real(pReal), dimension(3,3), intent(in) :: &
Mi !< Mandel stress
integer, intent(in) :: &
instance, &
of
end subroutine plastic_isotropic_LiAndItsTangent
module subroutine kinematics_cleavage_opening_LiAndItsTangent(Ld, dLd_dTstar, S, ipc, ip, el)
integer, intent(in) :: &
ipc, & !< grain number
ip, & !< integration point number
el !< element number
real(pReal), intent(in), dimension(3,3) :: &
S
real(pReal), intent(out), dimension(3,3) :: &
Ld !< damage velocity gradient
real(pReal), intent(out), dimension(3,3,3,3) :: &
dLd_dTstar !< derivative of Ld with respect to Tstar (4th-order tensor)
end subroutine kinematics_cleavage_opening_LiAndItsTangent
module subroutine kinematics_slipplane_opening_LiAndItsTangent(Ld, dLd_dTstar, S, ipc, ip, el)
integer, intent(in) :: &
ipc, & !< grain number
ip, & !< integration point number
el !< element number
real(pReal), intent(in), dimension(3,3) :: &
S
real(pReal), intent(out), dimension(3,3) :: &
Ld !< damage velocity gradient
real(pReal), intent(out), dimension(3,3,3,3) :: &
dLd_dTstar !< derivative of Ld with respect to Tstar (4th-order tensor)
end subroutine kinematics_slipplane_opening_LiAndItsTangent
module subroutine kinematics_thermal_expansion_LiAndItsTangent(Li, dLi_dTstar, ipc, ip, el)
integer, intent(in) :: &
ipc, & !< grain number
ip, & !< integration point number
el !< element number
real(pReal), intent(out), dimension(3,3) :: &
Li !< thermal velocity gradient
real(pReal), intent(out), dimension(3,3,3,3) :: &
dLi_dTstar !< derivative of Li with respect to Tstar (4th-order tensor defined to be zero)
end subroutine kinematics_thermal_expansion_LiAndItsTangent
module subroutine plastic_kinehardening_deltaState(Mp,instance,of)
@ -265,110 +248,115 @@ module constitutive
el
end subroutine plastic_nonlocal_deltaState
module function plastic_dislotwin_homogenizedC(ipc,ip,el) result(homogenizedC)
real(pReal), dimension(6,6) :: &
homogenizedC
integer, intent(in) :: &
module subroutine source_damage_isoBrittle_deltaState(C, Fe, ipc, ip, el)
integer, intent(in) :: &
ipc, & !< component-ID of integration point
ip, & !< integration point
el !< element
end function plastic_dislotwin_homogenizedC
real(pReal), intent(in), dimension(3,3) :: &
Fe
real(pReal), intent(in), dimension(6,6) :: &
C
end subroutine source_damage_isoBrittle_deltaState
module subroutine plastic_nonlocal_updateCompatibility(orientation,instance,i,e)
integer, intent(in) :: &
instance, &
i, &
e
type(rotation), dimension(1,discretization_nIP,discretization_nElem), intent(in) :: &
orientation !< crystal orientation
end subroutine plastic_nonlocal_updateCompatibility
module subroutine plastic_isotropic_results(instance,group)
integer, intent(in) :: instance
character(len=*), intent(in) :: group
end subroutine plastic_isotropic_results
module subroutine plastic_phenopowerlaw_results(instance,group)
integer, intent(in) :: instance
character(len=*), intent(in) :: group
end subroutine plastic_phenopowerlaw_results
module subroutine plastic_kinehardening_results(instance,group)
integer, intent(in) :: instance
character(len=*), intent(in) :: group
end subroutine plastic_kinehardening_results
module subroutine plastic_dislotwin_results(instance,group)
integer, intent(in) :: instance
character(len=*), intent(in) :: group
end subroutine plastic_dislotwin_results
module subroutine plastic_disloUCLA_results(instance,group)
integer, intent(in) :: instance
character(len=*), intent(in) :: group
end subroutine plastic_disloUCLA_results
module subroutine plastic_nonlocal_results(instance,group)
integer, intent(in) :: instance
character(len=*), intent(in) :: group
end subroutine plastic_nonlocal_results
module subroutine plastic_results
end subroutine plastic_results
module subroutine damage_results
end subroutine damage_results
end interface
interface constitutive_LpAndItsTangents
module subroutine constitutive_plastic_LpAndItsTangents(Lp, dLp_dS, dLp_dFi, &
S, Fi, ipc, ip, el)
integer, intent(in) :: &
ipc, & !< component-ID of integration point
ip, & !< integration point
el !< element
real(pReal), intent(in), dimension(3,3) :: &
S, & !< 2nd Piola-Kirchhoff stress
Fi !< intermediate deformation gradient
real(pReal), intent(out), dimension(3,3) :: &
Lp !< plastic velocity gradient
real(pReal), intent(out), dimension(3,3,3,3) :: &
dLp_dS, &
dLp_dFi !< derivative of Lp with respect to Fi
end subroutine constitutive_plastic_LpAndItsTangents
end interface constitutive_LpAndItsTangents
interface constitutive_dependentState
module subroutine constitutive_plastic_dependentState(F, Fp, ipc, ip, el)
integer, intent(in) :: &
ipc, & !< component-ID of integration point
ip, & !< integration point
el !< element
real(pReal), intent(in), dimension(3,3) :: &
F, & !< elastic deformation gradient
Fp !< plastic deformation gradient
end subroutine constitutive_plastic_dependentState
end interface constitutive_dependentState
type :: tDebugOptions
logical :: &
basic, &
extensive, &
selective
integer :: &
element, &
ip, &
grain
end type tDebugOptions
type(tDebugOptions) :: debugConstitutive
public :: &
plastic_nonlocal_updateCompatibility, &
constitutive_init, &
constitutive_homogenizedC, &
constitutive_dependentState, &
constitutive_LpAndItsTangents, &
constitutive_dependentState, &
constitutive_LiAndItsTangents, &
constitutive_initialFi, &
constitutive_SandItsTangents, &
constitutive_collectDotState, &
constitutive_deltaState, &
plastic_nonlocal_updateCompatibility, &
constitutive_damage_getRateAndItsTangents, &
constitutive_thermal_getRateAndItsTangents, &
constitutive_results
contains
!--------------------------------------------------------------------------------------------------
!> @brief allocates arrays pointing to array of the various constitutive modules
!> @brief Initialze constitutive models for individual physics
!--------------------------------------------------------------------------------------------------
subroutine constitutive_init
integer :: &
ph, & !< counter in phase loop
s !< counter in source loop
class (tNode), pointer :: &
debug_constitutive
!--------------------------------------------------------------------------------------------------
! initialized plasticity
if (any(phase_plasticity == PLASTICITY_NONE_ID)) call plastic_none_init
if (any(phase_plasticity == PLASTICITY_ISOTROPIC_ID)) call plastic_isotropic_init
if (any(phase_plasticity == PLASTICITY_PHENOPOWERLAW_ID)) call plastic_phenopowerlaw_init
if (any(phase_plasticity == PLASTICITY_KINEHARDENING_ID)) call plastic_kinehardening_init
if (any(phase_plasticity == PLASTICITY_DISLOTWIN_ID)) call plastic_dislotwin_init
if (any(phase_plasticity == PLASTICITY_DISLOUCLA_ID)) call plastic_disloucla_init
if (any(phase_plasticity == PLASTICITY_NONLOCAL_ID)) then
call plastic_nonlocal_init
else
call geometry_plastic_nonlocal_disable
endif
!--------------------------------------------------------------------------------------------------
! initialize source mechanisms
if (any(phase_source == SOURCE_thermal_dissipation_ID)) call source_thermal_dissipation_init
if (any(phase_source == SOURCE_thermal_externalheat_ID)) call source_thermal_externalheat_init
if (any(phase_source == SOURCE_damage_isoBrittle_ID)) call source_damage_isoBrittle_init
if (any(phase_source == SOURCE_damage_isoDuctile_ID)) call source_damage_isoDuctile_init
if (any(phase_source == SOURCE_damage_anisoBrittle_ID)) call source_damage_anisoBrittle_init
if (any(phase_source == SOURCE_damage_anisoDuctile_ID)) call source_damage_anisoDuctile_init
debug_constitutive => debug_root%get('constitutive', defaultVal=emptyList)
debugConstitutive%basic = debug_constitutive%contains('basic')
debugConstitutive%extensive = debug_constitutive%contains('extensive')
debugConstitutive%selective = debug_constitutive%contains('selective')
debugConstitutive%element = debug_root%get_asInt('element',defaultVal = 1)
debugConstitutive%ip = debug_root%get_asInt('integrationpoint',defaultVal = 1)
debugConstitutive%grain = debug_root%get_asInt('grain',defaultVal = 1)
!--------------------------------------------------------------------------------------------------
! initialize kinematic mechanisms
if (any(phase_kinematics == KINEMATICS_cleavage_opening_ID)) call kinematics_cleavage_opening_init
if (any(phase_kinematics == KINEMATICS_slipplane_opening_ID)) call kinematics_slipplane_opening_init
if (any(phase_kinematics == KINEMATICS_thermal_expansion_ID)) call kinematics_thermal_expansion_init
call plastic_init
call damage_init
call thermal_init
write(6,'(/,a)') ' <<<+- constitutive init -+>>>'; flush(6)
@ -382,8 +370,7 @@ subroutine constitutive_init
sourceState(ph)%p(s)%partionedState0 = sourceState(ph)%p(s)%state0
sourceState(ph)%p(s)%state = sourceState(ph)%p(s)%partionedState0
end forall
!--------------------------------------------------------------------------------------------------
! determine max size of source state
constitutive_source_maxSizeDotState = max(constitutive_source_maxSizeDotState, &
maxval(sourceState(ph)%p%sizeDotState))
enddo PhaseLoop2
@ -391,134 +378,29 @@ subroutine constitutive_init
end subroutine constitutive_init
!--------------------------------------------------------------------------------------------------
!> @brief returns the homogenize elasticity matrix
!> ToDo: homogenizedC66 would be more consistent
!--------------------------------------------------------------------------------------------------
function constitutive_homogenizedC(ipc,ip,el)
real(pReal), dimension(6,6) :: constitutive_homogenizedC
integer, intent(in) :: &
real(pReal), dimension(6,6) :: &
constitutive_homogenizedC
integer, intent(in) :: &
ipc, & !< component-ID of integration point
ip, & !< integration point
el !< element
plasticityType: select case (phase_plasticity(material_phaseAt(ipc,el)))
case (PLASTICITY_DISLOTWIN_ID) plasticityType
constitutive_homogenizedC = plastic_dislotwin_homogenizedC(ipc,ip,el)
constitutive_homogenizedC = plastic_dislotwin_homogenizedC(ipc,ip,el)
case default plasticityType
constitutive_homogenizedC = lattice_C66(1:6,1:6,material_phaseAt(ipc,el))
constitutive_homogenizedC = lattice_C66(1:6,1:6,material_phaseAt(ipc,el))
end select plasticityType
end function constitutive_homogenizedC
!--------------------------------------------------------------------------------------------------
!> @brief calls microstructure function of the different constitutive models
!--------------------------------------------------------------------------------------------------
subroutine constitutive_dependentState(F, Fp, ipc, ip, el)
integer, intent(in) :: &
ipc, & !< component-ID of integration point
ip, & !< integration point
el !< element
real(pReal), intent(in), dimension(3,3) :: &
F, & !< elastic deformation gradient
Fp !< plastic deformation gradient
integer :: &
ho, & !< homogenization
tme, & !< thermal member position
instance, of
ho = material_homogenizationAt(el)
tme = thermalMapping(ho)%p(ip,el)
of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phaseAt(ipc,el))
plasticityType: select case (phase_plasticity(material_phaseAt(ipc,el)))
case (PLASTICITY_DISLOTWIN_ID) plasticityType
call plastic_dislotwin_dependentState(temperature(ho)%p(tme),instance,of)
case (PLASTICITY_DISLOUCLA_ID) plasticityType
call plastic_disloUCLA_dependentState(instance,of)
case (PLASTICITY_NONLOCAL_ID) plasticityType
call plastic_nonlocal_dependentState (F,Fp,instance,of,ip,el)
end select plasticityType
end subroutine constitutive_dependentState
!--------------------------------------------------------------------------------------------------
!> @brief contains the constitutive equation for calculating the velocity gradient
! ToDo: Discuss whether it makes sense if crystallite handles the configuration conversion, i.e.
! Mp in, dLp_dMp out
!--------------------------------------------------------------------------------------------------
subroutine constitutive_LpAndItsTangents(Lp, dLp_dS, dLp_dFi, &
S, Fi, ipc, ip, el)
integer, intent(in) :: &
ipc, & !< component-ID of integration point
ip, & !< integration point
el !< element
real(pReal), intent(in), dimension(3,3) :: &
S, & !< 2nd Piola-Kirchhoff stress
Fi !< intermediate deformation gradient
real(pReal), intent(out), dimension(3,3) :: &
Lp !< plastic velocity gradient
real(pReal), intent(out), dimension(3,3,3,3) :: &
dLp_dS, &
dLp_dFi !< derivative of Lp with respect to Fi
real(pReal), dimension(3,3,3,3) :: &
dLp_dMp !< derivative of Lp with respect to Mandel stress
real(pReal), dimension(3,3) :: &
Mp !< Mandel stress work conjugate with Lp
integer :: &
ho, & !< homogenization
tme !< thermal member position
integer :: &
i, j, instance, of
ho = material_homogenizationAt(el)
tme = thermalMapping(ho)%p(ip,el)
Mp = matmul(matmul(transpose(Fi),Fi),S)
of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phaseAt(ipc,el))
plasticityType: select case (phase_plasticity(material_phaseAt(ipc,el)))
case (PLASTICITY_NONE_ID) plasticityType
Lp = 0.0_pReal
dLp_dMp = 0.0_pReal
case (PLASTICITY_ISOTROPIC_ID) plasticityType
call plastic_isotropic_LpAndItsTangent (Lp,dLp_dMp,Mp,instance,of)
case (PLASTICITY_PHENOPOWERLAW_ID) plasticityType
call plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dMp,Mp,instance,of)
case (PLASTICITY_KINEHARDENING_ID) plasticityType
call plastic_kinehardening_LpAndItsTangent(Lp,dLp_dMp,Mp,instance,of)
case (PLASTICITY_NONLOCAL_ID) plasticityType
call plastic_nonlocal_LpAndItsTangent (Lp,dLp_dMp,Mp, temperature(ho)%p(tme),instance,of,ip,el)
case (PLASTICITY_DISLOTWIN_ID) plasticityType
call plastic_dislotwin_LpAndItsTangent (Lp,dLp_dMp,Mp,temperature(ho)%p(tme),instance,of)
case (PLASTICITY_DISLOUCLA_ID) plasticityType
call plastic_disloucla_LpAndItsTangent (Lp,dLp_dMp,Mp,temperature(ho)%p(tme),instance,of)
end select plasticityType
do i=1,3; do j=1,3
dLp_dFi(i,j,1:3,1:3) = matmul(matmul(Fi,S),transpose(dLp_dMp(i,j,1:3,1:3))) + &
matmul(matmul(Fi,dLp_dMp(i,j,1:3,1:3)),S)
dLp_dS(i,j,1:3,1:3) = matmul(matmul(transpose(Fi),Fi),dLp_dMp(i,j,1:3,1:3)) ! ToDo: @PS: why not: dLp_dMp:(FiT Fi)
enddo; enddo
end subroutine constitutive_LpAndItsTangents
!--------------------------------------------------------------------------------------------------
!> @brief contains the constitutive equation for calculating the velocity gradient
! ToDo: MD: S is Mi?
@ -714,7 +596,7 @@ function constitutive_collectDotState(S, FArray, Fi, FpArray, subdt, ipc, ip, el
integer, intent(in) :: &
ipc, & !< component-ID of integration point
ip, & !< integration point
el, & !< element
el, & !< element
phase, &
of
real(pReal), intent(in) :: &
@ -769,7 +651,7 @@ function constitutive_collectDotState(S, FArray, Fi, FpArray, subdt, ipc, ip, el
sourceType: select case (phase_source(i,phase))
case (SOURCE_damage_anisoBrittle_ID) sourceType
call source_damage_anisoBrittle_dotState (S, ipc, ip, el) !< correct stress?
call source_damage_anisoBrittle_dotState (S, ipc, ip, el) ! correct stress?
case (SOURCE_damage_isoDuctile_ID) sourceType
call source_damage_isoDuctile_dotState ( ipc, ip, el)
@ -872,37 +754,8 @@ end function constitutive_deltaState
!--------------------------------------------------------------------------------------------------
subroutine constitutive_results
integer :: p
character(len=pStringLen) :: group
do p=1,size(config_name_phase)
group = trim('current/constituent')//'/'//trim(config_name_phase(p))
call results_closeGroup(results_addGroup(group))
group = trim(group)//'/plastic'
call results_closeGroup(results_addGroup(group))
select case(phase_plasticity(p))
case(PLASTICITY_ISOTROPIC_ID)
call plastic_isotropic_results(phase_plasticityInstance(p),group)
case(PLASTICITY_PHENOPOWERLAW_ID)
call plastic_phenopowerlaw_results(phase_plasticityInstance(p),group)
case(PLASTICITY_KINEHARDENING_ID)
call plastic_kinehardening_results(phase_plasticityInstance(p),group)
case(PLASTICITY_DISLOTWIN_ID)
call plastic_dislotwin_results(phase_plasticityInstance(p),group)
case(PLASTICITY_DISLOUCLA_ID)
call plastic_disloUCLA_results(phase_plasticityInstance(p),group)
case(PLASTICITY_NONLOCAL_ID)
call plastic_nonlocal_results(phase_plasticityInstance(p),group)
end select
enddo
call plastic_results
call damage_results
end subroutine constitutive_results

202
src/constitutive_damage.f90 Normal file
View File

@ -0,0 +1,202 @@
!----------------------------------------------------------------------------------------------------
!> @brief internal microstructure state for all damage sources and kinematics constitutive models
!----------------------------------------------------------------------------------------------------
submodule(constitutive) constitutive_damage
interface
module subroutine source_damage_anisoBrittle_init
end subroutine source_damage_anisoBrittle_init
module subroutine source_damage_anisoDuctile_init
end subroutine source_damage_anisoDuctile_init
module subroutine source_damage_isoBrittle_init
end subroutine source_damage_isoBrittle_init
module subroutine source_damage_isoDuctile_init
end subroutine source_damage_isoDuctile_init
module subroutine kinematics_cleavage_opening_init
end subroutine kinematics_cleavage_opening_init
module subroutine kinematics_slipplane_opening_init
end subroutine kinematics_slipplane_opening_init
module subroutine source_damage_anisobrittle_getRateAndItsTangent(localphiDot, dLocalphiDot_dPhi, phi, phase, constituent)
integer, intent(in) :: &
phase, & !< phase ID of element
constituent !< position of element within its phase instance
real(pReal), intent(in) :: &
phi !< damage parameter
real(pReal), intent(out) :: &
localphiDot, &
dLocalphiDot_dPhi
end subroutine source_damage_anisoBrittle_getRateAndItsTangent
module subroutine source_damage_anisoDuctile_getRateAndItsTangent(localphiDot, dLocalphiDot_dPhi, phi, phase, constituent)
integer, intent(in) :: &
phase, & !< phase ID of element
constituent !< position of element within its phase instance
real(pReal), intent(in) :: &
phi !< damage parameter
real(pReal), intent(out) :: &
localphiDot, &
dLocalphiDot_dPhi
end subroutine source_damage_anisoDuctile_getRateAndItsTangent
module subroutine source_damage_isoBrittle_getRateAndItsTangent(localphiDot, dLocalphiDot_dPhi, phi, phase, constituent)
integer, intent(in) :: &
phase, & !< phase ID of element
constituent !< position of element within its phase instance
real(pReal), intent(in) :: &
phi !< damage parameter
real(pReal), intent(out) :: &
localphiDot, &
dLocalphiDot_dPhi
end subroutine source_damage_isoBrittle_getRateAndItsTangent
module subroutine source_damage_isoDuctile_getRateAndItsTangent(localphiDot, dLocalphiDot_dPhi, phi, phase, constituent)
integer, intent(in) :: &
phase, & !< phase ID of element
constituent !< position of element within its phase instance
real(pReal), intent(in) :: &
phi !< damage parameter
real(pReal), intent(out) :: &
localphiDot, &
dLocalphiDot_dPhi
end subroutine source_damage_isoDuctile_getRateAndItsTangent
module subroutine source_damage_anisoBrittle_results(phase,group)
integer, intent(in) :: phase
character(len=*), intent(in) :: group
end subroutine source_damage_anisoBrittle_results
module subroutine source_damage_anisoDuctile_results(phase,group)
integer, intent(in) :: phase
character(len=*), intent(in) :: group
end subroutine source_damage_anisoDuctile_results
module subroutine source_damage_isoBrittle_results(phase,group)
integer, intent(in) :: phase
character(len=*), intent(in) :: group
end subroutine source_damage_isoBrittle_results
module subroutine source_damage_isoDuctile_results(phase,group)
integer, intent(in) :: phase
character(len=*), intent(in) :: group
end subroutine source_damage_isoDuctile_results
end interface
contains
!----------------------------------------------------------------------------------------------
!< @brief initialize damage sources and kinematics mechanism
!----------------------------------------------------------------------------------------------
module subroutine damage_init
! initialize source mechanisms
if (any(phase_source == SOURCE_damage_isoBrittle_ID)) call source_damage_isoBrittle_init
if (any(phase_source == SOURCE_damage_isoDuctile_ID)) call source_damage_isoDuctile_init
if (any(phase_source == SOURCE_damage_anisoBrittle_ID)) call source_damage_anisoBrittle_init
if (any(phase_source == SOURCE_damage_anisoDuctile_ID)) call source_damage_anisoDuctile_init
!--------------------------------------------------------------------------------------------------
! initialize kinematic mechanisms
if (any(phase_kinematics == KINEMATICS_cleavage_opening_ID)) call kinematics_cleavage_opening_init
if (any(phase_kinematics == KINEMATICS_slipplane_opening_ID)) call kinematics_slipplane_opening_init
end subroutine damage_init
!----------------------------------------------------------------------------------------------
!< @brief returns local part of nonlocal damage driving force
!----------------------------------------------------------------------------------------------
module subroutine constitutive_damage_getRateAndItsTangents(phiDot, dPhiDot_dPhi, phi, ip, el)
integer, intent(in) :: &
ip, & !< integration point number
el !< element number
real(pReal), intent(in) :: &
phi !< damage parameter
real(pReal), intent(inout) :: &
phiDot, &
dPhiDot_dPhi
real(pReal) :: &
localphiDot, &
dLocalphiDot_dPhi
integer :: &
phase, &
grain, &
source, &
constituent
phiDot = 0.0_pReal
dPhiDot_dPhi = 0.0_pReal
do grain = 1, homogenization_Ngrains(material_homogenizationAt(el))
phase = material_phaseAt(grain,el)
constituent = material_phasememberAt(grain,ip,el)
do source = 1, phase_Nsources(phase)
select case(phase_source(source,phase))
case (SOURCE_damage_isoBrittle_ID)
call source_damage_isobrittle_getRateAndItsTangent (localphiDot, dLocalphiDot_dPhi, phi, phase, constituent)
case (SOURCE_damage_isoDuctile_ID)
call source_damage_isoductile_getRateAndItsTangent (localphiDot, dLocalphiDot_dPhi, phi, phase, constituent)
case (SOURCE_damage_anisoBrittle_ID)
call source_damage_anisobrittle_getRateAndItsTangent(localphiDot, dLocalphiDot_dPhi, phi, phase, constituent)
case (SOURCE_damage_anisoDuctile_ID)
call source_damage_anisoductile_getRateAndItsTangent(localphiDot, dLocalphiDot_dPhi, phi, phase, constituent)
case default
localphiDot = 0.0_pReal
dLocalphiDot_dPhi = 0.0_pReal
end select
phiDot = phiDot + localphiDot
dPhiDot_dPhi = dPhiDot_dPhi + dLocalphiDot_dPhi
enddo
enddo
end subroutine constitutive_damage_getRateAndItsTangents
!----------------------------------------------------------------------------------------------
!< @brief writes damage sources resultsvto HDF5 output file
!----------------------------------------------------------------------------------------------
module subroutine damage_results
integer :: p,i
character(len=pStringLen) :: group
do p = 1, size(config_name_phase)
sourceLoop: do i = 1, phase_Nsources(p)
group = trim('current/constituent')//'/'//trim(config_name_phase(p))
group = trim(group)//'/sources'
call results_closeGroup(results_addGroup(group))
sourceType: select case (phase_source(i,p))
case (SOURCE_damage_anisoBrittle_ID) sourceType
call source_damage_anisoBrittle_results(p,group)
case (SOURCE_damage_anisoDuctile_ID) sourceType
call source_damage_anisoDuctile_results(p,group)
case (SOURCE_damage_isoBrittle_ID) sourceType
call source_damage_isoBrittle_results(p,group)
case (SOURCE_damage_isoDuctile_ID) sourceType
call source_damage_isoDuctile_results(p,group)
end select sourceType
enddo SourceLoop
enddo
end subroutine damage_results
end submodule constitutive_damage

View File

@ -0,0 +1,348 @@
!----------------------------------------------------------------------------------------------------
!> @brief internal microstructure state for all plasticity constitutive models
!----------------------------------------------------------------------------------------------------
submodule(constitutive) constitutive_plastic
interface
module subroutine plastic_none_init
end subroutine plastic_none_init
module subroutine plastic_isotropic_init
end subroutine plastic_isotropic_init
module subroutine plastic_phenopowerlaw_init
end subroutine plastic_phenopowerlaw_init
module subroutine plastic_kinehardening_init
end subroutine plastic_kinehardening_init
module subroutine plastic_dislotwin_init
end subroutine plastic_dislotwin_init
module subroutine plastic_disloUCLA_init
end subroutine plastic_disloUCLA_init
module subroutine plastic_nonlocal_init
end subroutine plastic_nonlocal_init
module subroutine plastic_isotropic_LpAndItsTangent(Lp,dLp_dMp,Mp,instance,of)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLp_dMp !< derivative of Lp with respect to the Mandel stress
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
integer, intent(in) :: &
instance, &
of
end subroutine plastic_isotropic_LpAndItsTangent
pure module subroutine plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dMp,Mp,instance,of)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLp_dMp !< derivative of Lp with respect to the Mandel stress
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
integer, intent(in) :: &
instance, &
of
end subroutine plastic_phenopowerlaw_LpAndItsTangent
pure module subroutine plastic_kinehardening_LpAndItsTangent(Lp,dLp_dMp,Mp,instance,of)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLp_dMp !< derivative of Lp with respect to the Mandel stress
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
integer, intent(in) :: &
instance, &
of
end subroutine plastic_kinehardening_LpAndItsTangent
module subroutine plastic_dislotwin_LpAndItsTangent(Lp,dLp_dMp,Mp,T,instance,of)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLp_dMp !< derivative of Lp with respect to the Mandel stress
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T
integer, intent(in) :: &
instance, &
of
end subroutine plastic_dislotwin_LpAndItsTangent
pure module subroutine plastic_disloUCLA_LpAndItsTangent(Lp,dLp_dMp,Mp,T,instance,of)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLp_dMp !< derivative of Lp with respect to the Mandel stress
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
T
integer, intent(in) :: &
instance, &
of
end subroutine plastic_disloUCLA_LpAndItsTangent
module subroutine plastic_nonlocal_LpAndItsTangent(Lp,dLp_dMp, &
Mp,Temperature,instance,of,ip,el)
real(pReal), dimension(3,3), intent(out) :: &
Lp !< plastic velocity gradient
real(pReal), dimension(3,3,3,3), intent(out) :: &
dLp_dMp !< derivative of Lp with respect to the Mandel stress
real(pReal), dimension(3,3), intent(in) :: &
Mp !< Mandel stress
real(pReal), intent(in) :: &
Temperature
integer, intent(in) :: &
instance, &
of, &
ip, & !< current integration point
el !< current element number
end subroutine plastic_nonlocal_LpAndItsTangent
module subroutine plastic_dislotwin_dependentState(T,instance,of)
integer, intent(in) :: &
instance, &
of
real(pReal), intent(in) :: &
T
end subroutine plastic_dislotwin_dependentState
module subroutine plastic_disloUCLA_dependentState(instance,of)
integer, intent(in) :: &
instance, &
of
end subroutine plastic_disloUCLA_dependentState
module subroutine plastic_nonlocal_dependentState(F, Fp, instance, of, ip, el)
real(pReal), dimension(3,3), intent(in) :: &
F, & !< deformation gradient
Fp !< plastic deformation gradient
integer, intent(in) :: &
instance, &
of, &
ip, & !< current integration point
el !< current element number
end subroutine plastic_nonlocal_dependentState
module subroutine plastic_isotropic_results(instance,group)
integer, intent(in) :: instance
character(len=*), intent(in) :: group
end subroutine plastic_isotropic_results
module subroutine plastic_phenopowerlaw_results(instance,group)
integer, intent(in) :: instance
character(len=*), intent(in) :: group
end subroutine plastic_phenopowerlaw_results
module subroutine plastic_kinehardening_results(instance,group)
integer, intent(in) :: instance
character(len=*), intent(in) :: group
end subroutine plastic_kinehardening_results
module subroutine plastic_dislotwin_results(instance,group)
integer, intent(in) :: instance
character(len=*), intent(in) :: group
end subroutine plastic_dislotwin_results
module subroutine plastic_disloUCLA_results(instance,group)
integer, intent(in) :: instance
character(len=*), intent(in) :: group
end subroutine plastic_disloUCLA_results
module subroutine plastic_nonlocal_results(instance,group)
integer, intent(in) :: instance
character(len=*), intent(in) :: group
end subroutine plastic_nonlocal_results
end interface
contains
!--------------------------------------------------------------------------------------------------
!> @brief Initialize constitutive models for plasticity
!--------------------------------------------------------------------------------------------------
module subroutine plastic_init
if (any(phase_plasticity == PLASTICITY_NONE_ID)) call plastic_none_init
if (any(phase_plasticity == PLASTICITY_ISOTROPIC_ID)) call plastic_isotropic_init
if (any(phase_plasticity == PLASTICITY_PHENOPOWERLAW_ID)) call plastic_phenopowerlaw_init
if (any(phase_plasticity == PLASTICITY_KINEHARDENING_ID)) call plastic_kinehardening_init
if (any(phase_plasticity == PLASTICITY_DISLOTWIN_ID)) call plastic_dislotwin_init
if (any(phase_plasticity == PLASTICITY_DISLOUCLA_ID)) call plastic_disloucla_init
if (any(phase_plasticity == PLASTICITY_NONLOCAL_ID)) then
call plastic_nonlocal_init
else
call geometry_plastic_nonlocal_disable
endif
end subroutine plastic_init
!--------------------------------------------------------------------------------------------------
!> @brief calls microstructure function of the different plasticity constitutive models
!--------------------------------------------------------------------------------------------------
module subroutine constitutive_plastic_dependentState(F, Fp, ipc, ip, el)
integer, intent(in) :: &
ipc, & !< component-ID of integration point
ip, & !< integration point
el !< element
real(pReal), intent(in), dimension(3,3) :: &
F, & !< elastic deformation gradient
Fp !< plastic deformation gradient
integer :: &
ho, & !< homogenization
tme, & !< thermal member position
instance, of
ho = material_homogenizationAt(el)
tme = thermalMapping(ho)%p(ip,el)
of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phaseAt(ipc,el))
plasticityType: select case (phase_plasticity(material_phaseAt(ipc,el)))
case (PLASTICITY_DISLOTWIN_ID) plasticityType
call plastic_dislotwin_dependentState(temperature(ho)%p(tme),instance,of)
case (PLASTICITY_DISLOUCLA_ID) plasticityType
call plastic_disloUCLA_dependentState(instance,of)
case (PLASTICITY_NONLOCAL_ID) plasticityType
call plastic_nonlocal_dependentState (F,Fp,instance,of,ip,el)
end select plasticityType
end subroutine constitutive_plastic_dependentState
!--------------------------------------------------------------------------------------------------
!> @brief contains the constitutive equation for calculating the velocity gradient
! ToDo: Discuss whether it makes sense if crystallite handles the configuration conversion, i.e.
! Mp in, dLp_dMp out
!--------------------------------------------------------------------------------------------------
module subroutine constitutive_plastic_LpAndItsTangents(Lp, dLp_dS, dLp_dFi, &
S, Fi, ipc, ip, el)
integer, intent(in) :: &
ipc, & !< component-ID of integration point
ip, & !< integration point
el !< element
real(pReal), intent(in), dimension(3,3) :: &
S, & !< 2nd Piola-Kirchhoff stress
Fi !< intermediate deformation gradient
real(pReal), intent(out), dimension(3,3) :: &
Lp !< plastic velocity gradient
real(pReal), intent(out), dimension(3,3,3,3) :: &
dLp_dS, &
dLp_dFi !< derivative of Lp with respect to Fi
real(pReal), dimension(3,3,3,3) :: &
dLp_dMp !< derivative of Lp with respect to Mandel stress
real(pReal), dimension(3,3) :: &
Mp !< Mandel stress work conjugate with Lp
integer :: &
ho, & !< homogenization
tme !< thermal member position
integer :: &
i, j, instance, of
ho = material_homogenizationAt(el)
tme = thermalMapping(ho)%p(ip,el)
Mp = matmul(matmul(transpose(Fi),Fi),S)
of = material_phasememberAt(ipc,ip,el)
instance = phase_plasticityInstance(material_phaseAt(ipc,el))
plasticityType: select case (phase_plasticity(material_phaseAt(ipc,el)))
case (PLASTICITY_NONE_ID) plasticityType
Lp = 0.0_pReal
dLp_dMp = 0.0_pReal
case (PLASTICITY_ISOTROPIC_ID) plasticityType
call plastic_isotropic_LpAndItsTangent (Lp,dLp_dMp,Mp,instance,of)
case (PLASTICITY_PHENOPOWERLAW_ID) plasticityType
call plastic_phenopowerlaw_LpAndItsTangent(Lp,dLp_dMp,Mp,instance,of)
case (PLASTICITY_KINEHARDENING_ID) plasticityType
call plastic_kinehardening_LpAndItsTangent(Lp,dLp_dMp,Mp,instance,of)
case (PLASTICITY_NONLOCAL_ID) plasticityType
call plastic_nonlocal_LpAndItsTangent (Lp,dLp_dMp,Mp, temperature(ho)%p(tme),instance,of,ip,el)
case (PLASTICITY_DISLOTWIN_ID) plasticityType
call plastic_dislotwin_LpAndItsTangent (Lp,dLp_dMp,Mp,temperature(ho)%p(tme),instance,of)
case (PLASTICITY_DISLOUCLA_ID) plasticityType
call plastic_disloucla_LpAndItsTangent (Lp,dLp_dMp,Mp,temperature(ho)%p(tme),instance,of)
end select plasticityType
do i=1,3; do j=1,3
dLp_dFi(i,j,1:3,1:3) = matmul(matmul(Fi,S),transpose(dLp_dMp(i,j,1:3,1:3))) + &
matmul(matmul(Fi,dLp_dMp(i,j,1:3,1:3)),S)
dLp_dS(i,j,1:3,1:3) = matmul(matmul(transpose(Fi),Fi),dLp_dMp(i,j,1:3,1:3)) ! ToDo: @PS: why not: dLp_dMp:(FiT Fi)
enddo; enddo
end subroutine constitutive_plastic_LpAndItsTangents
!--------------------------------------------------------------------------------------------
!> @brief writes plasticity constitutive results to HDF5 output file
!--------------------------------------------------------------------------------------------
module subroutine plastic_results
integer :: p
character(len=pStringLen) :: group
plasticityLoop: do p=1,size(config_name_phase)
group = trim('current/constituent')//'/'//trim(config_name_phase(p))
call results_closeGroup(results_addGroup(group))
group = trim(group)//'/plastic'
call results_closeGroup(results_addGroup(group))
select case(phase_plasticity(p))
case(PLASTICITY_ISOTROPIC_ID)
call plastic_isotropic_results(phase_plasticityInstance(p),group)
case(PLASTICITY_PHENOPOWERLAW_ID)
call plastic_phenopowerlaw_results(phase_plasticityInstance(p),group)
case(PLASTICITY_KINEHARDENING_ID)
call plastic_kinehardening_results(phase_plasticityInstance(p),group)
case(PLASTICITY_DISLOTWIN_ID)
call plastic_dislotwin_results(phase_plasticityInstance(p),group)
case(PLASTICITY_DISLOUCLA_ID)
call plastic_disloUCLA_results(phase_plasticityInstance(p),group)
case(PLASTICITY_NONLOCAL_ID)
call plastic_nonlocal_results(phase_plasticityInstance(p),group)
end select
enddo plasticityLoop
end subroutine plastic_results
end submodule constitutive_plastic

View File

@ -5,7 +5,7 @@
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
!> @brief crystal plasticity model for bcc metals, especially Tungsten
!--------------------------------------------------------------------------------------------------
submodule(constitutive) plastic_disloUCLA
submodule(constitutive:constitutive_plastic) plastic_disloUCLA
real(pReal), parameter :: &
kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin
@ -91,14 +91,13 @@ module subroutine plastic_disloUCLA_init
character(len=pStringLen) :: &
extmsg = ''
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_DISLOUCLA_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_DISLOUCLA_LABEL//' init -+>>>'
write(6,'(/,a)') ' Cereceda et al., International Journal of Plasticity 78:242256, 2016'
write(6,'(a)') ' https://dx.doi.org/10.1016/j.ijplas.2015.09.002'
Ninstance = count(phase_plasticity == PLASTICITY_DISLOUCLA_ID)
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(param(Ninstance))
allocate(state(Ninstance))

View File

@ -7,7 +7,7 @@
!> @brief material subroutine incoprorating dislocation and twinning physics
!> @details to be done
!--------------------------------------------------------------------------------------------------
submodule(constitutive) plastic_dislotwin
submodule(constitutive:constitutive_plastic) plastic_dislotwin
real(pReal), parameter :: &
kB = 1.38e-23_pReal !< Boltzmann constant in J/Kelvin
@ -138,7 +138,7 @@ module subroutine plastic_dislotwin_init
character(len=pStringLen) :: &
extmsg = ''
write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_DISLOTWIN_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_DISLOTWIN_LABEL//' init -+>>>'
write(6,'(/,a)') ' Ma and Roters, Acta Materialia 52(12):36033612, 2004'
write(6,'(a)') ' https://doi.org/10.1016/j.actamat.2004.04.012'
@ -150,9 +150,7 @@ module subroutine plastic_dislotwin_init
write(6,'(a,/)') ' https://doi.org/10.1016/j.actamat.2016.07.032'
Ninstance = count(phase_plasticity == PLASTICITY_DISLOTWIN_ID)
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(param(Ninstance))
allocate(state(Ninstance))
@ -590,7 +588,7 @@ module subroutine plastic_dislotwin_LpAndItsTangent(Lp,dLp_dMp,Mp,T,instance,of)
shearBandingContribution: if(dNeq0(prm%sbVelocity)) then
BoltzmannRatio = prm%E_sb/(kB*T)
call math_eigh33(Mp,eigValues,eigVectors) ! is Mp symmetric by design?
call math_eigh33(eigValues,eigVectors,Mp) ! is Mp symmetric by design?
do i = 1,6
P_sb = 0.5_pReal * math_outer(matmul(eigVectors,sb_sComposition(1:3,i)),&

View File

@ -7,7 +7,7 @@
!! resolving the stress on the slip systems. Will give the response of phenopowerlaw for an
!! untextured polycrystal
!--------------------------------------------------------------------------------------------------
submodule(constitutive) plastic_isotropic
submodule(constitutive:constitutive_plastic) plastic_isotropic
type :: tParameters
real(pReal) :: &
@ -61,14 +61,13 @@ module subroutine plastic_isotropic_init
character(len=pStringLen) :: &
extmsg = ''
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_ISOTROPIC_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_ISOTROPIC_LABEL//' init -+>>>'
write(6,'(/,a)') ' Maiti and Eisenlohr, Scripta Materialia 145:3740, 2018'
write(6,'(a)') ' https://doi.org/10.1016/j.scriptamat.2017.09.047'
Ninstance = count(phase_plasticity == PLASTICITY_ISOTROPIC_ID)
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(param(Ninstance))
allocate(state(Ninstance))
@ -84,8 +83,8 @@ module subroutine plastic_isotropic_init
prm%output = config%getStrings('(output)',defaultVal=emptyStringArray)
#ifdef DEBUG
if (p==material_phaseAt(debug_g,debug_e)) &
prm%of_debug = material_phasememberAt(debug_g,debug_i,debug_e)
if (p==material_phaseAt(debugConstitutive%grain,debugConstitutive%element)) &
prm%of_debug = material_phasememberAt(debugConstitutive%grain,debugConstitutive%ip,debugConstitutive%element)
#endif
xi_0 = config%getFloat('tau0')
@ -183,8 +182,7 @@ module subroutine plastic_isotropic_LpAndItsTangent(Lp,dLp_dMp,Mp,instance,of)
Lp = dot_gamma/prm%M * Mp_dev/norm_Mp_dev
#ifdef DEBUG
if (iand(debug_level(debug_constitutive), debug_levelExtensive) /= 0 &
.and. (of == prm%of_debug .or. .not. iand(debug_level(debug_constitutive),debug_levelSelective) /= 0)) then
if (debugConstitutive%extensive .and. (of == prm%of_debug .or. .not. debugConstitutive%selective)) then
write(6,'(/,a,/,3(12x,3(f12.4,1x)/))') '<< CONST isotropic >> Tstar (dev) / MPa', &
transpose(Mp_dev)*1.0e-6_pReal
write(6,'(/,a,/,f12.5)') '<< CONST isotropic >> norm Tstar / MPa', norm_Mp_dev*1.0e-6_pReal
@ -239,8 +237,7 @@ module subroutine plastic_isotropic_LiAndItsTangent(Li,dLi_dMi,Mi,instance,of)
* tr * abs(tr)**(prm%n-1.0_pReal)
#ifdef DEBUG
if (iand(debug_level(debug_constitutive), debug_levelExtensive) /= 0 &
.and. (of == prm%of_debug .or. .not. iand(debug_level(debug_constitutive),debug_levelSelective) /= 0)) then
if (debugConstitutive%extensive .and. (of == prm%of_debug .or. .not. debugConstitutive%selective)) then
write(6,'(/,a,/,f12.5)') '<< CONST isotropic >> pressure / MPa', tr/3.0_pReal*1.0e-6_pReal
write(6,'(/,a,/,f12.5)') '<< CONST isotropic >> gdot', prm%dot_gamma_0 * (3.0_pReal*prm%M*stt%xi(of))**(-prm%n) &
* tr * abs(tr)**(prm%n-1.0_pReal)

View File

@ -5,7 +5,7 @@
!> @brief Phenomenological crystal plasticity using a power law formulation for the shear rates
!! and a Voce-type kinematic hardening rule
!--------------------------------------------------------------------------------------------------
submodule(constitutive) plastic_kinehardening
submodule(constitutive:constitutive_plastic) plastic_kinehardening
type :: tParameters
real(pReal) :: &
@ -74,11 +74,10 @@ module subroutine plastic_kinehardening_init
character(len=pStringLen) :: &
extmsg = ''
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_KINEHARDENING_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_KINEHARDENING_LABEL//' init -+>>>'
Ninstance = count(phase_plasticity == PLASTICITY_KINEHARDENING_ID)
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(param(Ninstance))
allocate(state(Ninstance))
@ -96,8 +95,8 @@ module subroutine plastic_kinehardening_init
prm%output = config%getStrings('(output)',defaultVal=emptyStringArray)
#ifdef DEBUG
if (p==material_phaseAt(debug_g,debug_e)) then
prm%of_debug = material_phasememberAt(debug_g,debug_i,debug_e)
if (p==material_phaseAt(debugConstitutive%grain,debugConstitutive%element)) then
prm%of_debug = material_phasememberAt(debugConstitutive%grain,debugConstitutive%ip,debugConstitutive%element)
endif
#endif
@ -328,9 +327,8 @@ module subroutine plastic_kinehardening_deltaState(Mp,instance,of)
dEq0(gdot_pos+gdot_neg,1e-10_pReal)) ! current sense of shear direction
#ifdef DEBUG
if (iand(debug_level(debug_constitutive), debug_levelExtensive) /= 0 &
.and. (of == prm%of_debug &
.or. .not. iand(debug_level(debug_constitutive),debug_levelSelective) /= 0)) then
if (debugConstitutive%extensive &
.and. (of == prm%of_debug .or. .not. debugConstitutive%selective)) then
write(6,'(a)') '======= kinehardening delta state ======='
write(6,*) sense,state(instance)%sense(:,of)
endif

View File

@ -4,7 +4,7 @@
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
!> @brief Dummy plasticity for purely elastic material
!--------------------------------------------------------------------------------------------------
submodule(constitutive) plastic_none
submodule(constitutive:constitutive_plastic) plastic_none
contains
@ -19,11 +19,10 @@ module subroutine plastic_none_init
p, &
NipcMyPhase
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_NONE_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_NONE_LABEL//' init -+>>>'
Ninstance = count(phase_plasticity == PLASTICITY_NONE_ID)
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
do p = 1, size(phase_plasticity)
if (phase_plasticity(p) /= PLASTICITY_NONE_ID) cycle

View File

@ -4,7 +4,7 @@
!> @author Philip Eisenlohr, Max-Planck-Institut für Eisenforschung GmbH
!> @brief material subroutine for plasticity including dislocation flux
!--------------------------------------------------------------------------------------------------
submodule(constitutive) plastic_nonlocal
submodule(constitutive:constitutive_plastic) plastic_nonlocal
use geometry_plastic_nonlocal, only: &
nIPneighbors => geometry_plastic_nonlocal_nIPneighbors, &
IPneighborhood => geometry_plastic_nonlocal_IPneighborhood, &
@ -147,7 +147,7 @@ submodule(constitutive) plastic_nonlocal
v_scr_neg
end type tNonlocalState
type(tNonlocalState), allocatable, dimension(:) :: &
type(tNonlocalState), allocatable, dimension(:) :: &
deltaState, &
dotState, &
state, &
@ -179,7 +179,7 @@ module subroutine plastic_nonlocal_init
type(tInitialParameters) :: &
ini
write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_NONLOCAL_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- constitutive_'//PLASTICITY_NONLOCAL_LABEL//' init -+>>>'
write(6,'(/,a)') ' Reuber et al., Acta Materialia 71:333348, 2014'
write(6,'(a)') ' https://doi.org/10.1016/j.actamat.2014.03.012'
@ -188,8 +188,7 @@ module subroutine plastic_nonlocal_init
write(6,'(a)') ' http://publications.rwth-aachen.de/record/229993'
Ninstance = count(phase_plasticity == PLASTICITY_NONLOCAL_ID)
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(param(Ninstance))
allocate(state(Ninstance))
@ -387,7 +386,11 @@ module subroutine plastic_nonlocal_init
call material_allocateState(plasticState(p),NipcMyPhase,sizeState,sizeDotState,sizeDeltaState)
plasticState(p)%nonlocal = config%KeyExists('/nonlocal/')
plasticState(p)%nonlocal = config%KeyExists('/nonlocal/')
if(plasticState(p)%nonlocal .and. .not. allocated(IPneighborhood)) &
call IO_error(212,ext_msg='IPneighborhood does not exist')
plasticState(p)%offsetDeltaState = 0 ! ToDo: state structure does not follow convention
st0%rho => plasticState(p)%state0 (0*prm%sum_N_sl+1:10*prm%sum_N_sl,:)
@ -710,9 +713,9 @@ module subroutine plastic_nonlocal_dependentState(F, Fp, instance, of, ip, el)
endif
#ifdef DEBUG
if (iand(debug_level(debug_constitutive),debug_levelExtensive) /= 0 &
.and. ((debug_e == el .and. debug_i == ip)&
.or. .not. iand(debug_level(debug_constitutive),debug_levelSelective) /= 0)) then
if (debugConstitutive%extensive &
.and. ((debugConstitutive%element == el .and. debugConstitutive%ip == ip)&
.or. .not. debugConstitutive%selective)) then
write(6,'(/,a,i8,1x,i2,1x,i1,/)') '<< CONST >> nonlocal_microstructure at el ip ',el,ip
write(6,'(a,/,12x,12(e10.3,1x))') '<< CONST >> rhoForest', stt%rho_forest(:,of)
write(6,'(a,/,12x,12(f10.5,1x))') '<< CONST >> tauThreshold / MPa', dst%tau_pass(:,of)*1e-6
@ -927,9 +930,9 @@ module subroutine plastic_nonlocal_deltaState(Mp,instance,of,ip,el)
del%rho(:,of) = reshape(deltaRhoRemobilization + deltaRhoDipole2SingleStress, [10*ns])
#ifdef DEBUG
if (iand(debug_level(debug_constitutive),debug_levelExtensive) /= 0 &
.and. ((debug_e == el .and. debug_i == ip)&
.or. .not. iand(debug_level(debug_constitutive),debug_levelSelective) /= 0 )) then
if (debugConstitutive%extensive &
.and. ((debugConstitutive%element == el .and. debugConstitutive%ip == ip)&
.or. .not. debugConstitutive%selective)) then
write(6,'(a,/,8(12x,12(e12.5,1x),/))') '<< CONST >> dislocation remobilization', deltaRhoRemobilization(:,1:8)
write(6,'(a,/,10(12x,12(e12.5,1x),/),/)') '<< CONST >> dipole dissociation by stress increase', deltaRhoDipole2SingleStress
endif
@ -1016,9 +1019,9 @@ module subroutine plastic_nonlocal_dotState(Mp, F, Fp, Temperature,timestep, &
gdot = rhoSgl(:,1:4) * v * spread(prm%burgers,2,4)
#ifdef DEBUG
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0 &
.and. ((debug_e == el .and. debug_i == ip)&
.or. .not. iand(debug_level(debug_constitutive),debug_levelSelective) /= 0 )) then
if (debugConstitutive%basic &
.and. ((debugConstitutive%element == el .and. debugConstitutive%ip == ip) &
.or. .not. debugConstitutive%selective)) then
write(6,'(a,/,10(12x,12(e12.5,1x),/))') '<< CONST >> rho / 1/m^2', rhoSgl, rhoDip
write(6,'(a,/,4(12x,12(e12.5,1x),/))') '<< CONST >> gdot / 1/s',gdot
endif
@ -1127,7 +1130,7 @@ module subroutine plastic_nonlocal_dotState(Mp, F, Fp, Temperature,timestep, &
if ( any(rho(:,mob) + rhoDot(:,1:4) * timestep < -prm%atol_rho) &
.or. any(rho(:,dip) + rhoDot(:,9:10) * timestep < -prm%atol_rho)) then
#ifdef DEBUG
if (iand(debug_level(debug_constitutive),debug_levelExtensive) /= 0) then
if (debugConstitutive%extensive) then
write(6,'(a,i5,a,i2)') '<< CONST >> evolution rate leads to negative density at el ',el,' ip ',ip
write(6,'(a)') '<< CONST >> enforcing cutback !!!'
endif
@ -1239,7 +1242,7 @@ function rhoDotFlux(F,Fp,timestep, instance,of,ip,el)
.and. prm%CFLfactor * abs(v0) * timestep &
> IPvolume(ip,el) / maxval(IParea(:,ip,el)))) then ! ...with velocity above critical value (we use the reference volume and area for simplicity here)
#ifdef DEBUG
if (iand(debug_level(debug_constitutive),debug_levelExtensive) /= 0) then
if (debugConstitutive%extensive) then
write(6,'(a,i5,a,i2)') '<< CONST >> CFL condition not fullfilled at el ',el,' ip ',ip
write(6,'(a,e10.3,a,e10.3)') '<< CONST >> velocity is at ', &
maxval(abs(v0), abs(gdot) > 0.0_pReal &

View File

@ -4,7 +4,7 @@
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
!> @brief phenomenological crystal plasticity formulation using a powerlaw fitting
!--------------------------------------------------------------------------------------------------
submodule(constitutive) plastic_phenopowerlaw
submodule(constitutive:constitutive_plastic) plastic_phenopowerlaw
type :: tParameters
real(pReal) :: &
@ -83,11 +83,10 @@ module subroutine plastic_phenopowerlaw_init
character(len=pStringLen) :: &
extmsg = ''
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_PHENOPOWERLAW_LABEL//' init -+>>>'; flush(6)
write(6,'(/,a)') ' <<<+- plastic_'//PLASTICITY_PHENOPOWERLAW_LABEL//' init -+>>>'
Ninstance = count(phase_plasticity == PLASTICITY_PHENOPOWERLAW_ID)
if (iand(debug_level(debug_constitutive),debug_levelBasic) /= 0) &
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance
write(6,'(a16,1x,i5,/)') '# instances:',Ninstance; flush(6)
allocate(param(Ninstance))
allocate(state(Ninstance))

View File

@ -0,0 +1,116 @@
!----------------------------------------------------------------------------------------------------
!> @brief internal microstructure state for all thermal sources and kinematics constitutive models
!----------------------------------------------------------------------------------------------------
submodule(constitutive) constitutive_thermal
interface
module subroutine source_thermal_dissipation_init
end subroutine source_thermal_dissipation_init
module subroutine source_thermal_externalheat_init
end subroutine source_thermal_externalheat_init
module subroutine kinematics_thermal_expansion_init
end subroutine kinematics_thermal_expansion_init
module subroutine source_thermal_dissipation_getRateAndItsTangent(TDot, dTDot_dT, Tstar, Lp, phase)
integer, intent(in) :: &
phase !< phase ID of element
real(pReal), intent(in), dimension(3,3) :: &
Tstar !< 2nd Piola Kirchoff stress tensor for a given element
real(pReal), intent(in), dimension(3,3) :: &
Lp !< plastic velocuty gradient for a given element
real(pReal), intent(out) :: &
TDot, &
dTDot_dT
end subroutine source_thermal_dissipation_getRateAndItsTangent
module subroutine source_thermal_externalheat_getRateAndItsTangent(TDot, dTDot_dT, phase, of)
integer, intent(in) :: &
phase, &
of
real(pReal), intent(out) :: &
TDot, &
dTDot_dT
end subroutine source_thermal_externalheat_getRateAndItsTangent
end interface
contains
!----------------------------------------------------------------------------------------------
!< @brief initializes thermal sources and kinematics mechanism
!----------------------------------------------------------------------------------------------
module subroutine thermal_init
! initialize source mechanisms
if (any(phase_source == SOURCE_thermal_dissipation_ID)) call source_thermal_dissipation_init
if (any(phase_source == SOURCE_thermal_externalheat_ID)) call source_thermal_externalheat_init
!--------------------------------------------------------------------------------------------------
!initialize kinematic mechanisms
if (any(phase_kinematics == KINEMATICS_thermal_expansion_ID)) call kinematics_thermal_expansion_init
end subroutine thermal_init
!----------------------------------------------------------------------------------------------
!< @brief calculates thermal dissipation rate
!----------------------------------------------------------------------------------------------
module subroutine constitutive_thermal_getRateAndItsTangents(TDot, dTDot_dT, T, S, Lp, ip, el)
integer, intent(in) :: &
ip, & !< integration point number
el !< element number
real(pReal), intent(in) :: &
T
real(pReal), intent(in), dimension(:,:,:,:,:) :: &
S, & !< current 2nd Piola Kirchoff stress
Lp !< plastic velocity gradient
real(pReal), intent(inout) :: &
TDot, &
dTDot_dT
real(pReal) :: &
my_Tdot, &
my_dTdot_dT
integer :: &
phase, &
homog, &
instance, &
grain, &
source, &
constituent
homog = material_homogenizationAt(el)
instance = thermal_typeInstance(homog)
do grain = 1, homogenization_Ngrains(homog)
phase = material_phaseAt(grain,el)
constituent = material_phasememberAt(grain,ip,el)
do source = 1, phase_Nsources(phase)
select case(phase_source(source,phase))
case (SOURCE_thermal_dissipation_ID)
call source_thermal_dissipation_getRateAndItsTangent(my_Tdot, my_dTdot_dT, &
S(1:3,1:3,grain,ip,el), &
Lp(1:3,1:3,grain,ip,el), &
phase)
case (SOURCE_thermal_externalheat_ID)
call source_thermal_externalheat_getRateAndItsTangent(my_Tdot, my_dTdot_dT, &
phase, constituent)
case default
my_Tdot = 0.0_pReal
my_dTdot_dT = 0.0_pReal
end select
Tdot = Tdot + my_Tdot
dTdot_dT = dTdot_dT + my_dTdot_dT
enddo
enddo
end subroutine constitutive_thermal_getRateAndItsTangents
end submodule constitutive_thermal

View File

@ -23,7 +23,6 @@ module crystallite
use discretization
use lattice
use results
use YAML_types
implicit none
private
@ -98,6 +97,19 @@ module crystallite
type(tNumerics) :: num ! numerics parameters. Better name?
type :: tDebugOptions
logical :: &
basic, &
extensive, &
selective
integer :: &
element, &
ip, &
grain
end type tDebugOptions
type(tDebugOptions) :: debugCrystallite
procedure(integrateStateFPI), pointer :: integrateState
public :: &
@ -130,9 +142,19 @@ subroutine crystallite_init
myNcomponents !< number of components at current IP
class(tNode), pointer :: &
num_crystallite
num_crystallite, &
debug_crystallite ! pointer to debug options for crystallite
write(6,'(/,a)') ' <<<+- crystallite init -+>>>'
debug_crystallite => debug_root%get('crystallite', defaultVal=emptyList)
debugCrystallite%basic = debug_crystallite%contains('basic')
debugCrystallite%extensive = debug_crystallite%contains('extensive')
debugCrystallite%selective = debug_crystallite%contains('selective')
debugCrystallite%element = debug_root%get_asInt('element', defaultVal=1)
debugCrystallite%ip = debug_root%get_asInt('integrationpoint', defaultVal=1)
debugCrystallite%grain = debug_root%get_asInt('grain', defaultVal=1)
cMax = homogenization_maxNgrains
iMax = discretization_nIP
eMax = discretization_nElem
@ -269,7 +291,7 @@ subroutine crystallite_init
call crystallite_stressTangent
#ifdef DEBUG
if (iand(debug_level(debug_crystallite), debug_levelBasic) /= 0) then
if (debugCrystallite%basic) then
write(6,'(a42,1x,i10)') ' # of elements: ', eMax
write(6,'(a42,1x,i10)') ' # of integration points/element: ', iMax
write(6,'(a42,1x,i10)') 'max # of constituents/integration point: ', cMax
@ -297,26 +319,32 @@ function crystallite_stress()
startIP, endIP, &
s
logical, dimension(homogenization_maxNgrains,discretization_nIP,discretization_nElem) :: todo !ToDo: need to set some values to false for different Ngrains
todo = .false.
#ifdef DEBUG
if (iand(debug_level(debug_crystallite),debug_levelSelective) /= 0 &
.and. FEsolving_execElem(1) <= debug_e &
.and. debug_e <= FEsolving_execElem(2)) then
if (debugCrystallite%selective &
.and. FEsolving_execElem(1) <= debugCrystallite%element &
.and. debugCrystallite%element <= FEsolving_execElem(2)) then
write(6,'(/,a,i8,1x,i2,1x,i3)') '<< CRYST stress >> boundary and initial values at el ip ipc ', &
debug_e,debug_i, debug_g
debugCrystallite%element,debugCrystallite%ip, debugCrystallite%grain
write(6,'(a,/,3(12x,3(f14.9,1x)/))') '<< CRYST stress >> F ', &
transpose(crystallite_partionedF(1:3,1:3,debug_g,debug_i,debug_e))
transpose(crystallite_partionedF(1:3,1:3,debugCrystallite%grain, &
debugCrystallite%ip,debugCrystallite%element))
write(6,'(a,/,3(12x,3(f14.9,1x)/))') '<< CRYST stress >> F0 ', &
transpose(crystallite_partionedF0(1:3,1:3,debug_g,debug_i,debug_e))
transpose(crystallite_partionedF0(1:3,1:3,debugCrystallite%grain, &
debugCrystallite%ip,debugCrystallite%element))
write(6,'(a,/,3(12x,3(f14.9,1x)/))') '<< CRYST stress >> Fp0', &
transpose(crystallite_partionedFp0(1:3,1:3,debug_g,debug_i,debug_e))
transpose(crystallite_partionedFp0(1:3,1:3,debugCrystallite%grain, &
debugCrystallite%ip,debugCrystallite%element))
write(6,'(a,/,3(12x,3(f14.9,1x)/))') '<< CRYST stress >> Fi0', &
transpose(crystallite_partionedFi0(1:3,1:3,debug_g,debug_i,debug_e))
transpose(crystallite_partionedFi0(1:3,1:3,debugCrystallite%grain, &
debugCrystallite%ip,debugCrystallite%element))
write(6,'(a,/,3(12x,3(f14.9,1x)/))') '<< CRYST stress >> Lp0', &
transpose(crystallite_partionedLp0(1:3,1:3,debug_g,debug_i,debug_e))
transpose(crystallite_partionedLp0(1:3,1:3,debugCrystallite%grain, &
debugCrystallite%ip,debugCrystallite%element))
write(6,'(a,/,3(12x,3(f14.9,1x)/))') '<< CRYST stress >> Li0', &
transpose(crystallite_partionedLi0(1:3,1:3,debug_g,debug_i,debug_e))
transpose(crystallite_partionedLi0(1:3,1:3,debugCrystallite%grain, &
debugCrystallite%ip,debugCrystallite%element))
endif
#endif
@ -362,7 +390,7 @@ function crystallite_stress()
NiterationCrystallite = NiterationCrystallite + 1
#ifdef DEBUG
if (iand(debug_level(debug_crystallite),debug_levelExtensive) /= 0) &
if (debugCrystallite%extensive) &
write(6,'(a,i6)') '<< CRYST stress >> crystallite iteration ',NiterationCrystallite
#endif
!$OMP PARALLEL DO PRIVATE(formerSubStep)
@ -613,7 +641,7 @@ subroutine crystallite_orientations
if (plasticState(material_phaseAt(1,e))%nonlocal) then
do i = FEsolving_execIP(1),FEsolving_execIP(2)
call plastic_nonlocal_updateCompatibility(crystallite_orientation, &
phase_plasticityInstance(material_phaseAt(i,e)),i,e)
phase_plasticityInstance(material_phaseAt(1,e)),i,e)
enddo
endif
enddo

View File

@ -9,10 +9,7 @@ module damage_local
use config
use numerics
use YAML_types
use source_damage_isoBrittle
use source_damage_isoDuctile
use source_damage_anisoBrittle
use source_damage_anisoDuctile
use constitutive
use results
implicit none
@ -128,42 +125,13 @@ subroutine damage_local_getSourceAndItsTangent(phiDot, dPhiDot_dPhi, phi, ip, el
el !< element number
real(pReal), intent(in) :: &
phi
integer :: &
phase, &
grain, &
source, &
constituent
real(pReal) :: &
phiDot, dPhiDot_dPhi, localphiDot, dLocalphiDot_dPhi
phiDot, dPhiDot_dPhi
phiDot = 0.0_pReal
dPhiDot_dPhi = 0.0_pReal
do grain = 1, homogenization_Ngrains(material_homogenizationAt(el))
phase = material_phaseAt(grain,el)
constituent = material_phasememberAt(grain,ip,el)
do source = 1, phase_Nsources(phase)
select case(phase_source(source,phase))
case (SOURCE_damage_isoBrittle_ID)
call source_damage_isobrittle_getRateAndItsTangent (localphiDot, dLocalphiDot_dPhi, phi, phase, constituent)
case (SOURCE_damage_isoDuctile_ID)
call source_damage_isoductile_getRateAndItsTangent (localphiDot, dLocalphiDot_dPhi, phi, phase, constituent)
case (SOURCE_damage_anisoBrittle_ID)
call source_damage_anisobrittle_getRateAndItsTangent(localphiDot, dLocalphiDot_dPhi, phi, phase, constituent)
case (SOURCE_damage_anisoDuctile_ID)
call source_damage_anisoductile_getRateAndItsTangent(localphiDot, dLocalphiDot_dPhi, phi, phase, constituent)
case default
localphiDot = 0.0_pReal
dLocalphiDot_dPhi = 0.0_pReal
end select
phiDot = phiDot + localphiDot
dPhiDot_dPhi = dPhiDot_dPhi + dLocalphiDot_dPhi
enddo
enddo
call constitutive_damage_getRateAndItsTangents(phiDot, dPhiDot_dPhi, phi, ip, el)
phiDot = phiDot/real(homogenization_Ngrains(material_homogenizationAt(el)),pReal)
dPhiDot_dPhi = dPhiDot_dPhi/real(homogenization_Ngrains(material_homogenizationAt(el)),pReal)

View File

@ -10,10 +10,7 @@ module damage_nonlocal
use YAML_types
use crystallite
use lattice
use source_damage_isoBrittle
use source_damage_isoDuctile
use source_damage_anisoBrittle
use source_damage_anisoDuctile
use constitutive
use results
implicit none
@ -97,43 +94,13 @@ subroutine damage_nonlocal_getSourceAndItsTangent(phiDot, dPhiDot_dPhi, phi, ip,
el !< element number
real(pReal), intent(in) :: &
phi
integer :: &
phase, &
grain, &
source, &
constituent
real(pReal) :: &
phiDot, dPhiDot_dPhi, localphiDot, dLocalphiDot_dPhi
phiDot, dPhiDot_dPhi
phiDot = 0.0_pReal
dPhiDot_dPhi = 0.0_pReal
do grain = 1, homogenization_Ngrains(material_homogenizationAt(el))
phase = material_phaseAt(grain,el)
constituent = material_phasememberAt(grain,ip,el)
do source = 1, phase_Nsources(phase)
select case(phase_source(source,phase))
case (SOURCE_damage_isoBrittle_ID)
call source_damage_isobrittle_getRateAndItsTangent (localphiDot, dLocalphiDot_dPhi, phi, phase, constituent)
case (SOURCE_damage_isoDuctile_ID)
call source_damage_isoductile_getRateAndItsTangent (localphiDot, dLocalphiDot_dPhi, phi, phase, constituent)
case (SOURCE_damage_anisoBrittle_ID)
call source_damage_anisobrittle_getRateAndItsTangent(localphiDot, dLocalphiDot_dPhi, phi, phase, constituent)
case (SOURCE_damage_anisoDuctile_ID)
call source_damage_anisoductile_getRateAndItsTangent(localphiDot, dLocalphiDot_dPhi, phi, phase, constituent)
case default
localphiDot = 0.0_pReal
dLocalphiDot_dPhi = 0.0_pReal
end select
phiDot = phiDot + localphiDot
dPhiDot_dPhi = dPhiDot_dPhi + dLocalphiDot_dPhi
enddo
enddo
call constitutive_damage_getRateAndItsTangents(phiDot, dPhiDot_dPhi, phi, ip, el)
phiDot = phiDot/real(homogenization_Ngrains(material_homogenizationAt(el)),pReal)
dPhiDot_dPhi = dPhiDot_dPhi/real(homogenization_Ngrains(material_homogenizationAt(el)),pReal)

View File

@ -8,51 +8,15 @@
module debug
use prec
use IO
use YAML_types
use YAML_parse
implicit none
private
integer, parameter, public :: &
debug_LEVELSELECTIVE = 2**0, &
debug_LEVELBASIC = 2**1, &
debug_LEVELEXTENSIVE = 2**2
integer, parameter, private :: &
debug_MAXGENERAL = debug_LEVELEXTENSIVE ! must be set to the last bitcode used by (potentially) all debug types
integer, parameter, public :: &
debug_SPECTRALRESTART = debug_MAXGENERAL*2**1, &
debug_SPECTRALFFTW = debug_MAXGENERAL*2**2, &
debug_SPECTRALDIVERGENCE = debug_MAXGENERAL*2**3, &
debug_SPECTRALROTATION = debug_MAXGENERAL*2**4, &
debug_SPECTRALPETSC = debug_MAXGENERAL*2**5
integer, parameter, public :: &
debug_DEBUG = 1, &
debug_MATH = 2, &
debug_FESOLVING = 3, &
debug_MESH = 4, & !< stores debug level for mesh part of DAMASK bitwise coded
debug_MATERIAL = 5, & !< stores debug level for material part of DAMASK bitwise coded
debug_LATTICE = 6, & !< stores debug level for lattice part of DAMASK bitwise coded
debug_CONSTITUTIVE = 7, & !< stores debug level for constitutive part of DAMASK bitwise coded
debug_CRYSTALLITE = 8, &
debug_HOMOGENIZATION = 9, &
debug_CPFEM = 10, &
debug_SPECTRAL = 11, &
debug_MARC = 12
integer, parameter, private :: &
debug_MAXNTYPE = debug_MARC !< must be set to the maximum defined debug type
class(tNode), pointer, protected, public :: &
debug_root !< root pointer storing the debug YAML structure
integer,protected, dimension(debug_maxNtype+2), public :: & ! specific ones, and 2 for "all" and "other"
debug_level = 0
integer, protected, public :: &
debug_e = 1, &
debug_i = 1, &
debug_g = 1
#ifdef PETSc
character(len=1024), parameter, public :: &
PETSCDEBUG = ' -snes_view -snes_monitor '
#endif
public :: debug_init
contains
@ -63,11 +27,9 @@ contains
!--------------------------------------------------------------------------------------------------
subroutine debug_init
character(len=pStringLen), dimension(:), allocatable :: fileContent
integer :: i, what, j
integer, allocatable, dimension(:) :: chunkPos
character(len=pStringLen) :: tag, line
character(len=:), allocatable :: &
debug_input, &
debug_inFlow
logical :: fexist
write(6,'(/,a)') ' <<<+- debug init -+>>>'
@ -75,144 +37,14 @@ subroutine debug_init
write(6,'(a)') achar(27)//'[31m <<<+- DEBUG version -+>>>'//achar(27)//'[0m'
#endif
inquire(file='debug.config', exist=fexist)
debug_root => emptyDict
inquire(file='debug.yaml', exist=fexist)
fileExists: if (fexist) then
fileContent = IO_read_ASCII('debug.config')
do j=1, size(fileContent)
line = fileContent(j)
if (IO_isBlank(line)) cycle ! skip empty lines
chunkPos = IO_stringPos(line)
tag = IO_lc(IO_stringValue(line,chunkPos,1)) ! extract key
select case(tag)
case ('element','e','el')
debug_e = IO_intValue(line,chunkPos,2)
case ('integrationpoint','i','ip')
debug_i = IO_intValue(line,chunkPos,2)
case ('grain','g','gr')
debug_g = IO_intValue(line,chunkPos,2)
end select
what = 0
select case(tag)
case ('debug')
what = debug_DEBUG
case ('math')
what = debug_MATH
case ('fesolving', 'fe')
what = debug_FESOLVING
case ('mesh')
what = debug_MESH
case ('material')
what = debug_MATERIAL
case ('lattice')
what = debug_LATTICE
case ('constitutive')
what = debug_CONSTITUTIVE
case ('crystallite')
what = debug_CRYSTALLITE
case ('homogenization')
what = debug_HOMOGENIZATION
case ('cpfem')
what = debug_CPFEM
case ('spectral')
what = debug_SPECTRAL
case ('marc')
what = debug_MARC
case ('all')
what = debug_MAXNTYPE + 1
case ('other')
what = debug_MAXNTYPE + 2
end select
if (what /= 0) then
do i = 2, chunkPos(1)
select case(IO_lc(IO_stringValue(line,chunkPos,i)))
case('basic')
debug_level(what) = ior(debug_level(what), debug_LEVELBASIC)
case('extensive')
debug_level(what) = ior(debug_level(what), debug_LEVELEXTENSIVE)
case('selective')
debug_level(what) = ior(debug_level(what), debug_LEVELSELECTIVE)
case('restart')
debug_level(what) = ior(debug_level(what), debug_SPECTRALRESTART)
case('fft','fftw')
debug_level(what) = ior(debug_level(what), debug_SPECTRALFFTW)
case('divergence')
debug_level(what) = ior(debug_level(what), debug_SPECTRALDIVERGENCE)
case('rotation')
debug_level(what) = ior(debug_level(what), debug_SPECTRALROTATION)
case('petsc')
debug_level(what) = ior(debug_level(what), debug_SPECTRALPETSC)
end select
enddo
endif
enddo
do i = 1, debug_maxNtype
if (debug_level(i) == 0) &
debug_level(i) = ior(debug_level(i), debug_level(debug_MAXNTYPE + 2)) ! fill undefined debug types with levels specified by "other"
debug_level(i) = ior(debug_level(i), debug_level(debug_MAXNTYPE + 1)) ! fill all debug types with levels specified by "all"
enddo
if (iand(debug_level(debug_debug),debug_LEVELBASIC) /= 0) &
write(6,'(a,/)') ' using values from config file'
else fileExists
if (iand(debug_level(debug_debug),debug_LEVELBASIC) /= 0) &
write(6,'(a,/)') ' using standard values'
debug_input = IO_read('debug.yaml')
debug_inFlow = to_flow(debug_input)
debug_root => parse_flow(debug_inFlow)
endif fileExists
!--------------------------------------------------------------------------------------------------
! output switched on (debug level for debug must be extensive)
if (iand(debug_level(debug_debug),debug_LEVELEXTENSIVE) /= 0) then
do i = 1, debug_MAXNTYPE
select case(i)
case (debug_DEBUG)
tag = ' Debug'
case (debug_MATH)
tag = ' Math'
case (debug_FESOLVING)
tag = ' FEsolving'
case (debug_MESH)
tag = ' Mesh'
case (debug_MATERIAL)
tag = ' Material'
case (debug_LATTICE)
tag = ' Lattice'
case (debug_CONSTITUTIVE)
tag = ' Constitutive'
case (debug_CRYSTALLITE)
tag = ' Crystallite'
case (debug_HOMOGENIZATION)
tag = ' Homogenizaiton'
case (debug_CPFEM)
tag = ' CPFEM'
case (debug_SPECTRAL)
tag = ' Spectral solver'
case (debug_MARC)
tag = ' MSC.MARC FEM solver'
end select
if(debug_level(i) /= 0) then
write(6,'(3a)') ' debug level for ', trim(tag), ':'
if(iand(debug_level(i),debug_LEVELBASIC) /= 0) write(6,'(a)') ' basic'
if(iand(debug_level(i),debug_LEVELEXTENSIVE) /= 0) write(6,'(a)') ' extensive'
if(iand(debug_level(i),debug_LEVELSELECTIVE) /= 0) then
write(6,'(a)') ' selective on:'
write(6,'(a24,1x,i8)') ' element: ',debug_e
write(6,'(a24,1x,i8)') ' ip: ',debug_i
write(6,'(a24,1x,i8)') ' grain: ',debug_g
endif
if(iand(debug_level(i),debug_SPECTRALRESTART) /= 0) write(6,'(a)') ' restart'
if(iand(debug_level(i),debug_SPECTRALFFTW) /= 0) write(6,'(a)') ' FFTW'
if(iand(debug_level(i),debug_SPECTRALDIVERGENCE)/= 0) write(6,'(a)') ' divergence'
if(iand(debug_level(i),debug_SPECTRALROTATION) /= 0) write(6,'(a)') ' rotation'
if(iand(debug_level(i),debug_SPECTRALPETSC) /= 0) write(6,'(a)') ' PETSc'
endif
enddo
endif
end subroutine debug_init
end module debug

View File

@ -24,7 +24,6 @@ program DAMASK_grid
use grid_damage_spectral
use grid_thermal_spectral
use results
use YAML_types
implicit none
@ -93,7 +92,8 @@ program DAMASK_grid
external :: &
quit
class (tNode), pointer :: &
num_grid
num_grid, &
debug_grid ! pointer to grid debug options
!--------------------------------------------------------------------------------------------------
! init DAMASK (all modules)
@ -124,6 +124,7 @@ program DAMASK_grid
!--------------------------------------------------------------------------------------------------
! assign mechanics solver depending on selected type
debug_grid => debug_root%get('grid',defaultVal=emptyList)
select case (trim(num_grid%get_asString('solver', defaultVal = 'Basic')))
case ('Basic')
mech_init => grid_mech_spectral_basic_init
@ -133,7 +134,7 @@ program DAMASK_grid
mech_restartWrite => grid_mech_spectral_basic_restartWrite
case ('Polarisation')
if(iand(debug_level(debug_spectral),debug_levelBasic)/= 0) &
if(debug_grid%contains('basic')) &
call IO_warning(42, ext_msg='debug Divergence')
mech_init => grid_mech_spectral_polarisation_init
mech_forward => grid_mech_spectral_polarisation_forward
@ -142,7 +143,7 @@ program DAMASK_grid
mech_restartWrite => grid_mech_spectral_polarisation_restartWrite
case ('FEM')
if(iand(debug_level(debug_spectral),debug_levelBasic)/= 0) &
if(debug_grid%contains('basic')) &
call IO_warning(42, ext_msg='debug Divergence')
mech_init => grid_mech_FEM_init
mech_forward => grid_mech_FEM_forward
@ -340,7 +341,7 @@ program DAMASK_grid
writeHeader: if (interface_restartInc < 1) then
open(newunit=statUnit,file=trim(getSolverJobName())//'.sta',form='FORMATTED',status='REPLACE')
write(statUnit,'(a)') 'Increment Time CutbackLevel Converged IterationsNeeded' ! statistics file
if (iand(debug_level(debug_spectral),debug_levelBasic) /= 0) &
if (debug_grid%contains('basic')) &
write(6,'(/,a)') ' header of statistics file written out'
flush(6)
else writeHeader

View File

@ -57,7 +57,10 @@ subroutine discretization_grid_init(restart)
microstructureAt, &
homogenizationAt
integer :: j
integer :: &
j, &
debug_element, &
debug_ip
integer(C_INTPTR_T) :: &
devNull, z, z_offset
@ -83,6 +86,11 @@ subroutine discretization_grid_init(restart)
myGrid = [grid(1:2),grid3]
mySize = [geomSize(1:2),size3]
!-------------------------------------------------------------------------------------------------
! debug parameters
debug_element = debug_root%get_asInt('element',defaultVal=1)
debug_ip = debug_root%get_asInt('integrationpoint',defaultVal=1)
!--------------------------------------------------------------------------------------------------
! general discretization
microstructureAt = microstructureAt(product(grid(1:2))*grid3Offset+1: &
@ -110,6 +118,7 @@ subroutine discretization_grid_init(restart)
call results_addAttribute('origin',origin, 'geometry')
call results_closeJobFile
endif
!--------------------------------------------------------------------------------------------------
! geometry information required by the nonlocal CP model
call geometry_plastic_nonlocal_setIPvolume(reshape([(product(mySize/real(myGrid,pReal)),j=1,product(myGrid))], &
@ -120,8 +129,8 @@ subroutine discretization_grid_init(restart)
!--------------------------------------------------------------------------------------------------
! sanity checks for debugging
if (debug_e < 1 .or. debug_e > product(myGrid)) call IO_error(602,ext_msg='element') ! selected element does not exist
if (debug_i /= 1) call IO_error(602,ext_msg='IP') ! selected IP does not exist
if (debug_element < 1 .or. debug_element > product(myGrid)) call IO_error(602,ext_msg='element') ! selected element does not exist
if (debug_ip /= 1) call IO_error(602,ext_msg='IP') ! selected IP does not exist
end subroutine discretization_grid_init

Some files were not shown because too many files have changed in this diff Show More