LCOV - code coverage report
Current view: top level - src/materials - PorousFlowTemperature.C (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 40 40 100.0 %
Date: 2017-11-21 14:47:27 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 "PorousFlowTemperature.h"
       9             : 
      10             : template <>
      11             : InputParameters
      12         350 : validParams<PorousFlowTemperature>()
      13             : {
      14         350 :   InputParameters params = validParams<PorousFlowMaterial>();
      15        1050 :   params.addCoupledVar("temperature", 20.0, "Fluid temperature variable");
      16         700 :   params.addClassDescription("Material to provide temperature at the quadpoints or nodes and "
      17         350 :                              "derivatives of it with respect to the PorousFlow variables");
      18         350 :   return params;
      19             : }
      20             : 
      21        1050 : PorousFlowTemperature::PorousFlowTemperature(const InputParameters & parameters)
      22             :   : DerivativeMaterialInterface<PorousFlowMaterial>(parameters),
      23             : 
      24        1050 :     _num_pf_vars(_dictator.numVariables()),
      25        3150 :     _temperature_var(_nodal_material ? coupledNodalValue("temperature")
      26        1992 :                                      : coupledValue("temperature")),
      27        2571 :     _grad_temperature_var(_nodal_material ? nullptr : &coupledGradient("temperature")),
      28        2100 :     _temperature_is_PF(_dictator.isPorousFlowVariable(coupled("temperature"))),
      29        2301 :     _t_var_num(_temperature_is_PF ? _dictator.porousFlowVariableNum(coupled("temperature")) : 0),
      30             : 
      31        3150 :     _temperature(_nodal_material ? declareProperty<Real>("PorousFlow_temperature_nodal")
      32        1992 :                                  : declareProperty<Real>("PorousFlow_temperature_qp")),
      33             :     _dtemperature_dvar(
      34        3150 :         _nodal_material ? declareProperty<std::vector<Real>>("dPorousFlow_temperature_nodal_dvar")
      35        1992 :                         : declareProperty<std::vector<Real>>("dPorousFlow_temperature_qp_dvar")),
      36        1050 :     _grad_temperature(_nodal_material
      37        1521 :                           ? nullptr
      38        1992 :                           : &declareProperty<RealGradient>("PorousFlow_grad_temperature_qp")),
      39        1521 :     _dgrad_temperature_dgradv(_nodal_material ? nullptr
      40             :                                               : &declareProperty<std::vector<Real>>(
      41        1992 :                                                     "dPorousFlow_grad_temperature_qp_dgradvar")),
      42        1521 :     _dgrad_temperature_dv(_nodal_material ? nullptr
      43             :                                           : &declareProperty<std::vector<RealGradient>>(
      44       12492 :                                                 "dPorousFlow_grad_temperature_qp_dvar"))
      45             : {
      46        1050 : }
      47             : 
      48             : void
      49      153712 : PorousFlowTemperature::initQpStatefulProperties()
      50             : {
      51      461136 :   _temperature[_qp] = _temperature_var[_qp];
      52      153712 : }
      53             : 
      54             : void
      55     8005406 : PorousFlowTemperature::computeQpProperties()
      56             : {
      57    24016218 :   _temperature[_qp] = _temperature_var[_qp];
      58    16010812 :   _dtemperature_dvar[_qp].assign(_num_pf_vars, 0.0);
      59     8005406 :   if (_temperature_is_PF)
      60             :     // _temperature is a PorousFlow variable
      61      665424 :     _dtemperature_dvar[_qp][_t_var_num] = 1.0;
      62             : 
      63     8005406 :   if (!_nodal_material)
      64             :   {
      65    12013476 :     (*_grad_temperature)[_qp] = (*_grad_temperature_var)[_qp];
      66     8008984 :     (*_dgrad_temperature_dgradv)[_qp].assign(_num_pf_vars, 0.0);
      67     8008984 :     (*_dgrad_temperature_dv)[_qp].assign(_num_pf_vars, RealGradient());
      68     4004492 :     if (_temperature_is_PF)
      69      403624 :       (*_dgrad_temperature_dgradv)[_qp][_t_var_num] = 1.0;
      70             :   }
      71     8007905 : }

Generated by: LCOV version 1.11