Element classes

This class represents no particular element but rather defines common functionality for all elements.

Note

Every element in FEM.edu is derived from this class.

The Element class inherits methods from DrawElement, which provides default plotting functionality for common element types.

Note

Every element needs to declare its generic type through self.element_type in its constructor for the default plotting mechanism to work. The default constructor defines self.element_type = self.UNKNOWN, which means that this element will not be plotted.

See Inherited methods for more detail on the DrawElement class.

The Element base class
class femedu.elements.Element.Element(nodes, material, label=None)

abstract class: representing a single generic element

addTransformation(T, local_nodes=[])

Attach a transformation to any node of the element.

If no local_nodes list is given or an empty list is handed to the function, the transformation, T, will be applied to all nodes in the element.

A non-empty local_nodes list will apply the transformation to those local nodes listed in that list. Local nodes start at 0 and go to N-1, where N is the number of elements in this element.

A transformation can be removed from a node by assigning T=None as the transformation.

getDisp(node, **kwargs)

Use this function to get nodal displacements from inside your element implementation.

This is a wrapper around the Node.getDisp(caller)() method that adds the caller information for the node.

Parameters:

node – local node number for which displacements are requested.

getDofs()

returns the dof-codes for this element in a list

getForce()

Request the internal force vector (stress driven force only; no applied element loads)

Returns:

getLoad(apply_load_factor=False)

Requesting nodal forces generated by element loads, like

  • line loads on beams of frames

  • surface loads on plates or solids

  • body forces on solids.

Parameters:

apply_load_factor – shall the global load factor be applied by the element.

Returns:

element load vector

getPos(node, **kwargs)

Use this function to get nodal displacements from inside your element implementation.

This is a wrapper around the Node.getPos(caller)() method that adds the caller information for the node.

Parameters:

node – local node number for which displacements are requested.

getStiffness()
Returns:

initialize(type=0, dofs=[])
Parameters:
  • type – define DrawElement.TYPE for plotting. See femedu.elements.DrawElement() under Inherited methods for available options.

  • dofs – list of dofs used by this element. Example: [“ux”,”uy”] for 2d-displacements.

on_converged()

This method is called by the solver if convergence has been achieved.

The element shall perform all necessary state updates, especially inform it’s material instances about the necessary updates.

recordThisStep(load_level)

record current state of the system

resetLoads()

default implementation for resetting element loads.

reset_matrices()

(re-)initializes element stiffness matrix and element force

revert()

This method is called by the solver if the current load step failed to converge and the system shall be returned to the last converged state.

The element shall perform all necessary state updates, especially inform it’s material instances about the necessary updates.

setLoadFactor(lam)

Set the target load factor to lam

Warning

This method should not be called by the user. USE System.setLoadFactor(lam) instead!

The entered load pattern is considered a reference load, to be multiplied by a scalar load factor, \(\lambda\).

If no load factor is set explicitly, a factor of 1.0 is assumed, i.e., the entire entered load is applied in full.

setSurfaceLoad(face_idx, pn, ps=0)

Warning

This method needs to be implemented by every element that shall accept a surface load.

Parameters:
  • face_ix – face index for the laoded face (integer starting at 0)

  • pn – magnitude of distributed normal load per unit length. Tension on a surface is positive.

  • ps – magnitude of distributed shear load per unit length. Positive shear rotates the element counter-clockwise.

updateState()
Inherited methods
class femedu.elements.DrawElement.DrawElement

class for drawing any element

element types are:

UNKNOWN

LINE

truss, simple frame

CURVE

beam, nice frame

TRIANGLE

plates, shells

TETRAHEDRON

plates, shells

QUAD

plates, shells

BRICK

continuum

draw(factor=0.0, modeshape=False, **kwargs)

Returns a series of coordinate vectors representing the _x_, _y_, and _z_ values of points for plotting the deformed shape the current element (self). For the undeformed element, set factor=0.0.

Parameters:

factor – magnification factor for deformation

Returns:

a tuple (list) of coordinate vectors

drawBrick(factor, **kwargs)

implementation of a generic BRICK type

drawCurve(factor, **kwargs)

implementation of a generic CURVE type

drawLine(factor, **kwargs)

implementation of a generic LINE type

drawQuad(factor, **kwargs)

implementation of a generic QUAD type

drawTetrahedron(factor, **kwargs)

implementation of a generic TETRAHEDRON type

drawTriangle(factor, **kwargs)

implementation of a generic TRIANGLE type

Derived Classes
Helper Classes