Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
0b0d170c
Unverified
Commit
0b0d170c
authored
Apr 19, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a bit of documentation
parent
1e8e9adf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
6 deletions
+25
-6
include/cif++/symmetry.hpp
+22
-2
src/symmetry.cpp
+3
-4
No files found.
include/cif++/symmetry.hpp
View file @
0b0d170c
...
@@ -34,6 +34,10 @@
...
@@ -34,6 +34,10 @@
#include <cstdint>
#include <cstdint>
#include <string>
#include <string>
/// \file cif++/symmetry.hpp
/// This file contains code to do symmetry operations based on the
/// operations as specified in the International Tables.
namespace
cif
namespace
cif
{
{
...
@@ -265,7 +269,7 @@ class transformation
...
@@ -265,7 +269,7 @@ class transformation
transformation
&
operator
=
(
const
transformation
&
)
=
default
;
transformation
&
operator
=
(
const
transformation
&
)
=
default
;
transformation
&
operator
=
(
transformation
&&
)
=
default
;
transformation
&
operator
=
(
transformation
&&
)
=
default
;
point
operator
()(
const
cell
&
c
,
const
point
&
pt
)
const
;
//
point operator()(const cell &c, const point &pt) const;
point
operator
()(
const
point
&
pt
)
const
point
operator
()(
const
point
&
pt
)
const
{
{
...
@@ -275,6 +279,11 @@ class transformation
...
@@ -275,6 +279,11 @@ class transformation
friend
transformation
operator
*
(
const
transformation
&
lhs
,
const
transformation
&
rhs
);
friend
transformation
operator
*
(
const
transformation
&
lhs
,
const
transformation
&
rhs
);
friend
transformation
inverse
(
const
transformation
&
t
);
friend
transformation
inverse
(
const
transformation
&
t
);
transformation
operator
-
()
const
{
return
inverse
(
*
this
);
}
friend
class
spacegroup
;
friend
class
spacegroup
;
private
:
private
:
...
@@ -354,12 +363,23 @@ inline transformation fractional(const transformation &t, const cell &c)
...
@@ -354,12 +363,23 @@ inline transformation fractional(const transformation &t, const cell &c)
// --------------------------------------------------------------------
// --------------------------------------------------------------------
/// @brief Return the symmetry copy of a point based on spacegroup \a sg, cell \a c and symmetry operation \a symop
/// @param pt The point to transform
/// @param sg The spacegroup
/// @param c The cell
/// @param symop The symmetry operation
/// @return Newly calculated point
inline
point
symmetry_copy
(
const
point
&
pt
,
const
spacegroup
&
sg
,
const
cell
&
c
,
sym_op
symop
)
inline
point
symmetry_copy
(
const
point
&
pt
,
const
spacegroup
&
sg
,
const
cell
&
c
,
sym_op
symop
)
{
{
return
sg
(
pt
,
c
,
symop
);
return
sg
(
pt
,
c
,
symop
);
}
}
/// @brief Return the point and symmetry operation required to move point \a b as close as possible to point \a a
/// @param sg The spacegroup
/// @param c The cell
/// @param a The point that acts as reference
/// @param b The point that needs to be moved
/// @return The calculated distance between the new point and \a a plus the symmetry operation required to operate on \a b
std
::
tuple
<
float
,
point
,
sym_op
>
closest_symmetry_copy
(
const
spacegroup
&
sg
,
const
cell
&
c
,
point
a
,
point
b
);
std
::
tuple
<
float
,
point
,
sym_op
>
closest_symmetry_copy
(
const
spacegroup
&
sg
,
const
cell
&
c
,
point
a
,
point
b
);
}
// namespace cif
}
// namespace cif
src/symmetry.cpp
View file @
0b0d170c
...
@@ -85,8 +85,7 @@ sym_op::sym_op(std::string_view s)
...
@@ -85,8 +85,7 @@ sym_op::sym_op(std::string_view s)
auto
b
=
s
.
data
();
auto
b
=
s
.
data
();
auto
e
=
b
+
s
.
length
();
auto
e
=
b
+
s
.
length
();
int
rnri
;
int
rnri
=
256
;
// default to unexisting number
auto
r
=
std
::
from_chars
(
b
,
e
,
rnri
);
auto
r
=
std
::
from_chars
(
b
,
e
,
rnri
);
m_nr
=
rnri
;
m_nr
=
rnri
;
...
@@ -259,12 +258,12 @@ point spacegroup::inverse(const point &pt, const cell &c, sym_op symop) const
...
@@ -259,12 +258,12 @@ point spacegroup::inverse(const point &pt, const cell &c, sym_op symop) const
t
.
m_translation
.
m_y
+=
symop
.
m_tb
-
5
;
t
.
m_translation
.
m_y
+=
symop
.
m_tb
-
5
;
t
.
m_translation
.
m_z
+=
symop
.
m_tc
-
5
;
t
.
m_translation
.
m_z
+=
symop
.
m_tc
-
5
;
auto
it
=
cif
::
inverse
(
t
);
auto
fpt
=
fractional
(
pt
,
c
);
auto
fpt
=
fractional
(
pt
,
c
);
auto
o
=
offsetToOriginFractional
(
fpt
);
auto
o
=
offsetToOriginFractional
(
fpt
);
auto
it
=
cif
::
inverse
(
t
);
auto
spt
=
it
(
fpt
+
o
)
-
o
;
auto
spt
=
it
(
fpt
+
o
)
-
o
;
return
orthogonal
(
spt
,
c
);
return
orthogonal
(
spt
,
c
);
}
}
...
...
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