Skip to content

Commit c28796c

Browse files
committed
Fixed issue where MM was not a valid length unit.
1 parent 7a7061a commit c28796c

File tree

5 files changed

+9
-0
lines changed

5 files changed

+9
-0
lines changed

src/consts.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ pub const MICRON: f64 = 1E-6;
1515
pub const NM: f64 = 1E-9;
1616
/// One centimeter in meters.
1717
pub const CM: f64 = 1E-2;
18+
/// One milimter in meters.
19+
pub const MM: f64 = 1E-3;
1820
/// Vacuum permitivity in Farads/meter.
1921
pub const EPS0: f64 = 8.8541878128E-12;
2022
/// Bohr radius in meters.

src/geometry.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ impl Geometry for Mesh0D {
5252
let length_unit: f64 = match input.length_unit.as_str() {
5353
"MICRON" => MICRON,
5454
"CM" => CM,
55+
"MM" => MM,
5556
"ANGSTROM" => ANGSTROM,
5657
"NM" => NM,
5758
"M" => 1.,
@@ -142,6 +143,7 @@ impl Geometry for Mesh1D {
142143
let length_unit: f64 = match geometry_input.length_unit.as_str() {
143144
"MICRON" => MICRON,
144145
"CM" => CM,
146+
"MM" => MM,
145147
"ANGSTROM" => ANGSTROM,
146148
"NM" => NM,
147149
"M" => 1.,
@@ -323,6 +325,7 @@ impl Geometry for Mesh2D {
323325
let length_unit: f64 = match geometry_input.length_unit.as_str() {
324326
"MICRON" => MICRON,
325327
"CM" => CM,
328+
"MM" => MM,
326329
"ANGSTROM" => ANGSTROM,
327330
"NM" => NM,
328331
"M" => 1.,

src/input.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ where <T as Geometry>::InputFileFormat: Deserialize<'static> + 'static {
381381
let length_unit: f64 = match particle_parameters.length_unit.as_str() {
382382
"MICRON" => MICRON,
383383
"CM" => CM,
384+
"MM" => MM,
384385
"ANGSTROM" => ANGSTROM,
385386
"NM" => NM,
386387
"M" => 1.,

src/parry.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ impl Geometry for ParryBall {
6363
let length_unit: f64 = match input.length_unit.as_str() {
6464
"MICRON" => MICRON,
6565
"CM" => CM,
66+
"MM" => MM,
6667
"ANGSTROM" => ANGSTROM,
6768
"NM" => NM,
6869
"M" => 1.,
@@ -186,6 +187,7 @@ impl Geometry for ParryTriMesh {
186187
let length_unit: f64 = match input.length_unit.as_str() {
187188
"MICRON" => MICRON,
188189
"CM" => CM,
190+
"MM" => MM,
189191
"ANGSTROM" => ANGSTROM,
190192
"NM" => NM,
191193
"M" => 1.,

src/sphere.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ impl Geometry for Sphere {
5858
let length_unit: f64 = match input.length_unit.as_str() {
5959
"MICRON" => MICRON,
6060
"CM" => CM,
61+
"MM" => MM,
6162
"ANGSTROM" => ANGSTROM,
6263
"NM" => NM,
6364
"M" => 1.,

0 commit comments

Comments
 (0)