本文整理汇总了C++中MooseSharedPointer::blocks方法的典型用法代码示例。如果您正苦于以下问题:C++ MooseSharedPointer::blocks方法的具体用法?C++ MooseSharedPointer::blocks怎么用?C++ MooseSharedPointer::blocks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MooseSharedPointer
的用法示例。
在下文中一共展示了MooseSharedPointer::blocks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
MooseSharedPointer<MooseObjectAction>
MaterialOutputAction::createAction(const std::string & type, const std::string & property_name,
const std::string & variable_name, MooseSharedPointer<MaterialBase> material)
{
// Append the list of variables to create
_variable_names.insert(variable_name);
// Append the list of output variables for the current material
_material_variable_names.insert(variable_name);
// Generate the name
std::ostringstream name;
name << material->name() << "_" << variable_name;
// Set the action parameters
InputParameters action_params = _action_factory.getValidParams("AddKernelAction");
action_params.set<std::string>("type") = type;
action_params.set<ActionWarehouse *>("awh") = &_awh;
action_params.set<std::string>("task") = "add_aux_kernel";
// Create the action
MooseSharedPointer<MooseObjectAction> action = MooseSharedNamespace::static_pointer_cast<MooseObjectAction>(_action_factory.create("AddKernelAction", name.str(), action_params));
// Set the object parameters
InputParameters & object_params = action->getObjectParams();
object_params.set<MaterialPropertyName>("property") = property_name;
object_params.set<AuxVariableName>("variable") = variable_name;
object_params.set<MultiMooseEnum>("execute_on") = "timestep_end";
if (material->boundaryRestricted())
object_params.set<std::vector<BoundaryName> >("boundary") = material->boundaryNames();
else
object_params.set<std::vector<SubdomainName> >("block") = material->blocks();
// Return the created action
return action;
}