CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
CASM::COORD_MODE Class Reference

#include <CoordinateSystems.hh>

Detailed Description

COORD_MODE specifies the current coordinate mode (Fractional or Cartesian)

COORD_MODE is a container for the global coordinate system mode i.e., fractional or cartesian. The global coordinate mode is contained in ACTIVE_MODE. In order for ACTIVE_MODE to be initialized properly, the following line must be added before 'int main()': COORD_TYPE COORD_MODE::ACTIVE_MODE = FRAC;

COORD_MODE new_mode(FRAC); //creates new_mode and sets current mode to FRAC
Coordinate my_coord=something;
my_coord(); // accesses fractional vector of my_coord
do_something_with_frac();
{ // Curly brackets limit the scope of anything created inside
new_new_mode.check(); //Returns CART
COORD_MODE::CHECK(); //Returns CART
do_something_with_cart();
} //new_new_mode is destroyed here
COORD_MODE::CHECK(); //Returns FRAC

Definition at line 40 of file CoordinateSystems.hh.

Public Member Functions

 COORD_MODE (COORD_TYPE new_mode)
 
 ~COORD_MODE ()
 
void set (const COORD_TYPE new_mode)
 
COORD_TYPE check ()
 

Static Public Member Functions

static bool IS_CART ()
 Static method to check if mode is CART (call using COORD_MODE::IS_CART() ) More...
 
static bool IS_FRAC ()
 Static method to check if mode is FRAC (call using COORD_MODE::IS_FRAC() ) More...
 
static COORD_TYPE CHECK ()
 get the current mode (call using COORD_MODE::CHECK()) More...
 
static std::string NAME ()
 get a string with the name of the active mode More...
 
static std::string NAME (COORD_TYPE mode)
 

Private Attributes

COORD_TYPE old_mode
 old_mode specifies the value of ACTIVE_MODE when this COORD_MODE object was instantiated More...
 

Static Private Attributes

static COORD_TYPE ACTIVE_MODE = FRAC
 

Constructor & Destructor Documentation

CASM::COORD_MODE::COORD_MODE ( COORD_TYPE  new_mode)
inline

Definition at line 75 of file CoordinateSystems.hh.

CASM::COORD_MODE::~COORD_MODE ( )
inline

Definition at line 79 of file CoordinateSystems.hh.

Member Function Documentation

static COORD_TYPE CASM::COORD_MODE::CHECK ( )
inlinestatic

get the current mode (call using COORD_MODE::CHECK())

Definition at line 61 of file CoordinateSystems.hh.

COORD_TYPE CASM::COORD_MODE::check ( )
inline

Definition at line 86 of file CoordinateSystems.hh.

static bool CASM::COORD_MODE::IS_CART ( )
inlinestatic

Static method to check if mode is CART (call using COORD_MODE::IS_CART() )

Definition at line 52 of file CoordinateSystems.hh.

static bool CASM::COORD_MODE::IS_FRAC ( )
inlinestatic

Static method to check if mode is FRAC (call using COORD_MODE::IS_FRAC() )

Definition at line 56 of file CoordinateSystems.hh.

static std::string CASM::COORD_MODE::NAME ( )
inlinestatic

get a string with the name of the active mode

Definition at line 66 of file CoordinateSystems.hh.

static std::string CASM::COORD_MODE::NAME ( COORD_TYPE  mode)
inlinestatic

Definition at line 69 of file CoordinateSystems.hh.

void CASM::COORD_MODE::set ( const COORD_TYPE  new_mode)
inline

Definition at line 83 of file CoordinateSystems.hh.

Member Data Documentation

COORD_TYPE CASM::COORD_MODE::ACTIVE_MODE = FRAC
staticprivate

ACTIVE_MODE is a hidden global variable that specifies what coordinate system (CART or FRAC) is currently in use

Definition at line 45 of file CoordinateSystems.hh.

COORD_TYPE CASM::COORD_MODE::old_mode
private

old_mode specifies the value of ACTIVE_MODE when this COORD_MODE object was instantiated

Definition at line 48 of file CoordinateSystems.hh.


The documentation for this class was generated from the following files: