OwlCyberSecurity - MANAGER
Edit File: trirefine.cpython-38.pyc
U ��]6 � @ sD d Z ddlZddlmZ ddlZG dd� de�ZG dd� de�Z dS )z' Mesh refinement for triangular grids. � N)� Triangulationc @ s e Zd ZdZdd� ZdS )� 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 implements: - ``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 a :class:`~matplotlib.tri.TriInterpolator` (optional) - 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 C s t |t�std��|| _d S )NzExpected a Triangulation object)� isinstancer � ValueError�_triangulation��self� triangulation� r �:/usr/lib/python3/dist-packages/matplotlib/tri/trirefine.py�__init__) s zTriRefiner.__init__N)�__name__� __module__�__qualname__�__doc__r r r r r r s r c @ s: e Zd ZdZdd� Zd dd�Zdd d �Zeddd��ZdS )�UniformTriRefinerz� Uniform mesh refinement by recursive subdivisions. Parameters ---------- triangulation : :class:`~matplotlib.tri.Triangulation` The encapsulated triangulation (to be refined) c C s t �| |� d S )N)r r r r r r r = s zUniformTriRefiner.__init__F� c C s� | j }|jjd }tj|tjd�}t|�D ]}| �||�\}}q*|jjd }|j}|r�tj |dtjd�} | j j } | dkr�t�|d��dd�| |<