diff --git a/include/postprocessors/DPAPostprocessor.h b/include/postprocessors/DPAPostprocessor.h new file mode 100644 index 00000000..51f249bf --- /dev/null +++ b/include/postprocessors/DPAPostprocessor.h @@ -0,0 +1,34 @@ +/**********************************************************************/ +/* DO NOT MODIFY THIS HEADER */ +/* MAGPIE - Mesoscale Atomistic Glue Program for Integrated Execution */ +/* */ +/* Copyright 2017 Battelle Energy Alliance, LLC */ +/* ALL RIGHTS RESERVED */ +/**********************************************************************/ + +#ifdef GSL_ENABLED + +#pragma once + +#include "GeneralPostprocessor.h" + +// forward declarations +class DPAPostprocessor; +class NeutronDamageInterface; + +template <> +InputParameters validParams(); + +class DPAPostprocessor : public GeneralPostprocessor +{ +public: + DPAPostprocessor(const InputParameters & parameters); + virtual void execute() override {} + virtual void initialize() override {} + virtual Real getValue() override; + +protected: + const NeutronDamageInterface * _damage_object; +}; + +#endif diff --git a/src/postprocessors/DPAPostprocessor.C b/src/postprocessors/DPAPostprocessor.C new file mode 100644 index 00000000..b950d5e3 --- /dev/null +++ b/src/postprocessors/DPAPostprocessor.C @@ -0,0 +1,42 @@ +/**********************************************************************/ +/* DO NOT MODIFY THIS HEADER */ +/* MAGPIE - Mesoscale Atomistic Glue Program for Integrated Execution */ +/* */ +/* Copyright 2017 Battelle Energy Alliance, LLC */ +/* ALL RIGHTS RESERVED */ +/**********************************************************************/ + +#ifdef GSL_ENABLED + +#include "DPAPostprocessor.h" +#include "NeutronDamageInterface.h" + +registerMooseObject("MagpieApp", DPAPostprocessor); + +template <> +InputParameters +validParams() +{ + InputParameters params = validParams(); + params.addRequiredParam( + "dpa_object", "The neutronics damage object."); + params.addClassDescription("Retrieves the dpa from a neutronics damage object. The neutronics " + "damage object must inherit from NeutronDamageInterface."); + return params; +} + +DPAPostprocessor::DPAPostprocessor(const InputParameters & params) : GeneralPostprocessor(params) +{ + const UserObject * uo = &getUserObject("dpa_object"); + _damage_object = dynamic_cast(uo); + if (!_damage_object) + paramError("dpa_object", "The provided UserObject does not inherit from NeutronDamageInterface."); +} + +Real +DPAPostprocessor::getValue() +{ + return _damage_object->getDPA(); +} + +#endif