Skip to content
Snippets Groups Projects
Commit 440866e2 authored by Martin Bauer's avatar Martin Bauer
Browse files

Merge branch 'KernelFunction.fields_written' into 'master'

Add KernelFunction.fields_written

See merge request !33
parents 69f779ea 63de9997
Branches
Tags
1 merge request!33Add KernelFunction.fields_written
Pipeline #17267 passed with stages
in 2 minutes and 38 seconds
......@@ -212,6 +212,10 @@ class KernelFunction(Node):
"""Set of Field instances: fields which are accessed inside this kernel function"""
return set(o.field for o in self.atoms(ResolvedFieldAccess))
def fields_written(self):
assigments = self.atoms(SympyAssignment)
return {a.lhs.field for a in assigments if isinstance(a.lhs, ResolvedFieldAccess)}
def get_parameters(self) -> Sequence['KernelFunction.Parameter']:
"""Returns list of parameters for this function.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment