<commit_before># -*- coding: utf-8 -*-
"""GroundwaterDupuitPercolator Component.

@author: <NAME>, <NAME>, <NAME>
"""
from warnings import warn

import numpy as np

from landlab import Component
from landlab.grid.mappers import (
    map_mean_of_link_nodes_to_link,
    map_value_at_max_node_to_link,
)
from landlab.utils import return_array_at_link, return_array_at_node


# regularization functions used to deal with numerical demons of seepage
def _regularize_G(u, reg_factor):
    """Smooths transition of step function with an exponential.

    0<=u<=1.
    """
    return np.exp(-(1 - u) / reg_factor)


def _regularize_R(u):
    """ramp function on u."""
    return u * np.greater_equal(u, 0)


def _update_thickness(dt, h0, b, f, dqdx, n, r):
    """analytical solution for the linearized governing equation."""
    out = np.empty_like(h0)
    out[:] = b * (
        1
        - r
        * np.log(
            1
            + np.exp((1 - (h0 + ((f - dqdx) * dt) / n) / b) / r)
            * (1 - np.exp(-(b - h0) / (b * r)))<commit_msg>remove unneeded declaration<commit_after># -*- coding: utf-8 -*-
"""GroundwaterDupuitPercolator Component.

@author: <NAME>, <NAME>, <NAME>
"""
from warnings import warn

import numpy as np

from landlab import Component
from landlab.grid.mappers import (
    map_mean_of_link_nodes_to_link,
    map_value_at_max_node_to_link,
)
from landlab.utils import return_array_at_link, return_array_at_node


# regularization functions used to deal with numerical demons of seepage
def _regularize_G(u, reg_factor):
    """Smooths transition of step function with an exponential.

    0<=u<=1.
    """
    return np.exp(-(1 - u) / reg_factor)


def _regularize_R(u):
    """ramp function on u."""
    return u * np.greater_equal(u, 0)


def _update_thickness(dt, h0, b, f, dqdx, n, r):
    """analytical solution for the linearized governing equation."""
    out = b * (
        1
        - r
        * np.log(
            1
            + np.exp((1 - (h0 + ((f - dqdx) * dt) / n) / b) / r)
            * (1 - np.exp(-(b - h0) / (b * r)))
{'fraction_non_alphanumeric': 0.1326579835986493, 'fraction_numerical': 0.0120598166907863, 'mean_word_length': 2.7777777777777777, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, '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': '5894968', 'n_tokens_mistral': 750, 'n_tokens_neox': 724, 'n_words': 205}