| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
mesh_patch_2D
2D mesh patch generator (for 4 or 8 points of a fixed distance from a central point). i.e., total number of mesh points may be 5 or 9.
Once either 5 or 9 points have been selected, this is fixed for the mesh patch instance. The central point p0 and radii r of the mesh points are mutable using the 'update' method. If shape='circle' (default), mesh points are equidistant from p0. If shape='square', mesh points are distributed around the corners and mid-sides of a square of side length 2*r.
The points are in the order p0 followed by points in 'clockwise' order in the phase plane defined by the two variable names in p0.
Functions / callable objects can be applied to all points in the mesh patch by calling the mesh patch's 'eval' method with the function. It returns an a dictionary of mesh points -> function return values.
The direction of minimum (interpolated) gradient of a functional over the mesh can be determined from the 'min_gradient_dir' method. A similar method 'max_gradient_dir' also exists.
Highly experimental class!
Rob Clewley, Jan 2007
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
_s2 = 0.70710678118654757
|
|||
_mesh5 =
|
|||
_mesh9s =
|
|||
_mesh9c =
|
|||
|
|||
|
Inherited from |
|||
|
|||
p0 should be of type Point, r must be either a scalar or a Point giving weighted radius in each of two directions, n must be 5 or 9.
|
Evaluate the function or callable object f at the mesh patch points.
Returns a dictionary of
mesh point index -> function value
Indices are always in the same order as the Pointset attribute 'mesh'
|
Find the direction of any local minima of a functional over
the mesh patch, whose dictionary of
mesh point index -> function value
is given by valdict. The magnitudes of these values are
compared. The direction is indicated by a Point object, a
relative position at the patch's characteristic radius from
p0.
If the functional is constant everywhere on the patch (degenerate)
then a random direction is returned. If the functional is constant
everywhere except at the centre, then the vector (0,0) is returned
if the centre has lower value; a random vector is returned
otherwise.
If the functional is partially degenerate on some subset of
mesh points then the optional orient and dir arguments can
provide a means to select, provided the mesh resolution is
sufficiently high.
orient is a vector (Point object) relative to p0 orienting a
"positive" direction, such that the integer dir = -1 or +1
selects one half of the mesh points on which to conduct the
search.
|
Find the direction of any local minima of a functional over
the mesh patch, whose dictionary of
mesh point index -> function value
is given by valdict. The magnitudes of these values are
compared. The direction is returned as a pair containing the two
closest mesh points to the direction (in mesh local coords).
If the functional is constant everywhere on the patch (degenerate)
then a random direction is returned. If the functional is constant
everywhere except at the centre, then the vector (0,0) is returned
if the centre has lower value; a random vector is returned
otherwise.
If the functional is partially degenerate on some subset of
mesh points then the optional orient and dir arguments can
provide a means to select, provided the mesh resolution is
sufficiently high.
orient is a vector (Point object) relative to p0 orienting a
"positive" direction, such that the integer dir = -1 or +1
selects one half of the mesh points on which to conduct the
search.
|
Find the direction of maximum gradient of a functional over
the mesh patch, whose dictionary of
mesh point index -> function value
is given by valdict. The magnitudes of the values are
compared. The direction is indicated by a Point object, a
relative position at the patch's characteristic radius from
p0.
If the functional is constant everywhere on the patch (degenerate)
then a random direction is returned. If the functional is constant
everywhere except at the centre, then the vector (0,0) is returned
if the centre has higher value; a random vector is returned
otherwise.
If the functional is partially degenerate on some subset of
mesh points then the optional orient and dir arguments can
provide a means to select, provided the mesh resolution is
sufficiently high.
orient is a vector (Point object) relative to p0 orienting a
"positive" direction, such that the integer dir = -1 or +1
selects one half of the mesh points on which to conduct the
search.
|
Find the direction of maximum gradient of a functional over
the mesh patch, whose dictionary of
mesh point index -> function value
is given by valdict. The magnitudes of the values are
compared. The direction is returned as a pair containing the two
closest mesh points to the direction (in mesh local coords).
If the functional is constant everywhere on the patch (degenerate)
then a random direction is returned. If the functional is constant
everywhere except at the centre, then the vector (0,0) is returned
if the centre has higher value; a random vector is returned
otherwise.
If the functional is partially degenerate on some subset of
mesh points then the optional orient and dir arguments can
provide a means to select, provided the mesh resolution is
sufficiently high.
orient is a vector (Point object) relative to p0 orienting a
"positive" direction, such that the integer dir = -1 or +1
selects one half of the mesh points on which to conduct the
search.
|
str(x)
|
str(x)
|
|
|||
_mesh9s
|
_mesh9c
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Sun Dec 2 23:44:23 2012 | http://epydoc.sourceforge.net |