.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_functiongraphmesher.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_plot_functiongraphmesher.py: Function graph meshing ====================== .. GENERATED FROM PYTHON SOURCE LINES 7-8 In this example we will see how to define a function graph. .. GENERATED FROM PYTHON SOURCE LINES 10-14 .. code-block:: Python import openturns as ot import openturns.viewer as otv import otmeshing as otm .. GENERATED FROM PYTHON SOURCE LINES 15-16 Define the surface equation .. GENERATED FROM PYTHON SOURCE LINES 16-27 .. code-block:: Python a = [-4.0] * 3 b = [4.0] * 3 f = ot.SymbolicFunction(["x0", "x1"], ["cos(pi_*x0)*sin(pi_*x1)^2"]) f.setInputDescription([r"$x_0$", r"$x_1$"]) f.setOutputDescription([r"$x_2$"]) inputInterval = ot.Interval(a[:2], b[:2]) inputDiscretization = [16] * 2 mesher = otm.FunctionGraphMesher(inputInterval, inputDiscretization) outputIndex = 2 mesh = mesher.build(f, outputIndex, a[2], b[2]) .. GENERATED FROM PYTHON SOURCE LINES 28-29 Plot the function graph .. GENERATED FROM PYTHON SOURCE LINES 29-37 .. code-block:: Python shading = True thetaX, thetaY, thetaZ = 6.1, 3.7, 4.3 drawEdge = True graph = mesh.draw3D(drawEdge, thetaX, thetaY, thetaZ, shading) graph.setLegendPosition("upper left") graph.setTitle("Function graph") view = otv.View(graph) .. image-sg:: /auto_examples/images/sphx_glr_plot_functiongraphmesher_001.png :alt: Function graph :srcset: /auto_examples/images/sphx_glr_plot_functiongraphmesher_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 38-39 .. code-block:: Python otv.View.ShowAll() .. _sphx_glr_download_auto_examples_plot_functiongraphmesher.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_functiongraphmesher.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_functiongraphmesher.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_functiongraphmesher.zip `