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 18 of file EulerAngle2RGBAction.h.

Constructor & Destructor Documentation

EulerAngle2RGBAction::EulerAngle2RGBAction ( const InputParameters &  params)

Definition at line 38 of file EulerAngle2RGBAction.C.

39  : Action(params), _var_name_base(getParam<std::string>("auxvariable_name_base"))
40 {
41 }
const std::string _var_name_base

Member Function Documentation

void EulerAngle2RGBAction::act ( )
virtual

Definition at line 44 of file EulerAngle2RGBAction.C.

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

Member Data Documentation

const std::string EulerAngle2RGBAction::_var_name_base
private

Definition at line 26 of file EulerAngle2RGBAction.h.

Referenced by act().


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