https://mooseframework.inl.gov
CoupleableMooseVariableDependencyIntermediateInterface.C
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 
11 
12 #include "FEProblemBase.h"
13 
16  bool nodal,
17  bool is_fv)
18  : Coupleable(moose_object, nodal, is_fv),
19  ScalarCoupleable(moose_object),
21 {
22  for (MooseVariableFEBase * coupled_var : getCoupledMooseVars())
23  addMooseVariableDependency(coupled_var);
24 }
25 
26 const VariableValue &
28  const std::string & var_name)
29 {
32  _coupled_moose_vars.push_back(moose_var);
34  _coupled_standard_moose_vars.push_back(var);
35 
36  addMooseVariableDependency(moose_var);
37 
39  {
40  if (_c_nodal)
41  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
42  else
43  return (_c_is_implicit) ? var->sln() : var->slnOld();
44  }
45  else
46  {
47  if (_c_nodal)
48  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
49  else
50  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
51  }
52 }
53 
54 const ArrayVariableValue &
56  const std::string & var_name)
57 {
60  _coupled_moose_vars.push_back(moose_var);
62  _coupled_array_moose_vars.push_back(var);
63 
64  addMooseVariableDependency(moose_var);
65 
67  {
68  if (_c_nodal)
69  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
70  else
71  return (_c_is_implicit) ? var->sln() : var->slnOld();
72  }
73  else
74  {
75  if (_c_nodal)
76  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
77  else
78  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
79  }
80 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1430
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
Vector of array coupled variables.
Definition: Coupleable.h:1421
const FieldVariableValue & slnNeighbor() const override
neighbor solutions
THREAD_ID _c_tid
Thread ID of the thread using this object.
Definition: Coupleable.h:1439
This class provides an interface for common operations on field variables of both FE and FV types wit...
const DoFValue & dofValuesNeighbor() const override
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const override
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Definition: Coupleable.h:1415
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1403
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1433
CoupleableMooseVariableDependencyIntermediateInterface(const MooseObject *moose_object, bool nodal, bool is_fv=false)
OutputTools< RealEigenVector >::VariableValue ArrayVariableValue
Definition: MooseTypes.h:349
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:27
const FieldVariableValue & sln() const override
element solutions
const DoFValue & dofValuesOld() const override
const DoFValue & dofValuesOldNeighbor() const override
virtual MooseVariable & getStandardVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested MooseVariable which may be in any system.
const std::vector< MooseVariableFieldBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
Definition: Coupleable.h:70
std::vector< MooseVariableFieldBase * > _coupled_moose_vars
Vector of all coupled variables.
Definition: Coupleable.h:1412
OutputTools< Real >::VariableValue VariableValue
Definition: MooseTypes.h:315
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1702
virtual const VariableValue & coupledValueByName(const std::string &var_name)
Returns value of a coupled variable give the variable name.
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:45
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
const DoFValue & dofValues() const override
dof values getters
virtual const ArrayVariableValue & coupledArrayValueByName(const std::string &var_name)
Returns value of a coupled array variable give the variable name.
Interface for objects that needs scalar coupling capabilities.
virtual ArrayMooseVariable & getArrayVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested ArrayMooseVariable which may be in any system...
const FieldVariableValue & slnOld() const override
const FieldVariableValue & slnOldNeighbor() const override