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 45 of file EulerAngle2RGBAction.C.

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

Member Function Documentation

◆ act()

void EulerAngle2RGBAction::act ( )
virtual

Definition at line 51 of file EulerAngle2RGBAction.C.

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