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

#include <MatVecRealGradAuxKernelAction.h>

Inheritance diagram for MatVecRealGradAuxKernelAction:
[legend]

Public Member Functions

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

Protected Attributes

const AuxVariableName _div_var
 
const std::vector< MaterialPropertyName > _prop
 
const MaterialPropertyName _div_prop
 

Detailed Description

Definition at line 12 of file MatVecRealGradAuxKernelAction.h.

Constructor & Destructor Documentation

MatVecRealGradAuxKernelAction::MatVecRealGradAuxKernelAction ( const InputParameters &  params)

Definition at line 33 of file MatVecRealGradAuxKernelAction.C.

34  : Action(params),
35  _div_var(getParam<AuxVariableName>("divergence_variable")),
36  _prop(getParam<std::vector<MaterialPropertyName>>("property")),
37  _div_prop(getParam<MaterialPropertyName>("divergence_property"))
38 {
39  mooseDeprecated("Use 'MaterialVectorAuxKernel' or 'MaterialVectorGradAuxKernel' action instead "
40  "depending on data_type of MaterialProperty<std::vector<data_type> >");
41 }
const std::vector< MaterialPropertyName > _prop

Member Function Documentation

void MatVecRealGradAuxKernelAction::act ( )
virtual

Definition at line 44 of file MatVecRealGradAuxKernelAction.C.

45 {
46  const std::vector<std::string> var_name_base =
47  getParam<std::vector<std::string>>("var_name_base");
48 
49  const unsigned int op_num = getParam<unsigned int>("op_num");
50  const unsigned int dim = getParam<unsigned int>("dim");
51  const unsigned int size_v = var_name_base.size();
52  const unsigned int size_p = _prop.size();
53 
54  if (size_p != size_v)
55  mooseError("var_name_base and property must be vectors of the same dimension");
56 
57  for (unsigned int op = 0; op < op_num; ++op)
58  {
59  for (unsigned int val = 0; val < size_v; ++val)
60  for (unsigned int x = 0; x < dim; ++x)
61  {
62  std::string var_name = var_name_base[val] + Moose::stringify(x) + Moose::stringify(op);
63  {
64  InputParameters params = _factory.getValidParams("MaterialStdVectorRealGradientAux");
65  params.set<AuxVariableName>("variable") = var_name;
66  params.set<MaterialPropertyName>("property") = _prop[val];
67  params.set<unsigned int>("component") = x;
68  params.set<unsigned int>("index") = op;
69  params.set<bool>("use_displaced_mesh") = getParam<bool>("use_displaced_mesh");
70  _problem->addAuxKernel("MaterialStdVectorRealGradientAux", "grad_" + var_name, params);
71  }
72  }
73 
74  if (isParamValid("divergence_variable"))
75  {
76  if (isParamValid("divergence_property"))
77  {
78  InputParameters params = _factory.getValidParams("MaterialStdVectorAux");
79  params.set<AuxVariableName>("variable") = _div_var;
80  params.set<MaterialPropertyName>("property") = _div_prop;
81  params.set<unsigned int>("index") = op;
82  params.set<bool>("use_displaced_mesh") = getParam<bool>("use_displaced_mesh");
83  _problem->addAuxKernel("MaterialStdVectorAux", "div_" + Moose::stringify(op), params);
84  }
85  else
86  mooseError("Must specify a divergence_property name along with divergence_variable name");
87  }
88  }
89 }
const std::vector< MaterialPropertyName > _prop

Member Data Documentation

const MaterialPropertyName MatVecRealGradAuxKernelAction::_div_prop
protected

Definition at line 22 of file MatVecRealGradAuxKernelAction.h.

Referenced by act().

const AuxVariableName MatVecRealGradAuxKernelAction::_div_var
protected

Definition at line 20 of file MatVecRealGradAuxKernelAction.h.

Referenced by act().

const std::vector<MaterialPropertyName> MatVecRealGradAuxKernelAction::_prop
protected

Definition at line 21 of file MatVecRealGradAuxKernelAction.h.

Referenced by act().


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