17 #ifndef STABLE_SPECTRAL_PDE_1D_TMPL_HPP
18 #define STABLE_SPECTRAL_PDE_1D_TMPL_HPP
55 return std::string(
"stable_spectral_pde_1d_tmpl")+
typeid(T).name();
68 invals.
retrieve(_num,
"num_pulses",
this);
70 err(
"Number of pulses must be greater than zero",
"stable_spectral_pde_1d_tmpl<T>::postprocess",
74 if(this->dimension%num_pulses){
75 err(
"Dimension must be divisible by the number of pulses",
"stable_spectral_pde_1d_tmpl<T>::postprocess",
78 nts=this->dimension/num_pulses;
80 this->memp.add(nts, &t, &help);
81 for(
size_t i = 0; i < nts; i++){
82 t[i] = dt*((double)i-nts/2.0);
84 for(
size_t i = 0; i < nts; i++){
85 this->ucur[i] = this->ucur[i+nts] = 1.00/cosh(t[i]/2.0);
86 this->help[i] =
_real(this->ucur[i]);
92 for(
size_t i = 0; i < nts; i++){
93 this->ucur[i] = this->ucur[i+nts] = 1.00/cosh(t[i]/2.0);
97 for(
size_t i = 0; i < num_pulses; i++){
98 fft(this->ucur+i*nts, this->ucur+i*nts, nts);
100 post_fft_operations();
104 pre_ifft_operations();
106 for(
size_t i = 0; i < num_pulses; i++){
107 ifft(this->ucur+i*nts, this->ucur+i*nts, nts);
109 post_ifft_operations();