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 15 of file MaterialVectorGradAuxKernelAction.h.

Constructor & Destructor Documentation

◆ MaterialVectorGradAuxKernelAction()

MaterialVectorGradAuxKernelAction::MaterialVectorGradAuxKernelAction ( const InputParameters &  params)

Definition at line 27 of file MaterialVectorGradAuxKernelAction.C.

29 {
30 }
MaterialVectorAuxKernelAction(const InputParameters &params)

Member Function Documentation

◆ act()

void MaterialVectorGradAuxKernelAction::act ( )
virtual

Reimplemented from MaterialVectorAuxKernelAction.

Definition at line 33 of file MaterialVectorGradAuxKernelAction.C.

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

◆ _grain_num

const unsigned int MaterialVectorAuxKernelAction::_grain_num
protectedinherited

number of grains to create

Definition at line 24 of file MaterialVectorAuxKernelAction.h.

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

◆ _num_prop

const unsigned int MaterialVectorAuxKernelAction::_num_prop
protectedinherited

number of properties

Definition at line 36 of file MaterialVectorAuxKernelAction.h.

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

◆ _num_var

const unsigned int MaterialVectorAuxKernelAction::_num_var
protectedinherited

number of auxvariables

Definition at line 30 of file MaterialVectorAuxKernelAction.h.

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

◆ _prop

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

list of material properties to be used

Definition at line 33 of file MaterialVectorAuxKernelAction.h.

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

◆ _var_name_base

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

base name for the auxvariables

Definition at line 27 of file MaterialVectorAuxKernelAction.h.

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


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