Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explaining node indexing in update functions. #14

Open
JamesBremner opened this issue Nov 2, 2022 · 0 comments
Open

Explaining node indexing in update functions. #14

JamesBremner opened this issue Nov 2, 2022 · 0 comments

Comments

@JamesBremner
Copy link

Does anyone else have difficulty understanding the node indexing of the update functions?

image

What do the m+1 and m-1 do? Why doesn't the magnetic field not creep along the axis towrds the right, while the elctric field creep along in the opposite direction?

The answer is, of course, in figure 3.4

image

I had to stare at this for two days, off and on, before I got it.

I think, this figure could be more helpful. The problem, it seems to me, is that the brackets labelled 'index 0' etc are redundant since we can already see that the bracketed nodes share the indices. Maybe, the brackets should group the nodes that contribute to an update?

Here is how I have documented the update functions in the code I am developing for an acoustic simulation:

/* update velocity 
The velocity is a function of the previous velocity at this location
and the pressures at the nodes on each side of this location

Since a velocity node is assumed to be located one half the location delta 
away from the pressure nod with the same index ( k ) in the +ve direction
then the indices of the pressure locations on each side are k and k+1

Pk            Pk+1
  <<<<< Vk >>>>>
*/

/* update pressure 
The pressure is a function of the previous pressure at this location
and the velocities at the nodes on each side of this location

Since a pressure node is assumed to be located one half the location delta 
away from the velocity node with the same index ( k ) in the -ve direction
then the indices of the pressure locations on each side are k-1 and k

Vk-1            Vk
  <<<<< Pk >>>>>
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant