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

Tricrystal2CircleGrainsIC creates a 3 grain structure with 2 circle grains and one matrix grain. More...

#include <Tricrystal2CircleGrainsIC.h>

Inheritance diagram for Tricrystal2CircleGrainsIC:
[legend]

Public Member Functions

 Tricrystal2CircleGrainsIC (const InputParameters &parameters)
 
virtual Real value (const Point &p)
 

Protected Attributes

const MooseMesh & _mesh
 
const unsigned int _op_num
 
const unsigned int _op_index
 
Point _bottom_left
 
Point _top_right
 
Point _range
 

Detailed Description

Tricrystal2CircleGrainsIC creates a 3 grain structure with 2 circle grains and one matrix grain.

Definition at line 21 of file Tricrystal2CircleGrainsIC.h.

Constructor & Destructor Documentation

Tricrystal2CircleGrainsIC::Tricrystal2CircleGrainsIC ( const InputParameters &  parameters)

Definition at line 23 of file Tricrystal2CircleGrainsIC.C.

24  : InitialCondition(parameters),
25  _mesh(_fe_problem.mesh()),
26  _op_num(getParam<unsigned int>("op_num")),
27  _op_index(getParam<unsigned int>("op_index"))
28 {
29  if (_op_num != 3)
30  mooseError("Tricrystal ICs must have op_num = 3");
31 
32  // Set up domain bounds with mesh tools
33  for (unsigned int i = 0; i < LIBMESH_DIM; i++)
34  {
35  _bottom_left(i) = _mesh.getMinInDimension(i);
36  _top_right(i) = _mesh.getMaxInDimension(i);
37  }
39 }

Member Function Documentation

Real Tricrystal2CircleGrainsIC::value ( const Point &  p)
virtual

Definition at line 42 of file Tricrystal2CircleGrainsIC.C.

43 {
44  Point grain_center_left;
45  grain_center_left(0) = _bottom_left(0) + _range(0) / 4.0;
46  grain_center_left(1) = _bottom_left(1) + _range(1) / 2.0;
47  grain_center_left(2) = _bottom_left(2) + _range(2) / 2.0;
48 
49  Point grain_center_right;
50  grain_center_right(0) = _bottom_left(0) + _range(0) * 3.0 / 4.0;
51  grain_center_right(1) = _bottom_left(1) + _range(1) / 2.0;
52  grain_center_right(2) = _bottom_left(2) + _range(2) / 2.0;
53 
54  Real radius = _range(0) / 5.0;
55  Real dist_left = (p - grain_center_left).norm();
56  Real dist_right = (p - grain_center_right).norm();
57 
58  if ((dist_left <= radius && _op_index == 1) || (dist_right <= radius && _op_index == 2) ||
59  (dist_left > radius && dist_right > radius && _op_index == 0))
60  return 1.0;
61  else
62  return 0.0;
63 }

Member Data Documentation

Point Tricrystal2CircleGrainsIC::_bottom_left
protected

Definition at line 34 of file Tricrystal2CircleGrainsIC.h.

Referenced by Tricrystal2CircleGrainsIC(), and value().

const MooseMesh& Tricrystal2CircleGrainsIC::_mesh
protected

Definition at line 29 of file Tricrystal2CircleGrainsIC.h.

Referenced by Tricrystal2CircleGrainsIC().

const unsigned int Tricrystal2CircleGrainsIC::_op_index
protected

Definition at line 32 of file Tricrystal2CircleGrainsIC.h.

Referenced by value().

const unsigned int Tricrystal2CircleGrainsIC::_op_num
protected

Definition at line 31 of file Tricrystal2CircleGrainsIC.h.

Referenced by Tricrystal2CircleGrainsIC().

Point Tricrystal2CircleGrainsIC::_range
protected

Definition at line 36 of file Tricrystal2CircleGrainsIC.h.

Referenced by Tricrystal2CircleGrainsIC(), and value().

Point Tricrystal2CircleGrainsIC::_top_right
protected

Definition at line 35 of file Tricrystal2CircleGrainsIC.h.

Referenced by Tricrystal2CircleGrainsIC().


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