Changes between Version 1 and Version 2 of AmbientObjects
- Timestamp:
- 10/12/12 15:04:24 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AmbientObjects
v1 v2 13 13 TYPE AmbientDef 14 14 REAL(KIND=qPREC) :: density=1d0 15 REAL(KIND=qPREC) :: v (3)=0d015 REAL(KIND=qPREC) :: velocity(3)=0d0 16 16 REAL(KIND=qPREC) :: pressure=1d0 17 17 REAL(KIND=qPREC) :: B(3) = 0d0 18 INTEGER :: iTracer=018 ... 19 19 END TYPE AmbientDef 20 20 }}} … … 25 25 == How to Use this Object == 26 26 27 This object is perhaps the simplest to use since it has no shape. One only has to create the ambient object and modify its default values as necessary (and potentially add a tracer field) as follows... 27 This object is perhaps the simplest to use since it has no shape. One only has to create the ambient object and modify its default values as necessary (and potentially add a tracer field). 28 29 A simple call initializes this object: 30 31 {{{ CreateAmbient(Ambient, [density, pressure]) }}} 32 33 Other attributes can be set directly by accessing this object after instantiation, below is a quick example: 28 34 29 35 {{{ 30 SUBROUTINE ProblemModuleInit() 31 TYPE(AmbientDef), POINTER :: Ambient36 ... 37 TYPE(AmbientDef), POINTER :: myAmbient !Pointer to ambient object 32 38 33 CALL CreateAmbient(Ambient) 34 35 Ambient%density=10 36 Ambient%pressure=100 37 Ambient%B(:)=(/1d0, 0d0, 0d0/) 38 Ambient%v(:)=(/0d0, 0d0, 0d0/) 39 CreateAmbient(myAmbient, 1d0, 2d0) !Creates an ambient instance with density=1, and pressure=2 40 41 Ambient%B(:)=(/0d0, 0d0, 0d0/) !Magnetic field settings 42 Ambient%velocity(:)=(/0d0, 0d0, 0d0/) !Ambient velocity settings 39 43 40 44 CALL AddTracer(Ambient%iTracer, 'Ambient Tracer') 41 42 END SUBROUTINE ProblemModuleInit 45 ... 43 46 }}} 44 47 45 48 Grids then will be initialized with the correct energy etc... before being passed into the various other grid initialization routines. 49 50 51 == Ambient profiles == 52 53 AstroBEAR offers the possibility of instantiating ambient objects with custom density and pressure profiles. To do this, it is necessary to associate an ambient object with a profile object. 54 55 {{{ 56 TYPE(AmbientDef), POINTER :: myAmbient !ambient object pointer 57 TYPE(ProfileDef), POINTER :: hydrostaticProfile !profile object pointer 58 ... 59 Ambient%profile => hydrostaticProfile !association 60 ... 61 }}} 62