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 24 of file Tricrystal2CircleGrainsIC.h.

Constructor & Destructor Documentation

◆ Tricrystal2CircleGrainsIC()

Tricrystal2CircleGrainsIC::Tricrystal2CircleGrainsIC ( const InputParameters &  parameters)

Definition at line 27 of file Tricrystal2CircleGrainsIC.C.

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

Member Function Documentation

◆ value()

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

Definition at line 46 of file Tricrystal2CircleGrainsIC.C.

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

Member Data Documentation

◆ _bottom_left

Point Tricrystal2CircleGrainsIC::_bottom_left
protected

Definition at line 37 of file Tricrystal2CircleGrainsIC.h.

Referenced by Tricrystal2CircleGrainsIC(), and value().

◆ _mesh

const MooseMesh& Tricrystal2CircleGrainsIC::_mesh
protected

Definition at line 32 of file Tricrystal2CircleGrainsIC.h.

Referenced by Tricrystal2CircleGrainsIC().

◆ _op_index

const unsigned int Tricrystal2CircleGrainsIC::_op_index
protected

Definition at line 35 of file Tricrystal2CircleGrainsIC.h.

Referenced by value().

◆ _op_num

const unsigned int Tricrystal2CircleGrainsIC::_op_num
protected

Definition at line 34 of file Tricrystal2CircleGrainsIC.h.

Referenced by Tricrystal2CircleGrainsIC().

◆ _range

Point Tricrystal2CircleGrainsIC::_range
protected

Definition at line 39 of file Tricrystal2CircleGrainsIC.h.

Referenced by Tricrystal2CircleGrainsIC(), and value().

◆ _top_right

Point Tricrystal2CircleGrainsIC::_top_right
protected

Definition at line 38 of file Tricrystal2CircleGrainsIC.h.

Referenced by Tricrystal2CircleGrainsIC().


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