BasicTools.Linalg.ConstraintsHolder module
- class BasicTools.Linalg.ConstraintsHolder.Ainsworth[source]
Bases:
BaseOutputObjectMethod from https://doi.org/10.1016/S0045-7825(01)00236-5 Because the CleanConstraint(C) matrix is orthonormal then C.dot(C.T) = I this make the P Q R expression simpler
- class BasicTools.Linalg.ConstraintsHolder.ConstraintsHolder(nbdof=0)[source]
Bases:
BaseOutputObjectConstrained linear problem: Class to store and to enforce constraints for a quadratic system of the form:
minimize 1/2 u.K.u - u.f subject to: A.u = b
This class can store, and manipulate the system Au=b and enforced the constraint on Ku=f by different methods (penalisation, subtitution, lagrange multiplier)
the first set of function is used to fill this class with the system Au=b:
NextEquation must be called after the call of a set of : AddFactor, AddConstant One per constraint
AddEquationSparse, AddEquation, AddEquationsFromIJV to add a full constraint at once
Compact will clean (zeros,and duplicate) entries
- CleanEmptyColumns(mat)[source]
Function to clean empty columns for a matrix,
- this function returns:
res : a sparse matrix with only non zero columns of mat (the last column is always present, event if it is full of zeros) usedDofs : the indices of the columns prensent in res
- GetCleanConstraintBase(purePython=False)[source]
This function compute the QR decompostion of the augmentd system [A|b] Il will use the self.tol value to detect redundants constrants (rank revealing)
- this functions returns:
res : a parse matrix q’ with only the relevant part of the QR decomposition. Q’ containt only the non zero columns of [A|b] and always the last column (the b) usedDofs : the indices of the columns present in Q
- option:
purePython: to force scipy for computing the QR decomposition
- ToSparse()[source]
Function to convert to the constraints system Ax=B to a sparse matrix
- this function returns:
res : a sparse matrix of [A’|B] , A’ has only the non zero columns of A usedDofs : the indices of the columns present in A’
- BasicTools.Linalg.ConstraintsHolder.ExpandMatrix(op, mattoglobal, nbdofs, treatrows=True, treatcols=True)[source]
- class BasicTools.Linalg.ConstraintsHolder.Lagrange[source]
Bases:
BaseOutputObject
- class BasicTools.Linalg.ConstraintsHolder.Penalisation[source]
Bases:
BaseOutputObject
- class BasicTools.Linalg.ConstraintsHolder.Projection[source]
Bases:
BaseOutputObject