Skip to content

crack

gripyth.solving.crack

Crack.

MODULE DESCRIPTION
integration

Helper routines for numerical integration.

CLASS DESCRIPTION
Bar

Simple bar specimen.

Cct

Center-cracked test.

Cgr

Crack growth rate variables.

CrackDirection

Direction of crack growth (x-axis / y-axis).

CrackDiscretized

Variables for the discretized crack growth monitoring approach.

CrackGrowthDetails

Variables for the crack growth monitoring.

CrackInterpolated

Variables for the interpolated crack growth monitoring approach.

CrackParameters

Crack growth monitoring quantities.

CrackRegularized

Variables for the smeared crack growth monitoring approach.

CrackVariables

Crack growth variables.

Ct

Compact tension.

Dent

Double-edge-notched tension test.

Other

Other.

Pulltest

Simple pull test for stable crack growth.

Sent

Single-edge-notched tension test.

SmearedComputation

method to compute the smeared crack length.

Specimen

Specimen for specific computations.

Tpb

Three-point bending test.

FUNCTION DESCRIPTION
crack_discretized

Computes the discretized crack length.

crack_growth_rate

Generalized function to be used for various crack- and cgr-structs.

crack_growth_rate_detailed

Generalized function to be used for various crack- and cgr-structs.

crack_interpolated

Computes the interpolated crack length.

crack_regularized

Computes the smeared crack length.

fatigue_crack_growth

Computes the fatigue crack growth rate for different methods.

fatigue_crack_growth_details

Variables for the fatigue crack growth monitoring.

fatigue_life

Compute nominal stress for Woehler curve.

nth_corr

Try to index the list of available corr values, defaulting to (1., 1.).

shape_fun_2d

Shape functions, quad4 element.

sqrt_tanc

Implementation of sqrt(tan(x)/x) which also works at x=0 and neighbourhood.

ATTRIBUTE DESCRIPTION
N

Number or array generic used by vectorized routines.

N module-attribute

N = float | NDArray[float64]

Number or array generic used by vectorized routines.

Bar

Bases: Specimen

Simple bar specimen.

METHOD DESCRIPTION
geometric_factor

Computes the geometric factor for the stress intensity factor.

geometric_factor staticmethod

geometric_factor(gamma_avg: N) -> N

Computes the geometric factor for the stress intensity factor.

Cct

Bases: Specimen

Center-cracked test.

METHOD DESCRIPTION
geometric_factor

Computes the geometric factor for the stress intensity factor.

geometric_factor staticmethod

geometric_factor(gamma_avg: N) -> N

Computes the geometric factor for the stress intensity factor.

based on Tada 1939 'The stress analysis of cracks handbook', p.41 (accuracy 0.1% for any a/b for h/b>3)

Input:

  • gamma_avg: average crack length to width ratio

Cgr dataclass

Crack growth rate variables.

CrackDirection

Bases: Enum

Direction of crack growth (x-axis / y-axis).

CrackDiscretized dataclass

Variables for the discretized crack growth monitoring approach.

CrackGrowthDetails dataclass

Variables for the crack growth monitoring.

CrackInterpolated dataclass

Variables for the interpolated crack growth monitoring approach.

CrackParameters dataclass

Crack growth monitoring quantities.

METHOD DESCRIPTION
__init__

High level constructor.

ATTRIBUTE DESCRIPTION
J_elem

Jacobian of elements in the phase-field support

TYPE: float

a_offset

offset of the crack.

TYPE: float

cgr_da

increment of crack length after which to evaluate crack growth rate curve.

TYPE: float

crack_direction

direction of crack growth (x-axis / y-axis).

TYPE: CrackDirection

crack_elems

elements where the crack tip interpolation should take place.

TYPE: NDArray[int32]

crack_nodes

nodes where the crack tip interpolation should take place.

TYPE: NDArray[int32]

crack_thres

threshold of the phase-field which should be considered as broken.

TYPE: float

crack_tips

number of crack tips.

TYPE: int

d_int_approx_fac

constant factor for the L1-norm approximation of the smeared crack length

TYPE: float

diss_fct

dissipation function.

TYPE: DissipationFunction

ellh

number of elements per phase-field length scale

TYPE: int

export_pf_interp

whether to output a file with the interpolated phase-field variables.

TYPE: bool

int_d_segment

theoretical value for the phase-field integral for a segment.

TYPE: float

int_d_tip

theoretical value for the phase-field integral for a tip.

TYPE: float

material

material characteristics.

TYPE: Material

rel_pf

threshold value for phase-field above which it is considered for the

TYPE: float

smeared_computation

method to compute the smeared crack length.

TYPE: SmearedComputation

specimen

selection of a specimen for specific computations.

TYPE: Specimen

J_elem instance-attribute

J_elem: float = J_elem

Jacobian of elements in the phase-field support (for the L1-norm approximation of the smeared crack length).

a_offset instance-attribute

a_offset: float = a_offset

offset of the crack.

cgr_da instance-attribute

cgr_da: float = cgr_da

