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

#include <OccupantFunction.hh>

+ Inheritance diagram for CASM::OccupantFunction:

Detailed Description

Definition at line 25 of file OccupantFunction.hh.

Public Member Functions

 OccupantFunction (const DiscreteDoF &init_var, const Eigen::VectorXd &init_eval, int _occ_func_ind, int _basis_ind, SymGroupRepID _sym_rep_ID)
 
 OccupantFunction (const OccupantFunction &RHS)
 
 ~OccupantFunction ()
 
int class_ID () const
 
std::string type_name () const
 
Index occ_func_ind () const
 
Index basis_ind () const
 
void set_basis_ind (int new_ind)
 
const DiscreteDoFdof () const
 
Functioncopy () const
 
bool is_zero () const
 
Index num_terms () const
 
const Eigen::VectorXd & eval_table () const
 
double leading_coefficient () const
 
double leading_coefficient (Index &index) const
 
double get_coefficient (Index i) const
 
void small_to_zero (double tol=TOL)
 
void scale (double scale_factor)
 
void make_formula () const
 
int register_remotes (const std::string &dof_name, const Array< DoF::RemoteHandle > &remote_handles)
 
bool compare (const OccupantFunction *RHS) const
 
Eigen::VectorXd const * get_eigen_coeffs () const
 
double remote_eval () const
 
double remote_deval (const DoF::RemoteHandle &dvar) const
 
double cache_eval () const
 
double cache_deval (const DoF::RemoteHandle &dvar) const
 
double eval (const Array< Index > &dof_IDs, const Array< Index > &var_states) const
 
jsonParserto_json (jsonParser &json) const
 
void from_json (const jsonParser &json)
 
void refresh_ID ()
 
Index ID () const
 
Index num_args () const
 
std::string formula () const
 
std::string tex_formula () const
 
void print (std::ostream &stream) const
 
void print_tex (std::ostream &stream) const
 
void set_label_format (const std::string &format)
 
const std::string & label_format () const
 
void set_formula (const std::string &new_formula)
 
void set_tex_formula (const std::string &new_formula)
 
void clear_formula ()
 
virtual bool depends_on (const Function *test_func) const
 
bool accept (const FunctionVisitor &visitor, BasisSet const *home_basis_ptr=NULL)
 
virtual SparseTensor< double >
const * 
get_coeffs () const
 
virtual double eval (const Array< Index > &dof_IDs, const Array< double > &arg_states) const
 
bool update_dof_IDs (const Array< Index > &before_IDs, const Array< Index > &after_IDs)
 
virtual Functionapply_sym_coeffs (const SymOp &op, int dependency_layer=1)
 
Functionsym_copy_coeffs (const SymOp &op, int dependency_layer=1) const
 
void normalize ()
 
double dot (Function const *RHS) const
 
bool shallow_compare (Function const *RHS) const
 
bool compare (Function const *RHS) const
 
Functionminus (Function const *RHS) const
 
Functionplus (Function const *RHS) const
 
Functionmultiply (Function const *RHS) const
 
Functionpoly_quotient (Function const *RHS) const
 
Functionpoly_remainder (Function const *RHS) const
 
Functionminus_in_place (Function const *RHS)
 
Functionplus_in_place (Function const *RHS)
 
void set_arguments (const ArgumentContainer &new_arg)
 
const ArgumentContainerargument_bases () const
 

Static Public Member Functions

static int sclass_ID ()
 
static void fill_dispatch_table ()
 
static void print_table ()
 

Protected Types

typedef std::vector
< std::shared_ptr< BasisSet > > 
ArgumentContainer
 

Protected Member Functions

Function_apply_sym (const SymOp &op)
 
bool _accept (const FunctionVisitor &visitor, BasisSet const *home_basis_ptr=NULL)
 
bool _update_dof_IDs (const Array< Index > &before_IDs, const Array< Index > &after_IDs)
 
ReturnArray< SymGroupRepID_sub_sym_reps () const
 
