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

returns the central difference approx to the derivative of the function, ie (f(t, p + direction) - f(t, p - direction))/2/|direction| This derives from MooseParsedFunction, so it already knows about a function More...

#include <GradParsedFunction.h>

Inheritance diagram for GradParsedFunction:
[legend]

Public Member Functions

 GradParsedFunction (const InputParameters &parameters)
 
virtual Real value (Real t, const Point &pt)
 

Protected Attributes

RealVectorValue _direction
 central difference direction More...
 
Real _len
 2*|_direction| More...
 

Detailed Description

returns the central difference approx to the derivative of the function, ie (f(t, p + direction) - f(t, p - direction))/2/|direction| This derives from MooseParsedFunction, so it already knows about a function

Definition at line 25 of file GradParsedFunction.h.

Constructor & Destructor Documentation

GradParsedFunction::GradParsedFunction ( const InputParameters &  parameters)

Definition at line 23 of file GradParsedFunction.C.

24  : MooseParsedFunction(parameters), _direction(getParam<RealVectorValue>("direction"))
25 {
26  _len = _direction.norm();
27  if (_len == 0)
28  mooseError("The direction in the GradParsedFunction must have positive length.");
29  _direction /= 2.0; // note - so we can do central differences
30 }
RealVectorValue _direction
central difference direction
Real _len
2*|_direction|

Member Function Documentation

Real GradParsedFunction::value ( Real  t,
const Point &  pt 
)
virtual

Definition at line 33 of file GradParsedFunction.C.

34 {
35  return (_function_ptr->evaluate<Real>(t, p + _direction) -
36  _function_ptr->evaluate<Real>(t, p - _direction)) /
37  _len;
38 }
RealVectorValue _direction
central difference direction
Real _len
2*|_direction|

Member Data Documentation

RealVectorValue GradParsedFunction::_direction
protected

central difference direction

Definition at line 34 of file GradParsedFunction.h.

Referenced by GradParsedFunction(), and value().

Real GradParsedFunction::_len
protected

2*|_direction|

Definition at line 37 of file GradParsedFunction.h.

Referenced by GradParsedFunction(), and value().


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