wiki:UniformRegions

Version 3 (modified by Brandon Shroyer, 14 years ago) ( diff )

Uniform Regions

Description

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 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()).


Object API


Definition

TYPE 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 for SubSample 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.


Methods

  • InitUniformRegions():
  • CreateUniformRegion(UniformRegion):
  • AddUniformRegionObjToList(UniformRegionObj):
  • RemoveUniformRegionObjFromList(UniformRegionObj):
  • DestroyUniformRegionObject(UniformRegionObj):
  • UniformRegionGridInit(Info):
  • UniformRegionBeforeStep(Info):
  • PlaceUniformRegion(Info, UniformRegion, location):


How to Use this Object

The uniform regions object contains a 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. 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 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.

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.

Note: See TracWiki for help on using the wiki.