Interp
Evaluate expressions in arbitrary points or datasets using interpolation.
Syntax
model.result().numerical().create(<ftag>,"Interp");
model.result().numerical(<ftag>).set(property, <value>);
model.result().numerical(<ftag>).getCoordinates();
model.result().numerical(<ftag>).getData();
model.result().numerical(<ftag>).getData(<expressionIndex>);
model.result().numerical(<ftag>).getImagData();
model.result().numerical(<ftag>).getImagData(<expressionIndex>);
model.result().numerical(<ftag>).isComplex();
model.result().numerical(<ftag>).isComplex(<outersolnum>);
model.result().numerical(<ftag>).getElements();
model.result().numerical(<ftag>).getNData();
model.result().numerical(<ftag>).run();
model.result().numerical(<ftag>).setInterpolationCoordinates(<value>);
Description
model.result().numerical().create(<ftag>,"Interp") creates an interpolation feature with the name <ftag>.
Interp is a feature made specifically for users of the COMSOL API and does not appear in the COMSOL Multiphysics GUI. Interp combines cut points and evaluation features, as well as allowing evaluation of arbitrary datasets. It supports multiple expressions and some additional advanced properties not available when using cut points and EvalPoint features.
result = model.result().numerical(<ftag>).getData() returns the real part of the result, recomputing the feature if necessary. result is a three-dimensional double matrix ordered result[expression][solnum][coordinates].
model.result().numerical(<ftag>).getData(<expressionIndex>) returns the real part of the result for one expression, equivalent to result[expressionIndex].
result = model.result().numerical(<ftag>).getImagData() returns the imaginary part of the result, recomputing the feature if necessary. result is a three-dimensional double matrix ordered result[expression][solnum][coordinates].
model.result().numerical(<ftag>).getImagData(<expressionIndex>) returns the imaginary part of the result for one expression, equivalent to result[expressionIndex].
model.result().numerical(<ftag>).isComplex() returns true if the result is complex. The resulting value is a scalar, which true if any of the expressions in an array is complex-valued.
model.result().numerical(<ftag>).isComplex(<outersolnum>) returns true if the result is complex for the given outer solution. <outersolnum> is applicable only for parametric sweep solutions and is the index of each outer parametric solution.
model.result().numerical(<ftag>).getElements() returns indices to columns in p of a simplex mesh.
model.result().numerical(<ftag>).getNData() returns the number of points in the data vector.
model.result().numerical(<ftag>).getCoordinates() returns the coordinates of the interpolation.
model.result().numerical(<ftag>).setInterpolationCoordinates(<value>) is identical to model.result().numerical(<ftag>).set(coord, <value>), when value is of type double[][].
The columns of the coord property are the coordinates for the evaluation points. If the number of rows in coord equals the space dimension, then coord are global coordinates, and the selection (or the property edim) determines the dimension in which the expressions are evaluated. For instance, dimension 2 means that the expressions are evaluated on boundaries in a 3D model. If the dimension to evaluate on is less than the space dimension, then the points in coord are projected onto the closest point on a domain of that dimension. It is further possible to select a single geometric entity of a given dimension. If so, then the closest point on that domain in the given dimension is used.
If the number of rows in coord is less than the space dimension, then these coordinates are parameter values on a geometry face or edge. In that case, the domain number for that face or edge must be specified in the selection.
For datasets that do not support selections, the edim property must always be used, and no selections are possible.
The following properties are available:
on | off
on | off
none | dataset name
on | off
auto | 0 | 1 | 2 | 3
linpoint | harmonic | lintotal | lintotalavg | lintotalrms | lintotalpeak
on | off
auto | integer
off | pprint | ppr
The unit to use for the expression in expr. If the old unit is not valid when the expression changes, the unit property is reset to default.
See Also
Eval, Global (Numerical), EvalPoint, EvalGlobal