ElementPlotter class

Parent class

Class doc

class femedu.plotter.ElementPlotter.ElementPlotter

A plotter class that takes a list of nodes and elements from a finite element model and plots a deformed mesh, potentially shaded based on a value of a user-specified state variable.

The information needed for plotting is obtained through standardized element functions. Default versions of those functions are implemented through the Element-class, but respective methods may be overloaded by user-implemented elements.

addForces(axs, loads=False, reactions=False, factor=0.0, dofs=('ux', 'uy', 'rz'))

add nodal forces to the plot shown in axs

Parameters:
  • axs – axis on which to plot

  • loads – set to True for loads added to the plot

  • reactions – set to True for reactions added to the plot

  • factor – deformation factor. default: 0.0

  • dofs – dof mapping. default are 2D forces and in-plane moment

beamValuePlot(variable_name='', factor=0.0, filename=None, show_arrows=False, **kwargs)

Create a deformed system plot

If file is given, store the plot to that file. Use proper file extensions to indicate the desired format (.png, .pdf)

Parameters:
  • variable_name – string code for variable

  • factor – displacement scaling factor

  • file – filename (str)

displacementPlot(factor=1.0, filename=None, modeshape=False, **kwargs)

Create a deformed system plot

If file is given, store the plot to that file. Use proper file extensions to indicate the desired format (.png, .pdf)

Parameters:
  • factor – displacement scaling factor

  • file – filename (str)

  • **kwargs – see list of optional parameters below.

Keywords:

optional parameters

show_bc

set to True to mark fixed DOFs

show_loads

set to True to plot loads

show_reactions

set to True to plot nodal reactions

principal

set to True to add principal stress orientation. Sets factor=0

pval

set to stress or strain to select tensor for principal value plot. (defaults to stress)

valuePlot(variable_name='', factor=0.0, filename=None, **kwargs)

Create a plot using colors to identify magnitude of internal force.

If file is given, store the plot to that file. Use proper file extensions to indicate the desired format (.png, .pdf)

Parameters:
  • factor – True | False

  • filename – (str)

xyPlot(X, Y, filename=None, show_arrows=False, **kwargs)

Create a x-y-plot

If filename is given, store the plot to that file. Use proper file extensions to indicate the desired format (.png, .pdf)

Parameters:
  • XRecord holding x-values

  • Ylist or tuple of Record holding y-values

  • filename (str) –

  • title (str) – figure title (optional)

  • xlabel (str) – x-axis label (optional)

  • ylabel (str) – y-axis label (optional)