www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
MaterialVectorAuxKernelAction Class Reference

#include <MaterialVectorAuxKernelAction.h>

Inheritance diagram for MaterialVectorAuxKernelAction:
[legend]

Public Member Functions

 MaterialVectorAuxKernelAction (const InputParameters &params)
 
virtual void act ()
 

Protected Attributes

const unsigned int _grain_num
 number of grains to create More...
 
const std::vector< std::string > & _var_name_base
 base name for the auxvariables More...
 
const unsigned int _num_var
 number of auxvariables More...
 
const std::vector< MaterialPropertyName > & _prop
 list of material properties to be used More...
 
const unsigned int _num_prop
 number of properties More...
 

Detailed Description

Definition at line 12 of file MaterialVectorAuxKernelAction.h.

Constructor & Destructor Documentation

MaterialVectorAuxKernelAction::MaterialVectorAuxKernelAction ( const InputParameters &  params)

Definition at line 28 of file MaterialVectorAuxKernelAction.C.

29  : Action(params),
30  _grain_num(getParam<unsigned int>("grain_num")),
31  _var_name_base(getParam<std::vector<std::string>>("variable_base")),
32  _num_var(_var_name_base.size()),
33  _prop(getParam<std::vector<MaterialPropertyName>>("property")),
34  _num_prop(_prop.size())
35 {
36 }
const unsigned int _grain_num
number of grains to create
const std::vector< MaterialPropertyName > & _prop
list of material properties to be used
const unsigned int _num_prop
number of properties
const unsigned int _num_var
number of auxvariables
const std::vector< std::string > & _var_name_base
base name for the auxvariables

Member Function Documentation

void MaterialVectorAuxKernelAction::act ( )
virtual

Reimplemented in MaterialVectorGradAuxKernelAction.

Definition at line 39 of file MaterialVectorAuxKernelAction.C.

40 {
41  if (_num_prop != _num_var)
42  mooseError("variable_base and property must be vectors of the same size");
43 
44  for (unsigned int gr = 0; gr < _grain_num; ++gr)
45  for (unsigned int val = 0; val < _num_var; ++val)
46  {
47  std::string var_name = _var_name_base[val] + Moose::stringify(gr);
48 
49  InputParameters params = _factory.getValidParams("MaterialStdVectorAux");
50  params.set<AuxVariableName>("variable") = var_name;
51  params.set<MaterialPropertyName>("property") = _prop[val];
52  params.set<unsigned int>("index") = gr;
53  params.set<bool>("use_displaced_mesh") = getParam<bool>("use_displaced_mesh");
54 
55  std::string aux_kernel_name = var_name;
56  _problem->addAuxKernel("MaterialStdVectorAux", aux_kernel_name, params);
57  }
58 }
const unsigned int _grain_num
number of grains to create
const std::vector< MaterialPropertyName > & _prop
list of material properties to be used
const unsigned int _num_prop
number of properties
const unsigned int _num_var
number of auxvariables
const std::vector< std::string > & _var_name_base
base name for the auxvariables

Member Data Documentation

const unsigned int MaterialVectorAuxKernelAction::_grain_num
protected

number of grains to create

Definition at line 21 of file MaterialVectorAuxKernelAction.h.

Referenced by act(), and MaterialVectorGradAuxKernelAction::act().

const unsigned int MaterialVectorAuxKernelAction::_num_prop
protected

number of properties

Definition at line 33 of file MaterialVectorAuxKernelAction.h.

Referenced by act(), and MaterialVectorGradAuxKernelAction::act().

const unsigned int MaterialVectorAuxKernelAction::_num_var
protected

number of auxvariables

Definition at line 27 of file MaterialVectorAuxKernelAction.h.

Referenced by act(), and MaterialVectorGradAuxKernelAction::act().

const std::vector<MaterialPropertyName>& MaterialVectorAuxKernelAction::_prop
protected

list of material properties to be used

Definition at line 30 of file MaterialVectorAuxKernelAction.h.

Referenced by act(), and MaterialVectorGradAuxKernelAction::act().

const std::vector<std::string>& MaterialVectorAuxKernelAction::_var_name_base
protected

base name for the auxvariables

Definition at line 24 of file MaterialVectorAuxKernelAction.h.

Referenced by act(), and MaterialVectorGradAuxKernelAction::act().


The documentation for this class was generated from the following files: