Skip to content

Commit

Permalink
Merge pull request #2 from cmosbeux/cmosbeux-patch-3
Browse files Browse the repository at this point in the history
Update ParticleUtils.F90 with correct permutation of Mesh velocities
cmosbeux authored Jul 20, 2023
2 parents 9f06e16 + 31483b8 commit 13b11cd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fem/src/ParticleUtils.F90
Original file line number Diff line number Diff line change
@@ -4631,6 +4631,9 @@ SUBROUTINE GetVectorFieldInMesh(Var, CurrentElement, Basis, Velo, dBasisdx, Grad


IF( npos == 0 ) RETURN

! MAX 3 velocity direction (4th variable is pressure)
! This has to be accounted for in the Var % Values permutations
dofs = MIN(3,Var % Dofs)

!-----------------------------------------------------------------
@@ -4644,7 +4647,9 @@ SUBROUTINE GetVectorFieldInMesh(Var, CurrentElement, Basis, Velo, dBasisdx, Grad
DO i=1,n
j = LocalPerm(i)
DO k=1,dofs
LocalVelo(i,k) = Var % Values( Dofs*(j-1)+k)
! For correct permutation we have to account for the full dimension
! of the Flow Solution (e.g., Stokes 3D : vx, vy,vz, p)
LocalVelo(i,k) = Var % Values( Var % Dofs * (j-1) + k)
END DO
END DO
ELSE
@@ -4656,7 +4661,7 @@ SUBROUTINE GetVectorFieldInMesh(Var, CurrentElement, Basis, Velo, dBasisdx, Grad
IF( j > 0 ) THEN
SumBasis = SumBasis + Basis(i)
DO k=1,dofs
LocalVelo(i,k) = Var % Values( Dofs*(j-1)+k)
LocalVelo(i,k) = Var % Values( Var % Dofs * (j-1) + k)
END DO
ELSE
Basis(i) = 0.0_dp

0 comments on commit 13b11cd

Please sign in to comment.