OBUnitCell Class Reference

Used for storing information about periodic boundary conditions with conversion to/from translation vectors and (a, b, c, alpha, beta, gamma) More...

#include <openbabel/generic.h>

Inheritance diagram for OBUnitCell:
OBGenericData

List of all members.

Public Types

enum  LatticeType {
  Undefined, Triclinic, Monoclinic, Orthorhombic,
  Tetragonal, Rhombohedral, Hexagonal, Cubic
}

Public Member Functions

 OBUnitCell ()
 OBUnitCell (const OBUnitCell &)
virtual OBGenericDataClone (OBBase *) const
 ~OBUnitCell ()
OBUnitCelloperator= (const OBUnitCell &)
void SetData (const double a, const double b, const double c, const double alpha, const double beta, const double gamma)
void SetData (const vector3 v1, const vector3 v2, const vector3 v3)
void SetData (const matrix3x3 m)
void SetOffset (const vector3 v1)
void SetSpaceGroup (const SpaceGroup *sg)
void SetSpaceGroup (const std::string sg)
void SetSpaceGroup (const int sg)
void SetLatticeType (const LatticeType lt)
void FillUnitCell (OBMol *)
double GetA ()
double GetB ()
double GetC ()
double GetAlpha ()
double GetBeta ()
double GetGamma ()
vector3 GetOffset ()
const SpaceGroupGetSpaceGroup ()
const std::string GetSpaceGroupName ()
LatticeType GetLatticeType (int spacegroup)
LatticeType GetLatticeType ()
std::vector< vector3GetCellVectors ()
matrix3x3 GetCellMatrix ()
matrix3x3 GetOrthoMatrix ()
matrix3x3 GetOrientationMatrix ()
matrix3x3 GetFractionalMatrix ()
vector3 FractionalToCartesian (vector3 frac)
vector3 CartesianToFractional (vector3 cart)
vector3 WrapCartesianCoordinate (vector3 cart)
vector3 WrapFractionalCoordinate (vector3 frac)
int GetSpaceGroupNumber (std::string name="")
double GetCellVolume ()
void SetAttribute (const std::string &v)
void SetOrigin (const DataOrigin s)
virtual const std::string & GetAttribute () const
unsigned int GetDataType () const
virtual const std::string & GetValue () const
virtual DataOrigin GetOrigin () const

Protected Attributes

matrix3x3 _mOrtho
matrix3x3 _mOrient
vector3 _offset
std::string _spaceGroupName
const SpaceGroup_spaceGroup
LatticeType _lattice
std::string _attr
unsigned int _type
DataOrigin _source

Detailed Description

Used for storing information about periodic boundary conditions with conversion to/from translation vectors and (a, b, c, alpha, beta, gamma)


Member Enumeration Documentation

Enumerator:
Undefined 
Triclinic 
Monoclinic 
Orthorhombic 
Tetragonal 
Rhombohedral 

also called trigonal

Hexagonal 
Cubic 

Constructor & Destructor Documentation

OBUnitCell (  )

public constructor

OBUnitCell ( const OBUnitCell src )
~OBUnitCell (  ) [inline]

Member Function Documentation

virtual OBGenericData* Clone ( OBBase  ) const [inline, virtual]

Reimplemented from OBGenericData.

OBUnitCell & operator= ( const OBUnitCell src )
void SetData ( const double  a,
const double  b,
const double  c,
const double  alpha,
const double  beta,
const double  gamma 
)

Constructs the cell matrix in lower triangular form from the values supplied.

Implements blue-obelisk:calculateOrthogonalisationMatrix

Parameters:
aThe length a
bThe length b
cThe length c
alphaThe angle alpha
betaThe angle beta
gammaThe angle gamma

Referenced by OBUnitCell::SetData().

void SetData ( const vector3  v1,
const vector3  v2,
const vector3  v3 
)

Constructs the cell matrix using the supplied row vectors.

Implements blue-obelisk:calculateOrthogonalisationMatrix

Parameters:
v1The x-vector
v2The y-vector
v3The z-vector
See also:
OBUnitCell::GetCellVectors
void SetData ( const matrix3x3  m )

Sets the unit cell matrix.

Implements blue-obelisk:calculateOrthogonalisationMatrix

Parameters:
mThe unit cell matrix (row vectors)
See also:
OBUnitCell::GetCellMatrix
void SetOffset ( const vector3  v1 )

Set the offset to the origin to v1.

void SetSpaceGroup ( const SpaceGroup sg ) [inline]

Set the space group for this unit cell. Does not create an OBSymmetryData entry

Referenced by OBUnitCell::FillUnitCell().

void SetSpaceGroup ( const std::string  sg ) [inline]

Set the space group symbol for this unit cell. Does not create an OBSymmetryData entry or attempt to convert between different symbol notations

void SetSpaceGroup ( const int  sg ) [inline]

Set the space group for this unit cell. Each spacegroup-symbol has a numeric equivalent which is easier to use to convert between notations. Does not create an OBSymmetryData entry or attempt to convert between different symbol notations

void SetLatticeType ( const LatticeType  lt ) [inline]

Set the Bravais lattice type for this unit cell.

void FillUnitCell ( OBMol mol )

Duplicate symmetry-unique atoms to fill out the unit cell of the molecule, based on the known space group

double GetA (  )
Returns:
vector a

Referenced by OBUnitCell::GetLatticeType().

double GetB (  )
Returns:
vector b

Referenced by OBUnitCell::GetLatticeType().

double GetC (  )
Returns:
vector c

Referenced by OBUnitCell::GetLatticeType().

double GetAlpha (  )
Returns:
angle alpha

