morphogen.homogenization.kernels¶
Compiled kernels of the trilinear voxel elements of the FFT solver.
The grid has (nx, ny, nz) voxels (elements), numbered e = (i * ny + j) * nz + k.
Nodes are numbered the same way on the (nx + 1, ny + 1, nz + 1) node grid, or on
the (nx, ny, nz) grid when the mesh is periodic (opposite faces identified).
dof[node * nd + c] is the index of a degree of freedom, or -1 for an unused one.
Right-hand sides loop over nodes (each thread writes only the rows of its nodes, so no atomics are needed); element sums loop over chunks of elements.
The kernels of the loading paths (morphogen.homogenization.fft_nonlinear) work on
the 8 Gauss points of the voxels that carry material: point 8 t + g is Gauss point
g of voxel elem[t], and slot[e] is the position t of voxel e (-1 for a
void). Their measures of strain are the engineering strains (6, Voigt order) or, in
finite strains, the displacement gradients (9, row by row).
- morphogen.homogenization.kernels.element_load(nx, ny, nz, periodic, mat, dof, nd, loads, n_free)[source]¶
Right-hand side -sum_e loads[mat_e] restricted to the free dofs (
loads[m]: the element load vector of materialm;mat-1: no stiffness).
- morphogen.homogenization.kernels.elastic_sums(nx, ny, nz, periodic, mat, stat, n_stat, dmat, eig, dt, w, u_loc, b_gauss, wt)[source]¶
Integrals over each phase (
stat) of strains, stresses, energy and squares.wholds the nodal fluctuation (3 per node),u_locthe affine part at the corners of an element (identical for all elements),dmat[mat_e]the elasticity matrix of elemente(-1: void) andeig[mat_e]its thermal strain for a unit change of temperature (dt: the change). Strains are tensor components, stressesD (eps - dt eig).
- morphogen.homogenization.kernels.thermal_sums(nx, ny, nz, periodic, mat, stat, n_stat, kmat, t, t_loc, g_gauss, wt)[source]¶
Integrals over each phase of gradients, fluxes, dissipation and squares (
kmat[mat_e]: conductivity tensor of elemente).
- morphogen.homogenization.kernels.elastic_fields(nx, ny, nz, periodic, mat, dmat, eig, dt, w, u_loc, b_mean, b_gauss)[source]¶
Element means of the strain (tensor components), stress and energy density
sigma : (eps - dt eig)(NaN where inactive).
- morphogen.homogenization.kernels.thermal_fields(nx, ny, nz, periodic, mat, kmat, t, t_loc, g_mean, g_gauss)[source]¶
Element means of the temperature gradient, flux and dissipation
grad T . K grad T(NaN where inactive).
- morphogen.homogenization.kernels.voxel_measures(nx, ny, nz, elem, w, macro, g_gauss, finite, bbar, out, base)[source]¶
Measures of strain at the Gauss points of the voxels
elemof the periodic grid (intoout, points x 6 or 9): the gradient of the nodal fluctuationw(3 per node) plus the macroscopic gradientmacro(9, row by row; symmetric in small strains). Withbbar, the measures of B-bar or F-bar (see above), and in finite strains the gradients themselves intobase. A voxel turned inside out gets NaN measures (its behaviours then fail).
- morphogen.homogenization.kernels.voxel_effective(n_el, finite, s, base)[source]¶
The stresses of the points of
n_elvoxels replaced, in place, by those conjugate to the measures of B-bar or F-bar (see above):sholds the stresses of the behaviours (points x 6, or x 9 first Piola-Kirchhoff stresses),basethe gradients of the points in finite strains.
- morphogen.homogenization.kernels.voxel_tangent_stress(nx, ny, nz, elem, v, direction, tangent, s, base, g_gauss, finite, bbar, out)[source]¶
Increments of the stresses of the points (of their conjugates with
bbar) for the nodal displacementsv(3 per node) plus the uniform gradientdirection(9, row by row; symmetric in small strains), with the tangentstangentof the points (points x n x n), intoout(points x n). In finite strains withbbar,sholds the first Piola-Kirchhoff stresses of the behaviours andbasethe gradients of the points (the derivatives of the F-bar measures depend on them).
- morphogen.homogenization.kernels.voxel_forces(nx, ny, nz, slot, s, weight, g_gauss, finite, out)[source]¶
Nodal forces of the stresses
sat the Gauss points (int B^T s; in finite strainsint P . grad Nof the first Piola-Kirchhoff stresses), intoout(3 per node of the periodic grid;weight: the weight of a Gauss point). Loops over nodes, so no atomics are needed. Returns the norm of the contributions of the points before they cancel.
- morphogen.homogenization.kernels.voxel_centres(nx, ny, nz, w, out)[source]¶
Mean of the nodal fluctuation
w(3 per node) over the corners of every voxel: its value at the centre (voxels x 3).
- morphogen.homogenization.kernels.fourier_inverse(nx, ny, nz, blocks, out)[source]¶
Inverse of the symbol of a homogeneous operator at the frequencies of the real FFT of the periodic grid, into
out(nx x ny x (nz // 2 + 1) x nd x nd, complex): the stencilblocks(3 x 3 x 3 x nd x nd, node offsets -1, 0, 1) summed with its phases, then inverted (nd = 1 or 3, by cofactors); zero at the zero frequency (the fluctuation has a zero mean).