https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
MOOSEToNEML2 Class Referenceabstract

Common interface for inserting gathered MOOSE data into the NEML2 material model. More...

#include <MOOSEToNEML2.h>

Inheritance diagram for MOOSEToNEML2:
[legend]

Public Member Functions

 MOOSEToNEML2 (const InputParameters &params)
 
const std::string & NEML2Name () const
 Name of the NEML2 variable/parameter.
 
virtual at::Tensor gatheredData () const =0
 Convert data gathered from MOOSE into an at::Tensor (shape (batch, *base_shape))
 
void insertInto (std::map< std::string, at::Tensor > &) const
 Insert the gathered data into the NEML2 model input map.
 

Static Public Member Functions

static InputParameters validParams ()
 

Private Attributes

const std::string _neml2_name
 Name of the input variable or model parameter.
 

Detailed Description

Common interface for inserting gathered MOOSE data into the NEML2 material model.

This interface handles the insertion into both NEML2 input variable and NEML2 model parameter.

Users are only required to provide the name of the variable/parameter, and we perform a run-time introspection of the NEML2 model to determine if the supplied name is for a NEML2 variable or for a NEML2 model parameter.

Definition at line 27 of file MOOSEToNEML2.h.

Constructor & Destructor Documentation

◆ MOOSEToNEML2()

MOOSEToNEML2::MOOSEToNEML2 ( const InputParameters &  params)

Definition at line 23 of file MOOSEToNEML2.C.

23{}

Member Function Documentation

◆ gatheredData()

virtual at::Tensor MOOSEToNEML2::gatheredData ( ) const
pure virtual

Convert data gathered from MOOSE into an at::Tensor (shape (batch, *base_shape))

Implemented in TorchPreKernel, and MOOSEQuantityToNEML2< T, state >.

Referenced by insertInto().

◆ insertInto()

void MOOSEToNEML2::insertInto ( std::map< std::string, at::Tensor > &  map) const

Insert the gathered data into the NEML2 model input map.

Definition at line 34 of file MOOSEToNEML2.C.

35{
37}
const std::string _neml2_name
Name of the input variable or model parameter.
virtual at::Tensor gatheredData() const =0
Convert data gathered from MOOSE into an at::Tensor (shape (batch, *base_shape))

◆ NEML2Name()

const std::string & MOOSEToNEML2::NEML2Name ( ) const
inline

Name of the NEML2 variable/parameter.

Definition at line 36 of file MOOSEToNEML2.h.

36{ return _neml2_name; }

Referenced by TorchPreKernel::TorchPreKernel().

◆ validParams()

InputParameters MOOSEToNEML2::validParams ( )
static

Definition at line 13 of file MOOSEToNEML2.C.

14{
15 auto params = emptyInputParameters();
16 params.addRequiredParam<std::string>("to_neml2",
17 "Name of the NEML2 variable or parameter to write to");
18 return params;
19}
InputParameters emptyInputParameters()

Referenced by TorchPreKernel::validParams(), and MOOSEQuantityToNEML2< T, state >::validParams().

Member Data Documentation

◆ _neml2_name

const std::string MOOSEToNEML2::_neml2_name
private

Name of the input variable or model parameter.

Definition at line 46 of file MOOSEToNEML2.h.

Referenced by insertInto(), and NEML2Name().


The documentation for this class was generated from the following files: