403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/matplotlib/tri/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/matplotlib/tri/__pycache__/trirefine.cpython-312.pyc
�

G8�c�3��Z�dZddlZddlmZddlmZddlZGd�d�ZGd�de�Z	y)	z'
Mesh refinement for triangular grids.
�N)�_api)�
Triangulationc��eZdZdZd�Zy)�
TriRefinera{
    Abstract base class for classes implementing mesh refinement.

    A TriRefiner encapsulates a Triangulation object and provides tools for
    mesh refinement and interpolation.

    Derived classes must implement:

    - ``refine_triangulation(return_tri_index=False, **kwargs)`` , where
      the optional keyword arguments *kwargs* are defined in each
      TriRefiner concrete implementation, and which returns:

      - a refined triangulation,
      - optionally (depending on *return_tri_index*), for each
        point of the refined triangulation: the index of
        the initial triangulation triangle to which it belongs.

    - ``refine_field(z, triinterpolator=None, **kwargs)``, where:

      - *z* array of field values (to refine) defined at the base
        triangulation nodes,
      - *triinterpolator* is an optional `~matplotlib.tri.TriInterpolator`,
      - the other optional keyword arguments *kwargs* are defined in
        each TriRefiner concrete implementation;

      and which returns (as a tuple) a refined triangular mesh and the
      interpolated values of the field at the refined triangulation nodes.
    c�H�tjt|��||_y)N)�
triangulation)r�check_isinstancer�_triangulation)�selfrs  �:/usr/lib/python3/dist-packages/matplotlib/tri/trirefine.py�__init__zTriRefiner.__init__*s�����m�=�I�+���N)�__name__�
__module__�__qualname__�__doc__r
�rrrrs���:,rrc�D��eZdZdZ�fd�Zdd�Zdd�Zedd��Z�xZ	S)	�UniformTriRefinerz�
    Uniform mesh refinement by recursive subdivisions.

    Parameters
    ----------
    triangulation : `~matplotlib.tri.Triangulation`
        The encapsulated triangulation (to be refined)
    c�$��t�|�|�y�N)�superr
)rr�	__class__s  �rr
zUniformTriRefiner.__init__=s���
����'rc���|j}|jjd}tj|tj
��}t
|�D]}|j||�\}}�|jjd}|j}|r�tj|dtj
��}	|jj}
|
�-tj|d�jdd�|	|<||	fS|
|}tj||d�jdd�|	||dd�f<tj||d�jdd�|	||dd�f<||	fS|S)a�
        Compute an uniformly refined triangulation *refi_triangulation* of
        the encapsulated :attr:`triangulation`.

        This function refines the encapsulated triangulation by splitting each
        father triangle into 4 child sub-triangles built on the edges midside
        nodes, recursing *subdiv* times.  In the end, each triangle is hence
        divided into ``4**subdiv`` child triangles.

        Parameters
        ----------
        return_tri_index : bool, default: False
            Whether an index table indicating the father triangle index of each
            point is returned.
        subdiv : int, default: 3
            Recursion level for the subdivision.
            Each triangle is divided into ``4**subdiv`` child triangles;
            hence, the default results in 64 refined subtriangles for each
            triangle of the initial triangulation.

        Returns
        -------
        refi_triangulation : `~matplotlib.tri.Triangulation`
            The refined triangulation.
        found_index : int array
            Index of the initial triangulation containing triangle, for each
            point of *refi_triangulation*.
            Returned only if *return_tri_index* is set to True.
        r��dtype���N�)
r
�	triangles�shape�np�arange�int32�range�_refine_triangulation_once�x�full�mask�repeat�reshape)r�return_tri_index�subdiv�refi_triangulation�ntri�	ancestors�_�	refi_npts�refi_triangles�found_index�tri_mask�
ancestor_masks            r�refine_triangulationz&UniformTriRefiner.refine_triangulation@s���<"�0�0��!�+�+�1�1�!�4���I�I�d�"�(�(�3�	��v��	/�A�,0�,K�,K�"�I�-/�)��	�	/�'�(�(�.�.�q�1�	�+�5�5����'�'�)�R�r�x�x�@�K��*�*�/�/�H���.0�i�i�	�89�/;�;B�7�2�q�>��N�+�&�{�2�2�!)�� 3�
� "�	�	�)�M�*B�*+�!-�-4�W�R��^��N�=�!�+;�<��!#�	�	�)�]�N�*C�*+�!-�-4�W�R��^��N�M�>�1�+<�=��&�{�2�2�%�%rc�H�|�+tjj|j|�}n1t	j
tjj|��|}|j|d��\}}|j|j|j|��d}||fS)a�
        Refine a field defined on the encapsulated triangulation.

        Parameters
        ----------
        z : (npoints,) array-like
            Values of the field to refine, defined at the nodes of the
            encapsulated triangulation. (``n_points`` is the number of points
            in the initial triangulation)
        triinterpolator : `~matplotlib.tri.TriInterpolator`, optional
            Interpolator used for field interpolation. If not specified,
            a `~matplotlib.tri.CubicTriInterpolator` will be used.
        subdiv : int, default: 3
            Recursion level for the subdivision.
            Each triangle is divided into ``4**subdiv`` child triangles.

        Returns
        -------
        refi_tri : `~matplotlib.tri.Triangulation`
             The returned refined triangulation.
        refi_z : 1D array of length: *refi_tri* node count.
             The returned interpolated field (at *refi_tri* nodes).
        )�triinterpolatorT)r,r+)�	tri_indexr)�
matplotlib�tri�CubicTriInterpolatorr
rr	�TriInterpolatorr6�_interpolate_multikeysr&�y)r�zr8r,�interp�refi_trir3�refi_zs        r�refine_fieldzUniformTriRefiner.refine_field�s���0�"��^�^�8�8��#�#�Q�(�F�
�!�!�*�.�.�"@�"@�2A�
C�$�F� $� 9� 9��D�!:�!2���+��.�.��J�J��
�
�k�/�;�;<�>�����rc
�x	�|j}|j}|j}|j}t	j
|�d}t	j
|�d}|�ot	j|�}t	j
|�|fk7rAtdjt	j
|�t	j
|����t	j|dk(�}d|z|zdz}	||	z}
t	j|
�}t	j|
�}||d|||d|t	jt	j|tj��d�}
t	jt	jdtj��|�}||
|f}|
|kD}|
|}||}||||f||||dzdzfzd	z}||||f||||dzdzfzd	z}|||d|||d|}t	j|dgtj��}|}t!d�D]X}||k(}t	j|�}||}t	j|tj��|z|dd�|f|<||z
}�Zt	j"|�}|
|}||}t	j$||dd�ft	j&|t	j(dtj���z
�}t	j*|d�
�} ||}!||| f|||!f<t	j|dzdgtj��}"t	j,|dd�df|dd�df|dd�dfg�j.|"ddd�dd�f<t	j,|dd�df|dd�df|dd�dfg�j.|"ddd�dd�f<t	j,|dd�df|dd�df|dd�dfg�j.|"ddd�dd�f<t	j,|dd�df|dd�df|dd�dfg�j.|"ddd�dd�f<t1|||"�}#|j2�/|#j5t	j|j2d��|�|#S|#t	j|d�fS)a�
        Refine a `.Triangulation` by splitting each triangle into 4
        child-masked_triangles built on the edges midside nodes.

        Masked triangles, if present, are also split, but their children
        returned masked.

        If *ancestors* is not provided, returns only a new triangulation:
        child_triangulation.

        If the array-like key table *ancestor* is given, it shall be of shape
        (ntri,) where ntri is the number of *triangulation* masked_triangles.
        In this case, the function returns
        (child_triangulation, child_ancestors)
        child_ancestors is defined so that the 4 child masked_triangles share
        the same index as their father: child_ancestors.shape = (4 * ntri,).
        rNzYIncompatible shapes provide for triangulation.masked_triangles and ancestors: {0} and {1}rr�r�g�?)�axis�)r&r?�	neighborsrr!r �asarray�
ValueError�format�sum�zeros�tiler"r#r)�emptyr$�logical_not�abs�outer�ones�argmin�vstack�Trr(�set_mask)$rr/r&r?rJr�nptsr.�borders�	added_ptsr1�refi_x�refi_y�
edge_elems�edge_apexes�edge_neighbors�mask_masters�masters�apex_masters�x_add�y_add�
new_pt_corner�new_pt_midside�cum_sum�imid�mask_st_loc�
n_masters_loc�elem_masters_loc�mask_slaves�slaves�slaves_masters�
diff_table�slave_masters_apex�slaves_apex�child_triangles�child_triangulations$                                    rr%z,UniformTriRefiner._refine_triangulation_once�s���(
�O�O���O�O��"�+�+�	�!�+�+�	��x�x��{�1�~���x�x�	�"�1�%��� ��
�
�9�-�I��x�x�	�"�t�g�-� �C�CI�6�����+�R�X�X�i�-@�DB�C�C��&�&��b��)���t�V�g�%�!�+�	��9�$�	����)�$�����)�$����u��
���u��
��W�W�R�Y�Y�t�2�8�8�<�a�@�
��i�i��	�	�!�2�8�8� <�d�C��"�:�{�#:�;��"�^�3���\�*��"�<�0���9�W�l�2�3�4��9�W�|�A�~��&:�:�;�<�=�@C�D���9�W�l�2�3�4��9�W�|�A�~��&:�:�;�<�=�@C�D����t�u�
���t�u�
�"�
����4��)�2�8�8�<�����!�H�	%�D��<�/�K��F�F�;�/�M�&�{�3��8:�	�	��R�X�X�9/�18�99�N�1�d�7�#�$4�5��}�$�G�
	%��n�n�\�2���K�(��'��4���V�V�I�n�a�&7�8��H�H�V�R�W�W�Q�b�h�h�-G�H�I�J�
��Y�Y�z��:��!�+�.��.<��.�.�/0��v�{�*�+��(�(�D��F�A�;�b�h�h�?��#%�9�9��!�Q�$����1��!5��1�a�4� �."�$#�#$�1�	���1��a�� �$&�9�9��!�Q�$����1��!5��1�a�4� �."�$#�#$�1�	���1��a�� �$&�9�9��!�Q�$����1��!5��1�a�4� �."�$#�#$�1�	���1��a�� �$&�9�9��1�a�4� �.��A��"6��1�a�4� �."�$#�#$�1�	���1��a�� �,�F�F�O�L�����)��(�(����=�3E�3E�q�)I�J���&�&�&��	�	�)�Q�(?�?�?r)Fr)Nrr)
rrrrr
r6rD�staticmethodr%�
__classcell__)rs@rrr/s2����(�C&�J$ �L�G@��G@rr)
r�numpyr!r:r�matplotlib.tri.triangulationr�matplotlib.tri.triinterpolaterrrrr�<module>r{s3�����6�$� ,� ,�FD@�
�D@r

Youez - 2016 - github.com/yon3zu
LinuXploit