# Path: gusto/kernels.py
# class GaussianElimination(object):
# class Average(object):
# class AverageWeightings(object):
# class PhysicsRecoveryTop():
# class PhysicsRecoveryBottom():
#     def __init__(self, DG1):
#     def apply(self, v_DG1_old, v_DG1, act_coords, eff_coords, num_ext):
#     def __init__(self, V):
#     def apply(self, v_out, weighting, v_in):
#     def __init__(self, V):
#     def apply(self, w):
#     def __init__(self):
#     def apply(self, v_DG1, v_CG1):
#     def __init__(self):
#     def apply(self, v_DG1, v_CG1):


from firedrake import (IntervalMesh, Function, RectangleMesh, SpatialCoordinate,
                       VectorFunctionSpace, FiniteElement)
from gusto import kernels
import numpy as np
import pytest
            if field is not None and new_value is not None:
                field.dat.data[i] = new_value
            break

    if not point_found:
        raise ValueError('Your coordinates do not appear to match the coordinates of a DoF')

    if field is None or new_value is None:
        return point_index


@pytest.mark.parametrize("geometry", ["1D", "2D"])
def test_average(geometry, mesh):

    cell = mesh.ufl_cell().cellname()
    DG1_elt = FiniteElement("DG", cell, 1, variant="equispaced")
    vec_DG1 = VectorFunctionSpace(mesh, DG1_elt)
    vec_DG0 = VectorFunctionSpace(mesh, "DG", 0)
    vec_CG1 = VectorFunctionSpace(mesh, "CG", 1)

    # We will fill DG1_field with values, and average them to CG_field
    # First need to put the values into DG0 and then interpolate
    DG0_field = Function(vec_DG0)
    DG1_field = Function(vec_DG1)
    CG_field = Function(vec_CG1)
    weights = Function(vec_CG1)

    DG0_field, weights, true_values, CG_index = setup_values(geometry, DG0_field, weights)

    DG1_field.interpolate(DG0_field)

# Path: gusto/kernels.py
# class GaussianElimination(object):
# class Average(object):
# class AverageWeightings(object):
# class PhysicsRecoveryTop():
# class PhysicsRecoveryBottom():
#     def __init__(self, DG1):
#     def apply(self, v_DG1_old, v_DG1, act_coords, eff_coords, num_ext):
#     def __init__(self, V):
#     def apply(self, v_out, weighting, v_in):
#     def __init__(self, V):
#     def apply(self, w):
#     def __init__(self):
#     def apply(self, v_DG1, v_CG1):
#     def __init__(self):
#     def apply(self, v_DG1, v_CG1):


# Path: tests/kernel_tests/test_average_kernel.py
from firedrake import (IntervalMesh, Function, RectangleMesh, SpatialCoordinate,
                       VectorFunctionSpace, FiniteElement)
from gusto import kernels
import numpy as np
import pytest

            if field is not None and new_value is not None:
                field.dat.data[i] = new_value
            break

    if not point_found:
        raise ValueError('Your coordinates do not appear to match the coordinates of a DoF')

    if field is None or new_value is None:
        return point_index


@pytest.mark.parametrize("geometry", ["1D", "2D"])
def test_average(geometry, mesh):

    cell = mesh.ufl_cell().cellname()
    DG1_elt = FiniteElement("DG", cell, 1, variant="equispaced")
    vec_DG1 = VectorFunctionSpace(mesh, DG1_elt)
    vec_DG0 = VectorFunctionSpace(mesh, "DG", 0)
    vec_CG1 = VectorFunctionSpace(mesh, "CG", 1)

    # We will fill DG1_field with values, and average them to CG_field
    # First need to put the values into DG0 and then interpolate
    DG0_field = Function(vec_DG0)
    DG1_field = Function(vec_DG1)
    CG_field = Function(vec_CG1)
    weights = Function(vec_CG1)

    DG0_field, weights, true_values, CG_index = setup_values(geometry, DG0_field, weights)

    DG1_field.interpolate(DG0_field)

    kernel = kernels.Average(vec_CG1)