Commit c767e89a by Maarten L. Hekkelman

Fixed symmetry operator table generator

parent b78a603d
......@@ -25,7 +25,7 @@
cmake_minimum_required(VERSION 3.16)
# set the project name
project(cifpp VERSION 2.0.0 LANGUAGES CXX)
project(cifpp VERSION 2.0.1 LANGUAGES CXX)
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
......
Version 2.0.1
- Fixed the generator for the symmetry operator table
Version 2.0.0
- New API interface for accessing query results
- Removed bzip2 support
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -181,6 +181,50 @@ class SymopParser
int m_trn[3][2] = {};
};
std::array<int,15> move_symop(std::array<int,15> symop, const std::array<int,15>& cenop)
{
for (int i = 9; i < 15; i += 2)
{
if (cenop[i] == 0)
continue;
assert(cenop[i + 1] != 0);
if (symop[i] == 0)
{
assert(symop[i + 1] == 0);
symop[i] = cenop[i];
symop[i + 1] = cenop[i + 1];
continue;
}
if (symop[i + 1] == cenop[i + 1])
symop[i] += cenop[i];
else
{
int d = symop[i + 1] * cenop[i + 1];
int n = symop[i] * cenop[i + 1] + symop[i + 1] * cenop[i];
symop[i] = n;
symop[i + 1] = d;
}
for (int j = 5; j > 1; --j)
if (symop[i] % j == 0 and symop[i + 1] % j == 0)
{
symop[i] /= j;
symop[i + 1] /= j;
}
symop[i] = (symop[i] + symop[i + 1]) % symop[i + 1];
if (symop[i] == 0)
symop[i + 1] = 0;
}
return symop;
}
int main(int argc, char* const argv[])
{
using namespace std::literals;
......@@ -225,7 +269,6 @@ int main(int argc, char* const argv[])
if (not out.is_open())
throw std::runtime_error("Failed to open output file");
// --------------------------------------------------------------------
// store symop data here
......@@ -311,8 +354,7 @@ int main(int argc, char* const argv[])
{
for (auto symop: symops)
{
for (size_t i = 9; i < 15; ++i)
symop[i] += cenop[i];
symop = move_symop(symop, cenop);
data.emplace_back(cur.nr, symopnr, symop);
++symopnr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment