- changed milestone to 1.6
Multiple implementations of homogenize(bcs)
There are two independent implementations of BC homogenization:
- member
DirichletBC::homogenize()
- Python free function
homogenize(bcs)
They can do something different due to applicable DOFs being cached by DirichletBC on first use which are retained by approach 1 and thrown away by approach 2 (to be constructed again on its first use).
Comments (9)
-
reporter -
reporter - changed status to resolved
-
Hi Jan,
It's crucial for dolfin-adjoint to be able to construct an independent homogenised version of a given boundary condition. (These are the BCs we impose on the adjoint equation.) For that purpose we have been using the free function
homogenize
. However, when I now compile DOLFIN master, I get a deprecation warning.DirichletBC::homogenize
modifies in-place, and the deprecation warning cryptically states that*** Copy construction semantics of DirichletBC is not well defined.
. Hence, to use the method as opposed to the function you want to delete, I have to understand what's wrong with the copy constructor. Can you expand on this? And can we please not delete thehomogenize
method until this is ironed out? -
reporter Ok, let's not delete free
homogenize
until we have a consensus.Previous implementation of free
homogenize
was creating new bc and ad hoc copying some of the member data. This had different copy semantics from memberDirichletBC::homogenize
because there is caching inDirichletBC::compute_bc_*
. When user changes a domain, member version will not feel it because cached dofs will be kept (if already cached after first use) while freehomogenize
was throwing cached dofs away before this change.Now the semantics of both of them is the same hence free version is redundant. Why isn't usage of a member version (possibly in combination with a copy constructor) feasible for you? What exactly do you need to do? What does independent (in your first sentence) means?
-
Ah, I thought from the error message that there was something wrong with the
bc_copy = DirichletBC(bc)
copy constructor.I've tried it out in dolfin-adjoint and using the copy constructor and object method works fine. I've pushed that change to dolfin-adjoint master.
I'm happy for the free function to be removed.
-
reporter Yes, deprecation message is misleading. It reports the state before the fix, rather than current state. Let me fix this.
-
reporter - changed status to open
Fix of misleading deprecation message needed.
-
reporter - changed status to resolved
Fixed by 3f310c8
-
- removed milestone
Removing milestone: 1.6 (automated comment)
- Log in to comment