LCOV - code coverage report
Current view: top level - src/tensor_solver - ExplicitSolverBase.C (source / functions) Hit Total Coverage
Test: idaholab/swift: #92 (25e020) with base b3cd84 Lines: 19 21 90.5 %
Date: 2025-09-10 17:10:32 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /**********************************************************************/
       2             : /*                    DO NOT MODIFY THIS HEADER                       */
       3             : /*             Swift, a Fourier spectral solver for MOOSE             */
       4             : /*                                                                    */
       5             : /*            Copyright 2024 Battelle Energy Alliance, LLC            */
       6             : /*                        ALL RIGHTS RESERVED                         */
       7             : /**********************************************************************/
       8             : 
       9             : #include "ExplicitSolverBase.h"
      10             : #include "TensorProblem.h"
      11             : #include "DomainAction.h"
      12             : 
      13             : InputParameters
      14          64 : ExplicitSolverBase::validParams()
      15             : {
      16          64 :   InputParameters params = TensorSolver::validParams();
      17          64 :   params.addClassDescription("Base class for explicit time integrators.");
      18             : 
      19         128 :   params.addParam<std::vector<TensorOutputBufferName>>(
      20             :       "buffer", {}, "The buffer this solver is writing to");
      21             : 
      22         128 :   params.addParam<std::vector<TensorInputBufferName>>(
      23             :       "reciprocal_buffer", {}, "Buffer with the reciprocal of the integrated buffer");
      24         128 :   params.addParam<std::vector<TensorInputBufferName>>(
      25             :       "time_derivative_reciprocal",
      26             :       {},
      27             :       "Buffer with the reciprocal of the time derivative function");
      28          64 :   return params;
      29           0 : }
      30             : 
      31          32 : ExplicitSolverBase::ExplicitSolverBase(const InputParameters & parameters)
      32          32 :   : TensorSolver(parameters)
      33             : {
      34          64 :   auto buffers = getParam<std::vector<TensorOutputBufferName>>("buffer");
      35          64 :   auto reciprocal_buffers = getParam<std::vector<TensorInputBufferName>>("reciprocal_buffer");
      36             :   auto time_derivative_reciprocals =
      37          96 :       getParam<std::vector<TensorInputBufferName>>("time_derivative_reciprocal");
      38             : 
      39             :   const auto n = buffers.size();
      40          32 :   if (reciprocal_buffers.size() != n || time_derivative_reciprocals.size() != n)
      41           0 :     paramError("buffer",
      42             :                "Must have the same number of entries as 'reciprocal_buffer' and "
      43             :                "'time_derivative_reciprocal'.");
      44             : 
      45          64 :   for (const auto i : make_range(n))
      46          32 :     _variables.push_back(Variable{
      47          32 :         getOutputBufferByName(buffers[i]),
      48          32 :         getInputBufferByName(reciprocal_buffers[i]),
      49          32 :         getInputBufferByName(time_derivative_reciprocals[i]),
      50             :     });
      51          32 : }

Generated by: LCOV version 1.14