Hi Daniele,
I've cc'd the hedge mailing list just so this discussion gets
archived. Hope you don't mind.
Daniele Bigoni <dabi(a)imm.dtu.dk> writes:
Rasmus and me have been working on writing (or better
re-writing) the
hedge solve for the wave equation (examples/wave/wave.py and
models/wave.py). We got the most of it, but we also ended up having a
couple of questions.
1) In the op_template of the StrongWaveOperator (with constant velocity)
we found a FIXME when it was time to impose inhomogeneous Dirichlet
boundary conditions. What is wrong with the way you derived them in your
code? The code makes sense to us.
I'm not sure that code works. I'm not even quite sure I know what it
means to enforce an inhomogeneous Dirichlet in characteristic variables,
which is really the only way you're allowed to think about BCs for
hyperbolic systems. If you can convince me that this is the right way
(or come up with a better one), let me know.
2) When we define the operator template
(models/wave.py:172) we were
expecting to have an InverseMassOperator also in the first part, not
only on the flux part. We were expecting something similar to the
following:
----------------------------------------------------
result = (
- InverseMassOperator() * join_fields(
-self.c*numpy.dot(nabla, v),
-self.c*(nabla*u)
)
+ InverseMassOperator() * (
flux_op(w)
+ flux_op(BoundaryPair(w, dir_bc, self.dirichlet_tag))
+ flux_op(BoundaryPair(w, neu_bc, self.neumann_tag))
+ flux_op(BoundaryPair(w, rad_bc, self.radiation_tag))
))
----------------------------------------------------
Is the InverseMassOperator taken care of in the make_nabla(d) function?
Yep, a differentiation matrix has an inverse mass matrix built in, and
make_nabla consists of differentiation matrices.
3) The last question is more out of curiosity. Why is
the bind function
defined in the particular operator and not in the super-class
HyperbolicOperator? Is there any case in which the user might need to
change it?
Compare the bind method of the wave operators with that of the Maxwell
operator in hedge.models.em. That also derives from
HyperbolicOperator. Yet the bind() looks pretty different. That's
why. :)
Andreas