Repository navigation
More DMStag stuff: locations by axis, stencils from Julia indices, stencil assembly - #295
Merged
Merged
Conversation
…mbly face_location, edge_location, vertex_location and element_location name DMStag locations by axis, the same in 2D and 3D. stencil(dm, loc, I; dof) builds a DMStagStencil from a 1-based element index without allocating. set_values! (Mat and Vec), zero_rows_local! and LibPETSc.IS(dm, loc => dof) take stencils. C structs now use the loaded PetscInt width, so stencils work on Int32 builds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DMStag code that assembles its own Jacobian (MAGE, for example) still goes through LibPETSc for every stencil. This PR adds the high-level pieces for that.
vertex_location(dm),edge_location(dm, a, b),face_location(dm, axis)andelement_location(dm).DMSTAG_DOWNis the second axis, so its meaning shifts with the dimension; these functions mean the same thing in 2D and 3D.stencil(dm, loc, I; dof = 0)builds aDMStagStencilfrom the 1-based element index thatcornersreturns. It doesn't allocate, and ghost indices work.dofis PETSc's 0-based component, as indof_slot.set_values!(J, dm, rows, cols, vals, mode), the Vec versionset_values!(v, dm, positions, vals, mode), andzero_rows_local!(J, dm, rows, diag). They take anyAbstractVector.LibPETSc.IS(dm, loc => dof, ...)builds the index set of whole fields, forset_fieldsplit_is!. It takes location/component pairs, because PETSc ignoresi, j, khere.Fix: on an Int32 build,
DMStagStencil,MatStenciland the other C structs hadInt64fields, so PETSc read them wrong. They now use the integer width of the loaded library. Checked on an Int32 build: the new tests pass there too.