51 #if defined(HAVE_FFTW) 63 LOGICAL :: update_disk_height
68 REAL,
DIMENSION(:,:,:),
POINTER :: invr
69 INTEGER :: use_envelope
74 procedure(infosources),
DEFERRED :: infosources
76 procedure(externalsources_single),
DEFERRED :: externalsources_single
78 procedure(calctimestep_single),
DEFERRED :: calctimestep_single
84 SUBROUTINE infosources(this,Mesh)
88 CLASS(Sources_base),
INTENT(IN) :: this
89 CLASS(Mesh_base),
INTENT(IN) :: Mesh
91 SUBROUTINE calctimestep_single(this,Mesh,Physics,Fluxes,pvar,cvar,time,dt)
95 CLASS(sources_base),
INTENT(INOUT) :: this
96 CLASS(mesh_base),
INTENT(IN) :: Mesh
97 CLASS(physics_base),
INTENT(INOUT) :: Physics
98 CLASS(fluxes_base),
INTENT(IN) :: Fluxes
99 CLASS(marray_compound),
INTENT(INOUT) :: pvar,cvar
100 REAL,
INTENT(IN) :: time
101 REAL,
INTENT(OUT) :: dt
103 SUBROUTINE externalsources_single(this,Mesh,Physics,Fluxes,Sources,time,dt,pvar,cvar,sterm)
107 CLASS(sources_base),
INTENT(INOUT) :: this
108 CLASS(mesh_base),
INTENT(IN) :: Mesh
109 CLASS(physics_base),
INTENT(INOUT) :: Physics
110 CLASS(sources_base),
INTENT(INOUT) :: Sources
111 CLASS(fluxes_base),
INTENT(IN) :: Fluxes
112 REAL,
INTENT(IN) :: time, dt
113 CLASS(marray_compound),
INTENT(INOUT):: pvar,cvar,sterm
119 CLASS(sources_base),
INTENT(INOUT) :: this
150 SUBROUTINE initsources(this,Mesh,Fluxes,Physics,config,IO)
153 CLASS(sources_base),
INTENT(IN) :: this
154 CLASS(mesh_base),
INTENT(IN) :: Mesh
155 CLASS(fluxes_base),
INTENT(IN) :: Fluxes
156 CLASS(physics_base),
INTENT(IN) :: Physics
157 TYPE(Dict_TYP),
POINTER :: config, IO
159 CALL physics%new_statevector(
temp_sterm,conservative)
161 CALL this%Info(
" SOURCES--> source term: " // this%GetName())
162 CALL this%InfoSources(mesh)
166 SUBROUTINE externalsources(this,Mesh,Fluxes,Physics,time,dt,pvar,cvar,sterm)
169 CLASS(sources_base),
TARGET,
INTENT(INOUT) :: this
170 CLASS(mesh_base),
INTENT(IN) :: Mesh
171 CLASS(fluxes_base),
INTENT(IN) :: Fluxes
172 CLASS(physics_base),
INTENT(INOUT) :: Physics
173 REAL,
INTENT(IN) :: time,dt
174 CLASS(marray_compound),
INTENT(INOUT) :: pvar,cvar,sterm
176 CLASS(Sources_base),
POINTER :: srcptr
179 sterm%data1d(:) = 0.0
182 DO WHILE (
ASSOCIATED(srcptr))
184 CALL srcptr%ExternalSources_single(mesh,physics,fluxes,this,time,dt,pvar,cvar,
temp_sterm)
187 sterm%data1d(:) = sterm%data1d(:) +
temp_sterm%data1d(:)
190 srcptr => srcptr%next
194 IF (mesh%GINUM.GT.0)
THEN 195 sterm%data4d(mesh%IGMIN:mesh%IMIN-mesh%IP1,:,:,:) = 0.0
196 sterm%data4d(mesh%IMAX+mesh%IP1:mesh%IGMAX,:,:,:) = 0.0
198 IF (mesh%GJNUM.GT.0)
THEN 199 sterm%data4d(:,mesh%JGMIN:mesh%JMIN-mesh%JP1,:,:) = 0.0
200 sterm%data4d(:,mesh%JMAX+mesh%JP1:mesh%JGMAX,:,:) = 0.0
202 IF (mesh%GKNUM.GT.0)
THEN 203 sterm%data4d(:,:,mesh%KGMIN:mesh%KMIN-mesh%KP1,:) = 0.0
204 sterm%data4d(:,:,mesh%KMAX+mesh%KP1:mesh%KGMAX,:) = 0.0
209 SUBROUTINE calctimestep(this,Mesh,Physics,Fluxes,pvar,cvar,time,dt,dtcause)
212 CLASS(sources_base),
TARGET,
INTENT(IN) :: this
213 CLASS(mesh_base),
INTENT(IN) :: Mesh
214 CLASS(physics_base),
INTENT(INOUT) :: Physics
215 CLASS(fluxes_base),
INTENT(IN) :: Fluxes
216 CLASS(marray_compound),
INTENT(INOUT) :: pvar,cvar
217 REAL,
INTENT(IN) :: time
218 REAL,
INTENT(OUT) :: dt
219 INTEGER,
INTENT(OUT) :: dtcause
221 CLASS(Sources_base),
POINTER :: srcptr
228 DO WHILE(
ASSOCIATED(srcptr))
230 CALL srcptr%CalcTimestep_single(mesh,physics,fluxes,pvar,cvar,time,dt_new)
233 IF (dt_new .LT. dt) dtcause=srcptr%GetType()
236 srcptr => srcptr%next
246 INTEGER,
INTENT(IN) :: stype
250 IF (
ASSOCIATED(sp).EQV..false.)
EXIT 252 IF (sp%GetType().EQ.stype)
RETURN 261 CLASS(sources_base),
INTENT(INOUT) :: this
263 IF (.NOT.this%Initialized()) &
264 CALL this%Error(
"sources_base::Finalize_base",
"not initialized")
integer, parameter, public disk_cooling
subroutine finalize(this)
Destructor of common class.
subroutine calctimestep(this, Mesh, Physics, Fluxes, pvar, cvar, time, dt, dtcause)
class(marray_compound), pointer, save temp_sterm
generic source terms module providing functionaly common to all source terms
derived class for compound of mesh arrays
base class for mesh arrays
integer, parameter, public rotating_frame
generic gravity terms module providing functionaly common to all gravity terms
subroutine initsources(this, Mesh, Fluxes, Physics, config, IO)
Initialize data in sources.
integer, parameter, public gravity
subroutine finalize_base(this)
Destructor.
integer, parameter, public viscosity
named integer constants for flavour of state vectors
class(sources_base) function, pointer getsourcespointer(list, stype)
Dictionary for generic data types.
subroutine externalsources(this, Mesh, Fluxes, Physics, time, dt, pvar, cvar, sterm)
integer, parameter, public shearbox
base module for numerical flux functions
integer, parameter, public c_accel