https://mooseframework.inl.gov
Classes | Functions
TheWarehouse.C File Reference

Go to the source code of this file.

Classes

class  WarehouseStorage
 
class  VecStore
 

Functions

bool operator== (const std::unique_ptr< Attribute > &lhs, const std::unique_ptr< Attribute > &rhs)
 TheWarehouse uses this operator function for indexing and caching queries. More...
 
void isValid (MooseObject *obj)
 

Function Documentation

◆ isValid()

void isValid ( MooseObject obj)

Definition at line 287 of file TheWarehouse.C.

Referenced by TheWarehouse::add(), and InputParameters::isParamValid().

288 {
289  auto blk = dynamic_cast<BlockRestrictable *>(obj);
290  if (!blk)
291  return;
292 
293  // Check variables
294  auto c_ptr = dynamic_cast<Coupleable *>(obj);
295  if (c_ptr)
296  for (MooseVariableFEBase * var : c_ptr->getCoupledMooseVars())
297  blk->checkVariable(*var);
298 
299  const InputParameters & parameters = obj->parameters();
300 
301  SubProblem & problem = *parameters.get<SubProblem *>("_subproblem");
302 
303  THREAD_ID tid = parameters.get<THREAD_ID>("_tid");
304 
305  if (parameters.isParamValid("variable"))
306  {
307  // Try the scalar version first
308  std::string variable_name = parameters.getMooseType("variable");
309  if (variable_name == "")
310  // When using vector variables, we are only going to use the first one in the list at the
311  // interface level...
312  variable_name = parameters.getVecMooseType("variable")[0];
313 
314  blk->checkVariable(problem.getVariable(
316  }
317 }
std::string getMooseType(const std::string &name) const
Utility functions for retrieving one of the MooseTypes variables into the common "string" base class...
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
This class provides an interface for common operations on field variables of both FE and FV types wit...
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 =0
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:45
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:78
An interface that restricts an object to subdomains via the &#39;blocks&#39; input parameter.
const InputParameters & parameters() const
Get the parameters of the object.
std::vector< std::string > getVecMooseType(const std::string &name) const
unsigned int THREAD_ID
Definition: MooseTypes.h:209
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ operator==()

bool operator== ( const std::unique_ptr< Attribute > &  lhs,
const std::unique_ptr< Attribute > &  rhs 
)

TheWarehouse uses this operator function for indexing and caching queries.

So this is important even though you don't see it being called (directly) anywhere - it IS being used.

Definition at line 31 of file TheWarehouse.C.

32 {
33  return (*lhs) == (*rhs);
34 }