Minimum, messy code

This commit is contained in:
2023-12-17 13:33:06 +01:00
parent 62b85340ed
commit 17f3429488
9 changed files with 427 additions and 12 deletions

View File

@@ -12,21 +12,34 @@
#ifndef __WAVE_SIMULATION__
#define __WAVE_SIMULATION__
#include "constants.hpp"
#include "literals.hpp"
#include <armadillo>
#include <cstdint>
class WaveSimulation {
protected:
int M;
arma::cx_mat U;
arma::cx_mat V;
arma::cx_mat A;
arma::cx_mat B;
uint32_t M;
arma::sp_cx_mat B;
double h;
double dt;
double T;
public:
virtual void solve() = 0;
void build_A(arma::cx_vec A_vec);
void build_B(arma::cx_vec B_vec);
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