mpheval
Evaluate expressions on node points.
Syntax
pd = mpheval(model,{e1,...,en},...)
Description
pd = mpheval(model,{e1,...,en},...) returns the post data pd for the expressions e1,...,en.
The output value pd is a structure with fields expr, p, t, ve, unit and fields for data values.
The field expr contains the expression name evaluated.
For each expression e1,...,en a field with the name d1,... dn is added with the numerical values. The columns in the data value fields correspond to node point coordinates in columns in p. The data contains only the real part of complex-valued expressions.
The field p contains node point coordinate information. The number of rows in p is the number of space dimensions.
The field t contains the indices to columns in p of a simplex mesh, each column in t representing a simplex.
The field ve contains indices to mesh elements for each node point.
The field unit contains the list of the unit for each expression.
The function mpheval accepts the following property/value pairs:
off | ppr | pprint
internal | none | everywhere
The property Dataset controls which dataset is used for the evaluation. Datasets contain or refer to the source of data for postprocessing purposes. Evaluation is supported only on Solution datasets.
The property Edim decides which elements to evaluate on. Evaluation takes place only on elements with space dimension Edim. If not specified, Edim equal to the space dimension of the geometry is used. The setting is specified as one of the following strings 'point', 'edge', 'boundary' or 'domain'. In previous versions it was only possible to specify Edim as a number. For example, in a 3D model, if evaluation is done on edges (1D elements), Edim is 1. Similarly, for boundary evaluation (2D elements), Edim is 2, and for domain evaluation (3D elements), Edim is 3 (default in 3D).
Use Recover to recover fields using polynomial-preserving recovery. This techniques recover fields with derivatives such as stresses or fluxes with a higher theoretical convergence than smoothing. Recovery is expensive so it is turned off by default. The value pprint means that recovery is performed inside domains. The value ppr means that recovery is also applied on all domain boundaries.
The property Refine constructs evaluation points by making a regular refinements of each element. Each mesh edge is divided into Refine equal parts.
The property Smooth controls if the post data is forced to be continuous on element edges. When Smooth is set to internal, only elements not on interior boundaries are made continuous.
The property Solnum is used to select the solution to plot when a parametric, eigenvalue, or time-dependent solver has been used to solve the problem.
The property Outersolnum is used to select the solution to plot when a parametric sweep has been used in the study.
When the property Phase is used, the solution vector is multiplied with exp(i*phase) before evaluating the expression.
The expressions e1,...,en are evaluated for one or several solutions. Each solution generates an additional row in the data fields of the post data output structure. The properties Solnum and t control which solutions are used for the evaluations. The Solnum property is available when the dataset has multiple solutions — for example, in the case of parametric, eigenfrequency, or time-dependent solutions. The t property is available only for time-dependent problems. If Solnum is provided, the solutions indicated by the indices provided with the Solnum property are used. If t is provided, solutions are interpolated. If neither Solnum nor t is provided, all solutions are evaluated.
For time-dependent problems, the variable t can be used in the expressions ei. The value of t is the interpolation time when the property t is provided, and the time for the solution, when Solnum is used. Similarly, lambda and the parameter are available as eigenvalues for eigenvalue problems and as parameter values for parametric problems, respectively.
Example
Evaluate the temperature at node points:
model = mphopen('model_tutorial_llmatlab');
std = model.study.create('std');
std.feature.create('stat','Stationary');
std.run;
dat = mpheval(model,'T');
Evaluate both the total heat flux magnitude and the temperature:
data = mpheval(model,{'ht.tfluxMag', 'T'});
Evaluate the temperature and return the data only:
data = mpheval(model,'T','dataonly','on');
Evaluate the temperature at the node points in domain 2:
data = mpheval(model,'T','selection',2);
Evaluate the temperature at the node points on boundary 7:
data = mpheval(model,'T','selection',7,'edim','boundary');
Evaluate the temperature at second order Lagrange points:
data = mpheval(model,'T','refine',2);
Evaluate the temperature at the Gauss points:
data = mpheval(model,'T','pattern','gauss');
Evaluate the temperature at every time step computed with power set to 30:
model = mphopen('model_tutorial_llmatlab');
std = model.study.create('std');
param = std.feature.create('param','Parametric');
time = std.feature.create('time','Transient');
time.set('tlist', 'range(0,1,25)');
param.setIndex('pname','power',0);
param.setIndex('plistarr','30 60 90',0);
std.run;
data = mpheval(model,'T','dataset','dset2');
Evaluate the temperature at the fifth time step:
data = mpheval(model,'T','dataset','dset2','solnum',5);
Evaluate the temperature at 10.5 sec and 15.2 sec:
data = mpheval(model,'T','dataset','dset2','t',[10.5,15.2]);
Evaluate the temperature at every time step computed with power set to 90:
data = mpheval(model,'T','dataset','dset2','outersolnum',3);
See also
mphevalglobalmatrix, mphevalpoint, mphevalpointmatrix, mphglobal, mphint2, mphinterp, mphparticle, mphray