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

#include <MaterialVectorGradAuxKernelAction.h>

Inheritance diagram for MaterialVectorGradAuxKernelAction:
[legend]

Public Member Functions

 MaterialVectorGradAuxKernelAction (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 MaterialVectorGradAuxKernelAction.h.

Constructor & Destructor Documentation

MaterialVectorGradAuxKernelAction::MaterialVectorGradAuxKernelAction ( const InputParameters &  params)

Definition at line 22 of file MaterialVectorGradAuxKernelAction.C.

24 {
25 }
MaterialVectorAuxKernelAction(const InputParameters &params)

Member Function Documentation

void MaterialVectorGradAuxKernelAction::act ( )
virtual

Reimplemented from MaterialVectorAuxKernelAction.

Definition at line 28 of file MaterialVectorGradAuxKernelAction.C.

29 {
30  if (_num_prop != _num_var)
31  mooseError("variable_base and property must be vectors of the same size");
32 
33  // mesh dimension required for gradient variables
34  unsigned int dim = _mesh->dimension();
35  // For Specifying the components of the gradient terms
36  const std::vector<char> suffix = {'x', 'y', 'z'};
37 
38  for (unsigned int gr = 0; gr < _grain_num; ++gr)
39  for (unsigned int val = 0; val < _num_var; ++val)
40  for (unsigned int x = 0; x < dim; ++x)
41  {
42  std::string var_name = _var_name_base[val] + Moose::stringify(gr) + "_" + suffix[x];
43 
44  InputParameters params = _factory.getValidParams("MaterialStdVectorRealGradientAux");
45  params.set<AuxVariableName>("variable") = var_name;
46  params.set<MaterialPropertyName>("property") = _prop[val];
47  params.set<unsigned int>("component") = x;
48  params.set<unsigned int>("index") = gr;
49  params.set<bool>("use_displaced_mesh") = getParam<bool>("use_displaced_mesh");
50 
51  std::string aux_kernel_name = var_name;
52  _problem->addAuxKernel("MaterialStdVectorRealGradientAux", aux_kernel_name, params);
53  }
54 }
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
protectedinherited

number of grains to create

Definition at line 21 of file MaterialVectorAuxKernelAction.h.

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

const unsigned int MaterialVectorAuxKernelAction::_num_prop
protectedinherited

number of properties

Definition at line 33 of file MaterialVectorAuxKernelAction.h.

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

const unsigned int MaterialVectorAuxKernelAction::_num_var
protectedinherited

number of auxvariables

Definition at line 27 of file MaterialVectorAuxKernelAction.h.

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

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

list of material properties to be used

Definition at line 30 of file MaterialVectorAuxKernelAction.h.

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

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

base name for the auxvariables

Definition at line 24 of file MaterialVectorAuxKernelAction.h.

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


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