Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
Takin
mag-core
Commits
e7365e45
Verified
Commit
e7365e45
authored
Jun 02, 2022
by
Tobias WEBER
Browse files
bz tool: fixed coordinates
parent
c7a5b324
Changes
2
Hide whitespace changes
Inline
Side-by-side
tools/bz/bz.h
View file @
e7365e45
...
...
@@ -117,6 +117,7 @@ protected:
t_mat
m_crystB
=
tl2
::
unit
<
t_mat
>
(
3
);
t_mat
m_cut_plane
=
tl2
::
unit
<
t_mat
>
(
3
);
t_mat
m_cut_plane_inv
=
tl2
::
unit
<
t_mat
>
(
3
);
t_real
m_cut_norm_scale
=
1.
;
// convert 1/A to rlu lengths along the normal
std
::
vector
<
std
::
vector
<
t_mat
>>
m_SGops
;
...
...
tools/bz/bz_calc.cpp
View file @
e7365e45
...
...
@@ -240,12 +240,15 @@ void BZDlg::CalcBZCut()
t_real
nx
=
m_cutNX
->
value
();
t_real
ny
=
m_cutNY
->
value
();
t_real
nz
=
m_cutNZ
->
value
();
t_real
d
=
m_cutD
->
value
();
t_real
d
_rlu
=
m_cutD
->
value
();
// get plane coordinate system
t_vec
vec1
=
tl2
::
create
<
t_vec
>
({
x
,
y
,
z
});
t_vec
vec1
=
m_crystB
*
tl2
::
create
<
t_vec
>
({
x
,
y
,
z
});
t_vec
norm
=
tl2
::
create
<
t_vec
>
({
nx
,
ny
,
nz
});
norm
/=
tl2
::
norm
<
t_vec
>
(
norm
);
norm
=
m_crystB
*
norm
/
tl2
::
norm
<
t_vec
>
(
norm
);
m_cut_norm_scale
=
tl2
::
norm
<
t_vec
>
(
norm
);
norm
/=
m_cut_norm_scale
;
t_real
d_invA
=
d_rlu
*
m_cut_norm_scale
;
t_vec
vec2
=
tl2
::
cross
<
t_vec
>
(
norm
,
vec1
);
vec1
=
tl2
::
cross
<
t_vec
>
(
vec2
,
norm
);
...
...
@@ -284,7 +287,7 @@ void BZDlg::CalcBZCut()
vec
+=
Q_invA
;
auto
vecs
=
tl2
::
intersect_plane_poly
<
t_vec
>
(
norm
,
d
,
bz_poly
,
g_eps
);
norm
,
d
_invA
,
bz_poly
,
g_eps
);
vecs
=
tl2
::
remove_duplicates
(
vecs
,
g_eps
);
if
(
vecs
.
size
()
>=
2
)
...
...
@@ -317,7 +320,7 @@ void BZDlg::CalcBZCut()
}
m_descrBZCut
=
ostr
.
str
();
PlotSetPlane
(
norm
,
d
);
PlotSetPlane
(
norm
,
d
_invA
);
UpdateBZDescription
();
}
...
...
@@ -327,7 +330,8 @@ void BZDlg::CalcBZCut()
*/
void
BZDlg
::
BZCutMouseMoved
(
t_real
x
,
t_real
y
)
{
t_real
d
=
m_cutD
->
value
();
t_real
d
=
m_cutD
->
value
()
*
m_cut_norm_scale
;
t_vec
QinvA
=
m_cut_plane
*
tl2
::
create
<
t_vec
>
({
x
,
y
,
d
});
t_mat
B_inv
=
m_crystA
/
(
t_real
(
2
)
*
tl2
::
pi
<
t_real
>
);
t_vec
Qrlu
=
B_inv
*
QinvA
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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