LCOV - code coverage report
Current view: top level - src/variables - MooseLinearVariableFV.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #33416 (b10b36) with base 9fbd27 Lines: 169 366 46.2 %
Date: 2026-07-23 16:15:30 Functions: 31 111 27.9 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #include "MooseLinearVariableFV.h"
      11             : #include "TimeIntegrator.h"
      12             : #include "NonlinearSystemBase.h"
      13             : #include "DisplacedSystem.h"
      14             : #include "SystemBase.h"
      15             : #include "LinearSystem.h"
      16             : #include "AuxiliarySystem.h"
      17             : #include "SubProblem.h"
      18             : #include "Assembly.h"
      19             : #include "MathFVUtils.h"
      20             : #include "FVUtils.h"
      21             : #include "FVFluxBC.h"
      22             : #include "FVDirichletBCBase.h"
      23             : #include "GreenGaussGradient.h"
      24             : #include "LinearFVBoundaryCondition.h"
      25             : #include "LinearFVAdvectionDiffusionFunctorDirichletBC.h"
      26             : #include "GradientLimiterType.h"
      27             : 
      28             : #include "libmesh/numeric_vector.h"
      29             : 
      30             : #include <climits>
      31             : #include <typeinfo>
      32             : 
      33             : using namespace Moose;
      34             : 
      35             : registerMooseObject("MooseApp", MooseLinearVariableFVReal);
      36             : 
      37             : namespace
      38             : {
      39             : const std::vector<std::unique_ptr<libMesh::NumericVector<libMesh::Number>>> &
      40        1505 : linearFVGradientContainer(SystemBase & sys)
      41             : {
      42        1505 :   if (auto * const linear_system = dynamic_cast<LinearSystem *>(&sys))
      43        1264 :     return linear_system->linearFVGradientContainer();
      44             : 
      45         241 :   if (auto * const auxiliary_system = dynamic_cast<AuxiliarySystem *>(&sys))
      46         241 :     return auxiliary_system->linearFVGradientContainer();
      47             : 
      48           0 :   mooseError("The assigned system is not a linear or an auxiliary system. Linear variables can "
      49             :              "only be assigned to linear or auxiliary systems.");
      50             : }
      51             : }
      52             : 
      53             : template <typename OutputType>
      54             : InputParameters
      55        6099 : MooseLinearVariableFV<OutputType>::validParams()
      56             : {
      57        6099 :   InputParameters params = MooseVariableField<OutputType>::validParams();
      58       12198 :   params.set<bool>("fv") = true;
      59       24396 :   params.set<MooseEnum>("family") = "MONOMIAL";
      60       18297 :   params.set<MooseEnum>("order") = "CONSTANT";
      61        6099 :   return params;
      62           0 : }
      63             : 
      64             : template <typename OutputType>
      65        1505 : MooseLinearVariableFV<OutputType>::MooseLinearVariableFV(const InputParameters & parameters)
      66             :   : MooseVariableField<OutputType>(parameters),
      67        1505 :     _needs_cell_gradients(false),
      68        1505 :     _linear_system(dynamic_cast<LinearSystem *>(&this->_sys)),
      69        1505 :     _auxiliary_system(dynamic_cast<AuxiliarySystem *>(&this->_sys)),
      70        1505 :     _grad_container(linearFVGradientContainer(this->_sys)),
      71        1505 :     _sys_num(this->_sys.number()),
      72        1505 :     _solution(this->_sys.currentSolution()),
      73             :     // The following members are needed to be able to interface with the postprocessor and
      74             :     // auxiliary systems
      75        1505 :     _phi(this->_assembly.template fePhi<OutputShape>(FEType(CONSTANT, MONOMIAL))),
      76        1505 :     _grad_phi(this->_assembly.template feGradPhi<OutputShape>(FEType(CONSTANT, MONOMIAL))),
      77        1505 :     _phi_face(this->_assembly.template fePhiFace<OutputShape>(FEType(CONSTANT, MONOMIAL))),
      78        1505 :     _grad_phi_face(this->_assembly.template feGradPhiFace<OutputShape>(FEType(CONSTANT, MONOMIAL))),
      79        1505 :     _phi_face_neighbor(
      80        1505 :         this->_assembly.template fePhiFaceNeighbor<OutputShape>(FEType(CONSTANT, MONOMIAL))),
      81        1505 :     _grad_phi_face_neighbor(
      82        1505 :         this->_assembly.template feGradPhiFaceNeighbor<OutputShape>(FEType(CONSTANT, MONOMIAL))),
      83        1505 :     _phi_neighbor(this->_assembly.template fePhiNeighbor<OutputShape>(FEType(CONSTANT, MONOMIAL))),
      84        1505 :     _grad_phi_neighbor(
      85        4515 :         this->_assembly.template feGradPhiNeighbor<OutputShape>(FEType(CONSTANT, MONOMIAL)))
      86             : {
      87        1505 :   if (!_linear_system && !_auxiliary_system)
      88           0 :     this->paramError("solver_sys",
      89             :                      "The assigned system is not a linear or an auxiliary system! Linear variables "
      90             :                      "can only be assigned to linear or auxiliary systems!");
      91        1505 :   _element_data = std::make_unique<MooseVariableDataLinearFV<OutputType>>(
      92        1505 :       *this, _sys, _tid, Moose::ElementType::Element, this->_assembly.elem());
      93        1505 :   _neighbor_data = std::make_unique<MooseVariableDataLinearFV<OutputType>>(
      94        1505 :       *this, _sys, _tid, Moose::ElementType::Neighbor, this->_assembly.neighbor());
      95             : 
      96        1505 :   if (libMesh::n_threads() > 1)
      97           0 :     mooseError("MooseLinearVariableFV does not support threading at the moment!");
      98        1505 : }
      99             : 
     100             : template <typename OutputType>
     101             : void
     102         189 : MooseLinearVariableFV<OutputType>::computeCellGradients(
     103             :     const Moose::FV::GradientLimiterType limiter_type)
     104             : {
     105         189 :   if (limiter_type == Moose::FV::GradientLimiterType::None)
     106         126 :     computeCellGradients();
     107             :   else
     108          63 :     computeCellLimitedGradients(limiter_type);
     109         189 : }
     110             : 
     111             : template <typename OutputType>
     112             : void
     113          63 : MooseLinearVariableFV<OutputType>::computeCellLimitedGradients(
     114             :     const Moose::FV::GradientLimiterType limiter_type)
     115             : {
     116          63 :   computeCellGradients();
     117             : 
     118          63 :   if (_linear_system)
     119          63 :     _linear_system->requestLinearFVLimitedGradients(limiter_type, this->_var_num);
     120             :   else
     121           0 :     _auxiliary_system->requestLinearFVLimitedGradients(limiter_type, this->_var_num);
     122          63 : }
     123             : 
     124             : template <typename OutputType>
     125             : bool
     126           0 : MooseLinearVariableFV<OutputType>::isExtrapolatedBoundaryFace(
     127             :     const FaceInfo & /*fi*/, const Elem * const /*elem*/, const Moose::StateArg & /*state*/) const
     128             : {
     129             :   /// This is not used by this variable at this point.
     130           0 :   return false;
     131             : }
     132             : 
     133             : template <typename OutputType>
     134             : Real
     135   108438804 : MooseLinearVariableFV<OutputType>::getElemValue(const ElemInfo & elem_info,
     136             :                                                 const StateArg & state) const
     137             : {
     138             :   mooseAssert(
     139             :       this->hasBlocks(elem_info.subdomain_id()),
     140             :       "The variable should be defined on the element's subdomain! This typically occurs when the "
     141             :       "user wants to evaluate the elements right next to the boundary of two variables (block "
     142             :       "boundary). The subdomain which is queried: " +
     143             :           Moose::stringify(this->activeSubdomains()) + " the subdomain of the element " +
     144             :           std::to_string(elem_info.subdomain_id()));
     145             : 
     146             :   // It's not safe to use solutionState(0) because it returns the libMesh System solution member
     147             :   // which is wrong during things like finite difference Jacobian evaluation, e.g. when PETSc
     148             :   // perturbs the solution vector we feed these perturbations into the current_local_solution
     149             :   // while the libMesh solution is frozen in the non-perturbed state
     150   216877608 :   const auto & global_soln = (state.state == 0)
     151   108438804 :                                  ? *this->_sys.currentSolution()
     152           0 :                                  : this->_sys.solutionState(state.state, state.iteration_type);
     153             : 
     154   108438804 :   return global_soln(elem_info.dofIndices()[this->_sys_num][this->_var_num]);
     155             : }
     156             : 
     157             : template <typename OutputType>
     158             : VectorValue<Real>
     159    44290939 : MooseLinearVariableFV<OutputType>::gradSln(const ElemInfo & elem_info, const StateArg & state) const
     160             : {
     161    44290939 :   if (state.state != 0)
     162           0 :     gradientStateError(state);
     163             : 
     164    44290939 :   if (_needs_cell_gradients)
     165             :   {
     166    44290939 :     _cell_gradient.zero();
     167   132801952 :     for (const auto i : make_range(this->_mesh.dimension()))
     168    88511013 :       _cell_gradient(i) =
     169    88511013 :           (*_grad_container[i])(elem_info.dofIndices()[this->_sys_num][this->_var_num]);
     170             :   }
     171             : 
     172    44290939 :   return _cell_gradient;
     173             : }
     174             : 
     175             : template <typename OutputType>
     176             : Real
     177           0 : MooseLinearVariableFV<OutputType>::gradSlnComponent(const ElemInfo & elem_info,
     178             :                                                     const unsigned int component) const
     179             : {
     180             :   mooseAssert(_needs_cell_gradients,
     181             :               "Gradient component requested without calling computeCellGradients().");
     182             :   mooseAssert(component < _grad_container.size(), "Gradient component index out of range.");
     183             : 
     184           0 :   return (*_grad_container[component])(elem_info.dofIndices()[this->_sys_num][this->_var_num]);
     185             : }
     186             : 
     187             : template <typename OutputType>
     188             : VectorValue<Real>
     189    69863250 : MooseLinearVariableFV<OutputType>::gradSln(const ElemInfo & elem_info,
     190             :                                            const StateArg & state,
     191             :                                            const Moose::FV::GradientLimiterType limiter_type) const
     192             : {
     193             :   return (limiter_type == Moose::FV::GradientLimiterType::None)
     194    69863250 :              ? gradSln(elem_info, state)
     195    69863250 :              : limitedGradSln(elem_info, state, limiter_type);
     196             : }
     197             : 
     198             : template <typename OutputType>
     199             : VectorValue<Real>
     200    27799250 : MooseLinearVariableFV<OutputType>::limitedGradSln(
     201             :     const ElemInfo & elem_info,
     202             :     const StateArg & state,
     203             :     const Moose::FV::GradientLimiterType limiter_type) const
     204             : {
     205    27799250 :   if (state.state != 0)
     206           0 :     gradientStateError(state);
     207             : 
     208    27799250 :   _cell_gradient.zero();
     209    27799250 :   const auto & limited_grad_container =
     210    27799250 :       _linear_system ? _linear_system->linearFVLimitedGradientContainer(limiter_type)
     211           0 :                      : _auxiliary_system->linearFVLimitedGradientContainer(limiter_type);
     212    83363550 :   for (const auto i : make_range(this->_mesh.dimension()))
     213    55564300 :     _cell_gradient(i) =
     214    55564300 :         (*limited_grad_container[i])(elem_info.dofIndices()[this->_sys_num][this->_var_num]);
     215             : 
     216    27799250 :   return _cell_gradient;
     217             : }
     218             : 
     219             : template <typename OutputType>
     220             : VectorValue<Real>
     221         140 : MooseLinearVariableFV<OutputType>::gradSln(const FaceInfo & fi, const StateArg & state) const
     222             : {
     223         140 :   const auto face_type = fi.faceType(std::make_pair(this->_var_num, this->_sys_num));
     224             :   mooseAssert(face_type != FaceInfo::VarFaceNeighbors::NEITHER,
     225             :               "Gradient requested on a face where the variable is defined on neither side.");
     226             : 
     227         140 :   const bool var_defined_on_elem = (face_type == FaceInfo::VarFaceNeighbors::BOTH) ||
     228             :                                    (face_type == FaceInfo::VarFaceNeighbors::ELEM);
     229         140 :   const auto * const elem_one = var_defined_on_elem ? fi.elemInfo() : fi.neighborInfo();
     230         140 :   const auto * const elem_two = var_defined_on_elem ? fi.neighborInfo() : fi.elemInfo();
     231             : 
     232         140 :   const auto elem_one_grad = gradSln(*elem_one, state);
     233             : 
     234             :   // If we have a neighbor then we interpolate between the two to the face.
     235         140 :   if (face_type == FaceInfo::VarFaceNeighbors::BOTH)
     236             :   {
     237             :     mooseAssert(elem_two, "Face type indicates BOTH but neighbor information is missing.");
     238           0 :     const auto elem_two_grad = gradSln(*elem_two, state);
     239           0 :     return Moose::FV::linearInterpolation(elem_one_grad, elem_two_grad, fi, var_defined_on_elem);
     240             :   }
     241             :   else
     242         140 :     return elem_one_grad;
     243             : }
     244             : 
     245             : template <typename OutputType>
     246             : VectorValue<Real>
     247           0 : MooseLinearVariableFV<OutputType>::gradSln(const FaceInfo & fi,
     248             :                                            const StateArg & state,
     249             :                                            const Moose::FV::GradientLimiterType limiter_type) const
     250             : {
     251             :   return (limiter_type == Moose::FV::GradientLimiterType::None)
     252           0 :              ? gradSln(fi, state)
     253           0 :              : limitedGradSln(fi, state, limiter_type);
     254             : }
     255             : 
     256             : template <typename OutputType>
     257             : VectorValue<Real>
     258           0 : MooseLinearVariableFV<OutputType>::limitedGradSln(
     259             :     const FaceInfo & fi,
     260             :     const StateArg & state,
     261             :     const Moose::FV::GradientLimiterType limiter_type) const
     262             : {
     263           0 :   const auto face_type = fi.faceType(std::make_pair(this->_var_num, this->_sys_num));
     264             :   mooseAssert(face_type != FaceInfo::VarFaceNeighbors::NEITHER,
     265             :               "Limited gradient requested on a face where the variable is defined on neither "
     266             :               "side.");
     267             : 
     268           0 :   const bool var_defined_on_elem = (face_type == FaceInfo::VarFaceNeighbors::BOTH) ||
     269             :                                    (face_type == FaceInfo::VarFaceNeighbors::ELEM);
     270           0 :   const auto * const elem_one = var_defined_on_elem ? fi.elemInfo() : fi.neighborInfo();
     271           0 :   const auto * const elem_two = var_defined_on_elem ? fi.neighborInfo() : fi.elemInfo();
     272             : 
     273           0 :   const auto elem_one_grad = limitedGradSln(*elem_one, state, limiter_type);
     274             : 
     275           0 :   if (face_type == FaceInfo::VarFaceNeighbors::BOTH)
     276             :   {
     277             :     mooseAssert(elem_two, "Face type indicates BOTH but neighbor information is missing.");
     278           0 :     const auto elem_two_grad = limitedGradSln(*elem_two, state, limiter_type);
     279           0 :     return Moose::FV::linearInterpolation(elem_one_grad, elem_two_grad, fi, var_defined_on_elem);
     280             :   }
     281             :   else
     282           0 :     return elem_one_grad;
     283             : }
     284             : 
     285             : template <typename OutputType>
     286             : void
     287        1487 : MooseLinearVariableFV<OutputType>::initialSetup()
     288             : {
     289        1487 :   MooseVariableField<OutputType>::initialSetup();
     290        1487 :   cacheBoundaryBCMap();
     291        1487 : }
     292             : 
     293             : template <typename OutputType>
     294             : void
     295        1637 : MooseLinearVariableFV<OutputType>::timestepSetup()
     296             : {
     297        1637 :   MooseVariableField<OutputType>::timestepSetup();
     298        1637 :   cacheBoundaryBCMap();
     299        1637 : }
     300             : 
     301             : template <typename OutputType>
     302             : typename MooseLinearVariableFV<OutputType>::ValueType
     303        1568 : MooseLinearVariableFV<OutputType>::evaluate(const FaceArg & face, const StateArg & state) const
     304             : {
     305        1568 :   const FaceInfo * const fi = face.fi;
     306             : 
     307             :   mooseAssert(fi, "The face information must be non-null");
     308             : 
     309        1568 :   const auto face_type = fi->faceType(std::make_pair(this->_var_num, this->_sys_num));
     310             : 
     311        1568 :   if (face_type == FaceInfo::VarFaceNeighbors::BOTH)
     312          14 :     return Moose::FV::interpolate(*this, face, state);
     313        1554 :   else if (auto * bc_pointer = this->getBoundaryCondition(*fi->boundaryIDs().begin()))
     314             :   {
     315             :     mooseAssert(fi->boundaryIDs().size() == 1, "We should only have one boundary on every face.");
     316        1547 :     bc_pointer->setupFaceData(fi, face_type);
     317        1547 :     return bc_pointer->computeBoundaryValue();
     318             :   }
     319             :   // If no boundary condition is defined but we are evaluating on a boundary, just return the
     320             :   // element value
     321           7 :   else if (face_type == FaceInfo::VarFaceNeighbors::ELEM)
     322             :   {
     323           7 :     const auto & elem_info = this->_mesh.elemInfo(fi->elemPtr()->id());
     324           7 :     return getElemValue(elem_info, state);
     325             :   }
     326           0 :   else if (face_type == FaceInfo::VarFaceNeighbors::NEIGHBOR)
     327             :   {
     328           0 :     const auto & elem_info = this->_mesh.elemInfo(fi->neighborPtr()->id());
     329           0 :     return getElemValue(elem_info, state);
     330             :   }
     331             :   else
     332           0 :     mooseError("We should never get here!");
     333             : }
     334             : 
     335             : template <typename OutputType>
     336             : typename MooseLinearVariableFV<OutputType>::ValueType
     337           0 : MooseLinearVariableFV<OutputType>::evaluate(const NodeArg & /*node_arg*/,
     338             :                                             const StateArg & /*state*/) const
     339             : {
     340           0 :   mooseError("Not implemented yet");
     341             : }
     342             : 
     343             : template <typename OutputType>
     344             : typename MooseLinearVariableFV<OutputType>::DotType
     345             : MooseLinearVariableFV<OutputType>::evaluateDot(const ElemArg &, const StateArg &) const
     346             : {
     347             :   timeIntegratorError();
     348             : }
     349             : 
     350             : template <>
     351             : ADReal
     352           0 : MooseLinearVariableFV<Real>::evaluateDot(const ElemArg & /*elem_arg*/,
     353             :                                          const StateArg & /*state*/) const
     354             : {
     355           0 :   timeIntegratorError();
     356             : }
     357             : 
     358             : template <typename OutputType>
     359             : void
     360        3124 : MooseLinearVariableFV<OutputType>::cacheBoundaryBCMap()
     361             : {
     362        3124 :   _boundary_id_to_bc.clear();
     363        3124 :   std::vector<LinearFVBoundaryCondition *> bcs;
     364             : 
     365             :   // I believe because query() returns by value but condition returns by reference that binding to a
     366             :   // const lvalue reference results in the query() getting destructed and us holding onto a dangling
     367             :   // reference. I think that condition returned by value we would be able to bind to a const lvalue
     368             :   // reference here. But as it is we'll bind to a regular lvalue
     369        3124 :   auto base_query = this->_subproblem.getMooseApp()
     370        3124 :                         .theWarehouse()
     371             :                         .query()
     372        3124 :                         .template condition<AttribSystem>("LinearFVBoundaryCondition")
     373        3124 :                         .template condition<AttribThread>(_tid)
     374        3124 :                         .template condition<AttribVar>(_var_num)
     375        3124 :                         .template condition<AttribSysNum>(this->_sys.number());
     376             : 
     377       12851 :   for (const auto bnd_id : this->_mesh.getBoundaryIDs())
     378             :   {
     379        9727 :     auto base_query_copy = base_query;
     380       19454 :     base_query_copy.template condition<AttribBoundaries>(std::set<BoundaryID>({bnd_id}))
     381        9727 :         .queryInto(bcs);
     382             :     mooseAssert(bcs.size() <= 1, "cannot have multiple BCs on the same boundary");
     383        9727 :     if (!bcs.empty())
     384        6887 :       _boundary_id_to_bc.emplace(bnd_id, bcs[0]);
     385             :   }
     386        3124 : }
     387             : 
     388             : template <typename OutputType>
     389             : LinearFVBoundaryCondition *
     390     4964358 : MooseLinearVariableFV<OutputType>::getBoundaryCondition(const BoundaryID bd_id) const
     391             : {
     392     4964358 :   const auto iter = _boundary_id_to_bc.find(bd_id);
     393     4964358 :   if (iter == _boundary_id_to_bc.end())
     394       23367 :     return nullptr;
     395             :   else
     396     4940991 :     return iter->second;
     397             : }
     398             : 
     399             : template <typename OutputType>
     400             : const Elem * const &
     401           0 : MooseLinearVariableFV<OutputType>::currentElem() const
     402             : {
     403           0 :   return this->_assembly.elem();
     404             : }
     405             : 
     406             : template <typename OutputType>
     407             : bool
     408           0 : MooseLinearVariableFV<OutputType>::isDirichletBoundaryFace(const FaceInfo & fi) const
     409             : {
     410           0 :   for (const auto bnd_id : fi.boundaryIDs())
     411           0 :     if (auto it = _boundary_id_to_bc.find(bnd_id); it != _boundary_id_to_bc.end())
     412           0 :       if (dynamic_cast<LinearFVAdvectionDiffusionFunctorDirichletBC *>(it->second))
     413           0 :         return true;
     414             : 
     415           0 :   return false;
     416             : }
     417             : 
     418             : // ****************************************************************************
     419             : // The functions below are used for interfacing the auxiliary and
     420             : // postprocessor/userobject systems. Most of the postprocessors/
     421             : // auxkernels require quadrature-based evaluations and we provide that
     422             : // interface with the functions below.
     423             : // ****************************************************************************
     424             : 
     425             : template <typename OutputType>
     426             : void
     427           0 : MooseLinearVariableFV<OutputType>::getDofIndices(const Elem * elem,
     428             :                                                  std::vector<dof_id_type> & dof_indices) const
     429             : {
     430           0 :   dof_indices.clear();
     431           0 :   const auto & elem_info = this->_mesh.elemInfo(elem->id());
     432           0 :   dof_indices.push_back(elem_info.dofIndices()[this->_sys_num][this->number()]);
     433           0 : }
     434             : 
     435             : template <typename OutputType>
     436             : void
     437         648 : MooseLinearVariableFV<OutputType>::setDofValue(const DofValue & value, unsigned int index)
     438             : {
     439         648 :   _element_data->setDofValue(value, index);
     440         648 : }
     441             : 
     442             : template <typename OutputType>
     443             : void
     444         126 : MooseLinearVariableFV<OutputType>::setDofValues(const DenseVector<DofValue> & values)
     445             : {
     446         126 :   _element_data->setDofValues(values);
     447         126 : }
     448             : 
     449             : template <typename OutputType>
     450             : void
     451       14577 : MooseLinearVariableFV<OutputType>::clearDofIndices()
     452             : {
     453       14577 :   _element_data->clearDofIndices();
     454       14577 : }
     455             : 
     456             : template <typename OutputType>
     457             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     458           0 : MooseLinearVariableFV<OutputType>::dofValues() const
     459             : {
     460           0 :   return _element_data->dofValues();
     461             : }
     462             : 
     463             : template <typename OutputType>
     464             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     465           0 : MooseLinearVariableFV<OutputType>::dofValuesNeighbor() const
     466             : {
     467           0 :   return _neighbor_data->dofValues();
     468             : }
     469             : 
     470             : template <typename OutputType>
     471             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     472           0 : MooseLinearVariableFV<OutputType>::dofValuesOld() const
     473             : {
     474           0 :   return _element_data->dofValuesOld();
     475             : }
     476             : 
     477             : template <typename OutputType>
     478             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     479           0 : MooseLinearVariableFV<OutputType>::dofValuesOlder() const
     480             : {
     481           0 :   return _element_data->dofValuesOlder();
     482             : }
     483             : 
     484             : template <typename OutputType>
     485             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     486           0 : MooseLinearVariableFV<OutputType>::dofValuesPreviousNL() const
     487             : {
     488           0 :   return _element_data->dofValuesPreviousNL();
     489             : }
     490             : 
     491             : template <typename OutputType>
     492             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     493           0 : MooseLinearVariableFV<OutputType>::dofValuesOldNeighbor() const
     494             : {
     495           0 :   return _neighbor_data->dofValuesOld();
     496             : }
     497             : 
     498             : template <typename OutputType>
     499             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     500           0 : MooseLinearVariableFV<OutputType>::dofValuesOlderNeighbor() const
     501             : {
     502           0 :   return _neighbor_data->dofValuesOlder();
     503             : }
     504             : 
     505             : template <typename OutputType>
     506             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     507           0 : MooseLinearVariableFV<OutputType>::dofValuesPreviousNLNeighbor() const
     508             : {
     509           0 :   return _neighbor_data->dofValuesPreviousNL();
     510             : }
     511             : 
     512             : template <typename OutputType>
     513             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     514           0 : MooseLinearVariableFV<OutputType>::dofValuesDot() const
     515             : {
     516           0 :   timeIntegratorError();
     517             : }
     518             : 
     519             : template <typename OutputType>
     520             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     521           0 : MooseLinearVariableFV<OutputType>::dofValuesDotDot() const
     522             : {
     523           0 :   timeIntegratorError();
     524             : }
     525             : 
     526             : template <typename OutputType>
     527             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     528           0 : MooseLinearVariableFV<OutputType>::dofValuesDotOld() const
     529             : {
     530           0 :   timeIntegratorError();
     531             : }
     532             : 
     533             : template <typename OutputType>
     534             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     535           0 : MooseLinearVariableFV<OutputType>::dofValuesDotDotOld() const
     536             : {
     537           0 :   timeIntegratorError();
     538             : }
     539             : 
     540             : template <typename OutputType>
     541             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     542           0 : MooseLinearVariableFV<OutputType>::dofValuesDotNeighbor() const
     543             : {
     544           0 :   timeIntegratorError();
     545             : }
     546             : 
     547             : template <typename OutputType>
     548             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     549           0 : MooseLinearVariableFV<OutputType>::dofValuesDotDotNeighbor() const
     550             : {
     551           0 :   timeIntegratorError();
     552             : }
     553             : 
     554             : template <typename OutputType>
     555             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     556           0 : MooseLinearVariableFV<OutputType>::dofValuesDotOldNeighbor() const
     557             : {
     558           0 :   timeIntegratorError();
     559             : }
     560             : 
     561             : template <typename OutputType>
     562             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     563           0 : MooseLinearVariableFV<OutputType>::dofValuesDotDotOldNeighbor() const
     564             : {
     565           0 :   timeIntegratorError();
     566             : }
     567             : 
     568             : template <typename OutputType>
     569             : const MooseArray<Number> &
     570           0 : MooseLinearVariableFV<OutputType>::dofValuesDuDotDu() const
     571             : {
     572           0 :   timeIntegratorError();
     573             : }
     574             : 
     575             : template <typename OutputType>
     576             : const MooseArray<Number> &
     577           0 : MooseLinearVariableFV<OutputType>::dofValuesDuDotDotDu() const
     578             : {
     579           0 :   timeIntegratorError();
     580             : }
     581             : 
     582             : template <typename OutputType>
     583             : const MooseArray<Number> &
     584           0 : MooseLinearVariableFV<OutputType>::dofValuesDuDotDuNeighbor() const
     585             : {
     586           0 :   timeIntegratorError();
     587             : }
     588             : 
     589             : template <typename OutputType>
     590             : const MooseArray<Number> &
     591           0 : MooseLinearVariableFV<OutputType>::dofValuesDuDotDotDuNeighbor() const
     592             : {
     593           0 :   timeIntegratorError();
     594             : }
     595             : 
     596             : template <typename OutputType>
     597             : void
     598      625842 : MooseLinearVariableFV<OutputType>::computeElemValues()
     599             : {
     600      625842 :   if (_compute_qp_data)
     601             :   {
     602      293729 :     _element_data->setGeometry(Moose::Volume);
     603      293729 :     _element_data->computeValues();
     604             :   }
     605      625842 : }
     606             : 
     607             : template <typename OutputType>
     608             : void
     609         405 : MooseLinearVariableFV<OutputType>::computeElemValuesFace()
     610             : {
     611         405 :   if (_compute_qp_data)
     612             :   {
     613         307 :     _element_data->setGeometry(Moose::Face);
     614         307 :     _element_data->computeValues();
     615             :   }
     616         405 : }
     617             : 
     618             : template <typename OutputType>
     619             : void
     620           0 : MooseLinearVariableFV<OutputType>::computeNeighborValuesFace()
     621             : {
     622           0 :   if (_compute_qp_data)
     623             :   {
     624           0 :     _neighbor_data->setGeometry(Moose::Face);
     625           0 :     _neighbor_data->computeValues();
     626             :   }
     627           0 : }
     628             : 
     629             : template <typename OutputType>
     630             : void
     631           0 : MooseLinearVariableFV<OutputType>::computeNeighborValues()
     632             : {
     633           0 :   if (_compute_qp_data)
     634             :   {
     635           0 :     _neighbor_data->setGeometry(Moose::Volume);
     636           0 :     _neighbor_data->computeValues();
     637             :   }
     638           0 : }
     639             : 
     640             : template <typename OutputType>
     641             : void
     642           0 : MooseLinearVariableFV<OutputType>::computeLowerDValues()
     643             : {
     644           0 :   lowerDError();
     645             : }
     646             : 
     647             : template <typename OutputType>
     648             : void
     649           0 : MooseLinearVariableFV<OutputType>::computeNodalNeighborValues()
     650             : {
     651           0 :   nodalError();
     652             : }
     653             : 
     654             : template <typename OutputType>
     655             : void
     656           0 : MooseLinearVariableFV<OutputType>::computeNodalValues()
     657             : {
     658           0 :   nodalError();
     659             : }
     660             : 
     661             : template <typename OutputType>
     662             : const std::vector<dof_id_type> &
     663           0 : MooseLinearVariableFV<OutputType>::dofIndices() const
     664             : {
     665           0 :   return _element_data->dofIndices();
     666             : }
     667             : 
     668             : template <typename OutputType>
     669             : const std::vector<dof_id_type> &
     670           0 : MooseLinearVariableFV<OutputType>::dofIndicesNeighbor() const
     671             : {
     672           0 :   return _neighbor_data->dofIndices();
     673             : }
     674             : 
     675             : template <typename OutputType>
     676             : void
     677           0 : MooseLinearVariableFV<OutputType>::setLowerDofValues(const DenseVector<DofValue> &)
     678             : {
     679           0 :   lowerDError();
     680             : }
     681             : 
     682             : template <typename OutputType>
     683             : unsigned int
     684        1489 : MooseLinearVariableFV<OutputType>::oldestSolutionStateRequested() const
     685             : {
     686        1489 :   unsigned int state = 0;
     687        1489 :   state = std::max(state, _element_data->oldestSolutionStateRequested());
     688        1489 :   state = std::max(state, _neighbor_data->oldestSolutionStateRequested());
     689        1489 :   return state;
     690             : }
     691             : 
     692             : template <typename OutputType>
     693             : void
     694      375772 : MooseLinearVariableFV<OutputType>::prepareIC()
     695             : {
     696      375772 :   _element_data->prepareIC();
     697      375772 : }
     698             : 
     699             : template <typename OutputType>
     700             : void
     701          18 : MooseLinearVariableFV<OutputType>::clearAllDofIndices()
     702             : {
     703          18 :   _element_data->clearDofIndices();
     704          18 :   _neighbor_data->clearDofIndices();
     705          18 : }
     706             : 
     707             : template <typename OutputType>
     708             : void
     709           0 : MooseLinearVariableFV<OutputType>::setNodalValue(const OutputType & /*value*/, unsigned int /*idx*/)
     710             : {
     711           0 :   nodalError();
     712             : }
     713             : 
     714             : template <typename OutputType>
     715             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     716           0 : MooseLinearVariableFV<OutputType>::nodalVectorTagValue(TagID) const
     717             : {
     718           0 :   nodalError();
     719             : }
     720             : 
     721             : template <typename OutputType>
     722             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     723           0 : MooseLinearVariableFV<OutputType>::nodalMatrixTagValue(TagID) const
     724             : {
     725           0 :   nodalError();
     726             : }
     727             : 
     728             : template <typename OutputType>
     729             : const std::vector<dof_id_type> &
     730           0 : MooseLinearVariableFV<OutputType>::dofIndicesLower() const
     731             : {
     732           0 :   lowerDError();
     733             : }
     734             : 
     735             : template <typename OutputType>
     736             : const typename MooseLinearVariableFV<OutputType>::FieldVariablePhiValue &
     737           0 : MooseLinearVariableFV<OutputType>::phiLower() const
     738             : {
     739           0 :   lowerDError();
     740             : }
     741             : 
     742             : template <typename OutputType>
     743             : void
     744         774 : MooseLinearVariableFV<OutputType>::insert(NumericVector<Number> & vector)
     745             : {
     746         774 :   _element_data->insert(vector);
     747         774 : }
     748             : 
     749             : template <typename OutputType>
     750             : void
     751           0 : MooseLinearVariableFV<OutputType>::insertLower(NumericVector<Number> & /*residual*/)
     752             : {
     753           0 :   mooseError("We don't support value insertion to residuals in MooseLinearVariableFV!");
     754             : }
     755             : 
     756             : template <typename OutputType>
     757             : void
     758           0 : MooseLinearVariableFV<OutputType>::add(NumericVector<Number> & /*residual*/)
     759             : {
     760           0 :   mooseError("We don't support value addition to residuals in MooseLinearVariableFV!");
     761             : }
     762             : 
     763             : template <typename OutputType>
     764             : void
     765        3365 : MooseLinearVariableFV<OutputType>::setActiveTags(const std::set<TagID> & vtags)
     766             : {
     767        3365 :   _element_data->setActiveTags(vtags);
     768        3365 :   _neighbor_data->setActiveTags(vtags);
     769        3365 : }
     770             : 
     771             : template <typename OutputType>
     772             : const MooseArray<OutputType> &
     773           0 : MooseLinearVariableFV<OutputType>::nodalValueArray() const
     774             : {
     775           0 :   nodalError();
     776             : }
     777             : 
     778             : template <typename OutputType>
     779             : const MooseArray<OutputType> &
     780           0 : MooseLinearVariableFV<OutputType>::nodalValueOldArray() const
     781             : {
     782           0 :   nodalError();
     783             : }
     784             : 
     785             : template <typename OutputType>
     786             : const MooseArray<OutputType> &
     787           0 : MooseLinearVariableFV<OutputType>::nodalValueOlderArray() const
     788             : {
     789           0 :   nodalError();
     790             : }
     791             : 
     792             : template <typename OutputType>
     793             : std::size_t
     794           0 : MooseLinearVariableFV<OutputType>::phiLowerSize() const
     795             : {
     796           0 :   lowerDError();
     797             : }
     798             : 
     799             : template <typename OutputType>
     800             : const typename MooseLinearVariableFV<OutputType>::FieldVariableValue &
     801          66 : MooseLinearVariableFV<OutputType>::vectorTagValue(TagID tag) const
     802             : {
     803          66 :   return _element_data->vectorTagValue(tag);
     804             : }
     805             : 
     806             : template <typename OutputType>
     807             : const typename MooseLinearVariableFV<OutputType>::DofValues &
     808          66 : MooseLinearVariableFV<OutputType>::vectorTagDofValue(TagID tag) const
     809             : {
     810          66 :   return _element_data->vectorTagDofValue(tag);
     811             : }
     812             : 
     813             : template <typename OutputType>
     814             : const typename MooseLinearVariableFV<OutputType>::FieldVariableValue &
     815          22 : MooseLinearVariableFV<OutputType>::matrixTagValue(TagID tag) const
     816             : {
     817          22 :   return _element_data->matrixTagValue(tag);
     818             : }
     819             : 
     820             : template <typename OutputType>
     821             : const typename MooseLinearVariableFV<OutputType>::FieldVariablePhiSecond &
     822           0 : MooseLinearVariableFV<OutputType>::secondPhi() const
     823             : {
     824           0 :   mooseError("We don't currently implement second derivatives for FV");
     825             : }
     826             : 
     827             : template <typename OutputType>
     828             : const typename MooseLinearVariableFV<OutputType>::FieldVariablePhiValue &
     829           0 : MooseLinearVariableFV<OutputType>::curlPhi() const
     830             : {
     831           0 :   mooseError("We don't currently implement curl for FV");
     832             : }
     833             : 
     834             : template <typename OutputType>
     835             : const typename MooseLinearVariableFV<OutputType>::FieldVariablePhiDivergence &
     836           0 : MooseLinearVariableFV<OutputType>::divPhi() const
     837             : {
     838           0 :   mooseError("We don't currently implement divergence for FV");
     839             : }
     840             : 
     841             : template <typename OutputType>
     842             : const typename MooseLinearVariableFV<OutputType>::FieldVariablePhiSecond &
     843           0 : MooseLinearVariableFV<OutputType>::secondPhiFace() const
     844             : {
     845           0 :   mooseError("We don't currently implement second derivatives for FV");
     846             : }
     847             : 
     848             : template <typename OutputType>
     849             : const typename MooseLinearVariableFV<OutputType>::FieldVariablePhiSecond &
     850           0 : MooseLinearVariableFV<OutputType>::secondPhiFaceNeighbor() const
     851             : {
     852           0 :   mooseError("We don't currently implement second derivatives for FV");
     853             : }
     854             : 
     855             : template <typename OutputType>
     856             : const typename MooseLinearVariableFV<OutputType>::FieldVariablePhiSecond &
     857           0 : MooseLinearVariableFV<OutputType>::secondPhiNeighbor() const
     858             : {
     859           0 :   mooseError("We don't currently implement second derivatives for FV");
     860             : }
     861             : 
     862             : template <typename OutputType>
     863             : const typename MooseLinearVariableFV<OutputType>::FieldVariableValue &
     864         597 : MooseLinearVariableFV<OutputType>::sln() const
     865             : {
     866         597 :   return _element_data->sln(Moose::Current);
     867             : }
     868             : 
     869             : template <typename OutputType>
     870             : const typename MooseLinearVariableFV<OutputType>::FieldVariableValue &
     871           0 : MooseLinearVariableFV<OutputType>::slnOld() const
     872             : {
     873           0 :   return _element_data->sln(Moose::Old);
     874             : }
     875             : 
     876             : template <typename OutputType>
     877             : const typename MooseLinearVariableFV<OutputType>::FieldVariableValue &
     878           0 : MooseLinearVariableFV<OutputType>::slnOlder() const
     879             : {
     880           0 :   return _element_data->sln(Moose::Older);
     881             : }
     882             : 
     883             : template <typename OutputType>
     884             : const typename MooseLinearVariableFV<OutputType>::FieldVariableGradient &
     885         102 : MooseLinearVariableFV<OutputType>::gradSln() const
     886             : {
     887         102 :   return _element_data->gradSln(Moose::Current);
     888             : }
     889             : 
     890             : template <typename OutputType>
     891             : const typename MooseLinearVariableFV<OutputType>::FieldVariableGradient &
     892           0 : MooseLinearVariableFV<OutputType>::gradSlnOld() const
     893             : {
     894           0 :   return _element_data->gradSln(Moose::Old);
     895             : }
     896             : 
     897             : template <typename OutputType>
     898             : const typename MooseLinearVariableFV<OutputType>::FieldVariableValue &
     899           0 : MooseLinearVariableFV<OutputType>::slnNeighbor() const
     900             : {
     901           0 :   return _neighbor_data->sln(Moose::Current);
     902             : }
     903             : 
     904             : template <typename OutputType>
     905             : const typename MooseLinearVariableFV<OutputType>::FieldVariableValue &
     906           0 : MooseLinearVariableFV<OutputType>::slnOldNeighbor() const
     907             : {
     908           0 :   return _neighbor_data->sln(Moose::Old);
     909             : }
     910             : 
     911             : template <typename OutputType>
     912             : const typename MooseLinearVariableFV<OutputType>::FieldVariableGradient &
     913           0 : MooseLinearVariableFV<OutputType>::gradSlnNeighbor() const
     914             : {
     915           0 :   return _neighbor_data->gradSln(Moose::Current);
     916             : }
     917             : 
     918             : template <typename OutputType>
     919             : const typename MooseLinearVariableFV<OutputType>::FieldVariableGradient &
     920           0 : MooseLinearVariableFV<OutputType>::gradSlnOldNeighbor() const
     921             : {
     922           0 :   return _neighbor_data->gradSln(Moose::Old);
     923             : }
     924             : 
     925             : template <typename OutputType>
     926             : const ADTemplateVariableSecond<OutputType> &
     927           0 : MooseLinearVariableFV<OutputType>::adSecondSln() const
     928             : {
     929           0 :   adError();
     930             : }
     931             : 
     932             : template <typename OutputType>
     933             : const ADTemplateVariableValue<OutputType> &
     934           0 : MooseLinearVariableFV<OutputType>::adUDot() const
     935             : {
     936           0 :   adError();
     937             : }
     938             : 
     939             : template <typename OutputType>
     940             : const ADTemplateVariableValue<OutputType> &
     941           0 : MooseLinearVariableFV<OutputType>::adUDotDot() const
     942             : {
     943           0 :   adError();
     944             : }
     945             : 
     946             : template <typename OutputType>
     947             : const ADTemplateVariableGradient<OutputType> &
     948           0 : MooseLinearVariableFV<OutputType>::adGradSlnDot() const
     949             : {
     950           0 :   adError();
     951             : }
     952             : 
     953             : template <typename OutputType>
     954             : const ADTemplateVariableValue<OutputType> &
     955           0 : MooseLinearVariableFV<OutputType>::adSlnNeighbor() const
     956             : {
     957           0 :   adError();
     958             : }
     959             : 
     960             : template <typename OutputType>
     961             : const ADTemplateVariableGradient<OutputType> &
     962           0 : MooseLinearVariableFV<OutputType>::adGradSlnNeighbor() const
     963             : {
     964           0 :   adError();
     965             : }
     966             : 
     967             : template <typename OutputType>
     968             : const ADTemplateVariableSecond<OutputType> &
     969           0 : MooseLinearVariableFV<OutputType>::adSecondSlnNeighbor() const
     970             : {
     971           0 :   adError();
     972             : }
     973             : 
     974             : template <typename OutputType>
     975             : const ADTemplateVariableValue<OutputType> &
     976           0 : MooseLinearVariableFV<OutputType>::adUDotNeighbor() const
     977             : {
     978           0 :   adError();
     979             : }
     980             : 
     981             : template <typename OutputType>
     982             : const ADTemplateVariableValue<OutputType> &
     983           0 : MooseLinearVariableFV<OutputType>::adUDotDotNeighbor() const
     984             : {
     985           0 :   adError();
     986             : }
     987             : 
     988             : template <typename OutputType>
     989             : const ADTemplateVariableGradient<OutputType> &
     990           0 : MooseLinearVariableFV<OutputType>::adGradSlnNeighborDot() const
     991             : {
     992           0 :   adError();
     993             : }
     994             : 
     995             : template <typename OutputType>
     996             : const ADTemplateVariableValue<OutputType> &
     997           0 : MooseLinearVariableFV<OutputType>::adSln() const
     998             : {
     999           0 :   adError();
    1000             : }
    1001             : 
    1002             : template <typename OutputType>
    1003             : const ADTemplateVariableGradient<OutputType> &
    1004           0 : MooseLinearVariableFV<OutputType>::adGradSln() const
    1005             : {
    1006           0 :   adError();
    1007             : }
    1008             : 
    1009             : template <typename OutputType>
    1010             : const ADTemplateVariableCurl<OutputType> &
    1011           0 : MooseLinearVariableFV<OutputType>::adCurlSln() const
    1012             : {
    1013           0 :   adError();
    1014             : }
    1015             : 
    1016             : template <typename OutputType>
    1017             : const ADTemplateVariableCurl<OutputType> &
    1018           0 : MooseLinearVariableFV<OutputType>::adCurlSlnNeighbor() const
    1019             : {
    1020           0 :   adError();
    1021             : }
    1022             : 
    1023             : template <typename OutputType>
    1024             : const typename MooseLinearVariableFV<OutputType>::ADDofValues &
    1025           0 : MooseLinearVariableFV<OutputType>::adDofValues() const
    1026             : {
    1027           0 :   adError();
    1028             : }
    1029             : 
    1030             : template <typename OutputType>
    1031             : const typename MooseLinearVariableFV<OutputType>::ADDofValues &
    1032           0 : MooseLinearVariableFV<OutputType>::adDofValuesNeighbor() const
    1033             : {
    1034           0 :   adError();
    1035             : }
    1036             : 
    1037             : template <typename OutputType>
    1038             : const typename MooseLinearVariableFV<OutputType>::ADDofValues &
    1039           0 : MooseLinearVariableFV<OutputType>::adDofValuesDot() const
    1040             : {
    1041           0 :   adError();
    1042             : }
    1043             : 
    1044             : template <typename OutputType>
    1045             : const dof_id_type &
    1046           0 : MooseLinearVariableFV<OutputType>::nodalDofIndex() const
    1047             : {
    1048           0 :   nodalError();
    1049             : }
    1050             : 
    1051             : template <typename OutputType>
    1052             : const dof_id_type &
    1053           0 : MooseLinearVariableFV<OutputType>::nodalDofIndexNeighbor() const
    1054             : {
    1055           0 :   nodalError();
    1056             : }
    1057             : 
    1058             : template <typename OutputType>
    1059             : void
    1060        1489 : MooseLinearVariableFV<OutputType>::sizeMatrixTagData()
    1061             : {
    1062        1489 :   _element_data->sizeMatrixTagData();
    1063        1489 : }
    1064             : 
    1065             : template class MooseLinearVariableFV<Real>;

Generated by: LCOV version 1.14