-
assigned issue to
- edited description
Rename domain_data, domain_id to subdomain_data, subdomain_id (ufl,ffc,dolfin)
There is an unfortunate and nonintuitive naming clash between my new "Domain" class in ufl and the lazy naming of subdomain information using 'domain' in many places.
Of course the subdomain should not be mixed up with the domain, therefore the 'sub' part of the name, so I suggest we rename everywhere that's inconsistent.
A couple of renames to do in UFL which will affect dolfin as well:
dx.domain_data() -> dx.subdomain_data()
dx.domain_id() -> dx.subdomain_id()
In particular note that in many cases this confusing statement will hold:
dx = dx(domain=mesh, domain_data=cellfunction)
assert dx.domain().data() == mesh
assert dx.domain_data() == cellfunction
while this would be more understandable:
dx = dx(domain=mesh, subdomain_data=cellfunction)
assert dx.domain().data() == mesh
assert dx.subdomain_data() == cellfunction
Because previously, subdomain data has been attached to ufl.Measure using the syntax dx[cellfunction], I don't think renaming domain_data to subdomain_data will cause any trouble.
Comments (10)
-
reporter -
reporter I realise this is more of a UFL issue but it affects dolfin and ffc as well.
-
reporter And also there are other places in dolfin which use the name 'domain' where 'subdomain' would be more appropriate. I suggest renaming those as well, even if its only internal variable names, as it causes confusion.
-
reporter And mesh.domains(), that's not right either. But I'd rather see we remove it than rename it, since we're not actually using the mesh.domains() in the assembler.
-
reporter Nobody seems to care, which I guess mean people will probably keep calling subdomains 'domains', and this is a bit of work, so I'll just let it be for now.
-
reporter - changed status to wontfix
-
reporter - changed status to open
-
reporter My last comment here was not quite correct. I have renamed
- domain_id -> subdomain_id
- domain_data -> subdomain_data
- domain_type -> integral_type
in ufl/ffc/dolfin.
However I won't touch e.g. mesh.domains() and misleading local variable names in dolfin python layer.
-
reporter - changed status to resolved
Resolved in dolfin d21d294100 , ffc fbbadf52 , ufl 34a83dc06
-
- removed milestone
Removing milestone: 1.4 (automated comment)
- Log in to comment