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

Bicrystal using a bounding box. More...

#include <BicrystalBoundingBoxICAction.h>

Inheritance diagram for BicrystalBoundingBoxICAction:
[legend]

Public Member Functions

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

Private Attributes

const std::string _var_name_base
 
const unsigned int _op_num
 

Detailed Description

Bicrystal using a bounding box.

Definition at line 19 of file BicrystalBoundingBoxICAction.h.

Constructor & Destructor Documentation

◆ BicrystalBoundingBoxICAction()

BicrystalBoundingBoxICAction::BicrystalBoundingBoxICAction ( const InputParameters &  params)

Definition at line 34 of file BicrystalBoundingBoxICAction.C.

35  : Action(params),
36  _var_name_base(getParam<std::string>("var_name_base")),
37  _op_num(getParam<unsigned int>("op_num"))
38 {
39  if (_op_num != 2)
40  paramError("op_num", "op_num must equal 2 for bicrystal ICs");
41 }

Member Function Documentation

◆ act()

void BicrystalBoundingBoxICAction::act ( )
virtual

Definition at line 44 of file BicrystalBoundingBoxICAction.C.

45 {
46 #ifdef DEBUG
47  Moose::err << "Inside the BicrystalBoundingBoxICAction Object\n";
48 #endif
49 
50  // Loop through the number of order parameters
51  for (unsigned int op = 0; op < _op_num; ++op)
52  {
53  // Create variable names
54  const std::string var_name = _var_name_base + Moose::stringify(op);
55 
56  // Set parameters for BoundingBoxIC
57  InputParameters poly_params = _factory.getValidParams("BoundingBoxIC");
58  poly_params.applyParameters(parameters());
59  poly_params.set<VariableName>("variable") = var_name;
60  if (op == 0)
61  {
62  // Values for bounding box
63  poly_params.set<Real>("inside") = 1.0;
64  poly_params.set<Real>("outside") = 0.0;
65  }
66  else
67  {
68  // Values for matrix grain
69  poly_params.set<Real>("inside") = 0.0;
70  poly_params.set<Real>("outside") = 1.0;
71  }
72 
73  // Add initial condition
74  _problem->addInitialCondition(
75  "BoundingBoxIC", "BicrystalBoundingBoxIC_" + Moose::stringify(op), poly_params);
76  }
77 }

Member Data Documentation

◆ _op_num

const unsigned int BicrystalBoundingBoxICAction::_op_num
private

Definition at line 28 of file BicrystalBoundingBoxICAction.h.

Referenced by act(), and BicrystalBoundingBoxICAction().

◆ _var_name_base

const std::string BicrystalBoundingBoxICAction::_var_name_base
private

Definition at line 27 of file BicrystalBoundingBoxICAction.h.

Referenced by act().


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