commit 57e3ab910e896fc3892039e4b1c804ac34b1071a
parent 22187c513b089bbc9708d672944a4adc89ad25b8
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Thu, 2 Mar 2017 14:18:30 +0100
Fix the range of the thin dielectric absorption parameter
Absorption parameter can lie in [0, INFINITY) rather than [0, 1].
Diffstat:
4 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/doc/input b/doc/input
@@ -211,7 +211,7 @@
#
# <thin-dielectric> ::=
# thin_dielectric:
-# absorption: REAL # in [0, 1]
+# absorption: REAL # in [0, INF)
# thickness: REAL # in [0, INF)
# refractive_index: REAL # in ]0, INF)
#
diff --git a/src/parser/solparser.c b/src/parser/solparser.c
@@ -1077,7 +1077,7 @@ parse_material_thin_dielectric
} (void)0
if(!strcmp((char*)key->data.scalar.value, "absorption")) {
SETUP_MASK(ABSORPTION, "absorption");
- res = parse_real(parser, val, 0, 1, &mtl->absorption);
+ res = parse_real(parser, val, 0, DBL_MAX, &mtl->absorption);
} else if(!strcmp((char*)key->data.scalar.value, "refractive_index")) {
SETUP_MASK(REFRACTIVE_INDEX, "refractive_index");
res = parse_real
diff --git a/src/parser/yaml/test_ko_0.yaml b/src/parser/yaml/test_ko_0.yaml
@@ -234,10 +234,6 @@
- material:
thin_dielectric: { absorption: -1, thickness: 0, refractive_index: 1 }
---
-# invalid absorption
-- material:
- thin_dielectric: { absorption: 1.001, thickness: 0, refractive_index: 1 }
----
# invalid thickness
- material:
thin_dielectric: { absorption: 0, thickness: -0.01, refractive_index: 1 }
diff --git a/src/parser/yaml/test_ok_5.yaml b/src/parser/yaml/test_ok_5.yaml
@@ -37,7 +37,7 @@
- cylinder: { height: 1, radius: 1 }
material:
thin_dielectric:
- absorption: 0
+ absorption: 40
thickness: 10
refractive_index: 0.0001