From 39fc02c501d9a7a4fda83df6c81d26787db92bbb Mon Sep 17 00:00:00 2001 From: Michael Wedel <michael.wedel@psi.ch> Date: Thu, 15 Jan 2015 20:57:24 +0100 Subject: [PATCH] Refs #10900. Updated class- and method documentation in MantidGeometry --- .../MantidGeometry/Crystal/BraggScatterer.h | 12 ++-- .../Crystal/BraggScattererFactory.h | 11 +-- .../BraggScattererInCrystalStructure.h | 3 +- .../MantidGeometry/Crystal/CenteringGroup.h | 3 +- .../Crystal/CompositeBraggScatterer.h | 32 ++++----- .../MantidGeometry/Crystal/CrystalStructure.h | 27 ++++--- .../inc/MantidGeometry/Crystal/CyclicGroup.h | 17 ++--- .../inc/MantidGeometry/Crystal/Group.h | 50 ++++++------- .../Crystal/IsotropicAtomBraggScatterer.h | 72 ++++++++++--------- .../Crystal/PointGroupFactory.h | 5 +- .../Crystal/ProductOfCyclicGroups.h | 9 +-- .../inc/MantidGeometry/Crystal/SpaceGroup.h | 14 ++-- .../Crystal/SpaceGroupFactory.h | 6 +- .../Crystal/SymmetryOperation.h | 65 ++++++++--------- .../Crystal/SymmetryOperationFactory.h | 5 +- .../Crystal/SymmetryOperationSymbolParser.h | 3 +- .../Geometry/src/Crystal/BraggScatterer.cpp | 5 +- .../src/Crystal/BraggScattererFactory.cpp | 14 ++-- .../BraggScattererInCrystalStructure.cpp | 8 +-- .../src/Crystal/CompositeBraggScatterer.cpp | 8 +-- .../Crystal/IsotropicAtomBraggScatterer.cpp | 4 +- .../Geometry/src/Crystal/PointGroup.cpp | 24 +++---- .../Geometry/src/Crystal/SpaceGroup.cpp | 3 +- .../src/Crystal/SpaceGroupFactory.cpp | 16 ++--- .../src/Crystal/SymmetryOperation.cpp | 17 ++--- .../Crystal/SymmetryOperationSymbolParser.cpp | 17 ++--- 26 files changed, 211 insertions(+), 239 deletions(-) diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/BraggScatterer.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/BraggScatterer.h index ffcf6ba955e..c87a838f4cd 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/BraggScatterer.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/BraggScatterer.h @@ -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 @@ -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(); diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/BraggScattererFactory.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/BraggScattererFactory.h index e2f212f521a..1b98b0eacd2 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/BraggScattererFactory.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/BraggScattererFactory.h @@ -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 @@ -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. diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/BraggScattererInCrystalStructure.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/BraggScattererInCrystalStructure.h index f27e066cce8..67a1fdcd2de 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/BraggScattererInCrystalStructure.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/BraggScattererInCrystalStructure.h @@ -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 diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/CenteringGroup.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/CenteringGroup.h index 5bea640404b..ce3610842e5 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/CenteringGroup.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/CenteringGroup.h @@ -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 diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/CompositeBraggScatterer.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/CompositeBraggScatterer.h index 88387763033..d1e23c735bb 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/CompositeBraggScatterer.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/CompositeBraggScatterer.h @@ -7,7 +7,8 @@ namespace Mantid { namespace Geometry { -/** CompositeBraggScatterer +/** + @class CompositeBraggScatterer CompositeBraggScatterer accumulates scatterers, for easier calculation of structure factors. Scatterers can be added through the method @@ -15,26 +16,23 @@ namespace Geometry { 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 diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/CrystalStructure.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/CrystalStructure.h index 0f7d308e851..24d279a0d68 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/CrystalStructure.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/CrystalStructure.h @@ -14,7 +14,8 @@ namespace Mantid { namespace Geometry { -/** CrystalStructure : +/** + @class CrystalStructure Three components are required to describe a crystal structure: @@ -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 @@ -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); @@ -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); @@ -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. diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/CyclicGroup.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/CyclicGroup.h index 30610a346c0..da968d3410c 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/CyclicGroup.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/CyclicGroup.h @@ -10,12 +10,13 @@ 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 @@ -23,18 +24,18 @@ namespace Geometry { 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 @@ -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. diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/Group.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/Group.h index 7896cc29a63..248dca7b95d 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/Group.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/Group.h @@ -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 @@ -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, diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/IsotropicAtomBraggScatterer.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/IsotropicAtomBraggScatterer.h index 57d77e12650..0a243f40c6a 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/IsotropicAtomBraggScatterer.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/IsotropicAtomBraggScatterer.h @@ -8,14 +8,22 @@ namespace Mantid { namespace Geometry { -/** IsotropicAtomBraggScatterer +class IsotropicAtomBraggScatterer; + +typedef boost::shared_ptr<IsotropicAtomBraggScatterer> + IsotropicAtomBraggScatterer_sptr; + +/** @class IsotropicAtomBraggScatterer IsotropicAtomBraggScatterer calculates the structure factor for a given HKL using the following equation, which gives the 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 + - l*z_j)] + \f[ + 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 is required. The j-th atom in a unit cell occupies a certain position, @@ -24,53 +32,54 @@ namespace Geometry { so called "phase". This term is easier seen when the complex part is written using trigonometric functions: - phi = 2pi * (h*x_j + k*y_j + l*z_j) - exp[i * phi] = cos(phi) + i * sin(phi) + \f{eqnarray*}{ + \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 - 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 - 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 1 represents a fully occupied position in the crystal lattice. This number 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 (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 - atomic displacement parameters, please see [1]), it is often of the - order 0.05. d(hkl) is alculated using the unit cell. The model used - in this class is isotropic (hence the class name), which may be insufficient - depending on the crystal structure, but as a first approximation it is - often enough. + Here, \f$U\f$ is given in \f$\mathrm{\AA{}^2}\f$ (for a discussion of + terms regarding atomic displacement parameters, please see [1]), + it is often of the order 0.05. \f$d_{hkl}\f$ is alculated using + the unit cell. The model used in this class is isotropic + (hence the class name), which may be insufficient depending on the crystal + 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 - set, - the internally stored space group is used to generate all positions that are - symmetrically equivalent. In the structure factor calculation method - all contributions are summed. + set, the internally stored space group is used to generate all positions + that are symmetrically equivalent. In the structure factor calculation + method all contributions are summed. 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, - also 3 additional positions. + \f$Fm\bar{3}m\f$, Cu atoms occupy the position (0,0,0) and, because + of the F-centering, also 3 additional positions. BraggScatterer_sptr cu = - BraggScattererFactory::Instance().createScatterer( - "IsotropicAtomBraggScatterer", - "Element=Cu; - SpaceGroup=F m -3 m") - cu->setProperty("UnitCell", unitCellToStr(cellCu)); + BraggScattererFactory::Instance().createScatterer( + "IsotropicAtomBraggScatterer", + "Element=Cu; SpaceGroup=F m -3 m") + cu->setProperty("UnitCell", unitCellToStr(cellCu)); StructureFactor F = cu->calculateStructureFactor(V3D(1, 1, 1)); The structure factor F contains contributions from all 4 copper atoms in the - cell. - This is convenient especially for general positions. The general position - of Fm-3m for example has 192 equivalents. + cell. This is convenient especially for general positions. + The general position of \f$Fm\bar{3}m\f$ for example has 192 equivalents. [1] http://ww1.iucr.org/comm/cnom/adp/finrep/finrep.html @@ -97,11 +106,6 @@ namespace Geometry { File change history is stored at: <https://github.com/mantidproject/mantid> Code Documentation is available at: <http://doxygen.mantidproject.org> */ -class IsotropicAtomBraggScatterer; - -typedef boost::shared_ptr<IsotropicAtomBraggScatterer> - IsotropicAtomBraggScatterer_sptr; - class MANTID_GEOMETRY_DLL IsotropicAtomBraggScatterer : public BraggScattererInCrystalStructure { public: diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/PointGroupFactory.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/PointGroupFactory.h index 16017ad7c25..edb6fde5ce5 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/PointGroupFactory.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/PointGroupFactory.h @@ -10,13 +10,14 @@ namespace Mantid { namespace Geometry { -/** PointGroupFactory +/** + @class PointGroupFactory A factory for point groups. Point group objects can be constructed by supplying the Hermann-Mauguin-symbol like this: PointGroup_sptr cubic = - PointGroupFactory::Instance().createPointgroup("m-3m"); + PointGroupFactory::Instance().createPointgroup("m-3m"); Furthermore it's possible to query available point groups, either all available diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/ProductOfCyclicGroups.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/ProductOfCyclicGroups.h index eff12fae255..4a7b49fc2e9 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/ProductOfCyclicGroups.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/ProductOfCyclicGroups.h @@ -7,7 +7,8 @@ namespace Mantid { namespace Geometry { -/** ProductOfCyclicGroups : +/** + @class ProductOfCyclicGroups ProductOfCyclicGroups expands a bit on the explanations given in CyclicGroup. As shown for example in [1], some point groups @@ -20,14 +21,14 @@ namespace Geometry { a cyclic group C_i. The resulting n groups ("factor groups") are 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 in code to generate even large groups from a few generators becomes very short using this class: - Group_const_sptr pointGroup422 = - GroupFactory::create<ProductOfCyclicGroups>("-y,x,z; x,-y,-z"); + Group_const_sptr pointGroup422 = + GroupFactory::create<ProductOfCyclicGroups>("-y,x,z; x,-y,-z"); This is for example used in SpaceGroupFactory to create space groups from a small set of generators supplied in the International Tables diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SpaceGroup.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SpaceGroup.h index df4691de5bf..654f3b40279 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SpaceGroup.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SpaceGroup.h @@ -11,7 +11,8 @@ namespace Mantid { namespace Geometry { -/** SpaceGroup : +/** + @class SpaceGroup A class for representing space groups, inheriting from Group. @@ -24,14 +25,13 @@ namespace Geometry { SpaceGroup may for example be used to generate all equivalent positions within the unit cell: - SpaceGroup_const_sptr someGroup; + SpaceGroup_const_sptr group; - V3D position(0.13, 0.54, 0.38); - std::vector<V3D> equivalents = - someGroup->getEquivalentPositions(position); + V3D position(0.13, 0.54, 0.38); + std::vector<V3D> equivalents = group->getEquivalentPositions(position); - The class should not be instantiated directly, see SpaceGroupFactory - instead. + The class should not be instantiated directly, see SpaceGroupFactoryImpl + instead. @author Michael Wedel, Paul Scherrer Institut - SINQ @date 03/10/2014 diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SpaceGroupFactory.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SpaceGroupFactory.h index e7ef26a4e32..df07af3307d 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SpaceGroupFactory.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SpaceGroupFactory.h @@ -14,7 +14,8 @@ namespace Geometry { bool MANTID_GEOMETRY_DLL isValidGeneratorString(const std::string &generatorString); -/** AbstractSpaceGroupGenerator +/** + * @class AbstractSpaceGroupGenerator * * AbstractSpaceGroupGenerator is used by SpaceGroupFactory to delay * (possibly costly) construction of space group prototype objects until @@ -86,7 +87,8 @@ protected: Group_const_sptr generateGroup() const; }; -/** SpaceGroupFactory +/** + @class SpaceGroupFactory This factory is used to create space group objects. Each space group should be created only once, which is why the factory works with diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SymmetryOperation.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SymmetryOperation.h index 1c0e60eac0f..7e8bfa04fa2 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SymmetryOperation.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SymmetryOperation.h @@ -10,55 +10,49 @@ namespace Mantid { namespace Geometry { -/** SymmetryOperation : +/** + @class SymmetryOperation Crystallographic symmetry operations are composed of a rotational component, which is represented by a matrix and a translational part, which is described by a vector. - In this interface, each symmetry operation has a so-called order, which is - an - unsigned integer describing the number of times a symmetry operation - has to be applied to an object until it is identical. + In this interface, each symmetry operation has a so-called order, + which is an unsigned integer describing the number of times a + symmetry operation has to be applied to an object until it is identical. Furthermore, each symmetry operation has a string-identifier. It contains - the - Jones faithful representation of the operation, as it is commonly used in - many crystallographic programs and of course the International Tables + the Jones faithful representation of the operation, as it is commonly used + in many crystallographic programs and of course the International Tables for Crystallography, where the symmetry operations and their representations may be found [1]. The Jones faithful notation is a very concise way of describing - matrix/vector pairs. - The matrix/vector pair of a two-fold rotation axis along z is for example: + matrix/vector pairs. The matrix/vector pair of a two-fold rotation + axis along z is for example: Matrix Vector - -1 0 0 0 - 0 -1 0 0 - 0 0 1 0 + -1 0 0 0 + 0 -1 0 0 + 0 0 1 0 - This is described by the symbol '-x,-y,z'. If it were a 2_1 screw axis in - the same - direction, the matrix/vector pair would look like this: + This is described by the symbol '-x,-y,z'. If it were a 2_1 screw axis + in the same direction, the matrix/vector pair would look like this: Matrix Vector - -1 0 0 0 - 0 -1 0 0 - 0 0 1 1/2 + -1 0 0 0 + 0 -1 0 0 + 0 0 1 1/2 And this is represented by the string '-x,-y,z+1/2'. In hexagonal systems - there - are often operations involving 1/3 or 2/3, so the translational part is kept - as - a vector of rational numbers in order to carry out precise calculations. For - details, - see the class V3R. + there are often operations involving 1/3 or 2/3, so the translational part + is kept as a vector of rational numbers in order to carry out precise + calculations. For details, see the class Kernel::V3R. Using the symmetry operations in code is easy, since - SymmetryOperationSymbolParser is - automatically called by the string-based constructor of SymmetryOperation - and the multiplication - operator is overloaded: + SymmetryOperationSymbolParser is automatically called by the string-based + constructor of SymmetryOperation and the multiplication operator + is overloaded: SymmetryOperation inversion("-x,-y,-z"); V3D hklPrime = inversion * V3D(1, 1, -1); // results in -1, -1, 1 @@ -67,8 +61,7 @@ namespace Geometry { multiplied with and V3R can be added to (for example V3R, V3D). A special case is the multiplication of several symmetry operations, which - can - be used to generate new operations: + can be used to generate new operations: SymmetryOperation inversion("-x,-y,-z"); SymmetryOperation identity = inversion * inversion; @@ -77,11 +70,11 @@ namespace Geometry { the interval (0, 1] when two symmetry operations are combined. Constructing a SymmetryOperation object from a string is heavy, because the - string - has to be parsed every time. It's preferable to use the available factory: + string has to be parsed every time. It's preferable to use + the available factory: 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 instance on subsequent calls with the same string. @@ -90,7 +83,7 @@ namespace Geometry { References: [1] International Tables for Crystallography, Volume A, Fourth edition, - pp 797-798. + pp 797-798. @author Michael Wedel, Paul Scherrer Institut - SINQ @@ -116,8 +109,6 @@ namespace Geometry { File change history is stored at: <https://github.com/mantidproject/mantid> Code Documentation is available at: <http://doxygen.mantidproject.org> */ -class SymmetryOperation; - class MANTID_GEOMETRY_DLL SymmetryOperation { public: SymmetryOperation(); diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SymmetryOperationFactory.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SymmetryOperationFactory.h index 41e5eb0d1c7..eabe3833aea 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SymmetryOperationFactory.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SymmetryOperationFactory.h @@ -13,7 +13,8 @@ namespace Mantid { namespace Geometry { -/** SymmetryOperationFactory +/** + @class SymmetryOperationFactoryImpl A factory for symmetry operations. Symmetry operations are stored with respect to their identifier (see SymmetryOperation for details). @@ -21,7 +22,7 @@ namespace Geometry { Creation of symmetry operations is then performed like this: SymmetryOperations inversion = - SymmetryOperationFactory::Instance().createSymOp("x,y,z"); + SymmetryOperationFactory::Instance().createSymOp("x,y,z"); Creating a symmetry operation object automatically registers the object as a prototype and subsequent creations are much more efficient because diff --git a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SymmetryOperationSymbolParser.h b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SymmetryOperationSymbolParser.h index 6cb88453e0d..bca3a319af2 100644 --- a/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SymmetryOperationSymbolParser.h +++ b/Code/Mantid/Framework/Geometry/inc/MantidGeometry/Crystal/SymmetryOperationSymbolParser.h @@ -8,7 +8,8 @@ namespace Mantid { namespace Geometry { -/** SymmetryOperationSymbolParser : +/** + @class SymmetryOperationSymbolParser This is a parser for symmetry operation symbols in the Jones faithful representation. It creates matrix and a vector component diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/BraggScatterer.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/BraggScatterer.cpp index 2f433c0d18a..1941d8f6fdb 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/BraggScatterer.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/BraggScatterer.cpp @@ -52,9 +52,8 @@ bool BraggScatterer::isPropertyExposedToComposite(Property *property) const { * Exposes the property with the supplied name to BraggScattererComposite * * When a property is marked to be exposed to BraggScattererComposite, the - *composite - * also declares this property and tries to propagate the value assigned to the - * composite's property to all its members. + * composite also declares this property and tries to propagate the value + * assigned to the composite's property to all its members. * * @param propertyName :: Name of the parameter that should be exposed. */ diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/BraggScattererFactory.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/BraggScattererFactory.cpp index 929e94293e9..14a4e4bd97f 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/BraggScattererFactory.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/BraggScattererFactory.cpp @@ -8,16 +8,12 @@ namespace Geometry { * Creates an initialized instance of the desired scatterer class * * This method tries to construct an instance of the class specified by the - *"name"-parameter. - * If it is not found, an exception is thrown (see DynamicFactory::create). - *Otherwise, - * the object is initialized. If the second argument is not empty, it is - *expected - * to contain a semi-colon separated list of "name=value"-pairs. These pairs - *need to be + * "name"-parameter. If it is not found, an exception is thrown + * (see DynamicFactory::create). Otherwise, the object is initialized. + * If the second argument is not empty, it is 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 - *example in - * the general class documentation. + * example in the general class documentation. * * @param name :: Class name to construct. * @param properties :: Semi-colon separated "name=value"-pairs. diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/BraggScattererInCrystalStructure.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/BraggScattererInCrystalStructure.cpp index 52077d24476..a442625405a 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/BraggScattererInCrystalStructure.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/BraggScattererInCrystalStructure.cpp @@ -95,14 +95,12 @@ void BraggScattererInCrystalStructure::declareProperties() { * Additional property processing * * Takes care of handling new property values, for example for construction of a - *space group - * from string and so on. + * space group from string and so on. * * Please note that derived classes should not re-implement this method, as * the processing for the base properties is absolutely necessary. Instead, all - *deriving - * classes should override the method afterScattererPropertySet, which is called - * from this method. + * deriving classes should override the method afterScattererPropertySet, + * which is called from this method. */ void BraggScattererInCrystalStructure::afterPropertySet( const std::string &propertyName) { diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/CompositeBraggScatterer.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/CompositeBraggScatterer.cpp index f7dac1ff022..077dd92c759 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/CompositeBraggScatterer.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/CompositeBraggScatterer.cpp @@ -143,11 +143,9 @@ void CompositeBraggScatterer::propagatePropertyToScatterer( * Synchronize properties with scatterer members * * This method synchronizes the properties of CompositeBraggScatterer with the - *properties - * of the contained BraggScatterer instances. It adds new properties if required - * and removed properties that are no longer used (for example because the - *member that - * introduced the property has been removed). + * properties of the contained BraggScatterer instances. It adds new properties + * if required and removed properties that are no longer used (for example + * because the member that introduced the property has been removed). */ void CompositeBraggScatterer::redeclareProperties() { std::map<std::string, size_t> propertyUseCount = getPropertyCountMap(); diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/IsotropicAtomBraggScatterer.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/IsotropicAtomBraggScatterer.cpp index fc5614779f9..80e8f54eebf 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/IsotropicAtomBraggScatterer.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/IsotropicAtomBraggScatterer.cpp @@ -57,8 +57,8 @@ double IsotropicAtomBraggScatterer::getU() const { return getProperty("U"); } * Calculates the structure factor * * This method calculates the structure factor, taking into account - *contributions from all - * atoms on the stored position _and all symmetrically equivalent_. + * contributions from all atoms on the stored position + * _and all symmetrically equivalent_. * For details, please refer to the class documentation in the header file. * * @param hkl :: HKL for which the structure factor should be calculated diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/PointGroup.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/PointGroup.cpp index 86a905f6856..7056668b20f 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/PointGroup.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/PointGroup.cpp @@ -64,10 +64,8 @@ std::string PointGroup::getSymbol() const { return m_symbolHM; } * * This method applies all transformation matrices to the supplied hkl and puts * it into a set, which is returned in the end. Using a set ensures that each - *hkl - * occurs once and only once. This set is the set of equivalent hkls, specific - *to - * a concrete point group. + * hkl occurs once and only once. This set is the set of equivalent hkls, + * specific to a concrete point group. * * The symmetry operations need to be set prior to calling this method by a call * to PointGroup::setTransformationMatrices. @@ -115,25 +113,23 @@ std::vector<SymmetryOperation> PointGroup::getSymmetryOperations() const { * Returns all symmetry operations generated by a list of symmetry operations * * This method takes a vector of symmetry operations and returns the resulting - *set of - * symmetry operations. It does so by applying the first symmetry operation - *(order - 1) times - * to an identity operation which results in a list of (order - 1) matrices. - *Then it multiplies - * the second operation to all these operations, and so on. + * set of symmetry operations. It does so by applying the first symmetry + * operation (order - 1) times to an identity operation which results in a list + * of (order - 1) matrices. Then it multiplies the second operation to all these + * operations, and so on. * * Using this method, all point groups can be described using a maximum of four * symmetry operations. m-3m for example, which is defined in PointGroupLaue13, * needs only four symmetry operations to generate all 48 transformation - *matrices. + * matrices. * It does not matter which symmetry operations are chosen, as long * as the chosen set generates all (but not more than) present in the point - *group. For 2/m, one - * could for example either choose (m and 2) or (m and -1) or (2 and -1). + * group. For 2/m, one could for example either choose (m and 2) + * or (m and -1) or (2 and -1). * * All 32 point groups can be found in: * International Tables for Crystallography A, 2006, pp. 770 - 790 (Table - *10.1.2.2) + * 10.1.2.2) * * @param symmetryOperations * @return diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/SpaceGroup.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/SpaceGroup.cpp index 213b81774b1..aa1b30cf979 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/SpaceGroup.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/SpaceGroup.cpp @@ -9,8 +9,7 @@ namespace Geometry { * This constructor creates a space group with the symmetry operations contained * in the Group-parameter and assigns the given number and symbol. * - * @param itNumber :: Space group number according to International Tables for - *Crystallography A + * @param itNumber :: Space group number (ITA) * @param hmSymbol :: Herman-Mauguin symbol for the space group * @param group :: Group that contains all symmetry operations (including *centering). diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/SpaceGroupFactory.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/SpaceGroupFactory.cpp index 54a07d94f9d..325f8f321f4 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/SpaceGroupFactory.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/SpaceGroupFactory.cpp @@ -51,7 +51,7 @@ SpaceGroup_const_sptr AbstractSpaceGroupGenerator::getPrototype() { * * Constructs a space group object using a Group generated by the pure virtual * generateGroup()-method along with the stored number and - *Hermann-Mauguin-symbol. + * Hermann-Mauguin-symbol. * * generateGroup() has to be implemented by sub-classes and should probably use * the generatorInformation supplied to the constructor. @@ -201,22 +201,18 @@ void SpaceGroupFactoryImpl::unsubscribeSpaceGroup(const std::string &hmSymbol) { * Subscribes a space group into the factory using generators * * With this method one can register a space group that is generated by an - *algorithm - * based on the instructions in [1]. Currently it's important that the Herrman- - * Mauguin symbol starts with an upper case letter, because that is used to - *generate - * centering translations (it should be upper case anyway). + * algorithm based on the instructions in [1]. Currently it's important that + * the Herrman-Mauguin symbol starts with an upper case letter, because that is + * used to generate centering translations (it should be upper case anyway). * * The method will throw an exception if the number or symbol is already - *registered. + * registered. * * [1] Shmueli, U. Acta Crystallogr. A 40, 559–567 (1984). * http://dx.doi.org/10.1107/S0108767384001161 * - * @param number :: Space group number according to International Tables for - *Crystallography A + * @param number :: Space group number (ITA) * @param hmSymbol :: Herrman-Mauguin symbol with upper case first letter - *(centering). * @param generators :: Generating symmetry operations. */ void SpaceGroupFactoryImpl::subscribeGeneratedSpaceGroup( diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/SymmetryOperation.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/SymmetryOperation.cpp index a5270bd12bf..1776a9a77d7 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/SymmetryOperation.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/SymmetryOperation.cpp @@ -19,12 +19,10 @@ SymmetryOperation::SymmetryOperation() * Construct a symmetry operation from a Jones faithful representation * * This method invokes SymmetryOperationSymbolParser and tries to parse the - *supplied string. - * Please not that parsing this string is not very efficient. If you have to - *create the same - * operations very often, use SymmetryOperationFactory, which works with the - *copy constructor - * - it's orders of magnitude faster. + * supplied string. Please not that parsing this string is not very efficient. + * If you have to create the same operations very often, use + * SymmetryOperationFactory, which works with the copy constructor - it's orders + * of magnitude faster. * * @param identifier :: Jones faithful representation of a symmetry operation */ @@ -193,10 +191,9 @@ SymmetryOperation::getOrderFromMatrix(const Kernel::IntMatrix &matrix) const { * Wraps a V3R to the interval (0, 1] * * For certain crystallographic calculations it is necessary to constrain - *fractional - * coordinates to the unit cell, for example to generate all atomic positions - * in the cell. In this context, the fractional coordinate -0.45 is equal to - * "0.55 of the next cell", so it's transformed to 0.55. + * fractional coordinates to the unit cell, for example to generate all + * atomic positions in the cell. In this context, the fractional coordinate + * -0.45 is equal to "0.55 of the next cell", so it's transformed to 0.55. * * @param vector :: Input vector with arbitrary numbers. * @return Vector with components on the interval (0, 1] diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/SymmetryOperationSymbolParser.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/SymmetryOperationSymbolParser.cpp index 28fee8c5550..24fedd2e69e 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/SymmetryOperationSymbolParser.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/SymmetryOperationSymbolParser.cpp @@ -14,24 +14,21 @@ SymmetryOperationSymbolParser::SymmetryOperationSymbolParser() {} * Tries to parse the given symbol * * This method tries to parse a given symbol and returns the matrix/vector pair - *resulting from - * the parsing process. It takes a string representing a symmetry operation in - *the format: + * resulting from the parsing process. It takes a string representing a + * symmetry operation in the format: * x+a/b, -y-c/d, e/f-z * where x, y and z are the literals 'x', 'y' and 'z', while a-f are integers, - *representing - * rational numbers. The latter don't need to be present, a string "x,y,z" is - *valid. Leading plus-signs - * may be included if desired, so that "+x,+y,+z" is also valid. + * representing rational numbers. The latter don't need to be present, + * a string "x,y,z" is valid. Leading plus-signs may be included if desired, + * so that "+x,+y,+z" is also valid. * * If there is a problem, a Kernel::Exception::ParseError exception is thrown. * * See also SymmetryOperationSymbolParser::getNormalizedIdentifier, which - *performs the opposite operation. + * performs the opposite operation. * * @param identifier :: Symbol representing a symmetry operation - * @return Pair of Kernel::IntMatrix and V3R, representing the symmetry - *operation. + * @return Kernel::IntMatrix and V3R, representing the symmetry operation. */ std::pair<Kernel::IntMatrix, V3R> SymmetryOperationSymbolParser::parseIdentifier(const std::string &identifier) { -- GitLab