Configuration-dependent loads (structsolve.callbacks)#
Calls to the callables of Analysis used by the non-linear solvers
The callables may depend on the load factor and on the configuration
through their optional keyword arguments, which are passed only when the
callable declares them explicitly in its signature (a **kwargs does not
count), such that the callables written for the previous versions are called
exactly as before:
inc: the current load factor, passed tocalc_fint,calc_kCandcalc_kG. It allows configuration-dependent loads, e.g. follower pressures, whose configuration-dependent part enterscalc_fintand whose load stiffness enterscalc_kCorcalc_kG, both scaled by the load factor.c: the current configuration, passed tocalc_fext, which must then return the load vector of that configuration for a unit load factor. The arc-length solvers use it in the predictor and in the constraint instead of the constant reference vectorcalc_fext(inc=1.).lbd: the current load factor, passed tocalc_fexttogether withc, for a load vector that depends on the load factor as well, e.g. prescribed displacements imposed exactly as linear constraints. The keywordinckeeps its meaning, the factor that multiplies the returned vector, and the solvers keep callingcalc_fext(inc=1., ...). Whencalc_fextdeclareslbd:the arc-length solvers pass
lbdwithcin the predictor and in the constraint;the arc-length solvers scale the displacements with the linear solution of the load vector at
c = 0,lbd = 0, instead of the linear solution of the reference vectorcalc_fext(inc=1.), and the Newton-Raphson solver uses this linear solution as the predictor of its first step;the convergence criterion also considers the norm of the load factor times the load vector, see
newton_raphson._check_convergence();calc_fext(c=c, lbd=lbd)is called at the configurations where the tangent stiffness matrix is updated, right aftercalc_kCandcalc_kGat the samecand load factor, such that the callables may share their computations, and the last load vector evaluated is the reference of the convergence checks until the next update.
lbdis never passed by the linear static analysis,Analysis.static(NLgeom=False).
Notes#
With inc, the residual remains
with calc_kC + calc_kG its exact Jacobian \(\partial \boldsymbol{R}/\partial \boldsymbol{c}\).
With c, calc_fext(inc=1., c=c) is \(-\partial \boldsymbol{R}/\partial \lambda\) at
\(c\).
With lbd, prescribed displacements imposed exactly as linear
constraints \(\boldsymbol{c} = \boldsymbol{Z} \boldsymbol{c}_r + \boldsymbol{c}_{p0} + \lambda \boldsymbol{c}_{p1}\) give the
reduced residual
which has \(-\partial \boldsymbol{R}_r/\partial \lambda = \boldsymbol{Z}^\top(\boldsymbol{F}_{ext} - \boldsymbol{K}_T
\boldsymbol{c}_{p1})\), with \(\boldsymbol{K}_T\) evaluated at the current configuration and
load factor, the vector that calc_fext(inc=1., c=c, lbd=lbd) must
return. The convergence criterion also considers the norm of
\(-\lambda \, \partial \boldsymbol{R}/\partial \lambda\), since under a prescribed
displacement alone the reference vector and the reduced internal force
vector both vanish at equilibrium, and the displacements of the arc-length
solvers are scaled with the linear solution of \(-\partial \boldsymbol{R}/\partial
\lambda\) at \(c = 0, \lambda = 0\), since the reference vector
calc_fext(inc=1.) may then be null.
- structsolve.callbacks.accepts_kwarg(func, name)#
Tell whether
funcdeclares the keyword argumentnameThe argument is declared when it is a named parameter of the signature, positional-or-keyword or keyword-only; a
**kwargsdoes not count. A callable whose signature cannot be read byinspect.signature()does not declare it.- Parameters:
- funccallable
Function or method to inspect.
- namestr
Name of the keyword argument.
- Returns:
- acceptsbool
Truewhenfunchas a parameternamethat can be passed by keyword.
See also
calc_fint,calc_kT,calc_load_vectorcalls that depend on it.
- structsolve.callbacks.calc_fint(an, c, lbd)#
an.calc_fintatc, withinc=lbdwhen acceptedCalls
an.calc_fint(c=c, silent=True), addinginc=lbdonly whenan.calc_fintdeclaresinc, seeaccepts_kwarg().- Parameters:
- an
Analysis Analysis object providing
calc_fint.- carray-like
Configuration, the vector of the degrees of freedom.
- lbdfloat
Current load factor, dimensionless, passed as
inc.
- an
- Returns:
- fintarray-like
The internal force vector returned by
an.calc_fint.
- structsolve.callbacks.calc_kT(an, c, lbd)#
Tangent stiffness matrix
calc_kC + calc_kGatc, withinc=lbdpassed to the callables that accept itCalls
an.calc_kC(c=c, NLgeom=True, silent=True)andan.calc_kG(c=c, NLgeom=True, silent=True), each withinc=lbdonly when it declaresinc, seeaccepts_kwarg(), and returns their sum.- Parameters:
- an
Analysis Analysis object providing
calc_kCandcalc_kG.- carray-like
Configuration, the vector of the degrees of freedom.
- lbdfloat
Current load factor, dimensionless, passed as
inc.
- an
- Returns:
- kTsparse matrix or ndarray
The sum of the matrices returned by
an.calc_kCandan.calc_kG, of the type given by them.
- structsolve.callbacks.calc_load_vector(an, c, fext, lbd=None)#
Load vector, minus the derivative of the residual with respect to the load factor
Returns the load vector
qgiven byan.calc_fextfor a unit load factor at the configurationcand the load factorlbd, used by the solvers in the predictors, in the arc-length constraint and in the convergence criterion. With prescribed displacements,qis not their reaction force: it has the size of the reduced problem and acts on the free degrees of freedom.structsolvedoes not compute the reaction; see for instanceMultiDomain.reaction_pdof \(panels\).an.calc_fextis called withinc=1.and only with the keyword arguments that it declares:c=c, when it declaresc;lbd=lbd, when it declareslbdandlbdis notNone.
When none of them is passed, \(\boldsymbol{q}\) is the constant reference vector, and
fextis returned without callingan.calc_fext.- Parameters:
- an
Analysis Analysis object.
- carray-like
Configuration.
- fextarray-like
Reference vector
an.calc_fext(inc=1.).- lbdfloat or None, optional
Load factor.
- an
- Returns:
- qarray-like
\(-\partial \boldsymbol{R}/\partial \lambda\).
Notes
\(\boldsymbol{q} = -\partial \boldsymbol{R}/\partial \lambda\) is the external load vector only for loads that do not depend on the configuration; with prescribed displacements imposed exactly it also contains \(-\boldsymbol{Z}^\top \boldsymbol{K}_T \boldsymbol{c}_{p1}\), see the module docstring.
With prescribed displacements, \(\boldsymbol{q}\) is the out-of-balance force produced by a unit increment of the load factor at the current configuration, with the free degrees of freedom held fixed. The reaction is a quantity of the full problem, e.g. the generalized reaction work-conjugate to \(\lambda\), \(P = \boldsymbol{c}_{p1}^\top (\boldsymbol{F}_{int}(\boldsymbol{c}) - \lambda \boldsymbol{F}_{ext})\).
- structsolve.callbacks.is_load_configuration_dependent(an)#
Tell whether
an.calc_fextaccepts the configurationcWhen it does, the solvers evaluate the load vector at the current configuration, see
calc_load_vector(), and the linear static analysis iterates on the load, seeAnalysis.static().- Parameters:
- an
Analysis Analysis object providing
calc_fext.
- an
- Returns:
- dependentbool
Truewhenan.calc_fextdeclares the keyword argumentc, seeaccepts_kwarg().
- structsolve.callbacks.is_load_factor_dependent(an)#
Tell whether
an.calc_fextaccepts the load factorlbdWhen it does, the solvers pass the current load factor to
calc_fexttogether withc, seecalc_load_vector()and the module docstring.- Parameters:
- an
Analysis Analysis object providing
calc_fext.
- an
- Returns:
- dependentbool
Truewhenan.calc_fextdeclares the keyword argumentlbd, seeaccepts_kwarg().