47. plugins.isopar — Isoparametric transformations

class plugins.isopar.Isopar(eltype, coords, oldcoords)[source]

A class representing an isoparametric transformation

eltype is one of the keys in Isopar.isodata coords and oldcoords can be either arrays, Coords or Formex instances, but should be of equal shape, and match the number of atoms in the specified transformation type

The following three formulations are equivalent

trf = Isopar(eltype,coords,oldcoords)
G = F.isopar(trf)

trf = Isopar(eltype,coords,oldcoords)
G = trf.transform(F)

G = isopar(F,eltype,coords,oldcoords)
transform(X)[source]

Apply isoparametric transform to a set of coordinates.

Returns a Coords array with same shape as X

47.1. Functions defined in module plugins.isopar

plugins.isopar.evaluate(atoms, x, y=0, z=0)[source]

Build a matrix of functions of coords.

  • atoms: a list of text strings representing a mathematical function of x, and possibly of y and z.
  • x, y, z: a list of x- (and optionally y-, z-) values at which the atoms will be evaluated. The lists should have the same length.

Returns a matrix with nvalues rows and natoms colums.

plugins.isopar.exponents(n, layout='lag')[source]

Create tuples of polynomial exponents.

This function creates the exponents of polynomials in 1 to 3 dimensions which can be used to construct interpolation function over lagrangian, triangular or serendipity grids.

Parameters:

  • n: a tuple of 1 to 3 integers, specifying the degree of the polynomials in the x up to z directions. For a lagrangian layout, this is one less than the number of points in each direction.
  • layout: string, specifying the layout of grid and the selection of monomials to be used. Should be one of ‘lagrangian’, ‘triangular’, ‘serendipity’ or ‘border’. The string can be abbreviated to its first 3 characters.

Returns an integer array of shape (ndim,npoints), where ndim = len(n) and npoints depends on the layout:

  • lagrangian: npoints = prod(n). The point layout is a rectangular lagrangian grid form by n[i] points in direction i. As an example, specifying n=(3,2) uses a grid of 3 points in x-direction and 2 points in y-direction.
  • triangular: requires that all values in n are equal. For ndim=2, the number of points is n*(n+1)//2.
  • border: this is like the lagrangian grid with all internal points removed. For ndim=2, we have npoints = 2 * sum(n) - 4. For ndim=3 we have npoints = 2 * sum(nx*ny+ny*nz+nz*nx) - 4 * sum(n) + 8. Thus n=(3,3,3) will yield 2*3*3*3 - 4*(3+3+3) + 8 = 26
  • serendipity: tries to use only the corner and edge nodes, but uses a convex domain of the monomials. This may require some nodes inside the faces or the volume. Currently works up to (4,4) in 2D or (3,3,3) in 3D.
plugins.isopar.interpoly(n, layout='lag')[source]

Create an interpolation polynomial

parameters are like for exponents.

Returns a Polynomial that can be used for interpolation over the element.