pymoto.SystemOfEquations
- class pymoto.SystemOfEquations(free=None, prescribed=None, **kwargs)
Solve a partitioned linear system of equations
The partitioned system of equations
\(\begin{bmatrix} \mathbf{A}_\text{ff} & \mathbf{A}_\text{fp} \\ \mathbf{A}_\text{pf} & \mathbf{A}_\text{pp} \end{bmatrix} \begin{bmatrix} \mathbf{x}_\text{f} \\ \mathbf{x}_\text{p} \end{bmatrix} = \begin{bmatrix} \mathbf{b}_\text{f} \\ \mathbf{b}_\text{p} \end{bmatrix} ,\)
which is solved in two steps. First solving for the free unknowns (e.g. displacements or temperatures) \(\mathbf{x}_f\) and then calculating the rhs for the prescribed unknowns (e.g. reaction forces or heat flux):
\(\begin{aligned} \mathbf{A}_\text{ff} \mathbf{x}_\text{f} &= \mathbf{b}_\text{f} - \mathbf{A}_\text{fp} \mathbf{x}_\text{p} \\ \mathbf{b}_\text{p} &= \mathbf{A}_\text{pf}\mathbf{x}_\text{f} + \mathbf{A}_\text{pp} \mathbf{x}_\text{p}. \end{aligned}\)
References
Koppen, S., Langelaar, M., & van Keulen, F. (2022). Efficient multi-partition topology optimization. Computer Methods in Applied Mechanics and Engineering, 393, 114829. DOI: https://doi.org/10.1016/j.cma.2022.114829
- Input Signals:
A(dense or sparse matrix): The system matrix \(\mathbf{A}\) of size(n, n)b_f(vector): applied load vector of size(f)or block-vector of size(f, Nrhs)x_p(vector): prescribed state vector of size(p)or block-vector of size(p, Nrhs)
- Output Signal:
x(vector): state vector of size(n)or block-vector of size(n, Nrhs)b(vector): load vector of size(n)or block-vector of size(n, Nrhs)
- __init__(free=None, prescribed=None, **kwargs)
Initialize the system of equations module
The free indices, prescribed indices, or both must be provided.
- Parameters:
free (optional) – The indices corresponding to the free degrees of freedom at which \(f_ ext{f}\) is given
prescribed (optional) – The indices corresponding to the prescibed degrees of freedom at which \(x_ ext{p}\) is given
**kwargs – Arguments passed to initialization of
pymoto.LinSolve
Methods
__init__([free, prescribed])Initialize the system of equations module
connect(sig_in[, sig_out])Connect without automatic adding to a function network
get_input_sensitivities([as_list])get_input_states([as_list])get_output_sensitivities([as_list])get_output_states([as_list])reset()Reset the state of the sensitivities (they are set to zero or to None)
response()Calculate the response from sig_in and output this to sig_out
Calculate sensitivities using backpropagation
Attributes
Get the number of input signals
Get the number of output signals
- connect(sig_in: Signal | Iterable[Signal], sig_out: Signal | Iterable[Signal] = None)
Connect without automatic adding to a function network
- get_input_sensitivities(as_list=False)
- get_input_states(as_list=False)
- get_output_sensitivities(as_list=False)
- get_output_states(as_list=False)
- property n_in: int
Get the number of input signals
- property n_out: int
Get the number of output signals
Note: Cannot be used in the initial __call__()
- reset()
Reset the state of the sensitivities (they are set to zero or to None)
- response()
Calculate the response from sig_in and output this to sig_out
- sensitivity()
Calculate sensitivities using backpropagation
Based on the sensitivity we get from sig_out, reverse the process and output the new sensitivities to sig_in
- sig_in: List = None
- sig_out: List = None