Skip to content

Commit e8996aa

Browse files
committed
Merge branch 'improvement.filter.fix' into 'master'
Filter and overintegration always disabled in postiMode See merge request flexi/flexi!710
2 parents 06b5c3e + bc5614c commit e8996aa

File tree

7 files changed

+68
-45
lines changed

7 files changed

+68
-45
lines changed

regressioncheck/checks/tgv/split/parameter.ini

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
! =============================================================================== !
2-
! OUTPUT
2+
! OUTPUT
33
! =============================================================================== !
44
ProjectName = TGV_Re1600_Split
55
Logging = F
@@ -20,39 +20,38 @@ NVisu = 12
2020
! =============================================================================== !
2121
OverintegrationType=0 ! 0:off 1:cut-off filter 2: conservative cut-off 3: advective
2222
! flux only
23-
NOver = 11 ! overintegration for volume fluxes (NOver>N) for type 3
2423
NUnder = 7 ! specifies effective polydeg (modes > NUnder are thrown away)
2524
! for types 1 and 2
2625
NOut =-1 ! Change output poly deg to save memory:
2726
! -1: MIN(N,NUnder), 0: N, >=1: NOut
2827
!=========================================================================================
2928
! Riemann
3029
!=========================================================================================
31-
Riemann = RoeEntropyFix ! Riemann solver to be used: LF, HLLC, Roe,
32-
! RoeEntropyFix, HLL, HLLE, HLLEM
30+
Riemann = RoeEntropyFix ! Riemann solver to be used: LF, HLLC, Roe,
31+
! RoeEntropyFix, HLL, HLLE, HLLEM
3332
!=========================================================================================
3433
! SplitDG
3534
!=========================================================================================
3635
SplitDG = PI
3736
! =============================================================================== !
38-
! LES MODEL
37+
! LES MODEL
3938
! =============================================================================== !
4039
eddyViscType = 0 ! Choose LES model, 1:Smagorinsky
4140
CS = 0.1 ! Smagorinsky constant
4241
PrSGS = 0.6 ! turbulent Prandtl number
4342
! =============================================================================== !
4443
! MESH
4544
! =============================================================================== !
46-
MeshFile = CART_HEX_PERIODIC_008_mesh.h5
45+
MeshFile = CART_HEX_PERIODIC_008_mesh.h5
4746
useCurveds = F
4847
! if boundaries have to be changed (else they are used from Mesh directly):
4948

5049
! =============================================================================== !
5150
! EQUATION
5251
! =============================================================================== !
53-
IniExactFunc = 0
52+
IniExactFunc = 0
5453
IniRefState = 1
55-
RefState = (/1.,1.,0.,0.,17194.8345650329/)
54+
RefState = (/1.,1.,0.,0.,17194.8345650329/)
5655
Mu0 = 6.25E-04 ! viscosity set to 1/Re
5756
R = 71.42857
5857
! =============================================================================== !
@@ -67,10 +66,10 @@ DFLscale = 0.8 ! Scaling of theoretical DFL number
6766
! =============================================================================== !
6867
Analyze_dt = 13.0 ! Timestep of analyze outputs
6968
CalcErrorNorms= F ! Calculate error norms
70-
CalcBodyForces= F ! Calculate body forces (BC 4/9)
71-
CalcWallVelocity= F ! Calculate velocities at the walls (BC 4/9)
69+
CalcBodyForces= F ! Calculate body forces (BC 4/9)
70+
CalcWallVelocity= F ! Calculate velocities at the walls (BC 4/9)
7271

7372
! =============================================================================== !
74-
! Boundary specification
73+
! Boundary specification
7574
! =============================================================================== !
7675
!All boundaries are set in mesh file, could be changed here

src/dg/dg.f90

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ SUBROUTINE InitDG()
140140
END SUBROUTINE InitDG
141141

142142

143-
144143
!==================================================================================================================================
145144
!> Allocate and initialize the building blocks for the DG operator: Differentiation matrices and prolongation operators
146145
!==================================================================================================================================
@@ -560,17 +559,18 @@ SUBROUTINE DGTimeDerivative_weakForm(t)
560559

561560
! 14. Perform overintegration and apply Jacobian
562561
! Perform overintegration (projection filtering type overintegration)
563-
IF(OverintegrationType.GT.0) THEN
564-
CALL Overintegration(Ut)
565-
END IF
566-
! Apply Jacobian (for OverintegrationType==CUTOFFCONS this is already done within the Overintegration, but for DG only)
567-
IF (OverintegrationType.EQ.CUTOFFCONS) THEN
562+
SELECT CASE (OverintegrationType)
563+
CASE (OVERINTEGRATIONTYPE_CONSCUTOFF )
564+
CALL Overintegration(Ut)
568565
#if FV_ENABLED
569-
CALL ApplyJacobianCons(Ut,toPhysical=.TRUE.,FVE=1)
570-
#endif
571-
ELSE
572-
CALL ApplyJacobianCons(Ut,toPhysical=.TRUE.)
573-
END IF
566+
CALL ApplyJacobianCons(Ut,toPhysical=.TRUE.,FVE=1)
567+
#endif /*FV_ENABLED*/
568+
CASE (OVERINTEGRATIONTYPE_CUTOFF)
569+
CALL Overintegration(Ut)
570+
CALL ApplyJacobianCons(Ut,toPhysical=.TRUE.)
571+
CASE DEFAULT
572+
CALL ApplyJacobianCons(Ut,toPhysical=.TRUE.)
573+
END SELECT
574574

