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 MooseVariableFieldBase &variable, const TagID tag)
 Constructor Initialize the variable with a MOOSE variable and vector tag ID. More...
 
 Variable (const MooseVariableFieldBase &variable, const TagName &tag_name=Moose::SOLUTION_TAG)
 Constructor Initialize the variable with a MOOSE variable and vector tag name. More...
 
void init (const MooseVariableFieldBase &variable, const TagID tag)
 Initialize the variable with a MOOSE variable and vector tag ID. More...
 
void init (const MooseVariableFieldBase &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< Real > &values, CoupleableKey)
 Initialize the variable with coupled default values. More...
 
const MooseVariableFieldBasemooseVar (unsigned int comp=0)
 Get the MOOSE variable of a component. More...
 
KOKKOS_FUNCTION bool initialized () const
 Get whether the variable is initialized. More...
 
KOKKOS_FUNCTION bool coupled () const
 Get whether the variable is coupled. More...
 
KOKKOS_FUNCTION bool nodal () const
 Get whether the variable is nodal. More...
 
KOKKOS_FUNCTION bool dot () const
 Get whether the tag is time derivative. More...
 
KOKKOS_FUNCTION bool old () const
 Get whether the tag is old/older value. 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...
 
 Variable (const std::vector< const MooseVariableFieldBase *> &variables, const TagID tag)
 Constructor Initialize the variable with multiple MOOSE variables and vector tag ID. More...
 
 Variable (const std::vector< MooseVariableFieldBase *> &variables, const TagID tag)
 
 Variable (const std::vector< const MooseVariableFieldBase *> &variables, const TagName &tag_name=Moose::SOLUTION_TAG)
 Constructor Initialize the variable with multiple MOOSE variables and vector tag name. More...
 
 Variable (const std::vector< MooseVariableFieldBase *> &variables, const TagName &tag_name=Moose::SOLUTION_TAG)
 
void init (const std::vector< const MooseVariableFieldBase *> &variables, const TagID tag)
 Initialize the variable with multiple MOOSE variables and vector tag ID. More...
 
void init (const std::vector< MooseVariableFieldBase *> &variables, const TagID tag)
 
void init (const std::vector< const MooseVariableFieldBase *> &variables, const TagName &tag_name=Moose::SOLUTION_TAG)
 Initialize the variable with multiple MOOSE variables and vector tag name. More...
 
void init (const std::vector< MooseVariableFieldBase *> &variables, const TagName &tag_name=Moose::SOLUTION_TAG)
 

Private Attributes

bool _initialized = false
 Whether the variable is initialized. More...
 
bool _coupled = false
 Whether the variable is coupled. More...
 
bool _nodal = false
 Whether the variable is nodal. More...
 
bool _dot = false
 Whether the tag is time derivative. More...
 
bool _old = false
 Whether the tag is old/older value. More...
 
unsigned int _components = 1
 Number of components. More...
 
TagID _tag = Moose::INVALID_TAG_ID
 Vector tag ID. More...
 
Array< const MooseVariableFieldBase * > _moose_var
 MOOSE variable of each component. 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 26 of file KokkosVariable.h.

Member Typedef Documentation

◆ CoupleableKey

Definition at line 29 of file KokkosVariable.h.

Constructor & Destructor Documentation

◆ Variable() [1/7]

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

Default constructor.

◆ Variable() [2/7]

