commit 953c4771606084bd4c5986eba825d2697fa4e39d parent 2a3cf7df5054758cd8e396f12bbb4f8fa8f06b90 Author: Vincent Forest <vincent.forest@meso-star.com> Date: Wed, 7 Feb 2018 21:05:18 +0100 Merge branch 'release_0.7.1' Diffstat:
80 files changed, 413 insertions(+), 256 deletions(-)
diff --git a/README.md b/README.md @@ -36,7 +36,7 @@ functionalities. ## How to build This program relies on the [CMake](http://www.cmake.org) and the -[RCMake](https://gitlab.com/vaplv/rcmake/) package to build. +[RCMake](https://gitlab.com/vaplv/rcmake/) packages to build. It also depends on the [LibYAML](http://pyyaml.org/wiki/LibYAML), [RSys](https://gitlab.com/vaplv/rsys/), @@ -45,10 +45,10 @@ It also depends on the [Star-3DUT](https://gitlab.com/meso-star/star-3dut/), [Star-SP](https://gitlab.com/meso-star/star-sp/) and [Star-STL](https://gitlab.com/meso-star/star-stm/) libraries. -The documentation is written with the +The documentation is written in [AsciiDoc](http://www.methods.co.nz/asciidoc/) text format and relies on its tool suite to generate HTML and/or ROFF man pages. If the AsciiDoc tools cannot -be found, the documentation will be not built. +be found, the documentation will not be built. First ensure that CMake is installed on your system. Then install the RCMake package as well as the aforementioned prerequisites. Finally generate the @@ -60,12 +60,20 @@ informations on CMake. ## Release notes +### Version 0.7.1 + +- Replace the `roughness` parameter of the mirror material by the + `slope_error` parameter. +- Improve the documentation of the sun direction. +- Ensure that the per-receiver results are sorted according to the order of the + receivers as listed in the submitted receiver file. + ### Version 0.7 - Add the `gaussian` sun shape. - Add the `microfacet` attribute to the mirror material. It controls the normal distribution of the microfacets when the mirror roughness is not null. The - supported distribution are `BECKMANN` and `PILLBOX`. + supported distributions are `BECKMANN` and `PILLBOX`. ### Version 0.6.1 @@ -75,7 +83,7 @@ informations on CMake. ### Version 0.6 -- Rename the `absorption` parameter of the medium and the athmosphere in +- Rename the `absorption` parameter of the medium and the atmosphere in `extinction`. - Add several global and per-receiver estimations. The outputs now fully describe the incoming and absorbed fluxes: overall flux, flux without @@ -159,7 +167,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-2017 released under the GPL v3+ +This is a free software copyright (C) CNRS 2016-2018 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-2017 +# Copyright (C) CNRS 2016-2018 # # 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 @@ -97,7 +97,7 @@ configure_file(${SOLSTICE_SOURCE_DIR}/../doc/solstice.1.txt.in set(VERSION_MAJOR 0) set(VERSION_MINOR 7) -set(VERSION_PATCH 0) +set(VERSION_PATCH 1) 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-2017 +# Copyright (C) CNRS 2016-2018 # # 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-2017 +# Copyright (C) CNRS 2016-2018 # # 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-2017 +# Copyright (C) CNRS 2016-2018 # # 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-2017 +// Copyright (C) CNRS 2016-2018 // // This is free documentation: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -186,7 +186,7 @@ _______ <mirror> ::= mirror: reflectivity: <mtl-data> # in [0, 1] - roughness: <mtl-data> + slope_error: <mtl-data> [ microfacet: <normal-distrib> ] # Default is BECKMANN [ <normal-map> ] @@ -426,24 +426,25 @@ Diffuse surface. Reflects the same intensity in all directions independently of the incoming direction. *mirror*:: -Specular or glossy reflection whether the *roughness* parameter is 0 or not, +Specular or glossy reflection whether the *slope_error* parameter is 0 or not, respectively. Glossy reflections are controlled by a microfacet BRDF. The microfacet normals are distributed with respect to the Beckmann or the Pillbox distribution according to the *normal-distrib* attribute. + -Let m the *roughness* parameter in ]0, 1]. The Beckmann distribution is +Let S the *slope_error* parameter in ]0, 1]. The Beckmann distribution is defined as: + ....... D(wh) = exp(-tan^2(a) / m^2) / (PI * m^2 * cos^4(a)) ....... + -with a = arccos(wh.N), while the pillbox distribution is defined as: +with a = arccos(wh.N), and m = sqrt(2)*S while the pillbox distribution is +defined as: + ....... - | 0; if |wh.N| >= m + | 0; if |wh.N| >= S D(wh) = | - | 1 / (PI * (1 - cos^2(m))); if |wh.N| < m + | 1 / (PI * (1 - cos^2(S))); if |wh.N| < S ....... *thin-dielectric*:: @@ -873,7 +874,7 @@ is 1 and its center is positioned at {0,0,2}: - material: mirror: reflectivity: 1 - roughness: 0 + slope_error: 0 plane: clip: - operation: AND @@ -949,7 +950,7 @@ position is defined relatively to the receiver: transform: {rotation: [-90, 0, 0]} primary: 1 geometry: - - material: {mirror: {reflectivity: 1, roughness: 0}} + - material: {mirror: {reflectivity: 1, slope_error: 0}} parabol: focal: 100 clip: @@ -977,7 +978,7 @@ purely specular while the back faces are diffuse: - sun: {dni: 1000} - material: &specular - front: {mirror: {reflectivity: 1, roughness: 0}} + front: {mirror: {reflectivity: 1, slope_error: 0}} back: {matte: {reflectivity: 1}} - template: &H # Template of an heliostat @@ -1085,7 +1086,7 @@ glass. Furthermore, this example illustrates the use of a *spectrum* for - atmosphere: {extinction: *air_kabs} # Materials -- material: &specular {mirror: {reflectivity: 1, roughness: 0}} +- material: &specular {mirror: {reflectivity: 1, slope_error: 0}} - material: &black {matte: {reflectivity: 0}} - material: &glass front: {dielectric: {medium_i: *air_medium, medium_t: *glass_medium}} diff --git a/doc/solstice-output.5.txt b/doc/solstice-output.5.txt @@ -1,4 +1,4 @@ -// Copyright (C) CNRS 2016-2017 +// Copyright (C) CNRS 2016-2018 // // This is free documentation: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -78,7 +78,7 @@ _______ ------------------------------------- -<sun-direction> ::= "#--- Sun direction: <azimuth> <elevation> (<real3>)" +<sun-direction> ::= "#--- Sun direction: <alpha> <beta> (<sun-vector>)" <counts> ::= "<#globals> <#receivers> <#primaries> <#samples> <#failed>" @@ -161,8 +161,9 @@ _______ <real3> ::= REAL REAL REAL -<azimuth> ::= REAL # Degrees in [0, 360[ -<elevation> ::= REAL # Degrees in [0, 90] +<alpha> ::= REAL # Degrees in [0, 360[ +<beta> ::= REAL # Degrees in [0, 90] +<sun-vector> ::= <real3> <incoming-flux> ::= <estimate> <in-if-no-mat-loss> ::= <estimate> @@ -193,8 +194,9 @@ SIMULATION ---------- A *simulation-output* begins with two header lines. The first one reports the -sun direction used in the simulation (azimuth and elevation angles, in -degrees), and the second one lists the numbers of global, per receiver and per +sun direction used in the simulation (two angles in degrees, plus the +corresponding sun vector), +and the second one lists the numbers of global, per receiver and per primary results as well as the overall number of Monte-Carlo experiments used by the simulation and the number of experiments that failed due to unforeseen errors as numerical imprecisions. As soon as the number of failed experiments @@ -232,14 +234,16 @@ This results can be used to check conservation of energy: potential-flux * cos-factor and (absorbed-flux + shadow-loss + missing-loss + materials-loss + atmospheric-loss) -should be equal whithin their respective uncertainty ranges. +should be equal within their respective uncertainty ranges. Per receiver results ~~~~~~~~~~~~~~~~~~~~ Following global results, the output includes various per-receiver lines, one -line per receiver, the exact number of lines being part of the headers. Each -line contains the following data: +line per receiver, the exact number of lines being part of the headers. The +per-receiver results are sorted according to the order of the receivers as +defined in the submitted *solstice-receiver*(5) file. Each line contains the +following data: - *receiver-name*: name of the receiver, i.e. *entity-identifier* of the entity in which the receiving geometry is defined (see the diff --git a/doc/solstice-receiver.5.txt b/doc/solstice-receiver.5.txt @@ -1,4 +1,4 @@ -// Copyright (C) CNRS 2016-2017 +// Copyright (C) CNRS 2016-2018 // // This is free documentation: 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.1.txt.in b/doc/solstice.1.txt.in @@ -66,13 +66,24 @@ is used to render an image of the submitted solar facility. Note that these three options are mutually exclusives, and once defined, they replace the default *solstice* behaviour. +Please note that any coordinate-related question in Solstice must be +considered with the right-handed convention in mind. + OPTIONS ------- -*-D* <__azimuth__,__elevation__[:...]>:: - List of sun directions. A direction is defined by its _azimuthal_ and - _elevation_ angles in degrees, with _azimuth_ in [0, 360[ and _elevation_ in - [0, 90]. Each sun direction triggers a new computation whose results are +*-D* <__alpha__,__beta__[:...]>:: + List of sun directions. A direction is defined by two angles in degrees. The + first one, here refered to as _alpha_, is an azimuthal angle in [0, 360[ and + the second one, here refered to as _beta_, is an elevation in [0, 90]. + Each provided sun direction triggers a new computation whose results are concatenated to the _output_ file. ++ +Following the right-handed convention, Solstice azimuthal rotation is +counter-clockwise, with 0° on the X axis. Solstice elevation starts from 0° for +directions in the XY plane, up to 90° at zenith. Thus -D0,0 -D0,90 -D0,180 and +-D0,270 will produce solar vectors {-1,0,0} {0,-1,0} {+1,0,0} and {0,+1,0} +respectively, while -D__alpha__,90 will produce {0,0,-1} regardless of _alpha_ +value. *-f*:: Force overwrite of the _output_ file. diff --git a/src/main.c b/src/main.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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 @@ -245,7 +245,7 @@ parse_material_mirror const yaml_node_t* mirror, struct solparser_material_mirror_id* out_imtl) { - enum { MICROFACET, NORMAL_MAP, REFLECTIVITY, ROUGHNESS }; + enum { MICROFACET, NORMAL_MAP, REFLECTIVITY, SLOPE_ERROR }; struct solparser_material_mirror* mtl = NULL; size_t imtl = SIZE_MAX; int mask = 0; /* Register the parsed attributes */ @@ -300,9 +300,9 @@ parse_material_mirror } else if(!strcmp((char*)key->data.scalar.value, "reflectivity")) { SETUP_MASK(REFLECTIVITY, "reflectivity"); res = parse_mtl_data(parser, doc, val, 0, 1, &mtl->reflectivity); - } else if(!strcmp((char*)key->data.scalar.value, "roughness")) { - SETUP_MASK(ROUGHNESS, "roughness"); - res = parse_mtl_data(parser, doc, val, 0, 1, &mtl->roughness); + } else if(!strcmp((char*)key->data.scalar.value, "slope_error")) { + SETUP_MASK(SLOPE_ERROR, "slope_error"); + res = parse_mtl_data(parser, doc, val, 0, 1, &mtl->slope_error); } else { log_err(parser, key, "unknown mirror attribute `%s'.\n", key->data.scalar.value); @@ -323,7 +323,7 @@ parse_material_mirror goto error; \ } (void)0 CHECK_PARAM(REFLECTIVITY, "reflectivity"); - CHECK_PARAM(ROUGHNESS, "roughness"); + CHECK_PARAM(SLOPE_ERROR, "slope_error"); #undef CHECK_PARAM exit: diff --git a/src/parser/solparser_material.h b/src/parser/solparser_material.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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 @@ -68,7 +68,7 @@ solparser_material_matte_init } struct solparser_material_mirror { - struct solparser_mtl_data roughness; /* In [0, 1] */ + struct solparser_mtl_data slope_error; /* In [0, 1] */ struct solparser_mtl_data reflectivity; /* In [0, 1] */ enum solparser_microfacet_distribution ufacet_distrib; struct solparser_image_id normal_map; @@ -83,8 +83,8 @@ solparser_material_mirror_init { ASSERT(mirror); (void)allocator; - mirror->roughness.type = SOLPARSER_MTL_DATA_REAL; - mirror->roughness.value.real = 0; + mirror->slope_error.type = SOLPARSER_MTL_DATA_REAL; + mirror->slope_error.value.real = 0; mirror->ufacet_distrib = SOLPARSER_MICROFACET_BECKMANN; mirror->normal_map.i = SIZE_MAX; } diff --git a/src/parser/solparser_medium.c b/src/parser/solparser_medium.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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 @@ -88,7 +88,7 @@ main(int argc, char** argv) fprintf(stream, " geometry: \n"); fprintf(stream, " - sphere: {radius: 2}\n"); fprintf(stream, " material:\n"); - fprintf(stream, " mirror: { reflectivity: 0.9, roughness: 0.1 }\n"); + fprintf(stream, " mirror: { reflectivity: 0.9, slope_error: 0.1 }\n"); fprintf(stream, " - name: lvl1b\n"); fprintf(stream, " primary: 0\n"); fprintf(stream, " geometry: *sphere\n"); @@ -191,8 +191,8 @@ main(int argc, char** argv) mirror = solparser_get_material_mirror(parser, mtl->data.mirror); CHK(mirror->reflectivity.type == SOLPARSER_MTL_DATA_REAL); CHK(mirror->reflectivity.value.real == 0.9); - CHK(mirror->roughness.type == SOLPARSER_MTL_DATA_REAL); - CHK(mirror->roughness.value.real == 0.1); + CHK(mirror->slope_error.type == SOLPARSER_MTL_DATA_REAL); + CHK(mirror->slope_error.value.real == 0.1); entity_id = solparser_entity_get_child(entity, 1); entity1b = solparser_get_entity(parser, entity_id); diff --git a/src/parser/test_solparser3.c b/src/parser/test_solparser3.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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 @@ -23,7 +23,7 @@ static const char* input[] = { " dni: 1\n", " spectrum: [{wavelength: 1, data: 1}]\n", "- material: &lambertian\n", - " mirror: { reflectivity: 0.2, roughness: 0.1 }\n", + " mirror: { reflectivity: 0.2, slope_error: 0.1 }\n", "- geometry: &cuboid\n", " - cuboid: { size: [1, 2, 3] }\n", " material: *lambertian\n", @@ -161,8 +161,8 @@ main(int argc, char** argv) mirror = solparser_get_material_mirror(parser, mtl->data.mirror); CHK(mirror->reflectivity.type == SOLPARSER_MTL_DATA_REAL); CHK(mirror->reflectivity.value.real == 0.2); - CHK(mirror->roughness.type == SOLPARSER_MTL_DATA_REAL); - CHK(mirror->roughness.value.real == 0.1); + CHK(mirror->slope_error.type == SOLPARSER_MTL_DATA_REAL); + CHK(mirror->slope_error.value.real == 0.1); CHK(mirror->ufacet_distrib == SOLPARSER_MICROFACET_BECKMANN); shape = solparser_get_shape(parser, obj->shape); diff --git a/src/parser/test_solparser5.c b/src/parser/test_solparser5.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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 @@ -21,7 +21,7 @@ check_object (struct solparser* parser, const struct solparser_object* obj, const double reflectivity, - const double roughness, + const double slope_error, const enum solparser_microfacet_distribution distrib) { const struct solparser_shape* shape; @@ -44,8 +44,8 @@ check_object mirror = solparser_get_material_mirror(parser, mtl->data.mirror); CHK(mirror->reflectivity.type == SOLPARSER_MTL_DATA_REAL); CHK(mirror->reflectivity.value.real == reflectivity); - CHK(mirror->roughness.type == SOLPARSER_MTL_DATA_REAL); - CHK(mirror->roughness.value.real == roughness); + CHK(mirror->slope_error.type == SOLPARSER_MTL_DATA_REAL); + CHK(mirror->slope_error.value.real == slope_error); CHK(mirror->ufacet_distrib == distrib); } @@ -67,16 +67,16 @@ main(int argc, char** argv) fprintf(stream, "- material: &specular\n"); fprintf(stream, " mirror:\n"); fprintf(stream, " reflectivity: 1\n"); - fprintf(stream, " roughness: 0\n"); + fprintf(stream, " slope_error: 0\n"); fprintf(stream, "- material: &beckmann\n"); fprintf(stream, " mirror:\n"); fprintf(stream, " reflectivity: 0.5\n"); - fprintf(stream, " roughness: 0.5\n"); + fprintf(stream, " slope_error: 0.5\n"); fprintf(stream, " microfacet: BECKMANN\n"); fprintf(stream, "- material: &pillbox\n"); fprintf(stream, " mirror:\n"); fprintf(stream, " reflectivity: 0.2\n"); - fprintf(stream, " roughness: 0.2\n"); + fprintf(stream, " slope_error: 0.2\n"); fprintf(stream, " microfacet: PILLBOX\n"); fprintf(stream, "\n"); fprintf(stream, "- entity:\n"); 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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 @@ -193,7 +193,7 @@ test_mirror(struct solparser* parser) fprintf(stream, " material: \n"); fprintf(stream, " mirror:\n"); fprintf(stream, " reflectivity: 1\n"); - fprintf(stream, " roughness: 0.1\n"); + fprintf(stream, " slope_error: 0.1\n"); fprintf(stream, " normal_map: { path: Normal map } \n"); rewind(stream); @@ -225,8 +225,8 @@ test_mirror(struct solparser* parser) mirror = solparser_get_material_mirror(parser, mtl->data.mirror); CHK(mirror->reflectivity.type == SOLPARSER_MTL_DATA_REAL); CHK(mirror->reflectivity.value.real == 1); - CHK(mirror->roughness.type == SOLPARSER_MTL_DATA_REAL); - CHK(mirror->roughness.value.real == 0.1); + CHK(mirror->slope_error.type == SOLPARSER_MTL_DATA_REAL); + CHK(mirror->slope_error.value.real == 0.1); CHK(SOLPARSER_ID_IS_VALID(mirror->normal_map) == 1); img = solparser_get_image(parser, mirror->normal_map); CHK(strcmp(str_cget(&img->filename), "Normal map") == 0); diff --git a/src/parser/test_solparser_spectrum.c b/src/parser/test_solparser_spectrum.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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 @@ -145,7 +145,7 @@ test_mirror(struct solparser* parser) fprintf(stream, " - { wavelength: 3.4, data: 0.5 }\n"); fprintf(stream, " - { wavelength: 1.2, data: 0.25 }\n"); fprintf(stream, " - { wavelength: 6.7, data: 0.125 }\n"); - fprintf(stream, " roughness:\n"); + fprintf(stream, " slope_error:\n"); fprintf(stream, " - { wavelength: 123, data: 0 }\n"); fprintf(stream, " - { wavelength: 456, data: 1 }\n"); rewind(stream); @@ -161,7 +161,7 @@ test_mirror(struct solparser* parser) CHK(mtl->type == SOLPARSER_MATERIAL_MIRROR); mirror = solparser_get_material_mirror(parser, mtl->data.mirror); CHK(mirror->reflectivity.type == SOLPARSER_MTL_DATA_SPECTRUM); - CHK(mirror->roughness.type == SOLPARSER_MTL_DATA_SPECTRUM); + CHK(mirror->slope_error.type == SOLPARSER_MTL_DATA_SPECTRUM); CHK(SOLPARSER_ID_IS_VALID(mirror->normal_map) == 0); spectrum = solparser_get_spectrum(parser, mirror->reflectivity.value.spectrum); @@ -173,7 +173,7 @@ test_mirror(struct solparser* parser) CHK(darray_spectrum_data_cdata_get(&spectrum->data)[1].data == 0.5); CHK(darray_spectrum_data_cdata_get(&spectrum->data)[2].data == 0.125); - spectrum = solparser_get_spectrum(parser, mirror->roughness.value.spectrum); + spectrum = solparser_get_spectrum(parser, mirror->slope_error.value.spectrum); CHK(darray_spectrum_data_size_get(&spectrum->data) == 2); CHK(darray_spectrum_data_cdata_get(&spectrum->data)[0].wavelength == 123); CHK(darray_spectrum_data_cdata_get(&spectrum->data)[1].wavelength == 456); diff --git a/src/parser/yaml/test_ko_0.yaml b/src/parser/yaml/test_ko_0.yaml @@ -185,7 +185,7 @@ # <mirror> ::= # mirror: # reflectivity: REAL # in [0, 1] -# roughness: REAL # in [0, 1] +# slope_error: REAL # in [0, 1] # [ microfacet: <BECKMANN|PILLBOX> ] # @@ -196,42 +196,42 @@ - material: { mirror: { dummy: 0 } } --- # missing reflectivity parameter -- material: { mirror: { roughness: 0 } } +- material: { mirror: { slope_error: 0 } } --- -# missing roughness parameter +# missing slope_error parameter - material: { mirror: { reflectivity: 1 } } --- -# roughness should be a number -- material: { mirror: { roughness: "dummy" } } +# slope_error should be a number +- material: { mirror: { slope_error: "dummy" } } --- # reflectivity should be a number - material: { mirror: { reflectivity: "dummy" } } --- # -1 invalid -- material: { mirror: { reflectivity: -1, roughness: 0 } } +- material: { mirror: { reflectivity: -1, slope_error: 0 } } --- # 1.5 invalid -- material: { mirror: { reflectivity: 1.5, roughness: 0 } } +- material: { mirror: { reflectivity: 1.5, slope_error: 0 } } --- # -1 invalid -- material: { mirror: { reflectivity: 1, roughness: -1 } } +- material: { mirror: { reflectivity: 1, slope_error: -1 } } --- # 1.5 invalid -- material: { mirror: { reflectivity: 1, roughness: 1.5 } } +- material: { mirror: { reflectivity: 1, slope_error: 1.5 } } --- # 2x reflectivity - material: { mirror: { reflectivity: 1, reflectivity: 1 } } --- -# 2x roughness -- material: { mirror: { roughness: 1, roughness: 1 } } +# 2x slope_error +- material: { mirror: { slope_error: 1, slope_error: 1 } } --- # unknown microfacet -- material: { mirror: { roughness: 1, reflectivity: 1, microfacet: BECKBOX }} +- material: { mirror: { slope_error: 1, reflectivity: 1, microfacet: BECKBOX }} --- # 2x microfacet - material: mirror: - roughness: 1 + slope_error: 1 reflectivity: 1 microfacet: BECKMANN microfacet: PILLBOX diff --git a/src/parser/yaml/test_ok_1.yaml b/src/parser/yaml/test_ok_1.yaml @@ -3,7 +3,7 @@ - material: &mirror mirror: reflectivity: 1 - roughness: 0 + slope_error: 0 - geometry: &cylinder - material: *mirror @@ -25,7 +25,7 @@ - material: &mirror mirror: reflectivity: 1 - roughness: 0 + slope_error: 0 microfacet: BECKMANN - geometry: &cylinder @@ -47,7 +47,7 @@ name: entity primary: 1 geometry: - - material: { mirror: { reflectivity: 0.314, roughness: 0.5 } } + - material: { mirror: { reflectivity: 0.314, slope_error: 0.5 } } cylinder: { height: 10.12, radius: 0.32 } --- - sun: { dni: 1, spectrum: [{wavelength: 1, data: 1}] } @@ -55,7 +55,7 @@ name: entity primary: 1 geometry: - - material: { mirror: { reflectivity: 0, roughness: 0.5 } } + - material: { mirror: { reflectivity: 0, slope_error: 0.5 } } cylinder: { height: 1, radius: 1 } --- - sun: { dni: 1, spectrum: [{wavelength: 1, data: 1}] } @@ -68,5 +68,5 @@ mirror: microfacet: PILLBOX reflectivity: 0 - roughness: 0.5 + slope_error: 0.5 diff --git a/src/parser/yaml/test_ok_6.yaml b/src/parser/yaml/test_ok_6.yaml @@ -3,7 +3,7 @@ name: entity primary: 1 geometry: - - material: { mirror: { reflectivity: 0, roughness: 0.5 } } + - material: { mirror: { reflectivity: 0, slope_error: 0.5 } } plane: slices: 4 clip: @@ -19,7 +19,7 @@ name: entity primary: 1 geometry: - - material: { mirror: { reflectivity: 0, roughness: 0.5 } } + - material: { mirror: { reflectivity: 0, slope_error: 0.5 } } plane: clip: - operation: AND @@ -34,7 +34,7 @@ name: entity primary: 1 geometry: - - material: { mirror: { reflectivity: 0, roughness: 0.5 } } + - material: { mirror: { reflectivity: 0, slope_error: 0.5 } } parabol: slices: 40 focal: 18 @@ -47,7 +47,7 @@ name: entity primary: 1 geometry: - - material: { mirror: { reflectivity: 0, roughness: 0.5 } } + - material: { mirror: { reflectivity: 0, slope_error: 0.5 } } parabol: focal: 18 clip: @@ -59,7 +59,7 @@ name: entity primary: 1 geometry: - - material: { mirror: { reflectivity: 0, roughness: 0.5 } } + - material: { mirror: { reflectivity: 0, slope_error: 0.5 } } parabolic-cylinder: slices: 40 focal: 18 @@ -72,7 +72,7 @@ name: entity primary: 1 geometry: - - material: { mirror: { reflectivity: 0, roughness: 0.5 } } + - material: { mirror: { reflectivity: 0, slope_error: 0.5 } } parabolic-cylinder: focal: 18 clip: @@ -85,7 +85,7 @@ name: entity primary: 1 geometry: - - material: { mirror: { reflectivity: 0, roughness: 0.5 } } + - material: { mirror: { reflectivity: 0, slope_error: 0.5 } } hyperbol: slices: 40 focals: { real: 1, image: 1 } @@ -98,7 +98,7 @@ name: entity primary: 1 geometry: - - material: { mirror: { reflectivity: 0, roughness: 0.5 } } + - material: { mirror: { reflectivity: 0, slope_error: 0.5 } } hyperbol: focals: { real: 1, image: 1 } clip: @@ -110,7 +110,7 @@ name: entity primary: 1 geometry: - - material: { mirror: { reflectivity: 0, roughness: 0.5 } } + - material: { mirror: { reflectivity: 0, slope_error: 0.5 } } hyperbol: focals: { real: 1, image: 1 } clip: @@ -122,7 +122,7 @@ name: entity primary: 1 geometry: - - material: { mirror: { reflectivity: 0, roughness: 0.5 } } + - material: { mirror: { reflectivity: 0, slope_error: 0.5 } } hyperbol: focals: { real: 1, image: 1 } clip: diff --git a/src/receivers/srcvl.c b/src/receivers/srcvl.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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.h b/src/receivers/srcvl.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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_srcvl.c b/src/receivers/test_srcvl.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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 b/src/solstice.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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 @@ -429,18 +429,28 @@ error: static res_T setup_receivers(struct solstice* solstice, struct srcvl* srcvl) { - struct solstice_receiver receiver; - struct str name; size_t i, n; res_T res = RES_OK; ASSERT(solstice && srcvl); - str_init(solstice->allocator, &name); + htable_receiver_clear(&solstice->receivers); + darray_receiver_clear(&solstice->rcvs_list); n = srcvl_count(srcvl); + + res = darray_receiver_resize(&solstice->rcvs_list, n); + if(res != RES_OK) { + fprintf(stderr, "Could not reserve memory space for the receivers.\n"); + goto error; + } + FOR_EACH(i, 0, n) { + struct solstice_receiver* receiver; struct srcvl_receiver rcv; const struct solparser_entity* entity; + const char* name; + + receiver = darray_receiver_data_get(&solstice->rcvs_list) + i; srcvl_get(srcvl, i, &rcv); entity = solparser_find_entity(solstice->parser, rcv.name); @@ -458,17 +468,18 @@ setup_receivers(struct solstice* solstice, struct srcvl* srcvl) goto error; } - res = str_set(&name, rcv.name); + res = str_set(&receiver->name, rcv.name); if(res != RES_OK) { fprintf(stderr, "Could not copy the receiver name.\n"); goto error; } - receiver.node = NULL; - receiver.side = rcv.side; - receiver.per_primitive = rcv.per_primitive; + receiver->node = NULL; + receiver->side = rcv.side; + receiver->per_primitive = rcv.per_primitive; - res = htable_receiver_set(&solstice->receivers, &name, &receiver); + name = str_cget(&receiver->name); + res = htable_receiver_set(&solstice->receivers, &name, &i); if(res != RES_OK) { fprintf(stderr, "Could not register the receiver `%s' against Solstice.\n", @@ -478,10 +489,10 @@ setup_receivers(struct solstice* solstice, struct srcvl* srcvl) } exit: - str_release(&name); return res; error: htable_receiver_clear(&solstice->receivers); + darray_receiver_clear(&solstice->rcvs_list); goto exit; } @@ -588,6 +599,7 @@ solstice_init htable_primary_init(allocator, &solstice->primaries); darray_nodes_init(allocator, &solstice->roots); darray_nodes_init(allocator, &solstice->pivots); + darray_receiver_init(allocator, &solstice->rcvs_list); darray_double_init(allocator, &solstice->sun_dirs); darray_double_init(allocator, &solstice->sun_angles); @@ -710,6 +722,7 @@ solstice_release(struct solstice* solstice) htable_primary_release(&solstice->primaries); darray_nodes_release(&solstice->roots); darray_nodes_release(&solstice->pivots); + darray_receiver_release(&solstice->rcvs_list); darray_double_release(&solstice->sun_dirs); darray_double_release(&solstice->sun_angles); logger_release(&solstice->logger); diff --git a/src/solstice.h b/src/solstice.h @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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 @@ -34,11 +34,74 @@ struct ssol_object; struct sanim_node; struct solstice_receiver { + struct str name; struct solstice_node* node; enum srcvl_side side; int per_primitive; }; +static INLINE void +solstice_receiver_init + (struct mem_allocator* allocator, struct solstice_receiver* rcv) +{ + ASSERT(rcv); + str_init(allocator, &rcv->name); + rcv->node = NULL; + rcv->side = SRCVL_FRONT_AND_BACK; + rcv->per_primitive = 0; +} + +static INLINE void +solstice_receiver_release(struct solstice_receiver* rcv) +{ + ASSERT(rcv); + str_release(&rcv->name); +} + +static INLINE res_T +solstice_receiver_copy + (struct solstice_receiver* dst, + const struct solstice_receiver* src) +{ + ASSERT(dst && src); + dst->node = src->node; + dst->side = src->side; + dst->per_primitive = src->per_primitive; + return str_copy(&dst->name, &src->name); +} + +static INLINE res_T +solstice_receiver_copy_and_release + (struct solstice_receiver* dst, + struct solstice_receiver* src) +{ + res_T res = RES_OK; + ASSERT(dst && src); + dst->node = src->node; + dst->side = src->side; + dst->per_primitive = src->per_primitive; + res = str_copy_and_release(&dst->name, &src->name); + if(res != RES_OK) return res; + solstice_receiver_release(src); + return RES_OK; +} + +static INLINE size_t +cstr_hash(const char* const* key) +{ + const char* str; + ASSERT(key); + str = *key; + return hash_fnv64(str, strlen(str)); +} + +static INLINE char +cstr_eq(const char* const* a, const char* const* b) +{ + ASSERT(a && b); + return strcmp(*a, *b) == 0; +} + struct solstice_primary { struct solstice_node* node; }; @@ -63,15 +126,19 @@ struct solstice_primary { #define HTABLE_DATA struct solstice_node* #include <rsys/hash_table.h> +#define DARRAY_NAME receiver +#define DARRAY_DATA struct solstice_receiver +#define DARRAY_FUNCTOR_INIT solstice_receiver_init +#define DARRAY_FUNCTOR_RELEASE solstice_receiver_release +#define DARRAY_FUNCTOR_COPY solstice_receiver_copy +#define DARRAY_FUNCTOR_COPY_AND_RELEASE solstice_receiver_copy_and_release +#include <rsys/dynamic_array.h> + #define HTABLE_NAME receiver -#define HTABLE_KEY struct str -#define HTABLE_KEY_FUNCTOR_INIT str_init -#define HTABLE_KEY_FUNCTOR_RELEASE str_release -#define HTABLE_KEY_FUNCTOR_COPY str_copy -#define HTABLE_KEY_FUNCTOR_COPY_AND_RELEASE str_copy_and_release -#define HTABLE_KEY_FUNCTOR_EQ str_eq -#define HTABLE_KEY_FUNCTOR_HASH str_hash -#define HTABLE_DATA struct solstice_receiver +#define HTABLE_KEY const char* /* Pointer toward the name of the receiver */ +#define HTABLE_KEY_FUNCTOR_HASH cstr_hash +#define HTABLE_KEY_FUNCTOR_EQ cstr_eq +#define HTABLE_DATA size_t /* Index of the receiver */ #include <rsys/hash_table.h> #define HTABLE_NAME primary @@ -102,6 +169,9 @@ struct solstice { struct darray_nodes pivots; struct ssol_material* mtl_virtual; /* Shared virtual material */ + /* List of receivers ordered as submitted by the receiver file */ + struct darray_receiver rcvs_list; + /* Rendering */ struct ssol_camera* camera; struct ssol_image* framebuffer; diff --git a/src/solstice_args.c b/src/solstice_args.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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 @@ -74,7 +74,7 @@ print_help(const char* program) " --version display version information and exit.\n"); printf("\n"); printf( -"Solstice (C) 2016-2017 CNRS. This is a free software released under the GNU GPL\n" +"Solstice (C) 2016-2018 CNRS. This is a free software released under the GNU GPL\n" "license, version 3 or later. You are free to change or redistribute it under\n" "certain conditions <http://gnu.org/licenses/gpl.html>.\n"); } diff --git a/src/solstice_atmosphere.c b/src/solstice_atmosphere.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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 @@ -80,12 +80,26 @@ solstice_create_ssol_spectrum struct ssol_spectrum** spectrum); extern LOCAL_SYM res_T +solstice_create_scaled_ssol_spectrum + (struct solstice* solstice, + const struct solparser_spectrum_id spectrum_id, + const double scale_factor, /* Scale factor applied to the spectrum data */ + struct ssol_spectrum** spectrum); + +extern LOCAL_SYM res_T mtl_to_ssol_data (struct solstice* solstice, const struct solparser_mtl_data* mtl_data, struct ssol_data* data); extern LOCAL_SYM res_T +scaled_mtl_to_ssol_data + (struct solstice* solstice, + const struct solparser_mtl_data* mtl_data, + const double scale_factor, + struct ssol_data* data); + +extern LOCAL_SYM res_T solstice_create_ssol_material (struct solstice* solstice, const struct solparser_material_id mtl_id, diff --git a/src/solstice_draw.c b/src/solstice_draw.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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 @@ -290,6 +290,8 @@ create_node struct solstice_node* node = NULL; struct solstice_node* child = NULL; struct solstice_receiver* rcv = NULL; + const char* str = NULL; + size_t* pircv = NULL; struct str child_name; struct str anchor_name; double rotation[3]; @@ -349,11 +351,15 @@ create_node } /* Setup the entity receiver flags */ - rcv = htable_receiver_find(&solstice->receivers, name); - if(rcv) { - const int mask = srcvl_side_to_ssol_mask(rcv->side); + str = str_cget(name); + pircv = htable_receiver_find(&solstice->receivers, &str); + if(pircv) { + int mask; + 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); + res = solstice_node_geometry_set_receiver(node, mask, rcv->per_primitive); if(res != RES_OK) { fprintf(stderr, "Could not define the entity `%s' as a receiver.\n", diff --git a/src/solstice_material.c b/src/solstice_material.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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 @@ -472,8 +472,21 @@ create_material_mirror res = mtl_to_ssol_data(solstice, &mirror->reflectivity, ¶m->reflectivity); if(res != RES_OK) goto error; - res = mtl_to_ssol_data(solstice, &mirror->roughness, ¶m->roughness); - if(res != RES_OK) goto error; + + switch(mirror->ufacet_distrib) { + case SOLPARSER_MICROFACET_BECKMANN: + /* For the beckmann distribution, convert the slope error to the + * corresponding beckmann rougness by multiplying it by sqrt(2) */ + res = scaled_mtl_to_ssol_data + (solstice, &mirror->slope_error, sqrt(2), ¶m->roughness); + break; + case SOLPARSER_MICROFACET_PILLBOX: + /* Direct correspondance between the solver roughness parameter and the + * provided slope error */ + res = mtl_to_ssol_data(solstice, &mirror->slope_error, ¶m->roughness); + break; + default: FATAL("Unreachable code.\n"); break; + } if(!SOLPARSER_ID_IS_VALID(mirror->normal_map)) { shader.normal = mtl_get_normal; @@ -589,9 +602,10 @@ error: * Local functions ******************************************************************************/ res_T -mtl_to_ssol_data +scaled_mtl_to_ssol_data (struct solstice* solstice, const struct solparser_mtl_data* mtl_data, + const double scale_factor, struct ssol_data* data) { struct ssol_spectrum* spectrum = NULL; @@ -600,16 +614,16 @@ mtl_to_ssol_data ssol_data_clear(data); switch(mtl_data->type) { - case SOLPARSER_MTL_DATA_REAL: - ssol_data_set_real(data, mtl_data->value.real); - break; - case SOLPARSER_MTL_DATA_SPECTRUM: - res = solstice_create_ssol_spectrum - (solstice, mtl_data->value.spectrum, &spectrum); - if(res != RES_OK) goto error; - ssol_data_set_spectrum(data, spectrum); - break; - default: FATAL("Unreachable code.\n"); break; + case SOLPARSER_MTL_DATA_REAL: + ssol_data_set_real(data, mtl_data->value.real*scale_factor); + break; + case SOLPARSER_MTL_DATA_SPECTRUM: + res = solstice_create_scaled_ssol_spectrum + (solstice, mtl_data->value.spectrum, scale_factor, &spectrum); + if(res != RES_OK) goto error; + ssol_data_set_spectrum(data, spectrum); + break; + default: FATAL("Unreachable code.\n"); break; } exit: @@ -620,6 +634,15 @@ error: goto exit; } +extern LOCAL_SYM res_T +mtl_to_ssol_data + (struct solstice* solstice, + const struct solparser_mtl_data* mtl_data, + struct ssol_data* data) +{ + return scaled_mtl_to_ssol_data(solstice, mtl_data, 1.0, data); +} + res_T solstice_create_ssol_material (struct solstice* solstice, diff --git a/src/solstice_node.c b/src/solstice_node.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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 @@ -31,10 +31,10 @@ static void write_mc_global(struct solstice* solstice, struct ssol_estimator* estimator) { struct ssol_mc_global mc_global; - struct htable_receiver_iterator r_it, r_end; struct htable_primary_iterator p_it, p_end; const struct solparser_sun* solparser_sun = NULL; size_t nexperiments, nfailed, nprimary; + size_t ircv; double area, potential, irradiance_factor; ASSERT(solstice && estimator); @@ -51,7 +51,7 @@ write_mc_global(struct solstice* solstice, struct ssol_estimator* estimator) /* Counts */ fprintf(solstice->output, "%d %lu %lu %lu %lu\n", 7, /* #global results count */ - (unsigned long)htable_receiver_size_get(&solstice->receivers), + (unsigned long)darray_receiver_size_get(&solstice->rcvs_list), (unsigned long)nprimary, (unsigned long)nexperiments, (unsigned long)nfailed); @@ -69,11 +69,9 @@ write_mc_global(struct solstice* solstice, struct ssol_estimator* estimator) #undef PRINT_MC_GLOBAL /* Receivers' data */ - htable_receiver_begin(&solstice->receivers, &r_it); - htable_receiver_end(&solstice->receivers, &r_end); - while(!htable_receiver_iterator_eq(&r_it, &r_end)) { - const struct str* name = htable_receiver_iterator_key_get(&r_it); - struct solstice_receiver* rcv = htable_receiver_iterator_data_get(&r_it); + FOR_EACH(ircv, 0, darray_receiver_size_get(&solstice->rcvs_list)) { + struct solstice_receiver* rcv = darray_receiver_data_get + (&solstice->rcvs_list) + ircv; struct ssol_instance* inst = rcv->node->instance; struct ssol_mc_receiver front = MC_RCV_NONE__; struct ssol_mc_receiver back = MC_RCV_NONE__; @@ -81,7 +79,6 @@ write_mc_global(struct solstice* solstice, struct ssol_estimator* estimator) double b_eff_E = -1, b_eff_SE = -1; /* Back efficiency */ uint32_t id; - htable_receiver_iterator_next(&r_it); switch(rcv->side) { case SRCVL_FRONT: SSOL(estimator_get_mc_receiver(estimator, inst, SSOL_FRONT, &front)); @@ -111,7 +108,7 @@ write_mc_global(struct solstice* solstice, struct ssol_estimator* estimator) "%g %g %g %g %g %g %g %g %g %g " "%g %g %g %g %g %g %g %g %g %g %g %g " "%g %g %g %g %g %g %g %g %g %g\n", - str_cget(name), (unsigned)id, area, + str_cget(&rcv->name), (unsigned)id, area, front.incoming_flux.E, front.incoming_flux.SE, front.incoming_if_no_field_loss.E, front.incoming_if_no_field_loss.SE, front.incoming_if_no_atm_loss.E, front.incoming_if_no_atm_loss.SE, @@ -159,10 +156,9 @@ write_mc_global(struct solstice* solstice, struct ssol_estimator* estimator) } /* ReceiverXprimarys' data */ - htable_receiver_begin(&solstice->receivers, &r_it); - htable_receiver_end(&solstice->receivers, &r_end); - while (!htable_receiver_iterator_eq(&r_it, &r_end)) { - struct solstice_receiver* rcv = htable_receiver_iterator_data_get(&r_it); + FOR_EACH(ircv, 0, darray_receiver_size_get(&solstice->rcvs_list)) { + struct solstice_receiver* rcv = darray_receiver_data_get + (&solstice->rcvs_list) + ircv; struct ssol_instance* rcv_inst = rcv->node->instance; uint32_t rcv_id, prim_id; @@ -177,21 +173,21 @@ write_mc_global(struct solstice* solstice, struct ssol_estimator* estimator) SSOL(instance_get_id(prim_inst, &prim_id)); switch (rcv->side) { - case SRCVL_FRONT: - SSOL(estimator_get_mc_sampled_x_receiver - (estimator, prim_inst, rcv_inst, SSOL_FRONT, &front)); - break; - case SRCVL_BACK: - SSOL(estimator_get_mc_sampled_x_receiver - (estimator, prim_inst, rcv_inst, SSOL_BACK, &back)); - break; - case SRCVL_FRONT_AND_BACK: - SSOL(estimator_get_mc_sampled_x_receiver - (estimator, prim_inst, rcv_inst, SSOL_FRONT, &front)); - SSOL(estimator_get_mc_sampled_x_receiver - (estimator, prim_inst, rcv_inst, SSOL_BACK, &back)); - break; - default: FATAL("Unreachable code.\n"); break; + case SRCVL_FRONT: + SSOL(estimator_get_mc_sampled_x_receiver + (estimator, prim_inst, rcv_inst, SSOL_FRONT, &front)); + break; + case SRCVL_BACK: + SSOL(estimator_get_mc_sampled_x_receiver + (estimator, prim_inst, rcv_inst, SSOL_BACK, &back)); + break; + case SRCVL_FRONT_AND_BACK: + SSOL(estimator_get_mc_sampled_x_receiver + (estimator, prim_inst, rcv_inst, SSOL_FRONT, &front)); + SSOL(estimator_get_mc_sampled_x_receiver + (estimator, prim_inst, rcv_inst, SSOL_BACK, &back)); + break; + default: FATAL("Unreachable code.\n"); break; } fprintf(solstice->output, "%u %u " @@ -199,7 +195,7 @@ write_mc_global(struct solstice* solstice, struct ssol_estimator* estimator) "%g %g %g %g %g %g %g %g " "%g %g %g %g %g %g %g %g %g %g %g %g " "%g %g %g %g %g %g %g %g\n", - (unsigned) rcv_id, (unsigned) prim_id, + (unsigned)rcv_id, (unsigned) prim_id, front.incoming_flux.E, front.incoming_flux.SE, front.incoming_if_no_field_loss.E, front.incoming_if_no_field_loss.SE, front.incoming_if_no_atm_loss.E, front.incoming_if_no_atm_loss.SE, @@ -222,7 +218,6 @@ write_mc_global(struct solstice* solstice, struct ssol_estimator* estimator) back.absorbed_lost_in_atmosphere.E, back.absorbed_lost_in_atmosphere.SE); htable_primary_iterator_next(&p_it); } - htable_receiver_iterator_next(&r_it); } } @@ -319,23 +314,19 @@ static void write_per_receiver_mc_primitive (struct solstice* solstice, struct ssol_estimator* estimator) { - struct htable_receiver_iterator it, end; + size_t ircv; ASSERT(solstice && estimator); - htable_receiver_begin(&solstice->receivers, &it); - htable_receiver_end(&solstice->receivers, &end); - while(!htable_receiver_iterator_eq(&it, &end)) { + FOR_EACH(ircv, 0, darray_receiver_size_get(&solstice->rcvs_list)) { struct ssol_instantiated_shaded_shape inst_sshape; - const struct str* name = htable_receiver_iterator_key_get(&it); - struct solstice_receiver* rcv = htable_receiver_iterator_data_get(&it); + struct solstice_receiver* rcv = darray_receiver_data_get + (&solstice->rcvs_list) + ircv; struct ssol_instance* inst = rcv->node->instance; size_t ishape, nshapes; size_t nverts, ntris; size_t offset; int mask, prim; - htable_receiver_iterator_next(&it); - SSOL(instance_is_receiver(inst, &mask, &prim)); CHK(mask != 0); if(!prim) continue; @@ -344,7 +335,7 @@ write_per_receiver_mc_primitive /* Write the header */ fprintf(solstice->output, "# vtk DataFile Version 2.0\n"); - fprintf(solstice->output, "%s\n", str_cget(name)); + fprintf(solstice->output, "%s\n", str_cget(&rcv->name)); fprintf(solstice->output, "ASCII\n"); fprintf(solstice->output, "DATASET POLYDATA\n"); diff --git a/src/solstice_spectrum.c b/src/solstice_spectrum.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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 @@ -15,16 +15,21 @@ #include "solstice_c.h" +struct context { + double scale_factor; + const struct solparser_spectrum_data* spectrum_data; +}; + /******************************************************************************* * Helper function ******************************************************************************/ static void -get_wavelength(const size_t i, double* wlen, double* data, void* ctx) +get_wavelength(const size_t i, double* wlen, double* data, void* context) { - const struct solparser_spectrum_data* specdata = ctx; - ASSERT(wlen && data && ctx); - *wlen = specdata[i].wavelength; - *data = specdata[i].data; + const struct context* ctx = context; + ASSERT(wlen && data && context); + *wlen = ctx->spectrum_data[i].wavelength; + *data = ctx->spectrum_data[i].data * ctx->scale_factor; } /******************************************************************************* @@ -36,8 +41,19 @@ solstice_create_ssol_spectrum const struct solparser_spectrum_id spectrum_id, struct ssol_spectrum** out_spectrum) { + return solstice_create_scaled_ssol_spectrum + (solstice, spectrum_id, 1, out_spectrum); +} + +res_T +solstice_create_scaled_ssol_spectrum + (struct solstice* solstice, + const struct solparser_spectrum_id spectrum_id, + const double scale_factor, + struct ssol_spectrum** out_spectrum) +{ + struct context ctx; struct ssol_spectrum* spectrum = NULL; - const struct solparser_spectrum_data* data; const struct solparser_spectrum* spec; size_t nwlens; res_T res = RES_OK; @@ -51,8 +67,9 @@ solstice_create_ssol_spectrum spec = solparser_get_spectrum(solstice->parser, spectrum_id); nwlens = darray_spectrum_data_size_get(&spec->data); - data = darray_spectrum_data_cdata_get(&spec->data); - res = ssol_spectrum_setup(spectrum, get_wavelength, nwlens, (void*)data); + ctx.spectrum_data = darray_spectrum_data_cdata_get(&spec->data); + ctx.scale_factor = scale_factor; + res = ssol_spectrum_setup(spectrum, get_wavelength, nwlens, &ctx); if(res != RES_OK) { fprintf(stderr, "Could not setup the Solstice Solver spectrum.\n"); goto error; diff --git a/src/solstice_sun.c b/src/solstice_sun.c @@ -1,4 +1,4 @@ -/* Copyright (C) CNRS 2016-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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-2017 +/* Copyright (C) CNRS 2016-2018 * * 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/yaml/beam_down.ref b/yaml/beam_down.ref @@ -7,23 +7,23 @@ 0 0 0 0 0 0 -tower.secondary.hyperbol 10 421.957 465.484 0.0183212 465.484 0.0183212 465.484 0.0183212 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 tower.receptor 14 25 465.484 0.0183212 465.484 0.0183212 465.484 0.0183212 0 0 0 0 465.484 0.0183212 465.484 0.0183212 465.484 0.0183212 0 0 0 0 0.930888 3.66392e-05 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +tower.secondary.hyperbol 10 421.957 465.484 0.0183212 465.484 0.0183212 465.484 0.0183212 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 heliostat4.temp-heliostat150.pivot.reflector 6 100.009 1999 0.931645 7.76782e-05 0 0 heliostat5.temp-heliostat150.pivot.reflector 30 100.009 1986 0.929678 7.95031e-05 0 0 heliostat3.temp-heliostat150.pivot.reflector 22 100.009 1997 0.931827 7.8194e-05 0 0 heliostat2.temp-heliostat150.pivot.reflector 26 100.009 1994 0.931626 7.95559e-05 0 0 heliostat1.temp-heliostat150.pivot.reflector 34 100.009 2024 0.929675 7.9316e-05 0 0 -10 6 93.126 1.86312 93.126 1.86312 93.126 1.86312 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -10 30 92.325 1.85463 92.325 1.85463 92.325 1.85463 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -10 22 93.051 1.86278 93.051 1.86278 93.051 1.86278 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -10 26 92.8912 1.86133 92.8912 1.86133 92.8912 1.86133 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -10 34 94.0913 1.86784 94.0913 1.86784 94.0913 1.86784 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 14 6 93.126 1.86312 93.126 1.86312 93.126 1.86312 0 0 0 0 93.126 1.86312 93.126 1.86312 93.126 1.86312 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 14 30 92.325 1.85463 92.325 1.85463 92.325 1.85463 0 0 0 0 92.325 1.85463 92.325 1.85463 92.325 1.85463 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 14 22 93.051 1.86278 93.051 1.86278 93.051 1.86278 0 0 0 0 93.051 1.86278 93.051 1.86278 93.051 1.86278 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 14 26 92.8912 1.86133 92.8912 1.86133 92.8912 1.86133 0 0 0 0 92.8912 1.86133 92.8912 1.86133 92.8912 1.86133 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 14 34 94.0913 1.86784 94.0913 1.86784 94.0913 1.86784 0 0 0 0 94.0913 1.86784 94.0913 1.86784 94.0913 1.86784 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +10 6 93.126 1.86312 93.126 1.86312 93.126 1.86312 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +10 30 92.325 1.85463 92.325 1.85463 92.325 1.85463 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +10 22 93.051 1.86278 93.051 1.86278 93.051 1.86278 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +10 26 92.8912 1.86133 92.8912 1.86133 92.8912 1.86133 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +10 34 94.0913 1.86784 94.0913 1.86784 94.0913 1.86784 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #--- Sun direction: 50 50 (-0.413176 -0.492404 -0.766044) 7 2 5 10000 0 500.043 0 @@ -33,20 +33,20 @@ heliostat1.temp-heliostat150.pivot.reflector 34 100.009 2024 0.929675 7.9316e- 244.012 1.94769 19.6535 0.85974 0 0 -tower.secondary.hyperbol 10 421.957 400.227 0.111144 400.227 0.111144 400.227 0.111144 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 tower.receptor 14 25 136.561 1.90791 136.561 1.90791 136.561 1.90791 0 0 0 0 136.561 1.90791 136.561 1.90791 136.561 1.90791 0 0 0 0 0.273098 0.0038155 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +tower.secondary.hyperbol 10 421.957 400.227 0.111144 400.227 0.111144 400.227 0.111144 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 heliostat4.temp-heliostat150.pivot.reflector 6 100.009 2045 0.785215 0.000131988 0 0 heliostat5.temp-heliostat150.pivot.reflector 30 100.009 1956 0.769715 0.000138356 0 0 heliostat3.temp-heliostat150.pivot.reflector 22 100.009 1948 0.799928 0.000131691 0 0 heliostat2.temp-heliostat150.pivot.reflector 26 100.009 2049 0.815877 0.000121947 0 0 heliostat1.temp-heliostat150.pivot.reflector 34 100.009 2002 0.830429 0.000118476 0 0 -10 6 80.2952 1.58372 80.2952 1.58372 80.2952 1.58372 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -10 30 75.2847 1.52678 75.2847 1.52678 75.2847 1.52678 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -10 22 77.9198 1.58423 77.9198 1.58423 77.9198 1.58423 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -10 26 83.5939 1.64675 83.5939 1.64675 83.5939 1.64675 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -10 34 83.1332 1.66167 83.1332 1.66167 83.1332 1.66167 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 14 6 22.2344 0.907756 22.2344 0.907756 22.2344 0.907756 0 0 0 0 22.2344 0.907756 22.2344 0.907756 22.2344 0.907756 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 14 30 18.29 0.819036 18.29 0.819036 18.29 0.819036 0 0 0 0 18.29 0.819036 18.29 0.819036 18.29 0.819036 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 14 22 24.7238 0.963323 24.7238 0.963323 24.7238 0.963323 0 0 0 0 24.7238 0.963323 24.7238 0.963323 24.7238 0.963323 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 14 26 33.4259 1.11916 33.4259 1.11916 33.4259 1.11916 0 0 0 0 33.4259 1.11916 33.4259 1.11916 33.4259 1.11916 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 14 34 37.8866 1.19599 37.8866 1.19599 37.8866 1.19599 0 0 0 0 37.8866 1.19599 37.8866 1.19599 37.8866 1.19599 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +10 6 80.2952 1.58372 80.2952 1.58372 80.2952 1.58372 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +10 30 75.2847 1.52678 75.2847 1.52678 75.2847 1.52678 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +10 22 77.9198 1.58423 77.9198 1.58423 77.9198 1.58423 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +10 26 83.5939 1.64675 83.5939 1.64675 83.5939 1.64675 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +10 34 83.1332 1.66167 83.1332 1.66167 83.1332 1.66167 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/yaml/beam_down.yaml b/yaml/beam_down.yaml @@ -9,7 +9,7 @@ - sun: &sun { dni: 1 } -- material: &mirror { mirror: { reflectivity: 1, roughness: 0 } } +- material: &mirror { mirror: { reflectivity: 1, slope_error: 0 } } - material: &black { matte: { reflectivity: 0 } } - material: &virtual { virtual: } @@ -105,4 +105,4 @@ name: "heliostat5" transform: { translation: [100, 30, 0] } children: [ *temp_heliostat150 ] - -\ No newline at end of file + diff --git a/yaml/test01.yaml b/yaml/test01.yaml @@ -2,9 +2,9 @@ - material: &specular front: - mirror: { reflectivity: 1, roughness: 0 } + mirror: { reflectivity: 1, slope_error: 0 } back: - mirror: { reflectivity: 1, roughness: 0 } + mirror: { reflectivity: 1, slope_error: 0 } - geometry: &small_square diff --git a/yaml/test02.yaml b/yaml/test02.yaml @@ -1,7 +1,7 @@ - sun: &sun { dni: 1 } - material: &specular - mirror: { reflectivity: 1, roughness: 0 } + mirror: { reflectivity: 1, slope_error: 0 } - geometry: &small_square diff --git a/yaml/test03.yaml b/yaml/test03.yaml @@ -2,9 +2,9 @@ - material: &specular front: - mirror: { reflectivity: 1, roughness: 0 } + mirror: { reflectivity: 1, slope_error: 0 } back: - mirror: { reflectivity: 1, roughness: 0 } + mirror: { reflectivity: 1, slope_error: 0 } - geometry: &small_square - material: *specular diff --git a/yaml/test04.yaml b/yaml/test04.yaml @@ -2,9 +2,9 @@ - material: &specular front: - mirror: { reflectivity: 1, roughness: 0 } + mirror: { reflectivity: 1, slope_error: 0 } back: - mirror: { reflectivity: 1, roughness: 0 } + mirror: { reflectivity: 1, slope_error: 0 } - material: &black matte: { reflectivity: 0 } diff --git a/yaml/test06.yaml b/yaml/test06.yaml @@ -7,7 +7,7 @@ matte: { reflectivity: 1 } - material: &specular - mirror: { reflectivity: 1, roughness: 0 } + mirror: { reflectivity: 1, slope_error: 0 } - template: &self_oriented_parabol diff --git a/yaml/test07.yaml b/yaml/test07.yaml @@ -5,9 +5,9 @@ - material: &specular front: - mirror: { reflectivity: 1, roughness: 0 } + mirror: { reflectivity: 1, slope_error: 0 } back: - mirror: { reflectivity: 1, roughness: 0 } + mirror: { reflectivity: 1, slope_error: 0 } - geometry: &hemisphere - material: *specular diff --git a/yaml/test08.yaml b/yaml/test08.yaml @@ -10,7 +10,7 @@ matte: { reflectivity: 1 } - material: &specular - mirror: { reflectivity: 1, roughness: 0 } + mirror: { reflectivity: 1, slope_error: 0 } - template: &self_oriented_parabol name: "pivot"