CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::ClexParamPack Class Referenceabstract

#include <ClexParamPack.hh>

+ Inheritance diagram for CASM::ClexParamPack:

Detailed Description

Abstract base class for reading/writing clexulator parameters Parameters are assumed to be stored as, or at least sliceable into, 2D or 1D arrays in order to standardize read/write interface via Eigen types Arrays are layed out along two dimensions to form (m x N) or (m x 1) matrices where 'N' is the number of sites in the neighborhood of a unit cell, and 'm' is the intrinsic dimension of a particular parameter. Macroscopic or homogeneous properties of the crystal, such as evaluated crystal basis functions or homogeneous strain, which are not associated with individual sites, are represented as a (m x 1) array. The length of the 'm' dimension of a parameter array is referred do as 'dim' and the length of the N' dimension is referred to as 'size'.

Definition at line 230 of file ClexParamPack.hh.

Public Types

typedef unsigned int size_type
 

Public Member Functions

virtual ~ClexParamPack ()
 Abstract class must define virtual destructor. More...
 
std::map< std::string, ClexParamKey > const & keys () const
 Obtain registry of all keys for data blocks managed by this ClexParamPack. More...
 
ClexParamKey const & key (std::string const &_name) const
 Obtain key for managed data block by name. More...
 
virtual size_type size (ClexParamKey const &_key) const =0
 'N' dimension of parameter array (either '1', or size of unit cell neighborhood) returns number of columns in parameter array More...
 
virtual size_type dim (ClexParamKey const &_key) const =0
 'm' dimension of parameter array returns number of rows in parameter array More...
 
virtual std::string eval_mode (ClexParamKey const &_key) const =0
 Check evaluation mode for ClexParamPack parameter Choices are at least. More...
 
virtual Eigen::MatrixXd const & read (ClexParamKey const &_key) const =0
 Returns const reference to parameter array for parameter specified by. More...
 
virtual double const & read (ClexParamKey const &_key, size_type _i) const =0
 Returns const reference to element of 1D parameter array for parameter specified by. More...
 
virtual double const & read (ClexParamKey const &_key, size_type _i, size_type _j) const =0
 Returns const reference to element of 2D parameter array for parameter specified by. More...
 
virtual void set_eval_mode (ClexParamKey const &_key, std::string const &_mode)=0
 Sets evaluation mode for ClexParamPack parameter Choices are at least. More...
 
virtual void write (ClexParamKey const &_key, Eigen::Ref< const Eigen::MatrixXd > const &_val)=0
 Write parameter array for parameter specified by. More...
 
virtual void write (ClexParamKey const &_key, size_type _i, double val)=0
 Write element to 1D parameter array for parameter specified by. More...
 
virtual void write (ClexParamKey const &_key, size_type _i, size_type _j, double val)=0
 Write element to 2D parameter array for parameter specified by. More...
 
void pre_eval ()
 May be specialized to perform preprocessing before function evaluation. More...
 
void post_eval ()
 May be specialized to perform postprocessing after function evaluation. More...
 

Protected Attributes

std::map< std::string, ClexParamKeym_keys
 

Member Typedef Documentation

◆ size_type

typedef unsigned int CASM::ClexParamPack::size_type

Definition at line 232 of file ClexParamPack.hh.

Constructor & Destructor Documentation

◆ ~ClexParamPack()

virtual CASM::ClexParamPack::~ClexParamPack ( )
inlinevirtual

Abstract class must define virtual destructor.

Definition at line 235 of file ClexParamPack.hh.

Member Function Documentation

◆ dim()

virtual size_type CASM::ClexParamPack::dim ( ClexParamKey const &  _key) const
pure virtual

'm' dimension of parameter array returns number of rows in parameter array

Implemented in CASM::DiffClexParamPack, and CASM::BasicClexParamPack.

◆ eval_mode()

virtual std::string CASM::ClexParamPack::eval_mode ( ClexParamKey const &  _key) const
pure virtual

Check evaluation mode for ClexParamPack parameter Choices are at least.

Implemented in CASM::DiffClexParamPack, and CASM::BasicClexParamPack.

