Replies: 3 comments 4 replies
-
Yes we have separate Qfunctions, for example in this file in Ratel we create stress and other terms but forcing term for MMS is written here. Usually we group all terms that multiply by test function and its gradient as described in the documentation. (we call them f0, f1, g0, g1) |
Beta Was this translation helpful? Give feedback.
-
Another possible way to do it (depending on how into the weeds MOOSE users want to go) is to use If code gen is out of the question, then can create composite |
Beta Was this translation helpful? Give feedback.
-
I think the situation you're considering is like when one part computes a diffusion coefficient and another uses that coefficient (and other inputs) to compute a flux. That is not a libCEED composite operator because those are additive rather than sequential. The fundamental issue is that for GPUs, you pay a lot to use dynamic dispatch and you pay a lot any time you spill intermediate state out of registers (it's basically a spill to global memory because you don't have big and fast L1 cache in the CPU sense). It is possible for you to write a qfunction that uses dynamic dispatch inside, but I don't think you'll like the performance. You can make a sequence of CeedOperators, but I don't think you'll like that performance either (it becomes very memory-intensive) and we don't know how to efficiently assemble operators (because the interface doesn't guarantee that all the intermediates are passed through as "collocated", though I suppose we could learn to recognize that case). I think JIT is a better way to handle this sort of dynamic composition. We might be able to help with that, but would probably need a prototype and to look at the needs of the various backends. |
Beta Was this translation helpful? Give feedback.
-
The design in MOOSE is that each "qfunction" corresponds to one term of a weak form, e.g. we compose an advection-diffusion problem with separate advection and diffusion qfunctions. This makes it very easy for users to compose different physics problems piece-by-piece. Does this design still make sense using libCEED qfunctions? I'm thinking this would correspond to a
CeedOperatorApply
and then a followingCeedOperatorApplyAdd
?Beta Was this translation helpful? Give feedback.
All reactions