Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ObjCryst::Atom Class Reference

The basic atom scatterer, in a crystal. More...

Inheritance diagram for ObjCryst::Atom:

Inheritance graph
[legend]
Collaboration diagram for ObjCryst::Atom:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Atom ()
 Default constructor.

 Atom (const REAL x, const REAL y, const REAL z, const string &name, const ScatteringPower *pow)
 Atom constructor.

 Atom (const REAL x, const REAL y, const REAL z, const string &name, const ScatteringPower *pow, const REAL popu)
 Atom constructor.

 Atom (const Atom &old)
 Copy constructor.

virtual AtomCreateCopy () const
 ~Atom ()
 Destructor...

virtual const string & GetClassName () const
 Name for this class ("RefinableObj", "Crystal",...).

virtual void operator= (const Atom &rhs)
void Init (const REAL x, const REAL y, const REAL z, const string &name, const ScatteringPower *pow, const REAL popu=1)
 initialize the atom (used for arrays of atoms).

virtual int GetNbComponent () const
 Number of components in the scatterer (eg number of point scatterers).

virtual const ScatteringComponentListGetScatteringComponentList () const
 Get the list of all scattering components for this scatterer.

virtual string GetComponentName (const int i) const
 Name for the i-th component of this scatterer.

virtual void Print () const
 Print some info about the scatterer (ideally this should be one line...).

REAL GetMass () const
 Returns the molar mass of the atom.

REAL GetRadius () const
 Returns the radius (in Angstroems) of the atom.

virtual ostream & POVRayDescription (ostream &os, const CrystalPOVRayOptions &options) const
 XMLOutput a description of the scatterer for POVRay.

virtual void GLInitDisplayList (const bool onlyIndependentAtoms=false, const REAL xMin=-.1, const REAL xMax=1.1, const REAL yMin=-.1, const REAL yMax=1.1, const REAL zMin=-.1, const REAL zMax=1.1, const bool displayEnantiomer=false, const bool displayNames=false) const
bool IsDummy () const
 Is this a dummy atom ? (ie no ScatteringPower) Dummy atoms should not exist !

virtual void XMLOutput (ostream &os, int indent=0) const
 Output to stream in well-formed XML.

virtual void XMLInput (istream &is, const XMLCrystTag &tag)
 Input From stream.

const ScatteringPowerGetScatteringPower () const
 Get the ScatteringPowerAtom corresponding to this atom.

virtual void GetGeneGroup (const RefinableObj &obj, CrystVector_uint &groupIndex, unsigned int &firstGroup) const
 Get the gene group assigned to each parameter.


Private Member Functions

virtual void InitRefParList ()
 Prepare refinable parameters for the scatterer object.


Private Attributes

ScatteringComponentList mScattCompList
 The list of scattering components.

const ScatteringPowermpScattPowAtom
 The ScatteringPowerAtom associated to that atom.


Detailed Description

The basic atom scatterer, in a crystal.

This class records the position of the atom, and has a pointer to its ScatteringPowerAtom.

Note:
there can be 'Dummy' atoms, for which the used symbol is "X", and which have no scattering power (use with caution: dummy atoms are only supposed to be used within ZScatterer) ####################################################################


Constructor & Destructor Documentation

ObjCryst::Atom::Atom  ) 
 

Default constructor.

The Atom must be initialized thereafter using Atom::Init()

ObjCryst::Atom::Atom const REAL  x,
const REAL  y,
const REAL  z,
const string &  name,
const ScatteringPower pow
 

Atom constructor.

Parameters:
x,y,z : fractional coordinates of the atom
pow : the ScatteringPower associated to this atom. Must be allocated separately.
name : name of the atom ('Ta1','Sm2', 'Tungsten_1'...). The name can have any format but spaces should be avoided.

ObjCryst::Atom::Atom const REAL  x,
const REAL  y,
const REAL  z,
const string &  name,
const ScatteringPower pow,
const REAL  popu
 