increment of crack length after which to evaluate crack growth rate curve.

crack_direction instance-attribute

crack_direction: CrackDirection = crack_direction

direction of crack growth (x-axis / y-axis).

crack_elems instance-attribute

crack_elems: NDArray[int32]

elements where the crack tip interpolation should take place.

crack_nodes instance-attribute

crack_nodes: NDArray[int32]

nodes where the crack tip interpolation should take place.

crack_thres instance-attribute

crack_thres: float = crack_thres

threshold of the phase-field which should be considered as broken.

crack_tips instance-attribute

crack_tips: int = crack_tips

number of crack tips.

d_int_approx_fac instance-attribute

d_int_approx_fac: float = (
    ell / ellh**2 if J_elem == 0.0 else J_elem
)

constant factor for the L1-norm approximation of the smeared crack length (typically the Jacobian of the elements).

diss_fct instance-attribute

diss_fct: DissipationFunction = diss_fct

dissipation function.

ellh instance-attribute

ellh: int = ellh

number of elements per phase-field length scale (to properly correct the smeared crack length).

export_pf_interp instance-attribute

export_pf_interp: bool = export_pf_interp

whether to output a file with the interpolated phase-field variables.

int_d_segment instance-attribute

int_d_segment: float = int_d_segment

theoretical value for the phase-field integral for a segment.

int_d_tip instance-attribute

int_d_tip: float = int_d_tip

theoretical value for the phase-field integral for a tip.

material instance-attribute

material: Material = material

material characteristics.

rel_pf instance-attribute

rel_pf: float = 1.0 / e if diss_fct == AT2 else 0.25

threshold value for phase-field above which it is considered for the smeared crack length.

smeared_computation instance-attribute

smeared_computation: SmearedComputation = (
    smeared_computation
)

method to compute the smeared crack length.

specimen instance-attribute

specimen: Specimen = specimen

selection of a specimen for specific computations.

__init__

__init__(
    material: Material,
    specimen: Specimen,
    diss_fct: DissipationFunction,
    cgr_da: float = 0.1,
    crack_thres: float = 0.95,
    crack_elems: NDArray[np.int32] | None = None,
    crack_nodes: NDArray[np.int32] | None = None,
    export_pf_interp: bool = False,
    int_d_segment: float = 0.0,
    int_d_tip: float = 0.0,
    crack_tips: int = 1,
    J_elem: float = 0.0,
    smeared_computation: SmearedComputation = SmearedComputation.integration,
    ellh: int = 5,
)

High level constructor.

CrackRegularized dataclass

Variables for the smeared crack growth monitoring approach.

CrackVariables dataclass

Crack growth variables.

METHOD DESCRIPTION
__init__

High level constructor.

ATTRIBUTE DESCRIPTION
cgr_discretized

n, a

TYPE: list[Cgr]

cgr_interpolated

n, a

TYPE: list[Cgr]

cgr_regularized

n, a

TYPE: list[Cgr]

crack_discretized

n, dn, a, dadn, x, y

TYPE: list[CrackDiscretized]

crack_interpolated

n, dn, a, dadn, x, y

TYPE: list[CrackInterpolated]

crack_regularized

n, dn, a, dadn, int_d

TYPE: list[CrackRegularized]

n_resolved

number of explicitly computed cycles.

TYPE: int

cgr_discretized instance-attribute

cgr_discretized: list[Cgr] = [Cgr(a=a_ini)]

n, a

cgr_interpolated instance-attribute

cgr_interpolated: list[Cgr] = [Cgr(a=a_ini)]

n, a

cgr_regularized instance-attribute

cgr_regularized: list[Cgr] = [Cgr(a=a_ini)]

n, a

crack_discretized instance-attribute

crack_discretized: list[CrackDiscretized] = [
    CrackDiscretized(
        x=crack_coords[0], y=crack_coords[1], a=a_ini
    )
]

n, dn, a, dadn, x, y

crack_interpolated instance-attribute

crack_interpolated: list[CrackInterpolated] = [
    CrackInterpolated(
        x=crack_coords[0], y=crack_coords[1], a=a_ini
    )
]

n, dn, a, dadn, x, y

crack_regularized instance-attribute

crack_regularized: list[CrackRegularized] = [
    CrackRegularized(
        a=a_ini - crack_tips * int_d_tip / int_d_segment
    )
]

n, dn, a, dadn, int_d

n_resolved class-attribute instance-attribute

n_resolved: int = 0

number of explicitly computed cycles.

__init__

__init__(parameters: CrackParameters)

High level constructor.

Ct

Bases: Specimen

Compact tension.

METHOD DESCRIPTION
geometric_factor

Computes the geometric factor for the stress intensity factor.

geometric_factor staticmethod

geometric_factor(gamma_avg: N) -> N

Computes the geometric factor for the stress intensity factor.

based on ASTM E647

Input:

  • gamma_avg: average crack length to width ratio

Dent

Bases: Specimen

Double-edge-notched tension test.

