Skip to content

Out-of-scope k variable usage when updating source terms. #225

@willGraham01

Description

@willGraham01

The variable k is used in the Ksource update loop, with a specific instance here, despite not being a loop variable.

This is only possible since the indexing-variables are declared right at the top of execute(). In the previous two loops (Isource, Jsource), k is a loop variable so this is fine. However in the Ksource update loop only i and j are loop variables. It is only because k is globally scoped that the code compiles: but then we also notice that in this loop the value k is not changing, but is fixed to k = inputs.K1.index, and is still being used to fetch constants from the input matrices!

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority:2Second priority

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions