rl_DielectricLayer.h
00001 #ifndef rl_DielectricLayer_h_INCLUDED
00002 #define rl_DielectricLayer_h_INCLUDED
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #include <cstdlib>
00041 #include <rl_raylib/rl_Traits.h>
00042 #include <rl_raylib/rl_Exception.h>
00043 #include <rl_raylib/rl_DielectricData.h>
00044 #include <rl_raylib/rl_ReflectionCoefPOD.h>
00045 #include <rl_raylib/rl_TransmissionCoefPOD.h>
00046 #include <rl_raylib/rl_Exception.h>
00047
00048
00049
00050
00051
00060 class rl_DielectricLayer
00061 {
00062 public:
00063
00065 typedef rl_Traits::complex complex;
00066
00068 typedef rl_Traits::ERoughType ERoughType;
00069
00070 private:
00071
00072 rl_DielectricLayer& operator=( rl_DielectricLayer const& );
00073
00075 char* name_;
00076
00078 rl_DielectricData diel_info_;
00079
00081 double thickness_;
00082
00090 double zcoat_;
00091
00093 double alpha_;
00094
00096 double gamma_;
00097
00099 ERoughType rtype_;
00100
00102 double srough_;
00103
00105 double lambda_;
00106
00108 complex prop_;
00109
00127 complex kt_perp_;
00128
00134 double phase_factor_;
00135
00137 rl_ReflectionCoefPOD rflcoef_;
00138
00141 rl_TransmissionCoefPOD t_ij_;
00142
00145 rl_TransmissionCoefPOD t_ji_;
00146
00148 complex tij_tji_para_;
00149
00151 complex tij_tji_perp_;
00152
00154 complex r_para_;
00155
00157 complex r_perp_;
00158
00160 complex r2_para_;
00161
00163 complex r2_perp_;
00164
00166 complex r2_tij_tji_para_;
00167
00169 complex r2_tij_tji_perp_;
00170
00171 complex sqrt_epsratio_;
00172 complex eps_epsupper_;
00173 complex sqrt_eps_epsupper_;
00174
00176 rl_Traits::Bool is_substrate_;
00177
00178 public:
00179
00183 ~rl_DielectricLayer();
00184
00191 rl_DielectricLayer( char const layer_name[] = 0 )
00192 throw ( rl_Exception );
00193
00199 rl_DielectricLayer( rl_DielectricLayer const& other )
00200 throw ( rl_Exception );
00201
00217 rl_DielectricLayer( rl_Traits::rl_DielectricPOD const*
00218 diel,
00219 std::size_t ndielpts,
00220 double layer_thickness,
00221 double roughness,
00222 rl_Traits::ERoughType roughness_type,
00223 rl_Traits::EInterpMode interp_mode,
00224 double bulkdensity,
00225 char const* layer_name,
00226 rl_Traits::Bool is_substrate = rl_Traits::False
00227 )
00228 throw ( rl_Exception );
00229
00246 void init( rl_Traits::rl_DielectricPOD const* diel,
00247 std::size_t ndielpts,
00248 double layer_thickness,
00249 double roughness,
00250 rl_Traits::ERoughType roughness_type,
00251 rl_Traits::EInterpMode interp_mode,
00252 double bulkdensity,
00253 char const* layer_name,
00254 rl_Traits::Bool is_substrate = rl_Traits::False
00255 )
00256 throw ( rl_Exception );
00257
00265 int setup_for( double energy, double sinphi );
00266
00278 void reflect_nlayer( rl_DielectricLayer layer[],
00279 int num );
00280
00297 void reflect_amp( rl_DielectricLayer const& layer,
00298 double sinphi );
00299
00305 complex const& propagator() const;
00306
00312 double alpha() const;
00313
00319 double gamma() const;
00320
00326 double roughness() const;
00327
00333 ERoughType roughness_type() const;
00334
00340 rl_ReflectionCoefPOD const& reflection_coef() const;
00341
00363 double reflectivity( double polarization_factor = 0.0 ) const;
00364
00369 rl_Traits::Bool is_substrate() const;
00370
00375 rl_Traits::Bool is_vacuum() const;
00376
00380 char const* layer_name() const;
00381
00385 double energy_min() const;
00386
00390 double energy_max() const;
00391
00395 double thickness() const;
00396
00400 double zcoat() const;
00401
00406 double bulk_density_factor() const;
00407
00415 std::ostream& dump_on( std::ostream& os, char const pre[] = "",
00416 char const pst[] = "" ) const;
00417
00425 void cdump_on( std::FILE* of, char const pre[] = "", char const pst[] = "" ) const;
00426
00434 void cprint_constraints_on( std::FILE* of,
00435 char const pre[] = "",
00436 char const pst[] = "" ) const;
00437
00438
00439 private:
00440
00450 void
00451 apply_DebyeWaller_RSAO_factor(
00452 rl_DielectricLayer const& upper,
00453 double sinphi
00454 );
00455
00465 void
00466 apply_DebyeWaller_CSAO_factor(
00467 rl_DielectricLayer const& upper,
00468 double sinphi
00469 );
00470
00478 void
00479 apply_DebyeWaller_Spiller_factor( double sinphi
00480 );
00490 void
00491 apply_ModifiedDW_factor( rl_DielectricLayer const& upper,
00492 double sinphi
00493 );
00494
00517 void
00518 apply_NevotCroce_factor( rl_DielectricLayer const& upper,
00519 double sinphi
00520 );
00521 };
00522
00523 inline rl_Traits::complex const& rl_DielectricLayer::
00524 propagator() const
00525 { return prop_; }
00526
00527 inline double rl_DielectricLayer::
00528 alpha() const
00529 { return alpha_; }
00530
00531 inline double rl_DielectricLayer::
00532 gamma() const
00533 { return gamma_; }
00534
00535 inline double rl_DielectricLayer::
00536 thickness() const
00537 { return thickness_; }
00538
00539 inline double rl_DielectricLayer::
00540 zcoat() const
00541 { return zcoat_; }
00542
00543 inline rl_Traits::ERoughType rl_DielectricLayer::
00544 roughness_type() const
00545 { return rtype_; }
00546
00547 inline double rl_DielectricLayer::
00548 roughness() const
00549 { return srough_; }
00550
00551 inline rl_ReflectionCoefPOD const& rl_DielectricLayer::
00552 reflection_coef() const
00553 { return rflcoef_; }
00554
00555 inline double rl_DielectricLayer::
00556 reflectivity( double polarization_factor ) const
00557 { return rflcoef_.reflectivity( polarization_factor ); }
00558
00559 inline rl_Traits::Bool rl_DielectricLayer::
00560 is_substrate() const
00561 { return is_substrate_; }
00562
00563 inline rl_Traits::Bool rl_DielectricLayer::
00564 is_vacuum() const
00565 { return diel_info_.is_vacuum(); }
00566
00567 inline char const* rl_DielectricLayer::
00568 layer_name() const
00569 { if ( name_ ) { return name_; } else { return ""; } }
00570
00571 inline double rl_DielectricLayer::
00572 energy_min() const
00573 { return diel_info_.energy_min(); }
00574
00575 inline double rl_DielectricLayer::
00576 energy_max() const
00577 { return diel_info_.energy_max(); }
00578
00579 inline double rl_DielectricLayer::
00580 bulk_density_factor() const
00581 { return diel_info_.bulk_density_factor(); }
00582
00583
00584 #endif