\subsection{src/ridc.cpp File Reference}
\label{ridc_8cpp}\index{src/ridc.\+cpp@{src/ridc.\+cpp}}
{\ttfamily \#include \char`\"{}ridc.\+h\char`\"{}}\\*
{\ttfamily \#include $<$stdio.\+h$>$}\\*
\subsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void {\bf ridc\+\_\+fe} ({\bf O\+D\+E} $\ast$ode, int order, double $\ast$sol)
\item 
void {\bf ridc\+\_\+be} ({\bf O\+D\+E} $\ast$ode, int order, double $\ast$sol)
\item 
void {\bf lagrange\+\_\+coeff} (double $\ast$x, int Nx, int i, double $\ast$L)
\item 
double {\bf get\+\_\+quad\+\_\+weight} (double $\ast$L, int Nx, double a, double b)
\item 
void {\bf integration\+\_\+matrices} (int N, double $\ast$$\ast$S)
\item 
void {\bf init\+\_\+unif\+\_\+nodes} (double $\ast$x, int Nx, double a, double b)
\item 
void {\bf corr\+\_\+fe} ({\bf O\+D\+E} $\ast$ode, double $\ast$uold, double $\ast$$\ast$fprev, double $\ast$$\ast$S, int index, int level, double t, double $\ast$unew)
\item 
void {\bf corr\+\_\+be} ({\bf O\+D\+E} $\ast$ode, double $\ast$uold, double $\ast$$\ast$fprev, double $\ast$$\ast$S, int index, int level, double t, double $\ast$unew)
\end{DoxyCompactItemize}


\subsubsection{Function Documentation}
\index{ridc.\+cpp@{ridc.\+cpp}!corr\+\_\+be@{corr\+\_\+be}}
\index{corr\+\_\+be@{corr\+\_\+be}!ridc.\+cpp@{ridc.\+cpp}}
\paragraph[{corr\+\_\+be(\+O\+D\+E $\ast$ode, double $\ast$uold, double $\ast$$\ast$fprev, double $\ast$$\ast$\+S, int index, int level, double t, double $\ast$unew)}]{\setlength{\rightskip}{0pt plus 5cm}void corr\+\_\+be (
\begin{DoxyParamCaption}
\item[{{\bf O\+D\+E} $\ast$}]{ode, }
\item[{double $\ast$}]{uold, }
\item[{double $\ast$$\ast$}]{fprev, }
\item[{double $\ast$$\ast$}]{S, }
\item[{int}]{index, }
\item[{int}]{level, }
\item[{double}]{t, }
\item[{double $\ast$}]{unew}
\end{DoxyParamCaption}
)}\label{ridc_8cpp_a8f0874733447d234c1f21129a19c5630}
R\+I\+D\+C helper function -\/ solves error equation, updating the solution from time t to time t+param.dt.

\begin{DoxyReturn}{Returns}
(by reference) unew\+: solution at time level t + param.\+dt
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em ode} & abstract class containing parameters and step/rhs functions \\
\hline
{\em uold} & solution at time level t \\
\hline
{\em fprev} & matrix containing derivative information from previous steps, previous level \\
\hline
{\em S} & integration matrix (quadrature weights) \\
\hline
{\em index} & decides which quadrature weights to use \\
\hline
{\em level} & determines size of quadrature stencil \\
\hline
{\em t} & current time iterate \\
\hline
{\em unew} & solution at the new time level, passed by reference \\
\hline
\end{DoxyParams}


Definition at line 894 of file ridc.\+cpp.



References O\+D\+E\+::dt, O\+D\+E\+::neq, and O\+D\+E\+::step().



Referenced by ridc\+\_\+be().

\index{ridc.\+cpp@{ridc.\+cpp}!corr\+\_\+fe@{corr\+\_\+fe}}
\index{corr\+\_\+fe@{corr\+\_\+fe}!ridc.\+cpp@{ridc.\+cpp}}
\paragraph[{corr\+\_\+fe(\+O\+D\+E $\ast$ode, double $\ast$uold, double $\ast$$\ast$fprev, double $\ast$$\ast$\+S, int index, int level, double t, double $\ast$unew)}]{\setlength{\rightskip}{0pt plus 5cm}void corr\+\_\+fe (
\begin{DoxyParamCaption}
\item[{{\bf O\+D\+E} $\ast$}]{ode, }
\item[{double $\ast$}]{uold, }
\item[{double $\ast$$\ast$}]{fprev, }
\item[{double $\ast$$\ast$}]{S, }
\item[{int}]{index, }
\item[{int}]{level, }
\item[{double}]{t, }
\item[{double $\ast$}]{unew}
\end{DoxyParamCaption}
)}\label{ridc_8cpp_a9d505d3e3fe2d373768b906cc207b199}
R\+I\+D\+C helper function -\/ solves error equation, updating the solution from time t to time t+param.dt.

\begin{DoxyReturn}{Returns}
(by reference) unew\+: solution at time level t + param.\+dt
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em ode} & abstract class containing parameters and step/rhs functions \\
\hline
{\em uold} & solution at time level t \\
\hline
{\em fprev} & matrix containing derivative information from previous steps, previous level \\
\hline
{\em S} & integration matrix (quadrature weights) \\
\hline
{\em index} & decides which quadrature weights to use \\
\hline
{\em level} & determines size of quadrature stencil \\
\hline
{\em t} & current time iterate \\
\hline
{\em unew} & solution at the new time level, passed by reference \\
\hline
\end{DoxyParams}


Definition at line 846 of file ridc.\+cpp.



References O\+D\+E\+::dt, O\+D\+E\+::neq, and O\+D\+E\+::step().



Referenced by ridc\+\_\+fe().

\index{ridc.\+cpp@{ridc.\+cpp}!get\+\_\+quad\+\_\+weight@{get\+\_\+quad\+\_\+weight}}
\index{get\+\_\+quad\+\_\+weight@{get\+\_\+quad\+\_\+weight}!ridc.\+cpp@{ridc.\+cpp}}
\paragraph[{get\+\_\+quad\+\_\+weight(double $\ast$\+L, int Nx, double a, double b)}]{\setlength{\rightskip}{0pt plus 5cm}double get\+\_\+quad\+\_\+weight (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{L, }
\item[{int}]{Nx, }
\item[{double}]{a, }
\item[{double}]{b}
\end{DoxyParamCaption}
)}\label{ridc_8cpp_a07e5dce091c0ec540e8f9aff1bbc2a66}
R\+I\+D\+C helper function -- generates quadrature weight, int(L\+\_\+\{n,i\}(x),x=a..b)

\begin{DoxyReturn}{Returns}
quadrature weights
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em a} & range of integration \\
\hline
{\em b} & range of integration \\
\hline
{\em Nx} & number of quadrature nodes \\
\hline
{\em L} & coefficients for Lagrange poly, L[0] + L[1]x + L[2]x$^\wedge$2 + ... \\
\hline
\end{DoxyParams}


Definition at line 723 of file ridc.\+cpp.



Referenced by integration\+\_\+matrices().

\index{ridc.\+cpp@{ridc.\+cpp}!init\+\_\+unif\+\_\+nodes@{init\+\_\+unif\+\_\+nodes}}
\index{init\+\_\+unif\+\_\+nodes@{init\+\_\+unif\+\_\+nodes}!ridc.\+cpp@{ridc.\+cpp}}
\paragraph[{init\+\_\+unif\+\_\+nodes(double $\ast$x, int Nx, double a, double b)}]{\setlength{\rightskip}{0pt plus 5cm}void init\+\_\+unif\+\_\+nodes (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{x, }
\item[{int}]{Nx, }
\item[{double}]{a, }
\item[{double}]{b}
\end{DoxyParamCaption}
)}\label{ridc_8cpp_a6784be1bca782a9aef5584921af9304c}
R\+I\+D\+C helper function -- initializes uniformly spaced quadrature nodes

\begin{DoxyReturn}{Returns}
(by reference) x\+: uniformly spaced quadrature nodes
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em Nx} & number of quadrature nodes \\
\hline
{\em a} & range of integration \\
\hline
{\em b} & range of integration \\
\hline
{\em x} & quadrature node location (returned by reference) \\
\hline
\end{DoxyParams}


Definition at line 811 of file ridc.\+cpp.



Referenced by integration\+\_\+matrices().

\index{ridc.\+cpp@{ridc.\+cpp}!integration\+\_\+matrices@{integration\+\_\+matrices}}
\index{integration\+\_\+matrices@{integration\+\_\+matrices}!ridc.\+cpp@{ridc.\+cpp}}
\paragraph[{integration\+\_\+matrices(int N, double $\ast$$\ast$\+S)}]{\setlength{\rightskip}{0pt plus 5cm}void integration\+\_\+matrices (
\begin{DoxyParamCaption}
\item[{int}]{Nx, }
\item[{double $\ast$$\ast$}]{S}
\end{DoxyParamCaption}
)}\label{ridc_8cpp_a4bd004e1c1236beb766757b596fae927}
R\+I\+D\+C helper function -- constructions the integration matrix using get\+\_\+quad\+\_\+weight

\begin{DoxyReturn}{Returns}
(by reference) the integration matrix S
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em Nx} & number of quadrature nodes \\
\hline
{\em S} & integration matrix (by reference) \\
\hline
\end{DoxyParams}


Definition at line 765 of file ridc.\+cpp.



References get\+\_\+quad\+\_\+weight(), init\+\_\+unif\+\_\+nodes(), and lagrange\+\_\+coeff().