Function const * _argument (Index i) const
 
double _arg_eval_cache (Index i) const
 
double _arg_deval_cache (Index i) const
 
int _dependency_layer () const
 

Static Protected Member Functions

static void extend_hierarchy ()
 
static int new_class_ID ()
 
static int get_class_ID ()
 
static int new_class_ID ()
 

Protected Attributes

Index func_ID
 
ArgumentContainer m_argument
 
std::string m_label_format
 
Array< Indexm_arg2sub
 
Array< Indexm_arg2fun
 
std::string m_formula
 
std::string m_tex_formula
 

Static Protected Attributes

static Array< Array
< InnerProduct * > > 
inner_prod_table = Array<Array< InnerProduct * > > ()
 
static Array< Array
< FunctionOperation * > > 
operation_table = Array<Array< FunctionOperation * > > ()
 

Private Member Functions

 OccupantFunction ()
 

Private Attributes

DiscreteDoFm_var
 
Eigen::VectorXd m_eval_table
 
SymGroupRepID m_sym_rep_ID
 
Index m_occ_func_ind
 
Index m_basis_ind
 

Member Typedef Documentation

typedef std::vector<std::shared_ptr<BasisSet> > CASM::Function::ArgumentContainer
protectedinherited

Definition at line 46 of file BasisFunction.hh.

Constructor & Destructor Documentation

CASM::OccupantFunction::OccupantFunction ( const DiscreteDoF init_var,
const Eigen::VectorXd &  init_eval,
int  _occ_func_ind,
int  _basis_ind,
SymGroupRepID  _sym_rep_ID 
)
inline

Definition at line 28 of file OccupantFunction.hh.

CASM::OccupantFunction::OccupantFunction ( const OccupantFunction RHS)
inline

Definition at line 31 of file OccupantFunction.hh.

CASM::OccupantFunction::~OccupantFunction ( )
inline

Definition at line 34 of file OccupantFunction.hh.

CASM::OccupantFunction::OccupantFunction ( )
inlineprivate

Definition at line 125 of file OccupantFunction.hh.

Member Function Documentation

bool CASM::OccupantFunction::_accept ( const FunctionVisitor visitor,
BasisSet const *  home_basis_ptr = NULL 
)
protectedvirtual

Implements CASM::Function.

Definition at line 47 of file OccupantFunction.cc.

Function * CASM::OccupantFunction::_apply_sym ( const SymOp op)
protectedvirtual

Implements CASM::Function.

Definition at line 258 of file OccupantFunction.cc.

double CASM::Function::_arg_deval_cache ( Index  i) const
protectedinherited

Definition at line 129 of file BasisFunction.cc.

double CASM::Function::_arg_eval_cache ( Index  i) const
protectedinherited

Definition at line 123 of file BasisFunction.cc.

Function const * CASM::Function::_argument ( Index  i) const
protectedinherited

Definition at line 117 of file BasisFunction.cc.

int CASM::Function::_dependency_layer ( ) const
protectedinherited

Definition at line 135 of file BasisFunction.cc.

ReturnArray< SymGroupRepID > CASM::Function::_sub_sym_reps ( ) const
protectedinherited

Definition at line 107 of file BasisFunction.cc.

bool CASM::OccupantFunction::_update_dof_IDs ( const Array< Index > &  before_IDs,
const Array< Index > &  after_IDs 
)
protectedvirtual

Reimplemented from CASM::Function.

Definition at line 150 of file OccupantFunction.cc.

bool CASM::Function::accept ( const FunctionVisitor visitor,
BasisSet const *  home_basis_ptr = NULL 
)
inherited

Definition at line 150 of file BasisFunction.cc.

virtual Function* CASM::Function::apply_sym_coeffs ( const SymOp op,
int  dependency_layer = 1 
)
inlinevirtualinherited

Reimplemented in CASM::PolynomialFunction.

Definition at line 138 of file BasisFunction.hh.

const ArgumentContainer& CASM::Function::argument_bases ( ) const
inlineinherited

