FDM
- FDM class:
Python class, available in the file share/FDM.py file, that provides an interface to the filter diagonalization method [WC08] for extracting eigenmodes and their frequencies from time-domain data. In [ACWB09], we validate the method and demonstrate its accuracy.
FDM methods
- __init__ (self, prefix, fieldName, beginDump, endDump)
Initialize the FDM object. Here
prefixis the path to the data files, up to and excluding the underscore preceding the dataset name.fieldNameis the name of the field to analyze to obtain frequencies.beginDumpandendDumpare the first and one greater than the last dump numbers to use.
- setPointsRandom (self, npts)
Select
nptsrandom field points to use in the analysis. Components will also be chosen randomly.
- setPointsUniform (self, npts, component = None)
Here,
nptsis a tuple giving the number of points to use in each spatial direction; points will be placed on a uniform grid. Ifcomponent(an integer) is given, only that component will be used. Ifcomponentis omitted, the component will be chosen from among all field components in a round-robin fashion.
- readAndCompute (self)
This reads the data specified and performs the bulk of the FDM analysis. However, computeModes must be called to compute a requested number of modes.
- computeModes (self, nmodes)
This computes the (complex) frequencies of
nmodesmodes.
- constructModes (self, fieldName, compl = real)
Construct the field
fieldNamefor the previously computed modes.complcan be eitherrealorimag. Eigenmode fields will be written to files namedEigenmode_*fieldName*[I]_modenum.h5in the same directory as the data. The letterIis appended to the field name for imaginary fields, andmodenumis the mode index, starting with 0, ordered from low to high frequency.
- displayModes (self)
Display the computed mode information in a convenient format. This gives the number of the mode, the frequency, the inverse Q and the SVD value which allows the user to understand where the reliable mode calculations stop.
Example use of FDM
import FDM
extr = FDM.FDM("modeExtract2s", "elecField", 2, 14)
extr.setPointsUniform((10, 10), None)
extr.readAndCompute()
extr.computeModes(2)
extr.constructModes("elecField")
extr.displayModes()