LCOV - code coverage report
Current view: top level - include/userobjects - ParticleInitializerBase.h (source / functions) Hit Total Coverage
Test: idaholab/salamander: d3fcc7 Lines: 1 4 25.0 %
Date: 2025-08-11 14:54:34 Functions: 0 3 0.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             : #pragma once
      18             : 
      19             : #include "GeneralUserObject.h"
      20             : 
      21             : class VelocityInitializerBase;
      22             : 
      23       39506 : struct InitialParticleData
      24             : {
      25             :   /// the location where the particle will be placed
      26             :   Point position;
      27             :   /// the velocity that the particle will be given
      28             :   Point velocity;
      29             :   /// the type of physical particle this particle represents
      30             :   std::string species;
      31             :   /// the number of physical particles that this particle represents
      32             :   Real weight;
      33             :   /// the charge of the physical particle this computational particle represents
      34             :   Real charge;
      35             :   /// the mass of the physical particle this computational particle represents
      36             :   Real mass;
      37             :   /// the element that this particle will be placed into
      38             :   const Elem * elem;
      39             : };
      40             : 
      41             : class ParticleInitializerBase : public GeneralUserObject
      42             : {
      43             : public:
      44             :   ParticleInitializerBase(const InputParameters & parameters);
      45             : 
      46             :   static InputParameters validParams();
      47             : 
      48             :   /**
      49             :    * This method will be called by PIC studies to give them all of the data needed to create and
      50             :    * place particles on the finite element mesh
      51             :    * */
      52             :   virtual std::vector<InitialParticleData> getParticleData() const = 0;
      53             : 
      54             :   /**
      55             :    * Unused methods
      56             :    */
      57             :   ///@{
      58           0 :   virtual void initialize() override final {}
      59           0 :   virtual void finalize() override final {}
      60           0 :   virtual void execute() override final {}
      61             :   ///@}
      62             : 
      63             : protected:
      64             :   /// the mass of the particles being created
      65             :   const Real _mass;
      66             :   /// the charge of the particles being created
      67             :   const Real _charge;
      68             :   /// the type of particle being created
      69             :   const std::string & _species;
      70             :   /// a user specified seed for changing random number generator seeds
      71             :   const unsigned int _seed;
      72             :   /// the dimension of the finite element mesh
      73             :   const Real _mesh_dimension;
      74             :   /// The velocity initializer which will give all particles their initial velocity distribution
      75             :   const VelocityInitializerBase & _velocity_initializer;
      76             : };

Generated by: LCOV version 1.14