Fortran: gradient of 3D array

windows

Guest
Hi everyone.<br /><br />I'm a physics student, of course from time to time I have to do some programming, I just haven't cracked it yet, doesn't really come naturally to me.<br /><br />Anyway, I'm writing a program modelling specific magnetic fields, and I have a 3D scalar field named flux(i,j,k).<br /><br />My task now is to take the gradient of this array to convert each point to the magnetic field. I can picture quite easily how I would do this in a 1-dimensional case, just sum a number of points and divide by the distance between the end points. I can't quite seem to translate this to 3D in my mind, though.<br /><br />Any hints or suggestions or pseudocode would be really helpful.<br /><br />Many thanks,<br />Tim.
</div>
 
Back
Top