CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::xtal::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
COORD_MODE(COORD_TYPE new_mode)
static COORD_TYPE CHECK()
get the current mode (call using COORD_MODE::CHECK())
const COORD_TYPE FRAC
Definition: enum.hh:8
const COORD_TYPE CART
Definition: enum.hh:9

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
 

Static Private Attributes

static COORD_TYPE ACTIVE_MODE = FRAC
 

Constructor & Destructor Documentation

◆ COORD_MODE()

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

Definition at line 68 of file CoordinateSystems.hh.

◆ ~COORD_MODE()

CASM::xtal::COORD_MODE::~COORD_MODE ( )
inline

Definition at line 72 of file CoordinateSystems.hh.

Member Function Documentation

◆ CHECK()

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

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

Definition at line 58 of file CoordinateSystems.hh.

◆ check()

COORD_TYPE CASM::xtal::COORD_MODE::check ( )
inline

Definition at line 75 of file CoordinateSystems.hh.

◆ IS_CART()

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

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

Definition at line 53 of file CoordinateSystems.hh.

◆ IS_FRAC()

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

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

Definition at line 55 of file CoordinateSystems.hh.

◆ NAME() [1/2]

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

get a string with the name of the active mode

Definition at line 61 of file CoordinateSystems.hh.

◆ NAME() [2/2]

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

Definition at line 62 of file CoordinateSystems.hh.

◆ set()

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

Definition at line 74 of file CoordinateSystems.hh.

Member Data Documentation

◆ ACTIVE_MODE

COORD_TYPE CASM::xtal::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.

◆ old_mode

COORD_TYPE CASM::xtal::COORD_MODE::old_mode
private

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

Definition at line 49 of file CoordinateSystems.hh.


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