Static analyses (structsolve.analysis)#

class structsolve.Analysis(calc_fext=None, calc_fint=None, calc_kC=None, calc_kG=None)#

Class that embodies all data required for linear/non-linear analysis

The structural model is defined by the callables passed to the constructor, which return the force vectors and stiffness matrices. The static analysis, linear or non-linear, is run with static(), whose solution is stored in the attributes increments and cs.

For non-linear analyses, the internal force vector \(\{F_{int}(c)\}\) must be in equilibrium with the external force vector scaled by the load factor \(\lambda\):

\[\{R\} = \lambda \{F_{ext}\} - \{F_{int}(c)\} = \{0\}\]

and the tangent stiffness matrix \([K_T] = [K_C] + [K_G]\), given by the callables calc_kC and calc_kG, should be the exact derivative of \(\{F_{int}\}\) with respect to \(\{c\}\), such that the Newton-Raphson iterations converge quadratically.

The analysis parameters are attributes of this class, described in the following tables together with their default values:

Non-Linear Algorithm

Description

NL_method

str, 'NR' (default) for the Newton-Raphson method, see newton_raphson._solver_NR(), or 'arc_length_riks' and 'arc_length_crisfield' for the arc-length methods, see arc_length._solver_arc_length()

line_search

bool, activates a safeguarding line-search, for the Newton-Raphson method only. The full step is tried first and only reduced when it fails a sufficient-decrease test on the residual norm. Default is False

max_iter_line_search

int, maximum number of iterations of the line-search. Default is 20

modified_NR

bool, activates the modified Newton-Raphson method, where the tangent stiffness matrix is not updated at every iteration. Default is False, i.e. full Newton-Raphson

compute_every_n

int, if modified_NR=True, the tangent stiffness matrix is updated at every \(n\) iterations. Default is 6

kT_initial_state

bool, if modified_NR=True, tells if the tangent stiffness matrix should be calculated already at the first iteration of the analysis, which is required for example when initial imperfections take place. Otherwise the linear constitutive stiffness matrix is used. Default is True

Incrementation

Description

initialInc

initial load increment. In the arc-length methods it defines the initial arc-length increment, corresponding to a load factor increment of initialInc along the initial tangent. Default is 0.1

minInc

minimum increment; the analysis stops when the load increment (Newton-Raphson) or the arc-length increment (arc-length methods) becomes smaller than minInc. Default is 1.e-4

maxInc

maximum load increment, or maximum arc-length increment for the arc-length methods. Default is 1.

maxArcLength

maximum cumulative arc length covered by the arc-length methods. The arc length is dimensionless, with displacements scaled by the linear solution for a load factor of 1, such that in the linear regime an arc length of about sqrt(2) corresponds to a load factor increment of 1. Default is 18

Convergence Criteria

Description

relTOL

the convergence is achieved when the norm of the residual force vector is smaller than relTOL times the largest norm between the external and internal force vectors. Not used if None. Default is 1.e-6

absTOL

the convergence is also achieved when the maximum absolute residual force is smaller than this value, which depends on the units of the model. Not used if None. Default is None

maxNumIter

maximum number of iterations (corrections) of a step; if achieved the increment is reduced. Default is 30

too_slow_TOL

a step is considered too slow when the smallest residual norm is not reduced by this fraction over the last iterations; the increment is then reduced. Default is 0.005

Parameters:
calc_fextcallable, optional

calc_fext(inc=1., silent=False), must return a 1-D array with the external force vector. Required for linear and non-linear static analyses. The non-linear solvers call it with inc=1. and scale the returned vector by the load factor. It may declare the optional keyword arguments c and lbd, see the notes below.

calc_fintcallable, optional

calc_fint(c, silent=False), must return a 1-D array with the internal force vector for the solution vector c. Required for non-linear analyses.

calc_kCcallable, optional

calc_kC(c=None, NLgeom=False, silent=False), must return a sparse matrix with the constitutive stiffness matrix. With c=None and NLgeom=False it must return the linear stiffness matrix, and with NLgeom=True the constitutive part of the tangent stiffness matrix at c. Required for linear and non-linear static analyses.

calc_kGcallable, optional

calc_kG(c=None, NLgeom=False, silent=False), must return a sparse matrix with the geometric stiffness matrix at c. It is called with NLgeom=True. Required for non-linear analyses.

Attributes:
incrementslist

Load factors of the converged increments, filled by static().

cslist

Solution vectors of the converged increments, filled by static().

last_analysisstr

Type of the last analysis run, 'static' after static().

Notes

Configuration-dependent loads, e.g. follower pressures, are supported through optional keyword arguments, passed only to the callables that declare them explicitly, see callbacks:

  • calc_fint(c, inc=lbd), calc_kC(c, NLgeom=True, inc=lbd) and calc_kG(c, NLgeom=True, inc=lbd) receive the current load factor, such that calc_fint may contain the configuration-dependent part of the load, scaled by inc, and calc_kC + calc_kG its derivative.

  • calc_fext(inc=1., c=c) must return the load vector of the configuration c for a unit load factor, the derivative of the residual with respect to the load factor, used by the arc-length solvers.

  • calc_fext(inc=1., c=c, lbd=lbd) also receives the current load factor when it declares lbd, for a derivative \(\partial R/\partial \lambda\) that depends on the load factor, e.g. prescribed displacements imposed exactly as linear constraints, where the reference vector calc_fext(inc=1.) may be null. The solvers then use \(\partial R/\partial \lambda\) for the displacement scale of the arc-length methods, for the predictor of the first Newton-Raphson increment and as a reference of the relative convergence criterion, see callbacks. The linear static analysis never passes lbd.

The tangent stiffness matrix may then be unsymmetric, which the solvers support, since they use LU factorizations.

static(NLgeom=False, silent=False)#

General solver for static analyses

The linear analysis solves \([K_C]\{c\} = \{F_{ext}\}\) using solve(). When the load depends on the configuration, i.e. calc_fext declares the keyword argument c, see callbacks, the structure is still geometrically linear but the load is evaluated in the current configuration, \([K_C]\{c\} = \{F_{ext}(c)\}\), which is solved by the load correction iterations

\[\{c_{k+1}\} = \{c_k\} + [K_C]^{-1}(\{F_{ext}(c_k)\} - [K_C]\{c_k\})\]

starting from the solution of the reference load, until the relative criterion relTOL is satisfied, see newton_raphson._check_convergence(), or maxNumIter iterations are done. For a follower load whose force vector is affine in \(c\), \(\{F(c)\} = \{F_0\} - [K_f]\{c\}\), this is the solution of \(([K_C] + [K_f])\{c\} = \{F_0\}\), with the convergence rate of the spectral radius of \([K_C]^{-1}[K_f]\), i.e. of the ratio of the load to the lowest critical load of the linearized problem; beyond it the iterations diverge. The non-linear analysis uses the solver selected by the NL_method attribute.

Parameters:
NLgeombool, optional

Flag to indicate whether a linear or a non-linear analysis is to be performed.

silentbool, optional

A boolean to tell whether the log messages should be printed.

Returns:
incrementslist

Load factors of the converged increments. A linear analysis returns [1.]. Non-linear analyses finish at a load factor of exactly 1. unless they are stopped earlier, see the documentation of each solver.

cslist

Solution vectors of the converged increments.