CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::OccupantFunction Class Reference

#include <OccupantFunction.hh>

+ Inheritance diagram for CASM::OccupantFunction:

Detailed Description

Definition at line 26 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)
 
int class_ID () const override
 
std::string type_name () const override
 
Index occ_func_ind () const
 
Index basis_ind () const
 
void set_basis_ind (int new_ind)
 
const DiscreteDoFdof () const
 
Functioncopy () const override
 
bool is_zero () const override
 
Index num_terms () const override
 
const Eigen::VectorXd & eval_table () const
 
double leading_coefficient () const override
 
double leading_coefficient (Index &index) const override
 
double get_coefficient (Index i) const override
 
void small_to_zero (double tol=TOL) override
 
void scale (double scale_factor) override
 
void make_formula () const override
 
int register_remotes (const std::vector< DoF::RemoteHandle > &remote_handles) override
 
std::set< Indexdof_IDs () const override
 
bool compare (const OccupantFunction *RHS) const
 
Eigen::VectorXd const * get_eigen_coeffs () const override
 
double discrete_eval (int state) const
 
double remote_eval () const override
 
double remote_deval (const DoF::RemoteHandle &dvar) const override
 
double cache_eval () const override
 
double cache_deval (const DoF::RemoteHandle &dvar) const override
 
jsonParserto_json (jsonParser &json) const override
 
void from_json (const jsonParser &json)
 
void refresh_ID ()
 
Index ID () const
 
Index num_args () const
 
void set_identifier (char _key, std::string const &_value)
 
std::string identifier (char _key) 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_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=nullptr)
 
bool accept (const FunctionVisitor &visitor, BasisSet const *home_basis_ptr=nullptr) const
 
virtual SparseTensor< double > const * get_coeffs () const
 
bool update_dof_IDs (const std::vector< Index > &before_IDs, const std::vector< 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)
 change arguments of this function More...
 
void set_arguments (const ArgumentContainer &new_arg, std::vector< Index > const &compatibility_map)
 change arguments, allowing for new_arg to be larger than current argument list [or permuted (not yet implemented)] More...
 
const ArgumentContainerargument_bases () const
 

Static Public Member Functions

static int sclass_ID ()
 
static void fill_dispatch_table ()
 

Protected Types

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

Protected Member Functions

Function_apply_sym (const SymOp &op) override
 
bool _accept (const FunctionVisitor &visitor, BasisSet const *home_basis_ptr=NULL) override
 
bool _accept (const FunctionVisitor &visitor, BasisSet const *home_basis_ptr=NULL) const override
 
bool _update_dof_IDs (const std::vector< Index > &before_IDs, const std::vector< Index > &after_IDs) override
 
ReturnArray< SymGroupRepID_sub_sym_reps () const
 
virtual void _set_arguments (const ArgumentContainer &new_arg, std::vector< Index > const &compatibility_map)
 
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
 
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
 
static Array< Array< FunctionOperation * > > operation_table
 

Private Member Functions

 OccupantFunction ()
 

Private Attributes

notstd::cloneable_ptr< DiscreteDoFm_var
 
Eigen::VectorXd m_eval_table
 
SymGroupRepID m_sym_rep_ID
 
Index m_occ_func_ind
 
Index m_basis_ind
 
std::map< char, std::string > m_identifiers
 

Static Private Attributes

static Index ID_count
 

Member Typedef Documentation

◆ ArgumentContainer

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

Definition at line 43 of file BasisFunction.hh.

Constructor & Destructor Documentation

◆ OccupantFunction() [1/2]

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 29 of file OccupantFunction.hh.

◆ OccupantFunction() [2/2]

CASM::OccupantFunction::OccupantFunction ( )
inlineprivate

Definition at line 118 of file OccupantFunction.hh.

Member Function Documentation

◆ _accept() [1/2]

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

Implements CASM::Function.

Definition at line 48 of file OccupantFunction.cc.

◆ _accept() [2/2]

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

Implements CASM::Function.

Definition at line 41 of file OccupantFunction.cc.

◆ _apply_sym()

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

Implements CASM::Function.

Definition at line 242 of file OccupantFunction.cc.

◆ _arg_deval_cache()

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

Definition at line 150 of file BasisFunction.cc.

◆ _arg_eval_cache()

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

Definition at line 144 of file BasisFunction.cc.

◆ _argument()

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

Definition at line 138 of file BasisFunction.cc.

◆ _dependency_layer()

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

Definition at line 156 of file BasisFunction.cc.

◆ _set_arguments()

virtual void CASM::Function::_set_arguments ( const ArgumentContainer new_arg,
std::vector< Index > const &  compatibility_map 
)
inlineprotectedvirtualinherited

Reimplemented in CASM::PolynomialFunction.

Definition at line 225 of file BasisFunction.hh.

◆ _sub_sym_reps()

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

Definition at line 128 of file BasisFunction.cc.

