System class

class femedu.domain.System.System

class: representing a System model

addConstraint(*newConstraints)
Parameters:

newConstraints – one or more Constraint or a subclass objects

addElement(*newElements)
Parameters:

newElement – an Element object

addNode(*nodes)

Add one or more nodes to the model.

Parameters:

newNode – a Node object

beamValuePlot(variable, factor=0.0, filename=None, **kwargs)

Create a traditional beam value plot, i.e., moment and shear diagrams.

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

Parameters:
  • variable – string code for variable

  • deformed – True | False

  • filename (str) –

checkStability(**kwdargs)

Computes the stability index as

  • \(\mathop{det}([{\bf K}_t])\) for systems with less than 25 d.o.f.s

  • \(\min\lambda_i\) where \(\lambda_i\) are the eigenvalues of \({\bf K}_t\)

Implemented by Solver.

Parameters:
  • verbose – set to True for log info

  • num_eigen – if set to a value greater than 0, show the num_eigen eigenvalues closest to the current load level.

Returns:

stability index

fetchRecord(keys=[])

Request recorded time history data for the listed keys. If a single key is given as a string, a single np.array() is returned. If a list of keys is given, a list of np.array() is returned.

Returns:

time history data for the listed keys.

getSolver()

Provides a pointer to the current solver instance.

This function is used to get access to the solver and give instructions directly to that solver.

historyPlot(varX='', varY='', filename=None, **kwargs)

Create a generic X-Y plot using recorder data for load-level (horizontal) and varY (vertical).

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

Parameters:
  • varX

    X-axis parameter; This must be a variable code previously set by initRecorder().

    If varX is a str, it is assumed to be a global parameter/variable, e.g., load factor lam, or pseudo time time (time not yet supported)

    If varX is a tuple containing a variable code and a Node pointer, the respective nodal DOF defined by the parameter will be used.

    If varX is a tuple containing a variable code and a Element pointer, the respective element DOF defined by the parameter will be used. The parameter must identify a scalar parameter. Hence, you may use 'sig:xx' but not 'stress'.

  • varY – a variable code previously set by initRecorder()

  • filename (str) –

  • node – (optional)

  • nodes – (optional)

initArcLength(load_increment=1.0, alpha=0.0, tolerance=1e-12)

Initializes parameters for the arc-length constraint.

\[g({\bf u}, \lambda)) := \alpha ||\bar {\bf P}|| (\lambda-\lambda_n)^2 + ({\bf u} - {\bf u}_n)({\bf u} - {\bf u}_n) - \Delta s^2 = 0\]

Note

This feature requires a nonlinear solver. Review the setSolver() function.

Parameters:
  • load_increment – load increment used to calibrate the constraint

  • alpha – load contribution factor

  • tolerance – convergence tolerance

initRecorder(**kwargs)

initializes data arrays for gathering of load history data

Parameters:
  • variables (list-type) – list of variables or d.o.f.-codes to be recorded

  • nodes (list of Node) – nodes for which to record

  • elements (list of Element) – elements for which to record

# examples:

# system recorder tracking the stability index
initRecorder(variables=['stability',])

# tracking 'ux' at nodes X1 and X7
initRecorder(variables=['ux',], nodes=[X1, X7])

# tracking all components of stress at Elem2 and Elem42
initRecorder(variables=['stress',], elements=[Elem2, Elem42, ...])
pauseRecorder()

pauses the recorder. You can restart the recorder by calling startRecorder().

plot(factor=1.0, show_reactions=True, show_loads=True, force_limit=1e-06, **kwargs)

Create mesh plot showing the undeformed and the deformed system

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

Parameters:
  • factor – deformation magnification factor

  • show_reactions – plot reaction forces if this evaluates to True

  • show_loads – plot nodal load vectors if this evaluates to True

  • force_limit – don’t plot forces smaller than this value

  • filename – filename (str)

plotBucklingMode(factor=1.0, mode=0, filename=None, **kwargs)

Warning

This method has been marked DEPRECATED !

Use the System.plot() method with appropriate **kwargs instead.

Select a mode shape by setting mode to an integer, where 0 stands for the mode with the smallest absolute eigenvalue, 1 the second smallest, and so forth. If the resulting eigenvalue (shown in the plot) is negative, the load-level associated with that mode is below the current load level.

If a filename is given, e.g., filename=”buckling_mode.png”, the plot will be saved to the respective file. The file type will be determined from the given extensions, e.g., .png for a PNG format.

Parameters:
  • factor – Scale the mode shape by this factor.

  • mode – which mode shape shall be plotted?

  • filename – string

  • kwargs – not specified here. These are handed over to the Solver(...) instance.

plotDOF(dofs=[])

Warning

This method has been marked DEPRECATED !

Use the System.plot() method with appropriate **kwargs instead.

plotSystem(factor=1.0)

Warning

This method has been marked DEPRECATED !

Use the System.plot() method with appropriate **kwargs instead.

popU()

Restore a previously pushed displacement vector (using pushU()).

pushU()

Store the current displacement vector for later restore using popU().

recordThisStep()

record current state of the system

report()

print a text-based summary report

resetAll()

Resets load and displacement vectors.

resetDisp()

Resets the displacement vector.

resetLoad()

Resets the load vector.

setDisplacementControl(node, dof, target)

activate displacement control for the next load step

Parameters:
  • node – pointer to the controlling node

  • dof – dof code for controlled dof

  • target – target displacement value

setLoadFactor(lam)

Set the target load factor to lam

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.

setSolver(solver)

This method will change the current solver to the provided solver.

Upon successful update of the solver, the old solver state will be pushed to the new solver.

Parameters:

solver – a pointer to a solver object.

solve(**kwargs)

Solve system of equations and find state of deformation for the given load level.

startRecorder()

starts the recorder

stepArcLength(verbose=False, max_iter=10)

Progresses the model state by one arc-length.

Note

You need to initialize arc-length control by one call to initArcLength() at least once to set all necessary parameters.

Return normR:

the norm of the generalized residuum from the last iteration step

stopRecorder()

stops the recorder

valuePlot(variable, factor=0.0, filename=None, **kwargs)

Create a false color contour plot for the selected variable. A value of zero (0.0) will be assigned for any variable not provided by an element or a node.

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

Parameters:
  • variable – string code for variable to show

  • factor – deformation magnification factor (default is undeformed)

  • filename (str) –