Skip to content

Commit ff1382d

Browse files
committed
Avoid using ICSD cif files in unit tests.
1 parent 163c4b3 commit ff1382d

File tree

5 files changed

+189
-183
lines changed

5 files changed

+189
-183
lines changed

src/tests/TestObjCrystStructureAdapter.hpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class TestObjCrystStructureAdapter : public CxxTest::TestSuite
102102
}
103103
if (!m_catio3.get())
104104
{
105-
mcryst_catio3.reset(loadTestCrystal("icsd_62149.cif"));
105+
mcryst_catio3.reset(loadTestCrystal("CaTiO3.cif"));
106106
m_catio3 = createStructureAdapter(*mcryst_catio3);
107107
}
108108
}
@@ -135,17 +135,17 @@ class TestObjCrystStructureAdapter : public CxxTest::TestSuite
135135
const double eps = 1.0e-7;
136136
TS_ASSERT_DELTA(0.0914114, m_ni->numberDensity(), eps);
137137
TS_ASSERT_DELTA(0.0335565, m_kbise->numberDensity(), eps);
138-
TS_ASSERT_DELTA(0.0894126, m_catio3->numberDensity(), eps);
138+
TS_ASSERT_DELTA(0.0894566, m_catio3->numberDensity(), eps);
139139
}
140140

141141

142142
void test_siteCartesianPosition()
143143
{
144144
const double eps = 1.0e-5;
145-
R3::Vector rCa = m_catio3->siteCartesianPosition(0);
146-
TS_ASSERT_DELTA(-0.03637, rCa[0], eps);
147-
TS_ASSERT_DELTA(0.19603, rCa[1], eps);
148-
TS_ASSERT_DELTA(1.91003, rCa[2], eps);
145+
R3::Vector rCa = m_catio3->siteCartesianPosition(1);
146+
TS_ASSERT_DELTA(0.03486, rCa[0], eps);
147+
TS_ASSERT_DELTA(0.19366, rCa[1], eps);
148+
TS_ASSERT_DELTA(1.90975, rCa[2], eps);
149149
}
150150

151151

@@ -171,17 +171,17 @@ class TestObjCrystStructureAdapter : public CxxTest::TestSuite
171171
TS_ASSERT_EQUALS(0.0, puij[i]);
172172
}
173173
// check CaTiO3 values
174-
const R3::Matrix& UTi = m_catio3->siteCartesianUij(1);
174+
const R3::Matrix& UO2 = m_catio3->siteCartesianUij(3);
175175
const double eps = 1e-8;
176-
TS_ASSERT_DELTA(0.0052, UTi(0,0), eps);
177-
TS_ASSERT_DELTA(0.0049, UTi(1,1), eps);
178-
TS_ASSERT_DELTA(0.0049, UTi(2,2), eps);
179-
TS_ASSERT_DELTA(0.00016, UTi(0,1), eps);
180-
TS_ASSERT_DELTA(0.00016, UTi(1,0), eps);
181-
TS_ASSERT_DELTA(0.00001, UTi(0,2), eps);
182-
TS_ASSERT_DELTA(0.00001, UTi(2,0), eps);
183-
TS_ASSERT_DELTA(0.00021, UTi(1,2), eps);
184-
TS_ASSERT_DELTA(0.00021, UTi(2,1), eps);
176+
TS_ASSERT_DELTA(0.0065, UO2(0,0), eps);
177+
TS_ASSERT_DELTA(0.0060, UO2(1,1), eps);
178+
TS_ASSERT_DELTA(0.0095, UO2(2,2), eps);
179+
TS_ASSERT_DELTA(0.0020, UO2(0,1), eps);
180+
TS_ASSERT_DELTA(0.0020, UO2(1,0), eps);
181+
TS_ASSERT_DELTA(-0.0008, UO2(0,2), eps);
182+
TS_ASSERT_DELTA(-0.0008, UO2(2,0), eps);
183+
TS_ASSERT_DELTA(-0.0010, UO2(1,2), eps);
184+
TS_ASSERT_DELTA(-0.0010, UO2(2,1), eps);
185185
}
186186

187187

