@@ -135,29 +135,25 @@ def __init__(self, *meshes, ufl_id=None, cargo=None):
135
135
self ._ufl_cargo = cargo
136
136
if cargo is not None and cargo .ufl_id () != self ._ufl_id :
137
137
raise ValueError ("Expecting cargo object (e.g. dolfin.Mesh) to have the same ufl_id." )
138
- coordinate_element = meshes [0 ]._ufl_coordinate_element
139
- self ._ufl_coordinate_element = coordinate_element
140
- gdim , = coordinate_element .value_shape
141
- tdim = coordinate_element .cell .topological_dimension ()
138
+ if any (isinstance (m , MixedMesh ) for m in meshes ):
139
+ raise NotImplementedError ("Currently component meshes can not include MixedMesh instances" )
140
+ # TODO: Should make a "MixedCell" object here:
141
+ # currently only support single cell type.
142
+ self ._ufl_cell , = set (m .ufl_cell () for m in meshes )
143
+ gdim , = set (m .geometric_dimension () for m in meshes )
144
+ # ReferenceGrad requires topological_dimension of the mixed mesh:
145
+ # set tdim to max topological dim for a general mixed mesh (currently not implemented).
146
+ tdim = max (m .topological_dimension () for m in meshes )
142
147
AbstractDomain .__init__ (self , tdim , gdim )
143
148
self ._meshes = tuple (meshes )
144
149
145
150
def ufl_cargo (self ):
146
151
"""Return carried object that will not be used by UFL."""
147
152
return self ._ufl_cargo
148
153
149
- def ufl_coordinate_element (self ):
150
- """Get the coordinate element."""
151
- return self ._ufl_coordinate_element
152
-
153
154
def ufl_cell (self ):
154
155
"""Get the cell."""
155
- return self ._ufl_coordinate_element .cell
156
-
157
- def is_piecewise_linear_simplex_domain (self ):
158
- """Check if the domain is a piecewise linear simplex."""
159
- ce = self ._ufl_coordinate_element
160
- return ce .embedded_superdegree <= 1 and ce in H1 and self .ufl_cell ().is_simplex ()
156
+ return self ._ufl_cell
161
157
162
158
def __repr__ (self ):
163
159
"""Representation."""
@@ -170,15 +166,15 @@ def __str__(self):
170
166
171
167
def _ufl_hash_data_ (self ):
172
168
"""UFL hash data."""
173
- return (type ( self ) , self ._ufl_id , self . _ufl_coordinate_element )
169
+ return ("MixedMesh" , self ._ufl_id )
174
170
175
171
def _ufl_signature_data_ (self , renumbering ):
176
172
"""UFL signature data."""
177
173
return ("MixedMesh" , tuple (m ._ufl_signature_data_ (renumbering ) for m in self ._meshes ))
178
174
179
175
def _ufl_sort_key_ (self ):
180
176
"""UFL sort key."""
181
- typespecific = (self ._ufl_id , self . _ufl_coordinate_element )
177
+ typespecific = (self ._ufl_id , )
182
178
return (self .geometric_dimension (), self .topological_dimension (),
183
179
"MixedMesh" , typespecific )
184
180
0 commit comments