575575
END SUBROUTINE DGTimeDerivative_weakForm
576576

src/dg/overintegration.f90

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ MODULE MOD_Overintegration
2222
IMPLICIT NONE
2323
PRIVATE
2424

25-
INTEGER,PARAMETER :: OVERINTEGRATIONTYPE_NONE = 0
26-
INTEGER,PARAMETER :: OVERINTEGRATIONTYPE_CUTOFF = 1
27-
INTEGER,PARAMETER :: OVERINTEGRATIONTYPE_CONSCUTOFF = 2
28-
2925
!----------------------------------------------------------------------------------------------------------------------------------
3026
INTERFACE InitOverintegration
3127
MODULE PROCEDURE InitOverintegration
@@ -101,6 +97,13 @@ SUBROUTINE InitOverintegration()
10197
CALL CollectiveStop(__STAMP__,&
10298
'InitOverintegration not ready to be called or already called.')
10399
END IF
100+
101+
! OverIntegration always disabled in postiMode
102+
IF (postiMode) THEN
103+
OverintegrationType = OVERINTEGRATIONTYPE_NONE
104+
RETURN
105+
END IF
106+
104107
SWRITE(UNIT_stdOut,'(132("-"))')
105108
SWRITE(UNIT_stdOut,'(A)') ' INIT OVERINTEGRATION...'
106109

src/filter/filter.f90

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ SUBROUTINE FilterInt(U_in,FilterMat)
3434

3535
!----------------------------------------------------------------------------------------------------------------------------------
3636

37-
INTEGER,PARAMETER :: FILTERTYPE_NONE = 0
38-
INTEGER,PARAMETER :: FILTERTYPE_CUTOFF = 1
39-
INTEGER,PARAMETER :: FILTERTYPE_MODAL = 2
40-
INTEGER,PARAMETER :: FILTERTYPE_LAF = 3
41-
4237
INTERFACE InitFilter
4338
MODULE PROCEDURE InitFilter
4439
END INTERFACE
@@ -126,9 +121,17 @@ SUBROUTINE InitFilter()
126121
CALL CollectiveStop(__STAMP__,'InitFilter not ready to be called or already called.')
127122
RETURN
128123
END IF
124+
125+
! Filter always disabled in postiMode
126+
IF (postiMode) THEN
127+
FilterType = FILTERTYPE_NONE
128+
RETURN
129+
END IF
130+
129131
SWRITE(UNIT_stdOut,'(132("-"))')
130132
SWRITE(UNIT_stdOut,'(A)') ' INIT FILTER...'
131133

134+
132135
FilterType = GETINTFROMSTR('FilterType')
133136

134137
! set the filterfunction pointer to the cut-off filter, even if the filter itself is not active
@@ -181,9 +184,9 @@ SUBROUTINE InitFilter()
181184
END DO ! j
182185
END DO ! k
183186
IntegrationWeight(:,:,:,iElem,0) = IntegrationWeight(:,:,:,iElem,0) / Vol
184-
END DO !iElem
187+
END DO ! iElem
185188

186-
! Compute normalization for LAF
189+
! Compute normalization for LAF
187190
normMod=((REAL(NFilter)+1)**(-2./3.)-2.**(-2./3.))/(REAL(PP_N+1)**(-2./3.)-REAL(NFilter+1)**(-2./3.))
188191
lim=1E-8
189192
eRatio=0.
@@ -518,6 +521,7 @@ SUBROUTINE Filter_Selective(NVar,FilterMat,U_in,filter_ind)
518521
END IF
519522
END SUBROUTINE Filter_Selective
520523

524+
521525
!==================================================================================================================================
522526
!> Deallocate filter arrays
523527
!==================================================================================================================================

src/flexi.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,15 @@
144144
#define KILL(x) SWRITE(*,*) __FILE__,__LINE__,x; stop
145145

146146
! overintegration
147-
#define CUTOFF 1
148-
#define CUTOFFCONS 2
147+
#define OVERINTEGRATIONTYPE_NONE 0
148+
#define OVERINTEGRATIONTYPE_CUTOFF 1
149+
#define OVERINTEGRATIONTYPE_CONSCUTOFF 2
150+
151+
! filter
152+
#define FILTERTYPE_NONE 0
153+
#define FILTERTYPE_CUTOFF 1
154+
#define FILTERTYPE_MODAL 2
155+
#define FILTERTYPE_LAF 3
149156

150157
! PURE debug switch
151158
#if DEBUG

