Comments (6)
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.
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
checksother.__class__ is cls
, so we wouldn't be able to do arithmetic on modal and nodalDOFArray
s together by construction - typing annotations?
- easy to inspect by printing the name vs going through the discretization keys.
from meshmode.
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
DOFArray
s 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.
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.
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.
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)
- Pickling DOFArrays loses metadata HOT 1
- Resampling can lead to expressions that index along a 0-long axis HOT 1
- `dim` and `ambient_dim` should be attributes of the mesh
- Remove `FirstAxisIsElementsTag` and related transform infrastructure
- Loopy cache collision in CI HOT 4
- Make it clearer that `default_simplex_group` is not for external use HOT 1
- Performance of `generate_box_mesh` HOT 1
- [Direct Connection] Group Contributions (probably) should not be summed HOT 2
- Mesh check in `make_same_mesh_connection` too strict? HOT 2
- Rename Discretization(Element|Face|AmbientDim|TopologicalDim|DOF)AxisTag -> (Element|Face|AmbientDim|TopologicalDim|DOF)AxisTag? HOT 1
- `libfabric=1.17.0-3` on Debian causes MPI tests to fail with `MPI_ERR_OTHER` HOT 3
- Axis tagging in nodal-to-modal and modal-to-nodal connections HOT 4
- Find, extract elements near a point
- Error when dumping/loading TensorProductElementGroup mesh via pickle HOT 1
- TP element orientation flips on Gmsh read HOT 5
- Failing Firedrake test
- 3d element orientation for hexes HOT 4
- Interface with meshio HOT 9
- Recent update breaks mirgecom HOT 1
- Newest meshmode gmsh ingest chain has some problems HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meshmode.