Definition at line 174 of file BasisFunction.hh.

Index CASM::OccupantFunction::basis_ind ( ) const
inline

Definition at line 50 of file OccupantFunction.hh.

double CASM::OccupantFunction::cache_deval ( const DoF::RemoteHandle dvar) const
inlinevirtual

Implements CASM::Function.

Definition at line 96 of file OccupantFunction.hh.

double CASM::OccupantFunction::cache_eval ( ) const
inlinevirtual

Implements CASM::Function.

Definition at line 92 of file OccupantFunction.hh.

int CASM::OccupantFunction::class_ID ( ) const
virtual

Implements CASM::Function.

Definition at line 24 of file OccupantFunction.cc.

void CASM::Function::clear_formula ( )
inlineinherited

Definition at line 86 of file BasisFunction.hh.

bool CASM::OccupantFunction::compare ( const OccupantFunction RHS) const

Definition at line 168 of file OccupantFunction.cc.

bool CASM::Function::compare ( Function const *  RHS) const
inherited

Definition at line 47 of file BasisFunction.cc.

Function * CASM::OccupantFunction::copy ( ) const
virtual

Implements CASM::Function.

Definition at line 38 of file OccupantFunction.cc.

virtual bool CASM::Function::depends_on ( const Function test_func) const
inlinevirtualinherited

Reimplemented in CASM::PolynomialFunction.

Definition at line 101 of file BasisFunction.hh.

const DiscreteDoF& CASM::OccupantFunction::dof ( ) const
inline

Definition at line 58 of file OccupantFunction.hh.

double CASM::Function::dot ( Function const *  RHS) const
inherited

Definition at line 24 of file BasisFunction.cc.

double CASM::OccupantFunction::eval ( const Array< Index > &  dof_IDs,
const Array< Index > &  var_states 
) const
virtual

Reimplemented from CASM::Function.

Definition at line 305 of file OccupantFunction.cc.

double CASM::Function::eval ( const Array< Index > &  dof_IDs,
const Array< double > &  arg_states 
) const
virtualinherited

Reimplemented in CASM::PolynomialFunction.

Definition at line 257 of file BasisFunction.cc.

const Eigen::VectorXd& CASM::OccupantFunction::eval_table ( ) const
inline

Definition at line 68 of file OccupantFunction.hh.

static void CASM::Function::extend_hierarchy ( )
inlinestaticprotectedinherited

Definition at line 194 of file BasisFunction.hh.

void CASM::OccupantFunction::fill_dispatch_table ( )
static

Definition at line 13 of file OccupantFunction.cc.

std::string CASM::Function::formula ( ) const
inherited

Definition at line 227 of file BasisFunction.cc.

void CASM::OccupantFunction::from_json ( const jsonParser json)
static int CASM::DerivedID< OccupantFunction , Function >::get_class_ID ( )
inlinestaticprotectedinherited

Definition at line 32 of file HierarchyID.hh.

double CASM::OccupantFunction::get_coefficient ( Index  i) const
virtual

Implements CASM::Function.

Definition at line 248 of file OccupantFunction.cc.

virtual SparseTensor<double> const* CASM::Function::get_coeffs ( ) const
inlinevirtualinherited

Reimplemented in CASM::PolynomialFunction.

Definition at line 115 of file BasisFunction.hh.

Eigen::VectorXd const * CASM::OccupantFunction::get_eigen_coeffs ( ) const
virtual

Reimplemented from CASM::Function.

Definition at line 177 of file OccupantFunction.cc.

Index CASM::Function::ID ( ) const
inlineinherited

Definition at line 59 of file BasisFunction.hh.

bool CASM::OccupantFunction::is_zero ( ) const
virtual

Implements CASM::Function.

Definition at line 186 of file OccupantFunction.cc.

const std::string& CASM::Function::label_format ( ) const
inlineinherited

Definition at line 76 of file BasisFunction.hh.

double CASM::OccupantFunction::leading_coefficient ( ) const
virtual

