9#include <boost/algorithm/string/join.hpp>
10#include <boost/python/class.hpp>
11#include <boost/python/make_constructor.hpp>
12#include <boost/python/register_ptr_to_python.hpp>
20 return std::const_pointer_cast<SpaceGroup>(self.
spaceGroup());
26 std::vector<std::string> scattererStrings;
27 scattererStrings.reserve(scatterers->nScatterers());
29 for (
size_t i = 0; i < scatterers->nScatterers(); ++i) {
33 return scattererStrings;
40 ss <<
"Crystal structure with:\n";
43 const auto cell = self.
cell();
44 ss <<
" a = " << cell.
a();
45 ss <<
" b = " << cell.b();
46 ss <<
" c = " << cell.c();
48 ss <<
" alpha = " << cell.alpha();
49 ss <<
" beta = " << cell.beta();
50 ss <<
" gamma = " << cell.gamma();
54 ss <<
"Centering: " << self.
centering()->getName() <<
"\n";
55 ss <<
"Space Group: " << self.
spaceGroup()->hmSymbol() <<
"\n";
56 ss <<
"Scatterers: " << boost::algorithm::join(getScatterers(self),
", ");
63 ss <<
"CrystalStructure(\"";
65 const auto cell = self.
cell();
67 ss << cell.
a() <<
" ";
68 ss << cell.b() <<
" ";
69 ss << cell.c() <<
" ";
71 ss << cell.alpha() <<
" ";
72 ss << cell.beta() <<
" ";
76 ss <<
"\"" << self.
spaceGroup()->hmSymbol() <<
"\", ";
77 ss <<
"\"" << boost::algorithm::join(getScatterers(self),
"; ") <<
"\"";
86 class_<CrystalStructure>(
"CrystalStructure", no_init)
87 .def(init<const std::string &, const std::string &, const std::string &>(
88 (arg(
"unitCell"), arg(
"spaceGroup"), arg(
"scatterers"))))
89 .def(
"getUnitCell", &getCell, arg(
"self"))
90 .def(
"getSpaceGroup", &getSpaceGroup, arg(
"self"))
91 .def(
"getScatterers", &getScatterers, arg(
"self"))
92 .def(
"__str__", &__str__implementation)
93 .def(
"__repr__", &__repr__implementation);
void export_CrystalStructure()
Three components are required to describe a crystal structure:
CompositeBraggScatterer_sptr getScatterers() const
Return a clone of the internal CompositeBraggScatterer instance.
ReflectionCondition_sptr centering() const
SpaceGroup_const_sptr spaceGroup() const
Returns the space group of the crystal structure.
UnitCell const & cell() const &
Class to implement unit cell of crystals.
double a(int nd) const
Get lattice parameter a1-a3 as function of index (0-2)
MANTID_GEOMETRY_DLL std::string getIsotropicAtomBraggScattererString(const BraggScatterer_sptr &scatterer)
std::shared_ptr< SpaceGroup > SpaceGroup_sptr