solstice

Compute collected power and efficiencies of a solar plant
git clone git://git.meso-star.com/solstice.git
Log | Files | Refs | README | LICENSE

commit 4d22d0205ee36b2fa2ef92649782aeae98721ee8
parent 953c4771606084bd4c5986eba825d2697fa4e39d
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 20 Apr 2018 15:06:23 +0200

Merge branch 'release_0.8'

Diffstat:
MREADME.md | 18+++++++++++++++++-
Mcmake/CMakeLists.txt | 6+++---
Mcmake/doc/CMakeLists.txt | 2+-
Mcmake/parser/CMakeLists.txt | 2+-
Mcmake/receivers/CMakeLists.txt | 2+-
Mdoc/solstice-input.5.txt | 10+++++-----
Mdoc/solstice-output.5.txt | 73++++++++++++++++++++++++++++++++++++++++++-------------------------------
Mdoc/solstice-receiver.5.txt | 26+++++++++++++++++---------
Msrc/main.c | 2+-
Msrc/parser/solparser.c | 2+-
Msrc/parser/solparser.h | 2+-
Msrc/parser/solparser_atmosphere.c | 2+-
Msrc/parser/solparser_atmosphere.h | 2+-
Msrc/parser/solparser_c.h | 2+-
Msrc/parser/solparser_entity.c | 2+-
Msrc/parser/solparser_entity.h | 2+-
Msrc/parser/solparser_geometry.c | 2+-
Msrc/parser/solparser_geometry.h | 2+-
Msrc/parser/solparser_image.c | 2+-
Msrc/parser/solparser_image.h | 2+-
Msrc/parser/solparser_material.c | 2+-
Msrc/parser/solparser_material.h | 2+-
Msrc/parser/solparser_medium.c | 2+-
Msrc/parser/solparser_medium.h | 2+-
Msrc/parser/solparser_mtl_data.c | 2+-
Msrc/parser/solparser_mtl_data.h | 2+-
Msrc/parser/solparser_pivot.c | 2+-
Msrc/parser/solparser_pivot.h | 2+-
Msrc/parser/solparser_shape.h | 2+-
Msrc/parser/solparser_spectrum.c | 2+-
Msrc/parser/solparser_spectrum.h | 2+-
Msrc/parser/solparser_sun.c | 2+-
Msrc/parser/solparser_sun.h | 2+-
Msrc/parser/test_solparser.c | 2+-
Msrc/parser/test_solparser2.c | 2+-
Msrc/parser/test_solparser3.c | 2+-
Msrc/parser/test_solparser4.c | 2+-
Msrc/parser/test_solparser5.c | 2+-
Msrc/parser/test_solparser6.c | 2+-
Msrc/parser/test_solparser7.c | 2+-
Msrc/parser/test_solparser8.c | 2+-
Msrc/parser/test_solparser_mirror.c | 2+-
Msrc/parser/test_solparser_normal_map.c | 2+-
Msrc/parser/test_solparser_spectrum.c | 2+-
Msrc/receivers/srcvl.c | 42+++++++++++++++++++++++++-----------------
Msrc/receivers/srcvl.h | 17++++++++++++-----
Msrc/receivers/test_srcvl.c | 2+-
Msrc/receivers/test_srcvl2.c | 34+++++++++++++++++++++++-----------
Msrc/receivers/yaml/test_ko.yaml | 5++++-
Msrc/receivers/yaml/test_ok.yaml | 2+-
Msrc/solstice.c | 6+++---
Msrc/solstice.h | 10+++++-----
Msrc/solstice_args.c | 2+-
Msrc/solstice_atmosphere.c | 2+-
Msrc/solstice_c.h | 2+-
Msrc/solstice_draw.c | 2+-
Msrc/solstice_dump.c | 2+-
Msrc/solstice_entity.c | 27+++++++++++++++++++++------
Msrc/solstice_material.c | 2+-
Msrc/solstice_node.c | 2+-
Msrc/solstice_object.c | 2+-
Msrc/solstice_solve.c | 80++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------
Msrc/solstice_spectrum.c | 2+-
Msrc/solstice_sun.c | 2+-
Msrc/solstice_sun_spectrum.c | 2+-
Msrc/solstice_sun_spectrum.h | 2+-
Msrc/test_solstice_args.c | 2+-
Msrc/test_solstice_simulation.c | 2+-
Msrc/test_solstice_utils.h | 2+-
69 files changed, 294 insertions(+), 172 deletions(-)

