Skip to content
Snippets Groups Projects
Commit 39fc02c5 authored by Michael Wedel's avatar Michael Wedel
Browse files

Refs #10900. Updated class- and method documentation in MantidGeometry

parent c0f1bcf8
No related merge requests found
Showing
with 178 additions and 191 deletions
...@@ -15,7 +15,12 @@ namespace Geometry { ...@@ -15,7 +15,12 @@ namespace Geometry {
typedef std::complex<double> StructureFactor; typedef std::complex<double> StructureFactor;
/** BraggScatterer class BraggScatterer;
typedef boost::shared_ptr<BraggScatterer> BraggScatterer_sptr;
/**
@class BraggScatterer
BraggScatterer is a general interface for representing scatterers BraggScatterer is a general interface for representing scatterers
in the unit cell of a periodic structure. Since there are many possibilities in the unit cell of a periodic structure. Since there are many possibilities
...@@ -60,11 +65,6 @@ typedef std::complex<double> StructureFactor; ...@@ -60,11 +65,6 @@ typedef std::complex<double> StructureFactor;
File change history is stored at: <https://github.com/mantidproject/mantid> File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org> Code Documentation is available at: <http://doxygen.mantidproject.org>
*/ */
class BraggScatterer;
typedef boost::shared_ptr<BraggScatterer> BraggScatterer_sptr;
class MANTID_GEOMETRY_DLL BraggScatterer : public Kernel::PropertyManager { class MANTID_GEOMETRY_DLL BraggScatterer : public Kernel::PropertyManager {
public: public:
BraggScatterer(); BraggScatterer();
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
namespace Mantid { namespace Mantid {
namespace Geometry { namespace Geometry {
/** BraggScattererFactory : /**
@class BraggScattererFactory
This class implements a factory for concrete BraggScatterer classes. This class implements a factory for concrete BraggScatterer classes.
When a new scatterer is derived from BraggScatterer, it should be registered When a new scatterer is derived from BraggScatterer, it should be registered
...@@ -21,20 +22,20 @@ namespace Geometry { ...@@ -21,20 +22,20 @@ namespace Geometry {
At runtime, instances of this class can be created like this: At runtime, instances of this class can be created like this:
BraggScatterer_sptr scatterer = BraggScatterer_sptr scatterer =
BraggScattererFactory::Instance().createScatterer("NewScattererClass"); BraggScattererFactory::Instance().createScatterer("NewScattererClass");
The returned object is initialized, which is required for using the The returned object is initialized, which is required for using the
Kernel::Property-based system of setting parameters for the scatterer. Kernel::Property-based system of setting parameters for the scatterer.
To make creation of scatterers more convenient, it's possible to provide To make creation of scatterers more convenient, it's possible to provide
a string with "name=value" pairs, separated by semi-colons, which assigns a string with "name=value" pairs, separated by semi-colons, which assigns
property values. This is similar to the way property values. This is similar to the way
FunctionFactory::createInitialized works: FunctionFactory::createInitialized works:
BraggScatterer_sptr s = BraggScattererFactory::Instance() BraggScatterer_sptr s = BraggScattererFactory::Instance()
.createScatterer( .createScatterer(
"NewScatterer", "NewScatterer",
"SpaceGroup=F m -3 m; "SpaceGroup=F m -3 m;"
Position=[0.1,0.2,0.3]"); "Position=[0.1,0.2,0.3]");
If you choose to use the raw create/createUnwrapped methods, you have to If you choose to use the raw create/createUnwrapped methods, you have to
make sure to call BraggScatterer::initialize() on the created instance. make sure to call BraggScatterer::initialize() on the created instance.
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
namespace Mantid { namespace Mantid {
namespace Geometry { namespace Geometry {
/** BraggScattererInCrystalStructure /**
@class BraggScattererInCrystalStructure
This class provides an extension of BraggScatterer, suitable This class provides an extension of BraggScatterer, suitable
for scatterers that are part of a crystal structure. Information about for scatterers that are part of a crystal structure. Information about
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
namespace Mantid { namespace Mantid {
namespace Geometry { namespace Geometry {
/** CenteringGroup /**
@class CenteringGroup
This class is mostly a convenience class. It takes a bravais lattice symbol This class is mostly a convenience class. It takes a bravais lattice symbol
(P, I, A, B, C, F, R) and forms a group that contains all translations (P, I, A, B, C, F, R) and forms a group that contains all translations
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
namespace Mantid { namespace Mantid {
namespace Geometry { namespace Geometry {
/** CompositeBraggScatterer /**
@class CompositeBraggScatterer
CompositeBraggScatterer accumulates scatterers, for easier calculation CompositeBraggScatterer accumulates scatterers, for easier calculation
of structure factors. Scatterers can be added through the method of structure factors. Scatterers can be added through the method
...@@ -15,26 +16,23 @@ namespace Geometry { ...@@ -15,26 +16,23 @@ namespace Geometry {
it is cloned instead, so there is a new instance. The original instance it is cloned instead, so there is a new instance. The original instance
is not modified at all. is not modified at all.
For structure factor calculations, all contributions from contained For structure factor calculations, all contributions from
scatterers contained scatterers are summed. Contained scatterers may be
are summed. Contained scatterers may be CompositeBraggScatterers themselves, CompositeBraggScatterers themselves, so it's possible to build up elaborate
so it's possible to build up elaborate structures. structures.
There are two ways of creating instances of CompositeBraggScatterer. The There are two ways of creating instances of CompositeBraggScatterer. The
first first possibility is to use BraggScattererFactory, just like for other
possibility is to use BraggScattererFactory, just like for other implementations of BraggScatterer. Additionally there is a static method
implementations CompositeBraggScatterer::create, which creates a composite scatterer of
of BraggScatterer. Additionally there is a static method the supplied vector of scatterers.
CompositeBraggScatterer::create,
which creates a composite scatterer of the supplied vector of scatterers.
CompositeBraggScatterer does not declare any methods by itself, instead it CompositeBraggScatterer does not declare any methods by itself, instead it
exposes exposes some properties of the contained scatterers (those which were marked
some properties of the contained scatterers (those which were marked using using exposePropertyToComposite). When these properties are set,
exposePropertyToComposite). When these properties are set, their values their values are propagated to all members of the composite. The default
are propagated to all members of the composite. The default behavior when behavior when new properties are declared in subclasses of BraggScatterer is
new properties are declared in subclasses of BraggScatterer is not to expose not to expose them in this way.
them in this way.
@author Michael Wedel, Paul Scherrer Institut - SINQ @author Michael Wedel, Paul Scherrer Institut - SINQ
@date 21/10/2014 @date 21/10/2014
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
namespace Mantid { namespace Mantid {
namespace Geometry { namespace Geometry {
/** CrystalStructure : /**
@class CrystalStructure
Three components are required to describe a crystal structure: Three components are required to describe a crystal structure:
...@@ -47,7 +48,8 @@ namespace Geometry { ...@@ -47,7 +48,8 @@ namespace Geometry {
one of the ReflectionCondition-classes directly: one of the ReflectionCondition-classes directly:
ReflectionCondition_sptr fCentering = ReflectionCondition_sptr fCentering =
boost::make_shared<ReflectionConditionAllFaceCentred>(); boost::make_shared<ReflectionConditionAllFaceCentred>();
structure.setCentering(fCentering); structure.setCentering(fCentering);
Now, only reflections that fulfill the centering condition are Now, only reflections that fulfill the centering condition are
...@@ -58,7 +60,8 @@ namespace Geometry { ...@@ -58,7 +60,8 @@ namespace Geometry {
is to directly assign a point group: is to directly assign a point group:
PointGroup_sptr pointGroup = PointGroup_sptr pointGroup =
PointGroupFactory::Instance().createPointGroup("m-3m"); PointGroupFactory::Instance().createPointGroup("m-3m");
structure.setPointGroup(pointGroup); structure.setPointGroup(pointGroup);
std::vector<V3D> uniqueHKLs = structure.getUniqueHKLs(0.5, 10.0); std::vector<V3D> uniqueHKLs = structure.getUniqueHKLs(0.5, 10.0);
...@@ -81,25 +84,21 @@ namespace Geometry { ...@@ -81,25 +84,21 @@ namespace Geometry {
one Si-atom at the position (1/8, 1/8, 1/8) (for origin choice 2, with the one Si-atom at the position (1/8, 1/8, 1/8) (for origin choice 2, with the
inversion at the origin). Looking up this space group in the International inversion at the origin). Looking up this space group in the International
Tables for Crystallography A reveals that placing a scatterer at this Tables for Crystallography A reveals that placing a scatterer at this
position position introduces a new reflection condition for general reflections hkl:
introduces a new reflection condition for general reflections hkl:
h = 2n + 1 (reflections with odd h are allowed) h = 2n + 1 (reflections with odd h are allowed)
or h + k + l = 4n or h + k + l = 4n
This means that for example the reflection family {2 2 2} is not allowed, This means that for example the reflection family {2 2 2} is not allowed,
even though the F-centering would allow it. In other words, guessing even though the F-centering would allow it. In other words, guessing
existing existing reflections of silicon only using lattice information does not lead
reflections of silicon only using lattice information does not lead to the to the correct result. Besides that, there are also glide planes in that
correct result. Besides that, there are also glide planes in that space space group, which come with additional reflection conditions as well.
group,
which come with additional reflection conditions as well.
One way to obtain the correct result for this case is to calculate One way to obtain the correct result for this case is to calculate
structure factors for each HKL and check whether |F|^2 is non-zero. Of structure factors for each HKL and check whether |F|^2 is non-zero. Of
course, course, to perform this calculation, all three items mentioned in the list
to perform this calculation, all three items mentioned in the list at at the beginning must be present. CrystalStructure offers an additional
the beginning must be present. CrystalStructure offers an additional
constructor for this purpose: constructor for this purpose:
CrystalStructure silicon(unitcell, spaceGroup, scatterers); CrystalStructure silicon(unitcell, spaceGroup, scatterers);
...@@ -109,7 +108,7 @@ namespace Geometry { ...@@ -109,7 +108,7 @@ namespace Geometry {
Now, a different method for checking allowed reflections is available: Now, a different method for checking allowed reflections is available:
std::vector<V3D> uniqueHKLs = silicon.getUniqueHKLs(0.5, 10.0, std::vector<V3D> uniqueHKLs = silicon.getUniqueHKLs(0.5, 10.0,
CrystalStructure::UseStructureFactors); CrystalStructure::UseStructureFactors);
By supplying the extra argument, |F|^2 is calculated for each reflection By supplying the extra argument, |F|^2 is calculated for each reflection
and if it's greater than 1e-9, it's considered to be allowed. and if it's greater than 1e-9, it's considered to be allowed.
......
...@@ -10,12 +10,13 @@ ...@@ -10,12 +10,13 @@
namespace Mantid { namespace Mantid {
namespace Geometry { namespace Geometry {
/** CyclicGroup : /**
@class CyclicGroup
A cyclic group G has the property that it can be represented by A cyclic group G has the property that it can be represented by
powers of one symmetry operation S of order n: powers of one symmetry operation S of order n:
G = { S^1, S^2, ..., S^n = S^0 = I } G = { S^1, S^2, ..., S^n = S^0 = I }
The operation S^m is defined as carrying out the multiplication The operation S^m is defined as carrying out the multiplication
S * S * ... * S. To illustrate this, a four-fold rotation around S * S * ... * S. To illustrate this, a four-fold rotation around
...@@ -23,18 +24,18 @@ namespace Geometry { ...@@ -23,18 +24,18 @@ namespace Geometry {
transformation by this symmetry element is "-y,x,z". This is also the transformation by this symmetry element is "-y,x,z". This is also the
first member of the resulting group: first member of the resulting group:
S^1 = S = -y,x,z S^1 = S = -y,x,z
Then, multiplying this by itself: Then, multiplying this by itself:
S^2 = S * S = -x,-y,z S^2 = S * S = -x,-y,z
S^3 = S * S * S = y,-x,z S^3 = S * S * S = y,-x,z
S^4 = S * S * S * S = x,y,z = I S^4 = S * S * S * S = x,y,z = I
Thus, the cyclic group G resulting from the operation "-y,x,z" contains Thus, the cyclic group G resulting from the operation "-y,x,z" contains
the following members: the following members:
G = { S^1, S^2, S^3, I } = { -y,x,z; -x,-y,z; y,-x,z; x,y,z } G = { S^1, S^2, S^3, I } = { -y,x,z; -x,-y,z; y,-x,z; x,y,z }
This example shows in fact how the point group "4" can be generated as This example shows in fact how the point group "4" can be generated as
a cyclic group by the generator S = -y,x,z. Details about this a cyclic group by the generator S = -y,x,z. Details about this
...@@ -43,7 +44,7 @@ namespace Geometry { ...@@ -43,7 +44,7 @@ namespace Geometry {
In code, the example is very concise: In code, the example is very concise:
Group_const_sptr pointGroup4 = Group_const_sptr pointGroup4 =
GroupFactory::create<CyclicGroup>("-y,x,z"); GroupFactory::create<CyclicGroup>("-y,x,z");
This is much more convenient than having to construct a Group, This is much more convenient than having to construct a Group,
where all four symmetry operations would have to be supplied. where all four symmetry operations would have to be supplied.
......
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
namespace Mantid { namespace Mantid {
namespace Geometry { namespace Geometry {
/** Group : /**
@class Group
The class Group represents a set of symmetry operations (or The class Group represents a set of symmetry operations (or
symmetry group). It can be constructed by providing a vector symmetry group). It can be constructed by providing a vector
...@@ -42,49 +43,42 @@ namespace Geometry { ...@@ -42,49 +43,42 @@ namespace Geometry {
components of V3D are mapped onto the interval [0, 1). components of V3D are mapped onto the interval [0, 1).
Two groups A and B can be combined by a multiplication operation, provided Two groups A and B can be combined by a multiplication operation, provided
by by the corresponding overloaded operator:
the corresponding overloaded operator:
Group A, B; Group A, B;
Group C = A * B Group C = A * B
In this operation each element of A is multiplied with each element of B In this operation each element of A is multiplied with each element of B
and from the resulting list a new group is constructed. For better and from the resulting list a new group is constructed. For better
illustration, illustration, an example is provided. Group A has two symmetry operations:
an example is provided. Group A has two symmetry operations: identity identity ("x,y,z") and inversion ("-x,-y,-z"). Group B also consists of
("x,y,z") two operations: identity ("x,y,z") and a rotation around the y-axis
and inversion ("-x,-y,-z"). Group B also consists of two operations: ("-x,y,-z"). In terms of symmetry elements, the groups are defined like so:
identity ("x,y,z") and a rotation around the y-axis ("-x,y,-z"). In terms
of symmetry elements, the groups are defined like this:
A := { 1, -1 }; B := { 1, 2 [010] } A := { 1, -1 }; B := { 1, 2 [010] }
The following table shows all multiplications that are carried out and their The following table shows all multiplications that are carried out and their
results (for multiplication of symmetry operations see SymmetryOperation): results (for multiplication of symmetry operations see SymmetryOperation)
A
| x,y,z -x,-y,-z | x,y,z | -x,-y,-z
--------+------------------------ -------- | ---------- | -----------
x,y,z | x,y,z -x,-y,-z x,y,z | x,y,z | -x,-y,-z
B | -x,y,-z | -x,y,-z | x,-y,z
-x,y,-z | -x,y,-z x,-y,z
The resulting group contains the three elements of A and B (1, -1, 2 [010]), The resulting group contains the three elements of A and B (1, -1, 2 [010]),
but also one new element that is the result of multiplying "x,y,z" and but also one new element that is the result of multiplying "x,y,z" and
"-x,y,-z", "-x,y,-z", which is "x,-y,z" - the operation resulting from a mirror plane
which is "x,-y,z" - the operation resulting from a mirror plane perpendicular to the y-axis. In fact, this example demonstrated how the
perpendicular combination of two crystallographic point groups (see PointGroup
to the y-axis. In fact, this example demonstrated how the combination of documentation and wiki) "-1" and "2" results in a new point group "2/m".
two crystallographic point groups (see PointGroup documentation and wiki)
"-1" and "2" results in a new point group "2/m".
Most of the time it's not required to use Group directly, there are several Most of the time it's not required to use Group directly, there are several
sub-classes that implement different behavior (CenteringGroup, CyclicGroup, sub-classes that implement different behavior (CenteringGroup, CyclicGroup,
ProductOfCyclicGroups) and are easier to handle. For construction there is a ProductOfCyclicGroups) and are easier to handle. For construction there is a
simple simple "factory function", that works for all Group-based classes which
"factory function", that works for all Group-based classes which provide a provide a string-based constructor:
string-based constructor:
Group_const_sptr group = GroupFactory::create<CyclicGroup>("-x,-y,-z"); Group_const_sptr group = GroupFactory::create<CyclicGroup>("-x,-y,-z");
However, the most useful sub-class is SpaceGroup, which comes with its However, the most useful sub-class is SpaceGroup, which comes with its
own factory. For detailed information about the respective sub-classes, own factory. For detailed information about the respective sub-classes,
......
...@@ -8,14 +8,22 @@ ...@@ -8,14 +8,22 @@
namespace Mantid { namespace Mantid {
namespace Geometry { namespace Geometry {
/** IsotropicAtomBraggScatterer class IsotropicAtomBraggScatterer;
typedef boost::shared_ptr<IsotropicAtomBraggScatterer>
IsotropicAtomBraggScatterer_sptr;
/** @class IsotropicAtomBraggScatterer
IsotropicAtomBraggScatterer calculates the structure factor for IsotropicAtomBraggScatterer calculates the structure factor for
a given HKL using the following equation, which gives the a given HKL using the following equation, which gives the
structure factor for the j-th atom in the unit cell: structure factor for the j-th atom in the unit cell:
F(hkl)_j = b_j * o_j * DWF_j(hkl) * exp[i * 2pi * (h*x_j + k*y_j + \f[
l*z_j)] F(hkl)_j = b_j \cdot o_j \cdot DWF_j(hkl) \cdot
\exp\left[2\pi i \cdot
\left(h\cdot x_j + k\cdot y_j + l\cdot z_j\right)\right]
\f]
Since there are many terms in that equation, further explanation Since there are many terms in that equation, further explanation
is required. The j-th atom in a unit cell occupies a certain position, is required. The j-th atom in a unit cell occupies a certain position,
...@@ -24,53 +32,54 @@ namespace Geometry { ...@@ -24,53 +32,54 @@ namespace Geometry {
so called "phase". This term is easier seen when the complex part is written so called "phase". This term is easier seen when the complex part is written
using trigonometric functions: using trigonometric functions:
phi = 2pi * (h*x_j + k*y_j + l*z_j) \f{eqnarray*}{
exp[i * phi] = cos(phi) + i * sin(phi) \phi &=& 2\pi\left(h\cdot x_j + k\cdot y_j + l\cdot z_j\right) \\
\exp i\phi &=& \cos\phi + i\sin\phi
\f}
The magnitude of the complex number is determined first of all by the The magnitude of the complex number is determined first of all by the
scattering length, b_j (which is element specific and tabulated, in scattering length, \f$b_j\f$ (which is element specific and tabulated, in
Mantid this is in PhysicalConstants::NeutronAtom). It is multiplied Mantid this is in PhysicalConstants::NeutronAtom). It is multiplied
by the occupancy o_j, which is a number on the interval [0, 1], where 0 by the occupancy\f$o_j\f$, which is a number on the interval [0, 1], where 0
is a bit meaningless, since it means "no atoms on this position" and is a bit meaningless, since it means "no atoms on this position" and
1 represents a fully occupied position in the crystal lattice. This number 1 represents a fully occupied position in the crystal lattice. This number
can be used to model statistically distributed defects. can be used to model statistically distributed defects.
DWF_j denotes the Debye-Waller-factor, which models the diminishing \f$DWF_j\f$ denotes the Debye-Waller-factor, which models the diminishing
scattering power of atoms that are displaced from their position scattering power of atoms that are displaced from their position
(either due to temperature or other effects). It is defined like this: (either due to temperature or other effects). It is defined like this:
DWF_j(hkl) = exp[-2.0 * pi^2 * U * 1/d(hkl)^2] \f[
DWF_j(hkl) = \exp\left[-2\pi^2\cdot U \cdot 1/d_{hkl}^2\right]
\f]
Here, U is given in Angstrom^2 (for a discussion of terms regarding Here, \f$U\f$ is given in \f$\mathrm{\AA{}^2}\f$ (for a discussion of
atomic displacement parameters, please see [1]), it is often of the terms regarding atomic displacement parameters, please see [1]),
order 0.05. d(hkl) is alculated using the unit cell. The model used it is often of the order 0.05. \f$d_{hkl}\f$ is alculated using
in this class is isotropic (hence the class name), which may be insufficient the unit cell. The model used in this class is isotropic
depending on the crystal structure, but as a first approximation it is (hence the class name), which may be insufficient depending on the crystal
often enough. structure, but as a first approximation it is often enough.
This class is designed to handle atoms in a unit cell. When a position is This class is designed to handle atoms in a unit cell. When a position is
set, set, the internally stored space group is used to generate all positions
the internally stored space group is used to generate all positions that are that are symmetrically equivalent. In the structure factor calculation
symmetrically equivalent. In the structure factor calculation method method all contributions are summed.
all contributions are summed.
Easiest is demonstration by example. Copper crystallizes in the space group Easiest is demonstration by example. Copper crystallizes in the space group
Fm-3m, Cu atoms occupy the position (0,0,0) and, because of the F-centering, \f$Fm\bar{3}m\f$, Cu atoms occupy the position (0,0,0) and, because
also 3 additional positions. of the F-centering, also 3 additional positions.
BraggScatterer_sptr cu = BraggScatterer_sptr cu =
BraggScattererFactory::Instance().createScatterer( BraggScattererFactory::Instance().createScatterer(
"IsotropicAtomBraggScatterer", "IsotropicAtomBraggScatterer",
"Element=Cu; "Element=Cu; SpaceGroup=F m -3 m")
SpaceGroup=F m -3 m")
cu->setProperty("UnitCell", unitCellToStr(cellCu));
cu->setProperty("UnitCell", unitCellToStr(cellCu));
StructureFactor F = cu->calculateStructureFactor(V3D(1, 1, 1)); StructureFactor F = cu->calculateStructureFactor(V3D(1, 1, 1));
The structure factor F contains contributions from all 4 copper atoms in the The structure factor F contains contributions from all 4 copper atoms in the
cell. cell. This is convenient especially for general positions.
This is convenient especially for general positions. The general position The general position of \f$Fm\bar{3}m\f$ for example has 192 equivalents.
of Fm-3m for example has 192 equivalents.
[1] http://ww1.iucr.org/comm/cnom/adp/finrep/finrep.html [1] http://ww1.iucr.org/comm/cnom/adp/finrep/finrep.html
...@@ -97,11 +106,6 @@ namespace Geometry { ...@@ -97,11 +106,6 @@ namespace Geometry {
File change history is stored at: <https://github.com/mantidproject/mantid> File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org> Code Documentation is available at: <http://doxygen.mantidproject.org>
*/ */
class IsotropicAtomBraggScatterer;
typedef boost::shared_ptr<IsotropicAtomBraggScatterer>
IsotropicAtomBraggScatterer_sptr;
class MANTID_GEOMETRY_DLL IsotropicAtomBraggScatterer class MANTID_GEOMETRY_DLL IsotropicAtomBraggScatterer
: public BraggScattererInCrystalStructure { : public BraggScattererInCrystalStructure {
public: public:
......
...@@ -10,13 +10,14 @@ ...@@ -10,13 +10,14 @@
namespace Mantid { namespace Mantid {
namespace Geometry { namespace Geometry {
/** PointGroupFactory /**
@class PointGroupFactory
A factory for point groups. Point group objects can be constructed by A factory for point groups. Point group objects can be constructed by
supplying the Hermann-Mauguin-symbol like this: supplying the Hermann-Mauguin-symbol like this:
PointGroup_sptr cubic = PointGroup_sptr cubic =
PointGroupFactory::Instance().createPointgroup("m-3m"); PointGroupFactory::Instance().createPointgroup("m-3m");
Furthermore it's possible to query available point groups, either all Furthermore it's possible to query available point groups, either all
available available
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
namespace Mantid { namespace Mantid {
namespace Geometry { namespace Geometry {
/** ProductOfCyclicGroups : /**
@class ProductOfCyclicGroups
ProductOfCyclicGroups expands a bit on the explanations given in ProductOfCyclicGroups expands a bit on the explanations given in
CyclicGroup. As shown for example in [1], some point groups CyclicGroup. As shown for example in [1], some point groups
...@@ -20,14 +21,14 @@ namespace Geometry { ...@@ -20,14 +21,14 @@ namespace Geometry {
a cyclic group C_i. The resulting n groups ("factor groups") are a cyclic group C_i. The resulting n groups ("factor groups") are
multiplied to form a product group G: multiplied to form a product group G:
G = C_1 * C_2 * ... * C_n G = C_1 * C_2 * ... * C_n
Where C_i is generated by the symmetry operation S_i. The notation Where C_i is generated by the symmetry operation S_i. The notation
in code to generate even large groups from a few generators in code to generate even large groups from a few generators
becomes very short using this class: becomes very short using this class:
Group_const_sptr pointGroup422 = Group_const_sptr pointGroup422 =
GroupFactory::create<ProductOfCyclicGroups>("-y,x,z; x,-y,-z"); GroupFactory::create<ProductOfCyclicGroups>("-y,x,z; x,-y,-z");
This is for example used in SpaceGroupFactory to create space groups This is for example used in SpaceGroupFactory to create space groups
from a small set of generators supplied in the International Tables from a small set of generators supplied in the International Tables
......
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
namespace Mantid { namespace Mantid {
namespace Geometry { namespace Geometry {
/** SpaceGroup : /**
@class SpaceGroup
A class for representing space groups, inheriting from Group. A class for representing space groups, inheriting from Group.
...@@ -24,14 +25,13 @@ namespace Geometry { ...@@ -24,14 +25,13 @@ namespace Geometry {
SpaceGroup may for example be used to generate all equivalent positions SpaceGroup may for example be used to generate all equivalent positions
within the unit cell: within the unit cell:
SpaceGroup_const_sptr someGroup; SpaceGroup_const_sptr group;
V3D position(0.13, 0.54, 0.38); V3D position(0.13, 0.54, 0.38);
std::vector<V3D> equivalents = std::vector<V3D> equivalents = group->getEquivalentPositions(position);
someGroup->getEquivalentPositions(position);
The class should not be instantiated directly, see SpaceGroupFactory The class should not be instantiated directly, see SpaceGroupFactoryImpl
instead. instead.
@author Michael Wedel, Paul Scherrer Institut - SINQ @author Michael Wedel, Paul Scherrer Institut - SINQ
@date 03/10/2014 @date 03/10/2014
......
...@@ -14,7 +14,8 @@ namespace Geometry { ...@@ -14,7 +14,8 @@ namespace Geometry {
bool MANTID_GEOMETRY_DLL bool MANTID_GEOMETRY_DLL
isValidGeneratorString(const std::string &generatorString); isValidGeneratorString(const std::string &generatorString);
/** AbstractSpaceGroupGenerator /**
* @class AbstractSpaceGroupGenerator
* *
* AbstractSpaceGroupGenerator is used by SpaceGroupFactory to delay * AbstractSpaceGroupGenerator is used by SpaceGroupFactory to delay
* (possibly costly) construction of space group prototype objects until * (possibly costly) construction of space group prototype objects until
...@@ -86,7 +87,8 @@ protected: ...@@ -86,7 +87,8 @@ protected:
Group_const_sptr generateGroup() const; Group_const_sptr generateGroup() const;
}; };
/** SpaceGroupFactory /**
@class SpaceGroupFactory
This factory is used to create space group objects. Each space group This factory is used to create space group objects. Each space group
should be created only once, which is why the factory works with should be created only once, which is why the factory works with
......
...@@ -10,55 +10,49 @@ ...@@ -10,55 +10,49 @@
namespace Mantid { namespace Mantid {
namespace Geometry { namespace Geometry {
/** SymmetryOperation : /**
@class SymmetryOperation
Crystallographic symmetry operations are composed of a rotational component, Crystallographic symmetry operations are composed of a rotational component,
which is represented by a matrix and a translational part, which is which is represented by a matrix and a translational part, which is
described by a vector. described by a vector.
In this interface, each symmetry operation has a so-called order, which is In this interface, each symmetry operation has a so-called order,
an which is an unsigned integer describing the number of times a
unsigned integer describing the number of times a symmetry operation symmetry operation has to be applied to an object until it is identical.
has to be applied to an object until it is identical.
Furthermore, each symmetry operation has a string-identifier. It contains Furthermore, each symmetry operation has a string-identifier. It contains
the the Jones faithful representation of the operation, as it is commonly used
Jones faithful representation of the operation, as it is commonly used in in many crystallographic programs and of course the International Tables
many crystallographic programs and of course the International Tables
for Crystallography, where the symmetry operations and their representations for Crystallography, where the symmetry operations and their representations
may be found [1]. may be found [1].
The Jones faithful notation is a very concise way of describing The Jones faithful notation is a very concise way of describing
matrix/vector pairs. matrix/vector pairs. The matrix/vector pair of a two-fold rotation
The matrix/vector pair of a two-fold rotation axis along z is for example: axis along z is for example:
Matrix Vector Matrix Vector
-1 0 0 0 -1 0 0 0
0 -1 0 0 0 -1 0 0
0 0 1 0 0 0 1 0
This is described by the symbol '-x,-y,z'. If it were a 2_1 screw axis in This is described by the symbol '-x,-y,z'. If it were a 2_1 screw axis
the same in the same direction, the matrix/vector pair would look like this:
direction, the matrix/vector pair would look like this:
Matrix Vector Matrix Vector
-1 0 0 0 -1 0 0 0
0 -1 0 0 0 -1 0 0
0 0 1 1/2 0 0 1 1/2
And this is represented by the string '-x,-y,z+1/2'. In hexagonal systems And this is represented by the string '-x,-y,z+1/2'. In hexagonal systems
there there are often operations involving 1/3 or 2/3, so the translational part
are often operations involving 1/3 or 2/3, so the translational part is kept is kept as a vector of rational numbers in order to carry out precise
as calculations. For details, see the class Kernel::V3R.
a vector of rational numbers in order to carry out precise calculations. For
details,
see the class V3R.
Using the symmetry operations in code is easy, since Using the symmetry operations in code is easy, since
SymmetryOperationSymbolParser is SymmetryOperationSymbolParser is automatically called by the string-based
automatically called by the string-based constructor of SymmetryOperation constructor of SymmetryOperation and the multiplication operator
and the multiplication is overloaded:
operator is overloaded:
SymmetryOperation inversion("-x,-y,-z"); SymmetryOperation inversion("-x,-y,-z");
V3D hklPrime = inversion * V3D(1, 1, -1); // results in -1, -1, 1 V3D hklPrime = inversion * V3D(1, 1, -1); // results in -1, -1, 1
...@@ -67,8 +61,7 @@ namespace Geometry { ...@@ -67,8 +61,7 @@ namespace Geometry {
multiplied with and V3R can be added to (for example V3R, V3D). multiplied with and V3R can be added to (for example V3R, V3D).
A special case is the multiplication of several symmetry operations, which A special case is the multiplication of several symmetry operations, which
can can be used to generate new operations:
be used to generate new operations:
SymmetryOperation inversion("-x,-y,-z"); SymmetryOperation inversion("-x,-y,-z");
SymmetryOperation identity = inversion * inversion; SymmetryOperation identity = inversion * inversion;
...@@ -77,11 +70,11 @@ namespace Geometry { ...@@ -77,11 +70,11 @@ namespace Geometry {
the interval (0, 1] when two symmetry operations are combined. the interval (0, 1] when two symmetry operations are combined.
Constructing a SymmetryOperation object from a string is heavy, because the Constructing a SymmetryOperation object from a string is heavy, because the
string string has to be parsed every time. It's preferable to use
has to be parsed every time. It's preferable to use the available factory: the available factory:
SymmetryOperation inversion = SymmetryOperation inversion =
SymmetryOperationFactory::Instance().createSymOp("-x,-y,-z"); SymmetryOperationFactory::Instance().createSymOp("-x,-y,-z");
It stores a prototype of the created operation and copy constructs a new It stores a prototype of the created operation and copy constructs a new
instance on subsequent calls with the same string. instance on subsequent calls with the same string.
...@@ -90,7 +83,7 @@ namespace Geometry { ...@@ -90,7 +83,7 @@ namespace Geometry {
References: References:
[1] International Tables for Crystallography, Volume A, Fourth edition, [1] International Tables for Crystallography, Volume A, Fourth edition,
pp 797-798. pp 797-798.
@author Michael Wedel, Paul Scherrer Institut - SINQ @author Michael Wedel, Paul Scherrer Institut - SINQ
...@@ -116,8 +109,6 @@ namespace Geometry { ...@@ -116,8 +109,6 @@ namespace Geometry {
File change history is stored at: <https://github.com/mantidproject/mantid> File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org> Code Documentation is available at: <http://doxygen.mantidproject.org>
*/ */
class SymmetryOperation;
class MANTID_GEOMETRY_DLL SymmetryOperation { class MANTID_GEOMETRY_DLL SymmetryOperation {
public: public:
SymmetryOperation(); SymmetryOperation();
......
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
namespace Mantid { namespace Mantid {
namespace Geometry { namespace Geometry {
/** SymmetryOperationFactory /**
@class SymmetryOperationFactoryImpl
A factory for symmetry operations. Symmetry operations are stored A factory for symmetry operations. Symmetry operations are stored
with respect to their identifier (see SymmetryOperation for details). with respect to their identifier (see SymmetryOperation for details).
...@@ -21,7 +22,7 @@ namespace Geometry { ...@@ -21,7 +22,7 @@ namespace Geometry {
Creation of symmetry operations is then performed like this: Creation of symmetry operations is then performed like this:
SymmetryOperations inversion = SymmetryOperations inversion =
SymmetryOperationFactory::Instance().createSymOp("x,y,z"); SymmetryOperationFactory::Instance().createSymOp("x,y,z");
Creating a symmetry operation object automatically registers the object Creating a symmetry operation object automatically registers the object
as a prototype and subsequent creations are much more efficient because as a prototype and subsequent creations are much more efficient because
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
namespace Mantid { namespace Mantid {
namespace Geometry { namespace Geometry {
/** SymmetryOperationSymbolParser : /**
@class SymmetryOperationSymbolParser
This is a parser for symmetry operation symbols in the Jones This is a parser for symmetry operation symbols in the Jones
faithful representation. It creates matrix and a vector component faithful representation. It creates matrix and a vector component
......
...@@ -52,9 +52,8 @@ bool BraggScatterer::isPropertyExposedToComposite(Property *property) const { ...@@ -52,9 +52,8 @@ bool BraggScatterer::isPropertyExposedToComposite(Property *property) const {
* Exposes the property with the supplied name to BraggScattererComposite * Exposes the property with the supplied name to BraggScattererComposite
* *
* When a property is marked to be exposed to BraggScattererComposite, the * When a property is marked to be exposed to BraggScattererComposite, the
*composite * composite also declares this property and tries to propagate the value
* also declares this property and tries to propagate the value assigned to the * assigned to the composite's property to all its members.
* composite's property to all its members.
* *
* @param propertyName :: Name of the parameter that should be exposed. * @param propertyName :: Name of the parameter that should be exposed.
*/ */
......
...@@ -8,16 +8,12 @@ namespace Geometry { ...@@ -8,16 +8,12 @@ namespace Geometry {
* Creates an initialized instance of the desired scatterer class * Creates an initialized instance of the desired scatterer class
* *
* This method tries to construct an instance of the class specified by the * This method tries to construct an instance of the class specified by the
*"name"-parameter. * "name"-parameter. If it is not found, an exception is thrown
* If it is not found, an exception is thrown (see DynamicFactory::create). * (see DynamicFactory::create). Otherwise, the object is initialized.
*Otherwise, * If the second argument is not empty, it is expected to contain a semi-colon
* the object is initialized. If the second argument is not empty, it is * separated list of "name=value"-pairs. These pairs need to be
*expected
* to contain a semi-colon separated list of "name=value"-pairs. These pairs
*need to be
* valid input for assigning properties of the created scatterer. See the * valid input for assigning properties of the created scatterer. See the
*example in * example in the general class documentation.
* the general class documentation.
* *
* @param name :: Class name to construct. * @param name :: Class name to construct.
* @param properties :: Semi-colon separated "name=value"-pairs. * @param properties :: Semi-colon separated "name=value"-pairs.
......
...@@ -95,14 +95,12 @@ void BraggScattererInCrystalStructure::declareProperties() { ...@@ -95,14 +95,12 @@ void BraggScattererInCrystalStructure::declareProperties() {
* Additional property processing * Additional property processing
* *
* Takes care of handling new property values, for example for construction of a * Takes care of handling new property values, for example for construction of a
*space group * space group from string and so on.
* from string and so on.
* *
* Please note that derived classes should not re-implement this method, as * Please note that derived classes should not re-implement this method, as
* the processing for the base properties is absolutely necessary. Instead, all * the processing for the base properties is absolutely necessary. Instead, all
*deriving * deriving classes should override the method afterScattererPropertySet,
* classes should override the method afterScattererPropertySet, which is called * which is called from this method.
* from this method.
*/ */
void BraggScattererInCrystalStructure::afterPropertySet( void BraggScattererInCrystalStructure::afterPropertySet(
const std::string &propertyName) { const std::string &propertyName) {
......
...@@ -143,11 +143,9 @@ void CompositeBraggScatterer::propagatePropertyToScatterer( ...@@ -143,11 +143,9 @@ void CompositeBraggScatterer::propagatePropertyToScatterer(
* Synchronize properties with scatterer members * Synchronize properties with scatterer members
* *
* This method synchronizes the properties of CompositeBraggScatterer with the * This method synchronizes the properties of CompositeBraggScatterer with the
*properties * properties of the contained BraggScatterer instances. It adds new properties
* of the contained BraggScatterer instances. It adds new properties if required * if required and removed properties that are no longer used (for example
* and removed properties that are no longer used (for example because the * because the member that introduced the property has been removed).
*member that
* introduced the property has been removed).
*/ */
void CompositeBraggScatterer::redeclareProperties() { void CompositeBraggScatterer::redeclareProperties() {
std::map<std::string, size_t> propertyUseCount = getPropertyCountMap(); std::map<std::string, size_t> propertyUseCount = getPropertyCountMap();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment