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

IsolatedBoundingBoxIC creates several isolated boxes defined by their coordinates in the domain. More...

#include <IsolatedBoundingBoxIC.h>

Inheritance diagram for IsolatedBoundingBoxIC:
[legend]

Public Member Functions

 IsolatedBoundingBoxIC (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

IsolatedBoundingBoxIC creates several isolated 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 IsolatedBoundingBoxIC.h.

Constructor & Destructor Documentation

◆ IsolatedBoundingBoxIC()

IsolatedBoundingBoxIC::IsolatedBoundingBoxIC ( const InputParameters &  parameters)

Definition at line 27 of file IsolatedBoundingBoxIC.C.

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

Member Function Documentation

◆ value()

Real IsolatedBoundingBoxIC::value ( const Point &  p)

Definition at line 33 of file IsolatedBoundingBoxIC.C.

34 {
36 
37  if (_int_width != 0.0)
38  {
39  for (unsigned int b = 0; b < _nbox; ++b)
40  {
41  for (unsigned int i = 0; i < _dim; ++i)
42  {
43  if (_c1[b](i) < _c2[b](i) && p(i) >= _c1[b](i) - _int_width &&
44  p(i) <= _c2[b](i) + _int_width)
45  {
46  if (i != _dim - 1)
47  continue;
48  for (unsigned int n = b + 1; n < _nbox; ++n)
49  {
50  for (unsigned int j = 0; j < _dim; ++j)
51  {
52  if (p(j) >= _c1[n](j) - _int_width && p(j) <= _c2[n](j) + _int_width)
53  mooseError("Partially overlapping boxes are not allowed. Note that this "
54  "includes the overlapping diffused interfaces. For nested boxes, "
55  "use NestedBoundingBoxIC.C.");
56  }
57  }
58  Real f_in = 1.0;
59  for (unsigned int j = 0; j < _dim; ++j)
60  f_in *= 0.5 * (std::tanh(2.0 * libMesh::pi * (p(j) - _c1[b](j)) / _int_width) -
61  std::tanh(2.0 * libMesh::pi * (p(j) - _c2[b](j)) / _int_width));
62  value = _outside + (_inside[b] - _outside) * f_in;
63  }
64  else if (_c1[b](i) >= _c2[b](i))
65  mooseError("The coordinates of the smaller_coordinate_corners are equal to or larger "
66  "than that of "
67  "the larger_coordinate_corners.");
68  else
69  break;
70  }
71  }
72  }
73  return value;
74 }

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 NestedBoundingBoxIC::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 NestedBoundingBoxIC::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 NestedBoundingBoxIC::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 NestedBoundingBoxIC::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 NestedBoundingBoxIC::value().

◆ _outside

const Real IsolatedBoundingBoxIC::_outside
protected

values outside all the boxes

Definition at line 34 of file IsolatedBoundingBoxIC.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
IsolatedBoundingBoxIC::value
Real value(const Point &p)
Definition: IsolatedBoundingBoxIC.C:33
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
IsolatedBoundingBoxIC::_outside
const Real _outside
values outside all the boxes
Definition: IsolatedBoundingBoxIC.h:34
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