Skip to content

Commit

Permalink
Add DPAPostprocessor (idaholab#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Schunert committed Feb 15, 2020
1 parent 6aa52dd commit 4943a07
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
34 changes: 34 additions & 0 deletions include/postprocessors/DPAPostprocessor.h
Original file line number Diff line number Diff line change
@@ -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<DPAPostprocessor>();

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
42 changes: 42 additions & 0 deletions src/postprocessors/DPAPostprocessor.C
Original file line number Diff line number Diff line change
@@ -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<DPAPostprocessor>()
{
InputParameters params = validParams<GeneralPostprocessor>();
params.addRequiredParam<UserObjectName>(
"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<UserObject>("dpa_object");
_damage_object = dynamic_cast<const NeutronDamageInterface *>(uo);
if (!_damage_object)
paramError("dpa_object", "The provided UserObject does not inherit from NeutronDamageInterface.");
}

Real
DPAPostprocessor::getValue()
{
return _damage_object->getDPA();
}

#endif

0 comments on commit 4943a07

Please sign in to comment.