◆ _update_dof_IDs()

bool CASM::OccupantFunction::_update_dof_IDs ( const std::vector< Index > &  before_IDs,
const std::vector< Index > &  after_IDs 
)
overrideprotectedvirtual

Reimplemented from CASM::Function.

Definition at line 152 of file OccupantFunction.cc.

◆ accept() [1/2]

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

Definition at line 171 of file BasisFunction.cc.

◆ accept() [2/2]

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

Definition at line 189 of file BasisFunction.cc.

◆ apply_sym_coeffs()

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

Reimplemented in CASM::PolynomialFunction.

Definition at line 129 of file BasisFunction.hh.

◆ argument_bases()

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

Definition at line 170 of file BasisFunction.hh.

◆ basis_ind()

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

Definition at line 45 of file OccupantFunction.hh.

◆ cache_deval()

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

Implements CASM::Function.

Definition at line 85 of file OccupantFunction.hh.

◆ cache_eval()

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

Implements CASM::Function.

Definition at line 83 of file OccupantFunction.hh.

◆ class_ID()

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

Implements CASM::Function.

Definition at line 25 of file OccupantFunction.cc.

◆ clear_formula()

void CASM::Function::clear_formula ( )
inlineinherited

Definition at line 76 of file BasisFunction.hh.

◆ compare() [1/2]

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

Definition at line 170 of file OccupantFunction.cc.

◆ compare() [2/2]

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

Definition at line 52 of file BasisFunction.cc.

◆ copy()

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

Implements CASM::Function.

Definition at line 37 of file OccupantFunction.cc.

◆ depends_on()

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

Reimplemented in CASM::PolynomialFunction.

Definition at line 92 of file BasisFunction.hh.

◆ discrete_eval()

double CASM::OccupantFunction::discrete_eval ( int  state) const

Definition at line 269 of file OccupantFunction.cc.

◆ dof()

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

Definition at line 49 of file OccupantFunction.hh.

◆ dof_IDs()

std::set<Index> CASM::OccupantFunction::dof_IDs ( ) const
inlineoverridevirtual

Implements CASM::Function.

Definition at line 69 of file OccupantFunction.hh.

◆ dot()

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

Definition at line 28 of file BasisFunction.cc.

◆ eval_table()

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

Definition at line 56 of file OccupantFunction.hh.

◆ extend_hierarchy()

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

Definition at line 182 of file BasisFunction.hh.

◆ fill_dispatch_table()

void CASM::OccupantFunction::fill_dispatch_table ( )
static

Definition at line 13 of file OccupantFunction.cc.

◆ formula()

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

Definition at line 281 of file BasisFunction.cc.

◆ from_json()

void CASM::OccupantFunction::from_json ( const jsonParser json)

◆ get_class_ID()

static int CASM::DerivedID< OccupantFunction , Function >::get_class_ID ( )
inlinestaticprotectedinherited

Definition at line 30 of file HierarchyID.hh.

◆ get_coefficient()

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

Implements CASM::Function.

Definition at line 234 of file OccupantFunction.cc.

◆ get_coeffs()

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

Reimplemented in CASM::PolynomialFunction.

Definition at line 111 of file BasisFunction.hh.

◆ get_eigen_coeffs()

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

Reimplemented from CASM::Function.

Definition at line 178 of file OccupantFunction.cc.

◆ ID()

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

Definition at line 55 of file BasisFunction.hh.

◆ identifier()

std::string CASM::Function::identifier ( char  _key) const
inherited

Definition at line 273 of file BasisFunction.cc.

◆ is_zero()

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

Implements CASM::Function.

Definition at line 186 of file OccupantFunction.cc.

◆ leading_coefficient() [1/2]

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

Implements CASM::Function.

Definition at line 216 of file OccupantFunction.cc.

◆ leading_coefficient() [2/2]

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

Implements CASM::Function.

Definition at line 225 of file OccupantFunction.cc.

◆ make_formula()

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

Implements CASM::Function.

Definition at line 56 of file OccupantFunction.cc.

◆ minus()

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

Definition at line 72 of file BasisFunction.cc.

◆ minus_in_place()

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

Definition at line 104 of file BasisFunction.cc.

◆ multiply()

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

Definition at line 90 of file BasisFunction.cc.

◆ new_class_ID() [1/2]

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

Definition at line 16 of file HierarchyID.hh.

◆ new_class_ID() [2/2]

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

Definition at line 16 of file HierarchyID.hh.

◆ normalize()

void CASM::Function::normalize ( )
inherited

Definition at line 33 of file BasisFunction.cc.

◆ num_args()

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

Definition at line 57 of file BasisFunction.hh.

◆ num_terms()

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

Implements CASM::Function.

Definition at line 205 of file OccupantFunction.cc.

◆ occ_func_ind()

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

Definition at line 43 of file OccupantFunction.hh.

◆ plus()

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

