GithubHelp home page GithubHelp logo

Modal / nodal tracking about meshmode HOT 6 OPEN

inducer avatar inducer commented on August 29, 2024
Modal / nodal tracking

from meshmode.

Comments (6)

inducer avatar inducer commented on August 29, 2024 1

Would this be optional? What I'm thinking of is: e.g., pytential has that granularity stuff that doesn't correspond to the degrees of freedom of any existing group.

Oof, you're right. I mean, in principle it would be easy to make up some unique "discretization keys" for those cases, too. But given that concern, I think I agree that we would likely phase that in gradually, by deprecating the case where no discretization keys are supplied.

from meshmode.

alexfikl avatar alexfikl commented on August 29, 2024

Would it work to introduce some subclassses NodalDOFArray and ModalDOFArray? Then each connection or whatnot can check if it got the right subclass. Some nice side effects

  • the arithmetic in arraycontext checks other.__class__ is cls, so we wouldn't be able to do arithmetic on modal and nodal DOFArrays together by construction
  • typing annotations?
  • easy to inspect by printing the name vs going through the discretization keys.

from meshmode.

inducer avatar inducer commented on August 29, 2024

I agree that using type annotations to check this statically would be appealing.

  • The main difficulty I see with the approach you propose is that, technically, modal-vs-nodal is a per-group decision, and pretending otherwise is (IMO) going to lead to trouble. The first yuckiness I can foresee is having to check all element groups for modal-/nodal-ness... and then do you raise an error if it's not unanimous?
  • Modal vs nodal is also not really the only DOF-changes-meaning problem we might have. Suppose we have two different element groups with identical node counts, but (say) different nodal locations. Right now, nothing prevents passing DOFArrays from one to the other, typically dropping to first order as a result. The `discretization-key tracking might stand a chance at catching these issues before they ruin someone's afternoon.

from meshmode.

alexfikl avatar alexfikl commented on August 29, 2024

The main difficulty I see with the approach you propose is that, technically, modal-vs-nodal is a per-group decision, and pretending otherwise is (IMO) going to lead to trouble. The first yuckiness I can foresee is having to check all element groups for modal-/nodal-ness... and then do you raise an error if it's not unanimous?

What's the usecase for mixing modal and nodal values in the same DOFArray?

Also, if it's a per-group decision, what would passing a mixed DOFArray to a connection do? Would it only work on the groups it can or error out?

Suppose we have two different element groups with identical node counts, but (say) different nodal locations. Right now, nothing prevents passing DOFArrays from one to the other, typically dropping to first order as a result.

Oh yeah, that would be very cool to check somehow!

from meshmode.

inducer avatar inducer commented on August 29, 2024

What's the usecase for mixing modal and nodal values in the same DOFArray?

There's no use case at all! :) I'm not arguing it's a good idea. I'm just saying that, right now, it's each group's decision to say what the DOFs mean. What I'm saying is that enforcing homogeneity in one specific characteristic (modal vs nodal) would require fairly awkward checking logic, and on top of that, it would fall short of quite a few other things that more general and less awkward logic could check. That's why I'm pushing for per-group/discr-key-based logic.

from meshmode.

alexfikl avatar alexfikl commented on August 29, 2024

There's no use case at all! :) I'm not arguing it's a good idea. I'm just saying that, right now, it's each group's decision to say what the DOFs mean. What I'm saying is that enforcing homogeneity in one specific characteristic (modal vs nodal) would require fairly awkward checking logic, and on top of that, it would fall short of quite a few other things that more general and less awkward logic could check. That's why I'm pushing for per-group/discr-key-based logic.

Ah, got it now!

Would this be optional? What I'm thinking of is: e.g., pytential has that granularity stuff that doesn't correspond to the degrees of freedom of any existing group.

from meshmode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.