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 24 of file LevelSetOlssonBubble.h.

Constructor & Destructor Documentation

◆ LevelSetOlssonBubble()

LevelSetOlssonBubble::LevelSetOlssonBubble ( const InputParameters &  parameters)

Definition at line 28 of file LevelSetOlssonBubble.C.

29  : Function(parameters),
30  _center(getParam<RealVectorValue>("center")),
31  _radius(getParam<Real>("radius")),
32  _epsilon(getParam<Real>("epsilon"))
33 {
34 }
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

◆ gradient()

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

Definition at line 44 of file LevelSetOlssonBubble.C.

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

◆ value()

Real LevelSetOlssonBubble::value ( Real  ,
const Point &  p 
)
overridevirtual

Definition at line 37 of file LevelSetOlssonBubble.C.

38 {
39  const Real x = ((p - _center).size() - _radius) / _epsilon;
40  return 1.0 / (1 + std::exp(x));
41 }
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

◆ _center

const RealVectorValue& LevelSetOlssonBubble::_center
protected

The 'center' of the bubble.

Definition at line 35 of file LevelSetOlssonBubble.h.

Referenced by gradient(), and value().

◆ _epsilon

const Real& LevelSetOlssonBubble::_epsilon
protected

The interface thickness.

Definition at line 41 of file LevelSetOlssonBubble.h.

Referenced by gradient(), and value().

◆ _radius

const Real& LevelSetOlssonBubble::_radius
protected

The radius of the bubble.

Definition at line 38 of file LevelSetOlssonBubble.h.

Referenced by gradient(), and value().


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