CoefficientInterpolator< LevelData_, SolutionLevelData_ > Class Template Reference

#include <CoefficientInterpolator.H>

Inheritance diagram for CoefficientInterpolator< LevelData_, SolutionLevelData_ >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<typename LevelData_, typename SolutionLevelData_ = LevelData_>
class CoefficientInterpolator< LevelData_, SolutionLevelData_ >

This abstract base class provides an interface to time-dependent spatial coefficient data for various partial differential equations. One obtains constant access to coefficient data by specifying the desired time centering. Subclasses of this base class define how that coefficient data is computed.
Template Parameters:
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 &)
CoefficientInterpolatoroperator= (const CoefficientInterpolator &)

Private Attributes

int m_numComps
bool m_inCall

Member Typedef Documentation

template<typename LevelData_, typename SolutionLevelData_ = LevelData_>
typedef LevelData_ CoefficientInterpolator< LevelData_, SolutionLevelData_ >::LevelDataType

template<typename LevelData_, typename SolutionLevelData_ = LevelData_>
typedef SolutionLevelData_ CoefficientInterpolator< LevelData_, SolutionLevelData_ >::SolutionLevelDataType


Constructor & Destructor Documentation

template<typename LevelData_, typename SolutionLevelData_>
CoefficientInterpolator< LevelData_, SolutionLevelData_ >::CoefficientInterpolator ( int  a_numComps  )  [inline, explicit]

Base class constructor. Called by every subclass.

Parameters:
a_numComps The number of components in the interpolated coefficient.

template<typename LevelData_, typename SolutionLevelData_>
CoefficientInterpolator< LevelData_, SolutionLevelData_ >::~CoefficientInterpolator (  )  [inline, virtual]

Destructor.

template<typename LevelData_, typename SolutionLevelData_ = LevelData_>
CoefficientInterpolator< LevelData_, SolutionLevelData_ >::CoefficientInterpolator (  )  [private]

template<typename LevelData_, typename SolutionLevelData_ = LevelData_>
CoefficientInterpolator< LevelData_, SolutionLevelData_ >::CoefficientInterpolator ( const CoefficientInterpolator< LevelData_, SolutionLevelData_ > &   )  [private]


Member Function Documentation

template<typename LevelData_, typename SolutionLevelData_>
int CoefficientInterpolator< LevelData_, SolutionLevelData_ >::numComps (  )  const [inline]

Returns the number of components in the interpolated coefficient.

References CoefficientInterpolator< LevelData_, SolutionLevelData_ >::m_numComps.

template<typename LevelData_, typename SolutionLevelData_>
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.

Parameters:
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().

template<typename LevelData_, typename SolutionLevelData_>
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.

Parameters:
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.

template<typename LevelData_, typename SolutionLevelData_>
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().

template<typename LevelData_, typename SolutionLevelData_>
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.

Parameters:
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().

template<typename LevelData_, typename SolutionLevelData_>
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 $A(\phi) \phi - f(\vec{x}) = 0$ for $\phi$.

Parameters:
a_phi The solution to the equation, $\phi$, will be stored here.
a_f The term $f(\vec{x})$ in the equation.
a_time The time at which the equation is solved.
a_phi0 The initial estimate for $\phi$.
a_tolerance The threshold for the error in the equation that dictates when iteration should cease.

References MayDay::Error().

template<typename LevelData_, typename SolutionLevelData_>
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 $A(\phi) \phi - f(\vec{x}) = 0$ for $\phi$ using Newton-Raphson iteration. It can be used by subclasses to implement the solve() virtual method.

Parameters:
a_phi The solution to the equation, $\phi$, will be stored here.
a_f The term $f(\vec{x})$ in the equation.
a_time The time at which the equation is solved.
a_phi0 The initial estimate for $\phi$.
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().

template<typename LevelData_, typename SolutionLevelData_ = LevelData_>
CoefficientInterpolator& CoefficientInterpolator< LevelData_, SolutionLevelData_ >::operator= ( const CoefficientInterpolator< LevelData_, SolutionLevelData_ > &   )  [private]


Member Data Documentation

template<typename LevelData_, typename SolutionLevelData_ = LevelData_>
int CoefficientInterpolator< LevelData_, SolutionLevelData_ >::m_numComps [private]

template<typename LevelData_, typename SolutionLevelData_ = LevelData_>
bool CoefficientInterpolator< LevelData_, SolutionLevelData_ >::m_inCall [private]


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

Generated on Fri Apr 5 04:24:57 2019 for Chombo + EB by  doxygen 1.5.5