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 "MooseObject.h" 12 : #include "SwiftTypes.h" 13 : 14 : #include <torch/torch.h> 15 : 16 : class TensorProblem; 17 : class DomainAction; 18 : 19 : /** 20 : * TensorPredictor object 21 : */ 22 0 : class TensorPredictor : public MooseObject 23 : { 24 : public: 25 : static InputParameters validParams(); 26 : 27 : TensorPredictor(const InputParameters & parameters); 28 : 29 : /// perform the computation 30 : virtual void computeBuffer() = 0; 31 : 32 : /// called if the simulation cell dimensions change 33 0 : virtual void gridChanged() {} 34 : 35 : protected: 36 : TensorProblem & _tensor_problem; 37 : const DomainAction & _domain; 38 : 39 : const TensorOutputBufferName & _u_name; 40 : 41 : /// output buffer 42 : torch::Tensor & _u; 43 : 44 : /// old states of the output buffer 45 : const std::vector<torch::Tensor> & _u_old; 46 : };