LCOV - code coverage report
Current view: top level - include/other - ThreadedRecoilElementAveragedLoop.h (source / functions) Hit Total Coverage
Test: idaholab/magpie: 5710af Lines: 3 3 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 accumulated
      16             :  * as element averages.
      17             :  */
      18             : class ThreadedRecoilElementAveragedLoop : public ThreadedRecoilLoopBase
      19             : {
      20             : public:
      21             :   ThreadedRecoilElementAveragedLoop(const MyTRIMRasterizer &, const MooseMesh &);
      22             : 
      23             :   /// Splitting constructor
      24             :   ThreadedRecoilElementAveragedLoop(const ThreadedRecoilElementAveragedLoop & x,
      25             :                                     Threads::split split);
      26             : 
      27             :   /// thread join method
      28             :   virtual void join(const ThreadedRecoilElementAveragedLoop &);
      29             : 
      30             :   /**
      31             :    * result data map for the TRIM simulation holding interstitial/vacancy pairs
      32             :    * for each species in the rasterizer.
      33             :    */
      34             :   struct MyTRIMResult;
      35             :   typedef std::map<dof_id_type, MyTRIMResult> MyTRIMResultMap;
      36             : 
      37             :   const MyTRIMResultMap & getResultMap() { return _result_map; }
      38             : 
      39             : protected:
      40             :   /// add an interstitial or vacancy to the result list
      41             :   void addDefectToResult(const Point & p, unsigned int var, Real weight, DefectType type);
      42             : 
      43             :   /// add deposited energy to the result list
      44             :   void addEnergyToResult(const Point & p, Real edep);
      45             : 
      46             :   /// data such as interstitials and vacancies produced will be stored here
      47             :   MyTRIMResultMap _result_map;
      48             : };
      49             : 
      50      319346 : struct ThreadedRecoilElementAveragedLoop::MyTRIMResult
      51             : {
      52      163322 :   MyTRIMResult(unsigned int nvars) : _defects(nvars), _energy(0.0) {}
      53       52966 :   MyTRIMResult() : _defects(), _energy(0.0) {}
      54             : 
      55             :   // numbers of point defects per chemical element
      56             :   using Defect = std::array<Real, 4>;
      57             :   std::vector<Defect> _defects;
      58             : 
      59             :   /// this will hold the matrix of replacement collisions
      60             :   // std::vector<Real> _replacements;
      61             : 
      62             :   /// deposited energy per element
      63             :   Real _energy;
      64             : };
      65             : 
      66             : template <>
      67             : void dataStore(std::ostream &, ThreadedRecoilElementAveragedLoop::MyTRIMResult &, void *);
      68             : 
      69             : template <>
      70             : void dataLoad(std::istream &, ThreadedRecoilElementAveragedLoop::MyTRIMResult &, void *);

Generated by: LCOV version 1.14