Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

ObjCryst::ScatteringPower Class Reference

Abstract Base Class to describe the scattering power of any Scatterer component in a crystal. More...

#include <ScatteringPower.h>

Inheritance diagram for ObjCryst::ScatteringPower::

ObjCryst::RefinableObj ObjCryst::GlobalScatteringPower ObjCryst::ScatteringPowerAtom List of all members.

Public Methods

 ScatteringPower ()
 ScatteringPower (const ScatteringPower &old)
virtual ~ScatteringPower ()
virtual const string & GetClassName () const
 Name for this class ("RefinableObj", "Crystal",...). This is only useful to distinguish different classes when picking up objects from the RefinableObj Global Registry.

virtual void operator= (const ScatteringPower &rhs)
virtual CrystVector_REAL GetScatteringFactor (const ScatteringData &data, const int spgSymPosIndex=-1) const=0
 Get the Scattering factor for all reflections of a given ScatteringData object. More...

virtual REAL GetForwardScatteringFactor (const RadiationType) const=0
 Get the scattering factor at (0,0,0). Used for scatterer (electron, nucleus) density generation.

virtual CrystVector_REAL GetTemperatureFactor (const ScatteringData &data, const int spgSymPosIndex=-1) const=0
 Get the temperature factor for all reflections of a given ScatteringData object. More...

virtual CrystMatrix_REAL GetResonantScattFactReal (const ScatteringData &data, const int spgSymPosIndex=-1) const=0
 Get the real part of the resonant scattering factor. More...

virtual CrystMatrix_REAL GetResonantScattFactImag (const ScatteringData &data, const int spgSymPosIndex=-1) const=0
 Get the imaginary part of the resonant scattering factor. More...

virtual bool IsScatteringFactorAnisotropic () const
 Is the scattering factor anisotropic ?

virtual bool IsTemperatureFactorAnisotropic () const
 Is the thermic factor anisotropic ?

virtual bool IsResonantScatteringAnisotropic () const
 Are the resonant scattering terms anisotropic ?

virtual const string & GetSymbol () const
 Symbol for this Scattering power (the atom name for atoms).

REAL GetBiso () const
 Returns the isotropic temperature B factor.

REAL & GetBiso ()
 Returns the isotropic temperature B factor.

virtual void SetBiso (const REAL newB)
 Sets the isotropic temperature B factor.

bool IsIsotropic () const
 Returns true if the scattering power is isotropic, else false.

long GetDynPopCorrIndex () const
 Get the number identifying this kind of scatterer, used to decide whether two scatterers are equivalent, for the dynamical occupancy correction.

long GetScatteringPowerId () const
 Unique number identifying this ScatteringPower object.

long GetNbScatteringPower () const
 Total number of ScatteringPower object.

const RefinableObjClockGetLastChangeClock () const
 ObjCrystClock time when the last modification was made to the object.

const string & GetColourName () const
 Get the (POV-Ray) name associated to the color (if any).

const float * GetColourRGB () const
 Get the float[3] array of RGB components defining the colour of this scattering power.

void SetColour (const string &colorName)
 Set the colour from the associated POV-Ray name.

void SetColour (const float r, const float g, const float b)
 Set the colour from RGB components (all between 0 and 1.).

virtual REAL GetRadius () const=0
 Return the physical radius of this type of scatterer (for 3D display purposes).
Warning:
this may be removed later.


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


Protected Methods

virtual void InitRefParList ()=0
virtual void Init ()
 Initialization of the object, used by all constructors, and operator=.

virtual void InitRGBColour ()
 Get RGB Colour coordinates from Colour Name.


Protected Attributes

long mDynPopCorrIndex
 number identifying this kind of scatterer, for the dynamical occupancy correction. Right now it is the atomic number.

REAL mBiso
 Temperature isotropic B factor.

bool mIsIsotropic
 Is the scattering isotropic ?

CrystVector_REAL mBeta
 Anisotropic Beta(ij).

const long mScatteringPowerId
 Unique number identifying this ScatteringPower. Needed for avoiding re-calculations in ScatteringData.

RefinableObjClock mClock
 Clock.

string mColourName
 Colour for this ScatteringPower (from POVRay).

float mColourRGB [3]
 Colour for this ScatteringPower using RGB.


Static Protected Attributes

long mNbScatteringPower
 Current unique number to use for a new ScatteringPower object= total number of objects that have been allocated.

ScatteringPower * mspScatteringPowerGlobalList [1000]
 Keep a list of all objects.

CrystVector_bool mspScatteringPowerGlobalListIsUsed
 To know which objects are available in the list.


Friends

const ScatteringPower & GetScatteringPower (const long i)

Detailed Description

Abstract Base Class to describe the scattering power of any Scatterer component in a crystal.

This includes:

The interface is independent of the radiation type.

