On Fri, Jan 13, 2023 at 5:58 AM Eric Chamberland < [email protected]> wrote:
> ok, here is what I want to do: > > I am writing a brand new PC which needs some other PETSc objects like a > Vec (for unit partition). > > We have a text based user file format in which the user can create > arbitrary Petsc's Vec or Mat. > > Then, I would like the user to give the prefix of these Vec or Mat as a > parameter for the new PC that we would like to configure completely via the > "petsc options database". > > So in our PCApply_XXX we would like to retrieve some specific options > which will simply give the Vec prefix to retreive. > > Okay, so a named vector is created when options are processed, and you want to use that vector by name inside your new PC. 1. You could add that vector to a list you manage at creation time. This means that you are in charge of that list. 2. DM has named vectors ( https://petsc.org/release/docs/manualpages/DM/DMGetNamedGlobalVector/) but not matrices You could probably just extract the DM code to manage your objects. Thanks, Matt > Thanks, > > Eric > > > On 2023-01-13 15:39, Matthew Knepley wrote: > > On Fri, Jan 13, 2023 at 4:24 AM Eric Chamberland < > [email protected]> wrote: > >> Hi, >> >> Is it possible with PETSc's API to query an objet by it's name? >> >> Is there a "global" database with all PETScObject created? >> > > No, we do not store that information. What would the use case be? Maybe > there is another way to do it. > > Thanks, > > Matt > > >> Thanks, >> >> Eric >> >> -- >> Eric Chamberland, ing., M. Ing >> Professionnel de recherche >> GIREF/Université Laval >> (418) 656-2131 poste 41 22 42 >> >> > > -- > What most experimenters take for granted before they begin their > experiments is infinitely more interesting than any results to which their > experiments lead. > -- Norbert Wiener > > https://www.cse.buffalo.edu/~knepley/ > <http://www.cse.buffalo.edu/~knepley/> > > -- > Eric Chamberland, ing., M. Ing > Professionnel de recherche > GIREF/Université Laval > (418) 656-2131 poste 41 22 42 > > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
