Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MLIP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tadah
MLIP
Commits
edf014d7
Commit
edf014d7
authored
2 months ago
by
mkirsz
Browse files
Options
Downloads
Patches
Plain Diff
Added density calculation
parent
8c978f44
No related branches found
Branches containing commit
No related tags found
1 merge request
!17
Fix bug when reading stress with vaspreader. Added T to structure and adjusted...
Pipeline
#51253
failed
1 month ago
Stage: build_debug
Stage: run_unit_tests
Stage: build_release
Stage: trigger
Changes
2
Pipelines
5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/tadah/mlip/structure.h
+3
-0
3 additions, 0 deletions
include/tadah/mlip/structure.h
src/structure.cpp
+8
-0
8 additions, 0 deletions
src/structure.cpp
with
11 additions
and
0 deletions
include/tadah/mlip/structure.h
+
3
−
0
View file @
edf014d7
...
@@ -137,6 +137,9 @@ struct Structure {
...
@@ -137,6 +137,9 @@ struct Structure {
/** @return volume of this structure. */
/** @return volume of this structure. */
double
get_volume
()
const
;
double
get_volume
()
const
;
/** @return density of this structure in g/cm^3 */
double
get_density
()
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
...
...
This diff is collapsed.
Click to expand it.
src/structure.cpp
+
8
−
0
View file @
edf014d7
...
@@ -173,6 +173,14 @@ size_t Structure::get_nn_iindex(const size_t i, const size_t j, const size_t jj)
...
@@ -173,6 +173,14 @@ size_t Structure::get_nn_iindex(const size_t i, const size_t j, const size_t jj)
double
Structure
::
get_volume
()
const
{
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
V
=
cell
.
row
(
0
)
*
(
cell
.
row
(
1
).
cross
(
cell
.
row
(
2
)));
V
*=
1e-24
;
// convert to cm^3
double
amu
=
1.66053906660e-24
;
// g
double
mass
=
0
;
for
(
const
auto
&
a
:
atoms
)
mass
+=
PeriodicTable
::
get_mass
(
a
.
Z
);
return
amu
*
mass
/
V
;
}
double
Structure
::
get_virial_pressure
()
const
{
double
Structure
::
get_virial_pressure
()
const
{
return
stress
.
trace
()
/
get_volume
()
/
3
;
return
stress
.
trace
()
/
get_volume
()
/
3
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment