https://mooseframework.inl.gov
Public Types | Public Member Functions | Private Attributes | List of all members
Moose::Kokkos::Variable Class Reference

The Kokkos variable object that carries the coupled variable and tag information. More...

#include <KokkosVariable.h>

Public Types

using CoupleableKey = ::Moose::PassKey<::Coupleable >
 

Public Member Functions

 Variable ()=default
 Default constructor. More...
 
 Variable (const MooseVariableBase &variable, const TagID tag)
 Constructor Initialize the variable with a MOOSE variable and vector tag ID. More...
 
 Variable (const MooseVariableBase &variable, const TagName &tag_name=Moose::SOLUTION_TAG)
 Constructor Initialize the variable with a MOOSE variable and vector tag name. More...
 
void init (const MooseVariableBase &variable, const TagID tag)
 Initialize the variable with a MOOSE variable and vector tag ID. More...
 
void init (const MooseVariableBase &variable, const TagName &tag_name=Moose::SOLUTION_TAG)
 Initialize the variable with a MOOSE variable and vector tag name. More...
 
void init (const std::vector< const MooseVariableBase *> &variables, const TagID tag, CoupleableKey)
 Initialize the variable with coupled MOOSE variables. More...
 
void init (const std::vector< Real > &values, CoupleableKey)
 Initialize the variable with coupled default values. More...
 
KOKKOS_FUNCTION bool coupled () const
 Get whether the variable is coupled. More...
 
KOKKOS_FUNCTION unsigned int components ()
 Get the number of components. More...
 
KOKKOS_FUNCTION TagID tag () const
 Get the vector tag ID. More...
 
KOKKOS_FUNCTION unsigned int var (unsigned int comp=0) const
 Get the variable number of a component. More...
 
KOKKOS_FUNCTION unsigned int sys (unsigned int comp=0) const
 Get the system number of a component. More...
 
KOKKOS_FUNCTION Real value (unsigned int comp=0) const
 Get the default value of a component. More...
 

Private Attributes

bool _coupled = false
 Whether the variable is coupled. More...
 
unsigned int _components = 1
 Number of components. More...
 
TagID _tag = Moose::INVALID_TAG_ID
 Vector tag ID. More...
 
Array< unsigned int_var
 Variable number of each component. More...
 
Array< unsigned int_sys
 System number of each component. More...
 
Array< Real_default_value
 Default value of each component when the variable is not coupled. More...
 

Detailed Description

The Kokkos variable object that carries the coupled variable and tag information.

Definition at line 28 of file KokkosVariable.h.

Member Typedef Documentation

◆ CoupleableKey

Definition at line 31 of file KokkosVariable.h.

Constructor & Destructor Documentation

◆ Variable() [1/3]

Moose::Kokkos::Variable::Variable ( )
default

Default constructor.

◆ Variable() [2/3]

Moose::Kokkos::Variable::Variable ( const MooseVariableBase variable,
const TagID  tag 
)
inline

Constructor Initialize the variable with a MOOSE variable and vector tag ID.

Parameters
variableThe MOOSE variable
tagThe vector tag ID

Definition at line 43 of file KokkosVariable.h.

43 { init(variable, tag); }
KOKKOS_FUNCTION TagID tag() const
Get the vector tag ID.
void init(const MooseVariableBase &variable, const TagID tag)
Initialize the variable with a MOOSE variable and vector tag ID.

◆ Variable() [3/3]

Moose::Kokkos::Variable::Variable ( const MooseVariableBase variable,
const TagName &  tag_name = Moose::SOLUTION_TAG 
)
inline

Constructor Initialize the variable with a MOOSE variable and vector tag name.

Parameters
variableThe MOOSE variable
tag_nameThe vector tag name

Definition at line 50 of file KokkosVariable.h.

51  {
52  init(variable, tag_name);
53  }
void init(const MooseVariableBase &variable, const TagID tag)
Initialize the variable with a MOOSE variable and vector tag ID.

Member Function Documentation

