33. calpy_itf — Calpy interface for pyFormex. — pyFormex 0.9.1 documentation

### Navigation

- index
- modules |
- next |
- previous |
- pyFormex 0.9.1 documentation >
- pyFormex reference manual >

# 33. `calpy_itf` — Calpy interface for pyFormex.

Currently this is only used to detect the installation of calpy and add the path of the calpy module to sys.path.

Importing this module will automatically check the availabilty of calpy and set the sys.path accordingly.

`Classes defined in module calpy_itf`

class `calpy_itf.` `QuadInterpolator`(nelems, nplex, gprule)

  A class to interface with calpy’s Quad class.

  We want to use the calpy interpolation facilities without having to set up a full model for calpy processing. This class just sets the necessary data to make the interpolation methods (GP2NOdes, NodalAcc, NodalAvg) work.

  Parameters:

  - nelems: number of elements
  - nplex: plexitude of the elements (supported is 4 to 9)
  - gprule: gauss integration rule
  `AddElements`(nodes, matnr, emat, coord, dofid)

    Add elements to group and store interpolation matrices

  `InterpolationMatrix`(elnod, xyz, gpx, gpw)

    Form interpolation matrix for QUAD/4-9 element

    The input gives a node set with either 4, 8 or 9 nodes. The 8 and 9 node versions may contain zeros to suppress higher order nodes. xyz[nnod,2] contains the coordinates of the actually existing nodes! gpx and gpw are the coordinates and weights of the Gauss integration points (gpx has 2 rows) The procedure returns two matrices: hall[3,nnod,ng] holds the values at all gauss points, of the interpolation function and its natural derivatives corresponding with each node. w[ng] holds the 2D weight of the gauss points.

  `Assemble`(s, emat, model)

    Assemble all elements of this group

  `StressGP`(v, emat)

    Compute stress at GP for all elements of this group

  `GP2Nodes`(data)

    Extrapolate a set of data at GP to 9 nodal points

    data has shape (ndata,ngp,nelems) result has shape (ndata,nnodel,nelems)

  `NodalAcc`(nodes, endata, nnod=0, nodata=None, nodn=None)

    Store element data in nodes and compute averages

    If matching nodal arrays nodata and nodn are specified, data are added to it. If not, nnod should be specified. By default, new nodata and nodn arrays are created and zeroed.

  `NodalAvg`(*args)

    Return the nodal average from the accumulated data.

  `AddBoundaryLoads`(f, model, idloads, dloads, nodes, matnr, coord, dofid, emat)

    Assemble distributed boundary loads into the load vector

    This procedures adds the distributed loads acting on the boundaries of the elements of this group to the global load vector f. The loads are specified by idloads and dloads, in the format as returned by fe_util.ReadBoundaryLoads() idloads contains : element number, side number, load case dloads contains : load components qx, qy Side number is the number of the first node of this side. We mod it with 4, to have an offset in the sidenode numbers array nodes,matnr is the node/mat numbers of the underlying element group coords contains the coordinates of the nodes dofid contains the numbering of the nodal dofs emat is the properties matrix of the underlying group

  `BoundaryInterpolationMatrix`(elnod, xyz, gpx, gpw, localnodes)

    Form interpolation matrix for QUAD/4-9 boundary

    The input gives a node set with either 2 or 3 nodes. The 3 node version may contain a zero to suppress the higher order node. xyz[nnod,2] contains the coordinates of the actually existing nodes! gpx, gpw are the (2D)-coordinates and weights of the GPs The procedure returns two matrices: hall[3,nnod,ng] holds the values at all gauss points, of the interpolation function and its natural derivatives corresponding with each node. w[ng] holds the 2D weight of the gauss points.

`Functions defined in module calpy_itf`

`calpy_itf.` `detect`(trypaths=None)

  Check if we have calpy and if so, add its path to sys.path.

`calpy_itf.` `check`(trypaths=None)

  Warn the user that calpy was not found.

### Navigation

- index
- modules |
- next |
- previous |
- pyFormex 0.9.1 documentation >
- pyFormex reference manual >