.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_comparisons.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_comparisons.py: Depth sweep ================ Compare performance as mesh resolution increases. Generates ch3-4 data. .. GENERATED FROM PYTHON SOURCE LINES 9-87 .. code-block:: default import xcell as xc import Common_nongallery import matplotlib.pyplot as plt import argparse import numpy as np cli = argparse.ArgumentParser() cli.add_argument("--comparison", choices=["bounds", "mesh", "formula", "bigPOC", "fixedDisc"], default="fixedDisc") cli.add_argument("-p", "--plot-only", help="skip simulation and use existing data", action="store_true") # cli.add_argument('-a','--animate',help='skip simulation and use existing data', action = 'store_true') # cli.add_argument('-p','--plot-only',help='skip simulation and use existing data', action = 'store_true') args = cli.parse_args() generate = True # plot performance info staticPlots = True depths = np.arange(3, 12) xtraParams = None xmax = 1e-4 if args.comparison == "mesh" or args.comparison == "bigPOC": foldername = "Comparison/PoC" tstVals = ["adaptive", "uniform"] # tstVals=['adaptive','equal elements',r'equal $l_0$'] tstCat = "Mesh type" if args.comparison == "formula" or args.comparison == "fixedDisc": foldername = "Comparison/formulations" tstVals = ["Admittance", "FEM", "Face"] tstCat = "Element type" if args.comparison == "bounds": foldername = "Comparison/boundaries" tstVals = ["Analytic", "Ground", "Rubik0"] tstCat = "Boundary" if args.comparison == "testing": foldername = "Comparison/miniset" tstVals = ["adaptive", "uniform"] tstCat = "Mesh type" generate = False staticPlots = False depths = np.arange(3, 8) if args.comparison == "bigPOC": foldername = "Comparison/bigPOC" xmax = 1e-2 if args.comparison == "fixedDisc": foldername = "Comparison/fixedDisc" xtraParams = {"boundary_functionction": "Analytic"} # if args.comparison=='voltage': # tstVals=[False, True] # tstCat='Vsrc?' # generate animation(s) plotters = [ xc.visualizers.ErrorGraph, # xc.visualizers.ErrorGraph, # xc.visualizers.SliceSet, # xc.visualizers.LogError, # xc.visualizers.CurrentPlot, ] plotPrefs = [ None, # {'onlyDoF':True}, # None, # None, ] study, _ = Common_nongallery.makeSynthStudy(foldername, xmax=xmax) .. GENERATED FROM PYTHON SOURCE LINES 88-94 .. code-block:: default if generate and not args.plot_only: Common_nongallery.pairedDepthSweep( study, depthRange=depths, testCat=tstCat, testVals=tstVals, overrides=xtraParams ) .. rst-class:: sphx-glr-script-out .. code-block:: none 2.58777 Gb used error: 1.39509 2.58777 Gb used error: 1.38292 Calculating adjacency: 0%| | 0/120 [00:00` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_comparisons.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_