https://mooseframework.inl.gov
Loading...
Searching...
No Matches
TorchPreKernel.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12// NEML2_ENABLED implies MOOSE_LIBTORCH_ENABLED (neml2 is built against libtorch), so the
13// TorchKernel base is available here.
14#ifdef NEML2_ENABLED
15
16// MOOSE includes
17#include "TorchKernel.h"
18#include "MOOSEToNEML2.h"
19
23{
24public:
26
28
29 at::Tensor gatheredData() const override { return _output; }
30};
31
32#endif // NEML2_ENABLED
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Common interface for inserting gathered MOOSE data into the NEML2 material model.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
TorchKernel is a conceptual extension of a MOOSE kernel that operates on batched libtorch tensors.
Definition TorchKernel.h:37
at::Tensor _output
The output of the forward operator.
Definition TorchKernel.h:59
Base class for Torch FEM kernels that operate before the constitutive update, feeding their gathered ...
static InputParameters validParams()
at::Tensor gatheredData() const override
Convert data gathered from MOOSE into an at::Tensor (shape (batch, *base_shape))