Implements CASM::Function.

Definition at line 224 of file OccupantFunction.cc.

double CASM::OccupantFunction::leading_coefficient ( Index index) const
virtual

Implements CASM::Function.

Definition at line 236 of file OccupantFunction.cc.

void CASM::OccupantFunction::make_formula ( ) const
virtual

Implements CASM::Function.

Definition at line 55 of file OccupantFunction.cc.

Function * CASM::Function::minus ( Function const *  RHS) const
inherited

Definition at line 70 of file BasisFunction.cc.

Function * CASM::Function::minus_in_place ( Function const *  RHS)
inherited

Definition at line 98 of file BasisFunction.cc.

Function * CASM::Function::multiply ( Function const *  RHS) const
inherited

Definition at line 85 of file BasisFunction.cc.

template<typename Base>
static int CASM::HierarchyID< Base >::new_class_ID ( )
inlinestaticprotectedinherited

Definition at line 17 of file HierarchyID.hh.

static int CASM::HierarchyID< Function >::new_class_ID ( )
inlinestaticprotectedinherited

Definition at line 17 of file HierarchyID.hh.

void CASM::Function::normalize ( )
inherited

Definition at line 29 of file BasisFunction.cc.

Index CASM::Function::num_args ( ) const
inlineinherited

Definition at line 63 of file BasisFunction.hh.

Index CASM::OccupantFunction::num_terms ( ) const
virtual

Implements CASM::Function.

Definition at line 211 of file OccupantFunction.cc.

Index CASM::OccupantFunction::occ_func_ind ( ) const
inline

Definition at line 46 of file OccupantFunction.hh.

Function * CASM::Function::plus ( Function const *  RHS) const
inherited

Definition at line 65 of file BasisFunction.cc.

Function * CASM::Function::plus_in_place ( Function const *  RHS)
inherited

Definition at line 90 of file BasisFunction.cc.

Function * CASM::Function::poly_quotient ( Function const *  RHS) const
inherited

Definition at line 75 of file BasisFunction.cc.

Function * CASM::Function::poly_remainder ( Function const *  RHS) const
inherited

Definition at line 80 of file BasisFunction.cc.

void CASM::Function::print ( std::ostream &  stream) const
inherited

Definition at line 173 of file BasisFunction.cc.

static void CASM::Function::print_table ( )
inlinestaticinherited

Definition at line 178 of file BasisFunction.hh.

void CASM::Function::print_tex ( std::ostream &  stream) const
inherited

Definition at line 182 of file BasisFunction.cc.

void CASM::Function::refresh_ID ( )
inherited

Definition at line 167 of file BasisFunction.cc.

int CASM::OccupantFunction::register_remotes ( const std::string &  dof_name,
const Array< DoF::RemoteHandle > &  remote_handles 
)
virtual

Reimplemented from CASM::Function.

Definition at line 131 of file OccupantFunction.cc.

double CASM::OccupantFunction::remote_deval ( const DoF::RemoteHandle dvar) const
virtual

Implements CASM::Function.

Definition at line 294 of file OccupantFunction.cc.

double CASM::OccupantFunction::remote_eval ( ) const
virtual

Implements CASM::Function.

Definition at line 288 of file OccupantFunction.cc.

void CASM::OccupantFunction::scale ( double  scale_factor)
virtual

Implements CASM::Function.

Definition at line 279 of file OccupantFunction.cc.

int CASM::OccupantFunction::sclass_ID ( )
static

Definition at line 31 of file OccupantFunction.cc.

void CASM::Function::set_arguments ( const ArgumentContainer new_arg)
inlineinherited

Definition at line 169 of file BasisFunction.hh.

void CASM::OccupantFunction::set_basis_ind ( int  new_ind)
inline

Definition at line 54 of file OccupantFunction.hh.

void CASM::Function::set_formula ( const std::string &  new_formula)
inlineinherited

Definition at line 79 of file BasisFunction.hh.

void CASM::Function::set_label_format ( const std::string &  format)
inlineinherited

