class_docstr: 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.
class_docstr_tok: ["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","."]
code: def __init__(self, triangulation):
      _api.check_isinstance(Triangulation, triangulation=triangulation)
      self._triangulation = triangulation
  
file_path: catboost/contrib/python/matplotlib/py3/matplotlib/tri/_trirefine.py
imports: import numpy
  from matplotlib import _api
  from matplotlib.tri._triangulation import Triangulation
  import matplotlib.tri._triinterpolate
label_desc: Use image node_id 1 to create a new TriRefiner object  with example: obj = TriRefiner(triangulation)