Changes between Version 1 and Version 2 of AmbientObjects


Ignore:
Timestamp:
10/12/12 15:04:24 (12 years ago)
Author:
idilernia
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • AmbientObjects

    v1 v2  
    1313   TYPE AmbientDef
    1414      REAL(KIND=qPREC) :: density=1d0
    15       REAL(KIND=qPREC) :: v(3)=0d0
     15      REAL(KIND=qPREC) :: velocity(3)=0d0
    1616      REAL(KIND=qPREC) :: pressure=1d0
    1717      REAL(KIND=qPREC) :: B(3) = 0d0
    18       INTEGER :: iTracer=0
     18      ...
    1919   END TYPE AmbientDef
    2020}}}
     
    2525== How to Use this Object ==
    2626
    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...
     27This 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
     29A simple call initializes this object:
     30
     31{{{ CreateAmbient(Ambient, [density, pressure]) }}}
     32
     33Other attributes can be set directly by accessing this object after instantiation, below is a quick example:
    2834
    2935{{{
    30 SUBROUTINE ProblemModuleInit()
    31   TYPE(AmbientDef), POINTER :: Ambient
     36...
     37  TYPE(AmbientDef), POINTER :: myAmbient !Pointer to ambient object
    3238
    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
    3943
    4044  CALL AddTracer(Ambient%iTracer, 'Ambient Tracer')
    41 
    42 END SUBROUTINE ProblemModuleInit
     45...
    4346}}}
    4447
    4548Grids 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
     53AstroBEAR 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{{{
     56TYPE(AmbientDef), POINTER :: myAmbient             !ambient object pointer
     57TYPE(ProfileDef), POINTER :: hydrostaticProfile    !profile object pointer
     58...
     59Ambient%profile => hydrostaticProfile              !association
     60...
     61}}}
     62