Skip to content

Commit 21a6ea3

Browse files
author
Martin D. Weinberg
committed
Added more aliases
1 parent 74e9d88 commit 21a6ea3

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

expui/Coefficients.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ namespace CoefClasses
9898

9999
if (not valid) {
100100
throw std::runtime_error(std::string("Coefs::setUnits: Warning, type '")
101-
+ Name + "' or unit '" + Unit + "' are not recognized.");
101+
+ Name + "' with unit '" + Unit +
102+
"' is incompatible or not recognized.");
102103
}
103104

104105
// Check for existing unit and update

expui/UnitValidator.cc

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,28 @@ UnitValidator::createAllowedUnitTypes()
4949
allowed["G"] = "G";
5050

5151
// Aliases
52-
allowed["len"] = "length";
53-
allowed["l"] = "length";
54-
allowed["L"] = "length";
55-
allowed["m"] = "mass";
56-
allowed["M"] = "mass";
57-
allowed["t"] = "time";
58-
allowed["T"] = "time";
59-
allowed["vel"] = "velocity";
60-
allowed["Vel"] = "velocity";
61-
allowed["v"] = "velocity";
62-
allowed["V"] = "velocity";
63-
allowed["grav"] = "G";
52+
allowed["Length"] = "length";
53+
allowed["Len"] = "length";
54+
allowed["len"] = "length";
55+
allowed["l"] = "length";
56+
allowed["L"] = "length";
57+
allowed["Mass"] = "mass";
58+
allowed["m"] = "mass";
59+
allowed["M"] = "mass";
60+
allowed["Time"] = "time";
61+
allowed["t"] = "time";
62+
allowed["T"] = "time";
63+
allowed["vel"] = "velocity";
64+
allowed["Vel"] = "velocity";
65+
allowed["Velocity"] = "velocity";
66+
allowed["v"] = "velocity";
67+
allowed["V"] = "velocity";
68+
allowed["Grav"] = "G";
69+
allowed["grav"] = "G";
70+
allowed["grav_constant"] = "G";
71+
allowed["Grav_constant"] = "G";
6472
allowed["gravitational_constant"] = "G";
73+
allowed["Gravitational_constant"] = "G";
6574

6675
return allowed;
6776
}

0 commit comments

Comments
 (0)