Definition at line 73 of file BasisFunction.hh.

void CASM::Function::set_tex_formula ( const std::string &  new_formula)
inlineinherited

Definition at line 83 of file BasisFunction.hh.

bool CASM::Function::shallow_compare ( Function const *  RHS) const
inherited

Definition at line 41 of file BasisFunction.cc.

void CASM::OccupantFunction::small_to_zero ( double  tol = TOL)
virtual

Implements CASM::Function.

Definition at line 199 of file OccupantFunction.cc.

Function * CASM::Function::sym_copy_coeffs ( const SymOp op,
int  dependency_layer = 1 
) const
inherited

Definition at line 192 of file BasisFunction.cc.

std::string CASM::Function::tex_formula ( ) const
inherited

Definition at line 237 of file BasisFunction.cc.

jsonParser & CASM::OccupantFunction::to_json ( jsonParser json) const
virtual

Reimplemented from CASM::Function.

Definition at line 328 of file OccupantFunction.cc.

std::string CASM::OccupantFunction::type_name ( ) const
inlinevirtual

Implements CASM::Function.

Definition at line 42 of file OccupantFunction.hh.

bool CASM::Function::update_dof_IDs ( const Array< Index > &  before_IDs,
const Array< Index > &  after_IDs 
)
inherited

Definition at line 210 of file BasisFunction.cc.

Member Data Documentation

Index CASM::Function::func_ID
protectedinherited

Definition at line 204 of file BasisFunction.hh.

Array< Array< InnerProduct * > > CASM::Function::inner_prod_table = Array<Array< InnerProduct * > > ()
staticprotectedinherited

Definition at line 190 of file BasisFunction.hh.

Array<Index> CASM::Function::m_arg2fun
protectedinherited

Definition at line 229 of file BasisFunction.hh.

Array<Index> CASM::Function::m_arg2sub
protectedinherited

Definition at line 228 of file BasisFunction.hh.

ArgumentContainer CASM::Function::m_argument
protectedinherited

Definition at line 206 of file BasisFunction.hh.

Index CASM::OccupantFunction::m_basis_ind
private

Definition at line 123 of file OccupantFunction.hh.

Eigen::VectorXd CASM::OccupantFunction::m_eval_table
private

Definition at line 121 of file OccupantFunction.hh.

std::string CASM::Function::m_formula
mutableprotectedinherited

Definition at line 232 of file BasisFunction.hh.

std::string CASM::Function::m_label_format
protectedinherited

m_label_format sets the label format used to generate a label string for a Function object. It is specified as a string of the form (substr1 + "%a" + substr2 + "%b" + substr3 + ... ), where "%a" and "%b" are flags that specify object-specific values. The following flags are allowed:

  • f : function index (only available for some derived types)
  • b : basis index (only available for OccupantFunction and Variable)
  • n : neighbor list index – the DoF ID if dof.is_locked()==false
  • g : global DoF index – the DoF ID if dof.is_locked()==true For objects where the flag does not uniquely specify a single value, it evaluates to a substring that concatenates multiple values in ascending order. Example: For a polynomial function that combines DoFs from the sites {8, 2, 4} of the neighborlist, n will evaluate to the substring expression "2_4_8"

Definition at line 220 of file BasisFunction.hh.

Index CASM::OccupantFunction::m_occ_func_ind
private

Definition at line 123 of file OccupantFunction.hh.

SymGroupRepID CASM::OccupantFunction::m_sym_rep_ID
private

Definition at line 122 of file OccupantFunction.hh.

std::string CASM::Function::m_tex_formula
mutableprotectedinherited

Definition at line 232 of file BasisFunction.hh.

DiscreteDoF* CASM::OccupantFunction::m_var
private

Definition at line 120 of file OccupantFunction.hh.

Array< Array< FunctionOperation * > > CASM::Function::operation_table = Array<Array< FunctionOperation * > > ()
staticprotectedinherited

Definition at line 191 of file BasisFunction.hh.


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