diff --git a/example/maxwell_sibc/cimParameters.pro b/example/maxwell_sibc/cimParameters.pro index 6d6cde41b95c1d8160c02a10fbbdf3a488a00410..80b91c50abbb3e88012b971fd11ed04ad33c876a 100644 --- a/example/maxwell_sibc/cimParameters.pro +++ b/example/maxwell_sibc/cimParameters.pro @@ -11,11 +11,15 @@ Function{ angularFreqIm]; // [rad/m] // Algebraic data // - DefineConstant[x() = {}, // Solution - b() = {}]; // Right hand side + DefineConstant[nRHS = 1]; // Number of RHS for this run + For i In {0:nRHS-1} + DefineConstant[x~{i}() = {}, // Solution + b~{i}() = {}]; // Right hand side + EndFor // Control data // - DefineConstant[imposeRHS = 0, // Should I use an imposed RHS? + DefineConstant[doInit = 0, // Should I initialize some stuff? + doSolve = 0, // Should I solve Ax = b? doPostpro = 0, // Should I only create a view for x()? doApply = 0, // Should I only apply x(): x <- Ax? fileName = "eig.pos"]; // Postpro file name diff --git a/example/maxwell_sibc/cimResolution.pro b/example/maxwell_sibc/cimResolution.pro index adb8af11ce3169554466d807c43f653527436cf1..99551870563d2775702a773028f245864013abaa 100644 --- a/example/maxwell_sibc/cimResolution.pro +++ b/example/maxwell_sibc/cimResolution.pro @@ -9,23 +9,32 @@ Resolution{ Operation{ Generate[A]; - If(imposeRHS) - CopyRightHandSide[b(), A]; + If(doInit) + CopySolution[A, x~{0}()]; EndIf - If(!doPostpro && !doApply) + If(doSolve) + // Full solve for first RHS + CopyRightHandSide[b~{0}(), A]; Solve[A]; - CopySolution[A, x()]; + CopySolution[A, x~{0}()]; + + // SolveAgain for other RHSs + For i In {1:nRHS-1} + CopyRightHandSide[b~{i}(), A]; + SolveAgain[A]; + CopySolution[A, x~{i}()]; + EndFor EndIf If(doApply) - CopySolution[x(), A]; + CopySolution[x~{0}(), A]; Apply[A]; - CopySolution[A, x()]; + CopySolution[A, x~{0}()]; EndIf If(doPostpro) - CopySolution[x(), A]; + CopySolution[x~{0}(), A]; PostOperation[Post]; EndIf }