◆ key()

ClexParamKey const& CASM::ClexParamPack::key ( std::string const &  _name) const
inline

Obtain key for managed data block by name.

Definition at line 242 of file ClexParamPack.hh.

◆ keys()

std::map<std::string, ClexParamKey> const& CASM::ClexParamPack::keys ( ) const
inline

Obtain registry of all keys for data blocks managed by this ClexParamPack.

Definition at line 239 of file ClexParamPack.hh.

◆ post_eval()

void CASM::ClexParamPack::post_eval ( )
inline

May be specialized to perform postprocessing after function evaluation.

Definition at line 322 of file ClexParamPack.hh.

◆ pre_eval()

void CASM::ClexParamPack::pre_eval ( )
inline

May be specialized to perform preprocessing before function evaluation.

Definition at line 318 of file ClexParamPack.hh.

◆ read() [1/3]

virtual Eigen::MatrixXd const& CASM::ClexParamPack::read ( ClexParamKey const &  _key) const
pure virtual

Returns const reference to parameter array for parameter specified by.

Parameters
_keyNOTE: Take care in constructing pointers or references from the return value. If _key accepts additional index identifiers, (because the parameter has more than 2 dimensions) ClexParamPack::read() may be implemented using an internally cached matrix holding the current data slice. As such, subsequent requests to ClexParamPack::read() for a different slice may alter the internally cached values while returning a reference for the same block of memory

Implemented in CASM::DiffClexParamPack, and CASM::BasicClexParamPack.

◆ read() [2/3]

virtual double const& CASM::ClexParamPack::read ( ClexParamKey const &  _key,
size_type  _i 
) const
pure virtual

Returns const reference to element of 1D parameter array for parameter specified by.

Parameters
_key

Implemented in CASM::DiffClexParamPack, and CASM::BasicClexParamPack.

◆ read() [3/3]

virtual double const& CASM::ClexParamPack::read ( ClexParamKey const &  _key,
size_type  _i,
size_type  _j 
) const
pure virtual

Returns const reference to element of 2D parameter array for parameter specified by.

Parameters
_key

Implemented in CASM::DiffClexParamPack, and CASM::BasicClexParamPack.

◆ set_eval_mode()

virtual void CASM::ClexParamPack::set_eval_mode ( ClexParamKey const &  _key,
std::string const &  _mode 
)
pure virtual

Sets evaluation mode for ClexParamPack parameter Choices are at least.

Implemented in CASM::DiffClexParamPack, and CASM::BasicClexParamPack.

◆ size()

virtual size_type CASM::ClexParamPack::size ( ClexParamKey const &  _key) const
pure virtual

'N' dimension of parameter array (either '1', or size of unit cell neighborhood) returns number of columns in parameter array

Implemented in CASM::DiffClexParamPack, and CASM::BasicClexParamPack.

◆ write() [1/3]

virtual void CASM::ClexParamPack::write ( ClexParamKey const &  _key,
Eigen::Ref< const Eigen::MatrixXd > const &  _val 
)
pure virtual

Write parameter array for parameter specified by.

Parameters
_key

Implemented in CASM::DiffClexParamPack, and CASM::BasicClexParamPack.

◆ write() [2/3]

virtual void CASM::ClexParamPack::write ( ClexParamKey const &  _key,
size_type  _i,
double  val 
)
pure virtual

Write element to 1D parameter array for parameter specified by.

Parameters
_key

Implemented in CASM::DiffClexParamPack, and CASM::BasicClexParamPack.

◆ write() [3/3]

virtual void CASM::ClexParamPack::write ( ClexParamKey const &  _key,
size_type  _i,
size_type  _j,
double  val 
)
pure virtual

Write element to 2D parameter array for parameter specified by.

Parameters
_key

Implemented in CASM::DiffClexParamPack, and CASM::BasicClexParamPack.

Member Data Documentation

◆ m_keys

std::map<std::string, ClexParamKey> CASM::ClexParamPack::m_keys
protected

Definition at line 325 of file ClexParamPack.hh.


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