1 #ifndef CASM_ConfigDoFIsEquivalent
2 #define CASM_ConfigDoFIsEquivalent
14 namespace DoFIsEquivalent {
59 std::unique_ptr<ConfigDoFIsEquivalentBase>
clone()
const {
60 return std::unique_ptr<ConfigDoFIsEquivalentBase>(this->
_clone());
88 bool _check(
const T &A,
const T &B)
const {
110 bool _check(
const T &A,
const T &B)
const {
176 std::unique_ptr<Occupation>
clone()
const {
177 return std::unique_ptr<Occupation>(this->
_clone());
182 template<
typename F,
typename G>
185 for(i = 0; i <
size(); i++) {
219 return other.
disp(i)[j];
248 std::unique_ptr<Displacement>
clone()
const {
249 return std::unique_ptr<Displacement>(this->
_clone());
276 template<
typename F,
typename G>
279 for(i = 0; i <
size(); i++) {
280 for(j = 0; j < 3; j++) {
281 if(!
_check(f(i, j), g(i, j))) {
310 m_def_tensor(_configdof.deformation().transpose() * _configdof.deformation()),
325 return other_def_tensor(i, j);
354 std::unique_ptr<Strain>
clone()
const {
355 return std::unique_ptr<Strain>(this->
_clone());
390 template<
typename F,
typename G>
393 for(i = 0; i < 3; i++) {
394 for(j = 0; j < 3; j++) {
395 if(!
_check(f(i, j), g(i, j))) {
434 template<
typename ConfigDoFIsEquivalentType>
442 return m_f->is_less();
452 return (*
m_f)(other);
473 template<
typename ConfigDoFIsEquivalentType,
typename ...Args>
475 return ConfigDoFIsEquivalent(notstd::make_unique<ConfigDoFIsEquivalentType>(std::forward<Args>(args)...));
Eigen::MatrixXd m_new_disp_B
FloatIsEquivalent(const ConfigDoF &_configdof, double _tol)
void _update_B(const PermuteIterator &B) const
Abstract base class specialization of ConfigDoFIsEquivalentBase for integral DoF types.
void _update_A(const PermuteIterator &A) const
bool _check(const T &A, const T &B) const
bool operator()(const ConfigDoF &other) const override
Return config == other, store config < other.
bool is_less() const
Returns less than comparison.
Base class for functors that compare ConfigDoF.
Eigen::MatrixXd m_def_tensor_B
bool _for_each(F f, G g) const
bool operator()(const ConfigDoF &other) const
Return config == other.
Eigen::MatrixXd m_new_disp_A
bool operator()(const PermuteIterator &A, const PermuteIterator &B) const override
Return A*config == B*config, store A*config < B*config.
bool is_less() const
Returns less than comparison.
double _def_tensor_A(Index i, Index j) const
ConfigDoFIsEquivalentBase(const ConfigDoF &_configdof)
Compare displacement DoF.
Index permute_ind(Index i) const
Displacement(const Configuration &_config, double _tol)
bool operator()(const ConfigDoF &other) const override
Return config == other, store config < other.
const ConfigDoF & configdof() const
const Access the DoF
double _def_tensor(Index i, Index j) const
Strain * _clone() const override
bool _for_each(F f, G g) const
double _def_tensor_B(Index i, Index j) const
Index size() const
*** ACCESSORS ***
bool operator()(const PermuteIterator &A, const PermuteIterator &B) const override
Return A*config == B*config, store A*config < B*config.
const Eigen::Matrix3d & deformation() const
double new_disp_B(Index i, Index j) const
void _update_B(const PermuteIterator &B) const
Eigen::MatrixXd m_def_tensor
config().deformation().transpose()*config().deformation()
bool operator()(const PermuteIterator &A) const
Return config == A*config.
Occupation(const ConfigDoF &_configdof)
bool operator()(const PermuteIterator &A) const override
Return config == A*config, store config < A*config.
const matrix_type & matrix() const
Const access of entire cartesian symmetry matrix.
bool operator()(const PermuteIterator &A, const PermuteIterator &B) const
Return A*config == B*config.
notstd::cloneable_ptr< DoFIsEquivalent::ConfigDoFIsEquivalentBase > m_f
Displacement(const ConfigDoF &_configdof, double _tol)
bool operator()(const PermuteIterator &A, const PermuteIterator &B) const override
Return A*config == B*config, store A*config < B*config.
EigenIndex Index
For long integer indexing:
std::unique_ptr< ConfigDoFIsEquivalentBase > clone() const
bool operator()(const ConfigDoF &other) const override
Return config == other, store config < other.
A container class for the different degrees of freedom a Configuration might have.
Occupation * _clone() const override
std::unique_ptr< Occupation > clone() const
Displacement * _clone() const override
Eigen::MatrixXd m_def_tensor_A
Abstract base class specialization of ConfigDoFIsEquivalentBase for floating point DoF types...
virtual ConfigDoFIsEquivalentBase * _clone() const =0
double new_disp_A(Index i, Index j) const
IntegralIsEquivalent(const ConfigDoF &_configdof)
bool operator()(const PermuteIterator &A) const override
Return config == A*config, store config < A*config.
Wrapper class for generic equality comparison of ConfigDoF.
bool _for_each(F f, G g) const
std::unique_ptr< Strain > clone() const
Occupation(const Configuration &_config)
const ConfigDoF * m_configdof
std::unique_ptr< Displacement > clone() const
bool operator()(const Configuration &other) const
Return config == other.
void _update_A(const PermuteIterator &A) const
const ConfigDoF & configdof() const
const displacement_matrix_t & displacement() const
ConfigDoFIsEquivalent(std::unique_ptr< ConfigDoFIsEquivalentType > f)
Construct a ConfigDoFCompare object for a particular DoF type.
bool operator()(const PermuteIterator &A) const override
Return config == A*config, store config < A*config.
Strain(const ConfigDoF &_configdof, double _tol)
bool operator()(const Configuration &other) const
Return config == other.
displacement_t disp(Index i)
Strain(const Configuration &_config, double _tol)
ConfigDoFIsEquivalent make_dof_is_equivalent(Args &&...args)
Index factor_group_index() const
Return the index into m_factor_group_permute of the factor group op being pointed at...
bool _check(const T &A, const T &B) const
A Configuration represents the values of all degrees of freedom in a Supercell.