diff --git a/.basedpyright/baseline.json b/.basedpyright/baseline.json index 203432843..138aa70cc 100644 --- a/.basedpyright/baseline.json +++ b/.basedpyright/baseline.json @@ -39864,2968 +39864,6 @@ } } ], - "./pytential/symbolic/stokes.py": [ - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 17, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 20, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 20, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 37, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 37, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 45, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 45, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 37, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 37, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 64, - "endColumn": 82, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 54, - "endColumn": 70, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 75, - "endColumn": 81, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 37, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 37, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 64, - "endColumn": 82, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 54, - "endColumn": 70, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 75, - "endColumn": 81, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 29, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 29, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 46, - "endColumn": 52, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 46, - "endColumn": 52, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 54, - "endColumn": 70, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 54, - "endColumn": 70, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 32, - "endColumn": 66, - "lineCount": 2 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 54, - "endColumn": 72, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 49, - "endColumn": 65, - "lineCount": 1 - } - }, - { - "code": "reportPossiblyUnboundVariable", - "range": { - "startColumn": 27, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 32, - "endColumn": 66, - "lineCount": 2 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 54, - "endColumn": 72, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 49, - "endColumn": 65, - "lineCount": 1 - } - }, - { - "code": "reportPossiblyUnboundVariable", - "range": { - "startColumn": 15, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 31, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 31, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 42, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 42, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 29, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 29, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 37, - "endColumn": 53, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 37, - "endColumn": 53, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 53, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 41, - "endColumn": 55, - "lineCount": 4 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 55, - "endColumn": 80, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 55, - "endColumn": 80, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 45, - "endColumn": 63, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 62, - "endColumn": 78, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 48, - "endColumn": 54, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 41, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 45, - "endColumn": 55, - "lineCount": 4 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 59, - "endColumn": 84, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 59, - "endColumn": 84, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 45, - "endColumn": 63, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 62, - "endColumn": 78, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 48, - "endColumn": 54, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 27, - "endColumn": 42, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 27, - "endColumn": 42, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 44, - "endColumn": 55, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 44, - "endColumn": 55, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 24, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 24, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 32, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 32, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 37, - "endColumn": 71, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 37, - "endColumn": 71, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 37, - "endColumn": 55, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 54, - "endColumn": 70, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 75, - "endColumn": 81, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 48, - "endColumn": 82, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 48, - "endColumn": 82, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 48, - "endColumn": 66, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 65, - "endColumn": 81, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 51, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 17, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 20, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 20, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 37, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 37, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 50, - "endColumn": 56, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 50, - "endColumn": 56, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 58, - "endColumn": 74, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 58, - "endColumn": 74, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 37, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 37, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 37, - "endColumn": 72, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 54, - "endColumn": 70, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 75, - "endColumn": 81, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 48, - "endColumn": 73, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 48, - "endColumn": 73, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 48, - "endColumn": 83, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 65, - "endColumn": 81, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 51, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 29, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 29, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 46, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 46, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 59, - "endColumn": 65, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 59, - "endColumn": 65, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 67, - "endColumn": 83, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 67, - "endColumn": 83, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 14, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 16, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 33, - "endColumn": 71, - "lineCount": 3 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 37, - "endColumn": 72, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 54, - "endColumn": 70, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 16, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportPossiblyUnboundVariable", - "range": { - "startColumn": 27, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 39, - "endColumn": 79, - "lineCount": 3 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 45, - "endColumn": 80, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 62, - "endColumn": 78, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportPossiblyUnboundVariable", - "range": { - "startColumn": 15, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 31, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 31, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 42, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 42, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 59, - "endColumn": 70, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 59, - "endColumn": 70, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 29, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 29, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 37, - "endColumn": 53, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 37, - "endColumn": 53, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 53, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 37, - "endColumn": 50, - "lineCount": 4 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 51, - "endColumn": 76, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 51, - "endColumn": 76, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 40, - "endColumn": 75, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 57, - "endColumn": 73, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 43, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 40, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 40, - "endColumn": 54, - "lineCount": 4 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 54, - "endColumn": 79, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 54, - "endColumn": 79, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 44, - "endColumn": 79, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 61, - "endColumn": 77, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 47, - "endColumn": 53, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 27, - "endColumn": 42, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 27, - "endColumn": 42, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 44, - "endColumn": 58, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 44, - "endColumn": 58, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 60, - "endColumn": 71, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 60, - "endColumn": 71, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 24, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 24, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 32, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 32, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 36, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 61, - "endColumn": 76, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 37, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 53, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 61, - "endColumn": 77, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 51, - "endColumn": 70, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 44, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 61, - "endColumn": 75, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 44, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 52, - "endColumn": 68, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 36, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 36, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 46, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 46, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 11, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 30, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 41, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 32, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 32, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 33, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 33, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 41, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 41, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 45, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 45, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 33, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 33, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 41, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 41, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 45, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 45, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 33, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 33, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 45, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 45, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 24, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 24, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 28, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 28, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 30, - "endColumn": 46, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 48, - "endColumn": 56, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 48, - "endColumn": 56, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 16, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 16, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 33, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 24, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 24, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 31, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 31, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 39, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 39, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 43, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 43, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 33, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 51, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 51, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 61, - "endColumn": 66, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 33, - "endColumn": 84, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 50, - "endColumn": 66, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 68, - "endColumn": 76, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 68, - "endColumn": 76, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 78, - "endColumn": 83, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 36, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 43, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 51, - "endColumn": 53, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 33, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 12, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 16, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 18, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 39, - "endColumn": 53, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 55, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 22, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 32, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 32, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 58, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 19, - "endColumn": 33, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 34, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportIncompatibleMethodOverride", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 33, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 33, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 41, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 41, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 82, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 22, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 42, - "endColumn": 56, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 57, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 64, - "endColumn": 70, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 72, - "endColumn": 74, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportIncompatibleMethodOverride", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 33, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 33, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 41, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 41, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 45, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 17, - "lineCount": 4 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 17, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 32, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 18, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 33, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 40, - "endColumn": 46, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 48, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportIncompatibleMethodOverride", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 33, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 33, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 41, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 41, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 45, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 24, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 24, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 31, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 31, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 39, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 39, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 43, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 43, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 12, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 35, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 36, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 43, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 51, - "endColumn": 53, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 33, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 36, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 43, - "endColumn": 45, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 33, - "endColumn": 53, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 22, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportIncompatibleMethodOverride", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 33, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 33, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 41, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 41, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 82, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 22, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 42, - "endColumn": 56, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 57, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 64, - "endColumn": 70, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 72, - "endColumn": 74, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportIncompatibleMethodOverride", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 33, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 33, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 41, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 41, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 45, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 67, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 16, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 31, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 38, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 46, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportIncompatibleMethodOverride", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 33, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 33, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 41, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 41, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 45, - "endColumn": 61, - "lineCount": 1 - } - } - ], "./pytential/target.py": [ { "code": "reportUnannotatedClassAttribute", diff --git a/experiments/stokes-2d-interior.py b/experiments/stokes-2d-interior.py index f91a9bd88..c50546c62 100644 --- a/experiments/stokes-2d-interior.py +++ b/experiments/stokes-2d-interior.py @@ -89,7 +89,7 @@ def get_obj_array(obj_array): stresslet_obj = StressletWrapper(dim=2) # Describe boundary operator - bdry_op_sym = loc_sign * 0.5 * sigma_sym + sqrt_w * stresslet_obj.apply(inv_sqrt_w_sigma, nvec_sym, mu_sym, qbx_forced_limit='avg') + bdry_op_sym = loc_sign * 0.5 * sigma_sym + sqrt_w * stresslet_obj.apply(inv_sqrt_w_sigma, nvec_sym, mu_sym=mu_sym, qbx_forced_limit='avg') # Bind to the qbx discretization bound_op = bind(qbx, bdry_op_sym) @@ -139,7 +139,7 @@ def couette_soln(x, y, dp, h): sigma = gmres_result.solution # Describe representation of solution for evaluation in domain - representation_sym = stresslet_obj.apply(inv_sqrt_w_sigma, nvec_sym, mu_sym, qbx_forced_limit=-2) + representation_sym = stresslet_obj.apply(inv_sqrt_w_sigma, nvec_sym, mu_sym=mu_sym, qbx_forced_limit=-2) from sumpy.visualization import FieldPlotter nsamp = 10 @@ -193,7 +193,7 @@ def stride_hack(arr): print("exact velocity at max error points: x -> ", err[0][max_error_loc[0]], ", y -> ", err[1][max_error_loc[1]]) from pytential.symbolic.mappers import DerivativeTaker - rep_pressure = stresslet_obj.apply_pressure(inv_sqrt_w_sigma, nvec_sym, mu_sym, qbx_forced_limit=-2) + rep_pressure = stresslet_obj.apply_pressure(inv_sqrt_w_sigma, nvec_sym, mu_sym=mu_sym, qbx_forced_limit=-2) pressure = bind((qbx, PointsTarget(eval_points_dev)), rep_pressure)(queue, sigma=sigma, mu=mu, normal=normal) pressure = pressure.get() @@ -206,7 +206,7 @@ def stride_hack(arr): x_dir_vecs = cl.array.to_device(queue, x_dir_vecs) y_dir_vecs = cl.array.to_device(queue, y_dir_vecs) dir_vec_sym = sym.make_sym_vector("force_direction", dim) - rep_stress = stresslet_obj.apply_stress(inv_sqrt_w_sigma, nvec_sym, dir_vec_sym, mu_sym, qbx_forced_limit=-2) + rep_stress = stresslet_obj.apply_stress(inv_sqrt_w_sigma, nvec_sym, dir_vec_sym, mu_sym=mu_sym, qbx_forced_limit=-2) applied_stress_x = bind((qbx, PointsTarget(eval_points_dev)), rep_stress)(queue, sigma=sigma, normal=normal, force_direction=x_dir_vecs, mu=mu) diff --git a/pytential/symbolic/primitives.py b/pytential/symbolic/primitives.py index 02e075ea6..b3cf23145 100644 --- a/pytential/symbolic/primitives.py +++ b/pytential/symbolic/primitives.py @@ -54,6 +54,7 @@ Variable as var, cse_scope as cse_scope_base, expr_dataclass, + flattened_product, make_common_subexpression as cse, make_sym_vector, ) @@ -67,7 +68,7 @@ ShapeT, from_numpy, ) -from sumpy.kernel import ScalarKernel +from sumpy.kernel import ScalarKernel, SystemKernel from sumpy.symbolic import SpatialConstant from pytential.symbolic.dof_desc import ( @@ -451,6 +452,11 @@ def make_stringifier( return StringifyMapper() +@expr_dataclass() +class NamedIntermediateResult(Variable): + """Internal variables used by ``pytential.compiler``.""" + + Operand: TypeAlias = ( ArithmeticExpression | ObjectArrayND[ArithmeticExpression] @@ -466,6 +472,7 @@ def make_stringifier( MultiVector[ArithmeticExpression], Operand) + Side: TypeAlias = Literal[-1, 1] QBXForcedLimit: TypeAlias = Literal[-2, -1, +1, +2, "avg"] | None @@ -510,10 +517,7 @@ def func(operand_i: ArithmeticExpression) -> ArithmeticExpression: # }}} -@expr_dataclass() -class NamedIntermediateResult(Variable): - """Internal variables used by ``pytential.compiler``.""" - +# {{{ diagonistics @expr_dataclass() class ErrorExpression(ExpressionNode): @@ -526,6 +530,10 @@ class ErrorExpression(ExpressionNode): message: str """The error message to raise when this expression is encountered.""" +# }}} + + +# {{{ placeholders def make_sym_mv(name: str, num_components: int) -> MultiVector[ArithmeticExpression]: return MultiVector(make_sym_vector(name, num_components)) @@ -544,6 +552,10 @@ def make_sym_surface_mv( * cse(MultiVector(vec), f"tangent{i}", cse_scope.DISCRETIZATION) for i, vec in enumerate(par_grad.T)) +# }}} + + +# {{{ functions @expr_dataclass() class Function(Variable): @@ -616,6 +628,8 @@ class NumpyMathFunction(Function): exp = NumpyMathFunction("exp") log = NumpyMathFunction("log") +# }}} + # {{{ discretization properties @@ -1406,105 +1420,7 @@ def weights_and_area_elements( # }}} -# {{{ operators - -@expr_dataclass() -class Interpolation(ExpressionNode): - """Interpolate quantity from a DOF described by *from_dd* to a DOF - described by *to_dd*." - - .. autoattribute:: from_dd - .. autoattribute:: to_dd - .. autoattribute:: operand - """ - - from_dd: DOFDescriptor - """A descriptor for the geometry on which *operand* is defined.""" - to_dd: DOFDescriptor - """A descriptor for the geometry to which to interpolate *operand* to.""" - operand: ArithmeticExpression - """An expression or array of expressions to interpolate. Arrays are - interpolated componentwise. - """ - - def __new__(cls, - from_dd: DOFDescriptorLike, - to_dd: DOFDescriptorLike, - operand: OperandTc) -> Interpolation | OperandTc: - from_dd = as_dofdesc(from_dd) - to_dd = as_dofdesc(to_dd) - - if from_dd == to_dd: - return operand - - if isinstance(operand, ObjectArray | MultiVector): - warn(f"Passing {type(operand)} directly to {cls.__name__!r} " - "is deprecated and will result in an error from 2025. Use " - "the 'interpolate' function instead.", - DeprecationWarning, stacklevel=3) - - def make_op(operand_i: ArithmeticExpression) -> ArithmeticExpression: - return cls(from_dd, to_dd, operand_i) - - return componentwise(make_op, operand) - else: - return ExpressionNode.__new__(cls) - - def __post_init__(self) -> None: - if not isinstance(self.from_dd, DOFDescriptor): - warn("Passing a 'from_dd' that is not a 'DOFDescriptor' to " - f"{type(self).__name__!r} is deprecated and will stop working " - "in 2025. Use 'as_dofdesc' to convert the descriptor.", - DeprecationWarning, stacklevel=2) - - object.__setattr__(self, "from_dd", as_dofdesc(self.from_dd)) - - if not isinstance(self.to_dd, DOFDescriptor): - warn("Passing a 'to_dd' that is not a 'DOFDescriptor' to " - f"{type(self).__name__!r} is deprecated and will stop working " - "in 2025. Use 'as_dofdesc' to convert the descriptor.", - DeprecationWarning, stacklevel=2) - - object.__setattr__(self, "to_dd", as_dofdesc(self.to_dd)) - - -@for_each_expression -def interpolate(operand: ArithmeticExpression, - from_dd: DOFDescriptorLike, - to_dd: DOFDescriptorLike) -> ArithmeticExpression: - from_dd = as_dofdesc(from_dd) - to_dd = as_dofdesc(to_dd) - - if from_dd == to_dd: - return operand - - if to_dd.granularity == GRANULARITY_CENTER: - raise ValueError("use _interleave to attain GRANULARITY_CENTER") - - return Interpolation(from_dd, to_dd, operand) - - -# purposefully undocumented, only for use in interleaved_centers. -@expr_dataclass() -class Interleave(ExpressionNode): - from_dd: DOFDescriptor - operand_1: ArithmeticExpression - operand_2: ArithmeticExpression - - @property - def to_dd(self): - return self.from_dd.copy(granularity=GRANULARITY_CENTER) - - -def interleave( - operand_1: ArithmeticExpression, - operand_2: ArithmeticExpression, - from_dd: DOFDescriptorLike = None) -> ArithmeticExpression: - dof_desc = as_dofdesc(from_dd) - if dof_desc.granularity != GRANULARITY_NODE: - raise ValueError("can only interleave from node granularity") - - return Interleave(dof_desc, operand_1, operand_2) +# {{{ elementary numerics @expr_dataclass() @@ -1749,6 +1665,113 @@ def __post_init__(self) -> None: object.__setattr__(self, "dofdesc", as_dofdesc(self.dofdesc)) +# }}} + + +# {{{ operators + +@expr_dataclass() +class Interpolation(ExpressionNode): + """Interpolate quantity from a DOF described by *from_dd* to a DOF + described by *to_dd*." + + .. autoattribute:: from_dd + .. autoattribute:: to_dd + .. autoattribute:: operand + """ + + from_dd: DOFDescriptor + """A descriptor for the geometry on which *operand* is defined.""" + to_dd: DOFDescriptor + """A descriptor for the geometry to which to interpolate *operand* to.""" + operand: ArithmeticExpression + """An expression or array of expressions to interpolate. Arrays are + interpolated componentwise. + """ + + def __new__(cls, + from_dd: DOFDescriptorLike, + to_dd: DOFDescriptorLike, + operand: OperandTc) -> Interpolation | OperandTc: + from_dd = as_dofdesc(from_dd) + to_dd = as_dofdesc(to_dd) + + if from_dd == to_dd: + return operand + + if isinstance(operand, ObjectArray | MultiVector): + warn(f"Passing {type(operand)} directly to {cls.__name__!r} " + "is deprecated and will result in an error from 2025. Use " + "the 'interpolate' function instead.", + DeprecationWarning, stacklevel=3) + + def make_op(operand_i: ArithmeticExpression) -> ArithmeticExpression: + return cls(from_dd, to_dd, operand_i) + + return componentwise(make_op, operand) + else: + return ExpressionNode.__new__(cls) + + def __post_init__(self) -> None: + if not isinstance(self.from_dd, DOFDescriptor): + warn("Passing a 'from_dd' that is not a 'DOFDescriptor' to " + f"{type(self).__name__!r} is deprecated and will stop working " + "in 2025. Use 'as_dofdesc' to convert the descriptor.", + DeprecationWarning, stacklevel=2) + + object.__setattr__(self, "from_dd", as_dofdesc(self.from_dd)) + + if not isinstance(self.to_dd, DOFDescriptor): + warn("Passing a 'to_dd' that is not a 'DOFDescriptor' to " + f"{type(self).__name__!r} is deprecated and will stop working " + "in 2025. Use 'as_dofdesc' to convert the descriptor.", + DeprecationWarning, stacklevel=2) + + object.__setattr__(self, "to_dd", as_dofdesc(self.to_dd)) + + +@for_each_expression +def interpolate(operand: ArithmeticExpression, + from_dd: DOFDescriptorLike, + to_dd: DOFDescriptorLike) -> ArithmeticExpression: + from_dd = as_dofdesc(from_dd) + to_dd = as_dofdesc(to_dd) + + if from_dd == to_dd: + return operand + + if to_dd.granularity == GRANULARITY_CENTER: + raise ValueError("use _interleave to attain GRANULARITY_CENTER") + + return Interpolation(from_dd, to_dd, operand) + + +# purposefully undocumented, only for use in interleaved_centers. +@expr_dataclass() +class Interleave(ExpressionNode): + from_dd: DOFDescriptor + operand_1: ArithmeticExpression + operand_2: ArithmeticExpression + + @property + def to_dd(self): + return self.from_dd.copy(granularity=GRANULARITY_CENTER) + + +def interleave( + operand_1: ArithmeticExpression, + operand_2: ArithmeticExpression, + from_dd: DOFDescriptorLike = None) -> ArithmeticExpression: + dof_desc = as_dofdesc(from_dd) + if dof_desc.granularity != GRANULARITY_NODE: + raise ValueError("can only interleave from node granularity") + + return Interleave(dof_desc, operand_1, operand_2) + +# }}} + + +# {{{ geometric calculus class Derivative(DerivativeBase): """A symbolic derivative. @@ -1835,6 +1858,8 @@ def laplace(ambient_dim: int, operand: ArithmeticExpression) -> ArithmeticExpres | d(d.resolve(nabla * d(operand))) ).as_scalar() +# }}} + # {{{ potentials @@ -2180,13 +2205,6 @@ def add_dir_vector_to_kernel_arguments(coeff: ArithmeticExpression) -> Operand: density = cse(density) return (dsource*nabla).map(add_dir_vector_to_kernel_arguments) -# }}} - - -# {{{ non-dimension-specific operators - -# {{{ geometric calculus - class _unspecified: # ruff:ignore[invalid-class-name] pass @@ -2439,7 +2457,89 @@ def Dp( # }}} -# }}} + +# {{{ system potentials + + +def int_g_system( + spec: str, + kernel: SystemKernel | ObjectArrayND[ScalarKernel], + density: ObjectArray1D[ArithmeticExpression], + *directions: ObjectArray1D[ArithmeticExpression], + qbx_forced_limit: QBXForcedLimit | None = None, + source: DOFDescriptorLike | None = None, + target: DOFDescriptorLike | None = None, + kernel_arguments: KernelArgumentLike | None = None, +) -> ObjectArrayND[ArithmeticExpression]: + if kernel_arguments is None: + kernel_arguments = constantdict() + else: + kernel_arguments = constantdict(kernel_arguments) + + if "->" not in spec: + raise ValueError(f"'spec' must contain '->': {spec!r}") + + lhs, rhs = spec.split("->") + in_inames = tuple(arg.strip() for arg in lhs.split(",")) + out_inames = rhs.strip() + + if len(in_inames) != len(directions) + 2: + raise ValueError( + f"number of arguments should match the number of arg specs: {lhs!r}: " + f"got {len(directions) + 2} args and {len(in_inames)} arg specs" + ) + + if len(out_inames) != len(set(out_inames)): + raise ValueError(f"right-hand side must contain unique indices: {out_inames!r}") + + if len(in_inames[0]) != kernel.ndim: + raise ValueError( + f"kernel indices {in_inames[0]!r} do not match shape {kernel.shape}" + ) + + # build sizes + sizes: dict[str, int] = {} + shapes = (kernel.shape, density.shape, *(d.shape for d in directions)) + for inames, shape in zip(in_inames, shapes, strict=True): + for iname, size in zip(inames, shape, strict=True): + sizes[iname] = size + + # get kernel components + from itertools import product + + if isinstance(kernel, SystemKernel): + knl = np.empty(kernel.shape, dtype=object) + for k_idx in np.ndindex(*kernel.shape): + knl[k_idx] = kernel[k_idx] + else: + knl = kernel + + # einsum + operands = (knl, density, *directions) + contractions = {iname: n for iname, n in sizes.items() if iname not in out_inames} + + result = np.zeros(tuple(sizes[iname] for iname in out_inames), dtype=object) + for o_idx in product(*(range(n) for n in result.shape)): + idx = dict(zip(out_inames, o_idx, strict=True)) + + term = 0 + for c_idx in product(*(range(n) for n in contractions.values())): + idx.update(zip(contractions, c_idx, strict=True)) + i_operands = [ + operand[tuple(idx[iname] for iname in inames)] + for operand, inames in zip(operands, in_inames, strict=True) + ] + + term += int_g_vec( + cast("ScalarKernel", i_operands[0]), + flattened_product(i_operands[1:]), + qbx_forced_limit=qbx_forced_limit, + source=source, target=target, + kernel_arguments=kernel_arguments, + ) + result[o_idx] = term + + return from_numpy(result, ArithmeticExpression) # }}} diff --git a/pytential/symbolic/stokes.py b/pytential/symbolic/stokes.py index 7c7f71f11..5f222c72b 100644 --- a/pytential/symbolic/stokes.py +++ b/pytential/symbolic/stokes.py @@ -23,17 +23,27 @@ THE SOFTWARE. """ +from abc import ABC, abstractmethod +from typing import TYPE_CHECKING + import numpy as np +from typing_extensions import override +from pymbolic.typing import ArithmeticExpression +from pytools.obj_array import ObjectArray1D, from_numpy from sumpy.kernel import ( + AxisTargetDerivative, LaplaceKernel, - StokesletComponentKernel, - StressletComponentKernel, + StokesletSystemKernel, + StressletSystemKernel, ) from pytential import sym +if TYPE_CHECKING: + from pytential.symbolic.primitives import QBXForcedLimit, Side + __doc__ = """ .. autoclass:: StokesletWrapper .. autoclass:: StressletWrapper @@ -43,36 +53,29 @@ .. autoclass:: HebekerExteriorStokesOperator """ +Vector = ObjectArray1D[ArithmeticExpression] + # {{{ StokesletWrapper class StokesletWrapper: - """Wrapper class for the :class:`~sumpy.kernel.StokesletComponentKernel` kernel. - - This class is meant to shield the user from the messiness of writing - out every term in the expansion of the double-indexed Stokeslet kernel - applied to the density vector. The object is created - to do some of the set-up and bookkeeping once, rather than every - time we want to create a symbolic expression based on the kernel -- say, - once when we solve for the density, and once when we want a symbolic - representation for the solution, for example. - - The :meth:`apply` function returns the integral expressions needed for - the vector velocity resulting from convolution with the vector density, - and is meant to work similarly to calling - :func:`~pytential.symbolic.primitives.S` (which is - :class:`~pytential.symbolic.primitives.IntG`). - - Similar functions are available for other useful things related to + """Wrapper class for the :class:`~sumpy.kernel.StokesletSystemKernel` kernel. + + This class is meant to shield the user from the messiness of writing out + every term in the expansion of the double-indexed Stokeslet kernel applied + to the density vector. + + The :meth:`apply` function returns the integral expressions needed for the + vector velocity resulting from convolution with the vector density, and is + meant to work similarly to calling :func:`~pytential.symbolic.primitives.S` + (which returns a :class:`~pytential.symbolic.primitives.IntG`). + + Similar functions are available for other useful variables related to the flow: :meth:`apply_pressure`, :meth:`apply_derivative` (target derivative), - :meth:`apply_stress` (applies symmetric viscous stress tensor in + :meth:`apply_stress` (applies the symmetric viscous stress tensor in the requested direction). - .. attribute:: kernel_dict - - The dictionary allows us to exploit symmetry -- that - :math:`S_{01}` is identical to :math:`S_{10}` -- and avoid creating - multiple expansions for the same kernel in a different ordering. + .. autoattribute:: dim .. automethod:: __init__ .. automethod:: apply @@ -83,87 +86,75 @@ class StokesletWrapper: dim: int - def __init__(self, dim: int): - self.dim = dim + stokeslet: StokesletSystemKernel + stresslet: StressletSystemKernel - if dim == 2: - self.kernel_dict = { - (2, 0): StokesletComponentKernel(dim=2, icomp=0, jcomp=0), - (1, 1): StokesletComponentKernel(dim=2, icomp=0, jcomp=1), - (0, 2): StokesletComponentKernel(dim=2, icomp=1, jcomp=1) - } - elif dim == 3: - self.kernel_dict = { - (2, 0, 0): StokesletComponentKernel(dim=3, icomp=0, jcomp=0), - (1, 1, 0): StokesletComponentKernel(dim=3, icomp=0, jcomp=1), - (1, 0, 1): StokesletComponentKernel(dim=3, icomp=0, jcomp=2), - (0, 2, 0): StokesletComponentKernel(dim=3, icomp=1, jcomp=1), - (0, 1, 1): StokesletComponentKernel(dim=3, icomp=1, jcomp=2), - (0, 0, 2): StokesletComponentKernel(dim=3, icomp=2, jcomp=2) - } - else: - raise ValueError(f"unsupported dimension given to StokesletWrapper: {dim}") - - def apply(self, density_vec_sym, mu_sym, qbx_forced_limit): - """Symbolic expressions for integrating Stokeslet kernel. + def __init__(self, dim: int) -> None: + self.dim = dim + self.stokeslet = StokesletSystemKernel(dim) + self.stresslet = StressletSystemKernel(dim) + + def apply( + self, + density_vec_sym: ObjectArray1D[ArithmeticExpression], + *, + mu_sym: ArithmeticExpression | None = None, + qbx_forced_limit: QBXForcedLimit | None = None, + ) -> ObjectArray1D[ArithmeticExpression]: + """Symbolic expressions for integrating the Stokeslet kernel. Returns an object array of symbolic expressions for the vector - resulting from integrating the dyadic Stokeslet kernel with - variable *density_vec_sym*. + resulting from integrating the dyadic Stokeslet kernel with the + *density_vec_sym*. - :arg density_vec_sym: a symbolic vector variable for the density vector. :arg mu_sym: a symbolic variable for the viscosity. :arg qbx_forced_limit: the *qbx_forced_limit* argument to be passed on to :class:`~pytential.symbolic.primitives.IntG`. """ - - sym_expr = np.empty((self.dim,), dtype=object) - - for comp in range(self.dim): - - # Start variable count for kernel with 1 for the requested result - # component - base_count = np.zeros(self.dim, dtype=np.int32) - base_count[comp] += 1 - - for i in range(self.dim): - var_ctr = base_count.copy() - var_ctr[i] += 1 - ctr_key = tuple(var_ctr) - - if i < 1: - sym_expr[comp] = sym.int_g_vec( - self.kernel_dict[ctr_key], density_vec_sym[i], - qbx_forced_limit=qbx_forced_limit, mu=mu_sym) - - else: - sym_expr[comp] = sym_expr[comp] + sym.int_g_vec( - self.kernel_dict[ctr_key], density_vec_sym[i], - qbx_forced_limit=qbx_forced_limit, mu=mu_sym) - - return sym_expr - - def apply_pressure(self, density_vec_sym, mu_sym, qbx_forced_limit): + if mu_sym is None: + mu_sym = sym.SpatialConstant("mu") + + from itertools import product + sym_expr = np.zeros((self.dim,), dtype=object) + + for comp, i in product(range(self.dim), repeat=2): + sym_expr[comp] += sym.int_g_vec( + self.stokeslet[comp, i], + density_vec_sym[i], + qbx_forced_limit=qbx_forced_limit, + mu=mu_sym, + ) + + return from_numpy(sym_expr, ArithmeticExpression) + + def apply_pressure( + self, + density_vec_sym: ObjectArray1D[ArithmeticExpression], + *, + mu_sym: ArithmeticExpression | None = None, + qbx_forced_limit: QBXForcedLimit | None = None, + ) -> ArithmeticExpression: """Symbolic expression for pressure field associated with the Stokeslet.""" - from pytential.symbolic.mappers import DerivativeTaker kernel = LaplaceKernel(dim=self.dim) + sym_expr = 0 for i in range(self.dim): - - if i < 1: - sym_expr = DerivativeTaker(i).map_int_g( - sym.int_g_vec(kernel, density_vec_sym[i], - qbx_forced_limit=qbx_forced_limit)) - else: - sym_expr = sym_expr + (DerivativeTaker(i).map_int_g( - sym.int_g_vec(kernel, density_vec_sym[i], - qbx_forced_limit=qbx_forced_limit))) + sym_expr += sym.int_g_vec( + AxisTargetDerivative(i, kernel), + density_vec_sym[i], + qbx_forced_limit=qbx_forced_limit) return sym_expr - def apply_derivative(self, deriv_dir, density_vec_sym, - mu_sym, qbx_forced_limit): + def apply_derivative( + self, + deriv_dir: int, + density_vec_sym: ObjectArray1D[ArithmeticExpression], + *, + mu_sym: ArithmeticExpression | None = None, + qbx_forced_limit: QBXForcedLimit | None = None, + ) -> ObjectArray1D[ArithmeticExpression]: """Symbolic derivative of velocity from Stokeslet. Returns an object array of symbolic expressions for the vector @@ -176,42 +167,30 @@ def apply_derivative(self, deriv_dir, density_vec_sym, :arg qbx_forced_limit: the *qbx_forced_limit* argument to be passed on to :class:`~pytential.symbolic.primitives.IntG`. """ - - from pytential.symbolic.mappers import DerivativeTaker - - sym_expr = np.empty((self.dim,), dtype=object) - - for comp in range(self.dim): - - # Start variable count for kernel with 1 for the requested result - # component - base_count = np.zeros(self.dim, dtype=np.int32) - base_count[comp] += 1 - - for i in range(self.dim): - var_ctr = base_count.copy() - var_ctr[i] += 1 - ctr_key = tuple(var_ctr) - - if i < 1: - sym_expr[comp] = DerivativeTaker(deriv_dir).map_int_g( - sym.int_g_vec(self.kernel_dict[ctr_key], - density_vec_sym[i], - qbx_forced_limit=qbx_forced_limit, - mu=mu_sym)) - - else: - sym_expr[comp] = sym_expr[comp] + DerivativeTaker( - deriv_dir).map_int_g( - sym.int_g_vec(self.kernel_dict[ctr_key], - density_vec_sym[i], - qbx_forced_limit=qbx_forced_limit, - mu=mu_sym)) - - return sym_expr - - def apply_stress(self, density_vec_sym, dir_vec_sym, - mu_sym, qbx_forced_limit): + if mu_sym is None: + mu_sym = sym.SpatialConstant("mu") + + from itertools import product + sym_expr = np.zeros((self.dim,), dtype=object) + + for comp, i in product(range(self.dim), repeat=2): + sym_expr[comp] += sym.int_g_vec( + AxisTargetDerivative(deriv_dir, self.stokeslet[comp, i]), + density_vec_sym[i], + qbx_forced_limit=qbx_forced_limit, + mu=mu_sym, + ) + + return from_numpy(sym_expr, ArithmeticExpression) + + def apply_stress( + self, + density_vec_sym: ObjectArray1D[ArithmeticExpression], + dir_vec_sym: ObjectArray1D[ArithmeticExpression], + *, + mu_sym: ArithmeticExpression | None = None, + qbx_forced_limit: QBXForcedLimit | None = None, + ) -> ObjectArray1D[ArithmeticExpression]: r"""Symbolic expression for viscous stress applied to a direction. Returns a vector of symbolic expressions for the force resulting @@ -223,11 +202,11 @@ def apply_stress(self, density_vec_sym, dir_vec_sym, applied in the direction of *dir_vec_sym*. - Note that this computation is very similar to computing - a double-layer potential with the Stresslet kernel in - :class:`StressletWrapper`. The difference is that here the direction - vector is applied at the target points, while in the Stresslet the - direction is applied at the source points. + Note that this computation is very similar to computing a double-layer + potential with the Stresslet kernel in :class:`StressletWrapper`. The + difference is that here the direction vector is applied at the target + points, while in the Stresslet the direction is applied at the source + points. :arg density_vec_sym: a symbolic vector variable for the density vector. :arg dir_vec_sym: a symbolic vector for the application direction. @@ -235,39 +214,21 @@ def apply_stress(self, density_vec_sym, dir_vec_sym, :arg qbx_forced_limit: the *qbx_forced_limit* argument to be passed on to :class:`~pytential.symbolic.primitives.IntG`. """ + if mu_sym is None: + mu_sym = sym.SpatialConstant("mu") - import itertools - - sym_expr = np.empty((self.dim,), dtype=object) - stresslet_obj = StressletWrapper(dim=self.dim) - - for comp in range(self.dim): + from itertools import product + sym_expr = np.zeros((self.dim,), dtype=object) - # Start variable count for kernel with 1 for the requested result - # component - base_count = np.zeros(self.dim, dtype=np.int32) - base_count[comp] += 1 - - for i, j in itertools.product(range(self.dim), range(self.dim)): - var_ctr = base_count.copy() - var_ctr[i] += 1 - var_ctr[j] += 1 - ctr_key = tuple(var_ctr) - - if i + j < 1: - sym_expr[comp] = dir_vec_sym[i] * sym.int_g_vec( - stresslet_obj.kernel_dict[ctr_key], - density_vec_sym[j], - qbx_forced_limit=qbx_forced_limit, mu=mu_sym) - - else: - sym_expr[comp] = sym_expr[comp] + dir_vec_sym[i] * sym.int_g_vec( - stresslet_obj.kernel_dict[ctr_key], - density_vec_sym[j], - qbx_forced_limit=qbx_forced_limit, - mu=mu_sym) + for comp, i, j in product(range(self.dim), repeat=3): + sym_expr[comp] += dir_vec_sym[i] * sym.int_g_vec( + self.stresslet[comp, i, j], + density_vec_sym[j], + qbx_forced_limit=qbx_forced_limit, + mu=mu_sym, + ) - return sym_expr + return from_numpy(sym_expr, ArithmeticExpression) # }}} @@ -275,31 +236,14 @@ def apply_stress(self, density_vec_sym, dir_vec_sym, # {{{ StressletWrapper class StressletWrapper: - """Wrapper class for the :class:`~sumpy.kernel.StressletComponentKernel` kernel. - - This class is meant to shield the user from the messiness of writing - out every term in the expansion of the triple-indexed Stresslet - kernel applied to both a normal vector and the density vector. - The object is created to do some of the set-up and bookkeeping once, - rather than every time we want to create a symbolic expression based - on the kernel -- say, once when we solve for the density, and once when - we want a symbolic representation for the solution, for example. - - The :meth:`apply` function returns the integral expressions needed for - convolving the kernel with a vector density, and is meant to work - similarly to :func:`~pytential.symbolic.primitives.S` (which is - :class:`~pytential.symbolic.primitives.IntG`). - - Similar functions are available for other useful things related to - the flow: :meth:`apply_pressure`, :meth:`apply_derivative` (target derivative), - :meth:`apply_stress` (applies symmetric viscous stress tensor in - the requested direction). + """Wrapper class for the :class:`~sumpy.kernel.StressletSystemKernel` kernel. - .. attribute:: kernel_dict + This class is meant to shield the user from the messiness of writing out + every term in the expansion of the triple-indexed Stresslet kernel applied + to both a normal vector and the density vector. It provides the same + functionality as :class:`StokesletWrapper`. - The dictionary allows us to exploit symmetry -- that - :math:`T_{012}` is identical to :math:`T_{120}` -- and avoid creating - multiple expansions for the same kernel in a different ordering. + .. autoattribute:: dim .. automethod:: __init__ .. automethod:: apply @@ -309,39 +253,25 @@ class StressletWrapper: """ dim: int + stresslet: StressletSystemKernel - def __init__(self, dim: int): + def __init__(self, dim: int) -> None: self.dim = dim - - if dim == 2: - self.kernel_dict = { - (3, 0): StressletComponentKernel(dim=2, icomp=0, jcomp=0, kcomp=0), - (2, 1): StressletComponentKernel(dim=2, icomp=0, jcomp=0, kcomp=1), - (1, 2): StressletComponentKernel(dim=2, icomp=0, jcomp=1, kcomp=1), - (0, 3): StressletComponentKernel(dim=2, icomp=1, jcomp=1, kcomp=1) - } - elif dim == 3: - self.kernel_dict = { - (3, 0, 0): StressletComponentKernel(dim=3, icomp=0, jcomp=0, kcomp=0), - (2, 1, 0): StressletComponentKernel(dim=3, icomp=0, jcomp=0, kcomp=1), - (2, 0, 1): StressletComponentKernel(dim=3, icomp=0, jcomp=0, kcomp=2), - (1, 2, 0): StressletComponentKernel(dim=3, icomp=0, jcomp=1, kcomp=1), - (1, 1, 1): StressletComponentKernel(dim=3, icomp=0, jcomp=1, kcomp=2), - (1, 0, 2): StressletComponentKernel(dim=3, icomp=0, jcomp=2, kcomp=2), - (0, 3, 0): StressletComponentKernel(dim=3, icomp=1, jcomp=1, kcomp=1), - (0, 2, 1): StressletComponentKernel(dim=3, icomp=1, jcomp=1, kcomp=2), - (0, 1, 2): StressletComponentKernel(dim=3, icomp=1, jcomp=2, kcomp=2), - (0, 0, 3): StressletComponentKernel(dim=3, icomp=2, jcomp=2, kcomp=2) - } - else: - raise ValueError(f"unsupported dimension given to StressletWrapper: {dim}") - - def apply(self, density_vec_sym, dir_vec_sym, mu_sym, qbx_forced_limit): - """Symbolic expressions for integrating Stresslet kernel. + self.stresslet = StressletSystemKernel(dim) + + def apply( + self, + density_vec_sym: ObjectArray1D[ArithmeticExpression], + dir_vec_sym: ObjectArray1D[ArithmeticExpression], + *, + mu_sym: ArithmeticExpression | None = None, + qbx_forced_limit: QBXForcedLimit | None = None, + ) -> ObjectArray1D[ArithmeticExpression]: + """Symbolic expressions for integrating the Stresslet kernel. Returns an object array of symbolic expressions for the vector - resulting from integrating the dyadic Stresslet kernel with - variable *density_vec_sym* and source direction vectors *dir_vec_sym*. + resulting from integrating the triadic Stresslet kernel with + *density_vec_sym* and source direction vectors *dir_vec_sym*. :arg density_vec_sym: a symbolic vector variable for the density vector. :arg dir_vec_sym: a symbolic vector variable for the direction vector. @@ -349,74 +279,61 @@ def apply(self, density_vec_sym, dir_vec_sym, mu_sym, qbx_forced_limit): :arg qbx_forced_limit: the *qbx_forced_limit* argument to be passed on to :class:`~pytential.symbolic.primitives.IntG`. """ - - import itertools - - sym_expr = np.empty((self.dim,), dtype=object) - - for comp in range(self.dim): - - # Start variable count for kernel with 1 for the requested result - # component - base_count = np.zeros(self.dim, dtype=np.int32) - base_count[comp] += 1 - - for i, j in itertools.product(range(self.dim), range(self.dim)): - var_ctr = base_count.copy() - var_ctr[i] += 1 - var_ctr[j] += 1 - ctr_key = tuple(var_ctr) - - if i + j < 1: - sym_expr[comp] = sym.int_g_vec( - self.kernel_dict[ctr_key], - dir_vec_sym[i] * density_vec_sym[j], - qbx_forced_limit=qbx_forced_limit, mu=mu_sym) - - else: - sym_expr[comp] = sym_expr[comp] + sym.int_g_vec( - self.kernel_dict[ctr_key], - dir_vec_sym[i] * density_vec_sym[j], - qbx_forced_limit=qbx_forced_limit, - mu=mu_sym) - - return sym_expr - - def apply_pressure(self, density_vec_sym, dir_vec_sym, mu_sym, qbx_forced_limit): + if mu_sym is None: + mu_sym = sym.SpatialConstant("mu") + + from itertools import product + sym_expr = np.zeros((self.dim,), dtype=object) + + for comp, i, j in product(range(self.dim), repeat=3): + sym_expr[comp] += sym.int_g_vec( + self.stresslet[comp, i, j], + dir_vec_sym[i] * density_vec_sym[j], + qbx_forced_limit=qbx_forced_limit, + mu=mu_sym + ) + + return from_numpy(sym_expr, ArithmeticExpression) + + def apply_pressure( + self, + density_vec_sym: ObjectArray1D[ArithmeticExpression], + dir_vec_sym: ObjectArray1D[ArithmeticExpression], + *, + mu_sym: ArithmeticExpression | None = None, + qbx_forced_limit: QBXForcedLimit | None = None, + ) -> ArithmeticExpression: """Symbolic expression for pressure field associated with the Stresslet.""" + if mu_sym is None: + mu_sym = sym.SpatialConstant("mu") - import itertools - - from pytential.symbolic.mappers import DerivativeTaker + from itertools import product kernel = LaplaceKernel(dim=self.dim) - factor = (2. * mu_sym) - - for i, j in itertools.product(range(self.dim), range(self.dim)): - - if i + j < 1: - sym_expr = factor * DerivativeTaker(i).map_int_g( - DerivativeTaker(j).map_int_g( - sym.int_g_vec(kernel, - density_vec_sym[i] * dir_vec_sym[j], - qbx_forced_limit=qbx_forced_limit))) - else: - sym_expr = sym_expr + ( - factor * DerivativeTaker(i).map_int_g( - DerivativeTaker(j).map_int_g( - sym.int_g_vec(kernel, - density_vec_sym[i] * dir_vec_sym[j], - qbx_forced_limit=qbx_forced_limit)))) + sym_expr = 0 + for i, j in product(range(self.dim), repeat=2): + sym_expr += 2 * mu_sym * sym.int_g_vec( + AxisTargetDerivative(i, AxisTargetDerivative(j, kernel)), + density_vec_sym[i] * dir_vec_sym[j], + qbx_forced_limit=qbx_forced_limit, + ) return sym_expr - def apply_derivative(self, deriv_dir, density_vec_sym, dir_vec_sym, - mu_sym, qbx_forced_limit): - """Symbolic derivative of velocity from stresslet. + def apply_derivative( + self, + deriv_dir: int, + density_vec_sym: ObjectArray1D[ArithmeticExpression], + dir_vec_sym: ObjectArray1D[ArithmeticExpression], + *, + mu_sym: ArithmeticExpression | None = None, + qbx_forced_limit: QBXForcedLimit | None = None, + ) -> ObjectArray1D[ArithmeticExpression]: + """Symbolic derivative of velocity from Stresslet. Returns an object array of symbolic expressions for the vector resulting from integrating the *deriv_dir* target derivative of the - dyadic Stresslet kernel with variable *density_vec_sym* and source + triadic Stresslet kernel with the *density_vec_sym* and source direction vectors *dir_vec_sym*. :arg deriv_dir: integer denoting the axis direction for the derivative. @@ -426,45 +343,31 @@ def apply_derivative(self, deriv_dir, density_vec_sym, dir_vec_sym, :arg qbx_forced_limit: the *qbx_forced_limit* argument to be passed on to :class:`~pytential.symbolic.primitives.IntG`. """ - - import itertools - - from pytential.symbolic.mappers import DerivativeTaker - - sym_expr = np.empty((self.dim,), dtype=object) - - for comp in range(self.dim): - - # Start variable count for kernel with 1 for the requested result - # component - base_count = np.zeros(self.dim, dtype=np.int32) - base_count[comp] += 1 - - for i, j in itertools.product(range(self.dim), range(self.dim)): - var_ctr = base_count.copy() - var_ctr[i] += 1 - var_ctr[j] += 1 - ctr_key = tuple(var_ctr) - - if i + j < 1: - sym_expr[comp] = DerivativeTaker(deriv_dir).map_int_g( - sym.int_g_vec(self.kernel_dict[ctr_key], - dir_vec_sym[i] * density_vec_sym[j], - qbx_forced_limit=qbx_forced_limit, - mu=mu_sym)) - - else: - sym_expr[comp] = sym_expr[comp] + DerivativeTaker( - deriv_dir).map_int_g( - sym.int_g_vec(self.kernel_dict[ctr_key], - dir_vec_sym[i] * density_vec_sym[j], - qbx_forced_limit=qbx_forced_limit, - mu=mu_sym)) - - return sym_expr - - def apply_stress(self, density_vec_sym, normal_vec_sym, dir_vec_sym, - mu_sym, qbx_forced_limit): + if mu_sym is None: + mu_sym = sym.SpatialConstant("mu") + + from itertools import product + sym_expr = np.zeros((self.dim,), dtype=object) + + for comp, i, j in product(range(self.dim), repeat=3): + sym_expr[comp] += sym.int_g_vec( + AxisTargetDerivative(deriv_dir, self.stresslet[comp, i, j]), + dir_vec_sym[i] * density_vec_sym[j], + qbx_forced_limit=qbx_forced_limit, + mu=mu_sym + ) + + return from_numpy(sym_expr, ArithmeticExpression) + + def apply_stress( + self, + density_vec_sym: ObjectArray1D[ArithmeticExpression], + normal_vec_sym: ObjectArray1D[ArithmeticExpression], + dir_vec_sym: ObjectArray1D[ArithmeticExpression], + *, + mu_sym: ArithmeticExpression | None = None, + qbx_forced_limit: QBXForcedLimit | None = None, + ) -> ObjectArray1D[ArithmeticExpression]: r"""Symbolic expression for viscous stress applied to a direction. Returns a vector of symbolic expressions for the force resulting @@ -484,41 +387,44 @@ def apply_stress(self, density_vec_sym, normal_vec_sym, dir_vec_sym, :arg qbx_forced_limit: the *qbx_forced_limit* argument to be passed on to :class:`~pytential.symbolic.primitives.IntG`. """ + if mu_sym is None: + mu_sym = sym.SpatialConstant("mu") - sym_expr = np.empty((self.dim,), dtype=object) - - # Build velocity derivative matrix + # velocity velocity gradient sym_grad_matrix = np.empty((self.dim, self.dim), dtype=object) for i in range(self.dim): - sym_grad_matrix[:, i] = self.apply_derivative(i, density_vec_sym, - normal_vec_sym, mu_sym, qbx_forced_limit) - + sym_grad_matrix[:, i] = self.apply_derivative( + i, density_vec_sym, normal_vec_sym, + qbx_forced_limit=qbx_forced_limit, + mu_sym=mu_sym + ) + + # compute stress + sym_expr = np.zeros((self.dim,), dtype=object) for comp in range(self.dim): + sym_expr[comp] = -dir_vec_sym[comp] * self.apply_pressure( + density_vec_sym, normal_vec_sym, + qbx_forced_limit=qbx_forced_limit, + mu_sym=mu_sym, + ) - # First, add the pressure term: - sym_expr[comp] = - dir_vec_sym[comp] * self.apply_pressure( - density_vec_sym, normal_vec_sym, - mu_sym, qbx_forced_limit) - - # Now add the velocity derivative components - for j in range(self.dim): - sym_expr[comp] = sym_expr[comp] + ( - dir_vec_sym[j] * mu_sym * ( - sym_grad_matrix[comp][j] - + sym_grad_matrix[j][comp]) - ) + for i in range(self.dim): + sym_expr[comp] += mu_sym * dir_vec_sym[i] * ( + sym_grad_matrix[comp, i] + + sym_grad_matrix[i, comp]) - return sym_expr + return from_numpy(sym_expr, ArithmeticExpression) # }}} # {{{ base Stokes operator -class StokesOperator: +class StokesOperator(ABC): """ - .. attribute:: ambient_dim - .. attribute:: side + .. autoattribute:: side + .. autoattribute:: ambient_dim + .. autoproperty:: dim .. automethod:: __init__ .. automethod:: get_density_var @@ -529,7 +435,13 @@ class StokesOperator: .. automethod:: pressure """ - def __init__(self, ambient_dim, side): + ambient_dim: int + side: Side + + stokeslet: StokesletWrapper + stresslet: StressletWrapper + + def __init__(self, ambient_dim: int, side: Side) -> None: """ :arg ambient_dim: dimension of the ambient space. :arg side: :math:`+1` for exterior or :math:`-1` for interior. @@ -541,44 +453,71 @@ def __init__(self, ambient_dim, side): self.ambient_dim = ambient_dim self.side = side - self.stresslet = StressletWrapper(dim=self.ambient_dim) - self.stokeslet = StokesletWrapper(dim=self.ambient_dim) + self.stokeslet = StokesletWrapper(self.ambient_dim) + self.stresslet = StressletWrapper(self.ambient_dim) @property - def dim(self): + def dim(self) -> int: return self.ambient_dim - 1 - def get_density_var(self, name="sigma"): + def get_density_var( + self, name: str = "sigma", + ) -> ObjectArray1D[ArithmeticExpression]: """ :returns: a symbolic vector corresponding to the density. """ return sym.make_sym_vector(name, self.ambient_dim) - def prepare_rhs(self, b, *, mu): + def prepare_rhs( + self, + b: ObjectArray1D[ArithmeticExpression], + *, + mu: ArithmeticExpression | None = None, + ) -> ObjectArray1D[ArithmeticExpression]: """ :returns: a (potentially) modified right-hand side *b* that matches requirements of the representation. """ return b - def operator(self, sigma): + @abstractmethod + def operator( + self, + sigma: ObjectArray1D[ArithmeticExpression], + normal: ObjectArray1D[ArithmeticExpression], + *, + mu: ArithmeticExpression | None = None, + ) -> ObjectArray1D[ArithmeticExpression]: """ :returns: the integral operator that should be solved to obtain the density *sigma*. """ - raise NotImplementedError - def velocity(self, sigma, *, normal, mu, qbx_forced_limit=None): + @abstractmethod + def velocity( + self, + sigma: ObjectArray1D[ArithmeticExpression], + normal: ObjectArray1D[ArithmeticExpression], + *, + mu: ArithmeticExpression | None = None, + qbx_forced_limit: QBXForcedLimit | None = None, + ) -> ObjectArray1D[ArithmeticExpression]: """ :returns: a representation of the velocity field in the Stokes flow. """ - raise NotImplementedError - def pressure(self, sigma, *, normal, mu, qbx_forced_limit=None): + @abstractmethod + def pressure( + self, + sigma: ObjectArray1D[ArithmeticExpression], + normal: ObjectArray1D[ArithmeticExpression], + *, + mu: ArithmeticExpression | None = None, + qbx_forced_limit: QBXForcedLimit | None = None, + ) -> ArithmeticExpression: """ :returns: a representation of the pressure in the Stokes flow. """ - raise NotImplementedError # }}} @@ -598,7 +537,17 @@ class HsiaoKressExteriorStokesOperator(StokesOperator): .. automethod:: __init__ """ - def __init__(self, *, omega, alpha=None, eta=None): + omega: ObjectArray1D[ArithmeticExpression] + alpha: float + eta: float + + def __init__( + self, + *, + omega: ObjectArray1D[ArithmeticExpression], + alpha: float | None = None, + eta: float | None = None, + ) -> None: r""" :arg omega: farfield behaviour of the velocity field, as defined by :math:`A` in [HsiaoKress1985]_ Equation 2.3. @@ -624,14 +573,32 @@ def __init__(self, *, omega, alpha=None, eta=None): self.alpha = alpha self.eta = eta - def _farfield(self, mu, qbx_forced_limit): + def _farfield( + self, + *, + mu: ArithmeticExpression | None, + qbx_forced_limit: QBXForcedLimit | None, + ) -> ObjectArray1D[ArithmeticExpression]: + if mu is None: + mu = sym.SpatialConstant("mu") + length = sym.integral(self.ambient_dim, self.dim, 1) return self.stokeslet.apply( -self.omega / length, - mu, + mu_sym=mu, qbx_forced_limit=qbx_forced_limit) - def _operator(self, sigma, normal, mu, qbx_forced_limit): + def _operator( + self, + sigma: ObjectArray1D[ArithmeticExpression], + normal: ObjectArray1D[ArithmeticExpression], + *, + mu: ArithmeticExpression | None, + qbx_forced_limit: QBXForcedLimit | None, + ) -> ObjectArray1D[ArithmeticExpression]: + if mu is None: + mu = sym.SpatialConstant("mu") + slp_qbx_forced_limit = qbx_forced_limit if slp_qbx_forced_limit == "avg": slp_qbx_forced_limit = +1 @@ -644,31 +611,67 @@ def _operator(self, sigma, normal, mu, qbx_forced_limit): int_sigma = sym.integral(self.ambient_dim, self.dim, sigma, dofdesc=dd) meanless_sigma = sym.cse(sigma - sym.mean(self.ambient_dim, self.dim, sigma)) - op_k = self.stresslet.apply(sigma, normal, mu, + op_k = self.stresslet.apply( + sigma, normal, + mu_sym=mu, qbx_forced_limit=qbx_forced_limit) op_s = ( self.alpha / (2.0 * np.pi) * int_sigma - - self.stokeslet.apply(meanless_sigma, mu, + - self.stokeslet.apply( + meanless_sigma, + mu_sym=mu, qbx_forced_limit=slp_qbx_forced_limit) ) return op_k + self.eta * op_s - def prepare_rhs(self, b, *, mu): - return b + self._farfield(mu, qbx_forced_limit=+1) - - def operator(self, sigma, *, normal, mu): + @override + def prepare_rhs( + self, + b: ObjectArray1D[ArithmeticExpression], + *, + mu: ArithmeticExpression | None = None, + ) -> ObjectArray1D[ArithmeticExpression]: + return b + self._farfield(mu=mu, qbx_forced_limit=+1) + + @override + def operator( + self, + sigma: ObjectArray1D[ArithmeticExpression], + normal: ObjectArray1D[ArithmeticExpression], + *, + mu: ArithmeticExpression | None = None, + ) -> ObjectArray1D[ArithmeticExpression]: # NOTE: H. K. 1985 Equation 2.18 - return -0.5 * self.side * sigma - self._operator(sigma, normal, mu, "avg") - - def velocity(self, sigma, *, normal, mu, qbx_forced_limit=2): + return ( + -0.5 * self.side * sigma + - self._operator(sigma, normal, mu=mu, qbx_forced_limit="avg") + ) + + @override + def velocity( + self, + sigma: ObjectArray1D[ArithmeticExpression], + normal: ObjectArray1D[ArithmeticExpression], + *, + mu: ArithmeticExpression | None = None, + qbx_forced_limit: QBXForcedLimit | None = None, + ) -> ObjectArray1D[ArithmeticExpression]: # NOTE: H. K. 1985 Equation 2.16 return ( - -self._farfield(mu, qbx_forced_limit) - - self._operator(sigma, normal, mu, qbx_forced_limit) - ) - - def pressure(self, sigma, *, normal, mu, qbx_forced_limit=2): + -self._farfield(mu=mu, qbx_forced_limit=qbx_forced_limit) + - self._operator(sigma, normal, mu=mu, qbx_forced_limit=qbx_forced_limit) + ) + + @override + def pressure( + self, + sigma: ObjectArray1D[ArithmeticExpression], + normal: ObjectArray1D[ArithmeticExpression], + *, + mu: ArithmeticExpression | None = None, + qbx_forced_limit: QBXForcedLimit | None = None, + ) -> ArithmeticExpression: # FIXME: H. K. 1985 Equation 2.17 raise NotImplementedError @@ -686,7 +689,9 @@ class HebekerExteriorStokesOperator(StokesOperator): .. automethod:: __init__ """ - def __init__(self, *, eta=None): + eta: float + + def __init__(self, *, eta: float | None = None) -> None: r""" :arg eta: a parameter :math:`\eta > 0`. Choosing this parameter well can have a non-trivial effect on the conditioning of the operator. @@ -701,27 +706,67 @@ def __init__(self, *, eta=None): self.eta = eta - def _operator(self, sigma, normal, mu, qbx_forced_limit): + def _operator( + self, + sigma: ObjectArray1D[ArithmeticExpression], + normal: ObjectArray1D[ArithmeticExpression], + *, + mu: ArithmeticExpression | None, + qbx_forced_limit: QBXForcedLimit | None, + ) -> ObjectArray1D[ArithmeticExpression]: + if mu is None: + mu = sym.SpatialConstant("mu") + slp_qbx_forced_limit = qbx_forced_limit if slp_qbx_forced_limit == "avg": slp_qbx_forced_limit = self.side - op_w = self.stresslet.apply(sigma, normal, mu, + op_w = self.stresslet.apply( + sigma, normal, + mu_sym=mu, qbx_forced_limit=qbx_forced_limit) - op_v = self.stokeslet.apply(sigma, mu, + op_v = self.stokeslet.apply( + sigma, + mu_sym=mu, qbx_forced_limit=slp_qbx_forced_limit) return op_w + self.eta * op_v - def operator(self, sigma, *, normal, mu): + @override + def operator( + self, + sigma: ObjectArray1D[ArithmeticExpression], + normal: ObjectArray1D[ArithmeticExpression], + *, + mu: ArithmeticExpression | None = None, + ) -> ObjectArray1D[ArithmeticExpression]: # NOTE: H. 1986 Equation 17 - return -0.5 * self.side * sigma - self._operator(sigma, normal, mu, "avg") - - def velocity(self, sigma, *, normal, mu, qbx_forced_limit=2): + return ( + -0.5 * self.side * sigma + - self._operator(sigma, normal, mu=mu, qbx_forced_limit="avg") + ) + + @override + def velocity( + self, + sigma: ObjectArray1D[ArithmeticExpression], + normal: ObjectArray1D[ArithmeticExpression], + *, + mu: ArithmeticExpression | None = None, + qbx_forced_limit: QBXForcedLimit | None = None, + ) -> ObjectArray1D[ArithmeticExpression]: # NOTE: H. 1986 Equation 16 - return -self._operator(sigma, normal, mu, qbx_forced_limit) - - def pressure(self, sigma, *, normal, mu, qbx_forced_limit=2): + return -self._operator(sigma, normal, mu=mu, qbx_forced_limit=qbx_forced_limit) + + @override + def pressure( + self, + sigma: ObjectArray1D[ArithmeticExpression], + normal: ObjectArray1D[ArithmeticExpression], + *, + mu: ArithmeticExpression | None = None, + qbx_forced_limit: QBXForcedLimit | None = None, + ) -> ArithmeticExpression: # FIXME: not given in H. 1986, but should be easy to derive using the # equivalent single-/double-layer pressure kernels raise NotImplementedError diff --git a/test/test_stokes.py b/test/test_stokes.py index d8e4d8320..87f0ddad4 100644 --- a/test/test_stokes.py +++ b/test/test_stokes.py @@ -179,7 +179,7 @@ def run_exterior_stokes(actx_factory, *, sym_velocity = op.velocity(sym_sigma, normal=sym_normal, mu=sym_mu) - sym_source_pot = op.stokeslet.apply(sym_sigma, sym_mu, qbx_forced_limit=None) + sym_source_pot = op.stokeslet.apply(sym_sigma, mu_sym=sym_mu, qbx_forced_limit=None) # }}} diff --git a/test/test_symbolic.py b/test/test_symbolic.py index 7b43d7814..fbbbf2820 100644 --- a/test/test_symbolic.py +++ b/test/test_symbolic.py @@ -42,6 +42,11 @@ from meshmode.discretization.poly_element import ( InterpolatoryQuadratureSimplexGroupFactory, ) +from sumpy.kernel import ( + BrinkmanStressSystemKernel, + ElasticityStressSystemKernel, + StressletSystemKernel, +) from pytential import bind, sym from pytential.array_context import PytestPyOpenCLArrayContextFactory @@ -603,6 +608,136 @@ def test_derivative_with_spatial_constant(): # }}} +# {{{ test_int_g_system + +@pytest.mark.parametrize("dim", [2, 3]) +def test_int_g_system_stokeslet(dim): + from sumpy.kernel import StokesletSystemKernel + + from pytential.symbolic.mappers import OperatorCollector + + kernel = StokesletSystemKernel(dim) + density = sym.make_sym_vector("sigma", dim) + mu_sym = sym.SpatialConstant("mu") + + result = sym.int_g_system( + "ci,i->c", kernel, density, + qbx_forced_limit=None, + kernel_arguments={"mu": mu_sym}) + + assert result.shape == (dim,) + + collector = OperatorCollector() + for comp in range(dim): + intgs = collector(result[comp]) + assert len(intgs) == dim + + for intg in intgs: + # the kernel component shows up both as the "target kernel" and + # as the (single) source kernel + assert intg.target_kernel == kernel[comp, intg.densities[0].index] + assert intg.source_kernels == (intg.target_kernel,) + assert len(intg.densities) == 1 + assert intg.densities[0] in set(density) + +# }}} + + +# {{{ test_int_g_system_stress_kernels + +@pytest.mark.parametrize("dim", [2, 3]) +@pytest.mark.parametrize(("kernel_factory", "kernel_arguments"), [ + pytest.param( + lambda dim: StressletSystemKernel(dim), + {"mu": sym.SpatialConstant("mu")}, + id="stresslet"), + pytest.param( + lambda dim: ElasticityStressSystemKernel(dim), + {"mu": sym.SpatialConstant("mu"), "nu": sym.SpatialConstant("nu")}, + id="elasticity_stress"), + pytest.param( + lambda dim: BrinkmanStressSystemKernel(dim), + {"mu": sym.SpatialConstant("mu"), "k": sym.SpatialConstant("k")}, + id="brinkman_stress"), + ]) +def test_int_g_system_stress_kernel(dim, kernel_factory, kernel_arguments): + kernel = kernel_factory(dim) + assert kernel.shape == (dim, dim, dim) + + density = sym.make_sym_vector("sigma", dim) + direction = sym.make_sym_vector("dir", dim) + + # "double layer": direction contracts inside the IntG density + inside = sym.int_g_system( + "cij,j,i->c", kernel, density, direction, + qbx_forced_limit=None, + kernel_arguments=kernel_arguments) + assert inside.shape == (dim,) + + # "traction": direction stays outside, to be dotted in by the caller + outside = sym.int_g_system( + "cij,j->ci", kernel, density, + qbx_forced_limit=None, + kernel_arguments=kernel_arguments) + assert outside.shape == (dim, dim) + +# }}} + + +# {{{ test_int_g_system_scalar_output + +def test_int_g_system_scalar_output(): + from sumpy.kernel import StokesletSystemKernel + + from pytential.symbolic.mappers import OperatorCollector + + dim = 2 + kernel = StokesletSystemKernel(dim) + density = sym.make_sym_vector("sigma", dim) + mu_sym = sym.SpatialConstant("mu") + + result = sym.int_g_system( + "ci,i->", kernel, density, + qbx_forced_limit=None, + kernel_arguments={"mu": mu_sym}) + + assert result.shape == () + + # every kernel component contributes one IntG + intgs = OperatorCollector()(result[()]) + assert len(intgs) == dim * dim + +# }}} + + +# {{{ test_int_g_system_spec_errors + +def test_int_g_system_spec_errors(): + from sumpy.kernel import StokesletSystemKernel + + dim = 2 + kernel = StokesletSystemKernel(dim) + density = sym.make_sym_vector("sigma", dim) + + with pytest.raises(ValueError, match="must contain"): + sym.int_g_system("ci,i", kernel, density, qbx_forced_limit=None) + + with pytest.raises(ValueError, match="number of arguments"): + sym.int_g_system("ci,i,j->c", kernel, density, qbx_forced_limit=None) + + with pytest.raises(ValueError, match="unique"): + sym.int_g_system("ci,i->cc", kernel, density, qbx_forced_limit=None) + + with pytest.raises(ValueError, match="kernel indices"): + sym.int_g_system("cij,i->c", kernel, density, qbx_forced_limit=None) + + # 'mu' kernel argument is not supplied + with pytest.raises(ValueError, match="not supplied"): + sym.int_g_system("ci,i->c", kernel, density, qbx_forced_limit=None) + +# }}} + + # You can test individual routines by typing # $ python test_symbolic.py 'test_routine()'