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
6044d3dc
Unverified
Commit
6044d3dc
authored
Oct 19, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added cif::cell::get_volume()
parent
29446f21
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
2 deletions
+31
-2
changelog
+1
-0
include/cif++/symmetry.hpp
+2
-0
src/symmetry.cpp
+16
-0
test/.1juh.cif.gz.swp
+0
-0
test/unit-3d-test.cpp
+12
-2
No files found.
changelog
View file @
6044d3dc
Version
5.2.3
Version
5.2.3
-
New
constructors
for
cif
::
item
,
one
taking
std
::
optional
values
-
New
constructors
for
cif
::
item
,
one
taking
std
::
optional
values
and
another
taking
only
a
name
resulting
in
a
value
'.'
(
i
.
e
.
inapplicable
).
and
another
taking
only
a
name
resulting
in
a
value
'.'
(
i
.
e
.
inapplicable
).
-
added
cif
::
cell
::
get_volume
Version
5.2.2
Version
5.2.2
-
Remove
dependency
on
Eigen3
for
users
of
libcifpp
-
Remove
dependency
on
Eigen3
for
users
of
libcifpp
...
...
include/cif++/symmetry.hpp
View file @
6044d3dc
...
@@ -397,6 +397,8 @@ class cell
...
@@ -397,6 +397,8 @@ class cell
float
get_beta
()
const
{
return
m_beta
;
}
///< return angle beta
float
get_beta
()
const
{
return
m_beta
;
}
///< return angle beta
float
get_gamma
()
const
{
return
m_gamma
;
}
///< return angle gamma
float
get_gamma
()
const
{
return
m_gamma
;
}
///< return angle gamma
float
get_volume
()
const
;
///< return the calculated volume for this cell
matrix3x3
<
float
>
get_orthogonal_matrix
()
const
{
return
m_orthogonal
;
}
///< return the matrix to use to transform coordinates from fractional to orthogonal
matrix3x3
<
float
>
get_orthogonal_matrix
()
const
{
return
m_orthogonal
;
}
///< return the matrix to use to transform coordinates from fractional to orthogonal
matrix3x3
<
float
>
get_fractional_matrix
()
const
{
return
m_fractional
;
}
///< return the matrix to use to transform coordinates from orthogonal to fractional
matrix3x3
<
float
>
get_fractional_matrix
()
const
{
return
m_fractional
;
}
///< return the matrix to use to transform coordinates from orthogonal to fractional
...
...
src/symmetry.cpp
View file @
6044d3dc
...
@@ -80,6 +80,22 @@ void cell::init()
...
@@ -80,6 +80,22 @@ void cell::init()
m_fractional
=
inverse
(
m_orthogonal
);
m_fractional
=
inverse
(
m_orthogonal
);
}
}
float
cell
::
get_volume
()
const
{
auto
alpha
=
(
m_alpha
*
kPI
)
/
180
;
auto
beta
=
(
m_beta
*
kPI
)
/
180
;
auto
gamma
=
(
m_gamma
*
kPI
)
/
180
;
auto
cos_alpha
=
std
::
cos
(
alpha
);
auto
cos_beta
=
std
::
cos
(
beta
);
auto
cos_gamma
=
std
::
cos
(
gamma
);
auto
vol
=
m_a
*
m_b
*
m_c
;
vol
*=
std
::
sqrt
(
1.0
f
-
cos_alpha
*
cos_alpha
-
cos_beta
*
cos_beta
-
cos_gamma
*
cos_gamma
+
2.0
f
*
cos_alpha
*
cos_beta
*
cos_gamma
);
return
vol
;
}
// --------------------------------------------------------------------
// --------------------------------------------------------------------
sym_op
::
sym_op
(
std
::
string_view
s
)
sym_op
::
sym_op
(
std
::
string_view
s
)
...
...
test/.1juh.cif.gz.swp
0 → 100644
View file @
6044d3dc
File added
test/unit-3d-test.cpp
View file @
6044d3dc
...
@@ -565,8 +565,6 @@ BOOST_AUTO_TEST_CASE(symm_2bi3_1a, *utf::tolerance(0.1f))
...
@@ -565,8 +565,6 @@ BOOST_AUTO_TEST_CASE(symm_2bi3_1a, *utf::tolerance(0.1f))
}
}
}
}
BOOST_AUTO_TEST_CASE
(
symm_3bwh_1
,
*
utf
::
tolerance
(
0.1
f
))
BOOST_AUTO_TEST_CASE
(
symm_3bwh_1
,
*
utf
::
tolerance
(
0.1
f
))
{
{
cif
::
file
f
(
gTestDir
/
"3bwh.cif.gz"
);
cif
::
file
f
(
gTestDir
/
"3bwh.cif.gz"
);
...
@@ -589,3 +587,15 @@ BOOST_AUTO_TEST_CASE(symm_3bwh_1, *utf::tolerance(0.1f))
...
@@ -589,3 +587,15 @@ BOOST_AUTO_TEST_CASE(symm_3bwh_1, *utf::tolerance(0.1f))
}
}
}
}
}
}
BOOST_AUTO_TEST_CASE
(
volume_3bwh_1
,
*
utf
::
tolerance
(
0.1
f
))
{
cif
::
file
f
(
gTestDir
/
"1juh.cif.gz"
);
auto
&
db
=
f
.
front
();
cif
::
crystal
c
(
db
);
BOOST_CHECK_EQUAL
(
c
.
get_cell
().
get_volume
(),
741009.625
f
);
}
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