initial implementation of automated unit conversion.

this includes a tester program and implementation into pair style tersoff
This commit is contained in:
Axel Kohlmeyer
2020-06-22 17:57:05 -04:00
parent f5a31fefdc
commit b29b3d52f6
9 changed files with 308 additions and 13 deletions

View File

@ -583,6 +583,36 @@ std::string utils::get_potential_units(const std::string & path, const std::stri
return "";
}
/* ----------------------------------------------------------------------
return bitmask of supported conversions for a given property
------------------------------------------------------------------------- */
int utils::get_supported_conversions(const int property)
{
if (property == ENERGY) {
return METAL2REAL | REAL2METAL;
}
return NOCONVERT;
}
/* ----------------------------------------------------------------------
return conversion factor for a given property and conversion setting
return 0.0 if unknown.
------------------------------------------------------------------------- */
double utils::get_conversion_factor(const int property, const int conversion)
{
if (property == ENERGY) {
if (conversion == NOCONVERT) {
return 1.0;
} else if (conversion == METAL2REAL) {
return 23.060549;
} else if (conversion == REAL2METAL) {
return 0.04336410204284381954;
}
}
return 0.0;
}
/* ------------------------------------------------------------------ */
extern "C" {