LCOV - code coverage report
Current view: top level - src/other - MooseMyTRIMEnergyDeposition.C (source / functions) Hit Total Coverage
Test: idaholab/magpie: 5710af Lines: 24 26 92.3 %
Date: 2025-07-21 23:34:39 Functions: 5 5 100.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             : #include "MooseMyTRIMEnergyDeposition.h"
      10             : #include "MooseMyTRIMSample.h"
      11             : 
      12          49 : MooseMyTRIMEnergyDeposition::MooseMyTRIMEnergyDeposition(
      13             :     MyTRIM_NS::SimconfType * simconf,
      14             :     MooseMyTRIMSample * sample,
      15          49 :     std::list<std::pair<Point, Real>> & edep_list)
      16          49 :   : MooseMyTRIMCore(simconf, sample), _edep_list(edep_list)
      17             : {
      18          49 : }
      19             : 
      20             : void
      21      401400 : MooseMyTRIMEnergyDeposition::checkPKAState()
      22             : {
      23      401400 :   switch (_pka->_state)
      24             :   {
      25             :     // PKA is gone, and with it all energy
      26             :     case MyTRIM_NS::IonBase::LOST:
      27             :     case MyTRIM_NS::IonBase::DELETE:
      28             :       return;
      29             : 
      30             :     // only deposit electronic stopping (PKA is moving on)
      31      361932 :     case MyTRIM_NS::IonBase::MOVING:
      32      361932 :       depositEnergy(_pka, _dee);
      33      361932 :       return;
      34             : 
      35       27984 :     case MyTRIM_NS::IonBase::INTERSTITIAL:
      36             :       // deposit residual energy of the stopped PKA and electronic stopping
      37       27984 :       depositEnergy(_pka, _pka->_E + _dee);
      38       27984 :       return;
      39             : 
      40       11484 :     case MyTRIM_NS::IonBase::REPLACEMENT:
      41             :     case MyTRIM_NS::IonBase::SUBSTITUTIONAL:
      42             :       // deposit residual energy of the stopped PKA, electronic stopping, and binding energy to the
      43             :       // new lattice site
      44       11484 :       depositEnergy(_pka, _pka->_E + _element->_Elbind + _dee);
      45       11484 :       return;
      46             : 
      47           0 :     case MyTRIM_NS::IonBase::VACANCY:
      48           0 :       mooseError("PKA should never be in this state");
      49             :   }
      50             : }
      51             : 
      52             : void
      53      356955 : MooseMyTRIMEnergyDeposition::dissipateRecoilEnergy()
      54             : {
      55             :   // new recoil is not leaving its lattice site, reimburse binding energy
      56      356955 :   depositEnergy(_recoil, _recoil->_E + _element->_Elbind);
      57      356955 : }
      58             : 
      59             : bool
      60       44445 : MooseMyTRIMEnergyDeposition::followRecoil()
      61             : {
      62             :   // TODO: if we ever return false here we need to deposit the discarded recoil energy
      63       44445 :   return true;
      64             : }
      65             : 
      66             : void
      67      758355 : MooseMyTRIMEnergyDeposition::depositEnergy(MyTRIM_NS::IonBase * ion, Real E)
      68             : {
      69      758355 :   _edep_list.push_back(
      70      758355 :       std::make_pair(Point(ion->_pos(0), ion->_pos(1), _dim == 2 ? 0.0 : ion->_pos(2)), E));
      71      758355 : }

Generated by: LCOV version 1.14