https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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.
 
void isValid (MooseObject *obj)
 

Function Documentation

◆ isValid()

void isValid ( MooseObject obj)

Definition at line 294 of file TheWarehouse.C.

295{
296 auto blk = dynamic_cast<BlockRestrictable *>(obj);
297 if (!blk)
298 return;
299
300 // Check variables
301 auto c_ptr = dynamic_cast<Coupleable *>(obj);
302 if (c_ptr)
303 for (MooseVariableFEBase * var : c_ptr->getCoupledMooseVars())
304 blk->checkVariable(*var);
305
306 const InputParameters & parameters = obj->parameters();
307
308 SubProblem & problem = *parameters.get<SubProblem *>("_subproblem");
309
310 THREAD_ID tid = parameters.get<THREAD_ID>("_tid");
311
312 if (parameters.isParamValid("variable"))
313 {
314 // Try the scalar version first
315 std::string variable_name = parameters.getMooseType("variable");
316 if (variable_name == "")
317 // When using vector variables, we are only going to use the first one in the list at the
318 // interface level...
319 variable_name = parameters.getVecMooseType("variable")[0];
320
321 blk->checkVariable(problem.getVariable(
323 }
324}
unsigned int THREAD_ID
Definition MooseTypes.h:237
An interface that restricts an object to subdomains via the 'blocks' input parameter.
Interface for objects that needs coupling capabilities.
Definition Coupleable.h:53
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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::string > getVecMooseType(const std::string &name) const
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.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another,...
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
This class provides an interface for common operations on field variables of both FE and FV types wit...
Generic class for solving transient nonlinear problems.
Definition SubProblem.h:79
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...
void checkVariable(const Variable &var, bool expect_vector, const std::string &wrapper_name)
@ VAR_FIELD_ANY
Definition MooseTypes.h:781
@ VAR_ANY
Definition MooseTypes.h:772

Referenced by TheWarehouse::add().

◆ 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}