Re: [petsc-users] DMGetCoordinatesLocal and DMPlexGetCellCoordinates in PETSc > 3.18

2023-05-22 Thread Matthew Knepley
On Mon, May 22, 2023 at 4:41 AM Berend van Wachem wrote: > Dear Matt, > > I'm really sorry for this stupid bug! > No problem. You have really helped me get the bugs out of Plex. Thanks, Matt > I can confirm that setting the coordinates with both > CellCoordinatesLocal and

Re: [petsc-users] DMGetCoordinatesLocal and DMPlexGetCellCoordinates in PETSc > 3.18

2023-05-22 Thread Berend van Wachem
Dear Matt, I'm really sorry for this stupid bug! I can confirm that setting the coordinates with both CellCoordinatesLocal and CoordinatesLocal works. Best regards, Berend. Many thanks and best regards, Berend. On 5/17/23 23:04, Matthew Knepley wrote: On Wed, May 17, 2023 at 2:01 PM Berend

Re: [petsc-users] DMGetCoordinatesLocal and DMPlexGetCellCoordinates in PETSc > 3.18

2023-05-17 Thread Matthew Knepley
On Wed, May 17, 2023 at 2:01 PM Berend van Wachem wrote: > Dear Matt, > > I tried it, but it doesn't seem to work. > Attached is a very small working example illustrating the problem. > I create a DMPlexBox Mesh, periodic in the Y direction. I then scale the Y > coordinates with a factor 10, and

Re: [petsc-users] DMGetCoordinatesLocal and DMPlexGetCellCoordinates in PETSc > 3.18

2023-05-17 Thread Berend van Wachem
Dear Matt, I tried it, but it doesn't seem to work. Attached is a very small working example illustrating the problem. I create a DMPlexBox Mesh, periodic in the Y direction. I then scale the Y coordinates with a factor 10, and add 1.0 to it. Both DMGetCoordinatesLocal and

Re: [petsc-users] DMGetCoordinatesLocal and DMPlexGetCellCoordinates in PETSc > 3.18

2023-05-17 Thread Matthew Knepley
On Wed, May 17, 2023 at 11:20 AM Berend van Wachem wrote: > Dear Matt, > > Is there a way to 'redo' the DMLocalizeCoordinates() ? Or to undo it? > Alternatively, can we make the calling of DMLocalizeCoordinates() in the > DMPlexCreate...() routines optional? > > Otherwise, we would have to copy

Re: [petsc-users] DMGetCoordinatesLocal and DMPlexGetCellCoordinates in PETSc > 3.18

2023-05-17 Thread Berend van Wachem
Dear Matt, Is there a way to 'redo' the DMLocalizeCoordinates() ? Or to undo it? Alternatively, can we make the calling of DMLocalizeCoordinates() in the DMPlexCreate...() routines optional? Otherwise, we would have to copy all arrays of coordinates from DMGetCoordinatesLocal() and

Re: [petsc-users] DMGetCoordinatesLocal and DMPlexGetCellCoordinates in PETSc > 3.18

2023-05-17 Thread Matthew Knepley
On Wed, May 17, 2023 at 10:21 AM Berend van Wachem wrote: > Dear Matt, > > Thanks for getting back to me so quickly. > > If I scale each of the coordinates of the mesh (say, I want to cube each > co-ordinate), and I do this for both: > > DMGetCoordinatesLocal(); > DMGetCellCoordinatesLocal(); >

Re: [petsc-users] DMGetCoordinatesLocal and DMPlexGetCellCoordinates in PETSc > 3.18

2023-05-17 Thread Berend van Wachem
Dear Matt, Thanks for getting back to me so quickly. If I scale each of the coordinates of the mesh (say, I want to cube each co-ordinate), and I do this for both: DMGetCoordinatesLocal(); DMGetCellCoordinatesLocal(); How do I know I am not cubing one coordinate multiple times? Thanks,

Re: [petsc-users] DMGetCoordinatesLocal and DMPlexGetCellCoordinates in PETSc > 3.18

2023-05-17 Thread Matthew Knepley
On Wed, May 17, 2023 at 10:02 AM Berend van Wachem wrote: > Dear PETSc Team, > > We are using DMPlex, and we create a mesh using > > DMPlexCreateBoxMesh ( ); > > and get a uniform mesh. The mesh is periodic. > > We typically want to "scale" the coordinates (vertices) of the mesh, and > to

[petsc-users] DMGetCoordinatesLocal and DMPlexGetCellCoordinates in PETSc > 3.18

2023-05-17 Thread Berend van Wachem
Dear PETSc Team, We are using DMPlex, and we create a mesh using DMPlexCreateBoxMesh ( ); and get a uniform mesh. The mesh is periodic. We typically want to "scale" the coordinates (vertices) of the mesh, and to achieve this, we call DMGetCoordinatesLocal(dm, ); and scale the entries