initial implementation of automated unit conversion.
this includes a tester program and implementation into pair style tersoff
This commit is contained in:
@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user