Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/laplacexy/alfven-wave/alfven.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class Alfven : public PhysicsModel {
// Field2D Vort2D = DC(Vort); // n=0 component
// phi2D = laplacexy->solve(Vort2D, phi2D);

// Calculate phi from potential
// Calculate phi from vorticity
if (split_n0) {
// Split into axisymmetric and non-axisymmetric components
Field2D Vort2D = DC(Vort); // n=0 component
Expand Down
8 changes: 6 additions & 2 deletions src/invert/laplacexz/impls/petsc/laplacexz-petsc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,9 @@ Field3D LaplaceXZpetsc::solve(const Field3D &bin, const Field3D &x0in) {
for(int z=0; z < localmesh->LocalNz; z++) {
PetscScalar val;
VecGetValues(xs, 1, &ind, &val );
result(localmesh->xstart-1,y,z) = val;
for (int x = localmesh->xstart - 1; x >= 0; --x){
result(x,y,z) = val;
}
ind++;
}
}
Expand All @@ -807,7 +809,9 @@ Field3D LaplaceXZpetsc::solve(const Field3D &bin, const Field3D &x0in) {
for(int z=0; z < localmesh->LocalNz; z++) {
PetscScalar val;
VecGetValues(xs, 1, &ind, &val );
result(localmesh->xend+1,y,z) = val;
for(int x=localmesh->xend+1; x<localmesh->LocalNx; ++x){
result(x,y,z) = val;
}
ind++;
}
}
Expand Down