commit 9413ef8d9f92662c0932eeb5d7010836295b1323
parent 639ef01866e4394cdb3a1c27febb7606c3d89625
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Thu, 14 Sep 2017 17:03:39 +0200
Add the output of paths with type error.
Diffstat:
2 files changed, 30 insertions(+), 18 deletions(-)
diff --git a/doc/solstice-output.5.txt b/doc/solstice-output.5.txt
@@ -415,10 +415,13 @@ DUMP RADIATIVE PATHS
For each sun direction, the *dump-radiative-paths-output* lists the geometric
data of the radiative paths sampled during a simulation. Each path is colored
-with respect to its trajectory: the path is blue or yellow whether it reaches
-or not a receiver, respectively. A path can be red if its first segment, i.e.
-the ray starting from the sun toward a primary geometry, is occluded by a non
-virtual object. The following grammar describes the formatting of a
+with respect to its type: the path is yellow if its first segment, i.e.
+the ray starting from the sun towards a primary geometry, is occluded by a non
+virtual object. If not occluded, the path can be blue or turquoise whether it
+reaches a receiver or not, respectively. Finally, the path can also be red if
+it was canceled due to a topologically incoherent impact (i.e. an impact on
+a surface not at the boundary of the medium in which the rays was propagating).
+The following grammar describes the formatting of a
*VTK-RADIATIVE-PATHS* file. Refer to the VTK format specification [2] for more
informations on the VTK file format.
@@ -436,10 +439,12 @@ VTK-RADIATIVE-PATHS ::= # vtk DataFile Version 2.0
SCALAR Radiative_path_type float 1
LOOKUP_TABLE path_type
<paths-type>
- LOOKUP_TABLE path_type 3
- <color-occlude>
+ LOOKUP_TABLE path_type 5
+ <color-error>
+ <color-unused>
<color-success>
<color-missing>
+ <color-occluded>
<paths-vertices> ::= <real3>
[ <real3> ... ] # up to <#vertices>
@@ -452,13 +457,17 @@ VTK-RADIATIVE-PATHS ::= # vtk DataFile Version 2.0
<paths-type> ::= <color-id>
[ <color-id> ... ] # up to <#paths>
-<color-id> ::= 0.0 # occlude
- | 0.5 # success
- | 1.0 # missing
-
-<color-occlude> ::= 1.0 0.0 0.0 1.0
+<color-id> ::= 0.0 # Red: for error paths
+ | 0.25 # Green: unused
+ | 0.5 # Blue: for success paths
+ | 0.75 # Turquoise: for missing paths
+ | 1.0 # Yellow: for occluded paths
+
+<color-error> ::= 1.0 0.0 0.0 1.0
+<color-unused> ::= 0.0 1.0 0.0 1.0
<color-success> ::= 0.0 0.0 1.0 1.0
-<color-missing> ::= 1.0 1.0 0.0 1.0
+<color-missing> ::= 0.0 1.0 1.0 1.0
+<color-occluded> ::= 1.0 1.0 0.0 1.0
<#paths> ::= INTEGER
<#path-segments> ::= INTEGER
diff --git a/src/solstice_solve.c b/src/solstice_solve.c
@@ -449,16 +449,19 @@ write_paths(struct solstice* solstice, struct ssol_estimator* estimator)
SSOL(estimator_get_tracked_path(estimator, ipath, &path));
SSOL(path_get_type(&path, &type));
switch(type) {
- case SSOL_PATH_MISSING: fprintf(solstice->output, "1.0\n"); break;
+ case SSOL_PATH_ERROR: fprintf(solstice->output, "0.0\n"); break;
case SSOL_PATH_SUCCESS: fprintf(solstice->output, "0.5\n"); break;
- case SSOL_PATH_SHADOW: fprintf(solstice->output, "0.0\n"); break;
+ case SSOL_PATH_MISSING: fprintf(solstice->output, "0.75\n"); break;
+ case SSOL_PATH_SHADOW: fprintf(solstice->output, "1.0\n"); break;
default: FATAL("Unreachable code.\n"); break;
}
}
- fprintf(solstice->output, "LOOKUP_TABLE path_type 3\n");
- fprintf(solstice->output, "1.0 0.0 0.0 1.0\n");
- fprintf(solstice->output, "0.0 0.0 1.0 1.0\n");
- fprintf(solstice->output, "1.0 1.0 0.0 1.0\n");
+ fprintf(solstice->output, "LOOKUP_TABLE path_type 5\n");
+ fprintf(solstice->output, "1.0 0.0 0.0 1.0\n"); /* 0.0 = Red: for error paths */
+ fprintf(solstice->output, "0.0 1.0 0.0 1.0\n"); /* 0.25 = Green: unused */
+ fprintf(solstice->output, "0.0 0.0 1.0 1.0\n"); /* 0.5 = Blue: for success paths */
+ fprintf(solstice->output, "0.0 1.0 1.0 1.0\n"); /* 0.75 = Turquoise: for missing paths */
+ fprintf(solstice->output, "1.0 1.0 0.0 1.0\n"); /* 1.0 = Yellow: for occluded paths */
}
/*******************************************************************************