Skip to content
Snippets Groups Projects
Commit c48e8c4c authored by Marcin Kirsz's avatar Marcin Kirsz
Browse files

Merge branch 'develop' into 'main'

added get_t

See merge request !18
parents ebe0c979 1d414081
No related branches found
No related tags found
1 merge request!18added get_t
Pipeline #51496 passed
...@@ -140,6 +140,9 @@ struct Structure { ...@@ -140,6 +140,9 @@ struct Structure {
/** @return density of this structure in g/cm^3 */ /** @return density of this structure in g/cm^3 */
double get_density() const; double get_density() const;
/** @return temperature of this structure in K */
double get_temperature() const;
/** @return virial pressure calculated from the stress tensor. /** @return virial pressure calculated from the stress tensor.
* *
* Units: energy/distance^3 * Units: energy/distance^3
......
...@@ -174,7 +174,7 @@ double Structure::get_volume() const { ...@@ -174,7 +174,7 @@ double Structure::get_volume() const {
return cell.row(0)*(cell.row(1).cross(cell.row(2))); return cell.row(0)*(cell.row(1).cross(cell.row(2)));
} }
double Structure::get_density() const { double Structure::get_density() const {
double V = cell.row(0)*(cell.row(1).cross(cell.row(2))); double V = get_volume();
V*=1e-24; // convert to cm^3 V*=1e-24; // convert to cm^3
double amu = 1.66053906660e-24; // g double amu = 1.66053906660e-24; // g
double mass = 0; double mass = 0;
...@@ -182,6 +182,10 @@ double Structure::get_density() const { ...@@ -182,6 +182,10 @@ double Structure::get_density() const {
return amu*mass/V; return amu*mass/V;
} }
double Structure::get_temperature() const {
return T;
}
double Structure::get_virial_pressure() const { double Structure::get_virial_pressure() const {
return stress.trace()/get_volume()/3; return stress.trace()/get_volume()/3;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment