schiff_optical_properties.h (2205B)
1 /* Copyright (C) 2015, 2016, 2026 Centre National de la Recherche Scientifique 2 * Copyright (C) 2026 Clermont Auvergne INP 3 * Copyright (C) 2026 Institut Mines Télécom Albi-Carmaux 4 * Copyright (C) 2017, 2019-2021, 2026 |Méso|Star> (contact@meso-star.com) 5 * Copyright (C) 2026 Université de Lorraine 6 * Copyright (C) 2026 Université de Toulouse 7 * 8 * This program is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program. If not, see <http://www.gnu.org/licenses/>. */ 20 21 #ifndef SCHIFF_OPTICAL_PROPERTIES_H 22 #define SCHIFF_OPTICAL_PROPERTIES_H 23 24 #include <rsys/dynamic_array.h> 25 #include <rsys/rsys.h> 26 27 struct sschiff_material_properties; 28 29 struct schiff_optical_properties { 30 double W; /* Wavelength */ 31 double Nr; /* Real part of the relative refractive index */ 32 double Kr; /* Imaginary part of the relative refractive index */ 33 double Ne; /* Refractive index of the medium */ 34 }; 35 36 static INLINE char 37 schiff_optical_properties_check 38 (const struct schiff_optical_properties* props) 39 { 40 ASSERT(props); 41 return props->W >= 0.0 42 && props->Nr >= 0.0 43 && props->Kr >= 0.0 44 && props->Ne >= 0.0; 45 } 46 47 extern LOCAL_SYM res_T 48 schiff_optical_properties_load 49 (struct schiff_optical_properties** props, /* Stretchy array */ 50 const char* filename); 51 52 extern LOCAL_SYM res_T 53 schiff_optical_properties_load_stream 54 (struct schiff_optical_properties** props, /* Stretchy array */ 55 FILE* stream, 56 const char* stream_name); 57 58 extern LOCAL_SYM void 59 schiff_optical_properties_fetch 60 (struct schiff_optical_properties* properties, /* Stetchy array */ 61 const double wavelength, 62 struct sschiff_material_properties* props); 63 64 #endif /* SCHIFF_OPTICAL_PROPERTIES_H */ 65