VectorPlot3D Object

With this object three dimensional complex vector fields can be plotted in various ways. To choose what field to plot the SelectTreeItem command can be used.

General Methods

Type ( enum key )

Selects the type of Plot.

key can have one of  the following values:

"arrows"

Arrows will represent the field-vectors.

"arrowscolor"

The same as ”arrows”, but their color will change according to their fieldstrength.

"hedgehog”

The field vectors will be plotted as ”lines”.

 

PhaseValue ( double phase )

Specifies the phase of to be plotted complex field values.

 

PhaseStep ( double phasestep )

Specifies the step width used by phase incrementing actions.

 

Objects ( int objects )

Specifies the number of plotted objects. Depending on the plot type, objects may be arrows, hedgehogs or streamlines.

 

Scaling ( int scale )

Defines a scale factor of the plotted objects. A value between 0 and 100 may be given. This value influences the size of the objects.

 

LogScale ( bool switch )

Decides whether the fields should be plotted in a logarithmical scale or not.

 

LogStrength ( double strength )

The characteristic curve used for logarithmic scaling can be varied. Values from 1.0e-6 to 100000 are allowed.

 

LogAnchor ( double anchor )

Sets the anchor values used for logarithmical scaling.

 

LogAnchorType ( enum type )

Toggles between the automatic determination of the log anchor (type = "auto") and the user defined value set by LogAnchor (type = "user").

 

VectorOffset ( double offset )

Specifies an offset in normal direction for surface vectors to improve their visibility. Only offsets from -2 to 2 are allowed, whereby negative offsets will move the vector to the other side of the surface.

 

CheckVectorCollisions ( bool switch )

In case of strongly curved surfaces, high vector densities may occur. This method prevents vectors from being plotted into other vectors (switch = True). The collision check may take some time, therefore it is switched off by default (switch = False ).

 

SetTime ( double time )

The current time value of a time monitor plot is set.

 

SetSample ( long sample )

The current time sample number of a time monitor plot is set.

 

OptimizedArrowGrid ( bool switch )

The distance between adjacent arrows is optimized according to the field strength.

 

ClampValue ( double value )

Sets the maximum to which the plot is scaled. If you choose a maximum smaller than the field maximum, the field values greater than your chosen maximum are clamped (plotted as if they were equal to the chosen maximum).

 

ClampMode ( enum type )

Changes clamp mode (see ClampValue). If you choose to only clamp the size, you will get arrows of maximum size with different colors depending on the field value. If you choose a maximum greater than the field maximum, size and / or color are scaled down, as if the field maximum were the chosen maximum.

type can have one of  the following values:

"None"

No clamping is used.

"Size"

Only size is clamped.

"SizeColor"

Size and color is clamped.

 

Plot

Plots the field with the previously made settings.

Query

GetDomain enum

Returns the domain of the monitor used, return code can have the following values:

"frequency"

The plot is based on recordings of a frequency domain monitor.

"time"

The plot is based on recordings of a time domain monitor.

"static"

The plot is based on recordings of a static monitor.

 

GetNumberOfSamples long

Returns the total number of samples if the plot is based on recordings of a time monitor else 0.

 

GetTStart double

Returns the start time of recording if the plot is based on recordings of a time monitor else 0.0.

 

GetTEnd double

Returns the end time of recording if the plot is based on recordings of a time monitor else 0.0.

 

GetTStep double

Returns the time step width of recording if the plot is based on recordings of a time monitor else 0.0.

 

GetTime double

Returns the current  time set of a time monitor plot.

 

GetSample long

Returns the current time sample number of a time monitor plot.

 

AddListItem ( double x, double  y, double z)

Adds a field value query point to the internal coordinate list. Coordinates are expected in project units.

 

CalculateList

Calculates field values at all query points provided by the AddListItem command.

 

long GetListLength

Returns the number of field values calculated by CalculateList.

 

bool GetListItem( long index, double_ref FieldXRe, double_ref FieldXIm, double_ref FieldYRe, double_ref FieldYIm, double_ref FieldZRe, double_ref FieldZIm)

Returns the field value at position index calculated by CalculateList.

 

Reset

Clears the internal storage used by the field list evaluation and empties the evaluation point storage.

Default Settings

Type ("arrowscolor")

PhaseValue (0.0)

PhaseStep (22.5)

Objects (2000)

Scaling (50)

LogScale (False)

LogStrength (10.0)

OptimizedArrowGrid (True)

ClampValue (0.0)

ClampMode ("None")

VectorOffset (1.0)

CheckVectorCollisions (False)

SetTime (0.0)

SetSample (0)

Example

The following script plots the electric field  "e1" (if available) in a linear scale by using 400 colored arrows.

 

' Plot only a wire frame of the structure to be able to look inside

Plot.wireframe (True)

 

' Select the desired monitor in the tree.

SelectTreeItem ("2D/3D Results\E-Field\e1")

 

' Plot the field of the selected monitor

With VectorPlot3D

    .Type ("arrowscolor")

    .Objects (400)

    .Scaling (50)

    .LogScale (False)

    .Plot

End With