Atom constructor.

Parameters:
x,y,z : fractional coordinates of the atom
popu : the population of the atom (0.0->1.0) This should take into account the multiplicity of the atom. For an atom in group P2 and on the 2 axis, this should be set to 0.5, unless you are using the dynamical occupancy correction (recommended for global optimizations). See Crystal::CalcDynPopCorr() and Crystal::mUseDynPopCorr
pow : the ScatteringPower associated to this atom. Must be allocated separatly.
name : name of the atom ('Ta1','Sm2', 'Tungsten_1'...). The name can have any format but spaces should be avoided (just a precaution)

ObjCryst::Atom::Atom const Atom old  ) 
 

Copy constructor.

ObjCryst::Atom::~Atom  ) 
 

Destructor...


Member Function Documentation

virtual Atom* ObjCryst::Atom::CreateCopy  )  const [virtual]
 

For internal use only.

so-called Virtual copy constructor, needed to make copies of arrays of Scatterers

Implements ObjCryst::Scatterer.

virtual const string& ObjCryst::Atom::GetClassName  )  const [virtual]
 

Name for this class ("RefinableObj", "Crystal",...).

This is only useful to distinguish different classes when picking up objects from the RefinableObj Global Registry

Reimplemented from ObjCryst::Scatterer.

virtual string ObjCryst::Atom::GetComponentName const int  i  )  const [virtual]
 

Name for the i-th component of this scatterer.

If the component is an Atom, Then the name is that of the atom. Else, it is the name of the scatterer plus the component number in the scatterer plus the name of the ScatteringPower.

Note:
It would be better to return a reference, but we don't want to keep a name for all components... Weeelll, needs some more thinking... see what performance hit results (if any).
Bug:
does not take into account dummy atoms !!

Implements ObjCryst::Scatterer.

virtual void ObjCryst::Atom::GetGeneGroup const RefinableObj obj,
CrystVector_uint &  groupIndex,
unsigned int &  firstGroup
const [virtual]
 

Get the gene group assigned to each parameter.

Each parameter (a gene in terms of genetic algorithms) can be assigned to a gene group. Thus when mating two configurations, genes will be exchanged by groups. By default (in the base RefinabeObj class), each parameter is alone in its group. Derived classes can group genes for a better s** life.

The number identifying a gene group only has a meaning in a given object. It can also change on subsequent calls, and thus is not unique.

Parameters:
obj the , supplied by an algorithm class (OptimizationObj,..), which contains a list of parameters, some of which (but possibly all or none) are parameters belonging to this object.
groupIndex a vector of unsigned integers, one for each parameter in the input object, giving an unsigned integer value as gene group index. At the beginning this vector should contain only zeros (no group assigned).
firstGroup this is the number of groups which have already been assigned, plus one. The gene groups returned by this object will start from this value, and increment firstGroup for each gene group used, so that different RefinableObj cannot share a gene group.
Note:
this function is not optimized, and should only be called at the beginning of a refinement.

Reimplemented from ObjCryst::RefinableObj.

REAL ObjCryst::Atom::GetMass  )  const
 

Returns the molar mass of the atom.

Values are extracted from the 'atominfo' package, which uses data from the CRC Handbook of Chemistry & Physics, 63rd & 70th editions The Mass is actually extracted from the ScatteringPowerAtom.

virtual int ObjCryst::Atom::GetNbComponent  )  const [virtual]
 

Number of components in the scatterer (eg number of point scatterers).

Implements ObjCryst::Scatterer.

REAL ObjCryst::Atom::GetRadius  )  const
 

Returns the radius (in Angstroems) of the atom.

Values are extracted from the 'atominfo' package, which uses data from the ICSD/CRYSTIN Manual The Radius is extracted from the ScatteringPowerAtom.

virtual const ScatteringComponentList& ObjCryst::Atom::GetScatteringComponentList  )  const [virtual]
 

