LCOV - code coverage report
Current view: top level - src/other - MooseMyTRIMMaterial.C (source / functions) Hit Total Coverage
Test: idaholab/magpie: 5710af Lines: 13 13 100.0 %
Date: 2025-07-21 23:34:39 Functions: 3 3 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 "MooseMyTRIMMaterial.h"
      10             : 
      11      201377 : MooseMyTRIMMaterial::MooseMyTRIMMaterial(MyTRIM_NS::SimconfType * simconf)
      12      201377 :   : MyTRIM_NS::MaterialBase(simconf, 0.0)
      13             : {
      14      201377 : }
      15             : 
      16             : const MyTRIM_NS::Element &
      17    64715091 : MooseMyTRIMMaterial::getElement(unsigned int nn)
      18             : {
      19             :   // store the recoil element index in the tag field
      20    64715091 :   _tag = nn;
      21    64715091 :   return _element[nn];
      22             : }
      23             : 
      24             : void
      25      201377 : MooseMyTRIMMaterial::calculateDensity(Real site_volume)
      26             : {
      27             :   // sum up mass per lattice site
      28      201377 :   _rho = 0.0;
      29      529192 :   for (auto && el : _element)
      30      327815 :     _rho += el._t * el._m;
      31             : 
      32             :   // compute density in amu/nm^3
      33      201377 :   _rho /= site_volume;
      34             : 
      35             :   // convert _rho into g/cm^3 (1amu = 1.66054e-24g, 1nm^3 = 1e-21cm^3)
      36      201377 :   _rho *= 1.66054e-3;
      37      201377 : }

Generated by: LCOV version 1.14