Changes between Version 2 and Version 3 of UniformRegions
- Timestamp:
- 05/04/11 16:31:29 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UniformRegions
v2 v3 3 3 = Uniform Regions = 4 4 5 As its name implies, the {{{UniformRegion}}} object defines a region where the hydrodynamic variables are constant. The region itself is defined by a [wiki:Shape 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()}}}). 5 == Description == 6 As its name implies, the {{{UniformRegion}}} object defines a region where the hydrodynamic variables are constant. The region itself is defined by a [wiki:Shape Shape] object that is instantiated when {{{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()}}}). 6 7 7 8 [[BR]] 8 9 9 == Object Definitions == 10 {{{UniformRegion}}}: 10 == Object API == 11 [[BR]] 12 === Definition === 13 11 14 {{{ 12 TYPE(ShapeDef), POINTER :: Shape 13 REAL(KIND=qPREC), DIMENSION(:), ALLOCATABLE :: q 14 INTEGER :: SubSample = 1 15 LOGICAL :: PersistInBoundaries = .false. 16 LOGICAL :: PersistInternal = .false. 15 TYPE UniformRegion { 16 TYPE(ShapeDef), POINTER :: Shape 17 REAL(KIND=qPREC), DIMENSION(:), ALLOCATABLE :: q 18 INTEGER :: SubSample = 1 19 LOGICAL :: PersistInBoundaries = .false. 20 LOGICAL :: PersistInternal = .false. 21 } 17 22 }}} 18 23 … … 26 31 27 32 * ''{{{PersistInternal}}}'': Indicates whether the uniform region is persistent. Under this option, {{{beforeStep()}}} will enforce the uniform region within a grid's [GhostZone ghost regions] as well. By default, this option is turned off. 33 [[BR]] 34 === Methods === 35 36 * ''{{{InitUniformRegions()}}}'': 37 38 * ''{{{ CreateUniformRegion(UniformRegion)}}}'': 39 40 * ''{{{AddUniformRegionObjToList(UniformRegionObj)}}}'': 41 42 * ''{{{RemoveUniformRegionObjFromList(UniformRegionObj)}}}'': 43 44 * ''{{{DestroyUniformRegionObject(UniformRegionObj)}}}'': 45 46 * ''{{{UniformRegionGridInit(Info)}}}'': 47 48 * ''{{{UniformRegionBeforeStep(Info)}}}'': 49 50 * ''{{{PlaceUniformRegion(Info, UniformRegion, location)}}}'': 51 28 52 29 53 [[BR]] 30 54 == How to Use this Object == 31 55 32 The uniform regions object contains a ShapeObjectthat 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.56 The uniform regions object contains a [ShapeObjects Shape object] 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. 33 57 If !PersistInternal is true then the values are maintained wherever the object exists. 34 58 35 59 {{{ 36 60 SUBROUTINE ProblemModuleInit() 37 TYPE(UniformRegionDef), POINTER :: UniformRegion 61 TYPE(UniformRegionDef), POINTER :: UniformRegion 62 38 63 CALL CreateUniformRegion(UniformRegion) 64 39 65 UniformRegion%q(1:NrHydroVars)=qout(1:NrHydroVars) 40 66 UniformRegion%q(1)=density 67 41 68 CALL SetShapeType(UniformRegion%Shape, CIRCLE, radius) 42 69 CALL SetShapeOrientation(UniformRegion%Shape, psi, theta, phi) 43 70 SplitRegion%Shape%Position=position 71 44 72 CALL SetShapeBounds(UniformRegion%Shape) 45 73 END SUBROUTINE ProblemModuleInit 46 74 }}} 47 75 48 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. 76 When you call {{{CreateUniformRegion()}}} it instantiates all the pointer/allocatable attributes of a {{{UniformRegion}}} object and adds it to a global list of {{{UniformRegion}}} objects. The {{{UniformRegion%q}}} array is allocated with {{{NrHydroVars}}} elements. 77 78 As of revision 566, the user must manually set the values for {{{UniformRegion%q}}} (see the example above). Configuring the {{{UniformRegion%Shape}}} object is also the user's responsibility. 79 80