Definition at line 67 of file BasisFunction.cc.

◆ plus_in_place()

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

Definition at line 96 of file BasisFunction.cc.

◆ poly_quotient()

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

Definition at line 78 of file BasisFunction.cc.

◆ poly_remainder()

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

Definition at line 84 of file BasisFunction.cc.

◆ print()

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

Definition at line 211 of file BasisFunction.cc.

◆ print_tex()

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

Definition at line 220 of file BasisFunction.cc.

◆ refresh_ID()

void CASM::Function::refresh_ID ( )
inherited

Definition at line 207 of file BasisFunction.cc.

◆ register_remotes()

int CASM::OccupantFunction::register_remotes ( const std::vector< DoF::RemoteHandle > &  remote_handles)
overridevirtual

Reimplemented from CASM::Function.

Definition at line 133 of file OccupantFunction.cc.

◆ remote_deval()

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

Implements CASM::Function.

Definition at line 281 of file OccupantFunction.cc.

◆ remote_eval()

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

Implements CASM::Function.

Definition at line 275 of file OccupantFunction.cc.

◆ scale()

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

Implements CASM::Function.

Definition at line 261 of file OccupantFunction.cc.

◆ sclass_ID()

int CASM::OccupantFunction::sclass_ID ( )
static

Definition at line 31 of file OccupantFunction.cc.

◆ set_arguments() [1/2]

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

change arguments of this function

Definition at line 161 of file BasisFunction.hh.

◆ set_arguments() [2/2]

void CASM::Function::set_arguments ( const ArgumentContainer new_arg,
std::vector< Index > const &  compatibility_map 
)
inherited

change arguments, allowing for new_arg to be larger than current argument list [or permuted (not yet implemented)]

Parameters
compatibility_mapspecifies which elements of
new_argare compatible with urrent argument list (e.g., [2, 3])

Definition at line 113 of file BasisFunction.cc.

◆ set_basis_ind()

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

Definition at line 47 of file OccupantFunction.hh.

◆ set_formula()

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

Definition at line 69 of file BasisFunction.hh.

◆ set_identifier()

void CASM::Function::set_identifier ( char  _key,
std::string const &  _value 
)
inherited

Definition at line 268 of file BasisFunction.cc.

◆ set_tex_formula()

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

Definition at line 73 of file BasisFunction.hh.

◆ shallow_compare()

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

Definition at line 45 of file BasisFunction.cc.

◆ small_to_zero()

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

Implements CASM::Function.

Definition at line 197 of file OccupantFunction.cc.

◆ sym_copy_coeffs()

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

Definition at line 230 of file BasisFunction.cc.

◆ tex_formula()

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

Definition at line 291 of file BasisFunction.cc.

◆ to_json()

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

Reimplemented from CASM::Function.

Definition at line 301 of file OccupantFunction.cc.

◆ type_name()

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

Implements CASM::Function.

Definition at line 41 of file OccupantFunction.hh.

◆ update_dof_IDs()

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

Definition at line 250 of file BasisFunction.cc.

Member Data Documentation

◆ func_ID

Index CASM::Function::func_ID
protectedinherited

Definition at line 194 of file BasisFunction.hh.

◆ ID_count

Index CASM::Function::ID_count
staticprivateinherited

Definition at line 266 of file BasisFunction.hh.

◆ inner_prod_table

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

Definition at line 177 of file BasisFunction.hh.

◆ m_arg2fun

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

Definition at line 219 of file BasisFunction.hh.

◆ m_arg2sub

Array<Index> CASM::Function::m_arg2sub
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 218 of file BasisFunction.hh.

◆ m_argument

ArgumentContainer CASM::Function::m_argument
protectedinherited

Definition at line 196 of file BasisFunction.hh.

◆ m_basis_ind

Index CASM::OccupantFunction::m_basis_ind
private

Definition at line 116 of file OccupantFunction.hh.

◆ m_eval_table

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

Definition at line 114 of file OccupantFunction.hh.

◆ m_formula

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

Definition at line 221 of file BasisFunction.hh.

◆ m_identifiers

std::map<char, std::string> CASM::Function::m_identifiers
privateinherited

Definition at line 268 of file BasisFunction.hh.

◆ m_occ_func_ind

Index CASM::OccupantFunction::m_occ_func_ind
private

Definition at line 116 of file OccupantFunction.hh.

◆ m_sym_rep_ID

SymGroupRepID CASM::OccupantFunction::m_sym_rep_ID
private

Definition at line 115 of file OccupantFunction.hh.

◆ m_tex_formula

std::string CASM::Function::m_tex_formula
protectedinherited

Definition at line 221 of file BasisFunction.hh.

◆ m_var

notstd::cloneable_ptr<DiscreteDoF> CASM::OccupantFunction::m_var
private

Definition at line 113 of file OccupantFunction.hh.

◆ operation_table

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

Definition at line 178 of file BasisFunction.hh.


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