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

RndBoundingBoxIC allows setting the initial condition of a value inside and outside of a specified box. More...

#include <RndBoundingBoxIC.h>

Inheritance diagram for RndBoundingBoxIC:
[legend]

Public Member Functions

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

Private Attributes

const Real _x1
 
const Real _y1
 
const Real _z1
 
const Real _x2
 
const Real _y2
 
const Real _z2
 
const Real _mx_invalue
 
const Real _mx_outvalue
 
const Real _mn_invalue
 
const Real _mn_outvalue
 
const Real _range_invalue
 
const Real _range_outvalue
 
const Point _bottom_left
 
const Point _top_right
 

Detailed Description

RndBoundingBoxIC allows setting the initial condition of a value inside and outside of a specified box.

The box is aligned with the x,y,z axis... and is specified by passing in the x,y,z coordinates of the bottom left point and the top right point. Each of the coordinates of the "bottom_left" point MUST be less than those coordinates in the "top_right" point.

When setting the initial condition if bottom_left <= Point <= top_right then the "inside" value is used. Otherwise the "outside" value is used.

Definition at line 31 of file RndBoundingBoxIC.h.

Constructor & Destructor Documentation

RndBoundingBoxIC::RndBoundingBoxIC ( const InputParameters &  parameters)

Definition at line 34 of file RndBoundingBoxIC.C.

35  : InitialCondition(parameters),
36  _x1(parameters.get<Real>("x1")),
37  _y1(parameters.get<Real>("y1")),
38  _z1(parameters.get<Real>("z1")),
39  _x2(parameters.get<Real>("x2")),
40  _y2(parameters.get<Real>("y2")),
41  _z2(parameters.get<Real>("z2")),
42  _mx_invalue(parameters.get<Real>("mx_invalue")),
43  _mx_outvalue(parameters.get<Real>("mx_outvalue")),
44  _mn_invalue(parameters.get<Real>("mn_invalue")),
45  _mn_outvalue(parameters.get<Real>("mn_outvalue")),
50 {
51  mooseAssert(_range_invalue >= 0.0, "Inside Min > Inside Max for RandomIC!");
52  mooseAssert(_range_outvalue >= 0.0, "Outside Min > Outside Max for RandomIC!");
53 }
const Point _top_right
const Real _mx_invalue
const Real _range_outvalue
const Real _range_invalue
const Real _mx_outvalue
const Point _bottom_left
const Real _mn_invalue
const Real _mn_outvalue

Member Function Documentation

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

Definition at line 56 of file RndBoundingBoxIC.C.

57 {
58  // Random number between 0 and 1
59  Real rand_num = MooseRandom::rand();
60 
61  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
62  if (p(i) < _bottom_left(i) || p(i) > _top_right(i))
63  return rand_num * _range_outvalue + _mn_outvalue;
64 
65  return rand_num * _range_invalue + _mn_invalue;
66 }
const Point _top_right
const Real _range_outvalue
const Real _range_invalue
const Point _bottom_left
const Real _mn_invalue
const Real _mn_outvalue

Member Data Documentation

const Point RndBoundingBoxIC::_bottom_left
private

Definition at line 52 of file RndBoundingBoxIC.h.

Referenced by value().

const Real RndBoundingBoxIC::_mn_invalue
private

Definition at line 47 of file RndBoundingBoxIC.h.

Referenced by value().

const Real RndBoundingBoxIC::_mn_outvalue
private

Definition at line 48 of file RndBoundingBoxIC.h.

Referenced by value().

const Real RndBoundingBoxIC::_mx_invalue
private

Definition at line 45 of file RndBoundingBoxIC.h.

const Real RndBoundingBoxIC::_mx_outvalue
private

Definition at line 46 of file RndBoundingBoxIC.h.

const Real RndBoundingBoxIC::_range_invalue
private

Definition at line 49 of file RndBoundingBoxIC.h.

Referenced by RndBoundingBoxIC(), and value().

const Real RndBoundingBoxIC::_range_outvalue
private

Definition at line 50 of file RndBoundingBoxIC.h.

Referenced by RndBoundingBoxIC(), and value().

const Point RndBoundingBoxIC::_top_right
private

Definition at line 53 of file RndBoundingBoxIC.h.

Referenced by value().

const Real RndBoundingBoxIC::_x1
private

Definition at line 39 of file RndBoundingBoxIC.h.

const Real RndBoundingBoxIC::_x2
private

Definition at line 42 of file RndBoundingBoxIC.h.

const Real RndBoundingBoxIC::_y1
private

Definition at line 40 of file RndBoundingBoxIC.h.

const Real RndBoundingBoxIC::_y2
private

Definition at line 43 of file RndBoundingBoxIC.h.

const Real RndBoundingBoxIC::_z1
private

Definition at line 41 of file RndBoundingBoxIC.h.

const Real RndBoundingBoxIC::_z2
private

Definition at line 44 of file RndBoundingBoxIC.h.


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