Commit d6d843fb authored by Martin Bauer's avatar Martin Bauer
Browse files

Bugfix in equationcollection

parent 791caf42
......@@ -171,13 +171,15 @@ class EquationCollection:
continue # exact the same subexpression equation exists already
# different definition - a new name has to be introduced
newLhs = self.subexpressionSymbolNameGenerator()
newLhs = next(self.subexpressionSymbolNameGenerator)
newEq = sp.Eq(newLhs, fastSubs(otherSubexpressionEq.rhs, substitutionDict))
substitutionDict[otherSubexpressionEq.lhs] = newLhs
processedOtherSubexpressionEquations.append(fastSubs(otherSubexpressionEq, substitutionDict))
return self.copy(self.mainEquations + other.mainEquations,
processedOtherMainEquations = [fastSubs(eq, substitutionDict) for eq in other.mainEquations]
return self.copy(self.mainEquations + processedOtherMainEquations,
self.subexpressions + processedOtherSubexpressionEquations)
def getDependentSymbols(self, symbolSequence):
......@@ -236,6 +236,9 @@ class Field:
"Got %d, expected %d" % (len(idx), self.field.indexDimensions))
return Field.Access(self.field, self._offsets, idx)
def __getitem__(self, *idx):
return self.__call__(*idx)
def field(self):
return self._field
Markdown is supported
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