34 Coordinate(init_pos), m_nlist_ind(-1), m_type_ID(-1) {
126 return (
min_dist(test_coord) < compare_tol);
162 &&
"In Site::compare_type() comparing initialized occupant to uninitialized occupant! This isn't a good idea!");
170 return (
compare_type(test_site) && Coordinate::operator==(test_site));
251 for(
int i = 0; i < 3; i++) {
266 while(ch !=
'\n' && ch !=
':' && !stream.eof()) {
268 while((ch < 'a' || ch >
'z') && (ch < 'A' || ch >
'Z') && ch !=
'\n' && ch !=
':' && !stream.eof()) {
272 if(ch !=
'\n' && ch !=
':' && !stream.eof()) {
296 if(tocc[i].name == tMol.
name) {
300 if(index == tocc.
size()) {
301 std::cerr <<
"ERROR in Site::read(). Occupying molecule not listed in possible occupants" << std::endl;
302 std::cout <<
" occupying molecule name: " << tMol.
name <<
" index: " << index << std::endl;
303 std::cout <<
" possible occupants: ";
305 std::cout << tocc[i].name <<
" ";
306 std::cout <<
" " << std::endl;
314 std::cerr <<
"WARNING: Trying to read Site info, but no valid input was received." << std::endl;
324 std::cerr <<
"WARNING: Trying to read Site info, but no valid input was received." << std::endl;
326 stream.ignore(1000,
'\n');
334 void Site::read(std::istream &stream, std::string &elem,
bool SD_is_on) {
342 for(
int i = 0; i < 3; i++) {
364 std::cerr <<
"WARNING: Trying to read Site info, but no valid input was received." << std::endl;
366 stream.ignore(1000,
'\n');
384 stream << std::flush;
399 stream << std::flush;
410 void Site::print_mol(std::ostream &stream,
int spaces,
char delim,
bool SD_is_on)
const {
444 json[
"coordinate"].
put(coord);
527 return Site(LHS) += RHS;
533 return Site(RHS) += LHS;
std::string occ_name() const
Name of current occupant (name of molecule, but for single atom, molecule name is species name) ...
void read(std::istream &stream, bool SD_is_on=false)
Coordinate & operator-=(const Coordinate &RHS)
Negative translation of this coordinate by RHS.cart()
void set_domain(const Array< T > &new_dom)
void set_ID(Index new_ID)
void set_basis_ind(Index _basis_ind)
Set basis Index.
void set_value(int new_state) override
void from_json(ClexDescription &desc, const jsonParser &json)
jsonParser & to_json(jsonParser &json) const
bool is_specified() const
bool almost_equal(const Site &test_site, double tol) const
void push_back(const T &toPush)
jsonParser & to_json(const ClexDescription &desc, jsonParser &json)
double dist(const Coordinate &neighbor) const
distance (in Angstr) of neighbor from *this
const MoleculeOccupant & site_occupant() const
OccupantDoF< Molecule > MoleculeOccupant
void from_json(const jsonParser &json)
void set_lattice(const Lattice &new_lat, COORD_TYPE mode)
Coordinate & apply_sym(const SymOp &op)
Transform coordinate by symmetry operation (including translation)
bool _compare_type_no_ID(const Site &test_site) const
void print(std::ostream &stream, const Coordinate &trans, int spaces, char delim, bool SD_is_on=false) const
void print_occ(std::ostream &out) const
Array< std::string > allowed_occupants() const
GenericCluster< CoordType > operator+(const GenericCluster< CoordType > &LHS, const Coordinate &RHS)
create translated cluster
bool compare(const Coordinate &test_coord, double compare_tol=TOL) const
const Molecule & occ() const
void set_basis_ind(Index)
set basis_ind of site and its occupant functions
Site & operator+=(const Coordinate &translation)
void print(std::ostream &stream) const
double min_dist(const Coordinate &neighbor) const
Returns distance (in Angstr) to nearest periodic image of neighbor.
std::ostream & operator<<(std::ostream &_stream, const FormattedPrintable &_formatted)
SymOp is the Coordinate representation of a symmetry operation it keeps fraction (FRAC) and Cartesian...
static Array< Site > & _type_prototypes()
BasisSet operator*(const SymOp &LHS, const BasisSet &RHS)
void print(std::ostream &out) const
Represents cartesian and fractional coordinates.
Index nlist_ind() const
access m_nlist_ind
MoleculeOccupant m_site_occupant
Coordinate & apply_sym_no_trans(const SymOp &op)
Transform coordinate by symmetry operation (without translation)
EigenIndex Index
For long integer indexing:
bool compare_type(const Site &test_site) const
bool is_vacant() const
Checks if current occupant is a vacancy.
void print(std::ostream &stream, COORD_TYPE mode, char term=0, int prec=7, int pad=5) const
void print_occ(std::ostream &stream) const
Coordinate & operator+=(const Coordinate &RHS)
Positive translation of this coordinate by RHS.cart()
Index size() const override
void read(std::istream &stream, COORD_TYPE mode)
void set_lattice(const Lattice &new_lat, COORD_TYPE mode)
Change the home lattice of the coordinate, selecting one representation (either CART or FRAC) that re...
void set_nlist_ind(Index)
set m_nlist_ind of Site and its DoFs
Site & apply_sym_no_trans(const SymOp &op)
bool operator==(const Site &test_site) const
const T & get_occ() const
Site(const Lattice &init_home)
std::array< bool, 3 > sd_type
jsonParser & put_obj()
Puts new empty JSON object.
jsonParser & put(const T &value)
Puts data of any type T for which 'jsonParser& to_json( const T &value, jsonParser &json)' is defined (same as 'o...
bool contains(const std::string &name) const
void print_mol(std::ostream &stream, int spaces, char delim, bool SD_is_on=false) const
void set_site_occupant(const MoleculeOccupant &new_dof)
Site & apply_sym(const SymOp &op)
const Lattice & home() const
Access the home lattice of the coordinate.
void update_data_members(const Site &_ref_site)
Basic std::vector like container (deprecated)
Site & operator-=(const Coordinate &translation)
bool compare(const OccupantDoF &RHS, bool compare_value) const
bool valid_index(Index i)
static COORD_TYPE CHECK()
get the current mode (call using COORD_MODE::CHECK())