26 std::ostream &status)
const {
36 std::ostream &status)
const {
42 throw std::runtime_error(
43 "Error: make_periodic_orbits from generating elements not implemented "
49 std::ostream &status)
const {
50 throw std::runtime_error(
"Error: make_periodic_orbits not implemented for '" +
56 throw std::runtime_error(
57 "Error: make_local_orbits from generating elements not implemented for "
63 std::ostream &status)
const {
64 throw std::runtime_error(
"Error: make_local_orbits not implemented for '" +
69 "periodic_max_length";
72 std::shared_ptr<Structure const> _shared_prim,
74 std::vector<double>
const &_max_length,
75 std::vector<IntegralClusterOrbitGenerator>
const &_custom_generators)
77 generating_group(_generating_group),
79 site_filter(_site_filter),
80 max_length(_max_length),
81 custom_generators(_custom_generators) {
84 "Error in PeriodicMaxLengthClusterSpecs: max_length.size() == 0 (must "
85 "be greater than 0).");
104 std::ostream &status)
const {
106 std::vector<OrbitBranchSpecs<orbit_type> > specs;
108 for (
int branch = 0; branch <
max_length.size(); ++branch) {
109 std::vector<xtal::UnitCellCoord> candidate_sites;
113 }
else if (branch == 1) {
127 specs.emplace_back(*
shared_prim, candidate_sites.begin(),
135 std::back_inserter(orbits), status);
142 std::shared_ptr<Structure const> _shared_prim,
145 std::vector<double>
const &_max_length,
146 std::vector<double>
const &_cutoff_radius,
bool _include_phenomenal_sites,
147 std::vector<IntegralClusterOrbitGenerator>
const &_custom_generators)
149 generating_group(_generating_group),
151 phenomenal(_phenomenal),
152 site_filter(_site_filter),
153 max_length(_max_length),
154 cutoff_radius(_cutoff_radius),
155 include_phenomenal_sites(_include_phenomenal_sites),
156 custom_generators(_custom_generators) {
159 "Error in LocalMaxLengthClusterSpecs: max_length.size() == 0 (must be "
164 "Error in LocalMaxLengthClusterSpecs: max_length.size() != "
165 "cutoff_radius.size() (must be equal).");
181 std::ostream &status)
const {
183 std::vector<OrbitBranchSpecs<orbit_type> > specs;
185 for (
int branch = 0; branch <
max_length.size(); ++branch) {
186 std::vector<xtal::UnitCellCoord> candidate_sites;
203 specs.emplace_back(*
shared_prim, candidate_sites.begin(),
211 std::back_inserter(orbits), status);
216 std::string _method_name, std::shared_ptr<Structure const> _shared_prim,
219 std::vector<ClusterFilterFunction> _cluster_filter,
220 std::vector<CandidateSitesFunction> _candidate_sites,
221 std::vector<IntegralClusterOrbitGenerator> _custom_generators)
223 generating_group(_generating_group),
224 sym_compare(_sym_compare),
225 site_filter(_site_filter),
226 cluster_filter(_cluster_filter),
227 candidate_sites(_candidate_sites),
228 custom_generators(_custom_generators),
229 m_method_name(_method_name) {
232 "Error in GenericPeriodicClusterSpecs: candidate_sites.size() == 0 "
233 "(must be greater than 0).");
253 throw std::runtime_error(
254 "Error in GenericPeriodicClusterSpecs::_make_periodic_orbits: "
255 "cluster_filter.size() != candidate_sites.size()");
258 std::vector<OrbitBranchSpecs<OrbitType> > specs;
261 std::vector<xtal::UnitCellCoord> tmp;
271 std::back_inserter(orbits), status);
276 std::string _method_name, std::shared_ptr<Structure const> _shared_prim,
279 std::vector<ClusterFilterFunction> _cluster_filter,
280 std::vector<CandidateSitesFunction> _candidate_sites,
281 std::vector<IntegralClusterOrbitGenerator> _custom_generators)
283 generating_group(_generating_group),
284 sym_compare(_sym_compare),
285 site_filter(_site_filter),
286 cluster_filter(_cluster_filter),
287 candidate_sites(_candidate_sites),
288 custom_generators(_custom_generators),
289 m_method_name(_method_name) {
292 "Error in GenericLocalClusterSpecs: candidate_sites.size() == 0 (must "
293 "be greater than 0).");
297 "Error in GenericLocalClusterSpecs: candidate_sites.size() != "
298 "cluster_filter.size() (must be equal).");
314 std::ostream &status)
const {
316 throw std::runtime_error(
317 "Error in GenericLocalClusterSpecs::_make_local_orbits: "
318 "candidate_sites.size() != cluster_filter.size()");
321 std::vector<OrbitBranchSpecs<OrbitType> > specs;
324 std::vector<xtal::UnitCellCoord> tmp;
334 std::back_inserter(orbits), status);
338 namespace ClusterSpecs_impl {
352 }
else if (dof ==
"occ" && site.
occupant_dof().size() > 1) {
372 if (clust.
size() <= 1) {
376 return invariants.displacement().back() <
max_length;
387 return std::vector<xtal::UnitCellCoord>{};
395 std::vector<xtal::UnitCellCoord> result;
396 for (
int i = 0; i < prim.
basis().size(); ++i) {
397 if (site_filter(prim.
basis()[i])) {
398 result.emplace_back(i, 0, 0, 0);
411 std::vector<xtal::UnitCellCoord> result;
451 double _cutoff_radius,
452 bool _include_phenomenal_sites)
459 std::vector<xtal::UnitCellCoord> result;
521 bool include_phenomenal_sites) {
523 include_phenomenal_sites};
std::shared_ptr< Structure const > shared_prim
Template class to be specialized for comparisons with aperiodic symmetry.
Stores cluster invariants: number of sites and site distances.
bool operator()(IntegralCluster const &clust)
bool include_phenomenal_sites
CutoffRadiusNeighborhood(IntegralCluster const &_phenomenal, double _cutoff_radius, bool _include_phenomenal_sites)
std::vector< xtal::UnitCellCoord > operator()(Structure const &prim, SiteFilterFunction site_filter)
IntegralCluster phenomenal
std::vector< DoFKey > dofs
bool operator()(xtal::Site const &site)
DoFSitesFilter(std::vector< DoFKey > const &_dofs)
std::vector< xtal::UnitCellCoord > operator()(Structure const &prim, SiteFilterFunction site_filter)
MaxLengthClusterFilter(double _max_length)
bool operator()(IntegralCluster const &clust)
std::vector< xtal::UnitCellCoord > operator()(Structure const &prim, SiteFilterFunction site_filter)
MaxLengthNeighborhood(double _max_length)
std::vector< xtal::UnitCellCoord > operator()(Structure const &prim, SiteFilterFunction site_filter)
CLUSTER_PERIODICITY_TYPE periodicity_type() const
virtual CLUSTER_PERIODICITY_TYPE _periodicity_type() const =0
std::vector< PrimPeriodicOrbit< IntegralCluster > > PeriodicOrbitVec
std::vector< IntegralCluster > IntegralClusterVec
virtual LocalOrbitVec _make_local_orbits(IntegralClusterVec const &generating_elements) const
std::vector< LocalOrbit< IntegralCluster > > LocalOrbitVec
PeriodicOrbitVec make_periodic_orbits(IntegralClusterVec const &generating_elements) const
std::string name() const
This is the orbit generation method name.
LocalOrbitVec make_local_orbits(IntegralClusterVec const &generating_elements) const
virtual PeriodicOrbitVec _make_periodic_orbits(IntegralClusterVec const &generating_elements) const
virtual std::string _name() const =0
size_type size() const
Number of elements in the cluster.
SymGroup generating_group
The orbit generating group.
std::string _name() const override
SiteFilterFunction site_filter
std::vector< ClusterFilterFunction > cluster_filter
GenericLocalClusterSpecs(std::string _method_name, std::shared_ptr< Structure const > _shared_prim, SymGroup const &_generating_group, SymCompareType const &_sym_compare, SiteFilterFunction _site_filter, std::vector< ClusterFilterFunction > _cluster_filter, std::vector< CandidateSitesFunction > _candidate_sites, std::vector< IntegralClusterOrbitGenerator > _custom_generators)
std::vector< IntegralClusterOrbitGenerator > custom_generators
Specifies particular clusters that should be used to generate orbits.
std::string m_method_name
std::shared_ptr< Structure const > shared_prim
The prim.
LocalOrbitVec _make_local_orbits(IntegralClusterVec const &generating_elements) const override
std::vector< CandidateSitesFunction > candidate_sites
CLUSTER_PERIODICITY_TYPE _periodicity_type() const override
SymCompareType sym_compare
The comparisons used for orbit generation.
SymCompareType sym_compare
The comparisons used for orbit generation.
std::vector< ClusterFilterFunction > cluster_filter
GenericPeriodicClusterSpecs(std::string _method_name, std::shared_ptr< Structure const > _shared_prim, SymGroup const &_generating_group, SymCompareType const &_sym_compare, SiteFilterFunction _site_filter, std::vector< ClusterFilterFunction > _cluster_filter, std::vector< CandidateSitesFunction > _candidate_sites, std::vector< IntegralClusterOrbitGenerator > _custom_generators)
PeriodicOrbitVec _make_periodic_orbits(IntegralClusterVec const &generating_elements) const override
SiteFilterFunction site_filter
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::string m_method_name
std::vector< IntegralClusterOrbitGenerator > custom_generators
Specifies particular clusters that should be used to generate orbits.
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.
SiteFilterFunction site_filter
bool include_phenomenal_sites
CLUSTER_PERIODICITY_TYPE _periodicity_type() const override
LocalSymCompare< IntegralCluster > sym_compare
The comparisons used for orbit generation.
SymGroup generating_group
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
SymGroup generating_group
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.
SiteFilterFunction site_filter
std::vector< double > max_length
std::string _name() const override
std::shared_ptr< Structure const > shared_prim
The prim.
PeriodicOrbitVec _make_periodic_orbits(IntegralClusterVec const &generating_elements) const override
std::vector< IntegralClusterOrbitGenerator > custom_generators
Specifies particular clusters that should be used to generate orbits.
CLUSTER_PERIODICITY_TYPE _periodicity_type() const override
Structure specifies the lattice and atomic basis of a crystal.
const Lattice & lattice() const
const std::vector< xtal::Site > & basis() const
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
bool has_dof(std::string const &_dof_type) const
const std::vector< Molecule > & occupant_dof() const
OutputIterator neighborhood(Structure const &unit, double max_radius, SiteFilterFunction site_filter, OutputIterator result, double xtal_tol)
Output the neighborhood of UnitCellCoord within max_radius of any sites in unit cell.
GenericVectorXdScelFormatter lattice()
OrbitOutputIterator make_orbits(OrbitBranchSpecsIterator begin, OrbitBranchSpecsIterator end, const std::vector< IntegralClusterOrbitGenerator > &custom_generators, OrbitOutputIterator result, std::ostream &status)
Generate orbits of IntegralCluster using OrbitBranchSpecs.
std::function< bool(xtal::Site)> SiteFilterFunction
bool alloy_sites_filter(const xtal::Site &site)
Generate clusters using Site with site_occupant.size() > 1.
std::vector< Orbit< SymCompareType > > generate_orbits(std::vector< typename SymCompareType::Element > const &generating_elements, SymGroup const &generating_group, SymCompareType const &sym_compare)
Construct orbits from a vector of generating elements.
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