LCOV - code coverage report
Current view: top level - src/materials - ADFunctionPathGaussianHeatSource.C (source / functions) Hit Total Coverage
Test: idaholab/malamute: 0e4c8a Lines: 26 27 96.3 %
Date: 2025-08-02 07:01:39 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /****************************************************************************/
       2             : /*                        DO NOT MODIFY THIS HEADER                         */
       3             : /*                                                                          */
       4             : /* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
       5             : /*                                                                          */
       6             : /*           Copyright 2021 - 2024, Battelle Energy Alliance, LLC           */
       7             : /*                           ALL RIGHTS RESERVED                            */
       8             : /****************************************************************************/
       9             : 
      10             : #include "ADFunctionPathGaussianHeatSource.h"
      11             : 
      12             : #include "Function.h"
      13             : 
      14             : registerMooseObject("MalamuteApp", ADFunctionPathGaussianHeatSource);
      15             : 
      16             : InputParameters
      17          24 : ADFunctionPathGaussianHeatSource::validParams()
      18             : {
      19          24 :   InputParameters params = ADGaussianHeatSourceBase::validParams();
      20          48 :   params.addParam<FunctionName>("function_x",
      21             :                                 "0",
      22             :                                 "The x component of the center of the heating spot as a function "
      23             :                                 "of time, length unit is [mm], time unit is [ms].");
      24          48 :   params.addParam<FunctionName>("function_y",
      25             :                                 "0",
      26             :                                 "The y component of the center of the heating spot as a function "
      27             :                                 "of time, length unit is [mm], time unit is [ms].");
      28          48 :   params.addParam<FunctionName>("function_z",
      29             :                                 "0",
      30             :                                 "The z component of the center of the heating spot as a function "
      31             :                                 "of time, length unit is [mm], time unit is [ms].");
      32             : 
      33          24 :   params.addClassDescription(
      34             :       "Gaussian heat source whose center moves along a specified function path.");
      35             : 
      36          24 :   return params;
      37           0 : }
      38             : 
      39          18 : ADFunctionPathGaussianHeatSource::ADFunctionPathGaussianHeatSource(
      40          18 :     const InputParameters & parameters)
      41             :   : ADGaussianHeatSourceBase(parameters),
      42          18 :     _function_x(getFunction("function_x")),
      43          18 :     _function_y(getFunction("function_y")),
      44          36 :     _function_z(getFunction("function_z"))
      45             : {
      46          18 : }
      47             : 
      48             : void
      49      404000 : ADFunctionPathGaussianHeatSource::computeHeatSourceCenterAtTime(Real & x,
      50             :                                                                 Real & y,
      51             :                                                                 Real & z,
      52             :                                                                 const Real & time)
      53             : {
      54      404000 :   const static Point dummy;
      55      404000 :   x = _function_x.value(time, dummy);
      56      404000 :   y = _function_y.value(time, dummy);
      57      404000 :   z = _function_z.value(time, dummy);
      58      404000 : }
      59             : 
      60             : void
      61        5050 : ADFunctionPathGaussianHeatSource::computeHeatSourceMovingSpeedAtTime(const Real & time)
      62             : {
      63        5050 :   const static Point dummy;
      64        5050 :   Real vx = _function_x.timeDerivative(time);
      65        5050 :   Real vy = _function_y.timeDerivative(time);
      66        5050 :   Real vz = _function_z.timeDerivative(time);
      67        5050 :   _scan_speed = std::sqrt(vx * vx + vy * vy + vz * vz);
      68        5050 : }

Generated by: LCOV version 1.14