◆ components()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::Variable::components ( )
inline

Get the number of components.

Returns
The number of components

Definition at line 88 of file KokkosVariable.h.

88 { return _components; }
unsigned int _components
Number of components.

◆ coupled()

KOKKOS_FUNCTION bool Moose::Kokkos::Variable::coupled ( ) const
inline

◆ init() [1/4]

void Moose::Kokkos::Variable::init ( const MooseVariableBase variable,
const TagID  tag 
)

Initialize the variable with a MOOSE variable and vector tag ID.

Parameters
variableThe MOOSE variable
tagThe vector tag ID

Referenced by Variable().

◆ init() [2/4]

void Moose::Kokkos::Variable::init ( const MooseVariableBase variable,
const TagName &  tag_name = Moose::SOLUTION_TAG 
)

Initialize the variable with a MOOSE variable and vector tag name.

Parameters
variableThe MOOSE variable
tag_nameThe vector tag name

◆ init() [3/4]

void Moose::Kokkos::Variable::init ( const std::vector< const MooseVariableBase *> &  variables,
const TagID  tag,
CoupleableKey   
)

Initialize the variable with coupled MOOSE variables.

Parameters
variablesThe coupled MOOSE variables
tagThe vector tag ID

◆ init() [4/4]

void Moose::Kokkos::Variable::init ( const std::vector< Real > &  values,
CoupleableKey   
)

Initialize the variable with coupled default values.

Parameters
valuesThe default coupled values

◆ sys()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::Variable::sys ( unsigned int  comp = 0) const
inline

◆ tag()

KOKKOS_FUNCTION TagID Moose::Kokkos::Variable::tag ( ) const
inline

Get the vector tag ID.

Returns
The vector tag ID

Definition at line 93 of file KokkosVariable.h.

Referenced by Moose::Kokkos::VariableValue::operator()(), Moose::Kokkos::VariableNodalValue::operator()(), Moose::Kokkos::VariableGradient::operator()(), and Variable().

93 { return _tag; }
TagID _tag
Vector tag ID.

◆ value()

KOKKOS_FUNCTION Real Moose::Kokkos::Variable::value ( unsigned int  comp = 0) const
inline

Get the default value of a component.

Parameters
compThe variable component
Returns
The default value

Definition at line 111 of file KokkosVariable.h.

Referenced by Moose::Kokkos::VariableValue::operator()(), and Moose::Kokkos::VariableNodalValue::operator()().

112  {
113  KOKKOS_ASSERT(!_coupled);
114 
115  return _default_value[comp];
116  }
Array< Real > _default_value
Default value of each component when the variable is not coupled.
bool _coupled
Whether the variable is coupled.

◆ var()

KOKKOS_FUNCTION unsigned int Moose::Kokkos::Variable::var ( unsigned int  comp = 0) const
inline

Member Data Documentation

◆ _components

unsigned int Moose::Kokkos::Variable::_components = 1
private

Number of components.

Definition at line 126 of file KokkosVariable.h.

Referenced by components().

◆ _coupled

bool Moose::Kokkos::Variable::_coupled = false
private

Whether the variable is coupled.

Definition at line 122 of file KokkosVariable.h.

Referenced by coupled(), and value().

◆ _default_value

Array<Real> Moose::Kokkos::Variable::_default_value
private

Default value of each component when the variable is not coupled.

Definition at line 142 of file KokkosVariable.h.

Referenced by value().

◆ _sys

Array<unsigned int> Moose::Kokkos::Variable::_sys
private

System number of each component.

Definition at line 138 of file KokkosVariable.h.

Referenced by sys().

◆ _tag

TagID Moose::Kokkos::Variable::_tag = Moose::INVALID_TAG_ID
private

Vector tag ID.

Definition at line 130 of file KokkosVariable.h.

Referenced by tag().

◆ _var

Array<unsigned int> Moose::Kokkos::Variable::_var
private

Variable number of each component.

Definition at line 134 of file KokkosVariable.h.

Referenced by var().


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