Spectral Integral Suite in C++
|
Linop This class creates a Linear operator to solve TPBVPs. More...
#include <sis.hpp>
Public Member Functions | |
Linop () | |
A null-constructor for Linop. More... | |
Linop (const int &n_) | |
Makes a Linop by specifying the order n_ of the differential equation. More... | |
Linop (const Linop< T > &in) | |
Copy constructor. More... | |
void | operator= (const Linop< T > &in) |
Assignment operator. More... | |
Chebfun< T > | operator() (Chebfun< T > in) |
Apply the operator on a Chebfun. More... | |
void | operator+= (const Linop< T > &in) |
Add to self: More... | |
void | operator= (const T &in) |
Assignment operator for constant input. More... | |
void | operator= (const Eigen::Array< T, Eigen::Dynamic, 1 > &in) |
Assignment operator for function input, through Eigen array. More... | |
void | operator= (const std::valarray< T > &in) |
Assignment operator for function input, through valarray. More... | |
void | operator= (Chebfun< T > in) |
Assignment through a Chebfun: More... | |
Linop< T > | operator/ (T in) |
Dividing Linop by scalar. More... | |
void | set () |
Sets the the size of coefficient array based on the order of differential equation. Suppose order is 3, then the size of array needed is 4. More... | |
void | set (int n_) |
Sets the the size of coefficient array based on the order of differential equation. Suppose order is 3, then the size of array needed is 4. More... | |
void | ncc () |
Sets the the size of non-constant coefficient array based on the order of differential equation. Suppose order is 3, then the size of array needed is 4. This must be called before assigning non-constant coefficients. More... | |
void | ncc (int n_) |
Sets the the size of non-constant coefficient array based on the order of differential equation. Suppose order is 3, then the size of array needed is 4. This must be called before assigning non-constant coefficients. More... | |
Public Attributes | |
int | NCC |
Flag to set (value 1) for enabling nonconstant coefficients. More... | |
int | n |
The order of the Linear differential operator. More... | |
Eigen::Matrix< T, Eigen::Dynamic, 1 > | coef |
Stores the coefficients in the differential equation. More... | |
ChebfunMat< T > | coefFun |
Eigen::Matrix< T, Eigen::Dynamic, 1 > | solution |
Stores the solution. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<class T > | |
Linop< T > | operator* (Linop< T > L1, Linop< T > L2) |
These are used to define operator compositions, L1(L2). It is defined as operator multiplication, L1 * L2. Based on, \begin{align} \left[ \sum_{i=0}^{m}\,b_i(y)\,D^i \right] \, \left[ \sum_{j=0}^{n}\,a_i(y)\,D^i \right] \;=\; \sum_{i = 0}^{m}\,b_i(y)\, \sum_{j = 0}^{n}\sum_{k = 0}^{i}\,C^i_k\,a_j^k(y)\,Dj+i-k \end{align} Implemented by recursion, not by the formula above. More... | |
Linop This class creates a Linear operator to solve TPBVPs.
|
inline |
A null-constructor for Linop.
Definition at line 2632 of file sis.hpp.
References sis::Linop< T >::NCC.
|
inline |
Makes a Linop by specifying the order n_ of the differential equation.
Definition at line 2636 of file sis.hpp.
References sis::Linop< T >::coef, sis::Linop< T >::n, and sis::Linop< T >::NCC.
|
inline |
Copy constructor.
Definition at line 2643 of file sis.hpp.
References sis::Linop< T >::coef, sis::Linop< T >::coefFun, sis::Linop< T >::n, sis::Linop< T >::NCC, and sis::Linop< T >::solution.
|
inline |
Sets the the size of non-constant coefficient array based on the order of differential equation. Suppose order is 3, then the size of array needed is 4. This must be called before assigning non-constant coefficients.
Definition at line 2751 of file sis.hpp.
References sis::Linop< T >::coefFun, sis::Linop< T >::n, and sis::Linop< T >::NCC.
Referenced by sis::diff(), sis::dou2com(), sis::Linop< std::complex< T > >::imag(), sis::operator*(), sis::Linop< T >::operator*(), sis::operator+(), sis::Linop< T >::operator=(), sis::Linop< std::complex< T > >::operator=(), and sis::Linop< std::complex< T > >::real().
|
inline |
Sets the the size of non-constant coefficient array based on the order of differential equation. Suppose order is 3, then the size of array needed is 4. This must be called before assigning non-constant coefficients.
Definition at line 2760 of file sis.hpp.
References sis::Linop< T >::coefFun, sis::Linop< T >::n, and sis::Linop< T >::NCC.
|
inline |
Apply the operator on a Chebfun.
Definition at line 2663 of file sis.hpp.
References sis::Linop< T >::coef, sis::Linop< T >::coefFun, sis::diff(), sis::Linop< T >::n, sis::Linop< T >::NCC, and sis::Chebfun< T >::v.
|
inline |
|
inline |
Dividing Linop by scalar.
Definition at line 2718 of file sis.hpp.
References sis::Linop< T >::coef, sis::Linop< T >::coefFun, sis::Linop< T >::n, and sis::Linop< T >::NCC.
|
inline |
Assignment operator.
Definition at line 2654 of file sis.hpp.
References sis::Linop< T >::coef, sis::Linop< T >::coefFun, sis::Linop< T >::n, sis::Linop< T >::NCC, and sis::Linop< T >::solution.
Referenced by sis::Linop< T >::operator+=(), sis::Linop< std::complex< T > >::operator+=(), sis::Linop< T >::operator=(), and sis::Linop< std::complex< T > >::operator=().
|
inline |
Assignment operator for constant input.
Definition at line 2687 of file sis.hpp.
References sis::Linop< T >::coef, sis::Linop< T >::n, and sis::Linop< T >::NCC.
|
inline |
Assignment operator for function input, through Eigen array.
Definition at line 2695 of file sis.hpp.
References sis::Linop< T >::coefFun, sis::Linop< T >::n, and sis::Linop< T >::ncc().
|
inline |
Assignment operator for function input, through valarray.
Definition at line 2702 of file sis.hpp.
References sis::Linop< T >::coefFun, sis::Linop< T >::n, and sis::Linop< T >::ncc().
|
inline |
Assignment through a Chebfun:
Definition at line 2708 of file sis.hpp.
References sis::Chebfun< T >::c2p(), sis::Chebfun< T >::dct_flag, sis::Linop< T >::operator=(), sis::Chebfun< T >::p2c(), SIS_PHYS_SPACE, and sis::Chebfun< T >::v.
|
inline |
Sets the the size of coefficient array based on the order of differential equation. Suppose order is 3, then the size of array needed is 4.
Definition at line 2733 of file sis.hpp.
References sis::Linop< T >::coef, sis::Linop< T >::n, and sis::Linop< T >::NCC.
Referenced by sis::dou2com(), sis::Linop< std::complex< T > >::imag(), main(), sis::Linop< T >::operator*(), sis::operator*(), sis::operator+(), and sis::Linop< std::complex< T > >::real().
|
inline |
Sets the the size of coefficient array based on the order of differential equation. Suppose order is 3, then the size of array needed is 4.
Definition at line 2741 of file sis.hpp.
References sis::Linop< T >::coef, sis::Linop< T >::n, and sis::Linop< T >::NCC.
These are used to define operator compositions, L1(L2). It is defined as operator multiplication, L1 * L2. Based on,
\begin{align} \left[ \sum_{i=0}^{m}\,b_i(y)\,D^i \right] \, \left[ \sum_{j=0}^{n}\,a_i(y)\,D^i \right] \;=\; \sum_{i = 0}^{m}\,b_i(y)\, \sum_{j = 0}^{n}\sum_{k = 0}^{i}\,C^i_k\,a_j^k(y)\,Dj+i-k \end{align}
Implemented by recursion, not by the formula above.
<std::complex<T>>
Definition at line 12928 of file sis.hpp.
References sis::Linop< T >::coef, sis::Linop< T >::coefFun, sis::diff(), sis::Linop< T >::n, sis::Linop< T >::NCC, sis::Linop< T >::ncc(), and sis::Linop< T >::set().
Eigen::Matrix<T, Eigen::Dynamic, 1> sis::Linop< T >::coef |
Stores the coefficients in the differential equation.
Definition at line 2569 of file sis.hpp.
Referenced by sis::conj(), sis::diff(), sis::dou2com(), sis::Linop< std::complex< T > >::imag(), sis::Linop< T >::Linop(), sis::Linop< std::complex< T > >::Linop(), main(), sis::Linop< T >::operator()(), sis::Linop< std::complex< T > >::operator()(), sis::Linop< std::complex< T > >::operator*(), sis::operator*(), sis::Linop< T >::operator*(), sis::operator+(), sis::operator-(), sis::Linop< T >::operator/(), sis::Linop< std::complex< T > >::operator/(), sis::Linop< T >::operator=(), sis::Linop< std::complex< T > >::operator=(), sis::Linop< std::complex< T > >::real(), sis::Linop< T >::set(), and sis::Linop< std::complex< T > >::set().
ChebfunMat<T> sis::Linop< T >::coefFun |
Use this to input all non-constant coefficients.
For instance, for the differential operator \(2y^2\,\partial_y + 3y\), coefFun \( [0]= 2y^2\) and coef \([1] = 3y\), where y is a array whose cheb-points have been set. Note that this can only be called after calling Linop.ncc(), which initiates non-constant coefficients. One can also use the Eigen format to input coefficients. For example, to set coefficients of above differential equation, we need to do the following (assuming double precision):
Alternatively, in the eigen-input format, one can do the following:
Note that when ncc() is called coef is no more used in any function in Linop. In other words, DO NOT to mix coef and coefFun and expect it to work. If there is even one non-constant coefficient in the differential equation, then you must set coefficients in coefFun, and not in coef. This also means that constant coefficients problem can be solved as a non-constant coefficient problem, as in consider the differential operator \(2\,\partial_y + 3\). This can input as a constant coefficient problem in the following manner:
or as a non-constant coefficient problem as in:
Ofcourse, constant input to a coefFun automatically assigns values at all cheb-points to that constant.
However, the constant coefficient solver is far more efficient in terms of speed and memory than a non-constant solver, and hence we provide separate solvers for each case.
Definition at line 2621 of file sis.hpp.
Referenced by sis::conj(), sis::diff(), sis::dou2com(), sis::Linop< std::complex< T > >::imag(), sis::Linop< T >::Linop(), sis::Linop< std::complex< T > >::Linop(), sis::Linop< T >::ncc(), sis::Linop< std::complex< T > >::ncc(), sis::Linop< T >::operator()(), sis::Linop< std::complex< T > >::operator()(), sis::Linop< std::complex< T > >::operator*(), sis::operator*(), sis::Linop< T >::operator*(), sis::operator+(), sis::operator-(), sis::Linop< T >::operator/(), sis::Linop< std::complex< T > >::operator/(), sis::Linop< T >::operator=(), sis::Linop< std::complex< T > >::operator=(), and sis::Linop< std::complex< T > >::real().
int sis::Linop< T >::n |
The order of the Linear differential operator.
Definition at line 2566 of file sis.hpp.
Referenced by sis::conj(), sis::diff(), sis::Linop< std::complex< T > >::imag(), sis::Linop< T >::Linop(), sis::Linop< std::complex< T > >::Linop(), main(), sis::Linop< T >::ncc(), sis::Linop< std::complex< T > >::ncc(), sis::Linop< T >::operator()(), sis::Linop< std::complex< T > >::operator()(), sis::Linop< std::complex< T > >::operator*(), sis::operator*(), sis::Linop< T >::operator*(), sis::operator+(), sis::operator-(), sis::Linop< T >::operator/(), sis::Linop< std::complex< T > >::operator/(), sis::Linop< T >::operator=(), sis::Linop< std::complex< T > >::operator=(), sis::Linop< std::complex< T > >::real(), sis::Linop< T >::set(), and sis::Linop< std::complex< T > >::set().
int sis::Linop< T >::NCC |
Flag to set (value 1) for enabling nonconstant coefficients.
Definition at line 2565 of file sis.hpp.
Referenced by sis::conj(), sis::diff(), sis::Linop< T >::Linop(), sis::Linop< std::complex< T > >::Linop(), sis::Linop< T >::ncc(), sis::Linop< std::complex< T > >::ncc(), sis::Linop< T >::operator()(), sis::Linop< std::complex< T > >::operator()(), sis::Linop< std::complex< T > >::operator*(), sis::operator*(), sis::Linop< T >::operator*(), sis::operator+(), sis::operator-(), sis::Linop< T >::operator/(), sis::Linop< std::complex< T > >::operator/(), sis::Linop< T >::operator=(), sis::Linop< std::complex< T > >::operator=(), sis::Linop< T >::set(), and sis::Linop< std::complex< T > >::set().
Eigen::Matrix<T, Eigen::Dynamic, 1> sis::Linop< T >::solution |
Stores the solution.
The solution here involves storing the Chebyshev coeefficients of the highest derivative in the differential equation, and also the constants of integration. This can be used to construct all other lower derivatives using integration.
First N+1 elements of sol hold the Chebyshev coefficients and the remaining elements store the integration constants
Definition at line 2629 of file sis.hpp.
Referenced by sis::Linop< T >::Linop(), sis::Linop< std::complex< T > >::Linop(), sis::Linop< T >::operator=(), and sis::Linop< std::complex< T > >::operator=().