LCOV - code coverage report
Current view: top level - src/bcs - PorousFlowPiecewiseLinearSink.C (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 18 18 100.0 %
Date: 2017-11-20 14:50:56 Functions: 6 6 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /****************************************************************/
       2             : /* MOOSE - Multiphysics Object Oriented Simulation Environment  */
       3             : /*                                                              */
       4             : /*          All contents are licensed under LGPL V2.1           */
       5             : /*             See LICENSE for full restrictions                */
       6             : /****************************************************************/
       7             : 
       8             : #include "PorousFlowPiecewiseLinearSink.h"
       9             : 
      10             : template <>
      11             : InputParameters
      12          28 : validParams<PorousFlowPiecewiseLinearSink>()
      13             : {
      14          28 :   InputParameters params = validParams<PorousFlowSinkPTDefiner>();
      15          84 :   params.addRequiredParam<std::vector<Real>>(
      16             :       "pt_vals",
      17             :       "Tuple of pressure values (for the fluid_phase specified).  Must be monotonically "
      18             :       "increasing.  For heat fluxes that don't involve fluids, these are temperature "
      19          28 :       "values");
      20          84 :   params.addRequiredParam<std::vector<Real>>(
      21          28 :       "multipliers", "Tuple of multiplying values.  The flux values are multiplied by these.");
      22          56 :   params.addClassDescription("Applies a flux sink to a boundary. The base flux defined by "
      23          28 :                              "PorousFlowSink is multiplied by a piecewise linear function.");
      24          28 :   return params;
      25             : }
      26             : 
      27          28 : PorousFlowPiecewiseLinearSink::PorousFlowPiecewiseLinearSink(const InputParameters & parameters)
      28             :   : PorousFlowSinkPTDefiner(parameters),
      29         140 :     _sink_func(getParam<std::vector<Real>>("pt_vals"), getParam<std::vector<Real>>("multipliers"))
      30             : {
      31          28 : }
      32             : 
      33             : Real
      34      454096 : PorousFlowPiecewiseLinearSink::multiplier() const
      35             : {
      36      454096 :   return PorousFlowSink::multiplier() * _sink_func.sample(ptVar());
      37             : }
      38             : 
      39             : Real
      40       23712 : PorousFlowPiecewiseLinearSink::dmultiplier_dvar(unsigned int pvar) const
      41             : {
      42       23712 :   return PorousFlowSink::dmultiplier_dvar(pvar) * _sink_func.sample(ptVar()) +
      43       23712 :          PorousFlowSink::multiplier() * _sink_func.sampleDerivative(ptVar()) * dptVar(pvar);
      44        2499 : }

Generated by: LCOV version 1.11