diff --git a/README.md b/README.md @@ -60,6 +60,22 @@ informations on CMake. ## Release notes +### Version 0.8 + +Add the support of per-triangle absorbed flux density. The `per_primitive` +attribute of the receiver file format controls which flux densities to output +for each triangle of a receiver. Its value can be: + +- `NONE`: no per-triangle flux density is computed, i.e. no receiver map is + output for the receiver. It was the comportment of the previous version of + Solstice when the `per_primitive` flag was undefined or was set to 0. +- `INCOMING`: output the estimate of the per-triangle incoming flux density. + It was the comportment of the previous version of Solstice when the + `per_primitive` flag was set to 1. +- `ABSORBED`: output the estimate of the per-triangle absorbed flux density. +- `INCOMING_AND_ABSORBED`: output both the estimates of incoming and absorbed + flux density for each triangle of the receiver. + ### Version 0.7.1 - Replace the `roughness` parameter of the mirror material by the @@ -167,7 +183,7 @@ informations on CMake. Solstice is developed by [|Meso|Star>](http://www.meso-star.com) for the [National Center for Scientific Research](http://www.cnrs.fr/index.php) (CNRS). -This is a free software copyright (C) CNRS 2016-2018 released under the GPL v3+ +This is a free software copyright (C) 2016-2018 CNRS released under the GPL v3+ license: GNU GPL version 3 or later. You are welcome to redistribute it under certain conditions; refer to the COPYING file for details. diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) CNRS 2016-2018 +# Copyright (C) 2016-2018 CNRS # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -96,8 +96,8 @@ configure_file(${SOLSTICE_SOURCE_DIR}/../doc/solstice.1.txt.in ${CMAKE_CURRENT_BINARY_DIR}/doc/solstice.1.txt @ONLY) set(VERSION_MAJOR 0) -set(VERSION_MINOR 7) -set(VERSION_PATCH 1) +set(VERSION_MINOR 8) +set(VERSION_PATCH 0) set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) configure_file(${SOLSTICE_SOURCE_DIR}/solstice_version.h.in diff --git a/cmake/doc/CMakeLists.txt b/cmake/doc/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) CNRS 2016-2018 +# Copyright (C) 2016-2018 CNRS # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/cmake/parser/CMakeLists.txt b/cmake/parser/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) CNRS 2016-2018 +# Copyright (C) 2016-2018 CNRS # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/cmake/receivers/CMakeLists.txt b/cmake/receivers/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) CNRS 2016-2018 +# Copyright (C) 2016-2018 CNRS # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/doc/solstice-input.5.txt b/doc/solstice-input.5.txt @@ -1,4 +1,4 @@ -// Copyright (C) CNRS 2016-2018 +// Copyright (C) 2016-2018 CNRS // // This is free documentation: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -657,10 +657,10 @@ The available triangular meshes are: sphere. *stl*:: - Path toward an external mesh file defined with respect to the **ST**ereo - **L**ithography file format. The front side of the loaded triangles is - defined with respect to their vertex ordering into the STL file: a triangle - is front facing when their vertices are clock wise ordered. + Path toward an external mesh file defined with respect to the ASCII + **ST**ereo **L**ithography file format. The front side of the loaded + triangles is defined with respect to their vertex ordering into the STL + file: a triangle is front facing when their vertices are clock wise ordered. ENTITY ------ diff --git a/doc/solstice-output.5.txt b/doc/solstice-output.5.txt @@ -1,4 +1,4 @@ -// Copyright (C) CNRS 2016-2018 +// Copyright (C) 2016-2018 CNRS // // This is free documentation: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -176,7 +176,6 @@ _______ <abs-mat-loss> ::= <estimate> <abs-atm-loss> ::= <estimate> <cos-factor> ::= <estimate> -<incoming-flux> ::= <estimate> <missing-loss> ::= <estimate> <materials-loss> ::= <estimate> <atmospheric-loss> ::= <estimate> @@ -336,26 +335,28 @@ Receiver map ~~~~~~~~~~~~ A receiver defined in the submitted *solstice-receiver*(5) file, can have a -per-primitive incoming-flux estimate if its *per_primitive* flag is active. In -this case, *solstice*(1) generates a *receiver-map* that is actually an ASCII -VTK file [2] that stores the triangular mesh of the receiver and, for each -triangle, the estimate of its associated incoming-flux. The "definition" of the -receiver map is thus controlled by the discretisation of the receiver's shape, -as described in the *solstice-input*(5) file. Note that to obtain a good -estimate of the per-triangle incoming-flux, one have to ensure that the number -of per-triangle experiments is sufficient regarding the targeted accuracy. -Since only a small fraction of the overall sampled radiative paths reach a -given triangle, the total number of experiments required through the *-n* -option of *solstice*(1) should be increased significantly, as 1 or 2 order of -magnitude. - -If only the front or the back side of the receiver is active, then only one set -of per triangle incoming-flux estimate is written. If the *side* attribute of -the receiver is set to *FRONT_AND_BACK*, the incoming-flux estimates for the -front facing triangles are written before the estimates of the back facing -ones. The following grammar gives a brief description of the formatting of a -*VTK-RECEIVER-MAP*. Please refer to the VTK format specification [2] for more -informations on the VTK file format. +per-primitive estimate of its incoming flux density and/or absorbed flux +density if its *per_primitive* flag is active. In this case, *solstice*(1) +generates a *receiver-map* that is actually an ASCII VTK file [2] that stores +the triangular mesh of the receiver and, for each triangle, the estimate of +its associated incoming flux density and/or absorbed flux density. The +"definition" of the receiver map is thus controlled by the discretisation of +the receiver's shape, as described in the *solstice-input*(5) file. Note that +to obtain a good estimate of the per-triangle flux densities, one have to +ensure that the number of per-triangle experiments is sufficient regarding the +targeted accuracy. Since only a small fraction of the overall sampled +radiative paths reach a given triangle, the total number of experiments +required through the *-n* option of *solstice*(1) should be increased +significantly, as 1 or 2 order of magnitude. + +The number of written per-triangle flux density estimates depends on the +receiver's parameters: both front and back sides of the receiver can be active +and each side can produce an estimate both for the incoming flux density and +for the absorbed flux density. As a consequence, the output can include up to +4 different estimates that are written in the order: incoming front, absorbed +front, incoming back, absorbed back. The following grammar gives a brief +description of the formatting of a *VTK-RECEIVER-MAP*. Please refer to the VTK +format specification [2] for more informations on the VTK file format. [verse] _______ @@ -383,12 +384,22 @@ VTK-RECEIVER-MAP ::= # vtk DataFile Version 2.0 <map-front-data> ::= <map-side-data> <map-back-data> ::= <map-side-data> -<map-side-data> ::= SCALARS <side-name> float 2 +<map-side-data> ::= <incoming-flux> + | <absorbed-flux> + | <incoming-flux> <absorbed-flux> + +<incoming-flux> ::= <flux-density-data> +<absorbed-flux> ::= <flux-density-data> + +<flux-density-data> ::= SCALARS <side-and-flux-names> float 2 LOOKUP_TABLE default - <incoming-flux> - [ <incoming-flux> ... ] + <estimate> + [ <estimate> ... ] -<map-side-name> ::= Front_faces | Back_faces +<side-and-flux-names> ::= Front_faces_Incoming_flux + | Front_faces_Absorbed_flux + | Back_faces_Incoming_flux + | Back_faces_Absorbed_flux <#triangles> ::= INTEGER <#vertices> ::= INTEGER @@ -452,11 +463,11 @@ 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. +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. [verse] _______ diff --git a/doc/solstice-receiver.5.txt b/doc/solstice-receiver.5.txt @@ -1,4 +1,4 @@ -// Copyright (C) CNRS 2016-2018 +// Copyright (C) 2016-2018 CNRS // // This is free documentation: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -47,10 +47,12 @@ that is tracked is defined by the *side* attribute of the receiver. Note that the front and the back side of a geometry can be both considered if the *side* attribute is set to *FRONT_AND_BACK*. Refer to the *solstice-input*(5) specification for informations on which side of the geometry is front facing or -back facing. Finally, if the optional *per_primitive* flag is set to *1*, +back facing. Finally, if the optional *per_primitive* flag is set, *solstice*(1) will estimate the irradiance for each triangle of the receiver and use these data to generate a receiver map as described in -*solstice-output*(5). +*solstice-output*(5). The *per-primitive* flag can be set to *INCOMING*, +*ABSORBED* or *INCOMING_AND_ABSORBED* to produce the incoming flux density +map, the absorbed flux density map, or both. GRAMMAR ------- @@ -62,12 +64,17 @@ _______ <receiver> ::= name: <entity-identifier> side: <side-identifier> - [ per_primitive: INTEGER ] # in [0, 1] + [ per_primitive: <per-primitive-mode> ] # Default: NONE <side-identifier> ::= FRONT | BACK | FRONT_AND_BACK +<per-primitive-mode> ::= NONE + | INCOMING + | ABSORBED + | INCOMING_AND_ABSORBED + <entity-identifier> # Defined in *solstice-input*(5) _______ @@ -75,12 +82,13 @@ EXAMPLES -------- Define that the front and back side of the entity *small_square* are -receivers. For each side, enable the computation of per triangle irradiance. +receivers. For each side, enable the computation of per triangle absorbed +irradiance. ....... - name: small_square side: FRONT_AND_BACK - per_primitive: 1 + per_primitive: ABSORBED ....... Declare that the front side of 3 reflectors are receivers. Use the YAML @@ -93,11 +101,11 @@ compact notation to reduce the number of lines: ...... Declare that the back side of *receiver* is effectively a receiver and enable -the estimation of its associated irradiance map. Make a receiver from the front -side of the reflector named *LFR0.pivot.reflector*: +the estimation of its associated incoming irradiance map. Make a receiver from +the front side of the reflector named *LFR0.pivot.reflector*: ....... -- {name: receiver, side: BACK, per_primitive: 1} +- {name: receiver, side: BACK, per_primitive: INCOMING} - {name: LFR0.pivot.reflector, side: FRONT} ....... diff --git a/src/main.c b/src/main.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser.c b/src/parser/solparser.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser.h b/src/parser/solparser.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_atmosphere.c b/src/parser/solparser_atmosphere.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_atmosphere.h b/src/parser/solparser_atmosphere.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_c.h b/src/parser/solparser_c.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_entity.c b/src/parser/solparser_entity.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_entity.h b/src/parser/solparser_entity.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_geometry.c b/src/parser/solparser_geometry.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_geometry.h b/src/parser/solparser_geometry.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_image.c b/src/parser/solparser_image.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_image.h b/src/parser/solparser_image.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_material.c b/src/parser/solparser_material.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_material.h b/src/parser/solparser_material.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_medium.c b/src/parser/solparser_medium.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_medium.h b/src/parser/solparser_medium.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_mtl_data.c b/src/parser/solparser_mtl_data.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_mtl_data.h b/src/parser/solparser_mtl_data.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_pivot.c b/src/parser/solparser_pivot.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_pivot.h b/src/parser/solparser_pivot.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_shape.h b/src/parser/solparser_shape.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_spectrum.c b/src/parser/solparser_spectrum.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_spectrum.h b/src/parser/solparser_spectrum.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_sun.c b/src/parser/solparser_sun.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/solparser_sun.h b/src/parser/solparser_sun.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/test_solparser.c b/src/parser/test_solparser.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/test_solparser2.c b/src/parser/test_solparser2.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/test_solparser3.c b/src/parser/test_solparser3.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/test_solparser4.c b/src/parser/test_solparser4.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/test_solparser5.c b/src/parser/test_solparser5.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/test_solparser6.c b/src/parser/test_solparser6.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/test_solparser7.c b/src/parser/test_solparser7.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/test_solparser8.c b/src/parser/test_solparser8.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/test_solparser_mirror.c b/src/parser/test_solparser_mirror.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/test_solparser_normal_map.c b/src/parser/test_solparser_normal_map.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/parser/test_solparser_spectrum.c b/src/parser/test_solparser_spectrum.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/receivers/srcvl.c b/src/receivers/srcvl.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ struct receiver { struct str name; enum srcvl_side side; - int per_primitive; + enum srcvl_pp_output per_primitive_output; }; static INLINE void @@ -37,7 +37,7 @@ receiver_init(struct mem_allocator* allocator, struct receiver* receiver) ASSERT(receiver); str_init(allocator, &receiver->name); receiver->side = SRCVL_FRONT_AND_BACK; - receiver->per_primitive = 0; + receiver->per_primitive_output = SRCVL_PP_NONE; } static INLINE void @@ -52,7 +52,7 @@ receiver_copy(struct receiver* dst, const struct receiver* src) { ASSERT(dst && src); dst->side = src->side; - dst->per_primitive = src->per_primitive; + dst->per_primitive_output = src->per_primitive_output; return str_copy(&dst->name, &src->name); } @@ -61,7 +61,7 @@ receiver_copy_and_release(struct receiver* dst, struct receiver* src) { ASSERT(dst && src); dst->side = src->side; - dst->per_primitive = src->per_primitive; + dst->per_primitive_output = src->per_primitive_output; return str_copy_and_release(&dst->name, &src->name); } @@ -168,26 +168,34 @@ error: } static res_T -parse_integer(struct srcvl* srcvl, yaml_node_t* integer, int* dst) +parse_pp_output + (struct srcvl* srcvl, + yaml_node_t* side, + enum srcvl_pp_output* out_side) { res_T res = RES_OK; - ASSERT(integer && dst); + ASSERT(side && out_side); - if(integer->type != YAML_SCALAR_NODE - || !strlen((char*)integer->data.scalar.value)) { - log_err(srcvl, integer, "expect an integer.\n"); + if(side->type != YAML_SCALAR_NODE) { + log_err(srcvl, side, "expect a character string.\n"); res = RES_BAD_ARG; goto error; } - res = cstr_to_int((char*)integer->data.scalar.value, dst); - if(res != RES_OK) { - log_err(srcvl, integer, "invalid integer `%s'.\n", - integer->data.scalar.value); + if(!strcmp((char*) side->data.scalar.value, "NONE")) { + *out_side = SRCVL_PP_NONE; + } else if(!strcmp((char*) side->data.scalar.value, "INCOMING")) { + *out_side = SRCVL_PP_INCOMING; + } else if(!strcmp((char*) side->data.scalar.value, "ABSORBED")) { + *out_side = SRCVL_PP_ABSORBED; + } else if(!strcmp((char*) side->data.scalar.value, "INCOMING_AND_ABSORBED")) { + *out_side = SRCVL_PP_INCOMING_AND_ABSORBED; + } else { + log_err(srcvl, side, "unknown per primitive output type value `%s'.\n", + side->data.scalar.value); res = RES_BAD_ARG; goto error; } - exit: return res; error: @@ -251,7 +259,7 @@ parse_receiver res = parse_side(srcvl, val, &solreceiver->side); } else if(!strcmp((char*)key->data.scalar.value, "per_primitive")) { SETUP_MASK(PER_PRIMITIVE, "per_primitive"); - res = parse_integer(srcvl, val, &solreceiver->per_primitive); + res = parse_pp_output(srcvl, val, &solreceiver->per_primitive_output); } else { log_err(srcvl, key, "unknown receiver parameter `%s'.\n", key->data.scalar.value); @@ -461,6 +469,6 @@ srcvl_get r = darray_receiver_cdata_get(&srcvl->receivers) + i; receiver->name = str_cget(&r->name); receiver->side = r->side; - receiver->per_primitive = r->per_primitive; + receiver->per_primitive_output = r->per_primitive_output; } diff --git a/src/receivers/srcvl.h b/src/receivers/srcvl.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,15 +19,22 @@ #include <rsys/rsys.h> enum srcvl_side { - SRCVL_FRONT, - SRCVL_BACK, - SRCVL_FRONT_AND_BACK + SRCVL_FRONT = BIT(0), + SRCVL_BACK = BIT(1), + SRCVL_FRONT_AND_BACK = SRCVL_FRONT + SRCVL_BACK +}; + +enum srcvl_pp_output { + SRCVL_PP_NONE = 0, + SRCVL_PP_INCOMING = BIT(0), + SRCVL_PP_ABSORBED = BIT(1), + SRCVL_PP_INCOMING_AND_ABSORBED = SRCVL_PP_INCOMING + SRCVL_PP_ABSORBED }; struct srcvl_receiver { const char* name; enum srcvl_side side; - int per_primitive; /* Define if per primitive receiver is enabled */ + enum srcvl_pp_output per_primitive_output; }; struct mem_allocator; diff --git a/src/receivers/test_srcvl.c b/src/receivers/test_srcvl.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/receivers/test_srcvl2.c b/src/receivers/test_srcvl2.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,48 +39,60 @@ main(int argc, char** argv) fprintf(stream, "- { name: entity3, side: BACK }\n"); fprintf(stream, "- name: entity4\n"); fprintf(stream, " side: FRONT_AND_BACK\n"); - fprintf(stream, "- { name: entity5, side: BACK, per_primitive: 1 }\n"); - fprintf(stream, "- { name: entity6, per_primitive: 0, side: FRONT }\n"); + fprintf(stream, "- { name: entity5, side: BACK, per_primitive: INCOMING }\n"); + fprintf(stream, "- { name: entity6, side: BACK, per_primitive: ABSORBED }\n"); + fprintf(stream, "- { name: entity7, side: BACK, per_primitive: INCOMING_AND_ABSORBED }\n"); + fprintf(stream, "- { name: entity8, per_primitive: NONE, side: FRONT }\n"); rewind(stream); CHK(srcvl_setup_stream(srcvl, NULL, stream) == RES_OK); CHK(srcvl_load(srcvl) == RES_OK); - CHK(srcvl_count(srcvl) == 7); + CHK(srcvl_count(srcvl) == 9); srcvl_get(srcvl, 0, &receiver); CHK(strcmp(receiver.name, "entity0") == 0); CHK(receiver.side == SRCVL_FRONT_AND_BACK); - CHK(receiver.per_primitive == 0); + CHK(receiver.per_primitive_output == SRCVL_PP_NONE); srcvl_get(srcvl, 1, &receiver); CHK(strcmp(receiver.name, "entity1") == 0); CHK(receiver.side == SRCVL_FRONT_AND_BACK); - CHK(receiver.per_primitive == 0); + CHK(receiver.per_primitive_output == SRCVL_PP_NONE); srcvl_get(srcvl, 2, &receiver); CHK(strcmp(receiver.name, "entity2") == 0); CHK(receiver.side == SRCVL_FRONT); - CHK(receiver.per_primitive == 0); + CHK(receiver.per_primitive_output == SRCVL_PP_NONE); srcvl_get(srcvl, 3, &receiver); CHK(strcmp(receiver.name, "entity3") == 0); CHK(receiver.side == SRCVL_BACK); - CHK(receiver.per_primitive == 0); + CHK(receiver.per_primitive_output == SRCVL_PP_NONE); srcvl_get(srcvl, 4, &receiver); CHK(strcmp(receiver.name, "entity4") == 0); CHK(receiver.side == SRCVL_FRONT_AND_BACK); - CHK(receiver.per_primitive == 0); + CHK(receiver.per_primitive_output == SRCVL_PP_NONE); srcvl_get(srcvl, 5, &receiver); CHK(strcmp(receiver.name, "entity5") == 0); CHK(receiver.side == SRCVL_BACK); - CHK(receiver.per_primitive == 1); + CHK(receiver.per_primitive_output == SRCVL_PP_INCOMING); srcvl_get(srcvl, 6, &receiver); CHK(strcmp(receiver.name, "entity6") == 0); + CHK(receiver.side == SRCVL_BACK); + CHK(receiver.per_primitive_output == SRCVL_PP_ABSORBED); + + srcvl_get(srcvl, 7, &receiver); + CHK(strcmp(receiver.name, "entity7") == 0); + CHK(receiver.side == SRCVL_BACK); + CHK(receiver.per_primitive_output == SRCVL_PP_INCOMING_AND_ABSORBED); + + srcvl_get(srcvl, 8, &receiver); + CHK(strcmp(receiver.name, "entity8") == 0); CHK(receiver.side == SRCVL_FRONT); - CHK(receiver.per_primitive == 0); + CHK(receiver.per_primitive_output == SRCVL_PP_NONE); CHK(srcvl_load(srcvl) == RES_BAD_OP); diff --git a/src/receivers/yaml/test_ko.yaml b/src/receivers/yaml/test_ko.yaml @@ -25,4 +25,7 @@ - name: test per_primitive: --- -- per_primitive: 1 +- name: test + per_primitive: NOPE +--- +- per_primitive: NONE diff --git a/src/receivers/yaml/test_ok.yaml b/src/receivers/yaml/test_ok.yaml @@ -13,6 +13,6 @@ {name: test}, {side: FRONT_AND_BACK, name: "Hello world"}, {name: Hello world, side: BACK} - {name: hop, per_primitive: 1} + {name: hop, per_primitive: ABSORBED} {per_primitive: 0, name: test} ] diff --git a/src/solstice.c b/src/solstice.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -357,7 +357,7 @@ setup_sun_dirs(struct solstice* solstice, const struct solstice_args* args) goto error; } res = darray_double_resize(&solstice->sun_angles, args->nsun_dirs*2/*#dims*/); - if (res != RES_OK) { + if(res != RES_OK) { fprintf(stderr, "Could not reserve the list of %lu sun angles.\n", (unsigned long)args->nsun_dirs); @@ -476,7 +476,7 @@ setup_receivers(struct solstice* solstice, struct srcvl* srcvl) receiver->node = NULL; receiver->side = rcv.side; - receiver->per_primitive = rcv.per_primitive; + receiver->per_primitive_output = rcv.per_primitive_output; name = str_cget(&receiver->name); res = htable_receiver_set(&solstice->receivers, &name, &i); diff --git a/src/solstice.h b/src/solstice.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ struct solstice_receiver { struct str name; struct solstice_node* node; enum srcvl_side side; - int per_primitive; + enum srcvl_pp_output per_primitive_output; }; static INLINE void @@ -48,7 +48,7 @@ solstice_receiver_init str_init(allocator, &rcv->name); rcv->node = NULL; rcv->side = SRCVL_FRONT_AND_BACK; - rcv->per_primitive = 0; + rcv->per_primitive_output = SRCVL_PP_NONE; } static INLINE void @@ -66,7 +66,7 @@ solstice_receiver_copy ASSERT(dst && src); dst->node = src->node; dst->side = src->side; - dst->per_primitive = src->per_primitive; + dst->per_primitive_output = src->per_primitive_output; return str_copy(&dst->name, &src->name); } @@ -79,7 +79,7 @@ solstice_receiver_copy_and_release ASSERT(dst && src); dst->node = src->node; dst->side = src->side; - dst->per_primitive = src->per_primitive; + dst->per_primitive_output = src->per_primitive_output; res = str_copy_and_release(&dst->name, &src->name); if(res != RES_OK) return res; solstice_receiver_release(src); diff --git a/src/solstice_args.c b/src/solstice_args.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/solstice_atmosphere.c b/src/solstice_atmosphere.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/solstice_c.h b/src/solstice_c.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/solstice_draw.c b/src/solstice_draw.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/solstice_dump.c b/src/solstice_dump.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/solstice_entity.c b/src/solstice_entity.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -83,6 +83,20 @@ srcvl_side_to_ssol_mask(const enum srcvl_side side) return mask; } +static INLINE int +srcvl_per_prim_to_bool(const enum srcvl_pp_output output) +{ + int mask = 0; + switch (output) { + case SRCVL_PP_NONE: mask = 0; break; + case SRCVL_PP_INCOMING: mask = 1; break; + case SRCVL_PP_ABSORBED: mask = 1; break; + case SRCVL_PP_INCOMING_AND_ABSORBED: mask = 1; break; + default: FATAL("Unreachable code.\n"); break; + } + return mask; +} + static struct solstice_node* create_empty_node (struct solstice* solstice, const struct solparser_entity* entity) @@ -338,11 +352,11 @@ create_node str_cget(&entity->name)); goto error; } - if (entity->primary) { + if(entity->primary) { struct solstice_primary p; p.node = node; res = htable_primary_set(&solstice->primaries, name, &p); - if (res != RES_OK) { + if(res != RES_OK) { fprintf(stderr, "Could not define the entity `%s' as primary.\n", str_cget(&entity->name)); goto error; @@ -354,13 +368,14 @@ create_node str = str_cget(name); pircv = htable_receiver_find(&solstice->receivers, &str); if(pircv) { - int mask; + int side_mask, output; rcv = darray_receiver_data_get(&solstice->rcvs_list) + *pircv; ASSERT(rcv->node == NULL); /* Receiver is not attached to a node */ - mask = srcvl_side_to_ssol_mask(rcv->side); + side_mask = srcvl_side_to_ssol_mask(rcv->side); + output = srcvl_per_prim_to_bool(rcv->per_primitive_output); - res = solstice_node_geometry_set_receiver(node, mask, rcv->per_primitive); + res = solstice_node_geometry_set_receiver(node, side_mask, output); if(res != RES_OK) { fprintf(stderr, "Could not define the entity `%s' as a receiver.\n", str_cget(&entity->name)); diff --git a/src/solstice_material.c b/src/solstice_material.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/solstice_node.c b/src/solstice_node.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/solstice_object.c b/src/solstice_object.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/solstice_solve.c b/src/solstice_solve.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -136,7 +136,7 @@ write_mc_global(struct solstice* solstice, struct ssol_estimator* estimator) /* Primary-instances' data */ htable_primary_begin(&solstice->primaries, &p_it); htable_primary_end(&solstice->primaries, &p_end); - while (!htable_primary_iterator_eq(&p_it, &p_end)) { + while(!htable_primary_iterator_eq(&p_it, &p_end)) { const struct str* name = htable_primary_iterator_key_get(&p_it); struct solstice_primary* prim = htable_primary_iterator_data_get(&p_it); struct ssol_mc_sampled sampled; @@ -165,7 +165,7 @@ write_mc_global(struct solstice* solstice, struct ssol_estimator* estimator) SSOL(instance_get_id(rcv_inst, &rcv_id)); htable_primary_begin(&solstice->primaries, &p_it); htable_primary_end(&solstice->primaries, &p_end); - while (!htable_primary_iterator_eq(&p_it, &p_end)) { + while(!htable_primary_iterator_eq(&p_it, &p_end)) { struct solstice_primary* prim = htable_primary_iterator_data_get(&p_it); struct ssol_instance* prim_inst = prim->node->instance; struct ssol_mc_receiver front = MC_RCV_NONE__; @@ -259,7 +259,7 @@ dump_shape_triangle_indices } static void -dump_mc_shape +dump_mc_shape_in (struct solstice* solstice, struct ssol_shape* shape, struct ssol_mc_shape* mc_shape) @@ -278,15 +278,36 @@ dump_mc_shape } static void +dump_mc_shape_abs + (struct solstice* solstice, + struct ssol_shape* shape, + struct ssol_mc_shape* mc_shape) +{ + unsigned itri, ntris; + ASSERT(solstice && shape && mc_shape); + + SSOL(shape_get_triangles_count(shape, &ntris)); + FOR_EACH(itri, 0, ntris) { + struct ssol_mc_primitive mc_prim; + SSOL(mc_shape_get_mc_primitive(mc_shape, itri, &mc_prim)); + fprintf(solstice->output, "%g %g\n", + mc_prim.absorbed_flux.E, + mc_prim.absorbed_flux.SE); + } +} + +static void dump_per_primitive_mc_estimations (struct solstice* solstice, struct ssol_estimator* estimator, struct ssol_instance* inst, - const enum ssol_side_flag side) + const enum ssol_side_flag side, + const enum srcvl_pp_output output) { size_t ishape, nshapes; struct ssol_mc_receiver mc_rcv; const char* name; + const char* flux; ASSERT(solstice && estimator && inst); SSOL(estimator_get_mc_receiver(estimator, inst, side, &mc_rcv)); @@ -296,8 +317,13 @@ dump_per_primitive_mc_estimations case SSOL_BACK: name = "Back_faces"; break; default: FATAL("Unreachable code.\n"); break; } + switch (output) { + case SRCVL_PP_INCOMING: flux = "Incoming_flux"; break; + case SRCVL_PP_ABSORBED: flux = "Absorbed_flux"; break; + default: FATAL("Unreachable code.\n"); break; + } - fprintf(solstice->output, "SCALARS %s float 2\n", name); + fprintf(solstice->output, "SCALARS %s_%s float 2\n", name, flux); fprintf(solstice->output, "LOOKUP_TABLE default\n"); SSOL(instance_get_shaded_shapes_count(inst, &nshapes)); @@ -306,7 +332,15 @@ dump_per_primitive_mc_estimations struct ssol_mc_shape mc_shape; SSOL(instance_get_shaded_shape(inst, ishape, &inst_sshape)); SSOL(mc_receiver_get_mc_shape(&mc_rcv, inst_sshape.shape, &mc_shape)); - dump_mc_shape(solstice, inst_sshape.shape, &mc_shape); + switch (output) { + case SRCVL_PP_INCOMING: + dump_mc_shape_in(solstice, inst_sshape.shape, &mc_shape); + break; + case SRCVL_PP_ABSORBED: + dump_mc_shape_abs(solstice, inst_sshape.shape, &mc_shape); + break; + default: FATAL("Unreachable code.\n"); break; + } } } @@ -327,6 +361,7 @@ write_per_receiver_mc_primitive size_t offset; int mask, prim; + ASSERT(rcv->side); SSOL(instance_is_receiver(inst, &mask, &prim)); CHK(mask != 0); if(!prim) continue; @@ -371,18 +406,25 @@ write_per_receiver_mc_primitive /* Write front faces MC estimations */ fprintf(solstice->output, "CELL_DATA %lu\n", (unsigned long)ntris); - switch(rcv->side) { - case SRCVL_FRONT: - dump_per_primitive_mc_estimations(solstice, estimator, inst, SSOL_FRONT); - break; - case SRCVL_BACK: - dump_per_primitive_mc_estimations(solstice, estimator, inst, SSOL_BACK); - break; - case SRCVL_FRONT_AND_BACK: - dump_per_primitive_mc_estimations(solstice, estimator, inst, SSOL_FRONT); - dump_per_primitive_mc_estimations(solstice, estimator, inst, SSOL_BACK); - break; - default: FATAL("Unreachable code.\n"); break; + if(rcv->side & SRCVL_FRONT) { + if(rcv->per_primitive_output & SRCVL_PP_INCOMING) { + dump_per_primitive_mc_estimations(solstice, estimator, inst, + SSOL_FRONT, SRCVL_PP_INCOMING); + } + if(rcv->per_primitive_output & SRCVL_PP_ABSORBED) { + dump_per_primitive_mc_estimations(solstice, estimator, inst, + SSOL_FRONT, SRCVL_PP_ABSORBED); + } + } + if(rcv->side & SRCVL_BACK) { + if(rcv->per_primitive_output & SRCVL_PP_INCOMING) { + dump_per_primitive_mc_estimations(solstice, estimator, inst, + SSOL_BACK, SRCVL_PP_INCOMING); + } + if(rcv->per_primitive_output & SRCVL_PP_ABSORBED) { + dump_per_primitive_mc_estimations(solstice, estimator, inst, + SSOL_BACK, SRCVL_PP_ABSORBED); + } } } } diff --git a/src/solstice_spectrum.c b/src/solstice_spectrum.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/solstice_sun.c b/src/solstice_sun.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/solstice_sun_spectrum.c b/src/solstice_sun_spectrum.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/solstice_sun_spectrum.h b/src/solstice_sun_spectrum.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_solstice_args.c b/src/test_solstice_args.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_solstice_simulation.c b/src/test_solstice_simulation.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/test_solstice_utils.h b/src/test_solstice_utils.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2018 +/* Copyright (C) 2016-2018 CNRS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by