You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a perfect world one would be able to use AbstractOperations for all output needs. But alas, there is #1241. The discussion on #1234 makes clear that this will continue to be a serious issue. There may also be output that cannot be expressed as an abstract operation.
One work around for advanced users (which may be nice to have anyways) is to design an abstraction for KernelComputedFields that are computed based on a user-supplied kernel. I think usage could be something like (using ViscousDissipation as an example)
In this example viscous_dissipation is then a bonafide field with a fully-fledged compute! function that can be used in output, time-averaging, in an AveragedField, etc.
Users will need to write a kernel with KernelAbstractions language (which we'll have to document and provide examples for), but they won't have to write all the other boilerplate that goes into defining the struct and writing a compute! function (see again ViscousDissipation to get an idea of what this boiler plate looks like).
The kernel can have field_dependencies, which are passed into the KernelComputedField constructor. It also seems nice to pass clock.
The text was updated successfully, but these errors were encountered:
@glwagner I modified the docstring with a small example that I think illustrates the patterns relatively in this commit. I'm assuming that's what you meant by "example", right?
I've tested it already in some simple examples and it produces correct results. Is there anything else left besides testing this with an actual complex calculation that can only be done via KernelComputedField on a GPU?
In a perfect world one would be able to use
AbstractOperations
for all output needs. But alas, there is #1241. The discussion on #1234 makes clear that this will continue to be a serious issue. There may also be output that cannot be expressed as an abstract operation.One work around for advanced users (which may be nice to have anyways) is to design an abstraction for
KernelComputedField
s that are computed based on a user-supplied kernel. I think usage could be something like (usingViscousDissipation
as an example)In this example
viscous_dissipation
is then a bonafide field with a fully-fledgedcompute!
function that can be used in output, time-averaging, in anAveragedField
, etc.Users will need to write a kernel with
KernelAbstractions
language (which we'll have to document and provide examples for), but they won't have to write all the other boilerplate that goes into defining the struct and writing acompute!
function (see againViscousDissipation
to get an idea of what this boiler plate looks like).The kernel can have
field_dependencies
, which are passed into theKernelComputedField
constructor. It also seems nice to passclock
.The text was updated successfully, but these errors were encountered: