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

SmoothMultiBoundingBoxBaseIC is the base class for IsolatedBoundingBoxIC and NestedBoundingBoxIC. More...

#include <SmoothMultiBoundingBoxBaseIC.h>

Inheritance diagram for SmoothMultiBoundingBoxBaseIC:
[legend]

Public Member Functions

 SmoothMultiBoundingBoxBaseIC (const InputParameters &parameters)
 
Real value (const Point &p)
 

Protected Attributes

const unsigned int _nbox
 number of boxes More...
 
const Real _int_width
 value of interfacial width More...
 
const unsigned int _dim
 dimensionality of the mesh More...
 
std::vector< Real > _inside
 values inside the boxes More...
 
const std::vector< Point > _c1
 lists of opposite corners More...
 
const std::vector< Point > _c2
 

Private Attributes

const Real _outside
 

Detailed Description

SmoothMultiBoundingBoxBaseIC is the base class for IsolatedBoundingBoxIC and NestedBoundingBoxIC.

The boxes can finite interface width.

Definition at line 24 of file SmoothMultiBoundingBoxBaseIC.h.

Constructor & Destructor Documentation

◆ SmoothMultiBoundingBoxBaseIC()

SmoothMultiBoundingBoxBaseIC::SmoothMultiBoundingBoxBaseIC ( const InputParameters &  parameters)

Definition at line 37 of file SmoothMultiBoundingBoxBaseIC.C.

38  : InitialCondition(parameters),
39  _outside(getParam<Real>("outside")),
40  _c1(getParam<std::vector<Point>>("smaller_coordinate_corners")),
41  _c2(getParam<std::vector<Point>>("larger_coordinate_corners")),
42  _nbox(_c1.size()),
43  _int_width(getParam<Real>("int_width")),
44  _dim(_fe_problem.mesh().dimension()),
45  _inside(getParam<std::vector<Real>>("inside"))
46 {
47 }

Member Function Documentation

◆ value()

Real SmoothMultiBoundingBoxBaseIC::value ( const Point &  p)

Definition at line 50 of file SmoothMultiBoundingBoxBaseIC.C.

51 {
52  Real value = _outside;
53 
54  // if "inside" vector only has size 1, all the boxes have the same inside value
55  if (_inside.size() == 1)
56  {
57  _inside.assign(_nbox, _inside[0]);
58  }
59 
60  // make sure inputs are the same length
61  if (_c2.size() != _nbox || _inside.size() != _nbox)
62  paramError("vector inputs must all be the same size");
63 
64  if (_int_width < 0.0)
65  paramError("'int_width' should be non-negative");
66 
67  if (_int_width == 0.0)
68  {
69  for (unsigned int b = 0; b < _nbox; ++b)
70  {
71  for (unsigned int i = 0; i < _dim; ++i)
72  if (_c1[b](i) < _c2[b](i) && p(i) >= _c1[b](i) && p(i) <= _c2[b](i))
73  {
74  if (i != _dim - 1)
75  continue;
76  value = _inside[b];
77  break;
78  }
79  else
80  break;
81  }
82  }
83  return value;
84 }

Referenced by IsolatedBoundingBoxIC::value(), and NestedBoundingBoxIC::value().

Member Data Documentation

◆ _c1

const std::vector<Point> SmoothMultiBoundingBoxBaseIC::_c1
protected

lists of opposite corners

Definition at line 36 of file SmoothMultiBoundingBoxBaseIC.h.

Referenced by value(), IsolatedBoundingBoxIC::value(), and NestedBoundingBoxIC::value().

◆ _c2

const std::vector<Point> SmoothMultiBoundingBoxBaseIC::_c2
protected

◆ _dim

const unsigned int SmoothMultiBoundingBoxBaseIC::_dim
protected

dimensionality of the mesh

Definition at line 47 of file SmoothMultiBoundingBoxBaseIC.h.

Referenced by value(), IsolatedBoundingBoxIC::value(), and NestedBoundingBoxIC::value().

◆ _inside

std::vector<Real> SmoothMultiBoundingBoxBaseIC::_inside
protected

values inside the boxes

Definition at line 50 of file SmoothMultiBoundingBoxBaseIC.h.

Referenced by value(), IsolatedBoundingBoxIC::value(), and NestedBoundingBoxIC::value().

◆ _int_width

const Real SmoothMultiBoundingBoxBaseIC::_int_width
protected

value of interfacial width

Definition at line 44 of file SmoothMultiBoundingBoxBaseIC.h.

Referenced by value(), IsolatedBoundingBoxIC::value(), and NestedBoundingBoxIC::value().

◆ _nbox

const unsigned int SmoothMultiBoundingBoxBaseIC::_nbox
protected

number of boxes

Definition at line 41 of file SmoothMultiBoundingBoxBaseIC.h.

Referenced by value(), IsolatedBoundingBoxIC::value(), and NestedBoundingBoxIC::value().

◆ _outside

const Real SmoothMultiBoundingBoxBaseIC::_outside
private

Definition at line 32 of file SmoothMultiBoundingBoxBaseIC.h.

Referenced by value().


The documentation for this class was generated from the following files:
SmoothMultiBoundingBoxBaseIC::value
Real value(const Point &p)
Definition: SmoothMultiBoundingBoxBaseIC.C:50
SmoothMultiBoundingBoxBaseIC::_c1
const std::vector< Point > _c1
lists of opposite corners
Definition: SmoothMultiBoundingBoxBaseIC.h:36
SmoothMultiBoundingBoxBaseIC::_dim
const unsigned int _dim
dimensionality of the mesh
Definition: SmoothMultiBoundingBoxBaseIC.h:47
SmoothMultiBoundingBoxBaseIC::_inside
std::vector< Real > _inside
values inside the boxes
Definition: SmoothMultiBoundingBoxBaseIC.h:50
SmoothMultiBoundingBoxBaseIC::_int_width
const Real _int_width
value of interfacial width
Definition: SmoothMultiBoundingBoxBaseIC.h:44
SmoothMultiBoundingBoxBaseIC::_nbox
const unsigned int _nbox
number of boxes
Definition: SmoothMultiBoundingBoxBaseIC.h:41
SmoothMultiBoundingBoxBaseIC::_c2
const std::vector< Point > _c2
Definition: SmoothMultiBoundingBoxBaseIC.h:37
SmoothMultiBoundingBoxBaseIC::_outside
const Real _outside
Definition: SmoothMultiBoundingBoxBaseIC.h:32