/***********************************************************************************
Copyright 2011 Bryan Johnson, Xiaoyue Guan & Charles F. Gammie
mthreed version 1.0 (released Jun 2, 2011)
This file is part of mthreed. mthreed adopts a ZEUS-like scheme to solve
magnetohydrodynamic equations of motion in a shearing sheet. It uses obital
advection to ensure fast and accurate integration in a large shearing box.
You are morally obligated to cite the following paper in his/her
scientific literature that results from use of any part of mthreed:
[1] Johnson, B.M., Guan, X. \& Gammie, C.F. \ 2008, Astrophysical Journal,
Supplement, 177, 373
The latest version of the mthreed is available on our code distribution
website:
http://rainman.astro.uiuc.edu/codelib/
mthreed is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
mthreed is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with mthreed; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************************/
#include "decs.h"
/* driving power spectrum cut off at kmax */
#define KMAX 16
void step_drive()
{
REAL tmp,rhoa,X,Z ;
int i,j,k ;
LOOP {
X = (i + 0.5)*dx - 0.5*Lx ;
Z = (k + 0.5)*dz - 0.5*Lz ;
tmp = drive*cos(W*t)*Z ;
rhoa = 0.5*(rho[i][j][k] + rho[i-1][j][k]) ;
work += dx*dy*dz*rhoa*tmp*vx[i][j][k] ;
workp += dx*dy*dz*rhoa*drive*sin(W*t)*Z*vx[i][j][k] ;
vx[i][j][k] += dt*tmp ;
}
}