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 "SPPARKSAux.h" 10 : #include "SPPARKSUserObject.h" 11 : 12 : registerMooseObject("MagpieApp", SPPARKSAux); 13 : 14 : InputParameters 15 0 : SPPARKSAux::validParams() 16 : { 17 0 : InputParameters params = AuxKernel::validParams(); 18 0 : params.addRequiredParam<UserObjectName>("user_object", "Name of SPPARKSUserObject"); 19 0 : params.addParam<unsigned int>("var", "Index into SPPARKS array"); 20 0 : MooseEnum arrayType("IARRAY DARRAY"); 21 0 : params.addParam<MooseEnum>("array", arrayType, "SPPARKS array to read from"); 22 0 : return params; 23 0 : } 24 : 25 0 : SPPARKSAux::SPPARKSAux(const InputParameters & parameters) 26 : : AuxKernel(parameters), 27 0 : _spparks(getUserObject<SPPARKSUserObject>("user_object")), 28 0 : _var(getParam<unsigned int>("var")), 29 0 : _array(getParam<MooseEnum>("array")) 30 : { 31 0 : } 32 : 33 : Real 34 0 : SPPARKSAux::computeValue() 35 : { 36 0 : switch (_array) 37 : { 38 0 : case 0: // Integer Array 39 0 : return _spparks.getIntValue(_current_node->id(), _var); 40 : 41 0 : case 1: // Double Array 42 0 : return _spparks.getDoubleValue(_current_node->id(), _var); 43 : 44 0 : default: 45 0 : mooseError("Internal error."); 46 : } 47 : }