Moose::Kokkos::Variable::Variable ( const MooseVariableFieldBase 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 41 of file KokkosVariable.h.

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

◆ Variable() [3/7]

Moose::Kokkos::Variable::Variable ( const MooseVariableFieldBase 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 48 of file KokkosVariable.h.

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

◆ Variable() [4/7]

Moose::Kokkos::Variable::Variable ( const std::vector< const MooseVariableFieldBase *> &  variables,
const TagID  tag 
)
inline

Constructor Initialize the variable with multiple MOOSE variables and vector tag ID.

Parameters
variablesThe MOOSE variables
tagThe vector tag ID

Definition at line 59 of file KokkosVariable.h.

60  {
61  init(variables, tag);
62  }
KOKKOS_FUNCTION TagID tag() const
Get the vector tag ID.
void init(const MooseVariableFieldBase &variable, const TagID tag)
Initialize the variable with a MOOSE variable and vector tag ID.

◆ Variable() [5/7]

Moose::Kokkos::Variable::Variable ( const std::vector< MooseVariableFieldBase *> &  variables,
const TagID  tag 
)
inline

Definition at line 63 of file KokkosVariable.h.

64  {
65  init(variables, tag);
66  }
KOKKOS_FUNCTION TagID tag() const
Get the vector tag ID.
void init(const MooseVariableFieldBase &variable, const TagID tag)
Initialize the variable with a MOOSE variable and vector tag ID.

◆ Variable() [6/7]

Moose::Kokkos::Variable::Variable ( const std::vector< const MooseVariableFieldBase *> &  variables,
const TagName &  tag_name = Moose::SOLUTION_TAG 
)
inline

Constructor Initialize the variable with multiple MOOSE variables and vector tag name.

Parameters
variablesThe MOOSE variables
tagThe vector tag ID

Definition at line 75 of file KokkosVariable.h.

77  {
78  init(variables, tag_name);
79  }
void init(const MooseVariableFieldBase &variable, const TagID tag)
Initialize the variable with a MOOSE variable and vector tag ID.

◆ Variable() [7/7]

Moose::Kokkos::Variable::Variable ( const std::vector< MooseVariableFieldBase *> &  variables,
const TagName &  tag_name = Moose::SOLUTION_TAG 
)
inline

Definition at line 80 of file KokkosVariable.h.

82  {
83  init(variables, tag_name);
84  }
void init(const MooseVariableFieldBase &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 164 of file KokkosVariable.h.

Referenced by Moose::Kokkos::VariableGradientTempl< is_ad >::VariableGradientTempl(), and Moose::Kokkos::VariableValueTempl< is_ad >::VariableValueTempl().

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

◆ coupled()

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

◆ dot()

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

Get whether the tag is time derivative.

Returns
Whether the tag is time derivative

Definition at line 154 of file KokkosVariable.h.

Referenced by Moose::Kokkos::VariableGradientTempl< is_ad >::VariableGradientTempl(), and Moose::Kokkos::VariableValueTempl< is_ad >::VariableValueTempl().

154 { return _dot; }
bool _dot
Whether the tag is time derivative.

◆ init() [1/7]

void Moose::Kokkos::Variable::init ( const MooseVariableFieldBase 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/7]

void Moose::Kokkos::Variable::init ( const MooseVariableFieldBase 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/7]

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

Initialize the variable with multiple MOOSE variables and vector tag ID.

Parameters
variablesThe MOOSE variables
tagThe vector tag ID

◆ init() [4/7]

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

◆ init() [5/7]

void Moose::Kokkos::Variable::init ( const std::vector< const MooseVariableFieldBase *> &  variables,
const TagName &  tag_name = Moose::SOLUTION_TAG 
)

Initialize the variable with multiple MOOSE variables and vector tag name.

Parameters
variablesThe MOOSE variables
tag_nameThe vector tag name

◆ init() [6/7]

void Moose::Kokkos::Variable::init ( const std::vector< MooseVariableFieldBase *> &  variables,
const TagName &  tag_name = Moose::SOLUTION_TAG 
)

◆ init() [7/7]

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

Initialize the variable with coupled default values.

Parameters
valuesThe default coupled values

◆ initialized()

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

Get whether the variable is initialized.

Returns
Whether the variable is initialized

Definition at line 139 of file KokkosVariable.h.

139 { return _initialized; }
bool _initialized
Whether the variable is initialized.

◆ mooseVar()

const MooseVariableFieldBase* Moose::Kokkos::Variable::mooseVar ( unsigned int  comp = 0)
inline

Get the MOOSE variable of a component.

Parameters
compThe variable component
Returns
The MOOSE variable

Definition at line 130 of file KokkosVariable.h.

Referenced by Moose::Kokkos::VariableGradientTempl< is_ad >::VariableGradientTempl(), and Moose::Kokkos::VariableValueTempl< is_ad >::VariableValueTempl().

131  {
132  return _moose_var.size() ? _moose_var[comp] : nullptr;
133  }
KOKKOS_FUNCTION index_type size() const
Get the total array size.
Definition: KokkosArray.h:205
Array< const MooseVariableFieldBase * > _moose_var
MOOSE variable of each component.

◆ nodal()

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

Get whether the variable is nodal.

Returns
Whether the variable is nodal

Definition at line 149 of file KokkosVariable.h.

Referenced by Moose::Kokkos::Datum::isNodalDefined().

149 { return _nodal; }
bool _nodal
Whether the variable is nodal.

◆ old()

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

Get whether the tag is old/older value.

Returns
Whether the tag is old/older value

Definition at line 159 of file KokkosVariable.h.

Referenced by Moose::Kokkos::VariableGradientTempl< is_ad >::VariableGradientTempl(), and Moose::Kokkos::VariableValueTempl< is_ad >::VariableValueTempl().

159 { return _old; }
bool _old
Whether the tag is old/older value.

◆ 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

◆ 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 187 of file KokkosVariable.h.

188  {
189  KOKKOS_ASSERT(!_coupled);
190 
191  return _default_value[comp];
192  }
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 218 of file KokkosVariable.h.

Referenced by components().

◆ _coupled

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

Whether the variable is coupled.

Definition at line 202 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 238 of file KokkosVariable.h.

Referenced by value().

◆ _dot

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

Whether the tag is time derivative.

Definition at line 210 of file KokkosVariable.h.

Referenced by dot().

◆ _initialized

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

Whether the variable is initialized.

Definition at line 198 of file KokkosVariable.h.

Referenced by initialized().

◆ _moose_var

Array<const MooseVariableFieldBase *> Moose::Kokkos::Variable::_moose_var
private

MOOSE variable of each component.

Definition at line 226 of file KokkosVariable.h.

Referenced by mooseVar().

◆ _nodal

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

Whether the variable is nodal.

Definition at line 206 of file KokkosVariable.h.

Referenced by nodal().

◆ _old

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

Whether the tag is old/older value.

Definition at line 214 of file KokkosVariable.h.

Referenced by old().

◆ _sys

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

System number of each component.

Definition at line 234 of file KokkosVariable.h.

Referenced by sys().

◆ _tag

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

Vector tag ID.

Definition at line 222 of file KokkosVariable.h.

Referenced by tag().

◆ _var

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

Variable number of each component.

Definition at line 230 of file KokkosVariable.h.

Referenced by var().


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