fluid-project   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/external/fluid2d.xtm

Implementation

(bind-func fluid-project
  (lambda (velocx:double* velocy:double* p:double* div:double* iter Ny N)
    (let ((j 0)
    (i 0)
    (jj 0)
    (ii 0))
      (dotimes (j (- Ny 2))
  (dotimes (i (- N 2))
    (pset! div (+ (+ i 1) (* (+ j 1) N))
     (* -0.5 (/ (+ (- (pref velocx (+ (+ i 2) (* (+ j 1) N)))
          (pref velocx (+ i (* (+ j 1) N))))
             (- (pref velocy (+ (+ i 1) (* (+ j 2) N)))
          (pref velocy (+ (+ i 1) (* j N)))))
          (i64tod N))))
    (pset! p (+ (+ i 1) (* (+ j 1) N)) 0.0)
    1))


Back to Index

Similar Entries