Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
qbox-public
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
qbox
qbox-public
Commits
0d593a29
Commit
0d593a29
authored
Jan 26, 2018
by
Francois Gygi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup files in test/stress dir
parent
9c5654fb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
16 deletions
+17
-16
README
test/stress/README
+1
-1
check_stress.sh
test/stress/check_stress.sh
+11
-11
gs.i
test/stress/gs.i
+2
-1
gs_offdiag.i
test/stress/gs_offdiag.i
+3
-3
No files found.
test/stress/README
View file @
0d593a29
...
...
@@ -2,7 +2,7 @@
Test of the accuracy of the stress tensor
--------------------------------------------------------------------------------
Notes:
- To change the choice of xc, ecut, ecuts, edit the file params.i
- To change the choice of xc, ecut, ecuts, edit the file params.i
- In order to test off-diagonal elements of the stress tensor,
the starting unit cell in gs.i is distorted arbitrarily.
--------------------------------------------------------------------------------
test/stress/check_stress.sh
View file @
0d593a29
#!/bin/bash
#
# Test the accuracy of the computed stress tensor by comparing it with a
# Test the accuracy of the computed stress tensor by comparing it with a
# finite difference calculation of dE=tr(u*sigma)
#
# use: ./check_stress.sh [energy_term sigma_name] file.r
# If energy_term and sigma_name are not specified,
# the terms ekin, eps,
# If energy_term and sigma_name are not specified,
# the terms ekin, eps,
# example: ./check_stress.sh ekin sigma_ekin gs.r
#
# The output file file.r must contain the following sequence
...
...
@@ -29,11 +29,11 @@ function check_stress_term
file
=
$3
echo
$eterm
$sigma_name
# read volume
volume
=
$(
grep
'<unit_cell_volume>'
$file
| awk
'{print $2}'
)
echo
volume:
$volume
# compute energy difference E(+u)-E(-u)
ep
=
$(
grep
'<'
$eterm
'>'
$file
| awk
'NR==2 {print $2}'
)
em
=
$(
grep
'<'
$eterm
'>'
$file
| awk
'NR==3 {print $2}'
)
...
...
@@ -41,8 +41,8 @@ function check_stress_term
echo
em:
$em
de
=
$(
echo
"
$ep
-
$em
"
| bc
-l
)
echo
de:
$de
# read strain
# read strain
u
=
$(
grep
'<cmd>'
$file
|
grep
strain | head
-1
|
\
sed
"s/<cmd>//"
| sed
"s/<
\/
cmd>//"
| sed
"s/
\[
qbox
\]
//"
| sed
"s/strain//"
)
# echo $u
...
...
@@ -54,7 +54,7 @@ function check_stress_term
uyz
=
$(
echo
${
strain
[4]
})
uxz
=
$(
echo
${
strain
[5]
})
echo
strain:
$uxx
$uyy
$uzz
$uxy
$uyz
$uxz
# read computed stress tensor
sxx
=
$(
grep
'<'
${
sigma_name
}
_xx
'>'
$file
|head
-1
| awk
'{print $2}'
)
syy
=
$(
grep
'<'
${
sigma_name
}
_yy
'>'
$file
|head
-1
| awk
'{print $2}'
)
...
...
@@ -63,19 +63,19 @@ function check_stress_term
syz
=
$(
grep
'<'
${
sigma_name
}
_yz
'>'
$file
|head
-1
| awk
'{print $2}'
)
sxz
=
$(
grep
'<'
${
sigma_name
}
_xz
'>'
$file
|head
-1
| awk
'{print $2}'
)
echo
stress:
$sxx
$syy
$szz
$sxy
$syz
$sxz
# compute energy change from 2 * volume * tr(sigma*u)
de_comp
=
$(
echo
"-2.0 *
$volume
* (
$uxx
*
$sxx
+
$uyy
*
$syy
+
$uzz
*
$szz
+
\
2.0 * (
$uxy
*
$sxy
+
$uyz
*
$syz
+
$uxz
*
$sxz
) )"
| bc
-l
)
printf
"E(+u)-E(-u): %15.6e
\n
"
$de
printf
"2*v*tr(sigma*u): %15.6e
\n
"
$de_comp
# compute absolute error
abs_err
=
$(
echo
"
$de
-
$de_comp
"
| bc
-l
)
printf
"abs error: %15.6e
\n
"
$abs_err
rel_err
=
$(
echo
"
$abs_err
/
$de
"
| bc
-l
)
printf
"rel error: %15.6e
\n
"
$rel_err
echo
"==============================================================="
}
...
...
test/stress/gs.i
View file @
0d593a29
...
...
@@ -6,7 +6,8 @@ atom Si1 silicon 3.700 -0.100 0.300
atom Si2 silicon -0.100 2.800 -0.200
atom Si3 silicon -3.700 0.100 0.300
atom Si4 silicon -0.100 -2.800 -0.200
strain 0.02 0.04 0.06 0.03 0.05 0.07
#strain 0.02 0.04 0.06 0.03 0.05 0.07
strain 0.0 0.0 0.0 0.00 0.0 0.0
params.i
set wf_dyn PSDA
set stress ON
...
...
test/stress/gs_offdiag.i
View file @
0d593a29
...
...
@@ -5,8 +5,8 @@ set stress ON
set debug STRESS
run 0
set wf_dyn LOCKED
strain 0 0 0 0.00
1 0.002 -0.001
strain 0 0 0 0.00
05 0.000 0.000
run 0
strain -inverse 0 0 0 0.00
1 0.002 -0.001
strain -inverse 0 0 0 0.00
1 0.002 -0.001
strain -inverse 0 0 0 0.00
05 0.000 0.000
strain -inverse 0 0 0 0.00
05 0.000 0.000
run 0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment