Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

TF/SF Taflove Computer Implementation

Status
Not open for further replies.

Chris Fadden

Newbie level 1
Newbie level 1
Joined
Mar 6, 2015
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
8
I am trying to implement my own 3D FDTD based on Taflove's book, however I'm running into trouble with my TF/SF implementation. I am attempting to model free space, with no scatterers, yet I am getting significant fields outside the Total Field region. I am modelling a 10 GHz sine wave with a deltax of 0.002.

I don't expect you to debug my code, but if anyone has an implementation of the fully general 3D TF/SF, not just in one direction, that would be fantastic. I am confident that I have accounted for the 1/2 offsets correctly, but I would like to confirm.

Thanks for your help

Code:
	[LEFT][TABLE="class: c syntaxHighlighter expand"]
[TR]
[TD="colspan: 2"]Code C - [[COLOR=#226C22]expand[/COLOR]][/TD]
[/TR]
[TR="class: li1"]
[TD]
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
[/TD]
[TD][COLOR=#993333]void[/COLOR] FDTD[COLOR=#339933]::[/COLOR][COLOR=#202020]TFSF[/COLOR][COLOR=#009900]([/COLOR][COLOR=#009900])[/COLOR]
[COLOR=#009900]{[/COLOR]
  [COLOR=#993333]int[/COLOR] i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#339933];[/COLOR] 
  
 
  [COLOR=#808080][I]/******************[/I][/COLOR]
[COLOR=#808080][I]   * Y Face H Updates[/I][/COLOR]
[COLOR=#808080][I]  ******************/[/I][/COLOR]
  
  [COLOR=#666666][I]//Initial Y [/I][/COLOR]
  j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933]-[/COLOR][COLOR=#0000dd]1[/COLOR][COLOR=#339933];[/COLOR]
   
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR] i [COLOR=#339933]<[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR] i[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] k [COLOR=#339933]<=[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR] k[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Hz[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]-=[/COLOR] Ce1D[COLOR=#339933]*[/COLOR]ExInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933]+[/COLOR][COLOR=#0000dd]1[/COLOR][COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
  
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR] i [COLOR=#339933]<=[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR] i[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] k [COLOR=#339933]<[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR] k[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Hx[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]+=[/COLOR] Ce1D[COLOR=#339933]*[/COLOR]EzInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933]+[/COLOR][COLOR=#0000dd]1[/COLOR][COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
 
  [COLOR=#666666][I]//Final Y[/I][/COLOR]
  
  j [COLOR=#339933]=[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR]
  
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR] i [COLOR=#339933]<[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR] i[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] k [COLOR=#339933]<=[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR] k[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Hz[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]+=[/COLOR] Ce1D[COLOR=#339933]*[/COLOR]ExInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
  
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR] i [COLOR=#339933]<=[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR] i[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] k [COLOR=#339933]<[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR] k[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Hx[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]-=[/COLOR] Ce1D[COLOR=#339933]*[/COLOR]EzInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
 
 
  [COLOR=#808080][I]/********************[/I][/COLOR]
[COLOR=#808080][I]   * Z Face H Updates[/I][/COLOR]
[COLOR=#808080][I]   *******************/[/I][/COLOR]
  
  [COLOR=#666666][I]//Initial Z[/I][/COLOR]
  k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933]-[/COLOR][COLOR=#0000dd]1[/COLOR][COLOR=#339933];[/COLOR]
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR] i [COLOR=#339933]<[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR] i[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR] j [COLOR=#339933]<=[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR] j[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Hy[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]+=[/COLOR] Ce1D[COLOR=#339933]*[/COLOR]ExInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#339933]+[/COLOR][COLOR=#0000dd]1[/COLOR][COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
  
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR] i [COLOR=#339933]<=[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR] i[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR] j [COLOR=#339933]<[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR] j[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Hx[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]-=[/COLOR] Ce1D[COLOR=#339933]*[/COLOR]EyInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#339933]+[/COLOR][COLOR=#0000dd]1[/COLOR][COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
  
  [COLOR=#666666][I]//Final Z[/I][/COLOR]
  k [COLOR=#339933]=[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR]
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR] i [COLOR=#339933]<[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR] i[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR] j [COLOR=#339933]<=[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR] j[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Hy[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]-=[/COLOR] Ce1D[COLOR=#339933]*[/COLOR]ExInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
 
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR] i [COLOR=#339933]<=[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR] i[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR] j [COLOR=#339933]<[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR] j[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Hx[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]+=[/COLOR] Ce1D[COLOR=#339933]*[/COLOR]EyInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
  
  [COLOR=#808080][I]/*****************[/I][/COLOR]
[COLOR=#808080][I]   *  X Face H Updates[/I][/COLOR]
[COLOR=#808080][I]   ****************/[/I][/COLOR]
   
  [COLOR=#666666][I]//Initial X[/I][/COLOR]
  i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933]-[/COLOR][COLOR=#0000dd]1[/COLOR][COLOR=#339933];[/COLOR]
  
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR] j [COLOR=#339933]<[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR] j[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] k [COLOR=#339933]<=[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR] k[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Hz[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]+=[/COLOR] Ce1D[COLOR=#339933]*[/COLOR]EyInc[COLOR=#009900]([/COLOR]i[COLOR=#339933]+[/COLOR][COLOR=#0000dd]1[/COLOR][COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
   
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR] j [COLOR=#339933]<=[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR] j[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] k [COLOR=#339933]<[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR] k[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR] 
      Hy[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]-=[/COLOR] Ce1D[COLOR=#339933]*[/COLOR]EzInc[COLOR=#009900]([/COLOR]i[COLOR=#339933]+[/COLOR][COLOR=#0000dd]1[/COLOR][COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
 
 
  [COLOR=#666666][I]//Final X[/I][/COLOR]
  i [COLOR=#339933]=[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR]
 
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR] j [COLOR=#339933]<[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR] j[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] k [COLOR=#339933]<=[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR] k[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Hz[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]-=[/COLOR]  Ce1D[COLOR=#339933]*[/COLOR]EyInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
  
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR] j [COLOR=#339933]<=[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR] j[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] k [COLOR=#339933]<[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR] k[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Hy[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]+=[/COLOR] Ce1D[COLOR=#339933]*[/COLOR]EzInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
  
  
  
  [COLOR=#808080][I]/****************** [/I][/COLOR]
[COLOR=#808080][I]   * Update 1D Grid [/I][/COLOR]
[COLOR=#808080][I]   *****************/[/I][/COLOR] 
  Update1D[COLOR=#009900]([/COLOR][COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR] [COLOR=#666666][I]//Increment time for the 1D grid [/I][/COLOR]
 
  [COLOR=#808080][I]/**************[/I][/COLOR]
[COLOR=#808080][I]   * Y Face E Updates[/I][/COLOR]
[COLOR=#808080][I]   *************/[/I][/COLOR]
 
  [COLOR=#666666][I]//Initial y[/I][/COLOR]
  j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR]
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR] i [COLOR=#339933]<[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR] i[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] k [COLOR=#339933]<=[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR] k[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Ex[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]-=[/COLOR] Ch1D[COLOR=#339933]*[/COLOR]HzInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933]-[/COLOR][COLOR=#0000dd]1[/COLOR][COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR] 
 
  j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR]
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR] i [COLOR=#339933]<=[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR] i[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] k [COLOR=#339933]<[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR] k[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Ez[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]+=[/COLOR] Ch1D [COLOR=#339933]*[/COLOR] HxInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933]-[/COLOR][COLOR=#0000dd]1[/COLOR][COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
  
  [COLOR=#666666][I]//Final Y [/I][/COLOR]
  j [COLOR=#339933]=[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR]
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR] i [COLOR=#339933]<[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR] i[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] k [COLOR=#339933]<=[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR] k[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Ex[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]+=[/COLOR] Ch1D[COLOR=#339933]*[/COLOR]HzInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR] 
 
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR] i [COLOR=#339933]<=[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR] i[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] k [COLOR=#339933]<[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR] k[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Ez[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]-=[/COLOR] Ch1D[COLOR=#339933]*[/COLOR]HxInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
 
 
  [COLOR=#808080][I]/********************[/I][/COLOR]
[COLOR=#808080][I]   *  Z Face E Updates[/I][/COLOR]
[COLOR=#808080][I]   *******************/[/I][/COLOR]
  
  [COLOR=#666666][I]//Initial Z  [/I][/COLOR]
  k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] 
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR] i [COLOR=#339933]<[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR] i[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR] j [COLOR=#339933]<=[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR] j[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR] 
      Ex[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]+=[/COLOR] Ch1D[COLOR=#339933]*[/COLOR]HyInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#339933]-[/COLOR][COLOR=#0000dd]1[/COLOR][COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
 
   
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR] i [COLOR=#339933]<=[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR] i[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR] j [COLOR=#339933]<[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR] j[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Ey[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]-=[/COLOR] Ch1D[COLOR=#339933]*[/COLOR]HxInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#339933]-[/COLOR][COLOR=#0000dd]1[/COLOR][COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
 
  [COLOR=#666666][I]//Final Z[/I][/COLOR]
  k [COLOR=#339933]=[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR]
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR] i [COLOR=#339933]<[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR] i[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR] j [COLOR=#339933]<=[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR] j[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Ex[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]-=[/COLOR] Ch1D[COLOR=#339933]*[/COLOR]HyInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
  
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR] i [COLOR=#339933]<=[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR] i[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR] j [COLOR=#339933]<[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR] j[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Ey[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]+=[/COLOR] Ch1D[COLOR=#339933]*[/COLOR]HxInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
  
 
  [COLOR=#808080][I]/**************************[/I][/COLOR]
[COLOR=#808080][I]   *  X Face E Updates[/I][/COLOR]
[COLOR=#808080][I]   *************************/[/I][/COLOR]
  
  [COLOR=#666666][I]//Initial X[/I][/COLOR]
  i [COLOR=#339933]=[/COLOR] TFSF_x0[COLOR=#339933];[/COLOR]
  
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR] j [COLOR=#339933]<[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR] j[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] k [COLOR=#339933]<=[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR] k[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Ey[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]+=[/COLOR] Ch1D[COLOR=#339933]*[/COLOR]HzInc[COLOR=#009900]([/COLOR]i[COLOR=#339933]-[/COLOR][COLOR=#0000dd]1[/COLOR][COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
  
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR] j [COLOR=#339933]<=[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR] j[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] k [COLOR=#339933]<[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR] k[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR] 
      Ez[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]-=[/COLOR] Ch1D[COLOR=#339933]*[/COLOR]HyInc[COLOR=#009900]([/COLOR]i[COLOR=#339933]-[/COLOR][COLOR=#0000dd]1[/COLOR][COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
  
  [COLOR=#666666][I]//Final X[/I][/COLOR]
  i [COLOR=#339933]=[/COLOR] TFSF_x1[COLOR=#339933];[/COLOR]
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR] j [COLOR=#339933]<[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR] j[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] k [COLOR=#339933]<=[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR] k[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
      Ey[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]-=[/COLOR] Ch1D[COLOR=#339933]*[/COLOR]HzInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
 
  [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]j [COLOR=#339933]=[/COLOR] TFSF_y0[COLOR=#339933];[/COLOR] j [COLOR=#339933]<=[/COLOR] TFSF_y1[COLOR=#339933];[/COLOR] j[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR]
    [COLOR=#b1b100]for[/COLOR][COLOR=#009900]([/COLOR]k [COLOR=#339933]=[/COLOR] TFSF_z0[COLOR=#339933];[/COLOR] k [COLOR=#339933]<[/COLOR] TFSF_z1[COLOR=#339933];[/COLOR] k[COLOR=#339933]++[/COLOR][COLOR=#009900])[/COLOR] 
      Ez[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR] [COLOR=#339933]+=[/COLOR] Ch1D[COLOR=#339933]*[/COLOR]HyInc[COLOR=#009900]([/COLOR]i[COLOR=#339933],[/COLOR]j[COLOR=#339933],[/COLOR]k[COLOR=#009900])[/COLOR][COLOR=#339933];[/COLOR]
 
  [COLOR=#b1b100]return[/COLOR][COLOR=#339933];[/COLOR]
[COLOR=#009900]}[/COLOR][/TD]
[/TR]
[/TABLE]
[/LEFT]
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top