Skip to content

Commit

Permalink
Added point group symmetry recognizer...EJB
Browse files Browse the repository at this point in the history
  • Loading branch information
ebylaska committed Sep 15, 2023
1 parent fd1579f commit e75b144
Show file tree
Hide file tree
Showing 8 changed files with 1,800 additions and 99 deletions.
10 changes: 9 additions & 1 deletion Nwpw/nwpwlib/ion/Ion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>

#include "json.hpp"
Expand Down Expand Up @@ -323,10 +324,17 @@ Ion::Ion(std::string rtdbstring, Control2 &control)
}

//Check for Point group here????
double *rion_sym = fion1; //temporary
sym_tolerance = (geomjson["symmetry_tolerance"].is_number_float())
? (double) geomjson["symmetry_tolerance"]
: 0.001;

determine_point_group(rion1,mass,nion,
sym_tolerance,
group_name,rotation_type,
inertia_tensor,inertia_moments,inertia_axes);
inertia_tensor,inertia_moments,inertia_axes,
rion_sym);
std::fill(rion_sym,rion_sym+3*nion,0.0); //re-zero the array

// generate random initial velocities (temperature, seed) - only set with
// random velocities if seed > 0
Expand Down
5 changes: 5 additions & 0 deletions Nwpw/nwpwlib/parse/parse_pwdft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ static json parse_geometry(json geom, int *curptr,
autosym = 0;
else if (mystring_contains(mystring_lowercase(lines[cur]), "autosym"))
autosym = 1;
else if (mystring_contains(mystring_lowercase(lines[cur]),"symmetry_tolerance"))
geomjson["symmetry_tolerance"] = std::stod(mystring_split(mystring_lowercase(lines[cur]),"symmetry_tolerance")[1]);
else if (mystring_contains(mystring_lowercase(lines[cur]),"sym_tolerance"))
geomjson["symmetry_tolerance"] = std::stod(mystring_split(mystring_lowercase(lines[cur]),"sym_tolerance")[1]);


geomjson["conv"] = conv;
geomjson["center"] = center;
Expand Down
Loading

0 comments on commit e75b144

Please sign in to comment.