Get the list of all scattering components for this scatterer.

This is the most important function of this class, giving the list of scattering positions along with the associated ScatteringPower.

Implements ObjCryst::Scatterer.

const ScatteringPower& ObjCryst::Atom::GetScatteringPower  )  const
 

Get the ScatteringPowerAtom corresponding to this atom.

virtual void ObjCryst::Atom::GLInitDisplayList const bool  onlyIndependentAtoms = false,
const REAL  xMin = -.1,
const REAL  xMax = 1.1,
const REAL  yMin = -.1,
const REAL  yMax = 1.1,
const REAL  zMin = -.1,
const REAL  zMax = 1.1,
const bool  displayEnantiomer = false,
const bool  displayNames = false
const [virtual]
 

For internal use only.

Create an OpenGL Display List of the scatterer. This should only be called by a Crystal object.

Parameters:
noSymmetrics: if false (the default), then all symmetrics are shown in the 3D display, within the limits defined by the min/max parameters \ param xMin,xMax,yMin,yMax,zMin,zMax: in fractionnal coordinates, the region in which we want scaterrer to be displayed. The test is made on the center of the scatterer (eg a ZScatterer (molecule) will not be 'cut' on the border).
displayNames: if true, only the names of the scatterers will be displayed, at the position of the scatterers (to actually see them, they will have to be translated with respect to the drawing of the scatterers).

Implements ObjCryst::Scatterer.

void ObjCryst::Atom::Init const REAL  x,
const REAL  y,
const REAL  z,
const string &  name,
const ScatteringPower pow,
const REAL  popu = 1
 

initialize the atom (used for arrays of atoms).

Parameters:
x,y,z : fractional coordinates of the atom
pow : the ScatteringPower associated to this atom. Must be allocated separately.
name : name of the atom ('Ta1','Sm2', 'Tungsten_1'...).

virtual void ObjCryst::Atom::InitRefParList  )  [private, virtual]
 

Prepare refinable parameters for the scatterer object.

Implements ObjCryst::Scatterer.

bool ObjCryst::Atom::IsDummy  )  const
 

Is this a dummy atom ? (ie no ScatteringPower) Dummy atoms should not exist !

virtual void ObjCryst::Atom::operator= const Atom rhs  )  [virtual]
 

virtual ostream& ObjCryst::Atom::POVRayDescription ostream &  os,
const CrystalPOVRayOptions options
const [virtual]
 

XMLOutput a description of the scatterer for POVRay.

Implements ObjCryst::Scatterer.

virtual void ObjCryst::Atom::Print  )  const [virtual]
 

Print some info about the scatterer (ideally this should be one line...).

Implements ObjCryst::Scatterer.

virtual void ObjCryst::Atom::XMLInput istream &  is,
const XMLCrystTag tag
[virtual]
 

Input From stream.

Todo:
Add an bool XMLInputTag(is,tag) function to recognize all the tags from the stream. So that each inherited class can use the XMLInputTag function from its parent (ie take advantage of inheritance). The children class would first try to interpret the tag, then if unsuccessful would pass it to its parent (thus allowing overloading), etc...

Reimplemented from ObjCryst::RefinableObj.

virtual void ObjCryst::Atom::XMLOutput ostream &  os,
int  indent = 0
const [virtual]
 

Output to stream in well-formed XML.

Todo:
Use inheritance.. as for XMLInputTag()...

Reimplemented from ObjCryst::RefinableObj.


Member Data Documentation

const ScatteringPower* ObjCryst::Atom::mpScattPowAtom [private]
 

The ScatteringPowerAtom associated to that atom.

ScatteringComponentList ObjCryst::Atom::mScattCompList [mutable, private]
 

The list of scattering components.


The documentation for this class was generated from the following file:
Generated on Tue Nov 14 15:03:44 2006 for ObjCryst++ by doxygen 1.3.6