LCOV - code coverage report
Current view: top level - src/userobjects - ParticleInitializerBase.C (source / functions) Hit Total Coverage
Test: idaholab/salamander: d3fcc7 Lines: 18 19 94.7 %
Date: 2025-08-11 14:54:34 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of SALAMANDER: Software for Advanced Large-scale Analysis of MAgnetic
       2             : //* confinement for Numerical Design, Engineering & Research,
       3             : //* A multiphysics application for modeling plasma facing components
       4             : //* https://github.com/idaholab/salamander
       5             : //* https://mooseframework.inl.gov/salamander
       6             : //*
       7             : //* SALAMANDER is powered by the MOOSE Framework
       8             : //* https://www.mooseframework.inl.gov
       9             : //*
      10             : //* Licensed under LGPL 2.1, please see LICENSE for details
      11             : //* https://www.gnu.org/licenses/lgpl-2.1.html
      12             : //*
      13             : //* Copyright 2025, Battelle Energy Alliance, LLC
      14             : //* ALL RIGHTS RESERVED
      15             : //*
      16             : 
      17             : #include "MooseTypes.h"
      18             : #include "ParticleInitializerBase.h"
      19             : 
      20             : InputParameters
      21        1313 : ParticleInitializerBase::validParams()
      22             : {
      23        1313 :   auto params = GeneralUserObject::validParams();
      24        1313 :   params.addClassDescription("Base class for ParticleStepper. Provides the basic implementation"
      25             :                              "for dimensional dependent velocity updating."
      26             :                              "And the ability to sample vector fields for use in a particle step");
      27        2626 :   params.addParam<unsigned int>("seed", 0, "An additional seed for the random number generators");
      28        3939 :   params.addRangeCheckedParam<Real>(
      29        2626 :       "mass", 1.0, "mass > 0.0", "The mass of the particles being placed in the mesh");
      30        2626 :   params.addParam<Real>("charge", 1, "The charge of the particles being placed in the mesh");
      31        2626 :   params.addParam<std::string>("species", "", "The type of particle that is being initialized");
      32        2626 :   params.addRequiredParam<UserObjectName>(
      33             :       "velocity_initializer",
      34             :       "The user object that will generate the initial velocities for all of the particles.");
      35        1313 :   return params;
      36           0 : }
      37             : 
      38         655 : ParticleInitializerBase::ParticleInitializerBase(const InputParameters & parameters)
      39             :   : GeneralUserObject(parameters),
      40         655 :     _mass(getParam<Real>("mass")),
      41        1310 :     _charge(getParam<Real>("charge")),
      42        1310 :     _species(getParam<std::string>("species")),
      43        1310 :     _seed(getParam<unsigned int>("seed")),
      44         655 :     _mesh_dimension(_fe_problem.mesh().dimension()),
      45        1310 :     _velocity_initializer(getUserObject<VelocityInitializerBase>("velocity_initializer"))
      46             : {
      47         655 : }

Generated by: LCOV version 1.14