LCOV - code coverage report
Current view: top level - include/other - ThreadedRecoilDiracSourceLoop.h (source / functions) Hit Total Coverage
Test: idaholab/magpie: 5710af Lines: 2 2 100.0 %
Date: 2025-07-21 23:34:39 Functions: 0 0 -
Legend: Lines: hit not hit

          Line data    Source code
       1             : /**********************************************************************/
       2             : /*                     DO NOT MODIFY THIS HEADER                      */
       3             : /* MAGPIE - Mesoscale Atomistic Glue Program for Integrated Execution */
       4             : /*                                                                    */
       5             : /*            Copyright 2017 Battelle Energy Alliance, LLC            */
       6             : /*                        ALL RIGHTS RESERVED                         */
       7             : /**********************************************************************/
       8             : 
       9             : #pragma once
      10             : 
      11             : #include "ThreadedRecoilLoopBase.h"
      12             : #include "DataIO.h"
      13             : 
      14             : /**
      15             :  * MyTRIM simulation threaded loop for recoil calculation. Results are stored as
      16             :  * point lists for use with DiracKernel objects.
      17             :  */
      18             : class ThreadedRecoilDiracSourceLoop : public ThreadedRecoilLoopBase
      19             : {
      20             : public:
      21             :   ThreadedRecoilDiracSourceLoop(const MyTRIMRasterizer &, const MooseMesh &);
      22             : 
      23             :   /// Splitting constructor
      24             :   ThreadedRecoilDiracSourceLoop(const ThreadedRecoilDiracSourceLoop & x, Threads::split split);
      25             : 
      26             :   /// thread join method
      27             :   virtual void join(const ThreadedRecoilDiracSourceLoop &);
      28             : 
      29             :   /**
      30             :    * result data map for the TRIM simulation holding defects and their locations
      31             :    * for each species in the rasterizer.
      32             :    */
      33             :   struct MyTRIMResult;
      34             :   typedef std::vector<MyTRIMResult> MyTRIMResultList;
      35             :   const MyTRIMResultList & getResultList() { return _result_list; }
      36             : 
      37             : protected:
      38             :   /// add an interstitial or vacancy to the result list
      39             :   void addDefectToResult(const Point & p, unsigned int var, Real weight, DefectType type);
      40             : 
      41             :   /// add deposited energy to the result list
      42             :   void addEnergyToResult(const Point & p, Real edep);
      43             : 
      44             :   /// data such as interstitials and vacancies produced will be stored here
      45             :   MyTRIMResultList _result_list;
      46             : };
      47             : 
      48             : struct ThreadedRecoilDiracSourceLoop::MyTRIMResult
      49             : {
      50             :   MyTRIMResult(const Point & location,
      51             :                unsigned int var,
      52             :                ThreadedRecoilDiracSourceLoop::DefectType type,
      53             :                dof_id_type elem_id,
      54             :                Real weight)
      55     1168710 :     : _location(location), _var(var), _type(type), _elem_id(elem_id), _weight(weight)
      56             :   {
      57             :   }
      58             : 
      59      383742 :   MyTRIMResult() : _location(), _var(0), _type(NONE), _elem_id(libMesh::invalid_uint), _weight(1) {}
      60             : 
      61             :   Point _location;
      62             :   unsigned int _var;
      63             :   DefectType _type;
      64             :   dof_id_type _elem_id;
      65             :   Real _weight;
      66             : };
      67             : 
      68             : template <>
      69             : void dataStore(std::ostream &, ThreadedRecoilDiracSourceLoop::MyTRIMResult &, void *);
      70             : 
      71             : template <>
      72             : void dataLoad(std::istream &, ThreadedRecoilDiracSourceLoop::MyTRIMResult &, void *);

Generated by: LCOV version 1.14