LCOV - code coverage report
Current view: top level - src/auxkernels - TagVectorArrayVariableAux.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 16 17 94.1 %
Date: 2025-07-17 01:28:37 Functions: 3 3 100.0 %
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 "TagVectorArrayVariableAux.h"
      11             : 
      12             : registerMooseObject("MooseApp", TagVectorArrayVariableAux);
      13             : 
      14             : InputParameters
      15       14290 : TagVectorArrayVariableAux::validParams()
      16             : {
      17       14290 :   InputParameters params = TagAuxBase<ArrayAuxKernel>::validParams();
      18             : 
      19       14290 :   params.addRequiredParam<TagName>("vector_tag", "Tag Name this Aux works on");
      20       14290 :   params.addClassDescription(
      21             :       "Couple a tagged vector, and return its evaluations at degree of freedom "
      22             :       "indices corresponding to the coupled array variable.");
      23       14290 :   return params;
      24           0 : }
      25             : 
      26          13 : TagVectorArrayVariableAux::TagVectorArrayVariableAux(const InputParameters & parameters)
      27          13 :   : TagAuxBase<ArrayAuxKernel>(parameters), _v(coupledVectorTagArrayDofValue("v", "vector_tag"))
      28             : {
      29          13 :   checkCoupledVariable(getArrayVar("v", 0), &_var);
      30          13 : }
      31             : 
      32             : void
      33         200 : TagVectorArrayVariableAux::compute()
      34             : {
      35         200 :   const auto n_local_dofs = _var.numberOfDofs();
      36         200 :   _local_sol.resize(n_local_dofs);
      37         400 :   for (const auto i : make_range(n_local_dofs))
      38         200 :     _local_sol(i) = _v[i];
      39         200 :   _var.setDofValues(_local_sol);
      40         200 : }

Generated by: LCOV version 1.14