mlfma.c
/* Precomputes the near interactions for redundant calculations and sets up
 * the wave vector directions to be used for fast calculation of far-field patterns. */
Precomputes the near interactions for redundant calculations and sets up
the wave vector directions to be used for fast calculation of far-field patterns.
Precomputes the near interactions for redundant calculations and sets up the wave vector directions to be used for fast calculation of far - field patterns .
int fmmprecalc (real acatol, int useaca) {
	int ntheta, nphi, rank, i;
	MPI_Comm_rank (MPI_COMM_WORLD, &rank);
	ScaleME_getFinestLevelParams (&(fmaconf.nsamp), &ntheta, &nphi, NULL);
	if (!useaca) {
		fmaconf.acarank = 0;
		i = fullbuild (&(fmaconf.radpats), fmaconf.k0, ntheta,
				nphi, fmaconf.cell, fmaconf.bspbox);
		fprintf (stderr, "Rank %d: Far-field matrix element count: %d\n", rank, i);
	} else {
		if (acatol > 0)
			fmaconf.acarank = acabuild (&(fmaconf.radpats),
					fmaconf.k0, acatol, ntheta, nphi,
					fmaconf.cell, fmaconf.bspbox);
		else
			fmaconf.acarank = svdbuild (&(fmaconf.radpats),
					fmaconf.k0, -acatol, ntheta,
					nphi, fmaconf.cell, fmaconf.bspbox);
		fprintf (stderr, "Rank %d: Far-field matrix rank: %d\n", rank, fmaconf.acarank);
	}
	return fmaconf.acarank;
}
int fmmprecalc ( real acatol , int useaca ) { int ntheta , nphi , rank , i ; MPI_Comm_rank ( MPI_COMM_WORLD , & rank ) ; ScaleME_getFinestLevelParams ( & ( fmaconf . nsamp ) , & ntheta , & nphi , NULL ) ; if ( ! useaca ) { fmaconf . acarank = 0 ; i = fullbuild ( & ( fmaconf . radpats ) , fmaconf . k0 , ntheta , nphi , fmaconf . cell , fmaconf . bspbox ) ; fprintf ( stderr , " \n " , rank , i ) ; } else { if ( acatol > 0 ) fmaconf . acarank = acabuild ( & ( fmaconf . radpats ) , fmaconf . k0 , acatol , ntheta , nphi , fmaconf . cell , fmaconf . bspbox ) ; else fmaconf . acarank = svdbuild ( & ( fmaconf . radpats ) , fmaconf . k0 , - acatol , ntheta , nphi , fmaconf . cell , fmaconf . bspbox ) ; fprintf ( stderr , " \n " , rank , fmaconf . acarank ) ; } return fmaconf . acarank ; }
Precomputes the near interactions for redundant calculations and sets up
 the wave vector directions to be used for fast calculation of far-field patterns.
Precomputes the near interactions for redundant calculations and sets up the wave vector directions to be used for fast calculation of far - field patterns .
/* Get the finest level parameters. */ /* Build the direct far-field matrices. */ /* Use ACA if the tolerance is positive, otherwise use SVD. */