src/tests/TestPeriodicStructureAdapter.hpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class TestPeriodicStructureAdapter : public CxxTest::TestSuite
9393
}
9494
if (!m_catio3)
9595
{
96-
m_catio3 = loadTestPeriodicStructure("icsd_62149.stru");
96+
m_catio3 = loadTestPeriodicStructure("CaTiO3.stru");
9797
}
9898
if (!m_pswt)
9999
{
@@ -133,18 +133,18 @@ class TestPeriodicStructureAdapter : public CxxTest::TestSuite
133133
const double eps = 1.0e-7;
134134
TS_ASSERT_DELTA(0.0914114, m_ni->numberDensity(), eps);
135135
TS_ASSERT_DELTA(0.0335565, m_kbise->numberDensity(), eps);
136-
TS_ASSERT_DELTA(0.0894126, m_catio3->numberDensity(), eps);
136+
TS_ASSERT_DELTA(0.0894566, m_catio3->numberDensity(), eps);
137137
TS_ASSERT_DELTA(0.0760332, m_pswt->numberDensity(), eps);
138138
}
139139

140140

141141
void test_siteCartesianPosition()
142142
{
143143
const double eps = 1.0e-5;
144-
R3::Vector rCa = m_catio3->siteCartesianPosition(0);
145-
TS_ASSERT_DELTA(2.72617, rCa[0], eps);
146-
TS_ASSERT_DELTA(2.91718, rCa[1], eps);
147-
TS_ASSERT_DELTA(1.91003, rCa[2], eps);
144+
R3::Vector rCa = m_catio3->siteCartesianPosition(4);
145+
TS_ASSERT_DELTA(0.03486, rCa[0], eps);
146+
TS_ASSERT_DELTA(0.19366, rCa[1], eps);
147+
TS_ASSERT_DELTA(1.90975, rCa[2], eps);
148148
}
149149

150150

@@ -166,17 +166,17 @@ class TestPeriodicStructureAdapter : public CxxTest::TestSuite
166166
// nickel should have all Uij equal zero.
167167
TS_ASSERT_EQUALS(R3::zeromatrix(), m_ni->siteCartesianUij(0));
168168
// check CaTiO3 values
169-
const R3::Matrix& UTi = m_catio3->siteCartesianUij(7);
169+
const R3::Matrix& UO2 = m_catio3->siteCartesianUij(12);
170170
const double eps = 1e-8;
171-
TS_ASSERT_DELTA(0.0052, UTi(0,0), eps);
172-
TS_ASSERT_DELTA(0.0049, UTi(1,1), eps);
173-
TS_ASSERT_DELTA(0.0049, UTi(2,2), eps);
174-
TS_ASSERT_DELTA(0.00016, UTi(0,1), eps);
175-
TS_ASSERT_DELTA(0.00016, UTi(1,0), eps);
176-
TS_ASSERT_DELTA(0.00001, UTi(0,2), eps);
177-
TS_ASSERT_DELTA(0.00001, UTi(2,0), eps);
178-
TS_ASSERT_DELTA(0.00021, UTi(1,2), eps);
179-
TS_ASSERT_DELTA(0.00021, UTi(2,1), eps);
171+
TS_ASSERT_DELTA(0.0065, UO2(0,0), eps);
172+
TS_ASSERT_DELTA(0.0060, UO2(1,1), eps);
173+
TS_ASSERT_DELTA(0.0095, UO2(2,2), eps);
174+
TS_ASSERT_DELTA(0.0020, UO2(0,1), eps);
175+
TS_ASSERT_DELTA(0.0020, UO2(1,0), eps);
176+
TS_ASSERT_DELTA(-0.0008, UO2(0,2), eps);
177+
TS_ASSERT_DELTA(-0.0008, UO2(2,0), eps);
178+
TS_ASSERT_DELTA(-0.0010, UO2(1,2), eps);
179+
TS_ASSERT_DELTA(-0.0010, UO2(2,1), eps);
180180
}
181181

182182

