-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodels.c
More file actions
50 lines (44 loc) · 935 Bytes
/
Copy pathmodels.c
File metadata and controls
50 lines (44 loc) · 935 Bytes
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
#include "field.h"
#include "models.h"
#include "noModel.h"
#include "circleModel.h"
//#include "shelf.h"
//#include "nonshelf.h"
static double (*epsMethod)(double, double, int, int);
static void noModel(void)
{
//no material
epsMethod = noModel_EPS();
}
static void circleModel(void)
{
//cylinder material whitch radius = lambda, origin = center of field
epsMethod = circleModel_EPS(N_PX*0.5, N_PY*0.5, field_getLambda());
}
void setModel(enum MODEL model)
{
switch(model){
case NO_MODEL:
noModel();
break;
case MIE_CYLINDER:
circleModel();
break;
case SHELF :
case NONSHELF:
case LAYER:
break;
}
}
double models_eps(double x, double y, enum MODE mode){
double epsilon = EPSILON_0_S;
switch(mode){
case D_X :
epsilon = (*epsMethod)(x, y, 1, 0);
case D_Y :
epsilon = (*epsMethod)(x, y, 0, 1);
case D_XY :
epsilon = (*epsMethod)(x, y, 1, 1);
}
return epsilon;
}