forked from asmaxwell/NSDI-Pulse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NSDI_Pulse.cpp
61 lines (49 loc) · 1.67 KB
/
NSDI_Pulse.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <iostream>
#include <sstream>
#include <sys/stat.h>
#include <catch2/catch_session.hpp>
#include <catch2/catch_test_macros.hpp>
#include "actionData.h"
#include "speGrid.h"
/*
* Created by Andrew S Maxwell 12/12/2023
*
* NSDI code using a sin square pulse envelope
*/
int main(int argc, char **argv) {
const std::string PATH="Data/";
//ensure Data folder exists not will not overwrite existing one
struct stat st;
if(stat(PATH.c_str(),&st)==-1){
mkdir(PATH.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
}
speGridParameters gridParam;
gridParam.Nz1 = gridParam.Nz2 = 201;
gridParam.Nx1 = gridParam.Nx2 = 3;
gridParam.pfStart={-3, -3};
gridParam.pfEnd={3, 3};
gridParam.E01 = 0.79;
gridParam.E02 = 1.51;
//laser parameters
double omega = 0.057, rtUp = std::sqrt(1.2), phi = 0.;
int N = 1;
fieldTypes fieldType = fieldTypes::monochromatic;
laserField LF = std::make_shared<fields::monochromaticField>(omega, rtUp, phi, N, fieldType);
speGrid saddlePointGrid(gridParam, LF);
saddlePointGrid.populateGrid();
size_t midPointx = gridParam.Nx1/2;
size_t midPointz = gridParam.Nz1/2;
saddlePointGrid.solvePointRandom(midPointx, midPointz, midPointx, midPointz);
saddlePointGrid.propagateSolutionOverGrid(midPointx, midPointz, midPointx, midPointz);
saddlePointGrid.printToFile(PATH+"SaddlePointSoluitons.dat");
//compute action
actionData actionGrid(saddlePointGrid);
actionGrid.calculateAllAction();
actionGrid.printToFile(PATH+"ActionData.dat");
int result = 0;
//uncomment below to run all unit tests
// result = Catch::Session().run( argc, argv );
return result;
}
TEST_CASE( "1: All test cases reside in other .cpp files (empty)", "[multi-file:1]" ) {
}