This base class is designed to handle both isotropic and anisotropic versions of scattering, temperature and anomalous factors.

Todo:
Anisotropic scattering (temperature factor especially) code, using derived classes

Clarify organization by removing any 'real' data from the top, abstract base class (eg remove Biso and Betaij), and by creating derived classes. Optionnaly 3 classes (used as members of ScatteringPower) could be created, TemperatureFactor, ScatteringFactor, and ResonantScatteringFactor. In any way the design of this class should not evolve, so that code using the ScatteringPower interface will remain compatible whatever modifications are made.


Member Function Documentation

virtual void ObjCryst::ScatteringPower::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 \RefinableObj, 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.

virtual CrystMatrix_REAL ObjCryst::ScatteringPower::GetResonantScattFactImag const ScatteringData   data,
const int    spgSymPosIndex = -1
const [pure virtual]
 

Get the imaginary part of the resonant scattering factor.

Returns:
a matrix where each row corresponds to each wavelength (currently only monochromatic experiments are made so there is only one row), and each column corresponds to each reflection only if the scattering term is anisotropic, which is not the case so far...
Parameters:
data:  the ScatteringData object, giving access to all the reflections, and a list of wavelengths.
spgSymPosIndex:  if the ScatteringPower is anisotropic, then the different symmetrics will not have the same scattering power for all reflections. This parameter is the index of the symmetric position in the Spacegroup. If spgSymPosIndex=-1, the isotropic values are returned.
Warning:
There is no anisotropic code yet, so spgSymPosIndex is simply ignored so far , but the design of this function is general for any anisotropic scattering.

Reimplemented in ObjCryst::ScatteringPowerAtom, and ObjCryst::GlobalScatteringPower.

virtual CrystMatrix_REAL ObjCryst::ScatteringPower::GetResonantScattFactReal const ScatteringData   data,
const int    spgSymPosIndex = -1
const [pure virtual]
 

Get the real part of the resonant scattering factor.

Returns:
a matrix where each row corresponds to each wavelength (currently only monochromatic experiments are made so there is only one row), and each column corresponds to each reflection only if the scattering term is anisotropic, which is not the case so far...
Parameters:
data:  the ScatteringData object, giving access to all the reflections and a list of wavelengths).
spgSymPosIndex:  if the ScatteringPower is anisotropic, then the different symmetrics will not have the same scattering power for all reflections. This parameter is the index of the symmetric position in the Spacegroup. If spgSymPosIndex=-1, the isotropic values are returned.
Warning:
There is no anisotropic code yet, so spgSymPosIndex is simply ignored so far , but the design of this function is general for any anisotropic scattering.

Reimplemented in ObjCryst::ScatteringPowerAtom, and ObjCryst::GlobalScatteringPower.

virtual CrystVector_REAL ObjCryst::ScatteringPower::GetScatteringFactor const ScatteringData   data,
const int    spgSymPosIndex = -1
const [pure virtual]
 

Get the Scattering factor for all reflections of a given ScatteringData object.

Returns:
a vector with the scattering factor for all reflections, in the same order as in the ScatteringData object. This format is independent of the radiation type (X-Ray, neutron..).
Parameters:
data:  the ScatteringData object, giving access to all the reflections.
spgSymPosIndex:  if the ScatteringPower is anisotropic, then the different symmetrics will not have the same scattering power for all reflections. This parameter is the index of the symmetric position in the Spacegroup. If spgSymPosIndex=-1, the isotropic values are returned.
Warning:
There is no anisotropic code yet, so spgSymPosIndex is simply ignored so far , but the design of this function is general for any anisotropic scattering.

Reimplemented in ObjCryst::ScatteringPowerAtom, and ObjCryst::GlobalScatteringPower.

virtual CrystVector_REAL ObjCryst::ScatteringPower::GetTemperatureFactor const ScatteringData   data,
const int    spgSymPosIndex = -1
const [pure virtual]
 

Get the temperature factor for all reflections of a given ScatteringData object.

Returns:
a vector with the temperature factor for all reflections, in the same order as in the ScatteringData object.
Parameters:
data:  the ScatteringData object, giving access to all the reflections.
spgSymPosIndex:  if the ScatteringPower is anisotropic, then the different symmetrics will not have the same scattering power for all reflections. This parameter is the index of the symmetric position in the Spacegroup. If spgSymPosIndex=-1, the isotropic values are returned.
Warning:
There is no anisotropic code yet, so spgSymPosIndex is simply ignored so far , but the design of this function is general for any anisotropic scattering.

Reimplemented in ObjCryst::ScatteringPowerAtom, and ObjCryst::GlobalScatteringPower.


The documentation for this class was generated from the following file:
Generated on Tue Feb 5 17:37:26 2002 for ObjCryst++ by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001