model.probe()
Create and define properties for probes, which you can add to a model to monitor some quantity (real or complex-valued number) during a time-dependent, frequency-domain, or parametric simulation.
Syntax
model.probe().create(<tag>,type);
model.probe(<tag>).model(<mtag>);
model.probe(<tag>).set(property,<value>);
model.probe(<ptag>).create(<etag>,"PointExpr");
model.probe(<ptag>).feature(<etag>).set(eproperty,<evalue>);
model.probe(<tag>).genResult(String sol)
model.probe(<tag>).image()
Description
model.probe().create(<tag>,type) creates a probe of type type with tag <tag>. Table 2-113 lists the supported probe types.
model.probe(<tag>).model(<ctag>) sets the probe’s model component node to <ctag>.
model.probe(<tag>).set(property,<value>) sets property to <value>.
model.probe(<ptag>).selection("dom") gets the source selection for a boundary point probe.
model.probe(<ptag>).create(<etag>,"PointExpr") creates a point probe expression of tag <etag>. This is supported for probes of the types DomainPoint and BoundaryPoint.
model.probe(<ptag>).feature(<etag>).set(eproperty,<evalue>) sets the property eproperty on the point probe expression <etag> to the value <evalue>.
model.probe(<tag>).genResult(String sol) where sol is a solver sequence tag. This function prepares for using a probe while solving or during results processing. The command is invoked automatically when a solver or study is run from the COMSOL Desktop for all active probes but needs to be invoked explicitly when run through the API. The function genResult(String sol) sets up result features for evaluating the corresponding probe using the solver sequence sol. If null is used, the default solver sequence for a solution dataset is used. When sol is none, the corresponding probe solution dataset does not refer to any solver sequence. This means, for example, that the current model is used for selections used for this probe. When a solver sequence is run, then solution to use for the probes is always reset to use the current solver.
Use the model.probe(<tag>).image() methods for plotting and exporting probe plot images. See Plotting and Exporting Images.
Boundary Probes, Domain Probes, Edge Probes, Point Probes, Global Variable Probes, and Point Probe Expressions
Probes can be of the following types:
Table 2-113: Probe Types.
Boundary Point Probes and Domain Point Probes
These are probes that can be defined at arbitrary points in the modeling domain or on its boundaries. There are two types:
Table 2-114: Point Probe Types.
Probes of the types listed in Table 2-113 take the following properties:
Table 2-115: Probe properties.
on | off
Integration order, when method is set to integration.
Lagrange order when points is set to lagrange.
integration | summation
Method used when type is set to average or integral.
Integration rule when points is set to integration.
node | integration | lagrange
Type of point when type is set to maximum or minimum.
average | maximum | minimum | integral
A point probe of the type DomainPoint takes the following properties:
Table 2-116: Probe properties.
on | off
on | off
on | off
1 | 2 | 3
pointnormal | pointdirection | twopoints | none
first | second
A point probe of BoundaryPoint type takes the following properties:
Table 2-117: Probe properties.
In addition, boundary point probes support the selection property "dom", through which a Selection object containing the boundary on which the probe point resides can be retrieved.
ExampleS
Retrieve the entities for the boundary selection of a boundary point probe.
Code for Use with Java
int[] entities = model.probe("pbnd1").selection("dom").entities();
Code for Use with MATLAB
entities = model.probe('pbnd1').selection('dom').entities();
Here, the length of the array entities is either 0 or 1.
Retrieve the coordinates for a domain point probe in 2D.
Code for Use with Java
model.probe("pdom1").set("coords",new double[][]{{-0.17134, 0.0155763}});
double[][] coords = model.component("comp1").probe("pdom1").getDoubleMatrix("coords");
Code for Use with MATLAB
model.probe('pdom1').set('coords',[0.8878505 0.0778816]);
coords = model.component('comp1').probe('pdom1').getDoubleMatrix('coords');