www.mooseframework.org
Public Member Functions | Private Attributes | List of all members
EulerAngle2RGBAction Class Reference

Automatically generates all variables, Kernels, and Materials to ensure the correct derivatives of the elastic free energy in a non-split Cahn-Hilliard simulation are assembled. More...

#include <EulerAngle2RGBAction.h>

Inheritance diagram for EulerAngle2RGBAction:
[legend]

Public Member Functions

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

Private Attributes

const std::string _var_name_base
 

Detailed Description

Automatically generates all variables, Kernels, and Materials to ensure the correct derivatives of the elastic free energy in a non-split Cahn-Hilliard simulation are assembled.

Definition at line 21 of file EulerAngle2RGBAction.h.

Constructor & Destructor Documentation

◆ EulerAngle2RGBAction()

EulerAngle2RGBAction::EulerAngle2RGBAction ( const InputParameters &  params)

Definition at line 46 of file EulerAngle2RGBAction.C.

47  : Action(params), _var_name_base(getParam<std::string>("auxvariable_name_base"))
48 {
49 }
const std::string _var_name_base

Member Function Documentation

◆ act()

void EulerAngle2RGBAction::act ( )
virtual

Definition at line 52 of file EulerAngle2RGBAction.C.

53 {
54  // Auxvariable suffix names that will automatically become a vector in Paraview
55  std::vector<std::string> suffixes = {"_x", "_y", "_z"};
56 
57  // Three color types that will be outputted
58  std::vector<std::string> colors = {"red", "green", "blue"};
59 
60  for (unsigned int i = 0; i < 3; ++i)
61  {
62  // Create the auxvariable name
63  std::string var_name = _var_name_base + suffixes[i];
64 
65  if (_current_task == "add_aux_variable")
66  {
67  // Create scalar auxvariables for the three components of the RGB vector
68  _problem->addAuxVariable(var_name,
69  FEType(Utility::string_to_enum<Order>("CONSTANT"),
70  Utility::string_to_enum<FEFamily>("MONOMIAL")));
71  }
72  else if (_current_task == "add_aux_kernel")
73  {
74  // Create auxkernels corresponding to each auxvariable
75  InputParameters params = _factory.getValidParams("EulerAngleProvider2RGBAux");
76  params.set<AuxVariableName>("variable") = var_name;
77  params.set<MooseEnum>("sd") = getParam<MooseEnum>("sd");
78  params.set<MooseEnum>("crystal_structure") = getParam<MooseEnum>("crystal_structure");
79  params.set<MooseEnum>("output_type") = colors[i];
80  params.set<UserObjectName>("euler_angle_provider") =
81  getParam<UserObjectName>("euler_angle_provider");
82  params.set<UserObjectName>("grain_tracker") = getParam<UserObjectName>("grain_tracker");
83  params.set<ExecFlagEnum>("execute_on") = {EXEC_INITIAL, EXEC_TIMESTEP_END};
84  params.set<Point>("no_grain_color") = getParam<Point>("no_grain_color");
85  if (isParamValid("phase"))
86  params.set<unsigned int>("phase") = getParam<unsigned int>("phase");
87  _problem->addAuxKernel("EulerAngleProvider2RGBAux", var_name, params);
88  }
89  else
90  mooseError("Internal error in EulerAngle2RGBAction.");
91  }
92 }
const std::string _var_name_base

Member Data Documentation

◆ _var_name_base

const std::string EulerAngle2RGBAction::_var_name_base
private

Definition at line 29 of file EulerAngle2RGBAction.h.

Referenced by act().


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