CASM  1.1.0
A Clusters Approach to Statistical Mechanics
ClusterSpecs.hh
Go to the documentation of this file.
1 #ifndef CASM_ClusterSpecs
2 #define CASM_ClusterSpecs
3 
4 #include <vector>
5 
9 #include "casm/global/enum.hh"
13 
14 namespace CASM {
15 
16 class SupercellSymInfo;
17 class SymGroup;
18 
36  public:
37  typedef std::vector<IntegralCluster> IntegralClusterVec;
38  typedef std::vector<PrimPeriodicOrbit<IntegralCluster>> PeriodicOrbitVec;
39  typedef std::vector<LocalOrbit<IntegralCluster>> LocalOrbitVec;
40 
42  std::string name() const;
44 
46  IntegralClusterVec const &generating_elements) const;
47  PeriodicOrbitVec make_periodic_orbits(std::ostream &status) const;
48 
50  IntegralClusterVec const &generating_elements) const;
51  LocalOrbitVec make_local_orbits(std::ostream &status) const;
52 
53  private:
54  virtual std::string _name() const = 0;
56 
58  IntegralClusterVec const &generating_elements) const;
59  virtual PeriodicOrbitVec _make_periodic_orbits(std::ostream &status) const;
60 
62  IntegralClusterVec const &generating_elements) const;
63  virtual LocalOrbitVec _make_local_orbits(std::ostream &status) const;
64 };
65 
78 template <typename FunctorType>
79 void for_all_orbits(ClusterSpecs const &cluster_specs,
80  std::vector<IntegralCluster> const &generating_elements,
81  FunctorType const &f);
82 
94 template <typename FunctorType>
95 void for_all_orbits(ClusterSpecs const &cluster_specs, std::ostream &status,
96  FunctorType const &f);
97 
103  public:
104  static std::string const method_name; /*periodic_max_length*/
105 
107  PeriodicMaxLengthClusterSpecs(std::shared_ptr<Structure const> _shared_prim,
108  SymGroup const &_generating_group,
109  SiteFilterFunction const &_site_filter,
110  std::vector<double> const &_max_length,
111  std::vector<IntegralClusterOrbitGenerator> const
112  &_custom_generators = {});
113 
115  std::shared_ptr<Structure const> shared_prim;
116 
120 
123 
128 
139  std::vector<double> max_length;
140 
142  std::vector<IntegralClusterOrbitGenerator> custom_generators;
143 
144  private:
145  std::string _name() const override;
147 
149  IntegralClusterVec const &generating_elements) const override;
150  PeriodicOrbitVec _make_periodic_orbits(std::ostream &status) const override;
151 };
152 
156  public:
157  static std::string const method_name; /*local_max_length*/
158 
159  LocalMaxLengthClusterSpecs(std::shared_ptr<Structure const> _shared_prim,
160  SymGroup const &_generating_group,
161  IntegralCluster const &_phenomenal,
162  SiteFilterFunction const &_site_filter,
163  std::vector<double> const &_max_length,
164  std::vector<double> const &_cutoff_radius,
165  bool _include_phenomenal_sites,
166  std::vector<IntegralClusterOrbitGenerator> const
167  &_custom_generators = {});
168 
170  std::shared_ptr<Structure const> shared_prim;
171 
175 
178 
181 
186 
197  std::vector<double> max_length;
198 
203  std::vector<double> cutoff_radius;
204 
208 
210  std::vector<IntegralClusterOrbitGenerator> custom_generators;
211 
212  private:
213  std::string _name() const override;
215 
217  IntegralClusterVec const &generating_elements) const override;
218  LocalOrbitVec _make_local_orbits(std::ostream &status) const override;
219 };
220 
225 
227 
229  std::string _method_name, std::shared_ptr<Structure const> _shared_prim,
230  SymGroup const &_generating_group, SymCompareType const &_sym_compare,
231  SiteFilterFunction _site_filter,
232  std::vector<ClusterFilterFunction> _cluster_filter,
233  std::vector<CandidateSitesFunction> _candidate_sites,
234  std::vector<IntegralClusterOrbitGenerator> _custom_generators);
235 
237  std::shared_ptr<Structure const> shared_prim;
238 
241 
244 
249 
255 
261 
264 
265  private:
267 
268  std::string _name() const override;
270 
272  IntegralClusterVec const &generating_elements) const override;
273  PeriodicOrbitVec _make_periodic_orbits(std::ostream &status) const override;
274 };
275 
280 
282 
284  std::string _method_name, std::shared_ptr<Structure const> _shared_prim,
285  SymGroup const &_generating_group, SymCompareType const &_sym_compare,
286  SiteFilterFunction _site_filter,
287  std::vector<ClusterFilterFunction> _cluster_filter,
288  std::vector<CandidateSitesFunction> _candidate_sites,
289  std::vector<IntegralClusterOrbitGenerator> _custom_generators);
290 
292  std::shared_ptr<Structure const> shared_prim;
293 
296 
299 
304 
310 
316 
319 
320  private:
322 
323  std::string _name() const override;
325 
327  IntegralClusterVec const &generating_elements) const override;
328  LocalOrbitVec _make_local_orbits(std::ostream &status) const override;
329 };
330 
331 // ** Filter functions **
332 
334 bool all_sites_filter(const xtal::Site &site);
335 
337 bool alloy_sites_filter(const xtal::Site &site);
338 
340 SiteFilterFunction dof_sites_filter(const std::vector<DoFKey> &dofs = {});
341 
344 
347 
348 // /// Accept clusters with max pair distance (using closest images) less than
349 // max_length ClusterFilterFunction within_scel_max_length_cluster_filter(
350 // double max_length,
351 // Eigen::Matrix3l const &superlattice_matrix);
352 
355 
358 
359 // /// Sites in the supercell defined by the superlattice_matrix
360 // CandidateSitesFunction scel_neighborhood(Eigen::Matrix3l const
361 // &superlattice_matrix);
362 
366 
369  IntegralCluster const &phenomenal, double cutoff_radius,
370  bool include_phenomenal_sites = false);
371 
372 // /// Sites within cutoff_radius distance (using closest images) to any site in
373 // the phenomenal cluster CandidateSitesFunction
374 // within_scel_cutoff_radius_neighborhood(
375 // IntegralCluster const &phenomenal,
376 // double cutoff_radius,
377 // Eigen::Matrix3l const &superlattice_matrix);
378 
379 } // namespace CASM
380 #endif
Template class to be specialized for comparisons with aperiodic symmetry.
CLUSTER_PERIODICITY_TYPE periodicity_type() const
Definition: ClusterSpecs.cc:16
virtual CLUSTER_PERIODICITY_TYPE _periodicity_type() const =0
std::vector< PrimPeriodicOrbit< IntegralCluster > > PeriodicOrbitVec
Definition: ClusterSpecs.hh:38
std::vector< IntegralCluster > IntegralClusterVec
Definition: ClusterSpecs.hh:37
virtual LocalOrbitVec _make_local_orbits(IntegralClusterVec const &generating_elements) const
Definition: ClusterSpecs.cc:54
std::vector< LocalOrbit< IntegralCluster > > LocalOrbitVec
Definition: ClusterSpecs.hh:39
PeriodicOrbitVec make_periodic_orbits(IntegralClusterVec const &generating_elements) const
Definition: ClusterSpecs.cc:20
std::string name() const
This is the orbit generation method name.
Definition: ClusterSpecs.cc:14
LocalOrbitVec make_local_orbits(IntegralClusterVec const &generating_elements) const
Definition: ClusterSpecs.cc:30
virtual PeriodicOrbitVec _make_periodic_orbits(IntegralClusterVec const &generating_elements) const
Definition: ClusterSpecs.cc:40
virtual std::string _name() const =0
SymCompareType sym_compare
The comparisons used for orbit generation.
std::vector< ClusterFilterFunction > cluster_filter
PeriodicOrbitVec _make_periodic_orbits(IntegralClusterVec const &generating_elements) const override
std::shared_ptr< Structure const > shared_prim
The prim.
std::vector< CandidateSitesFunction > candidate_sites
std::string _name() const override
SymGroup generating_group
The orbit generating group.
CLUSTER_PERIODICITY_TYPE _periodicity_type() const override
std::vector< IntegralClusterOrbitGenerator > custom_generators
Specifies particular clusters that should be used to generate orbits.
Parameters most commonly used for local orbit generation.
LocalMaxLengthClusterSpecs(std::shared_ptr< Structure const > _shared_prim, SymGroup const &_generating_group, IntegralCluster const &_phenomenal, SiteFilterFunction const &_site_filter, std::vector< double > const &_max_length, std::vector< double > const &_cutoff_radius, bool _include_phenomenal_sites, std::vector< IntegralClusterOrbitGenerator > const &_custom_generators={})
static std::string const method_name
std::vector< double > max_length
std::vector< IntegralClusterOrbitGenerator > custom_generators
Specifies particular clusters that should be used to generate orbits.
IntegralCluster phenomenal
Phenomenal cluster, used to find local neighborhood.
CLUSTER_PERIODICITY_TYPE _periodicity_type() const override
LocalSymCompare< IntegralCluster > sym_compare
The comparisons used for orbit generation.
std::shared_ptr< Structure const > shared_prim
The prim.
std::string _name() const override
std::vector< double > cutoff_radius
LocalOrbitVec _make_local_orbits(IntegralClusterVec const &generating_elements) const override
PrimPeriodicSymCompare< IntegralCluster > sym_compare
The comparisons used for orbit generation.
static std::string const method_name
PeriodicMaxLengthClusterSpecs(std::shared_ptr< Structure const > _shared_prim, SymGroup const &_generating_group, SiteFilterFunction const &_site_filter, std::vector< double > const &_max_length, std::vector< IntegralClusterOrbitGenerator > const &_custom_generators={})
Constructor.
Definition: ClusterSpecs.cc:71
std::vector< double > max_length
std::string _name() const override
Definition: ClusterSpecs.cc:89
std::shared_ptr< Structure const > shared_prim
The prim.
PeriodicOrbitVec _make_periodic_orbits(IntegralClusterVec const &generating_elements) const override
Definition: ClusterSpecs.cc:97
std::vector< IntegralClusterOrbitGenerator > custom_generators
Specifies particular clusters that should be used to generate orbits.
CLUSTER_PERIODICITY_TYPE _periodicity_type() const override
Definition: ClusterSpecs.cc:91
Structure specifies the lattice and atomic basis of a crystal.
Definition: Structure.hh:30
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
Definition: SymGroup.hh:42
Base class for cloning.
#define CLONEABLE(T)
#define ABSTRACT_CLONEABLE(T)
Main CASM namespace.
Definition: APICommand.hh:8
void for_all_orbits(ClusterSpecs const &cluster_specs, std::vector< IntegralCluster > const &generating_elements, FunctorType const &f)
std::function< bool(xtal::Site)> SiteFilterFunction
std::string DoFKey
Definition: DoFDecl.hh:7
bool alloy_sites_filter(const xtal::Site &site)
Generate clusters using Site with site_occupant.size() > 1.
bool all_sites_filter(const xtal::Site &site)
Generate clusters using all Site.
std::function< std::vector< xtal::UnitCellCoord >Structure const &, SiteFilterFunction)> CandidateSitesFunction
CandidateSitesFunction origin_neighborhood()
Only sites in the origin unit cell {b, 0, 0, 0}.
ClusterFilterFunction all_clusters_filter()
Accept all clusters.
SiteFilterFunction dof_sites_filter(const std::vector< DoFKey > &dofs={})
Generate clusters using Site with specified DoF.
CandidateSitesFunction empty_neighborhood()
No sites (for null orbit, or global dof only)
CandidateSitesFunction cutoff_radius_neighborhood(IntegralCluster const &phenomenal, double cutoff_radius, bool include_phenomenal_sites=false)
Sites within cutoff_radius distance to any site in the phenomenal cluster.
CandidateSitesFunction max_length_neighborhood(double max_length)
ClusterFilterFunction max_length_cluster_filter(double max_length)
Accept clusters with max pair distance less than max_length.
std::function< bool(IntegralCluster)> ClusterFilterFunction
Definition: stream_io.hh:24