forked from idaholab/magpie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add aux kernel to read buffer content (idaholab#401)
- Loading branch information
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} |