当前位置: 首页>>代码示例>>C++>>正文


C++ MooseSharedPointer::boundaryRestricted方法代码示例

本文整理汇总了C++中MooseSharedPointer::boundaryRestricted方法的典型用法代码示例。如果您正苦于以下问题:C++ MooseSharedPointer::boundaryRestricted方法的具体用法?C++ MooseSharedPointer::boundaryRestricted怎么用?C++ MooseSharedPointer::boundaryRestricted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MooseSharedPointer的用法示例。


在下文中一共展示了MooseSharedPointer::boundaryRestricted方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

void
AuxiliarySystem::addKernel(const std::string & kernel_name, const std::string & name, InputParameters parameters)
{
  parameters.set<AuxiliarySystem *>("_aux_sys") = this;
  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
  {
    parameters.set<THREAD_ID>("_tid") = tid;

    MooseSharedPointer<AuxKernel> kernel = MooseSharedNamespace::static_pointer_cast<AuxKernel>(_factory.create(kernel_name, name, parameters));

    // Add this AuxKernel to multiple ExecStores
    const std::vector<ExecFlagType> & exec_flags = kernel->execFlags();
    for (unsigned int i=0; i<exec_flags.size(); ++i)
      _auxs(exec_flags[i])[tid].addAuxKernel(kernel);

    _mproblem._objects_by_name[tid][name].push_back(kernel.get());

    if (kernel->boundaryRestricted())
    {
      const std::set<BoundaryID> & boundary_ids = kernel->boundaryIDs();
      for (std::set<BoundaryID>::const_iterator it = boundary_ids.begin(); it != boundary_ids.end(); ++it)
        _vars[tid].addBoundaryVar(*it, &kernel->variable());
    }
  }
}
开发者ID:MatthewWilliamNoble,项目名称:moose,代码行数:25,代码来源:AuxiliarySystem.C

示例2:

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;
}
开发者ID:katyhuff,项目名称:moose,代码行数:37,代码来源:MaterialOutputAction.C


注:本文中的MooseSharedPointer::boundaryRestricted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。