topoptlab.fem_solvers.heat_conduction module
- class topoptlab.fem_solvers.heat_conduction.HeatConduction(nelx: int, nely: int, bc: Callable, nelz: int | None = None, kmax: float = 1.0, kmin: float = 1e-09, penal: float = 3.0, l: float | ndarray = 1.0, lin_solver: str = 'cvxopt-cholmod', preconditioner: str | None = None, assembly_mode: str = 'lower', **kwargs: Any)[source]
Bases:
FEM_PhysStationary heat conduction solver.
Solves the Poisson problem
- -div( k(x) grad T ) = f in Omega
T = 0 on Gamma_D
- Parameters:
nelx (int) – number of elements in x direction.
nely (int) – number of elements in y direction.
nelz (int or None) – number of elements in z direction. 2D problem if None.
bc (callable) – function that returns (T, f, fixed, free, springs) given (nelx, nely, nelz, ndof).
l (float or np.ndarray) – element side length(s).
lin_solver (str) – linear solver identifier passed to solve_lin.
preconditioner (str or None) – preconditioner identifier passed to solve_lin.
assembly_mode (str) – “full” or “lower” triangular assembly.
- assemble_system(Kes: ndarray, **kwargs: Any) csc_array[source]
Assemble the global conductivity matrix K for densities xPhys.
- Parameters:
Kes (np.ndarray) – element stiffness matrices shape (nel,m,m).
- Returns:
K – assembled global conductivity matrix.
- Return type:
scipy.sparse.csc_array, shape (ndof, ndof)