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

Constructor & Destructor Documentation

◆ ThumbIC()

ThumbIC::ThumbIC ( const InputParameters &  parameters)

Definition at line 28 of file ThumbIC.C.

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

Member Function Documentation

◆ value()

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

Definition at line 39 of file ThumbIC.C.

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

Member Data Documentation

◆ _height

const Real ThumbIC::_height
protected

Definition at line 34 of file ThumbIC.h.

Referenced by value().

◆ _invalue

const Real ThumbIC::_invalue
protected

Definition at line 35 of file ThumbIC.h.

Referenced by value().

◆ _outvalue

const Real ThumbIC::_outvalue
protected

Definition at line 36 of file ThumbIC.h.

Referenced by value().

◆ _width

const Real ThumbIC::_width
protected

Definition at line 33 of file ThumbIC.h.

Referenced by value().

◆ _xcoord

const Real ThumbIC::_xcoord
protected

Definition at line 32 of file ThumbIC.h.

Referenced by value().


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