Walker test code coverage report
Current view: top level - DiffEq/Beta - MixNumberFractionBetaCoeffPolicy.hpp (source / functions) Hit Total Coverage
Commit: test_coverage.info Lines: 2 2 100.0 %
Date: 2022-09-21 18:57:21 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : // *****************************************************************************
       2                 :            : /*!
       3                 :            :   \file      src/DiffEq/Beta/MixNumberFractionBetaCoeffPolicy.hpp
       4                 :            :   \copyright 2012-2015 J. Bakosi,
       5                 :            :              2016-2018 Los Alamos National Security, LLC.,
       6                 :            :              2019-2021 Triad National Security, LLC.
       7                 :            :              All rights reserved. See the LICENSE file for details.
       8                 :            :   \brief     Mix number-fraction beta SDE coefficients policies
       9                 :            :   \details   This file defines coefficients policy classes for the mix
      10                 :            :     number-fraction beta SDE, defined in DiffEq/MixNumberFractionBeta.h.
      11                 :            : 
      12                 :            :     General requirements on mix number-fraction beta SDE coefficients policy
      13                 :            :     classes:
      14                 :            : 
      15                 :            :     - Must define a _constructor_, which is used to initialize the SDE
      16                 :            :       coefficients, b, S, kappa, rho2, and rcomma. Required signature:
      17                 :            :       \code{.cpp}
      18                 :            :         CoeffPolicyName(
      19                 :            :           tk::ctr::ncomp_t ncomp,
      20                 :            :           const std::vector< kw::sde_bprime::info::expect::type >& bprime_,
      21                 :            :           const std::vector< kw::sde_S::info::expect::type >& S_,
      22                 :            :           const std::vector< kw::sde_kappaprime::info::expect::type >& kprime_,
      23                 :            :           const std::vector< kw::sde_rho2::info::expect::type >& rho2_,
      24                 :            :           const std::vector< kw::sde_rcomma::info::expect::type >& rcomma_,
      25                 :            :           std::vector< kw::sde_bprime::info::expect::type  >& bprime,
      26                 :            :           std::vector< kw::sde_S::info::expect::type >& S,
      27                 :            :           std::vector< kw::sde_kappaprime::info::expect::type >& kprime,
      28                 :            :           std::vector< kw::sde_rho2::info::expect::type >& rho2_,
      29                 :            :           std::vector< kw::sde_rcomma::info::expect::type >& rcomma_ );
      30                 :            :       \endcode
      31                 :            :       where
      32                 :            :       - ncomp denotes the number of scalar components of the system of
      33                 :            :         mix number-fraction beta SDEs.
      34                 :            :       - Constant references to bprime_, S_, kprime_, rho2_, and rcomma_, which
      35                 :            :         denote five vectors of real values used to initialize the parameter
      36                 :            :         vectors of the system of mix number-fraction beta SDEs. The length of
      37                 :            :         the vectors must be equal to the number of components given by ncomp.
      38                 :            :       - References to bprime, S, kprime, rho2_, and rcomma, which denote the
      39                 :            :         parameter vectors to be initialized based on bprime_, S_, kprime_,
      40                 :            :         rho2_, and rcomma_.
      41                 :            : 
      42                 :            :     - Must define the static function _type()_, returning the enum value of the
      43                 :            :       policy option. Example:
      44                 :            :       \code{.cpp}
      45                 :            :         static ctr::CoeffPolicyType type() noexcept {
      46                 :            :           return ctr::CoeffPolicyType::DECAY;
      47                 :            :         }
      48                 :            :       \endcode
      49                 :            :       which returns the enum value of the option from the underlying option
      50                 :            :       class, collecting all possible options for coefficients policies.
      51                 :            : 
      52                 :            :     - Must define the function _update()_, called from
      53                 :            :       MixNumberFractionBeta::advance(), updating the model coefficients.
      54                 :            :       Required signature:
      55                 :            :       \code{.cpp}
      56                 :            :         void update(
      57                 :            :           char depvar,
      58                 :            :           ncomp_t ncomp,
      59                 :            :           const std::map< tk::ctr::Product, tk::real >& moments,
      60                 :            :           const std::vector< kw::sde_bprime::info::expect::type  >& bprime,
      61                 :            :           const std::vector< kw::sde_kappaprime::info::expect::type >& kprime,
      62                 :            :           std::vector< kw::sde_b::info::expect::type  >& b,
      63                 :            :           std::vector< kw::sde_kappa::info::expect::type >& k ) const {}
      64                 :            :       \endcode
      65                 :            :       where _depvar_ is the dependent variable associated with the mix
      66                 :            :       number-fraction beta SDE, specified in the control file by the user, _ncomp_ is
      67                 :            :       the number of components in the system, _moments_ is the map associating
      68                 :            :       moment IDs (tk::ctr::vector< tk::ctr::Term >) to values of statistical
      69                 :            :       moments, _bprime_, _kprime_ are user-defined parameters, and _b_, _k_ are
      70                 :            :       the SDE parameters computed, see DiffEq/MixNumberFractionBeta.h.
      71                 :            : */
      72                 :            : // *****************************************************************************
      73                 :            : #ifndef MixNumberFractionBetaCoeffPolicy_h
      74                 :            : #define MixNumberFractionBetaCoeffPolicy_h
      75                 :            : 
      76                 :            : #include <brigand/sequences/list.hpp>
      77                 :            : 
      78                 :            : #include "Types.hpp"
      79                 :            : #include "Walker/Options/CoeffPolicy.hpp"
      80                 :            : #include "SystemComponents.hpp"
      81                 :            : 
      82                 :            : namespace walker {
      83                 :            : 
      84                 :            : //! \brief Mix number-fraction beta SDE decay coefficients policity.
      85                 :            : //! \details User-defined parameters b' and kappa' are constants in time and
      86                 :            : //!   ensure decay in the evolution of <x^2>.
      87                 :            : class MixNumFracBetaCoeffDecay {
      88                 :            : 
      89                 :            :     using ncomp_t = kw::ncomp::info::expect::type;
      90                 :            : 
      91                 :            :   public:
      92                 :            :     //! Constructor: initialize coefficients
      93                 :            :     MixNumFracBetaCoeffDecay(
      94                 :            :       ncomp_t ncomp,
      95                 :            :       const std::vector< kw::sde_bprime::info::expect::type >& bprime_,
      96                 :            :       const std::vector< kw::sde_S::info::expect::type >& S_,
      97                 :            :       const std::vector< kw::sde_kappaprime::info::expect::type >& kprime_,
      98                 :            :       const std::vector< kw::sde_rho2::info::expect::type >& rho2_,
      99                 :            :       const std::vector< kw::sde_rcomma::info::expect::type >& rcomma_,
     100                 :            :       std::vector< kw::sde_bprime::info::expect::type  >& bprime,
     101                 :            :       std::vector< kw::sde_S::info::expect::type >& S,
     102                 :            :       std::vector< kw::sde_kappaprime::info::expect::type >& kprime,
     103                 :            :       std::vector< kw::sde_rho2::info::expect::type >& rho2,
     104                 :            :       std::vector< kw::sde_rcomma::info::expect::type >& rcomma,
     105                 :            :       std::vector< kw::sde_b::info::expect::type  >& b,
     106                 :            :       std::vector< kw::sde_kappa::info::expect::type >& k );
     107                 :            : 
     108                 :            :     //! Coefficients policy type accessor
     109                 :       2992 :     static ctr::CoeffPolicyType type() noexcept
     110                 :       2992 :     { return ctr::CoeffPolicyType::DECAY; }
     111                 :            : 
     112                 :            :     //! \brief Update coefficients
     113                 :            :     void update(
     114                 :            :       char depvar,
     115                 :            :       ncomp_t ncomp,
     116                 :            :       const std::map< tk::ctr::Product, tk::real >& moments,
     117                 :            :       const std::vector< kw::sde_bprime::info::expect::type  >& bprime,
     118                 :            :       const std::vector< kw::sde_kappaprime::info::expect::type >& kprime,
     119                 :            :       std::vector< kw::sde_b::info::expect::type  >& b,
     120                 :            :       std::vector< kw::sde_kappa::info::expect::type >& k ) const;
     121                 :            : };
     122                 :            : 
     123                 :            : //! List of all mix numberf-fraction beta's coefficients policies
     124                 :            : using MixNumFracBetaCoeffPolicies =
     125                 :            :   brigand::list< MixNumFracBetaCoeffDecay >;
     126                 :            : 
     127                 :            : } // walker::
     128                 :            : 
     129                 :            : #endif // MixNumberFractionBetaCoeffPolicy_h

Generated by: LCOV version 1.14