Version 2 (modified by 14 years ago) ( diff ) | ,
---|
Uniform Regions
As its name implies, the UniformRegion
object defines a region where the hydrodynamic variables are constant. The region itself is defined by a Shape object passed in when the UniformRegion
is created. The UniformRegion
can be used as a one-shot or it can be made persistent, in which case it would be renewed before every step (i.e., by a subroutine called in beforeStep()
).
Object Definitions
UniformRegion
:
TYPE(ShapeDef), POINTER :: Shape REAL(KIND=qPREC), DIMENSION(:), ALLOCATABLE :: q INTEGER :: SubSample = 1 LOGICAL :: PersistInBoundaries = .false. LOGICAL :: PersistInternal = .false.
- *
Shape
: A pointer to a Shape object that defines the dimensions of the region this object will keep uniform.
q
: A state vector containing the hydrodynamic variable values this object will enforce within the uniform region.
SubSample
: An integer value used to determine the sub-sampling resolution. The default value forSubSample
is 1.
PersistInBoundaries
: Indicates whether the uniform region is persistent. Under this option,beforeStep()
only enforces the uniform region up to a grid's physical boundaries. By default, this option is turned off.
PersistInternal
: Indicates whether the uniform region is persistent. Under this option,beforeStep()
will enforce the uniform region within a grid's ghost regions as well. By default, this option is turned off.
How to Use this Object
The uniform regions object contains a ShapeObject that defines where the uniform value q
is to be applied. The SubSample defines how many sub cells in each direction are sampled. If PersistInBoundaries is true then anywhere the object overlaps with physical boundaries - the values are maintained during the simulation.
If PersistInternal is true then the values are maintained wherever the object exists.
SUBROUTINE ProblemModuleInit() TYPE(UniformRegionDef), POINTER :: UniformRegion CALL CreateUniformRegion(UniformRegion) UniformRegion%q(1:NrHydroVars)=qout(1:NrHydroVars) UniformRegion%q(1)=density CALL SetShapeType(UniformRegion%Shape, CIRCLE, radius) CALL SetShapeOrientation(UniformRegion%Shape, psi, theta, phi) SplitRegion%Shape%Position=position CALL SetShapeBounds(UniformRegion%Shape) END SUBROUTINE ProblemModuleInit
When you call CreateUniformRegion it adds the uniform region to a list and then automatically handles the initialization and the necessary boundary conditions. There is nothing else you have to do.