ActiveField™ Help    

Main QuickField Site  

Free Downloads  

Contacts  

ActiveField Technology
What's New
Objects Overview
Hierarchy Chart
How to Start: Application Object
How to work with Problems
How to work with Model
How to work with Data
How to Analyze Results

Objects

Properties

Methods

Parametric Simulation Samples

Contour Object

Contour Object

                                   

Summary

Contour Interface

Details

The Contour object represents a contour in a field picture window that is used for calculating integrals, drawing xy-plots and viewing field values tabulated along the it. Each FieldWindow owns exactly one Contour. When the FieldWindow is first created the Contour is empty. You access the Contour by the Contour property of the FieldWindow object.

The Contour object provides some methods for adding and deleting lines, edges or blocks to the contour. They are almost similar to the corresponding commands in the QuickField graphic user interface. In addition a Contour objects provides some read-only properties to get information about the contour: starting and ending point, contour length and square, number of contour parts and others.

Methods for Contour Editing

AddLineTo (
    p as Point, angle as double)

Adds a line (segment or arc) to the contour.
p parameter is an ending point of the created line. If p is omitted, the line is drawing to the contour starting point, so the contour becomes closed.
angle parameter if omitted is defaulted as zero.

If the contour is empty, the first call of the AddLineTo method does nothing but remembering p as a starting point of the contour. The line will be created by the next call of AddLineTo.

AddEdge (
    labelName as String, near as Point)

Adds a model edge to the contour. The same rules as with interactive editing are applied to the edge adding. The desired edge might be pointed by its labelName, by the nearest point near, or both.

If no parameters is given or there is some ambiguity, the first suitable edge is used.

AddBlock (
    labelName As String, near as Point)

Adds a model block to the contour. The same rules as with interactive editing are applied to the block adding. The desired block might be pointed by its labelName, by the nearest point near, or both.

If no parameters is given or there is some ambiguity, the first suitable block is used

Unlike the interactive editing, adding the block that is already included to contour does nothing. To exclude a block from the contour a special method DeleteBlock should be used.

DeleteBlock (
    labelName As String, near as Point)

Deleted a model block from the contour. The desired block might be pointed by its labelName, by the nearest point near, or both.

If no parameters is given or there is some ambiguity, the first suitable block is used

Delete (EntireContour As Boolean)

If the EntireContour is FALSE or omitted, the last added line/edge/block is deleted. Otherwise, the entire contour becomes empty.

ChangeDirection ()

Turn the contour direction.

Information Properties

Parent property as FieldWindow
(read-only)

Returns the Fieldwindow possessing the contour.

StartPoint property as Point
(read-only)

Returns the starting point.

EndPoint property as Point
(read-only)

Returns the ending point.

Lenght property as double
(read-only)

Returns the contour length.

Square property as double
(read-only)

Returns the square of closed contour, otherwise zero.

Closed property as Boolean
(read-only)

Returns TRUE if the contour is closed, i.e. its starting point coincides with the ending point.

Connectivity property as Integer
(read-only)

Returns the number of connectivity component of the contour, considered as a graph. An empty contour has Connectivity = 0. Connectivity can be great than one only if the contour is built by adding some several non-adjacent blocks.

The example below builds two contours for the model, representing a synchronous electric motor.

  • The first contour consists of all the blocks represents the left sides of the pole winding. They are labeled as Winding+. This contour is used to calculate the magnetic flux of the pole.
  • The second contour is a circle consisting of two semicircular arcs in the air gap between the rotor and stator. It is used for the mechanical torque calculation.

Dim Wnd As QuickField.FieldWindow 'Result field window object
' Get FieldWindow object
Set Wnd = Res.Windows(1)
' Get new Contour object
Dim Cnt as QuickField.Contour
Set Cnt = Wnd.Contour

Cnt.Delete True    ' Delete an old contour (if any)
Cnt.AddBlock "Winding+"
Dim Flux as Double
Flux = Res.GetIntegral(qfInt_FluxLinkage, Cnt).Abs


Const PI as Double = 3.1415926 ' The PI constant
Dim Ra As Double    ' Air Gap Diameter
Ra = 74.5
Cnt.Delete True    ' Delete an old contour
Cnt.AddLineTo PointXY(Ra, 0), 0
Cnt.AddLineTo PointXY(-Ra, 0), 3.1415926
Cnt.AddLineTo PointXY(Ra, 0), 3.1415926
Dim Torque as Double
Torque = Res.GetIntegral(qfInt_MaxwellTorque, Cnt).Abs