weac.analysis.analyzer module¶
This module provides the Analyzer class, which is used to analyze the results of the WEAC model.
- weac.analysis.analyzer.track_analyzer_call(func)[source]¶
Decorator to track call count and execution time of Analyzer methods.
- weac.analysis.analyzer.local_segment_grid(length, n_budget, *, include_right_endpoint, boundary_window=None, boundary_dx=None)[source]¶
Build monotonic local sample coordinates on a segment
[0, length].- Uniform mode (
boundary_window is None) np.linspacewithn_budgetpoints (same as historical rasterize).- Boundary-refined mode
Piecewise fine windows of half-width
boundary_windowand spacingboundary_dxat both segment ends (domain ends and joints), with any remainingn_budgetspent on a coarse interior. Fine resolution is preserved even if that makes the point count exceedn_budget.
The right endpoint
lengthis included only wheninclude_right_endpointis True (last segment). Other segments omit it so the joint is owned by the next segment’s localx = 0.- Parameters:
length (float)
n_budget (int)
include_right_endpoint (bool)
boundary_window (float | None)
boundary_dx (float | None)
- Return type:
ndarray
- Uniform mode (
- class weac.analysis.analyzer.Analyzer(system_model, printing_enabled=True)[source]¶
Bases:
objectProvides methods for the analysis of layered slabs on compliant elastic foundations.
- Parameters:
system_model (SystemModel)
printing_enabled (bool)
- __init__(system_model, printing_enabled=True)[source]¶
- Parameters:
system_model (SystemModel)
printing_enabled (bool)
- sm: SystemModel¶
- printing_enabled: bool = True¶
- print_call_stats(message='Analyzer Call Statistics')[source]¶
Prints the call statistics in a readable format.
- Parameters:
message (str)
- rasterize_solution(mode='cracked', num=4000, *, boundary_window=None, boundary_dx=None)[source]¶
Compute rasterized solution vector.
- Parameters:
mode (Literal["cracked", "uncracked"]) – Mode of the solution.
num (int) – Soft budget for the number of grid points (length-proportional per segment). With boundary refinement, fine windows are always filled even if the realized count exceeds
num.boundary_window (float, optional) – Half-width [mm] of piecewise-fine sampling windows at every segment end (domain ends and inter-segment joints).
Nonekeeps uniformlinspacespacing (historical default).boundary_dx (float, optional) – Target spacing [mm] inside fine windows. Required together with
boundary_window.
- Returns:
xs (ndarray) – Grid point x-coordinates at which solution vector is discretized.
zs (ndarray) – Matrix with solution vectors as columns at grid points xs.
x_founded (ndarray) – Grid point x-coordinates that lie on a foundation.
- get_zmesh(dz=2)[source]¶
Get z-coordinates of grid points and corresponding elastic properties.
- Parameters:
dz (float, optional) – Element size along z-axis (mm). Default is 2 mm.
- Returns:
mesh – Mesh along z-axis. Columns are a list of z-coordinates (mm) of grid points along z-axis with at least two grid points (top, bottom) per layer, Young’s modulus of each grid point, shear modulus of each grid point, and Poisson’s ratio of each grid point.
- Return type:
ndarray
- Sxx(Z, phi, dz=2, unit='kPa', normalize=False)[source]¶
Compute axial normal stress in slab layers.
- Parameters:
Z (ndarray) – Solution vector [u(x) u’(x) w(x) w’(x) psi(x), psi’(x)]^T
phi (float) – Inclination (degrees). Counterclockwise positive.
dz (float, optional) – Element size along z-axis (mm). Default is 2 mm.
unit ({'kPa', 'MPa'}, optional) – Desired output unit. Default is ‘kPa’.
normalize (bool, optional) – Toggle normalization. If True, normalize stress values to the tensile strength of each layer (dimensionless). When normalized, the unit parameter is ignored and values are returned as ratios. Default is False.
- Returns:
Axial slab normal stress in specified unit.
- Return type:
ndarray, float
- Txz(Z, phi, dz=2, unit='kPa', normalize=False)[source]¶
Compute shear stress in slab layers.
- Parameters:
Z (ndarray) – Solution vector [u(x) u’(x) w(x) w’(x) psi(x), psi’(x)]^T
phi (float) – Inclination (degrees). Counterclockwise positive.
dz (float, optional) – Element size along z-axis (mm). Default is 2 mm.
unit ({'kPa', 'MPa'}, optional) – Desired output unit. Default is ‘kPa’.
normalize (bool, optional) – Toggle normalization. If True, normalize shear stress values to the tensile strength of each layer (dimensionless). When normalized, the unit parameter is ignored and values are returned as ratios. Default is False.
- Returns:
Shear stress at grid points in the slab in specified unit.
- Return type:
ndarray
- Szz(Z, phi, dz=2, unit='kPa', normalize=False)[source]¶
Compute transverse normal stress in slab layers.
- Parameters:
Z (ndarray) – Solution vector [u(x) u’(x) w(x) w’(x) psi(x), psi’(x)]^T
phi (float) – Inclination (degrees). Counterclockwise positive.
dz (float, optional) – Element size along z-axis (mm). Default is 2 mm.
unit ({'kPa', 'MPa'}, optional) – Desired output unit. Default is ‘kPa’.
normalize (bool, optional) – Toggle normalization. If True, normalize stress values to the tensile strength of each layer (dimensionless). When normalized, the unit parameter is ignored and values are returned as ratios. Default is False.
- Returns:
Transverse normal stress at grid points in the slab in specified unit.
- Return type:
ndarray, float
- principal_stress_slab(Z, phi, dz=2, unit='kPa', val='max', normalize=False)[source]¶
Compute maximum or minimum principal stress in slab layers.
- Parameters:
Z (ndarray) – Solution vector [u(x) u’(x) w(x) w’(x) psi(x), psi’(x)]^T
phi (float) – Inclination (degrees). Counterclockwise positive.
dz (float, optional) – Element size along z-axis (mm). Default is 2 mm.
unit ({'kPa', 'MPa'}, optional) – Desired output unit. Default is ‘kPa’.
val (str, optional) – Maximum ‘max’ or minimum ‘min’ principal stress. Default is ‘max’.
normalize (bool) – Toggle layerwise normalization to strength.
- Returns:
Maximum or minimum principal stress in specified unit.
- Return type:
ndarray
- Raises:
ValueError – If specified principal stress component is neither ‘max’ nor ‘min’, or if normalization of compressive principal stress is requested.
- principal_stress_weaklayer(Z, sc=2.6, unit='kPa', val='min', normalize=False)[source]¶
Compute maximum or minimum principal stress in the weak layer.
- Parameters:
Z (ndarray) – Solution vector [u(x) u’(x) w(x) w’(x) psi(x), psi’(x)]^T
sc (float) – Weak-layer compressive strength. Default is 2.6 kPa.
unit ({'kPa', 'MPa'}, optional) – Desired output unit. Default is ‘kPa’.
val (str, optional) – Maximum ‘max’ or minimum ‘min’ principal stress. Default is ‘min’.
normalize (bool) – Toggle layerwise normalization to strength.
- Returns:
Maximum or minimum principal stress in specified unit.
- Return type:
ndarray
- Raises:
ValueError – If specified principal stress component is neither ‘max’ nor ‘min’, or if normalization of tensile principal stress is requested.
- incremental_ERR(tolerance=1e-6, unit='kJ/m^2')[source]¶
Compute incremental energy release rate (ERR) of all cracks.
- Returns:
List of total, mode I, and mode II energy release rates.
- Return type:
ndarray
- Parameters:
tolerance (float)
unit (Literal['kJ/m^2', 'J/m^2'])