Project-5/include/WaveSimulation.hpp
2023-12-17 13:33:06 +01:00

46 lines
1.0 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;
public:
int32_t N;
arma::cx_mat V;
arma::cx_mat U;
arma::sp_cx_mat A;
WaveSimulation(double h, double dt, double T);
virtual void solve(std::ofstream& ofile);
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 write_U(std::ofstream &ofile);
void step();
void build_V(double thickness, double pos_x, double aperture_sparation, double aperture, uint32_t slits);
};
#endif