5#ifndef GEMMI_SMCIF_HPP_
6#define GEMMI_SMCIF_HPP_
24 {
"length_a",
"length_b",
"length_c",
25 "angle_alpha",
"angle_beta",
"angle_gamma"});
29 st.cell.set(as_number(c[0]), as_number(c[1]), as_number(c[2]),
30 as_number(c[3]), as_number(c[4]), as_number(c[5]));
32 for (
const char* tag : {
"_space_group_name_H-M_alt",
33 "_symmetry_space_group_name_H-M"})
34 if (
const std::string* val = block.
find_value(tag)) {
38 for (
const char* tag : {
"_space_group_symop_operation_xyz",
39 "_symmetry_equiv_pos_as_xyz"}) {
41 st.symops.reserve(col.length());
42 for (
const std::string& value : col)
47 for (
const char* tag : {
"_space_group_name_Hall",
"_symmetry_space_group_name_Hall"})
48 if (
const std::string* val = block.
find_value(tag))
50 for (
const char* tag : {
"_space_group_IT_number",
"_symmetry_Int_Tables_number"})
51 if (
const std::string* val = block.
find_value(tag)) {
55 st.determine_and_set_spacegroup(
"S.H2");
94 std::vector<SmallStructure::Site>::iterator
aniso_site =
st.sites.begin();
95 for (
auto row : block.
find(
"_atom_site_aniso_",
96 {
"label",
"U_11",
"U_22",
"U_33",
97 "U_12",
"U_13",
"U_23"})) {
114 for (
auto row : block.
find(
"_atom_type_",
116 "scat_dispersion_real",
117 "scat_dispersion_imag"})) {
123 st.atom_types.push_back(atom_type);
133 if (
st.cell.is_crystal()) {
141 if (!
st.spacegroup_hm.empty())
143 if (
st.wavelength != 0)
157 site.type_symbol.empty() ?
site.element_and_charge_symbol()
164 site.disorder_group == 0 ?
"." : std::to_string(
site.disorder_group)
170 if (
site.aniso.nonzero()) {
176 "label",
"U_11",
"U_22",
"U_33",
"U_12",
"U_13",
"U_23"});
178 if (
site.aniso.nonzero())
struct Document that represents the CIF file (but can also be read from a different representation,...
double as_number(const std::string &s, double nan=NAN)
std::string as_string(const std::string &value)
bool is_null(const std::string &value)
std::string quote(std::string v)
int as_int(const std::string &str)
int string_to_int(const char *p, bool checked, size_t length=0)
void split_element_and_charge(const std::string &label, T *dest)
SmallStructure make_small_structure_from_block(const cif::Block &block_)
cif::Block make_cif_block_from_small_structure(const SmallStructure &st)
GEMMI_DLL int GEMMI_DLL int std::string to_str(double d)
constexpr double u_to_b()
Utilities for parsing CIF numbers (the CIF spec calls them 'numb').
Representation of a small molecule or inorganic crystal. Flat list of atom sites. Minimal functionali...
interface to stb_sprintf: snprintf_z, to_str(float|double)
Column find_values(const std::string &tag)
Table find(const std::string &prefix, const std::vector< std::string > &tags)
void set_pair(const std::string &tag, const std::string &value)
Loop & init_loop(const std::string &prefix, std::vector< std::string > tags)
const std::string * find_value(const std::string &tag) const