Skip to content

Commit

Permalink
Refs #10900. Updated class- and method documentation in MantidGeometry
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wedel committed Jan 15, 2015
1 parent c0f1bcf commit 39fc02c
Show file tree
Hide file tree
Showing 26 changed files with 211 additions and 239 deletions.
Expand Up @@ -15,7 +15,12 @@ namespace Geometry {

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
in the unit cell of a periodic structure. Since there are many possibilities
Expand Down Expand Up @@ -60,11 +65,6 @@ typedef std::complex<double> StructureFactor;
File change history is stored at: <https://github.com/mantidproject/mantid>
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 {
public:
BraggScatterer();
Expand Down
Expand Up @@ -9,7 +9,8 @@
namespace Mantid {
namespace Geometry {

/** BraggScattererFactory :
/**
@class BraggScattererFactory
This class implements a factory for concrete BraggScatterer classes.
When a new scatterer is derived from BraggScatterer, it should be registered
Expand All @@ -21,20 +22,20 @@ namespace Geometry {
At runtime, instances of this class can be created like this:
BraggScatterer_sptr scatterer =
BraggScattererFactory::Instance().createScatterer("NewScattererClass");
BraggScattererFactory::Instance().createScatterer("NewScattererClass");
The returned object is initialized, which is required for using the
Kernel::Property-based system of setting parameters for the scatterer.
To make creation of scatterers more convenient, it's possible to provide
a string with "name=value" pairs, separated by semi-colons, which assigns
property values. This is similar to the way
FunctionFactory::createInitialized works:
FunctionFactory::createInitialized works:
BraggScatterer_sptr s = BraggScattererFactory::Instance()
.createScatterer(
"NewScatterer",
"SpaceGroup=F m -3 m;
Position=[0.1,0.2,0.3]");
"SpaceGroup=F m -3 m;"
"Position=[0.1,0.2,0.3]");
If you choose to use the raw create/createUnwrapped methods, you have to
make sure to call BraggScatterer::initialize() on the created instance.
Expand Down
Expand Up @@ -9,7 +9,8 @@
namespace Mantid {
namespace Geometry {

/** BraggScattererInCrystalStructure
/**
@class BraggScattererInCrystalStructure
This class provides an extension of BraggScatterer, suitable
for scatterers that are part of a crystal structure. Information about
Expand Down
Expand Up @@ -10,7 +10,8 @@
namespace Mantid {
namespace Geometry {

/** CenteringGroup
/**
@class CenteringGroup
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
Expand Down
Expand Up @@ -7,34 +7,32 @@
namespace Mantid {
namespace Geometry {

/** CompositeBraggScatterer
/**
@class CompositeBraggScatterer
CompositeBraggScatterer accumulates scatterers, for easier calculation
of structure factors. Scatterers can be added through the method
addScatterer. The supplied scatterer is not stored directly,
it is cloned instead, so there is a new instance. The original instance
is not modified at all.
For structure factor calculations, all contributions from contained
scatterers
are summed. Contained scatterers may be CompositeBraggScatterers themselves,
so it's possible to build up elaborate structures.
For structure factor calculations, all contributions from
contained scatterers are summed. Contained scatterers may be
CompositeBraggScatterers themselves, so it's possible to build up elaborate
structures.
There are two ways of creating instances of CompositeBraggScatterer. The
first
possibility is to use BraggScattererFactory, just like for other
implementations
of BraggScatterer. Additionally there is a static method
CompositeBraggScatterer::create,
which creates a composite scatterer of the supplied vector of scatterers.
first possibility is to use BraggScattererFactory, just like for other
implementations of BraggScatterer. Additionally there is a static method
CompositeBraggScatterer::create, which creates a composite scatterer of
the supplied vector of scatterers.
CompositeBraggScatterer does not declare any methods by itself, instead it
exposes
some properties of the contained scatterers (those which were marked using
exposePropertyToComposite). When these properties are set, their values
are propagated to all members of the composite. The default behavior when
new properties are declared in subclasses of BraggScatterer is not to expose
them in this way.
exposes some properties of the contained scatterers (those which were marked
using exposePropertyToComposite). When these properties are set,
their values are propagated to all members of the composite. The default
behavior when new properties are declared in subclasses of BraggScatterer is
not to expose them in this way.
@author Michael Wedel, Paul Scherrer Institut - SINQ
@date 21/10/2014
Expand Down
Expand Up @@ -14,7 +14,8 @@
namespace Mantid {
namespace Geometry {

/** CrystalStructure :
/**
@class CrystalStructure
Three components are required to describe a crystal structure:
Expand Down Expand Up @@ -47,7 +48,8 @@ namespace Geometry {
one of the ReflectionCondition-classes directly:
ReflectionCondition_sptr fCentering =
boost::make_shared<ReflectionConditionAllFaceCentred>();
boost::make_shared<ReflectionConditionAllFaceCentred>();
structure.setCentering(fCentering);
Now, only reflections that fulfill the centering condition are
Expand All @@ -58,7 +60,8 @@ namespace Geometry {
is to directly assign a point group:
PointGroup_sptr pointGroup =
PointGroupFactory::Instance().createPointGroup("m-3m");
PointGroupFactory::Instance().createPointGroup("m-3m");
structure.setPointGroup(pointGroup);
std::vector<V3D> uniqueHKLs = structure.getUniqueHKLs(0.5, 10.0);
Expand All @@ -81,25 +84,21 @@ namespace Geometry {
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
Tables for Crystallography A reveals that placing a scatterer at this
position
introduces a new reflection condition for general reflections hkl:
position introduces a new reflection condition for general reflections hkl:
h = 2n + 1 (reflections with odd h are allowed)
or h + k + l = 4n
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
existing
reflections of silicon only using lattice information does not lead to the
correct result. Besides that, there are also glide planes in that space
group,
which come with additional reflection conditions as well.
existing reflections of silicon only using lattice information does not lead
to the correct result. Besides that, there are also glide planes in that
space group, which come with additional reflection conditions as well.
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
course,
to perform this calculation, all three items mentioned in the list at
the beginning must be present. CrystalStructure offers an additional
course, to perform this calculation, all three items mentioned in the list
at the beginning must be present. CrystalStructure offers an additional
constructor for this purpose:
CrystalStructure silicon(unitcell, spaceGroup, scatterers);
Expand All @@ -109,7 +108,7 @@ namespace Geometry {
Now, a different method for checking allowed reflections is available:
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
and if it's greater than 1e-9, it's considered to be allowed.
Expand Down
Expand Up @@ -10,31 +10,32 @@
namespace Mantid {
namespace Geometry {

/** CyclicGroup :
/**
@class CyclicGroup
A cyclic group G has the property that it can be represented by
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
S * S * ... * S. To illustrate this, a four-fold rotation around
the z-axis is considered. The symmetry operation representing the
transformation by this symmetry element is "-y,x,z". This is also the
first member of the resulting group:
S^1 = S = -y,x,z
S^1 = S = -y,x,z
Then, multiplying this by itself:
S^2 = S * S = -x,-y,z
S^3 = S * S * S = y,-x,z
S^4 = S * S * S * S = x,y,z = I
S^2 = S * S = -x,-y,z
S^3 = S * S * S = y,-x,z
S^4 = S * S * S * S = x,y,z = I
Thus, the cyclic group G resulting from the operation "-y,x,z" contains
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
a cyclic group by the generator S = -y,x,z. Details about this
Expand All @@ -43,7 +44,7 @@ namespace Geometry {
In code, the example is very concise:
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,
where all four symmetry operations would have to be supplied.
Expand Down
50 changes: 22 additions & 28 deletions Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/Group.h
Expand Up @@ -13,7 +13,8 @@
namespace Mantid {
namespace Geometry {

/** Group :
/**
@class Group
The class Group represents a set of symmetry operations (or
symmetry group). It can be constructed by providing a vector
Expand Down Expand Up @@ -42,49 +43,42 @@ namespace Geometry {
components of V3D are mapped onto the interval [0, 1).
Two groups A and B can be combined by a multiplication operation, provided
by
the corresponding overloaded operator:
by the corresponding overloaded operator:
Group A, B;
Group C = A * B
Group A, B;
Group C = A * 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
illustration,
an example is provided. Group A has two symmetry operations: identity
("x,y,z")
and inversion ("-x,-y,-z"). Group B also consists of two operations:
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:
illustration, an example is provided. Group A has two symmetry operations:
identity ("x,y,z") and inversion ("-x,-y,-z"). Group B also consists of
two operations: identity ("x,y,z") and a rotation around the y-axis
("-x,y,-z"). In terms of symmetry elements, the groups are defined like so:
A := { 1, -1 }; B := { 1, 2 [010] }
The following table shows all multiplications that are carried out and their
results (for multiplication of symmetry operations see SymmetryOperation):
A
| 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
results (for multiplication of symmetry operations see SymmetryOperation)
| x,y,z | -x,-y,-z
-------- | ---------- | -----------
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]),
but also one new element that is the result of multiplying "x,y,z" and
"-x,y,-z",
which is "x,-y,z" - the operation resulting from a mirror plane
perpendicular
to the y-axis. In fact, this example demonstrated how the combination of
two crystallographic point groups (see PointGroup documentation and wiki)
"-1" and "2" results in a new point group "2/m".
"-x,y,-z", which is "x,-y,z" - the operation resulting from a mirror plane
perpendicular to the y-axis. In fact, this example demonstrated how the
combination of 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
sub-classes that implement different behavior (CenteringGroup, CyclicGroup,
ProductOfCyclicGroups) and are easier to handle. For construction there is a
simple
"factory function", that works for all Group-based classes which provide a
string-based constructor:
simple "factory function", that works for all Group-based classes which
provide a 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
own factory. For detailed information about the respective sub-classes,
Expand Down

0 comments on commit 39fc02c

Please sign in to comment.