-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
more types? #145
Comments
It does have different Vec types (see https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecType.html#VecType), but it's a bit more dynamic than Julia (e.g. you can modify the type of an existing Vec) I think the main question is whether the distinction is useful from a dispatch perspective. In particular, I had originally planned that |
Right. I meant mainly from the dispatch perspective. For instance, the function What I meant by "PETSc doesn't really distinguish between these " I meat at the C-types level. For instance everything is really just a I'm also not sure that you can really change a vector in PETSc once it's been setup, this is mainly for initialization. My read o the code is that if you call |
The way it enforces that things are the correct size wrt being local or global is that it the |
Right. I was wondering if there would be any benefit to having any checks at compile time (obviously some stuff can only be checked at run time such as whether you can actually scatter between two vectors). But some sanity checks might be possible at run time, but maybe it's not worth it for now. For example, I was thinking that |
Probably worth waiting until we have more concrete use cases. |
Should we have more types, for example:
LocalVec
andGlobalVec
?DMDA
andDMStag
andDMXXX
?PETSc doesn't really distinguish between these, but we could leverage the Julia type system to make sure that the right functions are called always. (Not sure how to handle cases when we do not necessarily know the type, such as what's returned from
DMGetCoordinateDM
.)The text was updated successfully, but these errors were encountered: