fedoo.problem.Linear
- class Linear(assembly: Assembly, time_step: float | None = None, integrator: GeneralizedAlpha | None = None, name: str = 'MainProblem')
Class that defines linear problems.
This simple class allows a linear problem to be built from an assembly object. The discretized problem is written as
A * X = B + D, whereAis the matrix built by the assembly,Xis the solution vector,Bcontains the Neumann boundary conditions, andDis the vector built by the assembly.- Parameters:
assembly (Assembly-like object or str) – Assembly used to construct the matrix
Aand vectorD, or the name of a registered assembly.time_step (float, optional) – Constant time increment used when a second-order
integratoris attached. Omit it for the original static behavior.integrator (fedoo.time.Newmark or fedoo.time.GeneralizedAlpha, optional) – Implicit second-order time integrator. The stiffness and consistent mass matrices are assembled once by
initialize()and reused at every constant-size increment. Only the right-hand side is rebuilt.name (str, default="MainProblem") – Name of the problem.
- __init__(assembly: Assembly, time_step: float | None = None, integrator: GeneralizedAlpha | None = None, name: str = 'MainProblem')
Methods
returns : sum (0.5 * U.transposed * K * U)
returns : 0.5 * K * U .
Linear.add_global_dof(variable_names[, ...])Add global degrees of freedom to the problem.
Linear.add_output(filename, assembly[, ...])Register an output for automatic saving managed by solve methods.
Linear.apply_boundary_conditions([t_fact, ...])Linear.change_assembly(assembling[, update])Modify the assembly associated to the problem and update the problem (see Assembly.update for more information)
Look for boundary conditions applied twice on the same dof.
Stop automatic output by removing all registered requests.
Linear.get_acceleration([name])Return the current transient acceleration.
Return the active Problem.
Return the list of all problems.
Linear.get_disp([name])Return the displacement components.
Linear.get_dof_solution([name])returns : sum (0.5 * U.transposed * K * U)
Linear.get_ext_forces([name, include_mpc])Return the nodal Forces in global coordinates system.
Return
0.5 * velocity.T * M * velocity.returns : 0.5 * K * U .
Linear.get_results(*args, **kargs)Extract some results from the current problem.
Linear.get_rot([name])Return the rotation components.
Linear.get_velocity([name])Return the current transient velocity.
Initialize and cache the optional linear transient operators.
Invalidate any cached factorization.
Define the problem instance as the active Problem.
Linear.save_results([iterOutput])Write the current state to every registered output.
Linear.set_A(A)Linear.set_B(B)Linear.set_D(D)Linear.set_X(value)Linear.set_active(name)Define the active Problem from its name.
Linear.set_dof(name, value)Set a static solution field or the current dynamic displacement.
Linear.set_initial_acceleration(name, value)Set a transient initial acceleration component.
Linear.set_initial_displacement(name, value)Set a transient initial displacement component.
Linear.set_initial_velocity(name, value)Set a transient initial velocity component.
Linear.set_reuse_factorization([reuse])Enable or disable factorization reuse for repeated solves.
Linear.set_solver([solver, symmetric])Define the solver for the linear system resolution.
Linear.set_time_integrator(evolution, integrator)Attach a linear implicit second-order time integrator.
Linear.solve(**kargs)Solve the linear problem and optionally update assembly fields.
Linear.solve_history(tmax[, dt, ...])Solve a complete cached linear transient history.
Linear.solve_time_increment([...])Solve and advance one complete linear transient increment.
Linear.update([dtime, compute, update_weakform])Assemble the matrix including the following modification:
Whether this linear problem has a time integrator attached.
Return the name of the Problem.
Return the current solver used for the problem.
Return the ModelingSpace associated to the Problem if defined.
Return the attached second-order integrator, or
None.Boundary conditions defined on the problem.