8.1.4 Methods returning information

nelems( )
Returns the number of elements in the Formex.

nplex( )
Returns the number of points in each element.

ndim( self)
Returns the number of dimensions. This is the number of coordinates for each point.

In the current implementation this is always 3, though you can define 2D Formices by given only two coordinates: the third will automatically be set to zero.

npoints( )
Return the number of points in the Formex.

This is the product of the nelems() and nplex().

shape( )
Return the shape of the Formex.

The shape of a Formex is the shape of its data array, i.e. a tuple (nelems, nplex, ndim).

data( )
Return the Formex as a numpy array. Since the ndarray object has a method view() returning a view on the ndarray, this method allows writing code that works with both Formex and ndarray instances. The results is always an ndarray.
x( )
Return the x-plane.
y( )
Return the y-plane.
z( )
Return the z-plane.

prop( )
Return the properties as a numpy array, or None if the Formex has no properties.

maxprop( )
Return the highest property used, or None if the Formex has no properties.

propSet( )
Return a list with the unique property values on this Formex, or None if the Formex has no properties.

bbox( )
Return the bounding box of the Formex.

The bounding box is the smallest rectangular volume in global coordinates, such that no points of the Formex are outside the box. It is returned as a [2,3] array: the first row holds the minimal coordinates and the second one the maximal.

center( )
Return the center of the Formex. This is the center of its bbox().

centroid( )
Return the centroid of the Formex. This is the point whose coordinates are the mean values of those of all the pointsof the Formex.

sizes( )
Returns an array with shape (3,) holding the length of the bbox along the 3 axes.

diagonal( )
Return the length of the diagonal of the bbox().

bsphere( )
Return the diameter of the bounding sphere of the Formex.

The bounding sphere is the smallest sphere with center in the center() of the Formex, and such that no points of the Formex are lying outside the sphere. It is not necessarily the smallest sphere surrounding all points of the Formex.

centroids( )
Return the centroids of all elements of the Formex.

The centroid of an element is the point whose coordinates are the mean values of all points of the element. The return value is a plex-1 Formex.

distanceFromPlane( p,n)
Return the distance from the plane (p,n) for all points of the Formex.

p is a point specified by 3 coordinates. n is the normal vector to a plane, specified by 3 components.

The return value is a (nelems(),nplex()) shaped array with the distance of each point to the plane containing the point p and having normal n. Distance values are positive if the point is on the side of the plane indicated by the positive normal.

distanceFromLine( p,q)
Return the distance from the line (p,q) for all points of the Formex.

p and q are two points specified by 3 coordinates.

The return value is a (nelems(),nplex()) shaped array with the distance of each point to the line through p and q. All distance values are positive or zero.

distanceFromPoint( p)
Return the distance from the point p for all points of the Formex.

p is a point specified by 3 coordinates.

The return value is a (nelems(),nplex()) shaped array with the distance of each point to the line through p and q. All distance values are positive or zero.

feModel( nodesperbox=1,repeat=True,rtol=1.e-5,atol=1.e-5)
Return a tuple of nodal coordinates and element connectivity.

A tuple of two arrays is returned. The first is a float array with the coordinates of the unique nodes of the Formex. The second is an integer array with the node numbers connected by each element. The elements come in the same order as they are in the Formex, but the order of the nodes is unspecified. By the way, the reverse operation of coords,elems = feModel(F) is accomplished by F = Formex(coords[elems]). There is a (very small) probability that two very close nodes are not equivalenced by this procedure. Use it multiple times with different parameters to check.

rtol and atol are the relative, resp. absolute tolerances used to decide whether any nodal coordinates are considered to be equal.