diff --git a/src/include/IterationData.h b/src/include/IterationData.h index 92e21b0826996eff727c701862404eab060be315..8b8dca9e98afeda9201b92a7b10c1478f747046f 100644 --- a/src/include/IterationData.h +++ b/src/include/IterationData.h @@ -348,5 +348,146 @@ public: }; // >>> END OF InclusionIterationData CLASS DEFINITION <<< // +// >>> DEFINITION OF SphereIterationData CLASS <<< +/*! \brief A data structure representing the information used for a single scale + * of the SPHERE case. + */ +class SphereIterationData { +protected: + //! \brief Number of spheres + int _nsph; + //! \brief Maximum field expansion order. + int _lm; + //! \brief Vector of Mueller matrix components. + double *vec_cmul; + //! \brief Vector of Mueller matrix components referred to meridional plane. + double *vec_cmullr; + //! Vectorized TQSPE. + dcomplex *vec_tqspe; + //! Vectorized TQSPS. + dcomplex *vec_tqsps; + //! Vectorized TQSE. + double *vec_tqse; + //! Vectorized TQSS. + double *vec_tqss; + //! Vectorized ZPV. + double *vec_zpv; + +public: + //! \brief Vacuum magnitude of wave vector. + double vk; + //! \brief Wave number. + double wn; + //! \brief Normalization scale. QUESTION: correct? + double xip; + //! \brief Number of scales (wavelengths) to be computed. + int number_of_scales; + //! \brief Size of the block of scales handled by the current process. + int xiblock; + //! \brief Index of the first scale handled by the current process. + int firstxi; + //! \brief Index of the last scale handled by the current process. + int lastxi; + //! \brief Argument of harmonic functions. + dcomplex arg; + //! \brief S0 = FSAS / (4 PI K^3). + dcomplex s0; + //! \brief Total forward scattering amplitude of the spheres. + dcomplex tfsas; + //! \brief Pointer to a sphere particle descriptor. + ParticleDescriptor *c1; + //! \brief Imaginary part of `arg`. + double *argi; + //! \brief `arg` squared. + double *args; + //! \brief Scattering angle. + double scan; + //! \brief Control parameter on incidence direction referred to meridional plane. + double cfmp; + //! \brief Control parameter on scattering direction referred to meridional plane. + double sfmp; + //! \brief Control parameter on incidence direction referred to scattering plane. + double cfsp; + //! \brief Control parameter on scattering direction referred to scattering plane. + double sfsp; + //! \brief Geometry asymmetry parameter for spheres. + double *gaps; + //! \brief Variation of unitary wave vector. + double *duk; + //! \brief Incidence direction unitary vector. + double *u; + //! \brief Scattering direction unitary vector. + double *us; + //! \brief Normal direction unitary vector. + double *un; + //! \brief Scattering normal direction unitary vector. + double *uns; + //! \brief Polarization direction unitary vector. + double *up; + //! \brief Scattered polarization direction unitary vector. + double *ups; + //! \brief Polarization direction unitary vector referred to meridional plane. + double *upmp; + //! \brief Scattered polarization direction unitary vector referred to meridional plane. + double *upsmp; + //! \brief Normal direction unitary vector referred to meridional plane. + double *unmp; + //! \brief Scattering normal direction unitary vector referred to meridional plane. + double *unsmp; + //! \brief Mueller matrix components. + double **cmul; + //! \brief Mueller matrix components referred to meridional plane. + double **cmullr; + //! \brief Polarization-dependent extinction contribution to torque for each sphere. + dcomplex **tqspe; + //! \brief Polarization-dependent scattering contribution to torque for each sphere. + dcomplex **tqsps; + //! \brief Extinction contribution to torque for each sphere. + double **tqse; + //! \brief Scattering contribution to torque for each sphere. + double **tqss; + //! \brief Scattering coefficients tensor. + double ****zpv; + + /*! \brief `SphereIterationData` default instance constructor. + * + * \param gconf: `GeometryConfiguration *` Pointer to a `GeometryConfiguration` object. + * \param sconf: `ScattererConfiguration *` Pointer to a `ScattererConfiguration` object. + * \param mpidata: `mixMPI *` Pointer to a `mixMPI` object. + * \param device_count: `const int` Number of offload devices available on the system. + */ + SphereIterationData(GeometryConfiguration *gconf, ScattererConfiguration *sconf, const mixMPI *mpidata, const int device_count); + + /*! \brief `SphereIterationData` copy constructor. + * + * \param rhs: `const SphereIterationData &` Reference to the object to be copied. + */ + SphereIterationData(const SphereIterationData& rhs); + +#ifdef MPI_VERSION + /*! \brief `SphereIterationData` MPI constructor. + * + * \param mpidata: `const mixMPI *` Pointer to a `mixMPI` instance. + * \param device_count: `const int` Number of offload devices available on the system. + */ + SphereIterationData(const mixMPI *mpidata, const int device_count); + + /*! \brief Broadcast over MPI the `SphereIterationData` instance from MPI process 0 to all others. + * + * When using MPI, the initial InclusionIterationData instance created by + * MPI process 0 needs to be replicated on all other processes. This + * function sends it using MPI broadcast calls. The MPI broadcast calls in + * this function must match those in the constructor using the mixMPI pointer. + * + * \param mpidata: `mixMPI *` Pointer to `mixMPI` instance. + */ + int mpibcast(const mixMPI *mpidata); +#endif // MPI_VERSION + + /*! \brief `SphereIterationData` instance destroyer. + */ + ~SphereIterationData(); +}; +// >>> END OF SphereIterationData CLASS DEFINITION <<< #endif // INCLUDE_ITERATION_DATA_H_