nearfield.h
1.65 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#ifndef NEARFIELD_H
#define NEARFIELD_H
//#include "defaults.h"
#include "fieldslice.h"
#include "montecarlo.h"
#include "rts/optics/material.h"
#include "sphere.h"
#include <vector>
#define EPSILON_FLOAT 0.000001
//This structure stores values relevant to creating the near field
struct nearfieldStruct
{
//incident wavelength
ptype lambda;
//condenser numerical aperature (internal and external)
ptype condenser[2];
//amplitude of the incident field
ptype A;
//position of the focus in 3D space
bsVector k; //cartesian coordinates, normalized
bsPoint focus;
//slice position and orientation in world space
rts::rtsQuad<ptype, 3> pos;
//slices for the focused field
fieldslice Uf;
// and total field: Uf + sum(Us)
fieldslice U;
//incident field order
int m;
//flag for a vector simulation
bool scalarSim;
//flag for a plane wave
bool planeWave;
//---------Scatterers------------
//angular resolution of scatterers
// number of divisions in [0 pi]
unsigned int angRes;
//list of materials
std::vector< rts::material<ptype> > mVector;
//list of scatterers
std::vector<sphere> sVector;
nearfieldStruct();
void init();
void destroy();
void Simulate();
void calcSpheres();
//plane waves for Monte-Carlo sampling
std::vector<bsVector> inWaves;
int nWaves;
void calcWaves();
std::string toStr();
void setRes(int x_res, int y_res);
void setPos(bsPoint pMin, bsPoint pMax, bsVector normal);
//this function re-computes the focused field
void scalarUf();
//compute the field scattered by all of the materials
void scalarUs();
//add the incident field to the sum of scattered fields
void sumUf();
};
#endif