You want "auxiliary" variables. There may be better examples but, try looking at https://petsc.org/release/src/snes/tutorials/ex12.c.html And search for "aux".
Mark On Sun, Aug 28, 2022 at 12:44 PM Nicholas Arnold-Medabalimi < [email protected]> wrote: > Hi > > I'm working on a finite volume implementation using DMPlex. I was > wondering what the best-considered way to add cell variables to the DM that > we don't want to be part of the ksp/snes solve. As far as I can tell, if I > add an extra section with those, they will still be part of the F and U > vectors in the solver callbacks (to be expected). But my impression is that > that will just inflate the system size even if they have an F=0? Or is the > solver able to notice variables that are not dependent for the solve. > > Alternatively, I have been just making a separate DM with those but that > feels a bit clunky especially if any mesh refinement occurs. > > Any advice would be much appreciated. > > Thanks > Nicholas > > -- > Nicholas Arnold-Medabalimi > > Ph.D. Candidate > Computational Aeroscience Lab > University of Michigan >
