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
8f02665e
Unverified
Commit
8f02665e
authored
Feb 22, 2021
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
symop table generator, now requires output argument
parent
8604c3ab
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
73 deletions
+17
-73
GNUmakefile.in
+1
-1
tools/symop-map-generator.cpp
+16
-72
No files found.
GNUmakefile.in
View file @
8f02665e
...
@@ -130,7 +130,7 @@ ifneq "$(CCP4DIR)" ""
...
@@ -130,7 +130,7 @@ ifneq "$(CCP4DIR)" ""
tools/symop-map-generator
:
tools/symop-map-generator.cpp
tools/symop-map-generator
:
tools/symop-map-generator.cpp
src/SymOpTable_data.cpp
:
tools/symop-map-generator $(CLIBD)/symop.lib
src/SymOpTable_data.cpp
:
tools/symop-map-generator $(CLIBD)/symop.lib
tools/symop-map-generator
>
$@
tools/symop-map-generator
$@
$(OBJDIR)/Symmetry.lo
:
src/SymOpTable_data.cpp
$(OBJDIR)/Symmetry.lo
:
src/SymOpTable_data.cpp
...
...
tools/symop-map-generator.cpp
View file @
8f02665e
...
@@ -176,10 +176,17 @@ class SymopParser
...
@@ -176,10 +176,17 @@ class SymopParser
int
m_trn
[
3
][
2
]
=
{};
int
m_trn
[
3
][
2
]
=
{};
};
};
int
main
()
int
main
(
int
argc
,
char
*
const
argv
[]
)
{
{
try
try
{
{
if
(
argc
!=
2
)
throw
std
::
runtime_error
(
"Usage: symom-map-generator <outputfile>"
);
std
::
ofstream
out
(
argv
[
1
]);
if
(
not
out
.
is_open
())
throw
std
::
runtime_error
(
"Failed to open output file"
);
const
char
*
CLIBD
=
getenv
(
"CLIBD"
);
const
char
*
CLIBD
=
getenv
(
"CLIBD"
);
if
(
CLIBD
==
nullptr
)
if
(
CLIBD
==
nullptr
)
...
@@ -291,76 +298,13 @@ int main()
...
@@ -291,76 +298,13 @@ int main()
}
}
}
}
// // --------------------------------------------------------------------
// string line;
// string spacegroupName;
// int spacegroupNr, symopnr;
// enum class State { Initial, InSpacegroup, Error } state = State::Initial;
// while (getline(file, line))
// {
// if (line.empty())
// throw runtime_error("Invalid symop.lib file, contains empty line");
// switch (state)
// {
// case State::Error:
// case State::InSpacegroup:
// if (line[0] == ' ')
// {
// if (state == State::Error)
// continue;
// try
// {
// SymopParser p;
// data.emplace_back(spacegroupNr, symopnr, spacegroupName, p.parse(line));
// ++symopnr;
// }
// catch (const exception& e)
// {
// cerr << line << endl
// << e.what() << endl;
// }
// continue;
// }
// // fall through
// case State::Initial:
// {
// smatch m;
// if (not regex_match(line, m, kNameRx))
// {
// cerr << line << endl;
// throw runtime_error("Name line does not match regular expression");
// }
// spacegroupNr = stoi(m[1]);
// spacegroupName = m[7];
// symopnr = 1;
// if (not symInfo.count(spacegroupNr))
// throw runtime_error("Symmetry nr not found in syminfo.lib");
// if (symInfo[spacegroupNr].xHM != spacegroupName)
// cerr << "Inconsistent data between symop.lib and syminfo.lib for spacegroup nr " << to_string(spacegroupNr) << endl;
// state = State::InSpacegroup;
// break;
// }
// }
// }
// --------------------------------------------------------------------
// --------------------------------------------------------------------
sort
(
data
.
begin
(),
data
.
end
());
sort
(
data
.
begin
(),
data
.
end
());
// --------------------------------------------------------------------
// --------------------------------------------------------------------
c
out
<<
R"(// This file was generated from $CLIBD/symop.lib
out
<<
R"(// This file was generated from $CLIBD/symop.lib
// and $CLIBD/syminfo.lib using symop-map-generator,
// and $CLIBD/syminfo.lib using symop-map-generator,
// part of the PDB-REDO suite of programs.
// part of the PDB-REDO suite of programs.
...
@@ -394,10 +338,10 @@ const Spacegroup kSpaceGroups[] =
...
@@ -394,10 +338,10 @@ const Spacegroup kSpaceGroups[] =
Hall
=
'"'
+
Hall
+
'"'
+
string
(
40
-
Hall
.
length
(),
' '
);
Hall
=
'"'
+
Hall
+
'"'
+
string
(
40
-
Hall
.
length
(),
' '
);
c
out
<<
"
\t
{ "
<<
old
<<
", "
<<
xHM
<<
", "
<<
Hall
<<
", "
<<
nr
<<
" },"
<<
endl
;
out
<<
"
\t
{ "
<<
old
<<
", "
<<
xHM
<<
", "
<<
Hall
<<
", "
<<
nr
<<
" },"
<<
endl
;
}
}
c
out
<<
R"(
out
<<
R"(
};
};
const size_t kNrOfSpaceGroups = sizeof(kSpaceGroups) / sizeof(Spacegroup);
const size_t kNrOfSpaceGroups = sizeof(kSpaceGroups) / sizeof(Spacegroup);
...
@@ -412,17 +356,17 @@ const SymopDataBlock kSymopNrTable[] = {
...
@@ -412,17 +356,17 @@ const SymopDataBlock kSymopNrTable[] = {
tie
(
sp
,
o
,
ignore
)
=
sd
;
tie
(
sp
,
o
,
ignore
)
=
sd
;
if
(
sp
>
spacegroupNr
)
if
(
sp
>
spacegroupNr
)
c
out
<<
" // "
<<
symInfo
[
sp
].
xHM
<<
endl
;
out
<<
" // "
<<
symInfo
[
sp
].
xHM
<<
endl
;
spacegroupNr
=
sp
;
spacegroupNr
=
sp
;
c
out
<<
" { "
<<
setw
(
3
)
<<
sp
out
<<
" { "
<<
setw
(
3
)
<<
sp
<<
", "
<<
setw
(
3
)
<<
o
<<
", { "
;
<<
", "
<<
setw
(
3
)
<<
o
<<
", { "
;
for
(
auto
i
:
get
<
2
>
(
sd
))
for
(
auto
i
:
get
<
2
>
(
sd
))
c
out
<<
setw
(
2
)
<<
i
<<
','
;
out
<<
setw
(
2
)
<<
i
<<
','
;
c
out
<<
" } },"
<<
endl
;
out
<<
" } },"
<<
endl
;
}
}
c
out
<<
R"(};
out
<<
R"(};
const size_t kSymopNrTableSize = sizeof(kSymopNrTable) / sizeof(SymopDataBlock);
const size_t kSymopNrTableSize = sizeof(kSymopNrTable) / sizeof(SymopDataBlock);
...
...
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