direct.c
/* Evaluate at a group of observers the fields due to a group of sources. */
Evaluate at a group of observers the fields due to a group of sources.
Evaluate at a group of observers the fields due to a group of sources .
void blockinteract (int tkey, int tct, int *skeys, int *scts, int numsrc) {
	int i, l, boxoff[3], idx[3], *obslist, *srclist;
	cplx *buf, *gptr, *bptr;
	cplx *cobs;
	buf = FFTW_MALLOC (nfftprod * sizeof(cplx));
	memset (buf, 0, nfftprod * sizeof(cplx));
	obslist = ScaleME_getBasisList (tkey);
	cobs = (cplx *)ScaleME_getOutputVec (tkey);
	GRID (boxoff, obslist[0], fmaconf.nx, fmaconf.ny);
	boxoff[0] -= fmaconf.numbuffer;
	boxoff[1] -= fmaconf.numbuffer;
	boxoff[2] -= fmaconf.numbuffer;
	for (l = 0; l < numsrc; ++l) {
		srclist = ScaleME_getBasisList (skeys[l]);
		bptr = cacheboxrhs (srclist[0], skeys[l]);
		GRID (idx, srclist[0], fmaconf.nx, fmaconf.ny);
		idx[0] -= boxoff[0];
		idx[1] -= boxoff[1];
		idx[2] -= boxoff[2];
		gptr = gridints + nfftprod * IDX(nbors,idx[0],idx[1],idx[2]);
		for (i = 0; i < nfftprod; ++i) buf[i] += gptr[i] * bptr[i];
	}
	FFTW_EXECUTE_DFT (bplan, buf, buf);
	for (l = 0; l < fmaconf.bspboxvol; ++l) {
		GRID(idx, l, fmaconf.bspbox, fmaconf.bspbox);
		cobs[l] += buf[IDX(nfft,idx[0],idx[1],idx[2])];
	}
	FFTW_FREE (buf);
	return;
}
void blockinteract ( int tkey , int tct , int * skeys , int * scts , int numsrc ) { int i , l , boxoff [ 3 ] , idx [ 3 ] , * obslist , * srclist ; cplx * buf , * gptr , * bptr ; cplx * cobs ; buf = FFTW_MALLOC ( nfftprod * sizeof ( cplx ) ) ; memset ( buf , 0 , nfftprod * sizeof ( cplx ) ) ; obslist = ScaleME_getBasisList ( tkey ) ; cobs = ( cplx * ) ScaleME_getOutputVec ( tkey ) ; GRID ( boxoff , obslist [ 0 ] , fmaconf . nx , fmaconf . ny ) ; boxoff [ 0 ] -= fmaconf . numbuffer ; boxoff [ 1 ] -= fmaconf . numbuffer ; boxoff [ 2 ] -= fmaconf . numbuffer ; for ( l = 0 ; l < numsrc ; ++ l ) { srclist = ScaleME_getBasisList ( skeys [ l ] ) ; bptr = cacheboxrhs ( srclist [ 0 ] , skeys [ l ] ) ; GRID ( idx , srclist [ 0 ] , fmaconf . nx , fmaconf . ny ) ; idx [ 0 ] -= boxoff [ 0 ] ; idx [ 1 ] -= boxoff [ 1 ] ; idx [ 2 ] -= boxoff [ 2 ] ; gptr = gridints + nfftprod * IDX ( nbors , idx [ 0 ] , idx [ 1 ] , idx [ 2 ] ) ; for ( i = 0 ; i < nfftprod ; ++ i ) buf [ i ] += gptr [ i ] * bptr [ i ] ; } FFTW_EXECUTE_DFT ( bplan , buf , buf ) ; for ( l = 0 ; l < fmaconf . bspboxvol ; ++ l ) { GRID ( idx , l , fmaconf . bspbox , fmaconf . bspbox ) ; cobs [ l ] += buf [ IDX ( nfft , idx [ 0 ] , idx [ 1 ] , idx [ 2 ] ) ] ; } FFTW_FREE ( buf ) ; return ; }
Evaluate at a group of observers the fields due to a group of sources.
Evaluate at a group of observers the fields due to a group of sources .
/* Clear the local output buffer. */ /* Find the output vector segment and the target basis list. */ /* Find the index for the first basis in the target box. */ /* Find the minimum box index for near interactions. */ /* Populate the local grid with contributions from near boxes. */ /* Get the cached RHS for the source box in question.
		 * The cache may need to be filled. */ /* Get the index fo the first basis in the source box. */ /* Find the local box number. */ /* Point to the Green's function for this box. */ /* Convolve the source field with the Green's function and
		 * augment the field at the target. */ /* Inverse transform the grid in place. */ /* Augment with output with the local convolution. */ /* Note that each ScaleME "basis" is actually a finest-level group. */ /* Augment the RHS. */