Referenced by OBUnitCell::GetLatticeType().

double GetBeta (  )
Returns:
angle beta

Referenced by OBUnitCell::GetLatticeType().

double GetGamma (  )
Returns:
angle gamma

Referenced by OBUnitCell::GetLatticeType().

vector3 GetOffset (  )
Returns:
any offset in the origin of the periodic boundaries
const SpaceGroup* GetSpaceGroup (  ) [inline]
Returns:
the text representation of the space group for this unit cell

Referenced by OBUnitCell::FillUnitCell().

const std::string GetSpaceGroupName (  ) [inline]
Returns:
the text representation of the space group for this unit cell
OBUnitCell::LatticeType GetLatticeType ( int  spacegroup )
Returns:
lattice type (based on the spacegroup)
OBUnitCell::LatticeType GetLatticeType (  )
Returns:
lattice type (based on angles and distances)
vector< vector3 > GetCellVectors (  )

Implements blue-obelisk:convertNotionalIntoCartesianCoordinates

Returns:
v1, v2, v3 cell vectors
matrix3x3 GetCellMatrix (  )

Access to the cell matrix as row vectors, useful for writing input files. Equivalent to the transpose of GetOrientationMatrix() * GetOrthoMatrix()

Returns:
The cell matrix with row vectors.
See also:
OBUnitCell::GetOrthoMatrix
OBUnitCell::GetFractionalMatrix
OBUnitCell::GetOrientationMatrix
OBUnitCell::FractionalToCartesian
OBUnitCell::CartesianToFractional

Referenced by OBUnitCell::GetCellVectors(), and OBUnitCell::GetCellVolume().

matrix3x3 GetOrthoMatrix (  )
Returns:
The orthogonalization matrix, used for converting from fractional to Cartesian coords.
See also:
OBUnitCell::GetCellMatrix
OBUnitCell::GetFractionalMatrix
OBUnitCell::GetOrientationMatrix
OBUnitCell::FractionalToCartesian
OBUnitCell::CartesianToFractional
matrix3x3 GetOrientationMatrix (  )

Used to convert fractional and cartesian coordinates if the cell is not oriented in standard form (a parallel to x axis, b in xy plane)

Returns:
The orientation matrix
See also:
OBUnitCell::GetOrthoMatrix
OBUnitCell::GetCellMatrix
OBUnitCell::GetFractionalMatrix
OBUnitCell::FractionalToCartesian
OBUnitCell::CartesianToFractional
matrix3x3 GetFractionalMatrix (  )
Returns:
The fractionalization matrix, used for converting from Cartesian to fractional coords.
See also:
OBUnitCell::GetOrthoMatrix
OBUnitCell::GetCellMatrix
OBUnitCell::GetOrientationMatrix
OBUnitCell::FractionalToCartesian
OBUnitCell::CartesianToFractional
vector3 FractionalToCartesian ( vector3  frac )

Convenience function to convert fractional coordinates to cartesian coordinates. Returns

GetOrientationMatrix() * GetOrthoMatrix() * frac + GetOffset()

Parameters:
fracVector of fractional coordinates
Returns:
Cartesian coordinates

Referenced by OBUnitCell::FillUnitCell(), and OBUnitCell::WrapCartesianCoordinate().

vector3 CartesianToFractional ( vector3  cart )

Convenience function to convert cartesian coordinates to fractional coordinates. Returns

GetFractionalMatrix() * GetOrientationMatrix().inverse() * (cart - GetOffset())

Parameters:
cartVector of cartesian coordinates
Returns:
Fractional coordinates

Referenced by OBUnitCell::FillUnitCell(), and OBUnitCell::WrapCartesianCoordinate().

vector3 WrapCartesianCoordinate ( vector3  cart )

Wraps cartesian coordinate to fall within the unit cell.

Parameters:
cartVector of cartesian coordinates
Returns:
Cartesian coordinates within cell boundaries.
vector3 WrapFractionalCoordinate ( vector3  frac )

Wraps fractional coordinate to fall within the unit cell.

Parameters:
fracVector of fractional coordinates
Returns:
Fractional coordinates within cell boundaries (between 0 and 1).

Referenced by OBUnitCell::WrapCartesianCoordinate().

int GetSpaceGroupNumber ( std::string  name = "" )
Returns:
The numeric value of the given spacegroup
double GetCellVolume (  )
Returns:
The cell volume (in Angstroms^3)
void SetAttribute ( const std::string &  v ) [inline, inherited]
virtual const std::string& GetAttribute (  ) const [inline, virtual, inherited]
Returns:
The attribute (key), which can be used to retrieve this data

Referenced by OBMoleculeFormat::MakeCombinedMolecule().

unsigned int GetDataType (  ) const [inline, inherited]
Returns:
the data type for this object as defined in OBGenericDataType
virtual const std::string& GetValue (  ) const [inline, virtual, inherited]

Base class returns a default value (the attribute type) but should never be called.

Reimplemented in OBCommentData, and OBPairData.

Referenced by OBDepict::DrawMolecule(), OBDescriptor::FilterCompare(), and OBDescriptor::GetValues().

virtual DataOrigin GetOrigin (  ) const [inline, virtual, inherited]

Member Data Documentation

std::string _attr [protected, inherited]

attribute tag (e.g., "UnitCell", "Comment" or "Author")

Referenced by OBRotamerList::Clone(), and OBNasaThermoData::OBNasaThermoData().

unsigned int _type [protected, inherited]

attribute type -- declared for each subclass

Referenced by OBRotamerList::Clone(), and OBNasaThermoData::OBNasaThermoData().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines