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

Implements the "bubble" function from Olsson and Kreiss (2005). More...

#include <LevelSetOlssonBubble.h>

Inheritance diagram for LevelSetOlssonBubble:
[legend]

Public Member Functions

 LevelSetOlssonBubble (const InputParameters &parameters)
 
virtual Real value (Real, const Point &p) override
 
virtual RealGradient gradient (Real, const Point &p) override
 

Protected Attributes

const RealVectorValue & _center
 The 'center' of the bubble. More...
 
const Real & _radius
 The radius of the bubble. More...
 
const Real & _epsilon
 The interface thickness. More...
 

Detailed Description

Implements the "bubble" function from Olsson and Kreiss (2005).

Definition at line 22 of file LevelSetOlssonBubble.h.

Constructor & Destructor Documentation

LevelSetOlssonBubble::LevelSetOlssonBubble ( const InputParameters &  parameters)

Definition at line 24 of file LevelSetOlssonBubble.C.

25  : Function(parameters),
26  _center(getParam<RealVectorValue>("center")),
27  _radius(getParam<Real>("radius")),
28  _epsilon(getParam<Real>("epsilon"))
29 {
30 }
const Real & _radius
The radius of the bubble.
const RealVectorValue & _center
The &#39;center&#39; of the bubble.
const Real & _epsilon
The interface thickness.

Member Function Documentation

RealGradient LevelSetOlssonBubble::gradient ( Real  ,
const Point &  p 
)
overridevirtual

Definition at line 40 of file LevelSetOlssonBubble.C.

41 {
42  Real norm = (p - _center).size();
43  Real g = (norm - _radius) / _epsilon;
44  RealGradient output;
45 
46  Real g_prime;
47  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
48  {
49  g_prime = (p(i) - _center(i)) / (_epsilon * norm);
50  output(i) = (g_prime * std::exp(g)) / ((std::exp(g) + 1) * (std::exp(g) + 1));
51  }
52  return output;
53 }
const Real & _radius
The radius of the bubble.
const RealVectorValue & _center
The &#39;center&#39; of the bubble.
const Real & _epsilon
The interface thickness.
Real LevelSetOlssonBubble::value ( Real  ,
const Point &  p 
)
overridevirtual

Definition at line 33 of file LevelSetOlssonBubble.C.

34 {
35  const Real x = ((p - _center).size() - _radius) / _epsilon;
36  return 1.0 / (1 + std::exp(x));
37 }
const Real & _radius
The radius of the bubble.
const RealVectorValue & _center
The &#39;center&#39; of the bubble.
const Real & _epsilon
The interface thickness.

Member Data Documentation

const RealVectorValue& LevelSetOlssonBubble::_center
protected

The 'center' of the bubble.

Definition at line 33 of file LevelSetOlssonBubble.h.

Referenced by gradient(), and value().

const Real& LevelSetOlssonBubble::_epsilon
protected

The interface thickness.

Definition at line 39 of file LevelSetOlssonBubble.h.

Referenced by gradient(), and value().

const Real& LevelSetOlssonBubble::_radius
protected

The radius of the bubble.

Definition at line 36 of file LevelSetOlssonBubble.h.

Referenced by gradient(), and value().


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