Skip to content

Commit

Permalink
Merge pull request #410 from cmosbeux/devel
Browse files Browse the repository at this point in the history
Update ParticleUtils.F90 with correct permutation of Mesh velocities
  • Loading branch information
raback committed Jul 31, 2023
2 parents e193bf7 + 13b11cd commit b72e8ce
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
Expand Up @@ -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)

!-----------------------------------------------------------------
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b72e8ce

Please sign in to comment.