Changes between Version 52 and Version 53 of ModulesOnAstroBear


Ignore:
Timestamp:
04/24/17 16:24:10 (8 years ago)
Author:
Jonathan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • ModulesOnAstroBear

    v52 v53  
    432432  END SUBROUTINE
    433433}}}
     434
     435We can also use the ApplyEMF or ApplyBField routines just as we would use ApplyTemplate but the subroutine should return either the Vector Potential (EMF) or the B field respectively.  You should only use ApplyBField if your B-Field is constant - otherwise use the vector potential with ApplyEMF.
     436
     437{{{
     438  SUBROUTINE ProblemGridInit(Info)
     439    CALL ApplyEMF(myEMF, Info)
     440  END SUBROUTINE
     441
     442  SUBROUTINE myEMF(pos, t, dt, q)
     443    REAL(KIND=qPREC), DIMENSION(:) :: pos
     444    REAL(KIND=qPREC), DIMENSION(:) :: q
     445    REAL(KIND=qPREC) :: t, dt
     446    q=(/0d0,0d0,cos(pos(1))/)
     447  END SUBROUTINE myEMF
     448}}}
     449
     450
     451
     452
    434453 * Note that if {{{MaintainAuxArrays}}} is false then we don't have to worry about aux fields and we can just initialize the q values with volume averaged (or cell-centered).  Currently this only happens in 1D.
    435454 * If {{{MaintainAuxArrays}}} is true then we must initialize all of Info%aux surrounding the '''core''' region.  So first we set the Bx and Bz aux fields to zero.