WVTransform
Represent a fluid state with orthogonal wave and geostrophic solutions.
Declaration
classdef WVTransform < matlab.mixin.indexing.RedefinesDot & CAAnnotatedClassOverview
WVTransform is the abstract base class for wave-vortex transforms.
Each concrete transform represents the fluid state at time
t with spectral coefficients and exposes physical variables such as
velocity, isopycnal displacement, pressure, and potential vorticity.
Density is denoted by \(\rho\). Energetic quantities are normalized per
unit reference density \(\rho_0\) unless a method states otherwise.
The distinguishing feature of a WVTransform is that an instantaneous
fluid state is represented as energetically orthogonal wave, inertial,
geostrophic, and mean-density-anomaly constituents. No temporal filter is
required to perform the decomposition. The same object can reconstruct
\((u,v,w,\rho,p)\), relative vorticity, potential vorticity, energetic
diagnostics, and custom registered variables from those coefficients.
Choose one of five concrete transform classes:
WVTransformConstantStratification, in hydrostatic or nonhydrostatic modeWVTransformHydrostaticWVTransformBoussinesqWVTransformStratifiedQGWVTransformBarotropicQG
Wave-bearing transforms store positive- and negative-frequency wave and
inertial coefficients in Ap and Am, and zero-frequency geostrophic
and mean-density-anomaly coefficients in A0. Quasigeostrophic
transforms use A0 only. The Apt, Amt, and A0t variables are the
corresponding coefficients evaluated at the current transform time.
Topics
- Create and restore a transform
waveVortexTransformFromFileInitialize a WVTransform instance from an existing file
- Inspect the domain
- Spectral grid
- Resolution and shape
summarizeDegreesOfFreedomSummarize the spatial grid and active spectral degrees of freedom.
- Resolution and shape
- Transform configuration
isHydrostaticWhether the transform uses the hydrostatic approximation.
- Spectral grid
- Initialize the flow
- General initialization
addRandomFlowadd randomized flow to the existing stateaddUVEtaadd \((u,v,\eta)\) to the existing valuesinitFromNetCDFFileinitialize the flow from a NetCDF fileinitWithRandomFlowinitialize with a random flow stateinitWithUVEtainitialize with fluid variables \((u,v,\eta)\)initWithUVRhoinitialize with fluid variables \((u,v,\rho)\)removeAllremoves all energy from the model
- General initialization
- Evaluate physical fields
- Registered variables
hasVariableWithNameTest whether state variables are registered by name.summarizeVariablesPrint a table of registered state variables and cache status.variableNamesReturn the names of all registered state variables.variableWithNameCompute or retrieve one or more registered transform variables.
- At arbitrary positions
variableAtPositionWithNameAccess dynamical variables at arbitrary positions in the domain.
- Registered variables
- Manage forcing and closures
- Configure forcing
addForcingAdd forcing or closure objects to this transform.setForcingReplace the complete forcing registry.removeForcingRemove the exact registered forcing objects.removeAllForcingRemove every forcing and closure from this transform.
- Inspect forcing and closures
forcingforcingNamesReturn forcing and closure names in application order.forcingWithNameReturn registered forcing objects by name.hasForcingWithNameTest whether forcing objects are registered by name.hasClosureWhether a closure is currently attached to the transform.
- Summarize forcing
summarizeForcingPrint a table of registered forcing and closure objects.
- Configure forcing
- Analyze the flow
- Flow diagnostics
hasMeanPressureDifferenceDiagnose an MDA mean-pressure difference between the boundaries.
- Spectra
- Frequency
convertFromWavenumberToFrequencyBin wave energy by vertical mode and intrinsic frequency
- Frequency
- Flow diagnostics
- Analyze energy
- Component energy
totalEnergyOfFlowComponentCompute the energy carried by one flow component.
- Total energy
totalEnergyTotal energy computed from wave-vortex coefficients.totalEnergySpatiallyIntegratedTotal energy computed from physical-space fields.
- Energy summaries
summarizeEnergyContentdisplays a summary of the energy content of the fluidsummarizeModeEnergyList the most energetic modes
- Component energy
- Save transform state
writeToFileWrite this instance to NetCDF file.
- Convert representations
- Physical fields and coefficients
transformUVEtaToWaveVortextransform fluid variables \((u,v,\eta)\) to wave-vortex coefficients \((A_+,A_-,A_0)\).transformWaveVortexToUVWEtatransform wave-vortex coefficients \((A_+,A_-,A_0)\) to fluid variables \((u,v,\eta)\).
- Physical fields and coefficients
- Inspect flow components
- Primary flow components
primaryFlowComponentsPrimary flow components that partition the active coefficient state.primaryFlowComponentNamesretrieve the names of all available variablesprimaryFlowComponentWithNameretrieve a WVPrimaryFlowComponent by name
- Registered and combined components
flowComponentsAll registered physical and diagnostic flow components.flowComponentNamesretrieve the names of all available variablesflowComponentWithNameretrieve a WVFlowComponent by nametotalFlowComponentCombined view of all primary flow components.
- Summarize flow components
summarizeFlowComponentsPrint a table of registered primary and diagnostic components.
- Primary flow components
- Inspect wave-vortex coefficients
- Create a related transform
spectralVariableWithResolutioncreate a new variable with different resolutionwaveVortexTransformWithDoubleResolutioncreate a new WVTransform with double resolutionwaveVortexTransformWithResolutionCreate the same transform family at a new resolution.
- Extend a transform
- Flow components
addFlowComponentadd a flow component and its standard variablesaddPrimaryFlowComponentadd a primary flow component, automatically added to the flow
- Operations and variables
addOperationRegister one or more operations and their output variables.operationWithNameretrieve a WVOperation by nameremoveOperationRemove the exact registered operation and its cached outputs.
- Flow components
- Get package information
versionInstalled WaveVortexModel version.
Developer Topics
These items document internal implementation details and are not part of the primary public API.
- Projection and reconstruction coefficients
- Geometry and mode indexing
- Additional geometry utilities
concatenateVariablesAlongTimeDimensionConcatenate variables along the time dimensionspatialDimensionNamesspectralDimensionNames
- Additional geometry utilities
- Spectral transforms and operators
optimizedTransformsForFlowComponentreturns optimized transforms that avoid unnecessary computationtransformFromSpatialDomainWithFgRequired for transformUVEtaToWaveVortextransformFromSpatialDomainWithGgtransformToSpatialDomainWithFRequired for transformWaveVortexToUVEtatransformToSpatialDomainWithFAllDerivativestransformToSpatialDomainWithGtransformToSpatialDomainWithGAllDerivatives
- Nonlinear flux and forcing internals
energyFluxFromNonlinearFluxconverts nonlinear flux into energy fluxenstrophyFluxFromNonlinearFluxconverts nonlinear flux into enstrophy fluxforcingTypenFluxedComponentsnonlinearFluxnonlinearFluxForFlowComponentsreturns the flux of each coefficient as determined by the nonlinear flux operationnonlinearFluxWithGradientMasksreturns the flux of each coefficient as determined by the nonlinear flux operationnonlinearFluxWithMaskreturns the flux of each coefficient as determined by the nonlinear fluxrk4NonlinearFluxrk4NonlinearFluxForFlowComponentsspatialFluxForcingspectralAmplitudeForcingspectralFluxForcing
- Persistence internals
createNetCDFFileForTimeStepOutputOutput theWVTransformto file with variable time dimensioninitForcingFromNetCDFFileforcingGroupName = join( [string(class(self)),”forcing”],”-“);restoreForcingAmplitudes
- Caches and registries
addToVariableCacheadd variable to internal cache, in case it is needed againclassDefinedOperationForKnownVariableThis is one of two functions that returns operations for computingclearVariableCacheOfApAmA0DependentVariablesclear the internal cacheclearVariableCacheOfTimeDependentVariablesclear the internal cache of variables that claim to be time dependentdefaultOperationsreturn array of WVOperation instances initialized by defaultfetchFromVariableCacheretrieve a set of variables from the internal cacheflowComponentNameMapforcingNameMapoperationForKnownVariableThis is one of two functions that returns operations for computingoperationNameMapoperationVariableNameMapperformOperationcomputes (runs) the operationperformOperationWithNamecomputes (runs) the operationprimaryFlowComponentNameMappropertyAnnotationForKnownVariableThis is one of two functions that returns operations for computingpropertyAnnotationsForTransformreturn array of CAPropertyAnnotations for the WVTransformremoveFromVariableCacheremove one variable from the internal cachetimeDependentVariablesNameMapupdateDependentVariablesNameMapvariableCachewvCoefficientDependentVariablesNameMap
- Class internals
- Construction internals
WVTransformInitialize the internal WVTransform state for a concrete subclass.