https://mooseframework.inl.gov
Loading...
Searching...
No Matches
TorchStressDivergence.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#ifdef NEML2_ENABLED
13
14// libmesh includes
15#include "libmesh/petsc_vector.h"
16
17// MOOSE includes
18#include "TorchPostKernel.h"
19
21{
22public:
24
26
27protected:
29 void forward() override;
30
33
35 const at::Tensor & _stress;
36
38 const std::vector<NonlinearVariableName> _disp_vars;
39
41 const int64_t _ndisp;
42
44 const at::Tensor * _grad_test_x;
45 const at::Tensor * _grad_test_y;
46 const at::Tensor * _grad_test_z;
47};
48
49#endif // NEML2_ENABLED
const InputParameters & parameters() const
const at::Tensor * _grad_test_x
test function gradients
const std::vector< NonlinearVariableName > _disp_vars
Displacement variables.
const at::Tensor * _grad_test_z
static InputParameters validParams()
const int64_t _ndisp
the number of displacement variables
void forward() override
calculate residual contribution corresponding to the weak form $\phi_{i,J} P_{iJ}$
libMesh::PetscVector< Real > * _residual
The residual vector.
const at::Tensor * _grad_test_y
const at::Tensor & _stress
stress (a NEML2 model output, 6-component Mandel)