#include <CoefficientInterpolator.H>
LevelDataType | The LevelData type used to store coefficient data. |
Public Types | |
typedef LevelData_ | LevelDataType |
typedef SolutionLevelData_ | SolutionLevelDataType |
Public Member Functions | |
CoefficientInterpolator (int a_numComps) | |
virtual | ~CoefficientInterpolator () |
Destructor. | |
int | numComps () const |
Returns the number of components in the interpolated coefficient. | |
virtual void | interpolate (LevelDataType &a_result, Real a_time) |
virtual void | interpolate (LevelDataType &a_result, const SolutionLevelDataType &a_solution, Real a_time) |
virtual bool | dependsUponSolution () const |
virtual void | interpolatePrime (LevelDataType &a_prime, const SolutionLevelDataType &a_solution, Real a_time) |
virtual void | solve (SolutionLevelDataType &a_phi, const SolutionLevelDataType &a_f, Real a_time, const SolutionLevelDataType &a_phi0, Real a_tolerance) |
void | NewtonRaphson (SolutionLevelDataType &a_phi, const SolutionLevelDataType &a_f, Real a_time, const SolutionLevelDataType &a_phi0, Real a_tolerance) |
Private Member Functions | |
CoefficientInterpolator () | |
CoefficientInterpolator (const CoefficientInterpolator &) | |
CoefficientInterpolator & | operator= (const CoefficientInterpolator &) |
Private Attributes | |
int | m_numComps |
bool | m_inCall |
typedef LevelData_ CoefficientInterpolator< LevelData_, SolutionLevelData_ >::LevelDataType |
typedef SolutionLevelData_ CoefficientInterpolator< LevelData_, SolutionLevelData_ >::SolutionLevelDataType |
CoefficientInterpolator< LevelData_, SolutionLevelData_ >::CoefficientInterpolator | ( | int | a_numComps | ) | [inline, explicit] |
Base class constructor. Called by every subclass.
a_numComps | The number of components in the interpolated coefficient. |
CoefficientInterpolator< LevelData_, SolutionLevelData_ >::~CoefficientInterpolator | ( | ) | [inline, virtual] |
Destructor.
CoefficientInterpolator< LevelData_, SolutionLevelData_ >::CoefficientInterpolator | ( | ) | [private] |
CoefficientInterpolator< LevelData_, SolutionLevelData_ >::CoefficientInterpolator | ( | const CoefficientInterpolator< LevelData_, SolutionLevelData_ > & | ) | [private] |
int CoefficientInterpolator< LevelData_, SolutionLevelData_ >::numComps | ( | ) | const [inline] |
Returns the number of components in the interpolated coefficient.
References CoefficientInterpolator< LevelData_, SolutionLevelData_ >::m_numComps.
void CoefficientInterpolator< LevelData_, SolutionLevelData_ >::interpolate | ( | LevelDataType & | a_result, | |
Real | a_time | |||
) | [inline, virtual] |
Interpolate the coefficient at the given time, placing the result in the given LevelData object. This method must be overridden by subclasses.
a_result | The LevelData object that will store the result. | |
a_time | The time at which the coefficient is to be evaluated. |
References CoefficientInterpolator< LevelData_, SolutionLevelData_ >::dependsUponSolution(), MayDay::Error(), and CoefficientInterpolator< LevelData_, SolutionLevelData_ >::m_inCall.
Referenced by CoefficientInterpolator< LevelData_, SolutionLevelData_ >::interpolate(), and CoefficientInterpolator< LevelData_, SolutionLevelData_ >::NewtonRaphson().
void CoefficientInterpolator< LevelData_, SolutionLevelData_ >::interpolate | ( | LevelDataType & | a_result, | |
const SolutionLevelDataType & | a_solution, | |||
Real | a_time | |||
) | [inline, virtual] |
Interpolate the coefficient at the given time, placing the result in the given LevelData object. This method assumes that the coefficient depends upon the solution to the partial differential equation in question, so the solution is passed into it as an argument.
a_result | The LevelData object that will store the result. | |
a_solution | The solution to the partial differential equation. | |
a_time | The time at which the coefficient is to be evaluated. |
References CoefficientInterpolator< LevelData_, SolutionLevelData_ >::dependsUponSolution(), MayDay::Error(), CoefficientInterpolator< LevelData_, SolutionLevelData_ >::interpolate(), and CoefficientInterpolator< LevelData_, SolutionLevelData_ >::m_inCall.
bool CoefficientInterpolator< LevelData_, SolutionLevelData_ >::dependsUponSolution | ( | ) | const [inline, virtual] |
Returns true if the coefficient depends on the solution to the partial differential equation (rendering it nonlinear), false otherwise. By default, the coefficient is assumed not to depend upon the solution.
Referenced by CoefficientInterpolator< LevelData_, SolutionLevelData_ >::interpolate(), and CoefficientInterpolator< LevelData_, SolutionLevelData_ >::interpolatePrime().
void CoefficientInterpolator< LevelData_, SolutionLevelData_ >::interpolatePrime | ( | LevelDataType & | a_prime, | |
const SolutionLevelDataType & | a_solution, | |||
Real | a_time | |||
) | [inline, virtual] |
Computes the derivative of the coefficient with respect to the solution at the desired time. By default, this sets a_deriv to 0.
a_prime | The coefficient derivative data will be stored here. | |
a_solution | The solution to the partial differential equation. | |
a_time | The time at which to compute the coefficient data. |
References CoefficientInterpolator< LevelData_, SolutionLevelData_ >::dependsUponSolution(), and MayDay::Error().
Referenced by CoefficientInterpolator< LevelData_, SolutionLevelData_ >::NewtonRaphson().
void CoefficientInterpolator< LevelData_, SolutionLevelData_ >::solve | ( | SolutionLevelDataType & | a_phi, | |
const SolutionLevelDataType & | a_f, | |||
Real | a_time, | |||
const SolutionLevelDataType & | a_phi0, | |||
Real | a_tolerance | |||
) | [inline, virtual] |
This virtual void method performs the iterative nonlinear solve for .
a_phi | The solution to the equation, , will be stored here. | |
a_f | The term in the equation. | |
a_time | The time at which the equation is solved. | |
a_phi0 | The initial estimate for . | |
a_tolerance | The threshold for the error in the equation that dictates when iteration should cease. |
References MayDay::Error().
void CoefficientInterpolator< LevelData_, SolutionLevelData_ >::NewtonRaphson | ( | SolutionLevelDataType & | a_phi, | |
const SolutionLevelDataType & | a_f, | |||
Real | a_time, | |||
const SolutionLevelDataType & | a_phi0, | |||
Real | a_tolerance | |||
) | [inline] |
This helper method solves the nonlinear equation for using Newton-Raphson iteration. It can be used by subclasses to implement the solve() virtual method.
a_phi | The solution to the equation, , will be stored here. | |
a_f | The term in the equation. | |
a_time | The time at which the equation is solved. | |
a_phi0 | The initial estimate for . | |
a_tolerance | The threshold for the error in the equation that dictates when iteration should cease. |
References A, Abs(), CoefficientInterpolator< LevelData_, SolutionLevelData_ >::interpolate(), CoefficientInterpolator< LevelData_, SolutionLevelData_ >::interpolatePrime(), max(), Max(), and min().
CoefficientInterpolator& CoefficientInterpolator< LevelData_, SolutionLevelData_ >::operator= | ( | const CoefficientInterpolator< LevelData_, SolutionLevelData_ > & | ) | [private] |
int CoefficientInterpolator< LevelData_, SolutionLevelData_ >::m_numComps [private] |
bool CoefficientInterpolator< LevelData_, SolutionLevelData_ >::m_inCall [private] |