Skip to content

Commit

Permalink
Add aux kernel to read buffer content (idaholab#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
dschwen authored and recuero committed Apr 29, 2020
1 parent b13c26e commit 8c34413
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
32 changes: 32 additions & 0 deletions include/auxkernels/FFTBufferAux.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**********************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MAGPIE - Mesoscale Atomistic Glue Program for Integrated Execution */
/* */
/* Copyright 2017 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/**********************************************************************/

#pragma once

#include "AuxKernel.h"

class FFTBufferAux;
template <typename T>
class FFTBufferBase;

template <>
InputParameters validParams<FFTBufferAux>();

/**
*
*/
class FFTBufferAux : public AuxKernel
{
public:
FFTBufferAux(const InputParameters & parameters);

protected:
virtual Real computeValue() override;

const FFTBufferBase<Real> & _buffer;
};
33 changes: 33 additions & 0 deletions src/auxkernels/FFTBufferAux.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**********************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MAGPIE - Mesoscale Atomistic Glue Program for Integrated Execution */
/* */
/* Copyright 2017 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/**********************************************************************/

#include "FFTBufferAux.h"
#include "FFTBufferBase.h"

registerMooseObject("MagpieApp", FFTBufferAux);

template <>
InputParameters
validParams<FFTBufferAux>()
{
InputParameters params = validParams<AuxKernel>();
params.addClassDescription("Fetch values from an FFT buffer.");
params.addRequiredParam<UserObjectName>("fft_buffer", "Real valued FFT buffer object");
return params;
}

FFTBufferAux::FFTBufferAux(const InputParameters & parameters)
: AuxKernel(parameters), _buffer(getUserObject<FFTBufferBase<Real>>("fft_buffer"))
{
}

Real
FFTBufferAux::computeValue()
{
return _buffer(_current_elem->centroid());
}

0 comments on commit 8c34413

Please sign in to comment.