Referenced by ridc\+\_\+be(), and ridc\+\_\+fe().

\index{ridc.\+cpp@{ridc.\+cpp}!lagrange\+\_\+coeff@{lagrange\+\_\+coeff}}
\index{lagrange\+\_\+coeff@{lagrange\+\_\+coeff}!ridc.\+cpp@{ridc.\+cpp}}
\paragraph[{lagrange\+\_\+coeff(double $\ast$x, int Nx, int i, double $\ast$\+L)}]{\setlength{\rightskip}{0pt plus 5cm}void lagrange\+\_\+coeff (
\begin{DoxyParamCaption}
\item[{double $\ast$}]{x, }
\item[{int}]{Nx, }
\item[{int}]{i, }
\item[{double $\ast$}]{L}
\end{DoxyParamCaption}
)}\label{ridc_8cpp_a73647697e05b092fe6d4a43361977b0a}
R\+I\+D\+C helper function -- generates the coefficients for the lagrange interpolatory polynomials.

\begin{DoxyReturn}{Returns}
(by reference) L\+: coefficients for the Lagrange intepolatory polynomial. L is a vector of elements such that p(x) = L(0) + L(1)$\ast$x + L(2)$\ast$x$^\wedge$2 + ... 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em x} & quadrature nodes \\
\hline
{\em i} & the i$^\wedge$\{th\} Lagrange polynomial \\
\hline
{\em Nx} & number of quadrature nodes \\
\hline
{\em L} & coefficients, returned by reference \\
\hline
\end{DoxyParams}


Definition at line 652 of file ridc.\+cpp.



Referenced by integration\+\_\+matrices().

\index{ridc.\+cpp@{ridc.\+cpp}!ridc\+\_\+be@{ridc\+\_\+be}}
\index{ridc\+\_\+be@{ridc\+\_\+be}!ridc.\+cpp@{ridc.\+cpp}}
\paragraph[{ridc\+\_\+be(\+O\+D\+E $\ast$ode, int order, double $\ast$sol)}]{\setlength{\rightskip}{0pt plus 5cm}void ridc\+\_\+be (
\begin{DoxyParamCaption}
\item[{{\bf O\+D\+E} $\ast$}]{ode, }
\item[{int}]{order, }
\item[{double $\ast$}]{sol}
\end{DoxyParamCaption}
)}\label{ridc_8cpp_a44576f55de3e48c9752f1e75f31b1c72}
Main implicit ridc loop that initializes variables, integrates solution from ti to tf by bootstrapping the step function.

\begin{DoxyReturn}{Returns}
(by reference) sol, the solution at the final time, param.\+tf 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em ode} & abstract class containing parameters and step/rhs functions \\
\hline
{\em order} & order of the R\+I\+D\+C method (predictor + number of correctors) \\
\hline
{\em sol} & initial condition of the I\+V\+P \\
\hline
\end{DoxyParams}


Definition at line 341 of file ridc.\+cpp.



References corr\+\_\+be(), O\+D\+E\+::dt, integration\+\_\+matrices(), O\+D\+E\+::neq, O\+D\+E\+::nt, O\+D\+E\+::rhs(), O\+D\+E\+::step(), and O\+D\+E\+::ti.



Referenced by main().

\index{ridc.\+cpp@{ridc.\+cpp}!ridc\+\_\+fe@{ridc\+\_\+fe}}
\index{ridc\+\_\+fe@{ridc\+\_\+fe}!ridc.\+cpp@{ridc.\+cpp}}
\paragraph[{ridc\+\_\+fe(\+O\+D\+E $\ast$ode, int order, double $\ast$sol)}]{\setlength{\rightskip}{0pt plus 5cm}void ridc\+\_\+fe (
\begin{DoxyParamCaption}
\item[{{\bf O\+D\+E} $\ast$}]{ode, }
\item[{int}]{order, }
\item[{double $\ast$}]{sol}
\end{DoxyParamCaption}
)}\label{ridc_8cpp_a088c5b6cd62faca40e47d5a428a0877a}
Main explicit ridc loop that initializes variables, integrates solution from ti to tf by bootstrapping the step function. \begin{DoxyReturn}{Returns}
(by reference) sol, the solution at the final time, param.\+tf 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em ode} & abstract class containing parameters and step/rhs functions \\
\hline
{\em order} & order of the R\+I\+D\+C method (predictor + number of correctors) \\
\hline
{\em sol} & initial condition of the I\+V\+P \\
\hline
\end{DoxyParams}


Definition at line 32 of file ridc.\+cpp.



References corr\+\_\+fe(), O\+D\+E\+::dt, integration\+\_\+matrices(), O\+D\+E\+::neq, O\+D\+E\+::nt, O\+D\+E\+::rhs(), O\+D\+E\+::step(), and O\+D\+E\+::ti.



Referenced by main().

