libftsh
A Fast Transform for Spherical Harmonics
 All Data Structures Files Functions Variables Defines
Defines | Functions
direct1_tofile.c File Reference

Precompute and save data for direct1 spherical harmonic transform. More...

#include "libftsh.h"

Defines

#define ENTEREXIT   0

Functions

void direct1_tofile (int numpts, int band_limit, REAL *node, REAL *weight, FILE *fp)
void init_direct1 (Pm_Direct_d **out, int halfpts, int band_limit, REAL *node)
void dump_direct1 (int numpts, int band_limit, REAL *node, REAL *weight, Pm_Direct_d *pmn_matrix, FILE *fp)

Detailed Description

Precompute and save data for direct1 spherical harmonic transform.

Summary:


Function Documentation

void direct1_tofile ( int  numpts,
int  band_limit,
REAL node,
REAL weight,
FILE *  fp 
)

This routine initializes the direct transform for spherical harmonics (version 1) and dumps it to a file.

INPUTS:

  • numpts -- the number of points on the full interval. Must be divisible by 2.
  • band_limit -- the bound on the degree of the expansion. In \(P^m_n\) notation this bounds n.
  • node -- an array of length numpts with the nodes, usually Arcsin of the usual gaussian nodes.
  • weight -- an array of length numpts with the quadrature weights

OUTPUTS: fp - the objects created are written onto the file pointed to by fp, in binary format. The file must be opened before calling this routine.

NOTES:

  • node and weight are input so the user can select.

Here is the call graph for this function:

void dump_direct1 ( int  numpts,
int  band_limit,
REAL node,
REAL weight,
Pm_Direct_d pmn_matrix,
FILE *  fp 
)

This routine dumps the initialization constructed by init_direct1 and general parameters for the direct transform for spherical harmonics, dense version.

INPUTS:

  • numpts -- the number of points on the full interval.
  • band_limit -- the bound on the degree of the expansion. In \(P^m_n\) notation this bounds n.
  • node -- an array of length numpts with the nodes, usually Arcsin of the usual gaussian nodes.
  • weights -- an array of length numpts with the quadrature weights
  • pmn_matrix -- an array of band_limit (==order_limit) Pm_Direct_d structures, each representing the matrix for one m.

OUTPUTS: fp -- the objects above are written into the file pointed to by fp, in binary format. The file must be opened before calling this routine.

Here is the call graph for this function:

Here is the caller graph for this function:

void init_direct1 ( Pm_Direct_d **  out,
int  halfpts,
int  band_limit,
REAL node 
)

This routine initializes for the transform for spherical harmonics, direct version 1. This version simple precomputes the Pm matrices and stores them in dense matrix format.

INPUTS:

  • halfpts -- half the number of points on the full interval. This implies the full number of points is even, and we also assume the nodes are symmetric. Currrently halfpts must also be even for our trig transforms to work.
  • band_limit -- the bound on the degree of the expansion. In \(P^m_n\) notation this bounds n. For gaussian nodes this must be < 2*halfpts and for other nodes it should be even smaller. We confirn band_limit < 2*halfpts but leave the rest to the user.
  • node -- an array with the nodes, usually Arcsin of the usual gaussian nodes. We use halfpts of these, representing half of the interval.

OUTPUTS: out -- memory is allocated for band_limit (==order_limit) Pm_Direct_d structures, each representing the matrix for one m. Various bits of memory are allocated for these, and values filled in.

Here is the call graph for this function:

Here is the caller graph for this function: