Commit f32264ab authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Implement SphereOutputInfo class and use it in np_sphere

parent 098577ec
Loading
Loading
Loading
Loading
+107 −21
Original line number Diff line number Diff line
@@ -467,9 +467,9 @@ public:

  /*! \brief `ClusterOutputInfo` constructor from HDF5 input.
   *
   * \param hdf5_file_name: `const string &` Path to the HDF5 file to be read.
   * \param hdf5_name: `const string &` Path to the HDF5 file to be read.
   */   
  ClusterOutputInfo(const std::string &hdf5_file_name);
  ClusterOutputInfo(const std::string &hdf5_name);

  /*! \brief `ClusterOutputInfo` instance destroyer.
   */
@@ -479,13 +479,13 @@ public:
   *
   * \param sc: `ScattererConfiguration *` Pointer to a `ScattererConfiguration` instance.
   * \param gc: `GeometryConfiguration *` Pointer to a `GeometryConfiguration` instance.
   * \param first_xi: `int` Index of the first scale in output (optional, default is 0).
   * \param first_xi: `int` Index of the first scale in output (optional, default is 1).
   * \param xi_length: `int` Number of scales tobe included in output (optional, default is all).
   * \return size: `long` Estimated instance size in bytes.
   */
  static long compute_size(
    ScattererConfiguration *sc, GeometryConfiguration *gc,
    int first_xi = 0, int xi_length = 0
    int first_xi = 1, int xi_length = 0
  );
  
  /*! \brief Get the size of a `ClusterOutputInfo` instance in bytes.
@@ -647,7 +647,7 @@ public:
  int jwtm;
  //! \brief Vector of scale (wavelength) indices.
  int *vec_jxi;
  //! \brief Vector of error severities (0 - success, 1 - HJV, 2 - DME).
  //! \brief Vector of error severities (0 - success, 1 - INDME, 2 - OSPV).
  short *vec_ier;
  //! \brief Vector of vacuum wave numbers.
  double *vec_vk;
@@ -897,9 +897,9 @@ public:

  /*! \brief `InclusionOutputInfo` constructor from HDF5 input.
   *
   * \param hdf5_file_name: `const string &` Path to the HDF5 file to be read.
   * \param hdf5_name: `const string &` Path to the HDF5 file to be read.
   */   
  InclusionOutputInfo(const std::string &hdf5_file_name);
  InclusionOutputInfo(const std::string &hdf5_name);

  /*! \brief `InclusionOutputInfo` instance destroyer.
   */
