recalculateB Subroutine

public subroutine recalculateB()

Uses

  • proc~~recalculateb~~UsesGraph proc~recalculateb recalculateB mod_physics mod_physics proc~recalculateb->mod_physics module~mod_fix_conserve mod_fix_conserve proc~recalculateb->module~mod_fix_conserve module~mod_ghostcells_update mod_ghostcells_update proc~recalculateb->module~mod_ghostcells_update module~mod_global_parameters mod_global_parameters proc~recalculateb->module~mod_global_parameters module~mod_mpi_wrapper mod_mpi_wrapper module~mod_fix_conserve->module~mod_mpi_wrapper module~mod_ghostcells_update->module~mod_mpi_wrapper module~mod_basic_types mod_basic_types module~mod_global_parameters->module~mod_basic_types module~mod_connectivity mod_connectivity module~mod_global_parameters->module~mod_connectivity module~mod_constants mod_constants module~mod_global_parameters->module~mod_constants module~mod_physicaldata mod_physicaldata module~mod_global_parameters->module~mod_physicaldata module~mod_variables mod_variables module~mod_global_parameters->module~mod_variables mpi mpi module~mod_global_parameters->mpi module~mod_mpi_wrapper->mpi module~mod_variables->module~mod_basic_types

re-calculate the magnetic field from the vector potential in a completely divergency free way

Arguments

None

Calls

proc~~recalculateb~~CallsGraph proc~recalculateb recalculateB phys_face_to_center phys_face_to_center proc~recalculateb->phys_face_to_center phys_to_conserved phys_to_conserved proc~recalculateb->phys_to_conserved phys_to_primitive phys_to_primitive proc~recalculateb->phys_to_primitive proc~fake_advance fake_advance proc~recalculateb->proc~fake_advance proc~fix_conserve fix_conserve proc~recalculateb->proc~fix_conserve proc~fix_edges fix_edges proc~recalculateb->proc~fix_edges proc~getbc getbc proc~recalculateb->proc~getbc proc~init_comm_fix_conserve init_comm_fix_conserve proc~recalculateb->proc~init_comm_fix_conserve proc~recvflux recvflux proc~recalculateb->proc~recvflux proc~sendflux sendflux proc~recalculateb->proc~sendflux proc~fake_update fake_update proc~fake_advance->proc~fake_update proc~store_edge store_edge proc~fake_advance->proc~store_edge proc~store_flux store_flux proc~fake_advance->proc~store_flux mpi_get_count mpi_get_count proc~fix_conserve->mpi_get_count mpi_waitall mpi_waitall proc~fix_conserve->mpi_waitall proc~mpistop mpistop proc~fix_conserve->proc~mpistop proc~getbc->mpi_waitall mpi_wtime mpi_wtime proc~getbc->mpi_wtime phys_boundary_adjust phys_boundary_adjust proc~getbc->phys_boundary_adjust proc~fill_boundary_after_gc fill_boundary_after_gc proc~getbc->proc~fill_boundary_after_gc proc~fill_boundary_before_gc fill_boundary_before_gc proc~getbc->proc~fill_boundary_before_gc proc~fill_coarse_boundary fill_coarse_boundary proc~getbc->proc~fill_coarse_boundary proc~getintbc getintbc proc~getbc->proc~getintbc proc~idecode~2 idecode proc~getbc->proc~idecode~2 proc~mpi_irecv_wrapper mpi_irecv_wrapper proc~getbc->proc~mpi_irecv_wrapper proc~mpi_isend_wrapper mpi_isend_wrapper proc~getbc->proc~mpi_isend_wrapper proc~nvtxendrange~2 nvtxEndRange proc~getbc->proc~nvtxendrange~2 proc~nvtxstartrange~2 nvtxStartRange proc~getbc->proc~nvtxstartrange~2 proc~skip_direction skip_direction proc~getbc->proc~skip_direction proc~build_message_layout build_message_layout proc~init_comm_fix_conserve->proc~build_message_layout proc~init_comm_fix_conserve->proc~mpistop proc~recvflux->proc~mpi_irecv_wrapper proc~sendflux->proc~mpi_isend_wrapper proc~build_message_layout->proc~mpistop proc~layout_runs layout_runs proc~build_message_layout->proc~layout_runs proc~b_from_vector_potentiala b_from_vector_potentialA proc~fake_update->proc~b_from_vector_potentiala proc~bc_phys bc_phys proc~fill_boundary_after_gc->proc~bc_phys proc~fill_boundary_before_gc->proc~bc_phys proc~fill_coarse_boundary->proc~bc_phys proc~sync_positions_host sync_positions_host proc~getintbc->proc~sync_positions_host mpi_irecv mpi_irecv proc~mpi_irecv_wrapper->mpi_irecv mpi_isend mpi_isend proc~mpi_isend_wrapper->mpi_isend mpi_abort mpi_abort proc~mpistop->mpi_abort proc~b_from_vector_potentiala->proc~mpistop specialbound_usr specialbound_usr proc~bc_phys->specialbound_usr proc~rank_keys rank_keys proc~layout_runs->proc~rank_keys

Called by

proc~~recalculateb~~CalledByGraph proc~recalculateb recalculateB proc~improve_initial_condition improve_initial_condition proc~improve_initial_condition->proc~recalculateb proc~main main proc~main->proc~improve_initial_condition program~agile agile program~agile->proc~main

Source Code

  subroutine recalculateB
    use mod_global_parameters
    use mod_fix_conserve
    use mod_physics
    use mod_ghostcells_update

    integer :: igrid,iigrid

    call init_comm_fix_conserve(1,ndim,3)

    do iigrid=1,igridstail; igrid=igrids(iigrid);
       ! Make zero the magnetic fluxes
       ! Fake advance, storing electric fields at edges
       block=>ps(igrid)
       call fake_advance(igrid,1,3,ps(igrid))

    end do

    ! Do correction
    call recvflux(1,ndim)
    call sendflux(1,ndim)
    call fix_conserve(1,1,ndim,1,3)

    call fix_edges(ps,1,3)

    ! Now we fill the centers for the staggered variables
    do iigrid=1,igridstail_active; igrid=igrids_active(iigrid);
       call phys_to_primitive(ixGlo1,ixGlo2,ixGlo3,ixGhi1,ixGhi2,ixGhi3,ixMlo1,&
          ixMlo2,ixMlo3,ixMhi1,ixMhi2,ixMhi3,ps(igrid)%w,ps(igrid)%x)
       ! update cell center magnetic field
       call phys_face_to_center(ixMlo1,ixMlo2,ixMlo3,ixMhi1,ixMhi2,ixMhi3,&
          ps(igrid))
       call phys_to_conserved(ixGlo1,ixGlo2,ixGlo3,ixGhi1,ixGhi2,ixGhi3,ixMlo1,&
          ixMlo2,ixMlo3,ixMhi1,ixMhi2,ixMhi3,ps(igrid)%w,ps(igrid)%x)
    end do

    call getbc(global_time,0.d0,ps,iwstart,nwgc)

  end subroutine recalculateB