src/tests/testdata/CaTiO3.cif

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#------------------------------------------------------------------------------
2+
#$Date: 2013-03-28 16:17:04 +0000 (Thu, 28 Mar 2013) $
3+
#$Revision: 77586 $
4+
#$URL: file:///home/coder/svn-repositories/cod/cif/1/00/00/1000022.cif $
5+
#------------------------------------------------------------------------------
6+
#
7+
# This file is available in the Crystallography Open Database (COD),
8+
# http://www.crystallography.net/
9+
#
10+
# All data on this site have been placed in the public domain by the
11+
# contributors.
12+
#
13+
##data_calcium titanate
14+
data_1000022
15+
loop_
16+
_publ_author_name
17+
'Beran, A'
18+
'Libowitzky, E'
19+
'Armbruster, T'
20+
_publ_section_title
21+
;
22+
A single-crystal infrared spectroscopic and X-ray diffraction study of
23+
untwinned San Benito perovskite containing O H groups
24+
;
25+
_journal_coden_ASTM CAMIA6
26+
_journal_name_full 'Canadian Mineralogist'
27+
_journal_page_first 803
28+
_journal_page_last 809
29+
_journal_volume 34
30+
_journal_year 1996
31+
_chemical_compound_source
32+
;
33+
from Benitoite Gem mine, San Benito Co., California,USA
34+
;
35+
_chemical_formula_structural 'Ca (Ti O3)'
36+
_chemical_formula_sum 'Ca O3 Ti'
37+
_chemical_name_mineral Perovskite
38+
_chemical_name_systematic 'Calcium titanate'
39+
_symmetry_cell_setting orthorhombic
40+
_symmetry_Int_Tables_number 62
41+
_symmetry_space_group_name_H-M 'P b n m'
42+
_cell_angle_alpha 90
43+
_cell_angle_beta 90
44+
_cell_angle_gamma 90
45+
_cell_formula_units_Z 4
46+
_cell_length_a 5.380(1)
47+
_cell_length_b 5.440(1)
48+
_cell_length_c 7.639(1)
49+
_cell_volume 223.6
50+
_exptl_crystal_density_meas 4.03
51+
_refine_ls_R_factor_all 0.027
52+
_cod_database_code 1000022
53+
loop_
54+
_symmetry_equiv_pos_as_xyz
55+
x,y,z
56+
1/2-x,1/2+y,1/2-z
57+
-x,-y,1/2+z
58+
1/2+x,1/2-y,-z
59+
-x,-y,-z
60+
1/2+x,1/2-y,1/2+z
61+
x,y,1/2-z
62+
1/2-x,1/2+y,z
63+
loop_
64+
_atom_site_aniso_label
65+
_atom_site_aniso_U_11
66+
_atom_site_aniso_U_12
67+
_atom_site_aniso_U_13
68+
_atom_site_aniso_U_22
69+
_atom_site_aniso_U_23
70+
_atom_site_aniso_U_33
71+
Ti1 0.0059(2) .0000(1) .0000(1) 0.0052(2) 0.00025(9) 0.0045(2)
72+
Ca1 0.0082(2) 0.0016(2) 0. 0.0083(2) 0. 0.0079(2)
73+
O1 0.0082(6) 0.0002(5) 0. 0.0086(7) 0. 0.0045(5)
74+
O2 0.0065(4) 0.0020(4) -0.0008(3) 0.0060(4) -0.0010(3) 0.0095(4)
75+
loop_
76+
_atom_site_label
77+
_atom_site_type_symbol
78+
_atom_site_symmetry_multiplicity
79+
_atom_site_Wyckoff_symbol
80+
_atom_site_fract_x
81+
_atom_site_fract_y
82+
_atom_site_fract_z
83+
_atom_site_occupancy
84+
_atom_site_attached_hydrogens
85+
_atom_site_calc_flag
86+
Ti1 Ti4+ 4 b 0. 0.5 0. 1. 0 d
87+
Ca1 Ca2+ 4 c 0.00648(8) 0.0356(1) 0.25 1. 0 d
88+
O1 O2- 4 c 0.5711(3) -0.0161(3) 0.25 1. 0 d
89+
O2 O2- 8 d 0.2897(2) 0.2888(2) 0.0373(2) 1. 0 d
90+
loop_
91+
_atom_type_symbol
92+
_atom_type_oxidation_number
93+
Ti4+ 4.000
94+
Ca2+ 2.000
95+
O2- -2.000

0 commit comments

Comments
 (0)