LCOV - code coverage report
Current view: top level - src/vectorpostprocessors - PKAList.C (source / functions) Hit Total Coverage
Test: idaholab/magpie: 5710af Lines: 40 41 97.6 %
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 "PKAList.h"
      10             : #include "MyTRIMRasterizer.h"
      11             : 
      12             : registerMooseObject("MagpieApp", PKAList);
      13             : 
      14             : InputParameters
      15          16 : PKAList::validParams()
      16             : {
      17          16 :   InputParameters params = GeneralVectorPostprocessor::validParams();
      18          16 :   params.addClassDescription("Dumps the entire PKA list");
      19          32 :   params.addRequiredParam<UserObjectName>(
      20             :       "rasterizer", "Name of the MyTRIMRasterizer userobject that provides the PKA list.");
      21          16 :   return params;
      22           0 : }
      23             : 
      24           8 : PKAList::PKAList(const InputParameters & parameters)
      25             :   : GeneralVectorPostprocessor(parameters),
      26           8 :     _rasterizer(getUserObject<MyTRIMRasterizer>("rasterizer")),
      27           8 :     _pka_list(_rasterizer.getPKAList()),
      28           8 :     _x(declareVector("x")),
      29           8 :     _y(declareVector("y")),
      30           8 :     _z(declareVector("z")),
      31           8 :     _seed(declareVector("seed")),
      32           8 :     _m(declareVector("m")),
      33          16 :     _Z(declareVector("Z"))
      34             : {
      35           8 : }
      36             : 
      37             : void
      38           8 : PKAList::initialize()
      39             : {
      40           8 :   _x.clear();
      41           8 :   _y.clear();
      42           8 :   _z.clear();
      43           8 :   _seed.clear();
      44           8 :   _m.clear();
      45           8 :   _Z.clear();
      46           8 : }
      47             : 
      48             : void
      49           8 : PKAList::execute()
      50             : {
      51       24116 :   for (auto & pka : _pka_list)
      52             :   {
      53       24108 :     _x.push_back(pka._pos(0));
      54       24108 :     _y.push_back(pka._pos(1));
      55       24108 :     _z.push_back(pka._pos(2));
      56       24108 :     _seed.push_back(pka._seed);
      57       24108 :     _m.push_back(pka._m);
      58       24108 :     _Z.push_back(pka._Z);
      59             :   }
      60           8 : }
      61             : 
      62             : void
      63           8 : PKAList::finalize()
      64             : {
      65             :   // broadcast data to processor 0
      66           8 :   _communicator.allgather(_x, false);
      67           8 :   _communicator.allgather(_y, false);
      68           8 :   _communicator.allgather(_z, false);
      69           8 :   _communicator.allgather(_seed, false);
      70           8 :   _communicator.allgather(_m, false);
      71           8 :   _communicator.allgather(_Z, false);
      72           8 : }

Generated by: LCOV version 1.14