SmoothAbsoluteValue Class Reference

#include <SmoothAbsoluteValue.H>

List of all members.


Detailed Description

Functions to take a smooth absolute value of the difference between two functions A_e(a,b) = |a-b|

max(f, g) = (a + b + |a - b|)/2 We need to make abs(a-b) smooth.

We take the convolution of the absolute value with cos^4(pi w/(2 delta))

Public Member Functions

 SmoothAbsoluteValue (const BaseIF *a_f, const BaseIF *a_g, const Real &a_delta)
virtual ~SmoothAbsoluteValue ()
virtual Real smoothAbsFMinusG (const IntVect &a_deriv, const RealVect &a_point) const
void getWCase (int &a_case, Real &a_wval, const RealVect &a_point) const

Static Public Member Functions

static void setKnownFunction (int a_whichfunc)

Protected Member Functions

virtual Real valueAem (const RealVect &a_point) const
virtual Real firstDerivAem (const IntVect &a_deriv, const RealVect &a_point) const
virtual Real secondDerivAem (const IntVect &a_deriv, const RealVect &a_point) const
virtual Real thirdDerivAem (const IntVect &a_deriv, const RealVect &a_point) const
virtual Real fourthDerivAem (const IntVect &a_deriv, const RealVect &a_point) const
bool isBogus (const Real &a_number) const
 just checks nan
void checkAgainstKnown (const Real &a_myAnswer, const IntVect &a_deriv, const RealVect &a_point) const
 if s_knownFunc is set, check against known answer

Protected Attributes

const BaseIFm_f
const BaseIFm_g
Real m_d
Real m_pi

Static Protected Attributes

static int s_knownFunc
 for debugging against known functions

Private Member Functions

 SmoothAbsoluteValue (const SmoothAbsoluteValue &a_inputIF)
 SmoothAbsoluteValue ()
void operator= (const SmoothAbsoluteValue &a_inputIF)


Constructor & Destructor Documentation

SmoothAbsoluteValue::SmoothAbsoluteValue ( const BaseIF a_f,
const BaseIF a_g,
const Real a_delta 
) [inline]

References m_d, m_f, m_g, and m_pi.

virtual SmoothAbsoluteValue::~SmoothAbsoluteValue (  )  [inline, virtual]

SmoothAbsoluteValue::SmoothAbsoluteValue ( const SmoothAbsoluteValue a_inputIF  )  [inline, private]

References MayDay::Abort().

SmoothAbsoluteValue::SmoothAbsoluteValue (  )  [inline, private]

References MayDay::Abort().


Member Function Documentation

static void SmoothAbsoluteValue::setKnownFunction ( int  a_whichfunc  )  [inline, static]

Set a known f and g (from short list I have programmed) to check answer against 1 = double ramp with ramp_normal_0 = 2. 1. 0. ramp_normal_1 = -2. 1. 0. ramp_point_0 = 0. 1. 0. ramp_point_1 = 1. 1. 0.

2 = double sphere with sphere_center_0 = 0 0 0 sphere_center_1 = 1 0 0 sphere_radius_0 = 0.75 sphere_radius_1 = 0.75

References s_knownFunc.

virtual Real SmoothAbsoluteValue::smoothAbsFMinusG ( const IntVect a_deriv,
const RealVect a_point 
) const [virtual]

void SmoothAbsoluteValue::getWCase ( int &  a_case,
Real a_wval,
const RealVect a_point 
) const

returns -1 if w < -delta, 1 if w > delta, 0 otherwise reduces to regular |f-g| unless case == 0

virtual Real SmoothAbsoluteValue::valueAem ( const RealVect a_point  )  const [protected, virtual]

Here is the logic of this stuff. We have three cases that reduce to two cases. w = f(x) - g(x) case 1: (w > delta): ---- whole integral is above zero answer = abs(w) case -1: (w < - delta): ---- whole integral is below zero answer = abs(w) case 0: (-delta <= w <= delta) --- have to split integral into above and below answer = functionAem();

virtual Real SmoothAbsoluteValue::firstDerivAem ( const IntVect a_deriv,
const RealVect a_point 
) const [protected, virtual]

virtual Real SmoothAbsoluteValue::secondDerivAem ( const IntVect a_deriv,
const RealVect a_point 
) const [protected, virtual]

virtual Real SmoothAbsoluteValue::thirdDerivAem ( const IntVect a_deriv,
const RealVect a_point 
) const [protected, virtual]

virtual Real SmoothAbsoluteValue::fourthDerivAem ( const IntVect a_deriv,
const RealVect a_point 
) const [protected, virtual]

bool SmoothAbsoluteValue::isBogus ( const Real a_number  )  const [protected]

just checks nan

void SmoothAbsoluteValue::checkAgainstKnown ( const Real a_myAnswer,
const IntVect a_deriv,
const RealVect a_point 
) const [protected]

if s_knownFunc is set, check against known answer

void SmoothAbsoluteValue::operator= ( const SmoothAbsoluteValue a_inputIF  )  [inline, private]

References MayDay::Abort().


Member Data Documentation

const BaseIF* SmoothAbsoluteValue::m_f [protected]

Referenced by SmoothAbsoluteValue().

const BaseIF* SmoothAbsoluteValue::m_g [protected]

Referenced by SmoothAbsoluteValue().

Referenced by SmoothAbsoluteValue().

Referenced by SmoothAbsoluteValue().

int SmoothAbsoluteValue::s_knownFunc [static, protected]

for debugging against known functions

Referenced by setKnownFunction().


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

Generated on Mon Nov 20 03:27:26 2017 for Chombo + EB + MF by  doxygen 1.5.5