@@ -909,13 +909,13 @@ public:
   *
   * \param sc: `ScattererConfiguration *` Pointer to a `ScattererConfiguration` instance.
   * \param gc: `GeometryConfiguration *` Pointer to a `GeometryConfiguration` instance.
   * \param first_xi: `int` Index of the first scale in output (optional, default is 0).
   * \param first_xi: `int` Index of the first scale in output (optional, default is 1).
   * \param xi_length: `int` Number of scales tobe included in output (optional, default is all).
   * \return size: `long` Estimated instance size in bytes.
   */
  static long compute_size(
    ScattererConfiguration *sc, GeometryConfiguration *gc,
    int first_xi = 0, int xi_length = 0
    int first_xi = 1, int xi_length = 0
  );
  
  /*! \brief Get the size of a `ClusterOutputInfo` instance in bytes.
@@ -1004,18 +1004,16 @@ protected:
public:
  //! \brief Read-only view on the ID of the first scale
  const int &first_xi = _first_xi;
  //! \brief Number of spheres.
  int nsph;
  //! \brief Maximum field expansion order.
  int lm;
  //! \brief Maximum coefficient matrix dimension.
  np_int mxndm;
  //! \brief Incident polarization flag.
  int inpol;
  //! \brief Number of points for transition layer integration.
  int npnt;
  //! \brief Number of points for non-transition layer integration.
  int npntts;
  //! \brief Flag for intensity.
  int iavm;
  //! \brief Flag for reference to meridional plane.
  int isam;
  //! \brief Flag for dielectric function definition.
@@ -1054,18 +1052,106 @@ public:
  int xi_block_size;
  //! \brief Index of the wavelength for T-matrix output.
  int jwtm;
  //! \brief Number of sphere types.
  int configurations;
  //! \brief Highest expansion order achieved in calculations.
  int lcalc;
  //! \brief Harmonic functions argument.
  dcomplex arg;
  //! \brief Vector of scale (wavelength) indices.
  int *vec_jxi;
  //! \brief Vector of error severities (0 - success, 1 - HJV, 2 - DME).
  //! \brief Vector of error severities (0 - success, 1 - DME).
  short *vec_ier;
  //! \brief Vector of vacuum wave numbers.
  double *vec_vk;
  //! \brief Vector of computed scales.
  double *vec_xi;
  //! \brief Vector of sphere sizes (one for every scale).
  //! \brief Vector of sphere sizes (one for every configuration and scale).
  double *vec_sphere_sizes;
  //! \brief Vector of sphere refractive indices  (one for every scale).
  //! \brief Vector of sphere refractive indices (one for every configuration and scale).
  dcomplex *vec_sphere_ref_indices;
  //! \brief Vector of sphere scattering cross-sections.
  double *vec_scs;
  //! \brief Vector of sphere absorption cross-sections.
  double *vec_abs;
  //! \brief Vector of sphere extinction cross-sections.
  double *vec_exs;
  //! \brief Vector of sphere albedos.
  double *vec_albeds;
  //! \brief Vector of sphere scattering-to-geometric cross-sections.
  double *vec_scsrt;
  //! \brief Vector of sphere absorption-to-geometric cross-sections.
  double *vec_absrt;
  //! \brief Vector of sphere extinction-to-geometric cross-sections.
  double *vec_exsrt;
  //! \brief Vector of sphere forward scattering amplitudes.
  dcomplex *vec_fsas;
  //! \brief Vector of sphere QSCHU.
  double *vec_qschu;
  //! \brief Vector of sphere PSCHU.
  double *vec_pschu;
  //! \brief Vector of sphere S0MAG.
  double *vec_s0mag;
  //! \brief Vector of sphere average asymmetry parameter.
  double *vec_cosav;
  //! \brief Vector of sphere average radiation pressure force (N).
  double *vec_raprs;
  //! \brief Vector of sphere average extinction torque along incidence direction (parallel polarization).
  double *vec_tqek1;
  //! \brief Vector of sphere average extinction torque along incidence direction (perpendicular polarization).
  double *vec_tqek2;
  //! \brief Vector of sphere average scattering torque along incidence direction (parallel polarization).
  double *vec_tqsk1;
  //! \brief Vector of sphere average scattering torque along incidence direction (perpendicular polarization).
  double *vec_tqsk2;
  //| \brief Vector of total forward scattering amplitudes.
  dcomplex *vec_fsat;
  //! \brief Vector of total QSCHU.
  double *vec_qschut;
  //! \brief Vector of total PSCHU.
  double *vec_pschut;
  //! \brief Vector of total S0MAG.
  double *vec_s0magt;
  //! \brief Vector of incidence azimuth directions (one per incidence azimuth).
  double *vec_dir_tidg;
  //! \brief Vector of incidence elevation directions (one per incidence elevation).
  double *vec_dir_pidg;
  //! \brief Vector of scattering azimuth directions (one per scattering azimuth).
  double *vec_dir_tsdg;
  //! \brief Vector of scattering elevation directions (one per scattering elevation).
  double *vec_dir_psdg;
  //! \brief Vector of scattering angles (one per direction).
  double *vec_dir_scand;
  //! \brief Control parameter for incidence plane referred to meridional plane (one per direction).
  double *vec_dir_cfmp;
  //! \brief Control parameter for scattering plane referred to meridional plane (one per direction).
  double *vec_dir_sfmp;
  //! \brief Control parameter for incidence plane referred to scattering plane (one per direction).
  double *vec_dir_cfsp;
  //! \brief Control parameter for scattering plane referred to scattering plane (one per direction).
  double *vec_dir_sfsp;
  //! \brief Components of the unitary vector perpendicular to incidence plane (three per direction).
  double *vec_dir_un;
  //! \brief Components of the unitary vector perpendicular to scattering plane (three per direction).
  double *vec_dir_uns;
  //! \brief Vector of sphere differential scattering amplitude with polarization parallel to parallel incidence field.
  dcomplex *vec_dir_sas11;
  //! \brief Vector of sphere differential scattering amplitude with polarization perpendicular to the parallel incidence field.
  dcomplex *vec_dir_sas21;
  //! \brief Vector of sphere differential scattering amplitude with polarization perpendicular to perpendicular incidence field.
  dcomplex *vec_dir_sas12;
  //! \brief Vector of sphere differential scattering amplitude with polarization parallel the perpendicular incidence field.
  dcomplex *vec_dir_sas22;
  //! \brief Vector of differential radiation pressure force components along the X axis.
  double *vec_dir_fx;
  //! \brief Vector of differential radiation pressure force components along the Y axis.
  double *vec_dir_fy;
  //! \brief Vector of differential radiation pressure force components along the Z axis.
  double *vec_dir_fz;
  //! \brief Vector of sphere Mueller transormation matrices referred to meridional plane.
  double *vec_dir_muls;
  //! \brief Vector of sphere Mueller transormation matrices referred to scattering plane.
  double *vec_dir_mulslr;
  
  /*! \brief `SphereOutputInfo` default instance constructor.
   *
@@ -1082,9 +1168,9 @@ public:

  /*! \brief `SphereOutputInfo` constructor from HDF5 input.
   *
   * \param hdf5_file_name: `const string &` Path to the HDF5 file to be read.
   * \param hdf5_name: `const string &` Path to the HDF5 file to be read.
   */   
  SphereOutputInfo(const std::string &hdf5_file_name);
  SphereOutputInfo(const std::string &hdf5_name);

  /*! \brief `InclusionOutputInfo` instance destroyer.
   */
@@ -1094,13 +1180,13 @@ public:
   *
   * \param sc: `ScattererConfiguration *` Pointer to a `ScattererConfiguration` instance.
   * \param gc: `GeometryConfiguration *` Pointer to a `GeometryConfiguration` instance.
   * \param first_xi: `int` Index of the first scale in output (optional, default is 0).
   * \param first_xi: `int` Index of the first scale in output (optional, default is 1).
   * \param xi_length: `int` Number of scales tobe included in output (optional, default is all).
   * \return size: `long` Estimated instance size in bytes.
   */
  static long compute_size(
    ScattererConfiguration *sc, GeometryConfiguration *gc,
    int first_xi = 0, int xi_length = 0
    int first_xi = 1, int xi_length = 0
  );
  
  /*! \brief Get the size of a `ClusterOutputInfo` instance in bytes.