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

NestedBoundingBoxIC creates several nested boxes defined by their coordinates in the domain. More...

#include <NestedBoundingBoxIC.h>

Inheritance diagram for NestedBoundingBoxIC:
[legend]

Public Member Functions

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

Protected Attributes

const Real _outside
 values outside all the boxes More...
 
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
 

Detailed Description

NestedBoundingBoxIC creates several nested boxes defined by their coordinates in the domain.

If int_width > zero, the border of the boxes smoothly transitions from the invalue to the outvalue.

Definition at line 25 of file NestedBoundingBoxIC.h.

Constructor & Destructor Documentation

◆ NestedBoundingBoxIC()

NestedBoundingBoxIC::NestedBoundingBoxIC ( const InputParameters &  parameters)

Definition at line 26 of file NestedBoundingBoxIC.C.

27  : SmoothMultiBoundingBoxBaseIC(parameters), _outside(getParam<Real>("outside"))
28 {
29 }

Member Function Documentation

◆ value()

Real NestedBoundingBoxIC::value ( const Point &  p)

Definition at line 32 of file NestedBoundingBoxIC.C.

33 {
35 
36  if (_int_width != 0.0)
37  {
38  for (unsigned int b = 0; b < _nbox; ++b)
39  {
40  for (unsigned int i = 0; i < _dim; ++i)
41  {
42  if (_c1[b](i) < _c2[b](i) && p(i) >= _c1[b](i) - _int_width &&
43  p(i) <= _c2[b](i) + _int_width)
44  {
45  if (i != _dim - 1)
46  continue;
47  Real f_in = 1.0;
48  for (unsigned int j = 0; j < _dim; ++j)
49  f_in *= 0.5 * (std::tanh(2.0 * libMesh::pi * (p(j) - _c1[b](j)) / _int_width) -
50  std::tanh(2.0 * libMesh::pi * (p(j) - _c2[b](j)) / _int_width));
51  if (b == _nbox - 1)
52  value = _outside + (_inside[b] - _outside) * f_in;
53  else
54  value = _inside[b + 1] + (_inside[b] - _inside[b + 1]) * f_in;
55  goto label;
56  }
57  else if (_c1[b](i) >= _c2[b](i))
58  mooseError("The coordinates of the smaller_coordinate_corners are equal to or larger "
59  "than that of "
60  "the larger_coordinate_corners.");
61  else
62  break;
63  }
64  }
65  }
66 label:
67  return value;
68 }

Member Data Documentation

◆ _c1

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

lists of opposite corners

Definition at line 36 of file SmoothMultiBoundingBoxBaseIC.h.

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

◆ _c2

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

◆ _dim

const unsigned int SmoothMultiBoundingBoxBaseIC::_dim
protectedinherited

dimensionality of the mesh

Definition at line 47 of file SmoothMultiBoundingBoxBaseIC.h.

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

◆ _inside

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

values inside the boxes

Definition at line 50 of file SmoothMultiBoundingBoxBaseIC.h.

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

◆ _int_width

const Real SmoothMultiBoundingBoxBaseIC::_int_width
protectedinherited

value of interfacial width

Definition at line 44 of file SmoothMultiBoundingBoxBaseIC.h.

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

◆ _nbox

const unsigned int SmoothMultiBoundingBoxBaseIC::_nbox
protectedinherited

number of boxes

Definition at line 41 of file SmoothMultiBoundingBoxBaseIC.h.

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

◆ _outside

const Real NestedBoundingBoxIC::_outside
protected

values outside all the boxes

Definition at line 34 of file NestedBoundingBoxIC.h.

Referenced by value().


The documentation for this class was generated from the following files:
NestedBoundingBoxIC::value
Real value(const Point &p)
Definition: NestedBoundingBoxIC.C:32
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::SmoothMultiBoundingBoxBaseIC
SmoothMultiBoundingBoxBaseIC(const InputParameters &parameters)
Definition: SmoothMultiBoundingBoxBaseIC.C:37
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
NestedBoundingBoxIC::_outside
const Real _outside
values outside all the boxes
Definition: NestedBoundingBoxIC.h:34
SmoothMultiBoundingBoxBaseIC::_c2
const std::vector< Point > _c2
Definition: SmoothMultiBoundingBoxBaseIC.h:37