pdeInfo
First version: 3.00.6.1
Syntax
pdeInfo(obj)
Details
Displays diagnostic information for objects returned by pdeDomain1D, pdeDomain2D, pdeCoeff1D, and pdeCoeff2D.
Domain and coefficient constructor functions return only the fields required for solving. To inspect information such as grid statistics, coefficient input types, nonzero terms, or mixed terms, call this function.
Parameters
obj A dictionary object returned by pdeDomain1D, pdeDomain2D, pdeCoeff1D, or pdeCoeff2D. obj does not support ordinary numeric vectors, such as grid node vectors, user-defined ordinary dictionaries, or result dictionaries returned by pdeSolver.
Returns
Returns a dictionary. The output fields depend on the type of the input object obj.
When obj is an object returned by pdeDomain1D, the returned dictionary contains the following fields:
type: STRING scalar, fixed to "structured1D".
dim: INT scalar, fixed to 1.
nx: INT scalar, number of nodes.
xMin: DOUBLE scalar, left endpoint.
xMax: DOUBLE scalar, right endpoint.
gridType: STRING scalar, either "uniform" or "nonuniform".
minDx: DOUBLE scalar, minimum adjacent spacing.
maxDx: DOUBLE scalar, maximum adjacent spacing.
avgDx: DOUBLE scalar, average adjacent spacing.
gridRatio: DOUBLE scalar, maxDx / minDx.
maxLocalRatio: DOUBLE scalar, maximum two-way ratio between adjacent spacings.
isUniform: BOOL scalar, indicating whether the grid is uniform.
regions: STRING vector, fixed to left, right.
When obj is an object returned by pdeDomain2D, the returned dictionary contains the following fields:
type: STRING scalar, fixed to "structured2D".
dim: INT scalar, fixed to 2.
nx: INT scalar, number of nodes in the x direction.
ny: INT scalar, number of nodes in the y direction.
xMin: DOUBLE scalar, left endpoint in the x direction.
xMax: DOUBLE scalar, right endpoint in the x direction.
yMin: DOUBLE scalar, left endpoint in the y direction.
yMax: DOUBLE scalar, right endpoint in the y direction.
gridTypeX: STRING scalar, grid type in the x direction.
gridTypeY: STRING scalar, grid type in the y direction.
minDx / maxDx: DOUBLE scalar, adjacent spacing range in the x direction.
minDy / maxDy: DOUBLE scalar, adjacent spacing range in the y direction.
gridRatioX / gridRatioY: DOUBLE scalar, global grid ratio in the two directions.
maxLocalRatioX / maxLocalRatioY: DOUBLE scalar, maximum local jump ratio in the two directions.
isUniformX / isUniformY: BOOL scalar, indicating whether the grid is uniform in the two directions.
totalNodes: LONG scalar, equal to nx * ny.
regions: STRING vector, fixed to xMin, xMax, yMin, yMax.
When obj is an object returned by pdeCoeff1D or pdeCoeff2D, the returned dictionary contains the following fields:
type: STRING scalar, either "operator1D" or "operator2D".
dim: INT scalar, spatial dimension.
form: STRING scalar, fixed to "operator".
activeTerms: STRING vector, names of nonzero scalar coefficients and function coefficients.
inputTypes: STRING-to-STRING dictionary, indicating whether each coefficient is "scalar" or "function".
containsFunction: BOOL scalar, indicating whether at least one function coefficient is included.
recommendedScheme: STRING scalar. For 1D coefficients, this is "theta"; for 2D coefficients, the default is "MCS".
When obj is an object returned by pdeCoeff2D, the returned dictionary also contains the following field:
hasCrossTerm: BOOL scalar, true when xy is a nonzero scalar or function.
Note: pdeInfo does not execute coefficient functions. Therefore, function coefficients are listed in activeTerms and make containsFunction true even if they return 0 at some sample points.
Examples
Example 1. View grid information for a one-dimensional Domain
xGrid = (0..10) / 10.0
domain = pdeDomain1D(xGrid)
info = pdeInfo(domain)
info[`nx]
info[`gridType]
info[`gridRatio]
Example 2. View grid information for a two-dimensional Domain
xGrid = (0..40) / 40.0
yGrid = (0..30) / 30.0
domain = pdeDomain2D(xGrid, yGrid)
info = pdeInfo(domain)
info[`nx]
info[`ny]
info[`totalNodes]
Example 3. View one-dimensional Coefficient information
coeff = pdeCoeff1D(
diff = def(x, t) { return 0.1 + x * x },
react = -0.05
)
info = pdeInfo(coeff)
info[`inputTypes]
info[`activeTerms]
info[`containsFunction]
Example 4. View two-dimensional mixed-term information
coeff = pdeCoeff2D(0.1, 0.2, 0.03)
info = pdeInfo(coeff)
info[`hasCrossTerm]
info[`recommendedScheme]
Related Functions: pdeCoeff1D, pdeCoeff2D, pdeDomain1D, pdeDomain2D
