Changes between Version 17 and Version 18 of ModulesOnAstroBear


Ignore:
Timestamp:
07/12/11 20:11:21 (14 years ago)
Author:
ehansen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • ModulesOnAstroBear

    v17 v18  
    6060There are two major data arrays in {{{InfoDef}}}: the {{{q}}} array and the {{{aux}}} array.  {{{q}}} holds the cell-centered data and is used by all AstroBEAR simulations.  The {{{q}}} array takes the form {{{q(x,y,z,variable)}}} where {{{variable}}} is itself a 1D array that holds the physical quantities such as density, momentum, energy, etc. The order of the quantities in the {{{variable}}} array is {{{(rho, px, py, pz, E)}}}. An integer or a specific character can be used for {{{variable}}}.  The characters that can be used are {{{irho, ivx, ivy, ivz, iE}}} respectively.  So for example, the following two statements are equivalent:
    6161{{{
    62 Info%q(x,y,z,3) = 2
    63 
    64 Info%q(x,y,z,ivy) = 2
    65 }}}
    66 They both put the value 2 into the place in {{{q}}} that is reserved for the y-component of momentum.  Note that in order to use these character indices, the following statement is required at the beginning of {{{problem.f90}}}:
    67 
    68 {{{
    69 USE GlobalDeclarations
     62Info%q(x,y,z,3) = 2.0
     63
     64Info%q(x,y,z,ivy) = 2.0
     65}}}
     66They both place the value 2.0 into the position in {{{q}}} that is reserved for the y-component of momentum.  Note that in order to use these character indices, the following statement is required at the beginning of {{{problem.f90}}}:
     67
     68{{{
     69USE PhysicsDeclarations
    7070}}}
    7171
     
    213213The best way to understand how a module works is by example. The following example is a module for the Rayleigh-Taylor instability.
    214214
    215 {{{
    216 ! DataDeclarations makes the InfoDef type available, GlobalDeclarations is required for grid information,
    217 ! and PhysicsDeclarations is useful for certain physical quantities like gamma.
    218 USE DataDeclarations
    219 USE GlobalDeclarations
    220 USE PhysicsDeclarations
    221 IMPLICIT NONE
    222 
    223   ! Initialize the module variables
    224   SUBROUTINE ProblemModuleInit(Info)
    225   END SUBROUTINE ProblemModuleInit
    226 
    227   ! Initialize the grid
    228   SUBROUTINE ProblemGridInit(Info)
    229   END SUBROUTINE ProblemGridInit
    230 
    231   ! Use for pre-processing (this is an example of leaving a routine as a stub)
    232   SUBROUTINE ProblemBeforeStep(Info)
    233   END SUBROUTINE ProblemBeforeStep
    234 
    235   ! Use for post-processing
    236   SUBROUTINE ProblemAfterStep(Info)
    237   END SUBROUTINE ProblemAfterStep
    238 
    239   ! Use for additional refinement
    240   SUBROUTINE ProblemSetErrFlag(Info)
    241   END SUBROUTINE ProblemSetErrFlag
    242 }}}
     215[[Image()]]
    243216
    244217=== Additional Physics ===