Merge SNES constraints into refactor#3386
Conversation
…on of algebraic equations. For now it is only supported by backward_euler option. We will modify the rest of the options later.
…ork with petsc vectors instead of bout++ variables. I added an option to split the preconditioner so that the user can use a different PC_type for the algebraic equation.
|
|
||
| if (have_constraints) { | ||
| // Create PETSc-native index sets representing the two parts of your DAE. | ||
| PetscInt istart, iend; |
There was a problem hiding this comment.
warning: multiple declarations in a single statement reduces readability [readability-isolate-declaration]
| PetscInt istart, iend; | |
| PetscInt istart; | |
| PetscInt iend; |
|
|
||
| if (have_constraints) { | ||
| // Create PETSc-native index sets representing the two parts of your DAE. | ||
| PetscInt istart, iend; |
There was a problem hiding this comment.
warning: variable 'iend' is not initialized [cppcoreguidelines-init-variables]
PetscInt istart, iend;
^this fix will not be applied because it overlaps with another fix
|
|
||
| if (have_constraints) { | ||
| // Create PETSc-native index sets representing the two parts of your DAE. | ||
| PetscInt istart, iend; |
There was a problem hiding this comment.
warning: variable 'istart' is not initialized [cppcoreguidelines-init-variables]
PetscInt istart, iend;
^this fix will not be applied because it overlaps with another fix
| ASSERT2(have_is_maps); | ||
| // Some constraints | ||
|
|
||
| Vec x_diff, x0_diff, f_diff; |
There was a problem hiding this comment.
warning: variable 'f_diff' is not initialized [cppcoreguidelines-init-variables]
ints
^this fix will not be applied because it overlaps with another fix
| ASSERT2(have_is_maps); | ||
| // Some constraints | ||
|
|
||
| Vec x_diff, x0_diff, f_diff; |
There was a problem hiding this comment.
warning: variable 'x0_diff' is not initialized [cppcoreguidelines-init-variables]
ints
^this fix will not be applied because it overlaps with another fix
| ASSERT2(have_is_maps); | ||
| // Some constraints | ||
|
|
||
| Vec x_diff, x0_diff, f_diff; |
There was a problem hiding this comment.
warning: variable 'x_diff' is not initialized [cppcoreguidelines-init-variables]
ints
^this fix will not be applied because it overlaps with another fix
|
|
||
| Vec x_diff, x0_diff, f_diff; | ||
|
|
||
| PetscCall(VecGetSubVector(x, is_diff, &x_diff)); |
There was a problem hiding this comment.
warning: multiple declarations in a single statement reduces readability [readability-isolate-declaration]
| PetscCall(VecGetSubVector(x, is_diff, &x_diff)); | |
| ints | |
| diff; | |
| iVec x_diff; | |
| Vec x0_diff; | |
| Vec f_diff; |
| int neq; ///< Number of variables in total | ||
|
|
||
| bool have_constraints; ///< Are there any constraint variables? | ||
| Array<BoutReal> is_dae; ///< If using constraints, 1 -> DAE, 0 -> AE |
There was a problem hiding this comment.
warning: no header providing "Array" is directly included [misc-include-cleaner]
src/solver/impls/snes/snes.hxx:30:
- #include <bout/build_defines.hxx>
+ #include "bout/array.hxx"
+ #include <bout/build_defines.hxx>
Merges the changes in #3251 into the refactor-petsc-precon branch.