src/implicit/implicit.f90

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ MODULE MOD_Implicit
5858
SUBROUTINE DefineParametersImplicit()
5959
! MODULES
6060
USE MOD_ReadInTools ,ONLY: prms
61+
! IMPLICIT VARIABLE HANDLING
6162
IMPLICIT NONE
6263
!==================================================================================================================================
6364
CALL prms%SetSection("Implicit")
@@ -81,37 +82,45 @@ SUBROUTINE DefineParametersImplicit()
8182

8283
END SUBROUTINE DefineParametersImplicit
8384

85+
8486
!===================================================================================================================================
8587
!> Initialize implicit time integration. Mainly read in parameters for the Newton and GMRES solvers and call preconditioner init.
8688
!===================================================================================================================================
8789
SUBROUTINE InitImplicit()
8890
! MODULES
8991
USE MOD_Globals
9092
USE MOD_PreProc
93+
USE MOD_DG_Vars, ONLY: nDOFElem
94+
USE MOD_Filter_Vars, ONLY: FilterType
9195
USE MOD_Implicit_Vars
92-
USE MOD_Mesh_Vars, ONLY:MeshInitIsDone,nElems,nGlobalElems
93-
USE MOD_Interpolation_Vars,ONLY:InterpolationInitIsDone
94-
USE MOD_ReadInTools, ONLY:GETINT,GETREAL,GETLOGICAL
95-
USE MOD_DG_Vars, ONLY:nDOFElem
96-
USE MOD_TimeDisc_Vars, ONLY:TimeDiscType,RKb_embedded
97-
USE MOD_Precond, ONLY:InitPrecond
96+
USE MOD_Interpolation_Vars,ONLY: InterpolationInitIsDone
97+
USE MOD_Mesh_Vars, ONLY: MeshInitIsDone,nElems,nGlobalElems
98+
USE MOD_Precond, ONLY: InitPrecond
99+
USE MOD_ReadInTools, ONLY: GETINT,GETREAL,GETLOGICAL
100+
USE MOD_TimeDisc_Vars, ONLY: TimeDiscType,RKb_embedded
98101
! IMPLICIT VARIABLE HANDLING
99102
IMPLICIT NONE
100103
!-----------------------------------------------------------------------------------------------------------------------------------
101104
! INPUT VARIABLES
102-
103105
!-----------------------------------------------------------------------------------------------------------------------------------
104106
! OUTPUT VARIABLES
105107
!-----------------------------------------------------------------------------------------------------------------------------------
106108
! LOCAL VARIABLES
107109
!===================================================================================================================================
108-
IF((.NOT.InterpolationInitIsDone).OR.(.NOT.MeshInitIsDone).OR.ImplicitInitIsDone)THEN
110+
IF (.NOT.InterpolationInitIsDone .OR. .NOT.MeshInitIsDone .OR.ImplicitInitIsDone) &
109111
CALL Abort(__STAMP__,'InitImplicit not ready to be called or already called.')
110-
END IF
112+
111113
IF(TimeDiscType.EQ.'ESDIRK') THEN
112114
SWRITE(UNIT_stdOut,'(132("-"))')
113115
SWRITE(UNIT_stdOut,'(A)') ' INIT Implicit...'
114116

117+
SELECT CASE(FilterType)
118+
CASE(FILTERTYPE_NONE,FILTERTYPE_CUTOFF)
119+
! Do nothing
120+
CASE DEFAULT
121+
CALL Abort(__STAMP__,'Only no or spectral cutoff filtering support with implicit time stepping!')
122+
END SELECT
123+
115124
nDOFVar1D = PP_nVar*(PP_N+1)
116125
nDOFVarElem = PP_nVar*nDOFElem
117126
nDOFVarProc = nDOFVarElem*nElems
@@ -198,6 +207,7 @@ SUBROUTINE InitImplicit()
198207
END IF
199208
END SUBROUTINE InitImplicit
200209

210+
201211
!===================================================================================================================================
202212
!> Solves the non-linear system with Newton
203213
!> Root function: F_Xk = Xk - Q- alpha * dt* R_Xk(t+beta*dt,Xk) = 0!
@@ -348,6 +358,7 @@ SUBROUTINE Newton(t,Alpha)
348358

349359
END SUBROUTINE Newton
350360

361+
351362
!===================================================================================================================================
352363
!> Matrix free Linear Krylov subspace solver
353364
!> A * y = b

tutorials/taylorgreenvortex/parameter_flexi.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ NVisu = 12
2020
! =============================================================================== !
2121
OverintegrationType = 0 ! 0:off 1:cut-off filter 2: conservative cut-off 3: advective
2222
! flux only
23-
NOver = 11 ! overintegration for volume fluxes (NOver>N) for type 3
2423
NUnder = 7 ! specifies effective polydeg (modes > NUnder are thrown away)
2524
! for types 1 and 2
2625
NOut = -1 ! Change output poly deg to save memory:

0 commit comments

Comments
 (0)