<commit_before>from meshless.espim.plate2d_add_k0s_cell_based import add_k0s as add_k0s_cell
from meshless.espim.plate2d_add_k0s_cell_based_no_smoothing import add_k0s as add_k0s_cell_no_smoothing
from meshless.espim.plate2d_add_k0s_edge_based import add_k0s as add_k0s_edge

def add_k0s(k0, mesh, prop_from_node, method='cell-based', alpha=0.2):
    #alpha between 0. and 0.6, according to studies of Lyly et al.
    if method == 'cell-based':
        return add_k0s_cell(k0, mesh, prop_from_node, alpha=alpha)
    elif method == 'cell-based-no-smoothing':
        return add_k0s_cell_no_smoothing(k0, mesh, prop_from_node, alpha=alpha)
    elif method == 'edge-based':
        return add_k0s_edge(k0, mesh, prop_from_node, alpha=alpha)
    else:
        raise ValueError('Invalid method')


<commit_msg>ENH: updated default alpha to 0.08<commit_after>from meshless.espim.plate2d_add_k0s_cell_based import add_k0s as add_k0s_cell
from meshless.espim.plate2d_add_k0s_cell_based_no_smoothing import add_k0s as add_k0s_cell_no_smoothing
from meshless.espim.plate2d_add_k0s_edge_based import add_k0s as add_k0s_edge

def add_k0s(k0, mesh, prop_from_node, method='cell-based', alpha=0.08):
    """Add the transverse shear stiffness to an existing consitutive stiffness
    matrix

    The transverse shear stiffness is computed using the Discrete Shear Gap
    method, with a correction that uses parameter `alpha`

    Parameters
    ----------
    k0 : (N, N) array-like
        Existing stiffness matrix. This object is modified in-place

    mesh : :class:`pyNastran.bdf.BDF` object
        The object must have the proper edge references as those returned by
        :func:`.read_mesh` or :func:`.read_delaunay`

    prop_from_node : bool
        If the constitutive properties are assigned per node. Otherwise they
        are considered assigned per element

    method : str, optional
        The smoothing method for the transverse shear

    alpha : float
        Positive constant used in the correction applied to the transverse
        shear stiffness

    """
    #alpha between 0. and 0.6, according to studies of Lyly et al.
    if method == 'cell-based':
        return add_k0s_cell(k0, mesh, prop_from_node, alpha=alpha)
    elif method == 'cell-based-no-smoothing':
        return add_k0s_cell_no_smoothing(k0, mesh, prop_from_node, alpha=alpha)
    elif method == 'edge-based':
        return add_k0s_edge(k0, mesh, prop_from_node, alpha=alpha)
    else:
        raise ValueError('Invalid method')

{'fraction_non_alphanumeric': 0.07557677008750995, 'fraction_numerical': 0.021877486077963405, 'mean_word_length': 3.772296015180266, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3083305', 'n_tokens_mistral': 874, 'n_tokens_neox': 828, 'n_words': 235}