Project-5/include/WaveSimulation.hpp
2023-12-19 16:08:58 +01:00

52 lines
1.4 KiB
C++

/** @file WaveSimulation.hpp
*
* @author Cory Alexander Balaton (coryab)
* @author Janita Ovidie Sandtrøen Willumsen (janitaws)
*
* @version 0.1
*
* @brief The definition of the WaveSimulation class
*
* @bug No known bugs
* */
#ifndef __WAVE_SIMULATION__
#define __WAVE_SIMULATION__
#include "constants.hpp"
#include "literals.hpp"
#include <armadillo>
#include <cstdint>
class WaveSimulation {
protected:
uint32_t M;
arma::sp_cx_mat B;
double h;
double dt;
double T;
void build_A();
void build_B();
void initialize_U(double x_c, double y_c, double sigma_x, double sigma_y,
double p_x, double p_y);
void build_V(double thickness, double pos_x, double aperture_separation,
double aperture, uint32_t slits);
public:
int32_t N;
arma::cx_mat V;
arma::cx_mat U;
arma::sp_cx_mat A;
WaveSimulation(double h, double dt, double T, double x_c, double y_c,
double sigma_x, double sigma_y, double p_x, double p_y,
double thickness, double pos_x, double ap_sep, double ap,
uint32_t slits);
WaveSimulation(double h, double dt, double T, double x_c, double y_c,
double sigma_x, double sigma_y, double p_x, double p_y);
virtual void solve(std::ofstream &ofile);
void write_U(std::ofstream &ofile);
void step();
};
#endif