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
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:
Add elements to group and store interpolation matrices
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 all elements of this group
Compute stress at GP for all elements of this group
Extrapolate a set of data at GP to 9 nodal points
data has shape (ndata,ngp,nelems) result has shape (ndata,nnodel,nelems)
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.
Return the nodal average from the accumulated data.
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
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
Check if we have calpy and if so, add its path to sys.path.
Warn the user that calpy was not found.