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

ThumbIC creates a rectangle with a half circle on top. More...

#include <ThumbIC.h>

Inheritance diagram for ThumbIC:
[legend]

Public Member Functions

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

Protected Attributes

const Real _xcoord
 
const Real _width
 
const Real _height
 
const Real _invalue
 
const Real _outvalue
 

Detailed Description

ThumbIC creates a rectangle with a half circle on top.

Definition at line 21 of file ThumbIC.h.

Constructor & Destructor Documentation

ThumbIC::ThumbIC ( const InputParameters &  parameters)

Definition at line 23 of file ThumbIC.C.

24  : InitialCondition(parameters),
25  _xcoord(parameters.get<Real>("xcoord")),
26  _width(parameters.get<Real>("width")),
27  _height(parameters.get<Real>("height")),
28  _invalue(parameters.get<Real>("invalue")),
29  _outvalue(parameters.get<Real>("outvalue"))
30 {
31 }
const Real _height
Definition: ThumbIC.h:31
const Real _invalue
Definition: ThumbIC.h:32
const Real _width
Definition: ThumbIC.h:30
const Real _outvalue
Definition: ThumbIC.h:33
const Real _xcoord
Definition: ThumbIC.h:29

Member Function Documentation

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

Definition at line 34 of file ThumbIC.C.

35 {
36  Real value = 0.0;
37 
38  if (p(1) > _height)
39  {
40  Real rad = 0.0;
41  Point center(_xcoord, _height, 0.0);
42  for (unsigned int i = 0; i < 2; ++i)
43  rad += (p(i) - center(i)) * (p(i) - center(i));
44 
45  rad = sqrt(rad);
46 
47  if (rad <= _width / 2.0)
48  value = _invalue;
49  else
50  value = _outvalue;
51  }
52  else
53  {
54  if (p(0) > _xcoord - _width / 2.0 && p(0) < _xcoord + _width / 2.0)
55  value = _invalue;
56  else
57  value = _outvalue;
58  }
59 
60  return value;
61 }
const Real _height
Definition: ThumbIC.h:31
const Real _invalue
Definition: ThumbIC.h:32
virtual Real value(const Point &p)
Definition: ThumbIC.C:34
const Real _width
Definition: ThumbIC.h:30
const Real _outvalue
Definition: ThumbIC.h:33
const Real _xcoord
Definition: ThumbIC.h:29

Member Data Documentation

const Real ThumbIC::_height
protected

Definition at line 31 of file ThumbIC.h.

Referenced by value().

const Real ThumbIC::_invalue
protected

Definition at line 32 of file ThumbIC.h.

Referenced by value().

const Real ThumbIC::_outvalue
protected

Definition at line 33 of file ThumbIC.h.

Referenced by value().

const Real ThumbIC::_width
protected

Definition at line 30 of file ThumbIC.h.

Referenced by value().

const Real ThumbIC::_xcoord
protected

Definition at line 29 of file ThumbIC.h.

Referenced by value().


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