Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions firedrake/functionspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def make_scalar_element(mesh, family, degree, vfamily, vdegree, variant, quad_sc
family :
The finite element family.
degree :
The degree of the finite element.
The degree of the finite element. If unspecified this will default
to the lowest degree available for the given family.
Comment thread
connorjward marked this conversation as resolved.
vfamily :
The finite element in the vertical dimension (extruded meshes
only).
Expand Down Expand Up @@ -86,7 +87,8 @@ def FunctionSpace(mesh, family, degree=None, name=None,
family :
The finite element family.
degree :
The degree of the finite element.
The degree of the finite element. If unspecified this will default
to the lowest degree available for the given family.
name:
An optional name for the function space.
vfamily :
Expand Down Expand Up @@ -125,7 +127,8 @@ def DualSpace(mesh, family, degree=None, name=None,
family :
The finite element family.
degree :
The degree of the finite element.
The degree of the finite element. If unspecified this will default
to the lowest degree available for the given family.
name :
An optional name for the function space.
vfamily:
Expand Down Expand Up @@ -164,7 +167,8 @@ def VectorFunctionSpace(mesh, family, degree=None, dim=None, name=None,
family :
The finite element family.
degree :
The degree of the finite element.
The degree of the finite element. If unspecified this will default
to the lowest degree available for the given family.
dim :
An optional number of degrees of freedom per function space
node (defaults to the geometric dimension of the mesh).
Expand Down Expand Up @@ -216,7 +220,8 @@ def TensorFunctionSpace(mesh, family, degree=None, shape=None,
family :
The finite element family.
degree :
The degree of the finite element.
The degree of the finite element. If unspecified this will default
to the lowest degree available for the given family.
shape :
An optional shape for the tensor-valued degrees of freedom at
each function space node (defaults to a square tensor using the
Expand Down
5 changes: 0 additions & 5 deletions tests/firedrake/vertexonly/test_interpolation_from_parent.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,11 +310,6 @@ def test_scalar_real_interpolation(parentmesh, vertexcoords):
vm = VertexOnlyMesh(parentmesh, vertexcoords, missing_points_behaviour="ignore")
W = FunctionSpace(vm, "DG", 0)
V = FunctionSpace(parentmesh, "Real", 0)
# Remove below when interpolating constant onto Real works for extruded
if type(parentmesh.topology) is mesh.ExtrudedMeshTopology:
with pytest.raises(ValueError):
assemble(interpolate(Constant(1), V))
return
v = assemble(interpolate(Constant(1), V))
w_v = assemble(interpolate(v, W))
assert np.allclose(w_v.dat.data_ro, 1.)
Expand Down
2 changes: 1 addition & 1 deletion tests/firedrake/vertexonly/test_vertex_only_fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def vectorfunctionspace_tests(vm):
# num_vertices (globally) times. Note that we get a vertex cell for
# each geometric dimension so we have to sum over geometric
# dimension too.
R = VectorFunctionSpace(vm, "R", dim=gdim)
R = VectorFunctionSpace(vm, "R", 0, dim=gdim)
ones = Function(R).assign(1)
f.interpolate(ones)
assert np.isclose(assemble(inner(f, f)*dx), num_cells_mpi_global*gdim)
Expand Down
5 changes: 0 additions & 5 deletions tsfc/fem.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,11 +743,6 @@ def translate_constant_value(terminal, mt, ctx):
def translate_coefficient(terminal, mt, ctx):
domain = extract_unique_domain(terminal)
vec = ctx.coefficient(terminal, mt.restriction)

if terminal.ufl_element().family() == 'Real':
assert mt.local_derivatives == 0
return vec

element = ctx.create_element(terminal.ufl_element(), restriction=mt.restriction)

# Collect FInAT tabulation for all entities
Expand Down
10 changes: 1 addition & 9 deletions tsfc/kernel_interface/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ def coefficient(self, ufl_coefficient, restriction):
kernel_arg = self.coefficient_map[ufl_coefficient]
domain = extract_unique_domain(ufl_coefficient)
assert self._domain_integral_type_map[domain] is not None
if ufl_coefficient.ufl_element().family() == 'Real':
return kernel_arg
elif not self._domain_integral_type_map[domain].startswith("interior_facet"):
if not self._domain_integral_type_map[domain].startswith("interior_facet"):
return kernel_arg
else:
return kernel_arg[{'+': 0, '-': 1}[restriction]]
Expand Down Expand Up @@ -495,12 +493,6 @@ def prepare_coefficient(coefficient, name, domain_integral_type_map):
GEM expression referring to the Coefficient values.

"""
if coefficient.ufl_element().family() == 'Real':
# Constant
value_size = coefficient.ufl_function_space().value_size
expression = gem.reshape(gem.Variable(name, (value_size,)),
coefficient.ufl_shape)
return expression
finat_element = create_element(coefficient.ufl_element())
shape = finat_element.index_shape
size = numpy.prod(shape, dtype=int)
Expand Down
Loading