rl_DielectricLayer.h

00001 #ifndef rl_DielectricLayer_h_INCLUDED
00002 #define rl_DielectricLayer_h_INCLUDED
00003 
00004 // File:   rl_DielectricLayer.h
00005 // Author: Terry Gaetz
00006  
00007 /* --8<--8<--8<--8<--
00008  *
00009  * Copyright (C) 2006, 2007 Smithsonian Astrophysical Observatory
00010  *
00011  * This file is part of rl_raylib
00012  *
00013  * rl_raylib is free software; you can redistribute it and/or
00014  * modify it under the terms of the GNU General Public License
00015  * as published by the Free Software Foundation; either version 2
00016  * of the License, or (at your option) any later version.
00017  *
00018  * rl_raylib is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with this program; if not, write to the 
00025  *       Free Software Foundation, Inc. 
00026  *       51 Franklin Street, Fifth Floor
00027  *       Boston, MA  02110-1301, USA
00028  *
00029  * -->8-->8-->8-->8-- */
00030 
00031 /****************************************************************************
00032  * encapsulate the dielectric layer properties:
00033  *
00034  * History
00035  *--------
00036  * 1.0.1 2004-Dec-07  tjg  simplify/remove include guards
00037  * 0.0.0 1998-Jun-24  tjg  original version
00038  */
00039 
00040 #include <cstdlib>                            // size_t   
00041 #include <rl_raylib/rl_Traits.h>              // rl_Traits::EInterpMode complex
00042 #include <rl_raylib/rl_Exception.h>           // rl_Exception
00043 #include <rl_raylib/rl_DielectricData.h>      // rl_DielectricData
00044 #include <rl_raylib/rl_ReflectionCoefPOD.h>   // rl_ReflectionCoefPOD
00045 #include <rl_raylib/rl_TransmissionCoefPOD.h> // rl_ReflectionCoefPOD
00046 #include <rl_raylib/rl_Exception.h>           // rl_Exception
00047 
00048 //########################################################################
00049 // rl_DielectricLayer
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_;  // 2\pi srough_ / lambda_
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,  // upper layer
00453                   double                    sinphi  // sin(graze angle)
00454                                );
00455 
00465   void
00466   apply_DebyeWaller_CSAO_factor( 
00467                   rl_DielectricLayer const& upper,  // upper layer
00468                   double                    sinphi  // sin(graze angle)
00469                                );
00470 
00478   void
00479   apply_DebyeWaller_Spiller_factor( double sinphi  // sin(graze angle)
00480                                   );
00490   void
00491   apply_ModifiedDW_factor( rl_DielectricLayer const& upper,  // upper layer
00492                            double                    sinphi  // sin(graze angle)
00493                          );
00494 
00517   void
00518   apply_NevotCroce_factor( rl_DielectricLayer const& upper,  // upper layer
00519                            double                    sinphi  // sin(graze angle)
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 // rl_DielectricLayer_h_INCLUDED
00584 #endif

Generated on Mon Nov 3 18:15:05 2008 for rl_raylib by  doxygen 1.5.6