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 "MyTRIMDiracEnergyResult.h" 10 : #include "MyTRIMDiracRun.h" 11 : 12 : registerMooseObject("MagpieApp", MyTRIMDiracEnergyResult); 13 : 14 : InputParameters 15 8 : MyTRIMDiracEnergyResult::validParams() 16 : { 17 8 : InputParameters params = GeneralVectorPostprocessor::validParams(); 18 16 : params.addRequiredParam<UserObjectName>( 19 : "runner", "Name of the MyTRIMDiracRun userobject to pull data from."); 20 8 : return params; 21 0 : } 22 : 23 4 : MyTRIMDiracEnergyResult::MyTRIMDiracEnergyResult(const InputParameters & parameters) 24 : : GeneralVectorPostprocessor(parameters), 25 4 : _mytrim(getUserObject<MyTRIMDiracRun>("runner")), 26 4 : _x(declareVector("x")), 27 4 : _y(declareVector("y")), 28 4 : _z(declareVector("z")), 29 4 : _elem_id(declareVector("elem_id")), 30 8 : _energy_deposition(declareVector("energy_deposition")) 31 : { 32 4 : } 33 : 34 : void 35 4 : MyTRIMDiracEnergyResult::initialize() 36 : { 37 4 : _x.clear(); 38 4 : _y.clear(); 39 4 : _z.clear(); 40 4 : _elem_id.clear(); 41 4 : _energy_deposition.clear(); 42 4 : } 43 : 44 : void 45 4 : MyTRIMDiracEnergyResult::execute() 46 : { 47 68180 : for (auto && entry : _mytrim.result()) 48 68176 : if (static_cast<unsigned int>(entry._type) == 5) 49 : { 50 60372 : _x.push_back(entry._location(0)); 51 60372 : _y.push_back(entry._location(1)); 52 60372 : _z.push_back(entry._location(2)); 53 60372 : _elem_id.push_back(entry._elem_id); 54 60372 : _energy_deposition.push_back(entry._weight); 55 : } 56 4 : } 57 : 58 : void 59 4 : MyTRIMDiracEnergyResult::finalize() 60 : { 61 : // the MyTRIMDiracRunner already does the necessary communication 62 4 : }