At the MATLAB® prompt, the function
mphinterp evaluates the result at arbitrary points. To evaluate an expression at specific point coordinates, call the function
mphinterp as in the command:
where e1,... are the COMSOL Multiphysics
expressions to evaluate,
<coord> the evaluation point coordinates defined with a NxM double array,
N the space dimension of the evaluation domain, and
M is the number of evaluation points. The output
d1,... is a
Px
M double array, where
P is the length of the inner solution. If an evaluation point is outside the expressions definition domain the output value is NaN.
where <dsettag> is a selection dataset tag defined in the model, for example, Cut point, Cut Plane, Revolve, and so forth.
<dsettag> can also be a mesh dataset tag, in this case the evaluation is performed on the geometric mesh vertices.
The function mphinterp supports the following properties to set the data of the evaluation to perform:
<dsettag> is the tag of a solution dataset or a mesh dataset. The default value is the current solution dataset of the model. When a mesh dataset is specified the expression
<expr> can only be geometry or mesh expression.
where <seltag> is the tag of a selection node to use for the data evaluation.
<seltag> can also be a positive integer array that corresponds to the domain index list. The default selection is All domains where the expression is defined. If the evaluation point does not belong to the specified domain selection the output value is NaN.
where edim is one of the strings
'point',
'edge',
'boundary' or
'domain'. One can also use numerical values instead, which in 3D are the values from 0 to 3. The default settings correspond to the model geometry space dimension. When using a lower space dimension value, make sure that the evaluation point coordinates dimension has the same size.
where <ext> is a double value corresponding to the search distance as a scale in terms of the local element size. The default value is 0.1.
where <solnum> is an integer array corresponding to the inner solution index.
<solnum> can also be a string:
'end' or
'all' to evaluate the expression for the last inner solution, or all inner solution respectively. By default the evaluation is performed on all inner solution.
where <outersolnum> is a positive integer corresponding to the outer solution index.
<outersolnum> can also be a string,
'all' or
'end', to evaluate the expression for all or the last outer solution respectively. The default settings use the first outer solution for the data evaluation.
where <time> is a double array. The default value corresponds to all the stored time steps.
The function mphinterp returns in the MATLAB workspace a double array. It also supports other output formats.
with unit is a 1xN cell array where N is the number of expressions to evaluate.
the output data for evaluation points will only contains NaN.
where method can be one of the following value:
If the property evalmethod is set to
harmonic, you specify whether the expression should be linearized or not with the property
differential as shown below:
The default property value settings ('on') evaluates the differential of the expression with respect to the perturbation at the linearization point. If
diffvalue is
off, it evaluates the expression by taking the values of any dependent variables from the harmonic perturbation part of the solution.
With the property
recover, you can specify the accurate derivative recovery:
where recover is either
'ppr',
'pprint', or
'off' (the default). Set the property to
ppr to perform recovery inside domains or set to
pprint to apply recovery to all domain boundaries. Because the accurate derivative processing takes time, the property is disabled by default.
Set the unit property to specify the unit of the evaluation:
where unit is a cell array with the same size as
expr.
Use the property matherr to return an error for undefined operations or expressions: