# Path: discretize/tests.py
# def setup_mesh(mesh_type, nC, nDim):
#         def function(cell):
#     def setupMesh(self, nC):
#     def getError(self):
#     def orderTest(self):
# def rosenbrock(x, return_g=True, return_H=True):
# def check_derivative(
#     fctn,
#     x0,
#     num=7,
#     plotIt=True,
#     dx=None,
#     expectedOrder=2,
#     tolerance=0.85,
#     eps=1e-10,
#     ax=None,
# ):
#     def l2norm(x):
#     def plot_it(ax):
# def get_quadratic(A, b, c=0):
#     def Quadratic(x, return_g=True, return_H=True):
#             X, Y = example_curvilinear_grid([nC, nC], kwrd)
#             X, Y, Z = example_curvilinear_grid([nC, nC, nC], kwrd)
#     H = sp.csr_matrix(
#         np.array(
#             [[-400 * x[1] + 1200 * x[0] ** 2 + 2, -400 * x[0]], [-400 * x[0], 200]]
#         )
#     )
#     E0 = np.ones(h.shape)
#     E1 = np.ones(h.shape)
#             H = A
# class OrderTest(unittest.TestCase):


import unittest
import numpy as np
import sympy
import discretize
from sympy.abc import r, t, z
from discretize import tests
        derivR_z = (
            lambda r, t, z: 2
            * np.pi
            * np.cos(2 * np.pi * z)
            * np.sin(np.pi * r)
            * np.sin(t)
        )

        derivT_r = (
            lambda r, t, z: np.pi * np.cos(np.pi * z) * np.cos(np.pi * r) * np.sin(t)
        )
        derivT_z = (
            lambda r, t, z: -np.pi * np.sin(np.pi * z) * np.sin(np.pi * r) * np.sin(t)
        )

        derivZ_r = lambda r, t, z: np.pi * np.cos(np.pi * r) * np.sin(t)
        derivZ_t = lambda r, t, z: np.sin(np.pi * r) * np.cos(t)

        sol_r = lambda r, t, z: 1.0 / r * derivZ_t(r, t, z) - derivT_z(r, t, z)
        sol_t = lambda r, t, z: derivR_z(r, t, z) - derivZ_r(r, t, z)
        sol_z = (
            lambda r, t, z: 1.0
            / r
            * (r * derivT_r(r, t, z) + funT(r, t, z) - derivR_t(r, t, z))
        )

        Ec = cylE3(self.M, funR, funT, funZ)
        E = self.M.projectEdgeVector(Ec)
        curlE_num = self.M.edgeCurl * E


# Path: discretize/tests.py
# def setup_mesh(mesh_type, nC, nDim):
#         def function(cell):
#     def setupMesh(self, nC):
#     def getError(self):
#     def orderTest(self):
# def rosenbrock(x, return_g=True, return_H=True):
# def check_derivative(
#     fctn,
#     x0,
#     num=7,
#     plotIt=True,
#     dx=None,
#     expectedOrder=2,
#     tolerance=0.85,
#     eps=1e-10,
#     ax=None,
# ):
#     def l2norm(x):
#     def plot_it(ax):
# def get_quadratic(A, b, c=0):
#     def Quadratic(x, return_g=True, return_H=True):
#             X, Y = example_curvilinear_grid([nC, nC], kwrd)
#             X, Y, Z = example_curvilinear_grid([nC, nC, nC], kwrd)
#     H = sp.csr_matrix(
#         np.array(
#             [[-400 * x[1] + 1200 * x[0] ** 2 + 2, -400 * x[0]], [-400 * x[0], 200]]
#         )
#     )
#     E0 = np.ones(h.shape)
#     E1 = np.ones(h.shape)
#             H = A
# class OrderTest(unittest.TestCase):


# Path: tests/cyl/test_cylOperators.py
import unittest
import numpy as np
import sympy
import discretize
from sympy.abc import r, t, z
from discretize import tests

        derivR_z = (
            lambda r, t, z: 2
            * np.pi
            * np.cos(2 * np.pi * z)
            * np.sin(np.pi * r)
            * np.sin(t)
        )

        derivT_r = (
            lambda r, t, z: np.pi * np.cos(np.pi * z) * np.cos(np.pi * r) * np.sin(t)
        )
        derivT_z = (
            lambda r, t, z: -np.pi * np.sin(np.pi * z) * np.sin(np.pi * r) * np.sin(t)
        )

        derivZ_r = lambda r, t, z: np.pi * np.cos(np.pi * r) * np.sin(t)
        derivZ_t = lambda r, t, z: np.sin(np.pi * r) * np.cos(t)

        sol_r = lambda r, t, z: 1.0 / r * derivZ_t(r, t, z) - derivT_z(r, t, z)
        sol_t = lambda r, t, z: derivR_z(r, t, z) - derivZ_r(r, t, z)
        sol_z = (
            lambda r, t, z: 1.0
            / r
            * (r * derivT_r(r, t, z) + funT(r, t, z) - derivR_t(r, t, z))
        )

        Ec = cylE3(self.M, funR, funT, funZ)
        E = self.M.projectEdgeVector(Ec)
        curlE_num = self.M.edgeCurl * E


        Fc = cylF3(self.M, sol_r, sol_t, sol_z)