Skip to content

Commit 1ae87ec

Browse files
committed
Add aux kernel to read buffer content (idaholab#401)
1 parent c92b69c commit 1ae87ec

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

include/auxkernels/FFTBufferAux.h

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
#pragma once
10+
11+
#include "AuxKernel.h"
12+
13+
class FFTBufferAux;
14+
template <typename T>
15+
class FFTBufferBase;
16+
17+
template <>
18+
InputParameters validParams<FFTBufferAux>();
19+
20+
/**
21+
*
22+
*/
23+
class FFTBufferAux : public AuxKernel
24+
{
25+
public:
26+
FFTBufferAux(const InputParameters & parameters);
27+
28+
protected:
29+
virtual Real computeValue() override;
30+
31+
const FFTBufferBase<Real> & _buffer;
32+
};

src/auxkernels/FFTBufferAux.C

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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 "FFTBufferAux.h"
10+
#include "FFTBufferBase.h"
11+
12+
registerMooseObject("MagpieApp", FFTBufferAux);
13+
14+
template <>
15+
InputParameters
16+
validParams<FFTBufferAux>()
17+
{
18+
InputParameters params = validParams<AuxKernel>();
19+
params.addClassDescription("Fetch values from an FFT buffer.");
20+
params.addRequiredParam<UserObjectName>("fft_buffer", "Real valued FFT buffer object");
21+
return params;
22+
}
23+
24+
FFTBufferAux::FFTBufferAux(const InputParameters & parameters)
25+
: AuxKernel(parameters), _buffer(getUserObject<FFTBufferBase<Real>>("fft_buffer"))
26+
{
27+
}
28+
29+
Real
30+
FFTBufferAux::computeValue()
31+
{
32+
return _buffer(_current_elem->centroid());
33+
}

0 commit comments

Comments
 (0)