Line data Source code
1 : /**********************************************************************/ 2 : /* DO NOT MODIFY THIS HEADER */ 3 : /* Swift, a Fourier spectral solver for MOOSE */ 4 : /* */ 5 : /* Copyright 2024 Battelle Energy Alliance, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /**********************************************************************/ 8 : 9 : #pragma once 10 : 11 : #include "TensorOperatorBase.h" 12 : 13 : /** 14 : * TensorOperator object with a single output 15 : */ 16 : template <typename T = torch::Tensor> 17 0 : class TensorOperator : public TensorOperatorBase 18 : { 19 : public: 20 : static InputParameters validParams(); 21 : 22 : TensorOperator(const InputParameters & parameters); 23 : 24 : protected: 25 : /// output buffer 26 : T & _u; 27 : }; 28 : 29 : template <typename T> 30 : InputParameters 31 0 : TensorOperator<T>::validParams() 32 : { 33 0 : InputParameters params = TensorOperatorBase::validParams(); 34 0 : params.addRequiredParam<TensorOutputBufferName>("buffer", 35 : "The buffer this compute is writing to"); 36 0 : params.addClassDescription("TensorOperator object."); 37 0 : return params; 38 0 : } 39 : 40 : template <typename T> 41 0 : TensorOperator<T>::TensorOperator(const InputParameters & parameters) 42 0 : : TensorOperatorBase(parameters), _u(getOutputBuffer<T>("buffer")) 43 : { 44 0 : }