METHOD DESCRIPTION
geometric_factor

Computes the geometric factor for the stress intensity factor.

geometric_factor staticmethod

geometric_factor(gamma_avg: N) -> N

Computes the geometric factor for the stress intensity factor.

based on Tada 1939 'The stress analysis of cracks handbook', p.47 (accuracy 0.5% for any a/b for h/b>3)

Input:

  • gamma_avg: average crack length to width ratio

Other

Bases: Specimen

Other.

METHOD DESCRIPTION
geometric_factor

Computes the geometric factor for the stress intensity factor.

geometric_factor staticmethod

geometric_factor(gamma_avg: N) -> N

Computes the geometric factor for the stress intensity factor.

Pulltest

Bases: Specimen

Simple pull test for stable crack growth.

METHOD DESCRIPTION
geometric_factor

Computes the geometric factor for the stress intensity factor.

geometric_factor staticmethod

geometric_factor(gamma_avg: N) -> N

Computes the geometric factor for the stress intensity factor.

Sent

Bases: Specimen

Single-edge-notched tension test.

METHOD DESCRIPTION
geometric_factor

Computes the geometric factor for the stress intensity factor.

geometric_factor staticmethod

geometric_factor(gamma_avg: N) -> N

Computes the geometric factor for the stress intensity factor.

based on Tada 1939 'The stress analysis of cracks handbook', p.52

Input:

  • gamma_avg: average crack length to width ratio

SmearedComputation

Bases: Enum

method to compute the smeared crack length.

Specimen

Specimen for specific computations.

METHOD DESCRIPTION
geometric_factor

Computes the geometric factor for the stress intensity factor.

geometric_factor staticmethod

geometric_factor(gamma_avg: N) -> N

Computes the geometric factor for the stress intensity factor.

Tpb

Bases: Specimen

Three-point bending test.

METHOD DESCRIPTION
geometric_factor

Computes the geometric factor for the stress intensity factor.

geometric_factor staticmethod

geometric_factor(gamma_avg: N) -> N

Computes the geometric factor for the stress intensity factor.

based on ASTM E1820

Input:

  • gamma_avg: average crack length to width ratio

crack_discretized

crack_discretized(
    n_cycle: int,
    crack_params: CrackParameters,
    crack_var: CrackDiscretized,
    p_field: NDArray[np.float64],
    mesh: Mesh,
) -> CrackDiscretized

Computes the discretized crack length.

crack_growth_rate

crack_growth_rate(
    crack_params: CrackParameters,
    crack_struct: (
        CrackDiscretized
        | CrackInterpolated
        | CrackRegularized
    ),
    cgr_struct: Cgr,
) -> list[Cgr]

Generalized function to be used for various crack- and cgr-structs.

crack_growth_rate_detailed

crack_growth_rate_detailed(
    crack_params: CrackParameters,
    crack_structs: (
        list[CrackDiscretized]
        | list[CrackInterpolated]
        | list[CrackRegularized]
    ),
    cgr_struct: Cgr,
    R: float,
    geometry: Geometry,
    ty_final: float,
) -> CrackGrowthDetails | None

Generalized function to be used for various crack- and cgr-structs.

crack_interpolated

crack_interpolated(
    n_cycle: int,
    crack_params: CrackParameters,
    crack_var: CrackInterpolated,
    p_field: NDArray[np.float64],
    mesh: Mesh,
) -> CrackInterpolated

Computes the interpolated crack length.

crack_regularized

crack_regularized(
    n_cycle: int,
    crack_params: CrackParameters,
    crack_var: CrackRegularized,
    a_discretized: float,
    p_field: NDArray[np.float64],
    mesh: Mesh,
    t: float,
    quadrature: Quadrature,
) -> CrackRegularized

Computes the smeared crack length.

fatigue_crack_growth

fatigue_crack_growth(
    crack_params: CrackParameters, crack_var: CrackVariables
) -> None

Computes the fatigue crack growth rate for different methods.

fatigue_crack_growth_details

fatigue_crack_growth_details(
    crack_params: CrackParameters,
    crack_var: CrackVariables,
    step_params: StepParameters,
    geometry: Geometry,
    ty_final: float,
) -> tuple[
    CrackGrowthDetails | None,
    CrackGrowthDetails | None,
    CrackGrowthDetails | None,
]

Variables for the fatigue crack growth monitoring.

fatigue_life

fatigue_life(
    specimen: Specimen, geometry: Geometry, ty_final: float
) -> float

Compute nominal stress for Woehler curve.

nth_corr

nth_corr(
    corr_by_ellh: tuple[tuple[float, float] | None, ...],
    index: int,
) -> tuple[float, float]

Try to index the list of available corr values, defaulting to (1., 1.).

Display a warning if no value is available for the specified index.

shape_fun_2d

shape_fun_2d(d: int) -> NDArray[np.float64]

Shape functions, quad4 element.

sqrt_tanc

sqrt_tanc(x: N) -> N

Implementation of sqrt(tan(x)/x) which also works at x=0 and neighbourhood.