├── .editorconfig ├── .github └── workflows │ ├── dependencies │ ├── dependencies.sh │ ├── dependencies_clang6.sh │ ├── dependencies_dpcpp.sh │ ├── dependencies_gcc10.sh │ ├── dependencies_hip.sh │ ├── dependencies_mac.sh │ ├── dependencies_nofortran.sh │ ├── dependencies_nvcc.sh │ └── documentation.sh │ ├── docs.yml │ ├── id_most_recent_comment_on_PR.sh │ ├── linux.yml │ ├── macos.yml │ ├── pr-comment-trigger-gitlab.yml │ ├── style.yml │ ├── style │ ├── check_tabs.sh │ └── check_trailing_whitespaces.sh │ └── windows.yml ├── .gitignore ├── .gitpod.dependencies.sh ├── .gitpod.dockerfile ├── .gitpod.yml ├── .jupyter └── jupyter_notebook_config.py ├── Docs ├── Makefile └── source │ ├── AMR_Tutorial.rst │ ├── Basic_Tutorial.rst │ ├── Basics │ ├── amrgrids.png │ ├── cc_growbox.png │ ├── cc_tilebox.png │ ├── cc_validbox.png │ ├── ec_growbox.png │ ├── ec_tilebox.png │ ├── ec_validbox.png │ ├── figs │ │ ├── flowchart.odg │ │ └── flowchart.png │ └── indextypes.png │ ├── Blueprint_Tutorial.rst │ ├── EB_Tutorial.rst │ ├── FFT_Tutorial.rst │ ├── ForkJoin_Tutorial.rst │ ├── GPU_Tutorial.rst │ ├── GuidedTutorials.rst │ ├── HeatEquation_EX1_C.rst │ ├── HeatEquation_Simple.rst │ ├── HelloWorld.rst │ ├── HelloWorld_CMake.rst │ ├── Hypre_Install.rst │ ├── LinearSolvers_Tutorial.rst │ ├── ML_Tutorial.rst │ ├── MPMD_Tutorials.rst │ ├── MUI_Tutorial.rst │ ├── MultiFab.rst │ ├── NamespaceMultidim.rst │ ├── Particles_Tutorial.rst │ ├── Python_Tutorial.rst │ ├── SDC_Tutorial.rst │ ├── SENSEI_Tutorial.rst │ ├── SUNDIALS_Tutorial.rst │ ├── _static │ └── theme_overrides.css │ ├── conf.py │ ├── figs │ ├── fork_join_tasks.png │ ├── iface_rect.png │ ├── mf_remap_hires.png │ └── nested_fork_join_tasks.png │ ├── images_tutorial │ ├── Cmake_make.png │ ├── MultiFabTutorialVideo.png │ ├── amrex-cmake-hello.gif │ ├── amrex-gnu-hello.gif │ ├── amrex_gitclone_instructions.png │ ├── heat_eq_plot.png │ ├── plot_dirs.png │ ├── token.png │ └── token_hl.png │ └── index.rst ├── ExampleCodes ├── Amr │ ├── Advection_AmrCore │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── GNUmakefile │ │ │ ├── GNUmakefile_movie │ │ │ ├── Make.Adv │ │ │ ├── Make.package │ │ │ ├── Prob.H │ │ │ ├── inputs │ │ │ ├── inputs_for_scaling │ │ │ └── paraview_amr101.py │ │ ├── README │ │ ├── README.md │ │ └── Source │ │ │ ├── AdvancePhiAllLevels.cpp │ │ │ ├── AdvancePhiAtLevel.cpp │ │ │ ├── AmrCoreAdv.H │ │ │ ├── AmrCoreAdv.cpp │ │ │ ├── DefineVelocity.cpp │ │ │ ├── Kernels.H │ │ │ ├── Make.package │ │ │ ├── Src_K │ │ │ ├── Adv_K.H │ │ │ ├── Make.package │ │ │ ├── compute_flux_2D_K.H │ │ │ ├── compute_flux_3D_K.H │ │ │ └── slope_K.H │ │ │ ├── Tagging.H │ │ │ ├── bc_fill.H │ │ │ ├── face_velocity.H │ │ │ └── main.cpp │ ├── Advection_AmrLevel │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── Make.Adv │ │ │ ├── SingleVortex │ │ │ │ ├── Adv_prob.cpp │ │ │ │ ├── GNUmakefile │ │ │ │ ├── Make.package │ │ │ │ ├── Prob.f90 │ │ │ │ ├── Prob_Parm.H │ │ │ │ ├── face_velocity_2d.f90 │ │ │ │ ├── face_velocity_2d_K.H │ │ │ │ ├── face_velocity_3d.f90 │ │ │ │ ├── face_velocity_3d_K.H │ │ │ │ ├── inputs │ │ │ │ ├── inputs.tracers │ │ │ │ └── probin │ │ │ └── UniformVelocity │ │ │ │ ├── Adv_prob.cpp │ │ │ │ ├── GNUmakefile │ │ │ │ ├── Make.package │ │ │ │ ├── Prob.f90 │ │ │ │ ├── Prob_Parm.H │ │ │ │ ├── face_velocity_2d.f90 │ │ │ │ ├── face_velocity_2d_K.H │ │ │ │ ├── face_velocity_3d.f90 │ │ │ │ ├── face_velocity_3d_K.H │ │ │ │ ├── inputs │ │ │ │ ├── inputs.regt │ │ │ │ ├── probdata.f90 │ │ │ │ └── probin │ │ ├── README │ │ └── Source │ │ │ ├── Adv.cpp │ │ │ ├── Adv_F.H │ │ │ ├── AmrLevelAdv.H │ │ │ ├── AmrLevelAdv.cpp │ │ │ ├── Kernels.H │ │ │ ├── LevelBldAdv.cpp │ │ │ ├── Make.package │ │ │ ├── Src_2d │ │ │ ├── Adv_2d.f90 │ │ │ ├── Make.package │ │ │ ├── compute_flux_2d.f90 │ │ │ └── slope_2d.f90 │ │ │ ├── Src_3d │ │ │ ├── Adv_3d.f90 │ │ │ ├── Make.package │ │ │ ├── compute_flux_3d.f90 │ │ │ └── slope_3d.f90 │ │ │ ├── Src_K │ │ │ ├── Adv_K.H │ │ │ ├── Make.package │ │ │ ├── flux_2d_K.H │ │ │ ├── flux_3d_K.H │ │ │ ├── slope_K.H │ │ │ └── tagging_K.H │ │ │ ├── Src_nd │ │ │ ├── Adv_nd.f90 │ │ │ ├── Make.package │ │ │ ├── Tagging_nd.f90 │ │ │ └── tagging_params.f90 │ │ │ ├── Tagging_params.cpp │ │ │ ├── bc_nullfill.cpp │ │ │ └── main.cpp │ └── Wave_AmrLevel │ │ ├── AmrLevelWave.H │ │ ├── AmrLevelWave.cpp │ │ ├── AmrWave.H │ │ ├── AmrWave.cpp │ │ ├── GNUmakefile │ │ ├── LevelBldWave.cpp │ │ ├── Make.package │ │ ├── README.md │ │ ├── Wave_advance.cpp │ │ ├── Wave_init.cpp │ │ ├── inputs │ │ └── main.cpp ├── Basic │ ├── HeatEquation_EX0_C │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── GNUmakefile │ │ │ └── inputs │ │ └── Source │ │ │ ├── Make.package │ │ │ ├── main.cpp │ │ │ └── myfunc.H │ ├── HeatEquation_EX1_C │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── GNUmakefile │ │ │ └── inputs │ │ └── Source │ │ │ ├── Make.package │ │ │ ├── main.cpp │ │ │ ├── myfunc.H │ │ │ ├── myfunc.cpp │ │ │ └── mykernel.H │ ├── HeatEquation_EX1_CF │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── GNUmakefile │ │ │ ├── inputs_2d │ │ │ └── inputs_3d │ │ └── Source │ │ │ ├── Make.package │ │ │ ├── advance.cpp │ │ │ ├── advance_2d.f90 │ │ │ ├── advance_3d.f90 │ │ │ ├── init_phi_2d.f90 │ │ │ ├── init_phi_3d.f90 │ │ │ ├── main.cpp │ │ │ ├── myfunc.H │ │ │ └── myfunc_F.H │ ├── HeatEquation_EX1_F │ │ ├── CMakeLists.txt │ │ ├── GNUmakefile │ │ ├── Make.package │ │ ├── advance.f90 │ │ ├── fmain.F90 │ │ ├── init_phi.f90 │ │ └── inputs │ ├── HeatEquation_EX2_C │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── GNUmakefile │ │ │ └── inputs │ │ └── Source │ │ │ ├── Make.package │ │ │ ├── main.cpp │ │ │ ├── myfunc.H │ │ │ ├── myfunc.cpp │ │ │ └── mykernel.H │ ├── HeatEquation_EX2_CF │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── GNUmakefile │ │ │ ├── inputs_2d │ │ │ └── inputs_3d │ │ └── Source │ │ │ ├── Make.package │ │ │ ├── advance.cpp │ │ │ ├── advance_2d.f90 │ │ │ ├── advance_3d.f90 │ │ │ ├── init_phi_2d.f90 │ │ │ ├── init_phi_3d.f90 │ │ │ ├── main.cpp │ │ │ ├── myfunc.H │ │ │ └── myfunc_F.H │ ├── HeatEquation_EX3_C │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── GNUmakefile │ │ │ ├── inputs_2d │ │ │ └── inputs_3d │ │ └── Source │ │ │ ├── Make.package │ │ │ ├── advance.cpp │ │ │ ├── init_phi.cpp │ │ │ ├── main.cpp │ │ │ ├── myfunc.H │ │ │ └── mykernel.H │ ├── HeatEquation_Restart │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── GNUmakefile │ │ │ └── inputs │ │ └── Source │ │ │ ├── Make.package │ │ │ ├── checkpoint.cpp │ │ │ ├── main.cpp │ │ │ └── myfunc.H │ ├── HelloWorld_C │ │ ├── CMakeLists.txt │ │ ├── GNUmakefile │ │ ├── Make.package │ │ └── main.cpp │ ├── HelloWorld_F │ │ ├── CMakeLists.txt │ │ ├── GNUmakefile │ │ ├── Make.package │ │ └── fmain.f90 │ ├── main_C │ │ ├── CMakeLists.txt │ │ ├── GNUmakefile │ │ ├── Make.package │ │ └── main.cpp │ └── main_F │ │ ├── CMakeLists.txt │ │ ├── GNUmakefile │ │ ├── Make.package │ │ └── main.F90 ├── Blueprint │ ├── AssignMultiLevelDensity │ │ ├── CMakeLists.txt │ │ ├── GNUmakefile │ │ ├── Make.package │ │ ├── inputs │ │ └── main.cpp │ ├── CellSortedParticles │ │ ├── CMakeLists.txt │ │ ├── CellSortedPC.H │ │ ├── CellSortedPC.cpp │ │ ├── GNUmakefile │ │ ├── Make.package │ │ ├── cell_sorted_3d.F90 │ │ ├── cell_sorted_F.H │ │ ├── inputs │ │ └── main.cpp │ ├── HeatEquation_EX1_C │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── GNUmakefile │ │ │ ├── inputs_2d │ │ │ └── inputs_3d │ │ └── Source │ │ │ ├── Make.package │ │ │ ├── advance.cpp │ │ │ ├── advance_2d.f90 │ │ │ ├── advance_3d.f90 │ │ │ ├── init_phi_2d.f90 │ │ │ ├── init_phi_3d.f90 │ │ │ ├── main.cpp │ │ │ ├── myfunc.H │ │ │ └── myfunc_F.H │ └── README.txt ├── CMakeLists.txt ├── EB │ ├── CNS │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── Combustor │ │ │ │ ├── GNUmakefile │ │ │ │ ├── Make.package │ │ │ │ ├── bc_fill_nd.F90 │ │ │ │ ├── bc_fill_nd.F90_jbb │ │ │ │ ├── cns_prob.F90 │ │ │ │ ├── cns_prob.F90_jbb │ │ │ │ ├── inputs │ │ │ │ └── inputs.regt │ │ │ ├── Make.CNS │ │ │ ├── Pulse │ │ │ │ ├── GNUmakefile │ │ │ │ ├── Make.package │ │ │ │ ├── cns_prob.F90 │ │ │ │ ├── inputs │ │ │ │ └── inputs.regt │ │ │ ├── ShockRef │ │ │ │ ├── GNUmakefile │ │ │ │ ├── Make.package │ │ │ │ ├── cns_prob.F90 │ │ │ │ ├── inputs │ │ │ │ ├── inputs.amr │ │ │ │ └── inputs.regt │ │ │ └── Sod │ │ │ │ ├── GNUmakefile │ │ │ │ ├── Make.package │ │ │ │ ├── cns_prob.F90 │ │ │ │ └── inputs │ │ └── Source │ │ │ ├── CNS.H │ │ │ ├── CNS.cpp │ │ │ ├── CNSBld.cpp │ │ │ ├── CNS_F.H │ │ │ ├── CNS_advance.cpp │ │ │ ├── CNS_init_eb2.cpp │ │ │ ├── CNS_io.cpp │ │ │ ├── CNS_setup.cpp │ │ │ ├── Make.package │ │ │ ├── diffusion │ │ │ ├── Make.package │ │ │ ├── cns_diff_mod.F90 │ │ │ ├── cns_eb_diff_mod.F90 │ │ │ ├── cns_eb_diff_wall.F90 │ │ │ └── diff_coef_mod.F90 │ │ │ ├── fortran │ │ │ ├── CNS_derive.F90 │ │ │ ├── CNS_divop.F90 │ │ │ ├── CNS_dudt.F90 │ │ │ ├── CNS_f.F90 │ │ │ ├── CNS_nd.F90 │ │ │ ├── CNS_physics.F90 │ │ │ ├── CNS_tagging.F90 │ │ │ ├── Make.package │ │ │ └── bc_fill_nd.F90 │ │ │ ├── hydro │ │ │ ├── Hyp_gamma_MOL.F90 │ │ │ ├── Hyp_gamma_MOL_EB.F90 │ │ │ ├── Make.package │ │ │ ├── analriem3d.F90 │ │ │ ├── cns_eb_hyp_wall.F90 │ │ │ ├── slope_mol_3d_gamma.F90 │ │ │ └── slope_mol_3d_gamma_EB.F90 │ │ │ └── main.cpp │ ├── GeometryGeneration │ │ ├── CMakeLists.txt │ │ ├── GNUmakefile │ │ ├── Make.package │ │ └── main.cpp │ ├── Poisson │ │ ├── CMakeLists.txt │ │ ├── GNUmakefile │ │ ├── Make.package │ │ ├── Poisson.H │ │ ├── Poisson.cpp │ │ ├── inputs │ │ └── main.cpp │ └── STLtest │ │ ├── GNUmakefile │ │ ├── Make.package │ │ ├── airfoil.stl │ │ ├── inputs │ │ └── main.cpp ├── FFT │ ├── Basic │ │ ├── GNUmakefile │ │ ├── Make.package │ │ ├── inputs_2d │ │ ├── inputs_3d │ │ └── main.cpp │ ├── EnergySpectrum │ │ ├── GNUmakefile │ │ ├── Make.package │ │ ├── README │ │ └── main.cpp │ └── Poisson │ │ ├── GNUmakefile │ │ ├── Make.package │ │ ├── inputs │ │ └── main.cpp ├── ForkJoin │ ├── MLMG │ │ ├── Backtrace.0 │ │ ├── Backtrace.1 │ │ ├── Backtrace.2 │ │ ├── Backtrace.3 │ │ ├── CMakeLists.txt │ │ ├── GNUmakefile │ │ ├── Make.package │ │ ├── ff.f90 │ │ ├── inputs │ │ └── main.cpp │ └── Simple │ │ ├── CMakeLists.txt │ │ ├── GNUmakefile │ │ ├── Make.package │ │ ├── MyTest.H │ │ ├── MyTest.cpp │ │ ├── MyTest_F.H │ │ ├── inputs │ │ └── main.cpp ├── FortranInterface │ ├── Advection_F │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── Make.Adv │ │ │ └── SingleVortex │ │ │ │ ├── GNUmakefile │ │ │ │ ├── Make.package │ │ │ │ ├── Prob_2d.f90 │ │ │ │ ├── Prob_3d.f90 │ │ │ │ ├── face_velocity_2d.F90 │ │ │ │ ├── face_velocity_3d.F90 │ │ │ │ ├── inputs │ │ │ │ ├── inputs.physbc │ │ │ │ └── inputs.rt │ │ ├── README │ │ └── Source │ │ │ ├── Make.package │ │ │ ├── Src_2d │ │ │ ├── Make.package │ │ │ ├── advect_2d_mod.F90 │ │ │ ├── compute_flux_2d.f90 │ │ │ └── slope_2d.f90 │ │ │ ├── Src_3d │ │ │ ├── Make.package │ │ │ ├── advect_3d_mod.F90 │ │ │ ├── compute_flux_3d.f90 │ │ │ └── slope_3d.f90 │ │ │ ├── amr_data_mod.F90 │ │ │ ├── averagedown_mod.F90 │ │ │ ├── bc_mod.F90 │ │ │ ├── compute_dt_mod.F90 │ │ │ ├── evolve_mod.F90 │ │ │ ├── fillpatch_mod.F90 │ │ │ ├── fmain.F90 │ │ │ ├── initdata.F90 │ │ │ ├── my_amr_mod.F90 │ │ │ ├── plotfile_mod.F90 │ │ │ └── tagging_mod.F90 │ ├── Advection_octree_F │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── Make.Adv │ │ │ └── SingleVortex │ │ │ │ ├── GNUmakefile │ │ │ │ ├── Make.package │ │ │ │ ├── Prob.f90 │ │ │ │ ├── face_velocity_2d.F90 │ │ │ │ ├── inputs │ │ │ │ └── inputs.rt │ │ ├── README │ │ └── Source │ │ │ ├── Make.package │ │ │ ├── Src_2d │ │ │ ├── Make.package │ │ │ ├── advect_2d_mod.F90 │ │ │ ├── compute_flux_2d.f90 │ │ │ └── slope_2d.f90 │ │ │ ├── amr_data_mod.F90 │ │ │ ├── averagedown_mod.F90 │ │ │ ├── bc_mod.F90 │ │ │ ├── compute_dt_mod.F90 │ │ │ ├── evolve_mod.F90 │ │ │ ├── fillpatch_mod.F90 │ │ │ ├── fmain.F90 │ │ │ ├── initdata.F90 │ │ │ ├── my_amr_mod.F90 │ │ │ ├── plotfile_mod.F90 │ │ │ └── tagging_mod.F90 │ └── Advection_octree_F2 │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ ├── Make.Adv │ │ └── SingleVortex │ │ │ ├── GNUmakefile │ │ │ ├── Make.package │ │ │ ├── Prob.f90 │ │ │ ├── face_velocity_2d.F90 │ │ │ └── inputs │ │ ├── README │ │ └── Source │ │ ├── Make.package │ │ ├── Src_2d │ │ ├── Make.package │ │ ├── advect_2d_mod.F90 │ │ ├── compute_flux_2d.f90 │ │ └── slope_2d.f90 │ │ ├── amr_data_mod.F90 │ │ ├── averagedown_mod.F90 │ │ ├── bc_mod.F90 │ │ ├── compute_dt_mod.F90 │ │ ├── evolve_mod.F90 │ │ ├── fillpatch_mod.F90 │ │ ├── fmain.F90 │ │ ├── initdata.F90 │ │ ├── my_amr_mod.F90 │ │ ├── plotfile_mod.F90 │ │ └── tagging_mod.F90 ├── GPU │ ├── CNS │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── Make.CNS │ │ │ ├── RT │ │ │ │ ├── GNUmakefile │ │ │ │ ├── Make.package │ │ │ │ ├── cns_prob.H │ │ │ │ ├── cns_prob.cpp │ │ │ │ ├── cns_prob_parm.H │ │ │ │ ├── inputs │ │ │ │ └── inputs-rt │ │ │ └── Sod │ │ │ │ ├── GNUmakefile │ │ │ │ ├── Make.package │ │ │ │ ├── cns_prob.H │ │ │ │ ├── cns_prob.cpp │ │ │ │ ├── cns_prob_parm.H │ │ │ │ ├── inputs │ │ │ │ └── inputs-rt │ │ └── Source │ │ │ ├── CNS.H │ │ │ ├── CNS.cpp │ │ │ ├── CNSBld.cpp │ │ │ ├── CNS_K.H │ │ │ ├── CNS_advance.cpp │ │ │ ├── CNS_bcfill.cpp │ │ │ ├── CNS_derive.H │ │ │ ├── CNS_derive.cpp │ │ │ ├── CNS_index_macros.H │ │ │ ├── CNS_io.cpp │ │ │ ├── CNS_parm.H │ │ │ ├── CNS_parm.cpp │ │ │ ├── CNS_setup.cpp │ │ │ ├── CNS_tagging.H │ │ │ ├── Make.package │ │ │ ├── diffusion │ │ │ └── Make.package │ │ │ ├── hydro │ │ │ ├── CNS_hydro_K.H │ │ │ └── Make.package │ │ │ └── main.cpp │ ├── run.corigpu │ ├── run.saul │ └── run.summit ├── LinearSolvers │ ├── ABecLaplacian_C │ │ ├── CMakeLists.txt │ │ ├── GNUmakefile │ │ ├── Make.package │ │ ├── MyTest.H │ │ ├── MyTest.cpp │ │ ├── MyTestPlotfile.cpp │ │ ├── initProb.cpp │ │ ├── initProb_K.H │ │ ├── inputs │ │ ├── inputs-inhomNeumann │ │ ├── inputs-rt-abeclap-com │ │ ├── inputs-rt-poisson-lev │ │ ├── inputs.hypre │ │ ├── inputs.petsc │ │ ├── main.cpp │ │ ├── scalingtest │ │ │ ├── inputs.test │ │ │ ├── main.diff │ │ │ ├── results.org │ │ │ ├── run-1.sh │ │ │ ├── run-1024.sh │ │ │ ├── run-128.sh │ │ │ ├── run-16.sh │ │ │ ├── run-2.sh │ │ │ ├── run-2048.sh │ │ │ ├── run-256.sh │ │ │ ├── run-32.sh │ │ │ ├── run-4.sh │ │ │ ├── run-512.sh │ │ │ ├── run-64.sh │ │ │ └── run-8.sh │ │ └── threadmultiple_test │ │ │ ├── inputs.test │ │ │ ├── knl-mpi-1.sh │ │ │ ├── knl-mpi-16.sh │ │ │ ├── knl-mpi-2.sh │ │ │ ├── knl-mpi-32.sh │ │ │ ├── knl-mpi-4.sh │ │ │ ├── knl-mpi-64.sh │ │ │ ├── knl-mpi-8.sh │ │ │ ├── knl-omp-1.sh │ │ │ ├── knl-omp-16.sh │ │ │ ├── knl-omp-2.sh │ │ │ ├── knl-omp-32.sh │ │ │ ├── knl-omp-4.sh │ │ │ ├── knl-omp-64.sh │ │ │ ├── knl-omp-8.sh │ │ │ ├── main.diff │ │ │ └── results.org │ ├── ABecLaplacian_F │ │ ├── CMakeLists.txt │ │ ├── GNUmakefile │ │ ├── Make.package │ │ ├── README │ │ ├── init_prob.F90 │ │ ├── inputs │ │ ├── inputs-rt-abeclap-lev │ │ ├── inputs-rt-poisson-com │ │ ├── main.F90 │ │ └── mytest.F90 │ ├── GMRES │ │ └── Poisson │ │ │ ├── GMRES_Poisson.H │ │ │ ├── GMRES_Poisson.cpp │ │ │ ├── GNUmakefile │ │ │ ├── Make.package │ │ │ ├── inputs │ │ │ └── main.cpp │ ├── MultiComponent │ │ ├── GNUmakefile │ │ ├── MCNodalLinOp.H │ │ ├── MCNodalLinOp.cpp │ │ ├── Make.package │ │ ├── inputs │ │ └── main.cpp │ ├── NodalPoisson │ │ ├── CMakeLists.txt │ │ ├── GNUmakefile │ │ ├── Make.package │ │ ├── MyTest.H │ │ ├── MyTest.cpp │ │ ├── MyTestPlotfile.cpp │ │ ├── inputs-rt │ │ └── main.cpp │ └── NodeTensorLap │ │ ├── CMakeLists.txt │ │ ├── GNUmakefile │ │ ├── Make.package │ │ ├── MyTest.H │ │ ├── MyTest.cpp │ │ ├── MyTestPlotfile.cpp │ │ └── main.cpp ├── ML │ └── PYTORCH │ │ ├── Exec │ │ ├── GNUmakefile │ │ ├── inputs │ │ └── model.pt │ │ ├── README.md │ │ └── Source │ │ ├── Make.package │ │ ├── main.cpp │ │ └── myfunc.H ├── MPMD │ ├── Case-1 │ │ ├── Source_1 │ │ │ ├── GNUmakefile │ │ │ ├── Make.package │ │ │ └── main_1.cpp │ │ ├── Source_2 │ │ │ ├── GNUmakefile │ │ │ ├── Make.package │ │ │ └── main_2.cpp │ │ ├── mpmd_cpu.conf │ │ ├── mpmd_cpu.sh │ │ ├── mpmd_gpu.conf │ │ ├── mpmd_gpu.sh │ │ └── perlmutter_gpu.profile │ └── Case-2 │ │ ├── GNUmakefile │ │ ├── Make.package │ │ ├── main.cpp │ │ ├── main.py │ │ ├── mpmd_cpu.conf │ │ ├── mpmd_cpu.sh │ │ ├── mpmd_gpu.conf │ │ ├── mpmd_gpu.sh │ │ └── perlmutter_gpu.profile ├── MUI │ ├── Exec_01 │ │ └── GNUmakefile │ ├── Exec_02 │ │ └── GNUmakefile │ ├── Exec_coupled │ │ ├── cmd_mpirun │ │ └── inputs │ ├── Source_01 │ │ ├── Make.package │ │ ├── init_phi_3d.f90 │ │ ├── main_01.cpp │ │ ├── myfunc.H │ │ └── myfunc_F.H │ ├── Source_02 │ │ ├── Make.package │ │ ├── main_02.cpp │ │ └── myfunc.H │ └── doc │ │ ├── GNUmakefile │ │ ├── MUIcouplingNotes.tex │ │ ├── iface_rect.png │ │ └── vis_interface.m ├── Particles │ ├── CellSortedParticles │ │ ├── CMakeLists.txt │ │ ├── CellSortedPC.H │ │ ├── CellSortedPC.cpp │ │ ├── GNUmakefile │ │ ├── Make.package │ │ ├── cell_sorted_3d.F90 │ │ ├── cell_sorted_F.H │ │ ├── inputs │ │ └── main.cpp │ ├── ElectromagneticPIC │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── CUDA │ │ │ │ ├── EMParticleContainer.cpp │ │ │ │ ├── Evolve.cpp │ │ │ │ ├── GNUmakefile │ │ │ │ ├── Make.package │ │ │ │ ├── em_pic_K.H │ │ │ │ └── inputs │ │ │ ├── OpenACC │ │ │ │ ├── EMParticleContainer.cpp │ │ │ │ ├── Evolve.cpp │ │ │ │ ├── GNUmakefile │ │ │ │ ├── Make.package │ │ │ │ ├── em_pic_3d.F90 │ │ │ │ ├── em_pic_F.H │ │ │ │ ├── inputs │ │ │ │ └── script.sh │ │ │ └── OpenMP │ │ │ │ ├── EMParticleContainer.cpp │ │ │ │ ├── Evolve.cpp │ │ │ │ ├── GNUmakefile │ │ │ │ ├── GNUmakefile.libamrex │ │ │ │ ├── Make.package │ │ │ │ ├── em_pic_3d.F90 │ │ │ │ ├── em_pic_F.H │ │ │ │ ├── inputs │ │ │ │ └── run.summitdev │ │ ├── Make.EMPIC │ │ └── Source │ │ │ ├── Constants.H │ │ │ ├── EMParticleContainer.H │ │ │ ├── EMParticleContainerInit.cpp │ │ │ ├── Evolve.H │ │ │ ├── IO.H │ │ │ ├── IO.cpp │ │ │ ├── Make.package │ │ │ ├── NodalFlags.H │ │ │ ├── NodalFlags.cpp │ │ │ └── main.cpp │ ├── ElectrostaticPIC │ │ ├── CMakeLists.txt │ │ ├── Make.ESPIC │ │ ├── example │ │ │ ├── GNUmakefile │ │ │ └── inputs │ │ └── src │ │ │ ├── Make.package │ │ │ ├── PhysConst.H │ │ │ ├── diagnostics │ │ │ ├── FieldIO.H │ │ │ ├── FieldIO.cpp │ │ │ ├── Make.package │ │ │ └── ParticleIO.cpp │ │ │ ├── field_solver │ │ │ ├── FieldSolver.H │ │ │ ├── FieldSolver.cpp │ │ │ ├── FieldSolver_K.H │ │ │ └── Make.package │ │ │ ├── main.cpp │ │ │ └── particles │ │ │ ├── ElectrostaticParticleContainer.H │ │ │ ├── ElectrostaticParticleContainer.cpp │ │ │ ├── Make.package │ │ │ ├── deposition │ │ │ └── ChargeDeposition_K.H │ │ │ ├── field_gather │ │ │ └── FieldGather_K.H │ │ │ └── pusher │ │ │ └── ParticlePusher_K.H │ └── NeighborList │ │ ├── CMakeLists.txt │ │ ├── CheckPair.H │ │ ├── Constants.H │ │ ├── GNUmakefile │ │ ├── MDParticleContainer.H │ │ ├── MDParticleContainer.cpp │ │ ├── Make.package │ │ ├── README.md │ │ ├── inputs │ │ ├── main.cpp │ │ └── script.sh ├── SDC │ └── MISDC_ADR_2d │ │ ├── Exec │ │ ├── GNUmakefile │ │ └── inputs_2d │ │ ├── README │ │ └── Source │ │ ├── Make.package │ │ ├── SDC_sweeper.cpp │ │ ├── functions_2d.f90 │ │ ├── init_phi_2d.f90 │ │ ├── main.cpp │ │ ├── myfunc.H │ │ └── myfunc_F.H ├── SENSEI │ ├── Advection_AmrCore │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── Make.Adv │ │ │ └── SingleVortex │ │ │ │ ├── GNUmakefile │ │ │ │ ├── Make.package │ │ │ │ ├── Prob.f90 │ │ │ │ ├── face_velocity_2d.f90 │ │ │ │ ├── face_velocity_3d.f90 │ │ │ │ ├── inputs │ │ │ │ └── sensei │ │ │ │ ├── histogram.py │ │ │ │ ├── histogram_python.xml │ │ │ │ ├── render_catalyst.py │ │ │ │ ├── render_iso_catalyst_2d.py │ │ │ │ ├── render_iso_catalyst_2d.xml │ │ │ │ ├── render_iso_catalyst_3d.py │ │ │ │ ├── render_iso_catalyst_3d.xml │ │ │ │ ├── render_iso_libsim_2d.session │ │ │ │ ├── render_iso_libsim_2d.xml │ │ │ │ ├── render_iso_libsim_3d.session │ │ │ │ ├── render_iso_libsim_3d.xml │ │ │ │ └── write_vtk.xml │ │ ├── README │ │ ├── README_SENSEI.md │ │ └── Source │ │ │ ├── AmrCoreAdv.H │ │ │ ├── AmrCoreAdv.cpp │ │ │ ├── AmrCoreAdv_F.H │ │ │ ├── Make.package │ │ │ ├── Src_2d │ │ │ ├── Adv_2d.f90 │ │ │ ├── Make.package │ │ │ ├── compute_flux_2d.f90 │ │ │ └── slope_2d.f90 │ │ │ ├── Src_3d │ │ │ ├── Adv_3d.f90 │ │ │ ├── Make.package │ │ │ ├── compute_flux_3d.f90 │ │ │ └── slope_3d.f90 │ │ │ ├── Src_nd │ │ │ ├── Make.package │ │ │ └── Tagging_nd.f90 │ │ │ ├── bc_fill_nd.F90 │ │ │ └── main.cpp │ ├── Advection_AmrLevel │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── Make.Adv │ │ │ └── SingleVortex │ │ │ │ ├── GNUmakefile │ │ │ │ ├── Make.package │ │ │ │ ├── Prob.f90 │ │ │ │ ├── face_velocity_2d.f90 │ │ │ │ ├── face_velocity_3d.f90 │ │ │ │ ├── inputs │ │ │ │ ├── inputs.tracers │ │ │ │ ├── probin │ │ │ │ └── sensei │ │ │ │ ├── histogram.py │ │ │ │ ├── histogram_python.xml │ │ │ │ ├── iso_extract.xml │ │ │ │ ├── read_adios2_bp4_default.xml │ │ │ │ ├── read_adios2_sst_default.xml │ │ │ │ ├── render_catalyst.py │ │ │ │ ├── render_iso_catalyst_2d.py │ │ │ │ ├── render_iso_catalyst_2d.xml │ │ │ │ ├── render_iso_catalyst_3d.py │ │ │ │ ├── render_iso_catalyst_3d.xml │ │ │ │ ├── render_iso_libsim_2d.session │ │ │ │ ├── render_iso_libsim_2d.xml │ │ │ │ ├── render_iso_libsim_3d.session │ │ │ │ ├── render_iso_libsim_3d.xml │ │ │ │ ├── render_libsim.xml │ │ │ │ ├── render_particles_catalyst_3d.py │ │ │ │ ├── render_particles_catalyst_3d.xml │ │ │ │ ├── write_adios2_bp4.xml │ │ │ │ ├── write_adios2_sst.xml │ │ │ │ ├── write_pvd_m.xml │ │ │ │ ├── write_pvd_p.xml │ │ │ │ ├── write_pvd_pm.xml │ │ │ │ └── write_vtk.xml │ │ ├── README │ │ ├── README_SENSEI.md │ │ └── Source │ │ │ ├── Adv_F.H │ │ │ ├── AmrLevelAdv.H │ │ │ ├── AmrLevelAdv.cpp │ │ │ ├── LevelBldAdv.cpp │ │ │ ├── Make.package │ │ │ ├── Src_2d │ │ │ ├── Adv_2d.f90 │ │ │ ├── Make.package │ │ │ ├── compute_flux_2d.f90 │ │ │ └── slope_2d.f90 │ │ │ ├── Src_3d │ │ │ ├── Adv_3d.f90 │ │ │ ├── Make.package │ │ │ ├── compute_flux_3d.f90 │ │ │ └── slope_3d.f90 │ │ │ ├── Src_nd │ │ │ ├── Adv_nd.f90 │ │ │ ├── Make.package │ │ │ ├── Tagging_nd.f90 │ │ │ └── tagging_params.f90 │ │ │ ├── mainExplicitAmr.cpp │ │ │ ├── mainExplicitAmrAndParticles.cpp │ │ │ └── mainImplicitAmr.cpp │ └── README.md ├── SUNDIALS │ ├── Reaction-Diffusion │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ │ ├── GNUmakefile │ │ │ ├── README_sundials │ │ │ └── inputs_sundials_mri │ │ └── Source │ │ │ ├── Make.package │ │ │ ├── main.cpp │ │ │ └── myfunc.H │ └── Single-Rate │ │ ├── CMakeLists.txt │ │ ├── Exec │ │ ├── GNUmakefile │ │ ├── README_sundials │ │ └── inputs │ │ └── Source │ │ ├── Make.package │ │ ├── main.cpp │ │ └── myfunc.H └── cmake │ └── SetupTutorials.cmake ├── GuidedTutorials ├── HeatEquation │ ├── Exec │ │ ├── CMakeLists.txt │ │ ├── GNUmakefile │ │ └── inputs │ └── Source │ │ ├── Make.package │ │ ├── main.cpp │ │ ├── main.py │ │ └── myfunc.H ├── HeatEquation_Simple │ ├── CMakeLists.txt │ ├── GNUmakefile │ ├── Make.package │ ├── Visualization.ipynb │ ├── inputs │ └── main.cpp ├── HelloWorld │ ├── CMakeLists.txt │ ├── GNUmakefile │ ├── Make.package │ └── main.cpp └── MultiFab │ ├── CMakeLists.txt │ ├── GNUmakefile │ ├── Make.package │ ├── main.cpp │ └── main.py ├── LICENSE └── README.md /.github/workflows/dependencies/dependencies.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2020 The AMReX Community 4 | # 5 | # License: BSD-3-Clause-LBNL 6 | # Authors: Axel Huebl 7 | 8 | set -eu -o pipefail 9 | 10 | sudo apt-get update 11 | 12 | sudo apt-get install -y --no-install-recommends\ 13 | build-essential \ 14 | g++ gfortran \ 15 | libopenmpi-dev \ 16 | openmpi-bin \ 17 | python3 \ 18 | python3-pip 19 | 20 | python3 -m pip install -U pip 21 | python3 -m pip install -U build packaging setuptools wheel 22 | -------------------------------------------------------------------------------- /.github/workflows/dependencies/dependencies_clang6.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2020 The AMReX Community 4 | # 5 | # License: BSD-3-Clause-LBNL 6 | # Authors: Axel Huebl 7 | 8 | set -eu -o pipefail 9 | 10 | sudo apt-get update 11 | 12 | sudo apt-get install -y \ 13 | build-essential \ 14 | clang gfortran \ 15 | python3 \ 16 | python3-pip 17 | 18 | python3 -m pip install -U pip 19 | python3 -m pip install -U build packaging setuptools wheel 20 | -------------------------------------------------------------------------------- /.github/workflows/dependencies/dependencies_gcc10.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2020 The AMReX Community 4 | # 5 | # License: BSD-3-Clause-LBNL 6 | # Authors: Axel Huebl 7 | 8 | set -eu -o pipefail 9 | 10 | sudo add-apt-repository ppa:ubuntu-toolchain-r/test 11 | sudo apt-get update 12 | 13 | sudo apt-get install -y --no-install-recommends \ 14 | build-essential \ 15 | g++-10 gfortran-10 \ 16 | libopenmpi-dev \ 17 | openmpi-bin \ 18 | python3 \ 19 | python3-pip 20 | 21 | python3 -m pip install -U pip 22 | python3 -m pip install -U build packaging setuptools wheel 23 | -------------------------------------------------------------------------------- /.github/workflows/dependencies/dependencies_mac.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2020 The AMReX Community 4 | # 5 | # License: BSD-3-Clause-LBNL 6 | # Authors: Axel Huebl 7 | 8 | set -eu -o pipefail 9 | 10 | brew update 11 | brew install gfortran || true 12 | brew install libomp || true 13 | brew install open-mpi || true 14 | brew install ccache || true 15 | 16 | # verify installation 17 | gfortran-14 --version 18 | otool -L $(which gfortran-14) 19 | -------------------------------------------------------------------------------- /.github/workflows/dependencies/dependencies_nofortran.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2020 Axel Huebl 4 | # 5 | # License: BSD-3-Clause-LBNL 6 | 7 | # search recursive inside a folder if a file contains tabs 8 | # 9 | # @result 0 if no files are found, else 1 10 | # 11 | 12 | set -eu -o pipefail 13 | 14 | sudo apt-get update 15 | 16 | sudo apt-get install -y --no-install-recommends\ 17 | build-essential \ 18 | g++ \ 19 | libopenmpi-dev \ 20 | openmpi-bin \ 21 | python3 \ 22 | python3-pip 23 | 24 | python3 -m pip install -U pip 25 | python3 -m pip install -U build packaging setuptools wheel 26 | -------------------------------------------------------------------------------- /.github/workflows/dependencies/documentation.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2020 The AMReX Community 4 | # 5 | # License: BSD-3-Clause-LBNL 6 | # Authors: Andrew Myers 7 | 8 | set -eu -o pipefail 9 | 10 | sudo apt-get update 11 | 12 | sudo apt-get install -y --no-install-recommends\ 13 | build-essential \ 14 | pandoc \ 15 | doxygen \ 16 | texlive \ 17 | texlive-latex-extra \ 18 | texlive-lang-cjk \ 19 | tex-gyre \ 20 | latexmk 21 | 22 | -------------------------------------------------------------------------------- /.github/workflows/style.yml: -------------------------------------------------------------------------------- 1 | name: Style 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | tabs: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v3 10 | - name: Tabs 11 | run: .github/workflows/style/check_tabs.sh 12 | 13 | trailing_whitespaces: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v3 17 | - name: Trailing Whitespaces 18 | run: .github/workflows/style/check_trailing_whitespaces.sh 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | nohup.out 2 | *.[oa] 3 | *.ex 4 | *.ex.dSYM 5 | *.exe 6 | *.exe.dSYM 7 | *~ 8 | build/ 9 | tmp_build_dir/ 10 | d/ 11 | f/ 12 | o/ 13 | t/ 14 | TAGS 15 | 16 | # latex 17 | *.aux 18 | *.log 19 | *.bbl 20 | *.toc 21 | *.dvi 22 | *-eps-converted-to.pdf 23 | 24 | # python 25 | *.pyc 26 | 27 | .nfs* 28 | 29 | # vi 30 | *.sw[a-z] 31 | 32 | # files generated by tutorials 33 | Amr/Advection_AmrLevel/Exec/SingleVortex/*.png 34 | Amr/Advection_AmrCore/Exec/SingleVortex/*.png 35 | EB/LevelSet/Exec/ImpFunc* 36 | EB/LevelSet/Exec/LevelSet* 37 | EB/Donut/Exec/ls_plt* 38 | *.vth 39 | *.vti 40 | *.vtr 41 | *.vtp 42 | *.pvtp 43 | *.pvd 44 | *.visit 45 | *.pvsm 46 | 47 | -------------------------------------------------------------------------------- /.gitpod.dependencies.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu -o pipefail 4 | 5 | sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2 6 | sudo update-alternatives --set python /usr/bin/python3 7 | python -m pip install --upgrade pip 8 | python -m pip install --upgrade wheel 9 | python -m pip install --upgrade cmake matplotlib==3.2.2 numpy yt 10 | -------------------------------------------------------------------------------- /.gitpod.dockerfile: -------------------------------------------------------------------------------- 1 | FROM gitpod/workspace-full-vnc 2 | 3 | RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends build-essential g++ libopenmpi-dev openmpi-bin paraview python3-paraview ffmpeg python3 python3-pip python3-setuptools && sudo rm -rf /var/lib/apt/lists/* -------------------------------------------------------------------------------- /.jupyter/jupyter_notebook_config.py: -------------------------------------------------------------------------------- 1 | c.NotebookApp.ip = '0.0.0.0' 2 | c.NotebookApp.allow_origin = '*' 3 | c.NotebookApp.open_browser = False 4 | -------------------------------------------------------------------------------- /Docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | PYTHON ?= python 6 | SPHINXOPTS = 7 | SPHINXBUILD = $(PYTHON) -msphinx 8 | SPHINXPROJ = amrex 9 | SOURCEDIR = source 10 | BUILDDIR = build 11 | 12 | # Put it first so that "make" without argument is like "make help". 13 | help: 14 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 15 | 16 | .PHONY: help Makefile 17 | 18 | # Catch-all target: route all unknown targets to Sphinx using the new 19 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 20 | %: Makefile 21 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 22 | -------------------------------------------------------------------------------- /Docs/source/Basics/amrgrids.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/Basics/amrgrids.png -------------------------------------------------------------------------------- /Docs/source/Basics/cc_growbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/Basics/cc_growbox.png -------------------------------------------------------------------------------- /Docs/source/Basics/cc_tilebox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/Basics/cc_tilebox.png -------------------------------------------------------------------------------- /Docs/source/Basics/cc_validbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/Basics/cc_validbox.png -------------------------------------------------------------------------------- /Docs/source/Basics/ec_growbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/Basics/ec_growbox.png -------------------------------------------------------------------------------- /Docs/source/Basics/ec_tilebox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/Basics/ec_tilebox.png -------------------------------------------------------------------------------- /Docs/source/Basics/ec_validbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/Basics/ec_validbox.png -------------------------------------------------------------------------------- /Docs/source/Basics/figs/flowchart.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/Basics/figs/flowchart.odg -------------------------------------------------------------------------------- /Docs/source/Basics/figs/flowchart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/Basics/figs/flowchart.png -------------------------------------------------------------------------------- /Docs/source/Basics/indextypes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/Basics/indextypes.png -------------------------------------------------------------------------------- /Docs/source/EB_Tutorial.rst: -------------------------------------------------------------------------------- 1 | .. role:: cpp(code) 2 | :language: c++ 3 | 4 | .. role:: fortran(code) 5 | :language: fortran 6 | 7 | .. _tutorials_eb: 8 | 9 | EB 10 | ========================== 11 | 12 | ``amrex-tutorials/ExampleCodes/EB/CNS`` is an AMR code for solving compressible 13 | Navier-Stokes equations with the embedded boundary approach. 14 | 15 | ``amrex-tutorials/ExampleCodes/EB/Poisson`` is a single-level code that is a proxy for 16 | solving the electrostatic Poisson equation for a grounded sphere with a point 17 | charge inside. 18 | -------------------------------------------------------------------------------- /Docs/source/Python_Tutorial.rst: -------------------------------------------------------------------------------- 1 | .. _tutorials_python: 2 | 3 | ====== 4 | Python 5 | ====== 6 | 7 | These examples show how to use AMReX from Python. 8 | AMReX applications can also be interfaced to Python with the same logic. 9 | 10 | In order to build the Python tutorials, add ``-DTUTORIAL_PYTHON=ON`` to the CMake configuration options. 11 | Then install with ``cmake --build build --target pyamrex_pip_install``. 12 | 13 | Guided Tutorial Examples: 14 | 15 | - :download:`MultiFab <../../GuidedTutorials/MultiFab/main.py>` 16 | - :download:`Heat Equation <../../GuidedTutorials/HeatEquation/Source/main.py>` 17 | 18 | Please see `pyAMReX `__ for more details. 19 | -------------------------------------------------------------------------------- /Docs/source/_static/theme_overrides.css: -------------------------------------------------------------------------------- 1 | /* override table width restrictions */ 2 | .wy-table-responsive table td, .wy-table-responsive table th { 3 | white-space: normal; 4 | } 5 | 6 | .wy-table-responsive { 7 | margin-bottom: 24px; 8 | max-width: 100%; 9 | overflow: visible; 10 | } -------------------------------------------------------------------------------- /Docs/source/figs/fork_join_tasks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/figs/fork_join_tasks.png -------------------------------------------------------------------------------- /Docs/source/figs/iface_rect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/figs/iface_rect.png -------------------------------------------------------------------------------- /Docs/source/figs/mf_remap_hires.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/figs/mf_remap_hires.png -------------------------------------------------------------------------------- /Docs/source/figs/nested_fork_join_tasks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/figs/nested_fork_join_tasks.png -------------------------------------------------------------------------------- /Docs/source/images_tutorial/Cmake_make.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/images_tutorial/Cmake_make.png -------------------------------------------------------------------------------- /Docs/source/images_tutorial/MultiFabTutorialVideo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/images_tutorial/MultiFabTutorialVideo.png -------------------------------------------------------------------------------- /Docs/source/images_tutorial/amrex-cmake-hello.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/images_tutorial/amrex-cmake-hello.gif -------------------------------------------------------------------------------- /Docs/source/images_tutorial/amrex-gnu-hello.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/images_tutorial/amrex-gnu-hello.gif -------------------------------------------------------------------------------- /Docs/source/images_tutorial/amrex_gitclone_instructions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/images_tutorial/amrex_gitclone_instructions.png -------------------------------------------------------------------------------- /Docs/source/images_tutorial/heat_eq_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/images_tutorial/heat_eq_plot.png -------------------------------------------------------------------------------- /Docs/source/images_tutorial/plot_dirs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/images_tutorial/plot_dirs.png -------------------------------------------------------------------------------- /Docs/source/images_tutorial/token.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/images_tutorial/token.png -------------------------------------------------------------------------------- /Docs/source/images_tutorial/token_hl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/Docs/source/images_tutorial/token_hl.png -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrCore/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (AMReX_SPACEDIM EQUAL 1) 2 | return() 3 | endif () 4 | 5 | # List of source files 6 | set(_sources AdvancePhiAllLevels.cpp AdvancePhiAtLevel.cpp AmrCoreAdv.cpp AmrCoreAdv.H bc_fill.H) 7 | list(APPEND _sources DefineVelocity.cpp face_velocity.H Kernels.H main.cpp Tagging.H) 8 | list(APPEND _sources Src_K/Adv_K.H Src_K/compute_flux_${AMReX_SPACEDIM}D_K.H Src_K/slope_K.H) 9 | list(TRANSFORM _sources PREPEND Source/) 10 | list(APPEND _sources Exec/Prob.H) 11 | 12 | # List of input files 13 | set(_input_files inputs inputs_for_scaling paraview_amr101.py) 14 | list(TRANSFORM _input_files PREPEND "Exec/") 15 | 16 | setup_tutorial(_sources _input_files) 17 | 18 | unset( _sources ) 19 | unset( _input_files ) 20 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrCore/Exec/GNUmakefile: -------------------------------------------------------------------------------- 1 | 2 | PRECISION = DOUBLE 3 | PROFILE = FALSE 4 | 5 | DEBUG = TRUE 6 | DEBUG = FALSE 7 | 8 | DIM = 2 9 | #DIM = 3 10 | 11 | COMP = gnu 12 | 13 | USE_MPI = TRUE 14 | USE_OMP = FALSE 15 | USE_CUDA = FALSE 16 | 17 | Bpack := ./Make.package 18 | Blocs := . 19 | 20 | include Make.Adv 21 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrCore/Exec/GNUmakefile_movie: -------------------------------------------------------------------------------- 1 | PARAVIEW_PATH ?= /path/containing/paraview/executable 2 | 3 | movie2D: 4 | @echo "Making a movie from 2D simulation, this will probably take <30 seconds ..." 5 | @$(PARAVIEW_PATH)/pvpython paraview_amr101.py -d 2 > /dev/null 2>&1 6 | @echo "Done! Generated amr101_2D.avi and amr101_2D.gif" 7 | 8 | movie3D: 9 | @echo "Making a movie from 3D simulation, this will probably take <30 seconds ..." 10 | @$(PARAVIEW_PATH)/pvpython paraview_amr101.py > /dev/null 2>&1 11 | @echo "Done! Generated amr101_3D.avi and amr101_3D.gif" 12 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrCore/Exec/Make.Adv: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | ADV_DIR = ../ 3 | 4 | TOP := $(ADV_DIR) 5 | 6 | EBASE := main 7 | 8 | BL_NO_FORT = TRUE 9 | 10 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 11 | 12 | Bdirs := Source Source/Src_K 13 | Bpack += $(foreach dir, $(Bdirs), $(TOP)/$(dir)/Make.package) 14 | Blocs += $(foreach dir, $(Bdirs), $(TOP)/$(dir)) 15 | 16 | include $(Bpack) 17 | 18 | INCLUDE_LOCATIONS += $(Blocs) 19 | VPATH_LOCATIONS += $(Blocs) 20 | 21 | Pdirs := Base Boundary AmrCore 22 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 23 | 24 | include $(Ppack) 25 | 26 | all: $(executable) 27 | @echo SUCCESS 28 | 29 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 30 | 31 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrCore/Exec/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_headers += Prob.H 2 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrCore/Source/Kernels.H: -------------------------------------------------------------------------------- 1 | #ifndef Kernels_H_ 2 | #define Kernels_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #if (AMREX_SPACEDIM == 2) 12 | #include 13 | #else 14 | #include 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrCore/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += AdvancePhiAtLevel.cpp 2 | CEXE_sources += AdvancePhiAllLevels.cpp 3 | CEXE_sources += AmrCoreAdv.cpp 4 | CEXE_sources += DefineVelocity.cpp 5 | CEXE_sources += main.cpp 6 | 7 | CEXE_headers += AmrCoreAdv.H 8 | CEXE_headers += bc_fill.H 9 | CEXE_headers += face_velocity.H 10 | CEXE_headers += Kernels.H 11 | CEXE_headers += Tagging.H 12 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrCore/Source/Src_K/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_headers += Adv_K.H 2 | CEXE_headers += compute_flux_$(DIM)D_K.H 3 | CEXE_headers += slope_K.H 4 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrCore/Source/Tagging.H: -------------------------------------------------------------------------------- 1 | #ifndef TAGGING_H 2 | #define TAGGING_H 3 | 4 | #include 5 | 6 | AMREX_GPU_HOST_DEVICE 7 | AMREX_FORCE_INLINE 8 | void 9 | state_error (int i, int j, int k, 10 | amrex::Array4 const& tag, 11 | amrex::Array4 const& state, 12 | amrex::Real phierr, char tagval) 13 | { 14 | if (state(i,j,k) > phierr) 15 | tag(i,j,k) = tagval; 16 | } 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrCore/Source/bc_fill.H: -------------------------------------------------------------------------------- 1 | #ifndef BCFILL_H 2 | #define BCFILL_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | struct AmrCoreFill 9 | { 10 | AMREX_GPU_DEVICE 11 | void operator() (const amrex::IntVect& /*iv*/, amrex::Array4 const& /*data*/, 12 | const int /*dcomp*/, const int /*numcomp*/, 13 | amrex::GeometryData const& /*geom*/, const amrex::Real /*time*/, 14 | const amrex::BCRec* /*bcr*/, const int /*bcomp*/, 15 | const int /*orig_comp*/) const 16 | { 17 | // do something for external Dirichlet (BCType::ext_dir) 18 | } 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Exec/Make.Adv: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | ADR_DIR ?= ../../../Advection_AmrLevel 3 | 4 | TOP := $(ADR_DIR) 5 | 6 | EBASE := main 7 | 8 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 9 | 10 | Bdirs := Source Source/Src_K 11 | Bpack += $(foreach dir, $(Bdirs), $(TOP)/$(dir)/Make.package) 12 | Blocs += $(foreach dir, $(Bdirs), $(TOP)/$(dir)) 13 | 14 | include $(Bpack) 15 | 16 | INCLUDE_LOCATIONS += $(Blocs) 17 | VPATH_LOCATIONS += $(Blocs) 18 | 19 | Pdirs := Base Boundary AmrCore Amr 20 | ifeq ($(USE_PARTICLES),TRUE) 21 | Pdirs += Particle 22 | endif 23 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 24 | 25 | include $(Ppack) 26 | 27 | all: $(executable) 28 | @echo SUCCESS 29 | 30 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 31 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Exec/SingleVortex/Adv_prob.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern "C" { 4 | void amrex_probinit (const int* /*init*/, 5 | const int* /*name*/, 6 | const int* /*namelen*/, 7 | const amrex::Real* /*problo*/, 8 | const amrex::Real* /*probhi*/) 9 | { 10 | // Nothing needs to be done here, 11 | // since there are no extra inputs to be read from probin file 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Exec/SingleVortex/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../../../amrex 2 | USE_EB = FALSE 3 | PRECISION = DOUBLE 4 | PROFILE = FALSE 5 | 6 | DEBUG = TRUE 7 | DEBUG = FALSE 8 | 9 | DIM = 2 10 | #DIM = 3 11 | 12 | COMP = gnu 13 | 14 | USE_PARTICLES = TRUE 15 | 16 | USE_MPI = TRUE 17 | USE_OMP = FALSE 18 | 19 | Bpack := ./Make.package 20 | Blocs := . 21 | 22 | include ../Make.Adv 23 | 24 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Exec/SingleVortex/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += Prob.f90 2 | CEXE_headers += Prob_Parm.H face_velocity_$(DIM)d_K.H 3 | CEXE_sources += Adv_prob.cpp -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Exec/SingleVortex/Prob_Parm.H: -------------------------------------------------------------------------------- 1 | #ifndef PROB_PARM_H_ 2 | #define PROB_PARM_H_ 3 | 4 | #include 5 | 6 | using namespace amrex::literals; 7 | 8 | // Define the struct to contain problem-specific variables here. 9 | // For this case, since we don't need any, the struct is empty. 10 | struct ProbParm {}; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Exec/SingleVortex/probin: -------------------------------------------------------------------------------- 1 | &tagging 2 | 3 | phierr = 1.01d0, 1.1d0, 1.5d0 4 | 5 | max_phierr_lev = 10 6 | 7 | / 8 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Exec/UniformVelocity/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../../../amrex 2 | USE_EB =FALSE 3 | PRECISION = DOUBLE 4 | PROFILE = FALSE 5 | 6 | DEBUG = TRUE 7 | DEBUG = FALSE 8 | 9 | DIM = 2 10 | #DIM = 3 11 | 12 | COMP = gnu 13 | 14 | USE_MPI = TRUE 15 | USE_OMP = FALSE 16 | 17 | Bpack := ./Make.package 18 | Blocs := . 19 | 20 | include ../Make.Adv 21 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Exec/UniformVelocity/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += Prob.f90 2 | CEXE_headers += Prob_Parm.H face_velocity_$(DIM)d_K.H 3 | CEXE_sources += Adv_prob.cpp -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Exec/UniformVelocity/Prob_Parm.H: -------------------------------------------------------------------------------- 1 | #ifndef PROB_PARM_H_ 2 | #define PROB_PARM_H_ 3 | 4 | #include 5 | #include 6 | 7 | using namespace amrex::literals; 8 | 9 | // Define the struct to contain problem-specific variables here. 10 | struct ProbParm 11 | { 12 | amrex::Real adv_vel[AMREX_SPACEDIM] = {AMREX_D_DECL(1.0, 1.0, 1.0)}; // Default values 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Exec/UniformVelocity/face_velocity_2d.f90: -------------------------------------------------------------------------------- 1 | 2 | subroutine get_face_velocity(level, time, & 3 | vx, vx_l1, vx_l2, vx_h1, vx_h2, & 4 | vy, vy_l1, vy_l2, vy_h1, vy_h2, & 5 | dx, prob_lo) bind(C, name="get_face_velocity") 6 | 7 | use probdata_module, only : adv_vel 8 | 9 | implicit none 10 | 11 | integer, intent(in) :: level 12 | double precision, intent(in) :: time 13 | integer, intent(in) :: vx_l1, vx_l2, vx_h1, vx_h2 14 | integer, intent(in) :: vy_l1, vy_l2, vy_h1, vy_h2 15 | double precision, intent(out) :: vx(vx_l1:vx_h1,vx_l2:vx_h2) 16 | double precision, intent(out) :: vy(vy_l1:vy_h1,vy_l2:vy_h2) 17 | double precision, intent(in) :: dx(2), prob_lo(2) 18 | 19 | vx = adv_vel(1) 20 | vy = adv_vel(2) 21 | 22 | end subroutine get_face_velocity 23 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Exec/UniformVelocity/face_velocity_2d_K.H: -------------------------------------------------------------------------------- 1 | #ifndef FACE_VELOCITY_2D_H_ 2 | #define FACE_VELOCITY_2D_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include "AmrLevelAdv.H" 8 | #include "Prob_Parm.H" 9 | 10 | AMREX_GPU_HOST 11 | AMREX_FORCE_INLINE 12 | void get_face_velocity(const amrex::Real /*time*/, 13 | amrex::FArrayBox& vx, 14 | amrex::FArrayBox& vy, 15 | amrex::GpuArray /*dx*/, 16 | amrex::GpuArray /*prob_lo*/) 17 | { 18 | using namespace amrex; 19 | 20 | vx.setVal(AmrLevelAdv::d_prob_parm->adv_vel[0]); 21 | vy.setVal(AmrLevelAdv::d_prob_parm->adv_vel[1]); 22 | 23 | return; 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Exec/UniformVelocity/probdata.f90: -------------------------------------------------------------------------------- 1 | module probdata_module 2 | 3 | implicit none 4 | 5 | double precision, save :: adv_vel(3) 6 | 7 | end module probdata_module 8 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Exec/UniformVelocity/probin: -------------------------------------------------------------------------------- 1 | &fortin 2 | 3 | adv_vel = 1.d0, 1.d0, 1.d0 4 | 5 | / 6 | 7 | &tagging 8 | 9 | phierr = 1.01d0, 1.1d0, 1.5d0 10 | 11 | max_phierr_lev = 10 12 | 13 | / 14 | 15 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/README: -------------------------------------------------------------------------------- 1 | Advection_AmrLevel: This tutorial contains an AMR advection code that advects a 2 | single scalar field with a velocity field that is specified on faces. 3 | 4 | It is a mixed Fortran/C++ AMReX-based code designed to run in parallel using 5 | MPI/OMP. Additionally, it can also be run using GPUs. 6 | 7 | This example uses source code from the amrex/Src/Base, Boundary, AmrCore , and 8 | Amr directories. 9 | 10 | The directories Exec/SingleVortex and Exec/UniformVelocity each include 11 | a makefile and a sample inputs file. 12 | Plotfiles are generated that can be viewed with amrvis2d / amrvis3d 13 | (CCSE's native vis / spreadsheet tool, downloadable separately from ccse.lbl.gov) 14 | or with VisIt. 15 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Source/Adv_F.H: -------------------------------------------------------------------------------- 1 | #ifndef _Adv_F_H_ 2 | #define _Adv_F_H_ 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" 8 | { 9 | #endif 10 | 11 | void initdata(const int* level, const amrex_real* time, 12 | const int* lo, const int* hi, 13 | BL_FORT_FAB_ARG_3D(state), 14 | const amrex_real* dx, const amrex_real* problo); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Source/Kernels.H: -------------------------------------------------------------------------------- 1 | #ifndef Kernels_H_ 2 | #define Kernels_H_ 3 | 4 | // GPU kernels to calculate slopes 5 | #include "slope_K.H" 6 | 7 | // GPU kernels to calculate fluxes 8 | #if (AMREX_SPACEDIM == 2) 9 | #include "flux_2d_K.H" 10 | #else 11 | #include "flux_3d_K.H" 12 | #endif 13 | 14 | // GPU kernels to update state during advection 15 | #include "Adv_K.H" 16 | 17 | // GPU kernels to tag high error cells 18 | #include "tagging_K.H" 19 | 20 | // GPU kernel to compute Godunov velocities on each face. 21 | // This is a problem-dependent kernel defined under the Exec directory. 22 | #if (AMREX_SPACEDIM == 2) 23 | #include "face_velocity_2d_K.H" 24 | #else 25 | #include "face_velocity_3d_K.H" 26 | #endif 27 | 28 | #endif /* Kernels_H_ */ 29 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_headers += AmrLevelAdv.H Kernels.H 2 | CEXE_sources += AmrLevelAdv.cpp LevelBldAdv.cpp Adv.cpp bc_nullfill.cpp Tagging_params.cpp main.cpp 3 | 4 | FEXE_headers += Adv_F.H 5 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Source/Src_2d/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += Adv_$(DIM)d.f90 2 | f90EXE_sources += slope_$(DIM)d.f90 3 | f90EXE_sources += compute_flux_$(DIM)d.f90 4 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Source/Src_3d/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += Adv_$(DIM)d.f90 2 | f90EXE_sources += slope_$(DIM)d.f90 3 | f90EXE_sources += compute_flux_$(DIM)d.f90 4 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Source/Src_K/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_headers += Adv_K.H flux_$(DIM)d_K.H slope_K.H tagging_K.H 2 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Source/Src_nd/Adv_nd.f90: -------------------------------------------------------------------------------- 1 | subroutine nullfill(adv,adv_lo,adv_hi,domlo,domhi,delta,xlo,time,bc) bind(C, name="nullfill") 2 | implicit none 3 | integer :: adv_lo(3),adv_hi(3) 4 | integer :: bc(*) 5 | integer :: domlo(3), domhi(3) 6 | double precision :: delta(3), xlo(3), time 7 | double precision :: adv(adv_lo(1):adv_hi(1),adv_lo(2):adv_hi(2),adv_lo(3):adv_hi(3)) 8 | ! no physical boundaries to fill because it is all periodic 9 | return 10 | end subroutine nullfill 11 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Source/Src_nd/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += Adv_nd.f90 2 | f90EXE_sources += Tagging_nd.f90 tagging_params.f90 3 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Advection_AmrLevel/Source/Tagging_params.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "AmrLevelAdv.H" 6 | 7 | void 8 | AmrLevelAdv::get_tagging_params() 9 | { 10 | // Use ParmParse to get number of levels from input file 11 | amrex::ParmParse pp("tagging"); 12 | pp.query("max_phierr_lev", max_phierr_lev); 13 | pp.query("max_phigrad_lev", max_phigrad_lev); 14 | 15 | // Set default values for the error thresholds, then read from input file 16 | if (max_phierr_lev != -1) { 17 | phierr.resize(max_phierr_lev, 1.0e+20); 18 | pp.queryarr("phierr", phierr); 19 | } 20 | if (max_phigrad_lev != -1) { 21 | phigrad.resize(max_phigrad_lev, 1.0e+20); 22 | pp.queryarr("phigrad", phigrad); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Wave_AmrLevel/AmrWave.H: -------------------------------------------------------------------------------- 1 | #ifndef AMR_WAVE_H_ 2 | #define AMR_WAVE_H_ 3 | 4 | #include 5 | 6 | class AmrWave 7 | : public amrex::Amr 8 | { 9 | public: 10 | using amrex::Amr::Amr; 11 | 12 | virtual ~AmrWave (); 13 | 14 | // If we need to override any virtual functions in amrex::Amr, we can do 15 | // it here. 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Wave_AmrLevel/AmrWave.cpp: -------------------------------------------------------------------------------- 1 | #include "AmrWave.H" 2 | #include "AmrLevelWave.H" 3 | 4 | using namespace amrex; 5 | 6 | AmrWave::~AmrWave () 7 | { 8 | MultiFab const& S = this->getLevel(0).get_new_data(State_Type); 9 | amrex::Print() << "At the end of simulation, the min and max of the wave are " 10 | << S.min(0) << " and " << S.max(0) << "\n\n"; 11 | } 12 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Wave_AmrLevel/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | 3 | DEBUG = FALSE 4 | 5 | DIM = 2 6 | 7 | USE_MPI = TRUE 8 | USE_OMP = FALSE 9 | 10 | USE_CUDA = FALSE 11 | USE_HIP = FALSE 12 | USE_SYCL = FALSE 13 | 14 | #No Fortran 15 | BL_NO_FORT = TRUE 16 | # No Fortran probin file 17 | AMREX_NO_PROBINIT = TRUE 18 | 19 | CXXSTD=c++17 20 | 21 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 22 | 23 | include ./Make.package 24 | include $(AMREX_HOME)/Src/Base/Make.package 25 | include $(AMREX_HOME)/Src/Boundary/Make.package 26 | include $(AMREX_HOME)/Src/AmrCore/Make.package 27 | include $(AMREX_HOME)/Src/Amr/Make.package 28 | 29 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 30 | 31 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Wave_AmrLevel/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += AmrWave.cpp AmrLevelWave.cpp LevelBldWave.cpp main.cpp Wave_init.cpp Wave_advance.cpp 2 | CEXE_headers += AmrWave.H AmrLevelWave.H 3 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Wave_AmrLevel/README.md: -------------------------------------------------------------------------------- 1 | This solves the scalar wave equation $\frac{\partial^2 u}{\partial t^2} = \nabla u$. 2 | If we define $v = \frac{\partial u}{\partial t}$, then we have two 3 | first-order partial differential equations, $\frac{\partial u}{\partial t} = v$ 4 | and $\frac{\partial v}{\partial t} = \nabla u$. The Laplacian operator is 5 | discretized dimension by dimension with a fourth-order stencil, 6 | 7 | $$\frac{\partial^2 u}{\partial x^2} = \left(-\frac{5}{2} u_i + \frac{4}{3} (u_{i-1} + u_{i+1}) - \frac{1}{12} (u_{i-2} + u_{i+2})\right) / \Delta x^2$$ 8 | 9 | The time stepping is done with a Runge-Kutta method (RK2, RK3 or RK4). In 10 | this test, the displacement at the x-direction boundaries is zero, and the 11 | it's periodic in the y-direction. Note that refluxing is not implemented in 12 | this test code. 13 | -------------------------------------------------------------------------------- /ExampleCodes/Amr/Wave_AmrLevel/Wave_init.cpp: -------------------------------------------------------------------------------- 1 | #include "AmrLevelWave.H" 2 | #include 3 | 4 | using namespace amrex; 5 | 6 | void 7 | AmrLevelWave::initData () 8 | { 9 | const auto problo = geom.ProbLoArray(); 10 | const auto dx = geom.CellSizeArray(); 11 | 12 | MultiFab& S_new = get_new_data(State_Type); 13 | auto const& snew = S_new.arrays(); 14 | 15 | amrex::ParallelFor(S_new, 16 | [=] AMREX_GPU_DEVICE (int bi, int i, int j, int k) noexcept 17 | { 18 | Real x = problo[0] + (i+0.5)*dx[0]; 19 | Real r = x - 0.5; 20 | constexpr Real Pi = 3.1415926535897932384626; 21 | snew[bi](i,j,k,0) = 0.0; 22 | snew[bi](i,j,k,1) = std::exp(-16.*r*r) * std::pow(std::cos(Pi*r),6); 23 | }); 24 | } 25 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX0_C/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (AMReX_SPACEDIM EQUAL 1) 2 | return() 3 | endif () 4 | 5 | # List of source files 6 | set(_sources main.cpp myfunc.H) 7 | list(TRANSFORM _sources PREPEND "Source/") 8 | 9 | # List of input files 10 | file( GLOB_RECURSE _input_files LIST_DIRECTORIES false Exec/input* ) 11 | 12 | setup_tutorial(_sources _input_files) 13 | 14 | unset( _sources ) 15 | unset( _input_files ) 16 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX0_C/Exec/GNUmakefile: -------------------------------------------------------------------------------- 1 | # AMREX_HOME defines the directory in which we will find all the AMReX code. 2 | AMREX_HOME ?= ../../../../../amrex 3 | 4 | DEBUG = FALSE 5 | USE_MPI = FALSE 6 | USE_OMP = FALSE 7 | COMP = gnu 8 | DIM = 3 9 | 10 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 11 | 12 | include ../Source/Make.package 13 | VPATH_LOCATIONS += ../Source 14 | INCLUDE_LOCATIONS += ./Source 15 | 16 | include $(AMREX_HOME)/Src/Base/Make.package 17 | 18 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 19 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX0_C/Exec/inputs: -------------------------------------------------------------------------------- 1 | n_cell = 32 2 | max_grid_size = 16 3 | 4 | nsteps = 1000 5 | plot_int = 100 6 | 7 | dt = 1.e-5 8 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX0_C/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | CEXE_headers += myfunc.H 3 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX0_C/Source/myfunc.H: -------------------------------------------------------------------------------- 1 | #ifndef MYFUNC_H_ 2 | #define MYFUNC_H_ 3 | 4 | void main_main (); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX1_C/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (AMReX_SPACEDIM EQUAL 1) 2 | return() 3 | endif () 4 | 5 | # List of source files 6 | set(_sources main.cpp myfunc.cpp myfunc.H mykernel.H) 7 | list(TRANSFORM _sources PREPEND "Source/") 8 | 9 | # List of input files 10 | file( GLOB_RECURSE _input_files LIST_DIRECTORIES false Exec/input* ) 11 | 12 | setup_tutorial(_sources _input_files) 13 | 14 | unset( _sources ) 15 | unset( _input_files ) 16 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX1_C/Exec/GNUmakefile: -------------------------------------------------------------------------------- 1 | # AMREX_HOME defines the directory in which we will find all the AMReX code. 2 | AMREX_HOME ?= ../../../../../amrex 3 | 4 | DEBUG = FALSE 5 | USE_MPI = FALSE 6 | MPI_THREAD_MULTIPLE = FALSE # amrex.async_out=1 with more than 64 processes requires MPI_THREAD_MULTIPLE 7 | USE_OMP = FALSE 8 | COMP = gnu 9 | DIM = 3 10 | 11 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 12 | 13 | include ../Source/Make.package 14 | VPATH_LOCATIONS += ../Source 15 | INCLUDE_LOCATIONS += ../Source 16 | 17 | include $(AMREX_HOME)/Src/Base/Make.package 18 | 19 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 20 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX1_C/Exec/inputs: -------------------------------------------------------------------------------- 1 | nsteps = 1000 2 | plot_int = 100 3 | n_cell = 128 4 | max_grid_size = 64 5 | 6 | amrex.v = 1 7 | amrex.async_out = 0 # If we use more than 64 processes, async_out will require MPI_THREAD_MULTIPLE 8 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX1_C/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp myfunc.cpp 2 | CEXE_headers += myfunc.H mykernel.H 3 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX1_C/Source/myfunc.H: -------------------------------------------------------------------------------- 1 | #ifndef MYFUNC_H_ 2 | #define MYFUNC_H_ 3 | 4 | #include 5 | #include 6 | 7 | void main_main (); 8 | 9 | void advance (amrex::MultiFab& phi_old, 10 | amrex::MultiFab& phi_new, 11 | amrex::Array& flux, 12 | amrex::Real dt, 13 | amrex::Geometry const& geom); 14 | 15 | void init_phi (amrex::MultiFab& phi_new, amrex::Geometry const& geom); 16 | #endif 17 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX1_CF/Exec/GNUmakefile: -------------------------------------------------------------------------------- 1 | # AMREX_HOME defines the directory in which we will find all the AMReX code. 2 | AMREX_HOME ?= ../../../../../amrex 3 | 4 | DEBUG = FALSE 5 | USE_MPI = FALSE 6 | USE_OMP = FALSE 7 | COMP = gnu 8 | DIM = 2 9 | 10 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 11 | 12 | include ../Source/Make.package 13 | VPATH_LOCATIONS += ../Source 14 | INCLUDE_LOCATIONS += ../Source 15 | 16 | include $(AMREX_HOME)/Src/Base/Make.package 17 | 18 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 19 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX1_CF/Exec/inputs_2d: -------------------------------------------------------------------------------- 1 | nsteps = 10000 2 | plot_int = 1000 3 | n_cell = 256 4 | max_grid_size = 64 5 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX1_CF/Exec/inputs_3d: -------------------------------------------------------------------------------- 1 | nsteps = 1000 2 | plot_int = 100 3 | n_cell = 128 4 | max_grid_size = 32 5 | 6 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX1_CF/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp advance.cpp 2 | 3 | CEXE_headers += myfunc.H 4 | FEXE_headers += myfunc_F.H 5 | 6 | f90EXE_sources += init_phi_$(DIM)d.f90 7 | f90EXE_sources += advance_$(DIM)d.f90 8 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX1_CF/Source/myfunc.H: -------------------------------------------------------------------------------- 1 | #ifndef MYFUNC_H_ 2 | #define MYFUNC_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | void main_main (); 9 | 10 | void advance (amrex::MultiFab& phi_old, 11 | amrex::MultiFab& phi_new, 12 | amrex::Array& flux, 13 | amrex::Real dt, 14 | const amrex::Geometry& geom); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX1_F/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This tutorial needs Fortran interfaces 3 | # Disable for cuda 4 | # 5 | if ( NOT AMReX_FORTRAN_INTERFACES OR AMReX_CUDA ) 6 | return() 7 | endif () 8 | 9 | # List of source files 10 | set(_sources fmain.F90 init_phi.f90 advance.f90) 11 | 12 | # List of input files 13 | file( GLOB_RECURSE _input_files LIST_DIRECTORIES false input* ) 14 | 15 | setup_tutorial(_sources _input_files HAS_FORTRAN_MODULES) 16 | 17 | unset( _sources ) 18 | unset( _input_files ) 19 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX1_F/GNUmakefile: -------------------------------------------------------------------------------- 1 | # AMREX_HOME defines the directory in which we will find all the AMReX code 2 | AMREX_HOME ?= ../../../../amrex 3 | 4 | DEBUG = TRUE 5 | 6 | USE_MPI = TRUE 7 | USE_OMP = FALSE 8 | USE_MPI3 = FALSE 9 | 10 | USE_F_INTERFACES = TRUE 11 | 12 | MEM_PROFILE = FALSE 13 | TINY_PROFILE = FALSE 14 | 15 | COMP = gnu 16 | 17 | DIM = 3 18 | 19 | EBASE = main 20 | 21 | include ./Make.package 22 | 23 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 24 | 25 | include $(AMREX_HOME)/Src/Base/Make.package 26 | include $(AMREX_HOME)/Src/F_Interfaces/Base/Make.package 27 | 28 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 29 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX1_F/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += init_phi.f90 advance.f90 2 | F90EXE_sources += fmain.F90 3 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX1_F/inputs: -------------------------------------------------------------------------------- 1 | 2 | nsteps = 100 # how many steps to run? 3 | 4 | plot_int = 10 # how often to make plot files? 5 | 6 | n_cell = 128 # number of cells in each dimension 7 | max_grid_size = 32 # max grid size 8 | 9 | # Must set coordinates to 0 (Cartesian), or 1 (Cylindrical), or 2 (Spherical). 10 | geometry.coord_sys = 0 11 | 12 | # Must set physical domain size. 13 | geometry.prob_lo = -1.0 -1.0 -1.0 14 | geometry.prob_hi = 1.0 1.0 1.0 15 | 16 | # Periodic? Default in AMReX is set to 0 (no). 17 | geometry.is_periodic = 1 1 1 18 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX2_C/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # List of source files 2 | set(_sources main.cpp myfunc.cpp myfunc.H mykernel.H) 3 | list(TRANSFORM _sources PREPEND "Source/") 4 | 5 | # List of input files 6 | file( GLOB_RECURSE _input_files LIST_DIRECTORIES false Exec/input* ) 7 | 8 | setup_tutorial(_sources _input_files) 9 | 10 | unset( _sources ) 11 | unset( _input_files ) 12 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX2_C/Exec/GNUmakefile: -------------------------------------------------------------------------------- 1 | # AMREX_HOME defines the directory in which we will find all the AMReX code. 2 | AMREX_HOME ?= ../../../../../amrex 3 | 4 | DEBUG = FALSE 5 | USE_MPI = TRUE 6 | USE_OMP = FALSE 7 | COMP = gcc 8 | DIM = 3 9 | 10 | USE_CUDA = FALSE 11 | USE_HIP = FALSE 12 | USE_SYCL = FALSE 13 | 14 | 15 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 16 | 17 | 18 | include ../Source/Make.package 19 | VPATH_LOCATIONS += ../Source 20 | INCLUDE_LOCATIONS += ../Source 21 | 22 | include $(AMREX_HOME)/Src/Base/Make.package 23 | 24 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 25 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX2_C/Exec/inputs: -------------------------------------------------------------------------------- 1 | nsteps = 10000 2 | plot_int = 1000 3 | n_cell = 256 4 | max_grid_size = 64 5 | 6 | # 0 = periodic 7 | # 2 = homogeneous Neumann (zero flux) 8 | # 3 = Dirichlet (prescribed value) 9 | bc_lo = 3 0 10 | bc_hi = 2 0 11 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX2_C/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp myfunc.cpp 2 | CEXE_heaeders += myfunc.H mykernel.H 3 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX2_C/Source/myfunc.H: -------------------------------------------------------------------------------- 1 | #ifndef MYFUNC_H_ 2 | #define MYFUNC_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace amrex; 9 | 10 | void main_main (); 11 | 12 | void advance (amrex::MultiFab& phi_old, 13 | amrex::MultiFab& phi_new, 14 | amrex::Array& flux, 15 | amrex::Real dt, 16 | amrex::Geometry const& geom, 17 | Vector const& BoundaryCondition); 18 | 19 | void init_phi (amrex::MultiFab& phi_new, amrex::Geometry const& geom); 20 | #endif 21 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX2_CF/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if ( NOT AMReX_FINTERFACES OR ( AMReX_SPACEDIM EQUAL 1) ) 2 | return() 3 | endif () 4 | 5 | # List of source files 6 | set(_sources main.cpp advance.cpp myfunc_F.H myfunc.H init_phi_${AMReX_SPACEDIM}d.f90 advance_${AMReX_SPACEDIM}d.f90) 7 | list(TRANSFORM _sources PREPEND "Source/") 8 | 9 | # List of input files 10 | file( GLOB_RECURSE _input_files LIST_DIRECTORIES false Exec/input* ) 11 | 12 | setup_tutorial(_sources _input_files) 13 | 14 | unset( _sources ) 15 | unset( _input_files ) 16 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX2_CF/Exec/GNUmakefile: -------------------------------------------------------------------------------- 1 | # AMREX_HOME defines the directory in which we will find all the AMReX code. 2 | AMREX_HOME ?= ../../../../../amrex 3 | 4 | DEBUG = FALSE 5 | USE_MPI = FALSE 6 | USE_OMP = FALSE 7 | COMP = gnu 8 | DIM = 2 9 | 10 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 11 | 12 | include ../Source/Make.package 13 | VPATH_LOCATIONS += ../Source 14 | INCLUDE_LOCATIONS += ../Source 15 | 16 | include $(AMREX_HOME)/Src/Base/Make.package 17 | 18 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 19 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX2_CF/Exec/inputs_2d: -------------------------------------------------------------------------------- 1 | nsteps = 10000 2 | plot_int = 1000 3 | n_cell = 256 4 | max_grid_size = 64 5 | 6 | # 0 = periodic 7 | # 2 = homogeneous Neumann (zero flux) 8 | # 3 = Dirichlet (prescribed value) 9 | bc_lo = 3 0 10 | bc_hi = 2 0 11 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX2_CF/Exec/inputs_3d: -------------------------------------------------------------------------------- 1 | nsteps = 1000 2 | plot_int = 100 3 | n_cell = 128 4 | max_grid_size = 32 5 | 6 | # 0 = periodic 7 | # 2 = homogeneous Neumann (zero flux) 8 | # 3 = Dirichlet (prescribed value) 9 | bc_lo = 0 3 0 10 | bc_hi = 0 2 0 11 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX2_CF/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp advance.cpp 2 | 3 | CEXE_headers += myfunc.H 4 | FEXE_headers += myfunc_F.H 5 | 6 | f90EXE_sources += init_phi_$(DIM)d.f90 7 | f90EXE_sources += advance_$(DIM)d.f90 8 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX2_CF/Source/myfunc.H: -------------------------------------------------------------------------------- 1 | #ifndef MYFUNC_H_ 2 | #define MYFUNC_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | void main_main (); 10 | 11 | void advance (amrex::MultiFab& phi_old, 12 | amrex::MultiFab& phi_new, 13 | amrex::Array& flux, 14 | amrex::Real dt, 15 | const amrex::Geometry& geom, 16 | const amrex::Vector& bc); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX3_C/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # List of source files 2 | set(_sources main.cpp advance.cpp init_phi.cpp myfunc.H mykernel.H) 3 | list(TRANSFORM _sources PREPEND "Source/") 4 | 5 | # List of input files 6 | file( GLOB_RECURSE _input_files LIST_DIRECTORIES false Exec/input* ) 7 | 8 | setup_tutorial(_sources _input_files) 9 | 10 | unset( _sources ) 11 | unset( _input_files ) 12 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX3_C/Exec/GNUmakefile: -------------------------------------------------------------------------------- 1 | # AMREX_HOME defines the directory in which we will find all the AMReX code. 2 | AMREX_HOME ?= ../../../../../amrex 3 | 4 | DEBUG = FALSE 5 | USE_MPI = FALSE 6 | USE_OMP = FALSE 7 | COMP = gnu 8 | DIM = 2 9 | 10 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 11 | 12 | include ../Source/Make.package 13 | VPATH_LOCATIONS += ../Source 14 | INCLUDE_LOCATIONS += ../Source 15 | 16 | Pdirs := Base Boundary LinearSolvers/MLMG 17 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 18 | 19 | include $(Ppack) 20 | 21 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 22 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX3_C/Exec/inputs_2d: -------------------------------------------------------------------------------- 1 | # Implicit time step is set to 10 * (explicit time step) 2 | nsteps = 1000 3 | plot_int = 100 4 | n_cell = 256 5 | max_grid_size = 64 6 | 7 | # 0 = periodic 8 | # 2 = homogeneous Neumann (zero flux) 9 | # 3 = Dirichlet (prescribed value) 10 | bc_lo = 0 2 11 | bc_hi = 0 2 12 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX3_C/Exec/inputs_3d: -------------------------------------------------------------------------------- 1 | # Implicit time step is set to 10^{DIM-1} * (explicit time step) 2 | nsteps = 10 3 | plot_int = 1 4 | n_cell = 128 5 | max_grid_size = 32 6 | 7 | # 0 = periodic 8 | # 2 = homogeneous Neumann (zero flux) 9 | # 3 = Dirichlet (prescribed value) 10 | bc_lo = 2 0 0 11 | bc_hi = 2 0 0 12 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX3_C/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp advance.cpp init_phi.cpp 2 | CEXE_headers += myfunc.H mykernel.H 3 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX3_C/Source/init_phi.cpp: -------------------------------------------------------------------------------- 1 | #include "myfunc.H" 2 | #include "mykernel.H" 3 | 4 | #include 5 | #include 6 | 7 | using namespace amrex; 8 | 9 | void init_phi(amrex::MultiFab& phi_new, amrex::Geometry const& geom) 10 | { 11 | GpuArray dx = geom.CellSizeArray(); 12 | GpuArray prob_lo = geom.ProbLoArray(); 13 | 14 | for (MFIter mfi(phi_new); mfi.isValid(); ++mfi) 15 | { 16 | const Box& vbx = mfi.validbox(); 17 | auto const& phiNew = phi_new.array(mfi); 18 | amrex::ParallelFor(vbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) 19 | { 20 | init_phi(i, j, k, phiNew, dx, prob_lo); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_EX3_C/Source/myfunc.H: -------------------------------------------------------------------------------- 1 | #ifndef MYFUNC_H_ 2 | #define MYFUNC_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | // #include 8 | 9 | void main_main (); 10 | 11 | void advance (amrex::MultiFab& phi_old, 12 | amrex::MultiFab& phi_new, 13 | amrex::Real dt, 14 | const amrex::Geometry& geom, 15 | const amrex::BoxArray& grids, 16 | const amrex::DistributionMapping& dmap, 17 | const amrex::Vector& bc); 18 | 19 | void init_phi (amrex::MultiFab& phi_new, 20 | amrex::Geometry const& geom); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_Restart/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (AMReX_SPACEDIM EQUAL 1) 2 | return() 3 | endif () 4 | 5 | # List of source files 6 | set(_sources main.cpp checkpoint.cpp myfunc.H) 7 | list(TRANSFORM _sources PREPEND "Source/") 8 | 9 | # List of input files 10 | file( GLOB_RECURSE _input_files LIST_DIRECTORIES false Exec/input* ) 11 | 12 | setup_tutorial(_sources _input_files) 13 | 14 | unset( _sources ) 15 | unset( _input_files ) 16 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_Restart/Exec/GNUmakefile: -------------------------------------------------------------------------------- 1 | # AMREX_HOME defines the directory in which we will find all the AMReX code. 2 | AMREX_HOME ?= ../../../../../amrex 3 | 4 | DEBUG = FALSE 5 | USE_MPI = FALSE 6 | USE_OMP = FALSE 7 | COMP = gnu 8 | DIM = 3 9 | 10 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 11 | 12 | include ../Source/Make.package 13 | VPATH_LOCATIONS += ../Source 14 | INCLUDE_LOCATIONS += ./Source 15 | 16 | include $(AMREX_HOME)/Src/Base/Make.package 17 | 18 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 19 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_Restart/Exec/inputs: -------------------------------------------------------------------------------- 1 | n_cell = 32 2 | max_grid_size = 16 3 | 4 | nsteps = 1000 5 | plot_int = 100 6 | chk_int = 100 7 | 8 | dt = 1.e-5 9 | 10 | restart = -1 11 | #restart = 200 12 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_Restart/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | CEXE_sources += checkpoint.cpp 3 | CEXE_headers += myfunc.H 4 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HeatEquation_Restart/Source/myfunc.H: -------------------------------------------------------------------------------- 1 | #include "AMReX_PlotFileUtil.H" 2 | 3 | #ifndef MYFUNC_H_ 4 | #define MYFUNC_H_ 5 | 6 | using namespace amrex; 7 | 8 | void main_main (); 9 | 10 | void WriteCheckpoint(const int& step, 11 | const Real& time, 12 | const MultiFab& phi); 13 | 14 | void ReadCheckpoint(const int& restart, 15 | Real& time, 16 | MultiFab& phi, 17 | BoxArray& ba, 18 | DistributionMapping& dm); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HelloWorld_C/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # List of source files 2 | set(_sources main.cpp) 3 | 4 | # List of input files 5 | set(_input_files) 6 | 7 | setup_tutorial(_sources _input_files) 8 | 9 | unset( _sources ) 10 | unset( _input_files ) 11 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HelloWorld_C/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | 3 | DEBUG = FALSE 4 | DEBUG = TRUE 5 | 6 | DIM = 3 7 | 8 | COMP = gcc 9 | 10 | USE_MPI = FALSE 11 | USE_OMP = FALSE 12 | USE_CUDA = FALSE 13 | USE_HIP = FALSE 14 | 15 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 16 | 17 | include ./Make.package 18 | include $(AMREX_HOME)/Src/Base/Make.package 19 | 20 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 21 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HelloWorld_C/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HelloWorld_C/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | amrex::Initialize(argc,argv); 8 | { 9 | amrex::Print() << "Hello world from AMReX version " << amrex::Version() << "\n"; 10 | } 11 | amrex::Finalize(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HelloWorld_F/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if ( NOT AMReX_FORTRAN_INTERFACES ) 2 | return() 3 | endif () 4 | 5 | # List of source files 6 | set(_sources fmain.f90) 7 | 8 | # List of input files 9 | set(_input_files) 10 | 11 | setup_tutorial(_sources _input_files) 12 | 13 | unset( _sources ) 14 | unset( _input_files ) 15 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HelloWorld_F/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | 3 | DEBUG = FALSE 4 | DEBUG = TRUE 5 | 6 | DIM = 3 7 | 8 | COMP = gnu 9 | 10 | USE_MPI = FALSE 11 | USE_OMP = FALSE 12 | 13 | USE_F_INTERFACES = TRUE 14 | 15 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 16 | 17 | include ./Make.package 18 | include $(AMREX_HOME)/Src/Base/Make.package 19 | include $(AMREX_HOME)/Src/F_Interfaces/Base/Make.package 20 | 21 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 22 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HelloWorld_F/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += fmain.f90 2 | 3 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/HelloWorld_F/fmain.f90: -------------------------------------------------------------------------------- 1 | 2 | program main 3 | 4 | use amrex_base_module 5 | 6 | implicit none 7 | 8 | call amrex_init() 9 | 10 | if (amrex_parallel_ioprocessor()) then 11 | print *, "Hello world!" 12 | end if 13 | 14 | call amrex_finalize() 15 | 16 | end program main 17 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/main_C/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT AMReX_MPI) 2 | return() 3 | endif () 4 | 5 | set(_sources main.cpp) 6 | set(_input_files) 7 | 8 | setup_tutorial(_sources _input_files) 9 | 10 | unset(_sources) 11 | unset(_input_files) 12 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/main_C/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | 3 | DEBUG = FALSE 4 | DEBUG = TRUE 5 | 6 | DIM = 3 7 | 8 | COMP = gnu 9 | 10 | USE_MPI = TRUE 11 | USE_OMP = FALSE 12 | 13 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 14 | 15 | include ./Make.package 16 | include $(AMREX_HOME)/Src/Base/Make.package 17 | 18 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 19 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/main_C/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/main_F/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT AMReX_FORTRAN_INTERFACES OR NOT AMReX_MPI) 2 | return() 3 | endif () 4 | 5 | set(_sources main.F90) 6 | set(_input_files) 7 | 8 | setup_tutorial(_sources _input_files) 9 | 10 | unset(_sources) 11 | unset(_input_files) 12 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/main_F/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | 3 | DEBUG = FALSE 4 | DEBUG = TRUE 5 | 6 | DIM = 3 7 | 8 | COMP = gnu 9 | 10 | USE_MPI = TRUE 11 | USE_OMP = FALSE 12 | 13 | USE_F_INTERFACES = TRUE 14 | 15 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 16 | 17 | include ./Make.package 18 | include $(AMREX_HOME)/Src/Base/Make.package 19 | include $(AMREX_HOME)/Src/F_Interfaces/Base/Make.package 20 | 21 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 22 | -------------------------------------------------------------------------------- /ExampleCodes/Basic/main_F/Make.package: -------------------------------------------------------------------------------- 1 | F90EXE_sources += main.F90 2 | -------------------------------------------------------------------------------- /ExampleCodes/Blueprint/AssignMultiLevelDensity/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT CMAKE_Fortran_COMPILER_LOADED OR NOT AMReX_PARTICLES) 2 | return() 3 | endif () 4 | 5 | set(_sources main.cpp) 6 | set(_input_files inputs) 7 | 8 | setup_tutorial(_sources _input_files) 9 | 10 | unset(_sources) 11 | unset(_input_files) 12 | -------------------------------------------------------------------------------- /ExampleCodes/Blueprint/AssignMultiLevelDensity/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | 3 | -------------------------------------------------------------------------------- /ExampleCodes/Blueprint/CellSortedParticles/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT (AMReX_SPACEDIM EQUAL 3) OR NOT CMAKE_Fortran_COMPILER_LOADED OR NOT AMReX_PARTICLES) 2 | return() 3 | endif () 4 | 5 | set(_sources cell_sorted_3d.F90 cell_sorted_F.H CellSortedPC.cpp CellSortedPC.H main.cpp) 6 | set(_input_files inputs) 7 | 8 | setup_tutorial(_sources _input_files) 9 | 10 | unset(_sources) 11 | unset(_input_files) 12 | -------------------------------------------------------------------------------- /ExampleCodes/Blueprint/CellSortedParticles/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | 3 | DEBUG = TRUE 4 | DEBUG = FALSE 5 | 6 | DIM = 3 7 | 8 | COMP = gcc 9 | 10 | TINY_PROFILE = TRUE 11 | USE_PARTICLES = TRUE 12 | 13 | PRECISION = DOUBLE 14 | 15 | USE_MPI = FALSE 16 | USE_OMP = FALSE 17 | 18 | ################################################### 19 | 20 | EBASE = main 21 | 22 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 23 | 24 | include ./Make.package 25 | include $(AMREX_HOME)/Src/Base/Make.package 26 | include $(AMREX_HOME)/Src/Particle/Make.package 27 | 28 | ifeq ($(USE_CONDUIT),TRUE) 29 | include $(AMREX_HOME)/Src/Extern/Conduit/Make.package 30 | endif 31 | 32 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 33 | -------------------------------------------------------------------------------- /ExampleCodes/Blueprint/CellSortedParticles/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp CellSortedPC.cpp 2 | CEXE_headers += CellSortedPC.H 3 | 4 | CEXE_headers += cell_sorted_F.H 5 | F90EXE_sources += cell_sorted_$(DIM)d.F90 6 | -------------------------------------------------------------------------------- /ExampleCodes/Blueprint/CellSortedParticles/cell_sorted_F.H: -------------------------------------------------------------------------------- 1 | #ifndef _CELL_SORTED_F_H_ 2 | #define _CELL_SORTED_F_H_ 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" 8 | { 9 | #endif 10 | 11 | void move_particles(void* particles, 12 | const int *np, 13 | const int *lo, 14 | const int *hi, 15 | int** c_vectors, 16 | int* sizes, 17 | const int* clo, 18 | const int* chi, 19 | const amrex_real* plo, 20 | const amrex_real* dx, 21 | const amrex_real* dt); 22 | 23 | #ifdef __cplusplus 24 | }; 25 | #endif 26 | 27 | #endif /*_EM_PIC_F_H_*/ 28 | -------------------------------------------------------------------------------- /ExampleCodes/Blueprint/CellSortedParticles/inputs: -------------------------------------------------------------------------------- 1 | 2 | ncell = (32, 32, 32) 3 | nppc = (4, 4, 4) 4 | 5 | max_grid_size = 16 6 | 7 | nsteps = 10 8 | -------------------------------------------------------------------------------- /ExampleCodes/Blueprint/HeatEquation_EX1_C/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (AMReX_SPACEDIM EQUAL 1 OR NOT CMAKE_Fortran_COMPILER_LOADED) 2 | return() 3 | endif () 4 | 5 | set(_sources advance_${AMReX_SPACEDIM}d.f90 advance.cpp init_phi_${AMReX_SPACEDIM}d.f90 main.cpp myfunc_F.H myfunc.H) 6 | list(TRANSFORM _sources PREPEND Source/) 7 | 8 | set(_input_files Exec/inputs_${AMReX_SPACEDIM}d) 9 | 10 | setup_tutorial(_sources _input_files) 11 | 12 | unset(_sources) 13 | unset(_input_files) 14 | -------------------------------------------------------------------------------- /ExampleCodes/Blueprint/HeatEquation_EX1_C/Exec/inputs_2d: -------------------------------------------------------------------------------- 1 | nsteps = 10000 2 | plot_int = 1000 3 | n_cell = 128 4 | max_grid_size = 64 5 | -------------------------------------------------------------------------------- /ExampleCodes/Blueprint/HeatEquation_EX1_C/Exec/inputs_3d: -------------------------------------------------------------------------------- 1 | nsteps = 1000 2 | plot_int = 100 3 | n_cell = 64 4 | max_grid_size = 32 5 | 6 | -------------------------------------------------------------------------------- /ExampleCodes/Blueprint/HeatEquation_EX1_C/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp advance.cpp 2 | 3 | CEXE_headers += myfunc.H 4 | FEXE_headers += myfunc_F.H 5 | 6 | f90EXE_sources += init_phi_$(DIM)d.f90 7 | f90EXE_sources += advance_$(DIM)d.f90 8 | -------------------------------------------------------------------------------- /ExampleCodes/Blueprint/HeatEquation_EX1_C/Source/myfunc.H: -------------------------------------------------------------------------------- 1 | #ifndef MYFUNC_H_ 2 | #define MYFUNC_H_ 3 | 4 | #include 5 | #include 6 | 7 | using namespace amrex; 8 | 9 | void main_main (); 10 | 11 | void advance (MultiFab& phi_old, 12 | MultiFab& phi_new, 13 | std::array& flux, 14 | Real dt, 15 | const Geometry& geom); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /ExampleCodes/EB/CNS/Exec/Combustor/GNUmakefile: -------------------------------------------------------------------------------- 1 | TINY_PROFILE = TRUE 2 | #PROFILE=FALSE 3 | #MEM_PROFILE=TRUE 4 | #TRACE_PROFILE=TRUE 5 | #COMM_PROFILE=TRUE 6 | #USE_PROFPARSER=TRUE 7 | 8 | DEBUG = FALSE 9 | 10 | USE_MPI = TRUE 11 | USE_OMP = FALSE 12 | 13 | include ./Make.package 14 | include ../Make.CNS 15 | 16 | -------------------------------------------------------------------------------- /ExampleCodes/EB/CNS/Exec/Combustor/Make.package: -------------------------------------------------------------------------------- 1 | 2 | F90EXE_sources += cns_prob.F90 3 | -------------------------------------------------------------------------------- /ExampleCodes/EB/CNS/Exec/Pulse/GNUmakefile: -------------------------------------------------------------------------------- 1 | TINY_PROFILE = FALSE 2 | 3 | DEBUG = TRUE 4 | DIM=3 5 | USE_MPI = FALSE 6 | USE_OMP = FALSE 7 | 8 | include ./Make.package 9 | include ../Make.CNS 10 | 11 | -------------------------------------------------------------------------------- /ExampleCodes/EB/CNS/Exec/Pulse/Make.package: -------------------------------------------------------------------------------- 1 | 2 | F90EXE_sources += cns_prob.F90 3 | -------------------------------------------------------------------------------- /ExampleCodes/EB/CNS/Exec/ShockRef/GNUmakefile: -------------------------------------------------------------------------------- 1 | TINY_PROFILE = FALSE 2 | 3 | DEBUG = FALSE 4 | 5 | USE_MPI = TRUE 6 | USE_OMP = FALSE 7 | 8 | include ./Make.package 9 | include ../Make.CNS 10 | 11 | -------------------------------------------------------------------------------- /ExampleCodes/EB/CNS/Exec/ShockRef/Make.package: -------------------------------------------------------------------------------- 1 | 2 | F90EXE_sources += cns_prob.F90 3 | -------------------------------------------------------------------------------- /ExampleCodes/EB/CNS/Exec/Sod/GNUmakefile: -------------------------------------------------------------------------------- 1 | TINY_PROFILE = FALSE 2 | 3 | DEBUG = FALSE 4 | DIM=3 5 | USE_MPI = TRUE 6 | USE_OMP = FALSE 7 | 8 | include ./Make.package 9 | include ../Make.CNS 10 | 11 | -------------------------------------------------------------------------------- /ExampleCodes/EB/CNS/Exec/Sod/Make.package: -------------------------------------------------------------------------------- 1 | 2 | F90EXE_sources += cns_prob.F90 3 | -------------------------------------------------------------------------------- /ExampleCodes/EB/CNS/Source/Make.package: -------------------------------------------------------------------------------- 1 | 2 | CEXE_sources += main.cpp 3 | 4 | CEXE_headers += CNS.H 5 | CEXE_headers += CNS_F.H 6 | 7 | CEXE_sources += CNS_advance.cpp 8 | CEXE_sources += CNS.cpp 9 | CEXE_sources += CNSBld.cpp 10 | CEXE_sources += CNS_io.cpp 11 | CEXE_sources += CNS_setup.cpp 12 | 13 | CEXE_sources += CNS_init_eb2.cpp 14 | -------------------------------------------------------------------------------- /ExampleCodes/EB/CNS/Source/diffusion/Make.package: -------------------------------------------------------------------------------- 1 | 2 | F90EXE_sources += cns_diff_mod.F90 3 | F90EXE_sources += cns_eb_diff_mod.F90 4 | F90EXE_sources += cns_eb_diff_wall.F90 5 | F90EXE_sources += diff_coef_mod.F90 6 | -------------------------------------------------------------------------------- /ExampleCodes/EB/CNS/Source/fortran/Make.package: -------------------------------------------------------------------------------- 1 | 2 | F90EXE_sources += CNS_f.F90 3 | F90EXE_sources += CNS_nd.F90 4 | F90EXE_sources += CNS_physics.F90 5 | F90EXE_sources += CNS_derive.F90 6 | F90EXE_sources += bc_fill_nd.F90 7 | F90EXE_sources += CNS_dudt.F90 8 | F90EXE_sources += CNS_divop.F90 9 | F90EXE_sources += CNS_tagging.F90 10 | -------------------------------------------------------------------------------- /ExampleCodes/EB/CNS/Source/hydro/Make.package: -------------------------------------------------------------------------------- 1 | 2 | F90EXE_sources += Hyp_gamma_MOL.F90 3 | F90EXE_sources += Hyp_gamma_MOL_EB.F90 4 | 5 | F90EXE_sources += slope_mol_3d_gamma.F90 6 | F90EXE_sources += slope_mol_3d_gamma_EB.F90 7 | 8 | F90EXE_sources += analriem3d.F90 9 | 10 | F90EXE_sources += cns_eb_hyp_wall.F90 11 | 12 | -------------------------------------------------------------------------------- /ExampleCodes/EB/GeometryGeneration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT AMReX_SPACEDIM EQUAL 3) 2 | return() 3 | endif () 4 | 5 | set(_sources main.cpp) 6 | set(_input_files) 7 | 8 | setup_tutorial(_sources _input_files) 9 | 10 | unset(_sources) 11 | unset(_input_files) 12 | -------------------------------------------------------------------------------- /ExampleCodes/EB/GeometryGeneration/GNUmakefile: -------------------------------------------------------------------------------- 1 | DEBUG = FALSE 2 | TEST = TRUE 3 | USE_ASSERTION = TRUE 4 | 5 | USE_EB = TRUE 6 | 7 | USE_MPI = TRUE 8 | USE_OMP = FALSE 9 | 10 | COMP = gnu 11 | 12 | DIM = 3 13 | 14 | AMREX_HOME ?= ../../../../amrex 15 | 16 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 17 | 18 | include ./Make.package 19 | 20 | Pdirs := Base Boundary AmrCore EB 21 | 22 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 23 | 24 | include $(Ppack) 25 | 26 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 27 | 28 | -------------------------------------------------------------------------------- /ExampleCodes/EB/GeometryGeneration/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | -------------------------------------------------------------------------------- /ExampleCodes/EB/Poisson/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_sources main.cpp Poisson.cpp Poisson.H) 2 | set(_input_files inputs) 3 | 4 | setup_tutorial(_sources _input_files) 5 | 6 | unset(_sources) 7 | unset(_input_files) 8 | -------------------------------------------------------------------------------- /ExampleCodes/EB/Poisson/GNUmakefile: -------------------------------------------------------------------------------- 1 | USE_EB = TRUE 2 | DEBUG = FALSE 3 | USE_MPI = TRUE 4 | USE_OMP = FALSE 5 | 6 | USE_HYPRE = FALSE 7 | 8 | COMP = gnu 9 | 10 | DIM = 2 11 | 12 | AMREX_HOME ?= ../../../../amrex 13 | 14 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 15 | 16 | include ./Make.package 17 | 18 | Pdirs := Base Boundary AmrCore 19 | Pdirs += EB 20 | Pdirs += LinearSolvers/MLMG 21 | 22 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 23 | 24 | include $(Ppack) 25 | 26 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 27 | 28 | -------------------------------------------------------------------------------- /ExampleCodes/EB/Poisson/Make.package: -------------------------------------------------------------------------------- 1 | 2 | CEXE_sources += main.cpp 3 | 4 | CEXE_headers += Poisson.H 5 | CEXE_sources += Poisson.cpp 6 | -------------------------------------------------------------------------------- /ExampleCodes/EB/Poisson/Poisson.H: -------------------------------------------------------------------------------- 1 | #ifndef POISSON_H_ 2 | #define POISSON_H_ 3 | 4 | #include 5 | 6 | void InitData (amrex::MultiFab& State); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /ExampleCodes/EB/Poisson/Poisson.cpp: -------------------------------------------------------------------------------- 1 | #include "Poisson.H" 2 | 3 | using namespace amrex; 4 | 5 | void InitData (MultiFab& State) 6 | { 7 | #ifdef AMREX_USE_OMP 8 | #pragma omp parallel 9 | #endif 10 | for (MFIter mfi(State,true); mfi.isValid(); ++mfi) 11 | { 12 | const Box& bx = mfi.growntilebox(); 13 | const Array4& q = State.array(mfi); 14 | amrex::ParallelFor(bx, 15 | [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept 16 | { 17 | if (i==70 && j==70 && k==0) { 18 | q(i,j,k) = 1.0; 19 | } else { 20 | q(i,j,k) = 0.0; 21 | } 22 | }); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ExampleCodes/EB/Poisson/inputs: -------------------------------------------------------------------------------- 1 | amrex.fpe_trap_invalid=1 2 | 3 | verbose = 2 4 | n_cell = 128 5 | max_grid_size = 32 6 | 7 | eb2.geom_type = sphere 8 | eb2.sphere_center = 0.5 0.5 0.5 9 | eb2.sphere_radius = 0.25 10 | eb2.sphere_has_fluid_inside = 1 11 | -------------------------------------------------------------------------------- /ExampleCodes/EB/STLtest/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | 3 | DEBUG = FALSE 4 | 5 | DIM = 3 6 | 7 | COMP = gnu 8 | 9 | USE_MPI = TRUE 10 | USE_OMP = FALSE 11 | USE_CUDA = FALSE 12 | USE_EB = TRUE 13 | 14 | TINY_PROFILE = FALSE 15 | 16 | include ./Make.package 17 | 18 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 19 | 20 | include $(AMREX_HOME)/Src/Base/Make.package 21 | include $(AMREX_HOME)/Src/EB/Make.package 22 | include $(AMREX_HOME)/Src/Boundary/Make.package 23 | include $(AMREX_HOME)/Src/AmrCore/Make.package 24 | 25 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 26 | -------------------------------------------------------------------------------- /ExampleCodes/EB/STLtest/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | -------------------------------------------------------------------------------- /ExampleCodes/EB/STLtest/inputs: -------------------------------------------------------------------------------- 1 | eb2.geom_type = stl 2 | eb2.stl_file = airfoil.stl 3 | 4 | eb2.stl_scale = 1 # default is 1 5 | eb2.stl_center = 0 0 0 # default is (0,0,0) 6 | eb2.stl_reverse_normal = 0 # default is 0. 7 | 8 | prob_lo = 0 0 0 9 | prob_hi = 220 35 60 10 | ncells = 128 32 64 11 | 12 | max_grid_size = 8 13 | 14 | -------------------------------------------------------------------------------- /ExampleCodes/FFT/Basic/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | 3 | DEBUG = FALSE 4 | DIM = 3 5 | COMP = gcc 6 | TINY_PROFILE = TRUE 7 | USE_MPI = TRUE 8 | USE_CUDA = FALSE 9 | USE_HIP = FALSE 10 | USE_FFT = TRUE 11 | 12 | BL_NO_FORT = TRUE 13 | 14 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 15 | include $(AMREX_HOME)/Src/Base/Make.package 16 | include $(AMREX_HOME)/Src/FFT/Make.package 17 | include Make.package 18 | 19 | 20 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 21 | -------------------------------------------------------------------------------- /ExampleCodes/FFT/Basic/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | -------------------------------------------------------------------------------- /ExampleCodes/FFT/Basic/inputs_2d: -------------------------------------------------------------------------------- 1 | n_cell_x = 64 2 | n_cell_y = 64 3 | 4 | max_grid_size_x = 32 5 | max_grid_size_y = 32 6 | 7 | prob_lo_x = 0. 8 | prob_lo_y = 0. 9 | 10 | prob_hi_x = 1. 11 | prob_hi_y = 1. 12 | -------------------------------------------------------------------------------- /ExampleCodes/FFT/Basic/inputs_3d: -------------------------------------------------------------------------------- 1 | n_cell_x = 64 2 | n_cell_y = 64 3 | n_cell_z = 64 4 | 5 | max_grid_size_x = 32 6 | max_grid_size_y = 32 7 | max_grid_size_z = 64 8 | 9 | prob_lo_x = 0. 10 | prob_lo_y = 0. 11 | prob_lo_z = 0. 12 | 13 | prob_hi_x = 1. 14 | prob_hi_y = 1. 15 | prob_hi_z = 1. 16 | -------------------------------------------------------------------------------- /ExampleCodes/FFT/EnergySpectrum/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | 3 | DEBUG = FALSE 4 | DIM = 3 5 | COMP = gcc 6 | USE_MPI = TRUE 7 | USE_CUDA = FALSE 8 | USE_HIP = FALSE 9 | USE_FFT = TRUE 10 | 11 | BL_NO_FORT = TRUE 12 | 13 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 14 | include $(AMREX_HOME)/Src/Base/Make.package 15 | include $(AMREX_HOME)/Src/FFT/Make.package 16 | include Make.package 17 | 18 | 19 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 20 | -------------------------------------------------------------------------------- /ExampleCodes/FFT/EnergySpectrum/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | -------------------------------------------------------------------------------- /ExampleCodes/FFT/EnergySpectrum/README: -------------------------------------------------------------------------------- 1 | This tutorial provides an example of computing the kinetic energy spectrum 2 | of velocity. 3 | 4 | To run this tutorial, one can generate the input data first with the incflo 5 | code (https://github.com/AMReX-Fluids/incflo). 6 | 7 | $ cd ../../../../ 8 | $ git clone https://github.com/AMReX-Fluids/AMReX-Hydro.git 9 | $ git clone https://github.com/AMReX-Fluids/incflo.git 10 | $ cd incflo/test_no_eb_3d 11 | $ make -j 12 | $ mpiexec -n 4 ./incflo3d.gnu.MPI.ex benchmark.taylor_green_vortices stop_time=0.1 amr.max_level=0 amr.n_cell="64 64 64" geometry.prob_hi="1.0 1.0 1.0" 13 | $ # Assuming plt00030 is the plotfile you want to use. 14 | $ cp -r plt00030 ../../amrex-tutorials/ExampleCodes/FFT/EnergySpectrum/plot 15 | $ cd ../../amrex-tutorials/ExampleCodes/FFT/EnergySpectrum 16 | 17 | -------------------------------------------------------------------------------- /ExampleCodes/FFT/Poisson/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | 3 | DEBUG = FALSE 4 | DIM = 3 5 | COMP = gcc 6 | TINY_PROFILE = TRUE 7 | USE_MPI = TRUE 8 | USE_CUDA = FALSE 9 | USE_HIP = FALSE 10 | USE_FFT = TRUE 11 | 12 | BL_NO_FORT = TRUE 13 | 14 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 15 | include $(AMREX_HOME)/Src/Base/Make.package 16 | include $(AMREX_HOME)/Src/FFT/Make.package 17 | include Make.package 18 | 19 | 20 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 21 | -------------------------------------------------------------------------------- /ExampleCodes/FFT/Poisson/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | -------------------------------------------------------------------------------- /ExampleCodes/FFT/Poisson/inputs: -------------------------------------------------------------------------------- 1 | n_cell_x = 64 2 | n_cell_y = 64 3 | n_cell_z = 64 4 | 5 | max_grid_size_x = 32 6 | max_grid_size_y = 32 7 | max_grid_size_z = 64 8 | 9 | prob_lo_x = 0. 10 | prob_lo_y = 0. 11 | prob_lo_z = 0. 12 | 13 | prob_hi_x = 1. 14 | prob_hi_y = 1. 15 | prob_hi_z = 1. 16 | -------------------------------------------------------------------------------- /ExampleCodes/ForkJoin/MLMG/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT CMAKE_Fortran_COMPILER_LOADED OR NOT AMReX_LINEAR_SOLVERS) 2 | return() 3 | endif () 4 | 5 | set(_sources main.cpp ff.f90) 6 | set(_input_files inputs) 7 | 8 | setup_tutorial(_sources _input_files) 9 | 10 | unset(_sources) 11 | unset(_input_files) 12 | -------------------------------------------------------------------------------- /ExampleCodes/ForkJoin/MLMG/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | 3 | DEBUG ?= TRUE 4 | DIM ?= 2 5 | COMP ?= gnu 6 | USE_MPI ?= TRUE 7 | USE_OMP ?= FALSE 8 | 9 | EBASE = main 10 | 11 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 12 | 13 | include Make.package 14 | Pdirs := Base Boundary LinearSolvers/MLMG 15 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 16 | include $(Ppack) 17 | 18 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 19 | -------------------------------------------------------------------------------- /ExampleCodes/ForkJoin/MLMG/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | 3 | f90EXE_sources += ff.f90 4 | -------------------------------------------------------------------------------- /ExampleCodes/ForkJoin/MLMG/inputs: -------------------------------------------------------------------------------- 1 | ntasks = 4 2 | ncomp = 12 3 | modify_split = 1 4 | 5 | n_cell = 64 6 | max_grid_size = 32 7 | 8 | fj_verbose = 1 9 | mlmg_verbose = 0 10 | task_output_dir = task_output 11 | -------------------------------------------------------------------------------- /ExampleCodes/ForkJoin/Simple/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_sources main.cpp MyTest.cpp MyTest_F.H MyTest.H) 2 | set(_input_files inputs) 3 | 4 | setup_tutorial(_sources _input_files) 5 | 6 | unset(_sources) 7 | unset(_input_files) 8 | -------------------------------------------------------------------------------- /ExampleCodes/ForkJoin/Simple/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | 3 | DEBUG ?= FALSE 4 | DIM ?= 3 5 | COMP ?= gnu 6 | USE_MPI ?= TRUE 7 | USE_OMP ?= FALSE 8 | 9 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 10 | 11 | include Make.package 12 | Pdirs := Base 13 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 14 | include $(Ppack) 15 | 16 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 17 | 18 | -------------------------------------------------------------------------------- /ExampleCodes/ForkJoin/Simple/Make.package: -------------------------------------------------------------------------------- 1 | 2 | CEXE_sources += main.cpp 3 | CEXE_sources += MyTest.cpp 4 | CEXE_headers += MyTest.H 5 | -------------------------------------------------------------------------------- /ExampleCodes/ForkJoin/Simple/MyTest.H: -------------------------------------------------------------------------------- 1 | #ifndef MY_TEST_H_ 2 | #define MY_TEST_H_ 3 | 4 | #include 5 | 6 | class MyTest 7 | { 8 | public: 9 | 10 | MyTest (); 11 | 12 | void runTest (); 13 | 14 | private: 15 | 16 | void readParameters (); 17 | void initData (); 18 | 19 | int n_tasks; 20 | amrex::MultiFab data_split, data_single, data_all; 21 | std::string outdir; 22 | bool fj_verbose; 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /ExampleCodes/ForkJoin/Simple/inputs: -------------------------------------------------------------------------------- 1 | 2 | n_cell = 32 3 | max_grid_size = 16 4 | n_comp_split = 8 5 | n_comp_single = 1 6 | n_comp_all = 2 7 | n_tasks = 2 8 | 9 | -------------------------------------------------------------------------------- /ExampleCodes/ForkJoin/Simple/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include "MyTest.H" 5 | 6 | int main (int argc, char* argv[]) 7 | { 8 | amrex::Initialize(argc, argv); 9 | 10 | { 11 | BL_PROFILE("main"); 12 | MyTest mytest; 13 | mytest.runTest(); 14 | } 15 | 16 | amrex::Finalize(); 17 | } 18 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_F/Exec/Make.Adv: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../../amrex 2 | TOP := ../../../Advection_F 3 | 4 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 5 | 6 | Bdirs := Source Source/Src_$(DIM)d 7 | Bpack += $(foreach dir, $(Bdirs), $(TOP)/$(dir)/Make.package) 8 | Blocs += $(foreach dir, $(Bdirs), $(TOP)/$(dir)) 9 | 10 | include $(Bpack) 11 | 12 | INCLUDE_LOCATIONS += $(Blocs) 13 | VPATH_LOCATIONS += $(Blocs) 14 | 15 | Pdirs := Base Boundary AmrCore Particle F_Interfaces/Base F_Interfaces/AmrCore F_Interfaces/Particle 16 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 17 | 18 | $(info $(Ppack)) 19 | 20 | include $(Ppack) 21 | 22 | 23 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 24 | 25 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_F/Exec/SingleVortex/GNUmakefile: -------------------------------------------------------------------------------- 1 | 2 | DEBUG = TRUE 3 | DEBUG = FALSE 4 | 5 | USE_MPI = TRUE 6 | USE_OMP = FALSE 7 | USE_MPI3 = FALSE 8 | 9 | MEM_PROFILE = FALSE 10 | TINY_PROFILE = FALSE 11 | 12 | COMP = gnu 13 | 14 | DIM = 2 15 | #DIM = 3 16 | 17 | USE_PARTICLES = TRUE 18 | USE_F_INTERFACES = TRUE 19 | 20 | Bpack := ./Make.package 21 | Blocs := . 22 | 23 | include ../Make.Adv 24 | 25 | 26 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_F/Exec/SingleVortex/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += Prob_$(DIM)d.f90 2 | 3 | F90EXE_sources += face_velocity_$(DIM)d.F90 4 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_F/README: -------------------------------------------------------------------------------- 1 | AMR_Adv_CF: This code advects a single scalar field with a velocity 2 | field that is specified on faces. 3 | 4 | It is a AMReX based code designed to run in parallel using MPI/OMP. 5 | It uses the Fortran interfaces of AMReX. 6 | 7 | The directory Exec/SingleVortex includes a makefile and a sample inputs file. 8 | Plotfiles are generated that can be viewed with amrvis2d / amrvis3d. 9 | (CCSE's native vis / spreadsheet tool, downloadable separately from ccse.lbl.gov) 10 | or with Visit. 11 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_F/Source/Make.package: -------------------------------------------------------------------------------- 1 | 2 | F90EXE_sources += fmain.F90 my_amr_mod.F90 initdata.F90 tagging_mod.F90 plotfile_mod.F90 3 | F90EXE_sources += averagedown_mod.F90 evolve_mod.F90 compute_dt_mod.F90 fillpatch_mod.F90 4 | F90EXE_sources += amr_data_mod.F90 bc_mod.F90 5 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_F/Source/Src_2d/Make.package: -------------------------------------------------------------------------------- 1 | 2 | F90EXE_sources += advect_$(DIM)d_mod.F90 3 | 4 | f90EXE_sources += compute_flux_$(DIM)d.f90 slope_$(DIM)d.f90 5 | 6 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_F/Source/Src_3d/Make.package: -------------------------------------------------------------------------------- 1 | F90EXE_sources += advect_$(DIM)d_mod.F90 2 | f90EXE_sources += slope_$(DIM)d.f90 3 | f90EXE_sources += compute_flux_$(DIM)d.f90 4 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_F/Source/bc_mod.F90: -------------------------------------------------------------------------------- 1 | 2 | module bc_module 3 | 4 | use amrex_base_module 5 | 6 | implicit none 7 | 8 | ! periodic bc. See amrex_bc_types_module for a list of bc types. 9 | integer, save :: lo_bc(amrex_spacedim,1) = amrex_bc_int_dir ! the second dimension is the 10 | integer, save :: hi_bc(amrex_spacedim,1) = amrex_bc_int_dir ! number of components 11 | 12 | end module bc_module 13 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_F/Source/fmain.F90: -------------------------------------------------------------------------------- 1 | 2 | program main 3 | 4 | use amrex_amr_module 5 | 6 | use my_amr_module 7 | use initdata_module 8 | use evolve_module 9 | 10 | implicit none 11 | 12 | call amrex_init() 13 | call amrex_amrcore_init() 14 | 15 | call my_amr_init() 16 | 17 | call initdata() 18 | 19 | call evolve() 20 | 21 | call my_amr_finalize() 22 | 23 | call amrex_amrcore_finalize() 24 | call amrex_finalize() 25 | 26 | end program main 27 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if ( NOT AMReX_SPACEDIM EQUAL 2) 2 | return () 3 | endif () 4 | 5 | set(_sources advect_2d_mod.F90 compute_flux_2d.f90 slope_2d.f90) 6 | list(TRANSFORM _sources PREPEND Src_2d/ ) 7 | 8 | list(APPEND _sources amr_data_mod.F90 averagedown_mod.F90 bc_mod.F90 9 | compute_dt_mod.F90 evolve_mod.F90 fillpatch_mod.F90 fmain.F90 10 | initdata.F90 my_amr_mod.F90 plotfile_mod.F90 tagging_mod.F90) 11 | 12 | list(TRANSFORM _sources PREPEND Source/ ) 13 | 14 | list(APPEND _sources 15 | Exec/SingleVortex/face_velocity_2d.F90 16 | Exec/SingleVortex/Prob.f90 17 | ) 18 | 19 | file(GLOB_RECURSE _input_files LIST_DIRECTORIES false 20 | ${CMAKE_CURRENT_LIST_DIR}/input* ) 21 | 22 | 23 | setup_tutorial(_sources _input_files HAS_FORTRAN_MODULES) 24 | 25 | unset(_sources) 26 | unset(_input_files) 27 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F/Exec/Make.Adv: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../../amrex 2 | TOP := ../../../Advection_octree_F 3 | 4 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 5 | 6 | Bdirs := Source Source/Src_$(DIM)d 7 | Bpack += $(foreach dir, $(Bdirs), $(TOP)/$(dir)/Make.package) 8 | Blocs += $(foreach dir, $(Bdirs), $(TOP)/$(dir)) 9 | 10 | include $(Bpack) 11 | 12 | INCLUDE_LOCATIONS += $(Blocs) 13 | VPATH_LOCATIONS += $(Blocs) 14 | 15 | Pdirs := Base Boundary AmrCore F_Interfaces/Base F_Interfaces/AmrCore F_Interfaces/Octree 16 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 17 | 18 | $(info $(Ppack)) 19 | 20 | include $(Ppack) 21 | 22 | 23 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 24 | 25 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F/Exec/SingleVortex/GNUmakefile: -------------------------------------------------------------------------------- 1 | 2 | DEBUG = TRUE 3 | 4 | USE_MPI = TRUE 5 | USE_OMP = FALSE 6 | USE_MPI3 = FALSE 7 | 8 | MEM_PROFILE = FALSE 9 | TINY_PROFILE = FALSE 10 | 11 | COMP = gnu 12 | USE_F_INTERFACES = TRUE 13 | 14 | DIM = 2 15 | #DIM = 3 16 | 17 | Bpack := ./Make.package 18 | Blocs := . 19 | 20 | include ../Make.Adv 21 | 22 | 23 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F/Exec/SingleVortex/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += Prob.f90 2 | 3 | F90EXE_sources += face_velocity_$(DIM)d.F90 4 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F/Exec/SingleVortex/inputs: -------------------------------------------------------------------------------- 1 | max_step = 1000000 2 | stop_time = 2.0 3 | 4 | # PROBLEM SIZE & GEOMETRY 5 | geometry.is_periodic = 1 1 1 6 | geometry.coord_sys = 0 # 0 => cart 7 | geometry.prob_lo = 0.0 0.0 0.0 8 | geometry.prob_hi = 1.0 1.0 1.0 9 | amr.n_cell = 64 64 64 10 | 11 | # VERBOSITY 12 | amr.v = 1 # verbosity in Amr 13 | 14 | # REFINEMENT 15 | amr.max_level = 2 # maximum level number allowed 16 | amr.regrid_int = 2 # how often to regrid 17 | 18 | # PLOTFILES 19 | amr.plot_file = plt # root name of plot file 20 | amr.plot_int = 10 # number of timesteps between plot files 21 | 22 | myamr.verbose = 1 23 | myamr.cfl = 0.6 24 | 25 | # Tagging 26 | myamr.phierr = 1.1 1.12 27 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F/Exec/SingleVortex/inputs.rt: -------------------------------------------------------------------------------- 1 | max_step = 1000000 2 | stop_time = 2.0 3 | 4 | # PROBLEM SIZE & GEOMETRY 5 | geometry.is_periodic = 1 1 1 6 | geometry.coord_sys = 0 # 0 => cart 7 | geometry.prob_lo = 0.0 0.0 0.0 8 | geometry.prob_hi = 1.0 1.0 1.0 9 | amr.n_cell = 64 64 64 10 | 11 | # VERBOSITY 12 | amr.v = 1 # verbosity in Amr 13 | 14 | # REFINEMENT 15 | amr.max_level = 2 # maximum level number allowed 16 | amr.regrid_int = 2 # how often to regrid 17 | 18 | # PLOTFILES 19 | amr.plot_file = plt # root name of plot file 20 | amr.plot_int = 600 # number of timesteps between plot files 21 | 22 | myamr.verbose = 1 23 | myamr.cfl = 0.6 24 | 25 | # Tagging 26 | myamr.phierr = 1.1 1.12 27 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F/README: -------------------------------------------------------------------------------- 1 | AMR_Adv_CF_octree: This code advects a single scalar field with a velocity 2 | field that is specified on faces. 3 | 4 | It is a AMReX based code designed to run in parallel using MPI/OMP. 5 | It uses the Fortran interfaces of AMReX. The grids have an octree 6 | structure with a grid size of 8. No subcycling is used. 7 | 8 | The directory Exec/SingleVortex includes a makefile and a sample inputs file. 9 | Plotfiles are generated that can be viewed with amrvis2d / amrvis3d. 10 | (CCSE's native vis / spreadsheet tool, downloadable separately from ccse.lbl.gov) 11 | or with Visit. 12 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F/Source/Make.package: -------------------------------------------------------------------------------- 1 | 2 | F90EXE_sources += fmain.F90 my_amr_mod.F90 initdata.F90 tagging_mod.F90 plotfile_mod.F90 3 | F90EXE_sources += averagedown_mod.F90 evolve_mod.F90 compute_dt_mod.F90 fillpatch_mod.F90 4 | F90EXE_sources += amr_data_mod.F90 bc_mod.F90 5 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F/Source/Src_2d/Make.package: -------------------------------------------------------------------------------- 1 | 2 | F90EXE_sources += advect_$(DIM)d_mod.F90 3 | 4 | f90EXE_sources += compute_flux_$(DIM)d.f90 slope_$(DIM)d.f90 5 | 6 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F/Source/averagedown_mod.F90: -------------------------------------------------------------------------------- 1 | module averagedown_module 2 | 3 | use amrex_amr_module 4 | 5 | use amr_data_module, only : phi_new 6 | 7 | implicit none 8 | private 9 | 10 | public :: averagedown 11 | 12 | contains 13 | 14 | subroutine averagedown () 15 | integer :: lev, finest_level 16 | finest_level = amrex_get_finest_level() 17 | do lev = finest_level-1, 0, -1 18 | call amrex_average_down(phi_new(lev+1), phi_new(lev), amrex_geom(lev+1), amrex_geom(lev), & 19 | 1, 1, amrex_ref_ratio(lev)) 20 | end do 21 | end subroutine averagedown 22 | 23 | end module averagedown_module 24 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F/Source/bc_mod.F90: -------------------------------------------------------------------------------- 1 | 2 | module bc_module 3 | 4 | use amrex_base_module 5 | 6 | implicit none 7 | 8 | ! periodic bc. See amrex_bc_types_module for a list of bc types. 9 | integer, parameter :: lo_bc(amrex_spacedim,1) = amrex_bc_int_dir ! the second dimension is the 10 | integer, parameter :: hi_bc(amrex_spacedim,1) = amrex_bc_int_dir ! number of components 11 | 12 | contains 13 | 14 | end module bc_module 15 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F/Source/fmain.F90: -------------------------------------------------------------------------------- 1 | 2 | program main 3 | 4 | use amrex_amr_module 5 | use amrex_octree_module 6 | 7 | use my_amr_module 8 | use initdata_module 9 | use evolve_module 10 | 11 | implicit none 12 | 13 | call amrex_init() 14 | call amrex_octree_init() 15 | call amrex_amrcore_init() 16 | 17 | call my_amr_init() 18 | 19 | call initdata() 20 | 21 | call evolve() 22 | 23 | call my_amr_finalize() 24 | 25 | call amrex_amrcore_finalize() 26 | call amrex_octree_finalize() 27 | call amrex_finalize() 28 | 29 | end program main 30 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F/Source/initdata.F90: -------------------------------------------------------------------------------- 1 | module initdata_module 2 | 3 | use amrex_amr_module 4 | 5 | use my_amr_module, only : restart, plot_int 6 | use plotfile_module, only : writeplotfile 7 | use averagedown_module, only : averagedown 8 | 9 | implicit none 10 | 11 | private 12 | 13 | public :: initdata 14 | 15 | contains 16 | 17 | subroutine initdata () 18 | if (len_trim(restart) .eq. 0) then 19 | call amrex_init_from_scratch(0.0_amrex_real) 20 | call averagedown() 21 | if (plot_int .gt. 0) call writeplotfile 22 | else 23 | call amrex_abort("init from checkpoint not implemented yet") 24 | end if 25 | end subroutine initdata 26 | 27 | end module initdata_module 28 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if ( NOT AMReX_SPACEDIM EQUAL 2 ) 2 | return () 3 | endif () 4 | 5 | set(_sources advect_2d_mod.F90 compute_flux_2d.f90 slope_2d.f90) 6 | list(TRANSFORM _sources PREPEND Src_2d/ ) 7 | 8 | list(APPEND _sources amr_data_mod.F90 averagedown_mod.F90 bc_mod.F90 9 | compute_dt_mod.F90 evolve_mod.F90 fillpatch_mod.F90 fmain.F90 10 | initdata.F90 my_amr_mod.F90 plotfile_mod.F90 tagging_mod.F90) 11 | 12 | list(TRANSFORM _sources PREPEND Source/ ) 13 | 14 | list(APPEND _sources 15 | Exec/SingleVortex/face_velocity_2d.F90 16 | Exec/SingleVortex/Prob.f90 17 | ) 18 | 19 | file(GLOB_RECURSE _input_files LIST_DIRECTORIES false 20 | ${CMAKE_CURRENT_LIST_DIR}/input* ) 21 | 22 | 23 | setup_tutorial(_sources _input_files HAS_FORTRAN_MODULES) 24 | 25 | unset(_sources) 26 | unset(_input_files) 27 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F2/Exec/Make.Adv: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../../amrex 2 | TOP := ../../../Advection_octree_F2 3 | 4 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 5 | 6 | Bdirs := Source Source/Src_$(DIM)d 7 | Bpack += $(foreach dir, $(Bdirs), $(TOP)/$(dir)/Make.package) 8 | Blocs += $(foreach dir, $(Bdirs), $(TOP)/$(dir)) 9 | 10 | include $(Bpack) 11 | 12 | INCLUDE_LOCATIONS += $(Blocs) 13 | VPATH_LOCATIONS += $(Blocs) 14 | 15 | Pdirs := Base Boundary AmrCore F_Interfaces/Base F_Interfaces/AmrCore F_Interfaces/Octree 16 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 17 | 18 | $(info $(Ppack)) 19 | 20 | include $(Ppack) 21 | 22 | 23 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 24 | 25 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F2/Exec/SingleVortex/GNUmakefile: -------------------------------------------------------------------------------- 1 | 2 | DEBUG = TRUE 3 | 4 | USE_MPI = TRUE 5 | USE_OMP = FALSE 6 | USE_MPI3 = FALSE 7 | 8 | MEM_PROFILE = FALSE 9 | TINY_PROFILE = FALSE 10 | 11 | COMP = gnu 12 | USE_F_INTERFACES = TRUE 13 | 14 | DIM = 2 15 | #DIM = 3 16 | 17 | Bpack := ./Make.package 18 | Blocs := . 19 | 20 | include ../Make.Adv 21 | 22 | 23 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F2/Exec/SingleVortex/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += Prob.f90 2 | 3 | F90EXE_sources += face_velocity_$(DIM)d.F90 4 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F2/Exec/SingleVortex/inputs: -------------------------------------------------------------------------------- 1 | max_step = 1000000 2 | stop_time = 2.0 3 | 4 | # PROBLEM SIZE & GEOMETRY 5 | geometry.is_periodic = 1 1 1 6 | geometry.coord_sys = 0 # 0 => cart 7 | geometry.prob_lo = 0.0 0.0 0.0 8 | geometry.prob_hi = 1.0 1.0 1.0 9 | amr.n_cell = 64 64 64 10 | 11 | # VERBOSITY 12 | amr.v = 1 # verbosity in Amr 13 | 14 | # REFINEMENT 15 | amr.max_level = 2 # maximum level number allowed 16 | amr.regrid_int = 2 # how often to regrid 17 | 18 | # PLOTFILES 19 | amr.plot_file = plt # root name of plot file 20 | amr.plot_int = 10 # number of timesteps between plot files 21 | 22 | myamr.verbose = 1 23 | myamr.cfl = 0.6 24 | 25 | # Tagging 26 | myamr.phierr = 1.1 1.12 27 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F2/README: -------------------------------------------------------------------------------- 1 | This is almost identical to Advection_octree_F except this uses FlashFluxRegister. 2 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F2/Source/Make.package: -------------------------------------------------------------------------------- 1 | 2 | F90EXE_sources += fmain.F90 my_amr_mod.F90 initdata.F90 tagging_mod.F90 plotfile_mod.F90 3 | F90EXE_sources += averagedown_mod.F90 evolve_mod.F90 compute_dt_mod.F90 fillpatch_mod.F90 4 | F90EXE_sources += amr_data_mod.F90 bc_mod.F90 5 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F2/Source/Src_2d/Make.package: -------------------------------------------------------------------------------- 1 | 2 | F90EXE_sources += advect_$(DIM)d_mod.F90 3 | 4 | f90EXE_sources += compute_flux_$(DIM)d.f90 slope_$(DIM)d.f90 5 | 6 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F2/Source/averagedown_mod.F90: -------------------------------------------------------------------------------- 1 | module averagedown_module 2 | 3 | use amrex_amr_module 4 | 5 | use amr_data_module, only : phi_new 6 | 7 | implicit none 8 | private 9 | 10 | public :: averagedown 11 | 12 | contains 13 | 14 | subroutine averagedown () 15 | integer :: lev, finest_level 16 | finest_level = amrex_get_finest_level() 17 | do lev = finest_level-1, 0, -1 18 | call amrex_average_down(phi_new(lev+1), phi_new(lev), amrex_geom(lev+1), amrex_geom(lev), & 19 | 1, 1, amrex_ref_ratio(lev)) 20 | end do 21 | end subroutine averagedown 22 | 23 | end module averagedown_module 24 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F2/Source/bc_mod.F90: -------------------------------------------------------------------------------- 1 | 2 | module bc_module 3 | 4 | use amrex_base_module 5 | 6 | implicit none 7 | 8 | ! periodic bc. See amrex_bc_types_module for a list of bc types. 9 | integer, parameter :: lo_bc(amrex_spacedim,1) = amrex_bc_int_dir ! the second dimension is the 10 | integer, parameter :: hi_bc(amrex_spacedim,1) = amrex_bc_int_dir ! number of components 11 | 12 | contains 13 | 14 | end module bc_module 15 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F2/Source/fmain.F90: -------------------------------------------------------------------------------- 1 | 2 | program main 3 | 4 | use amrex_amr_module 5 | use amrex_octree_module 6 | 7 | use my_amr_module 8 | use initdata_module 9 | use evolve_module 10 | 11 | implicit none 12 | 13 | call amrex_init() 14 | call amrex_octree_init() 15 | call amrex_amrcore_init() 16 | 17 | call my_amr_init() 18 | 19 | call initdata() 20 | 21 | call evolve() 22 | 23 | call my_amr_finalize() 24 | 25 | call amrex_amrcore_finalize() 26 | call amrex_octree_finalize() 27 | call amrex_finalize() 28 | 29 | end program main 30 | -------------------------------------------------------------------------------- /ExampleCodes/FortranInterface/Advection_octree_F2/Source/initdata.F90: -------------------------------------------------------------------------------- 1 | module initdata_module 2 | 3 | use amrex_amr_module 4 | 5 | use my_amr_module, only : restart, plot_int 6 | use plotfile_module, only : writeplotfile 7 | use averagedown_module, only : averagedown 8 | 9 | implicit none 10 | 11 | private 12 | 13 | public :: initdata 14 | 15 | contains 16 | 17 | subroutine initdata () 18 | if (len_trim(restart) .eq. 0) then 19 | call amrex_init_from_scratch(0.0_amrex_real) 20 | call averagedown() 21 | if (plot_int .gt. 0) call writeplotfile 22 | else 23 | call amrex_abort("init from checkpoint not implemented yet") 24 | end if 25 | end subroutine initdata 26 | 27 | end module initdata_module 28 | -------------------------------------------------------------------------------- /ExampleCodes/GPU/CNS/Exec/RT/GNUmakefile: -------------------------------------------------------------------------------- 1 | TINY_PROFILE = TRUE 2 | 3 | DEBUG = FALSE 4 | DIM=3 5 | USE_MPI = TRUE 6 | USE_OMP = FALSE 7 | 8 | USE_CUDA = TRUE 9 | COMP = gcc 10 | 11 | include ./Make.package 12 | include ../Make.CNS 13 | -------------------------------------------------------------------------------- /ExampleCodes/GPU/CNS/Exec/RT/Make.package: -------------------------------------------------------------------------------- 1 | 2 | CEXE_headers += cns_prob.H cns_prob_parm.H 3 | CEXE_sources += cns_prob.cpp 4 | -------------------------------------------------------------------------------- /ExampleCodes/GPU/CNS/Exec/RT/cns_prob.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | extern "C" { 6 | void amrex_probinit (const int* /*init*/, 7 | const int* /*name*/, 8 | const int* /*namelen*/, 9 | const amrex_real* /*problo*/, 10 | const amrex_real* /*probhi*/) 11 | { 12 | // could read parmparse parameters here 13 | 14 | amrex::Gpu::htod_memcpy(CNS::d_prob_parm, CNS::h_prob_parm, sizeof(ProbParm)); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ExampleCodes/GPU/CNS/Exec/RT/cns_prob_parm.H: -------------------------------------------------------------------------------- 1 | #ifndef CNS_PROB_PARM_H_ 2 | #define CNS_PROB_PARM_H_ 3 | 4 | #include 5 | #include 6 | 7 | using namespace amrex::literals; 8 | 9 | struct ProbParm 10 | { 11 | amrex::Real rho_1 = 0.5; 12 | amrex::Real rho_2 = 2.0; 13 | amrex::Real p0_base = 5.0; 14 | }; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /ExampleCodes/GPU/CNS/Exec/Sod/GNUmakefile: -------------------------------------------------------------------------------- 1 | TINY_PROFILE = TRUE 2 | 3 | DEBUG = FALSE 4 | DIM=3 5 | USE_MPI = TRUE 6 | USE_OMP = FALSE 7 | 8 | USE_CUDA = TRUE 9 | COMP = gcc 10 | 11 | include ./Make.package 12 | include ../Make.CNS 13 | -------------------------------------------------------------------------------- /ExampleCodes/GPU/CNS/Exec/Sod/Make.package: -------------------------------------------------------------------------------- 1 | 2 | CEXE_headers += cns_prob.H cns_prob_parm.H 3 | CEXE_sources += cns_prob.cpp 4 | -------------------------------------------------------------------------------- /ExampleCodes/GPU/CNS/Exec/Sod/cns_prob_parm.H: -------------------------------------------------------------------------------- 1 | #ifndef CNS_PROB_PARM_H_ 2 | #define CNS_PROB_PARM_H_ 3 | 4 | #include 5 | #include 6 | 7 | using namespace amrex::literals; 8 | 9 | struct ProbParm 10 | { 11 | amrex::Real p_l = 1.0; 12 | amrex::Real p_r = 0.1; 13 | amrex::Real rho_l = 1.0; 14 | amrex::Real rho_r = 0.125; 15 | amrex::Real u_l = 0.0; 16 | amrex::Real u_r = 0.0; 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ExampleCodes/GPU/CNS/Source/CNS_derive.H: -------------------------------------------------------------------------------- 1 | #ifndef CNS_DERIVE_H_ 2 | #define CNS_DERIVE_H_ 3 | 4 | #include 5 | #include 6 | 7 | void cns_derpres (const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, int ncomp, 8 | const amrex::FArrayBox& datafab, const amrex::Geometry& geomdata, 9 | amrex::Real time, const int* bcrec, int level); 10 | 11 | void cns_dervel (const amrex::Box& bx, amrex::FArrayBox& derfab, int dcomp, int ncomp, 12 | const amrex::FArrayBox& datafab, const amrex::Geometry& geomdata, 13 | amrex::Real time, const int* bcrec, int level); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /ExampleCodes/GPU/CNS/Source/CNS_index_macros.H: -------------------------------------------------------------------------------- 1 | #ifndef CNS_INDEX_H_ 2 | #define CNS_INDEX_H_ 3 | 4 | #define URHO 0 5 | #define UMX 1 6 | #define UMY 2 7 | #define UMZ 3 8 | #define UEDEN 4 9 | #define UEINT 5 10 | #define UTEMP 6 11 | #define NCONS 7 12 | 13 | #define QRHO 0 14 | #define QU 1 15 | #define QV 2 16 | #define QW 3 17 | #define QPRES 4 18 | #define QCS 5 19 | #define QEINT 6 20 | #define QTEMP 7 21 | #define NPRIM 8 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /ExampleCodes/GPU/CNS/Source/CNS_io.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | using namespace amrex; 5 | 6 | void 7 | CNS::restart (Amr& papa, std::istream& is, bool bReadSpecial) 8 | { 9 | AmrLevel::restart(papa,is,bReadSpecial); 10 | 11 | if (do_reflux && level > 0) { 12 | flux_reg.reset(new FluxRegister(grids,dmap,crse_ratio,level,NUM_STATE)); 13 | } 14 | 15 | buildMetrics(); 16 | } 17 | 18 | void 19 | CNS::checkPoint (const std::string& dir, std::ostream& os, VisMF::How how, bool dump_old) 20 | { 21 | AmrLevel::checkPoint(dir, os, how, dump_old); 22 | } 23 | 24 | void 25 | CNS::writePlotFile (const std::string& dir, std::ostream& os, VisMF::How how) 26 | { 27 | BL_PROFILE("CNS::writePlotFile()"); 28 | AmrLevel::writePlotFile(dir, os, how); 29 | } 30 | -------------------------------------------------------------------------------- /ExampleCodes/GPU/CNS/Source/CNS_parm.H: -------------------------------------------------------------------------------- 1 | #ifndef CNS_PARM_H_ 2 | #define CNS_PARM_H_ 3 | 4 | #include 5 | #include 6 | 7 | struct Parm 8 | { 9 | amrex::Real eos_gamma = 1.4; 10 | amrex::Real eos_mu = 28.97; // mean molecular weight 11 | 12 | amrex::Real cv; 13 | amrex::Real cp; 14 | 15 | amrex::Real Pr = 0.72; // Prandtl number 16 | amrex::Real C_S = 1.458e-5; // constant in Sutherland's law 17 | amrex::Real T_S = 110.4; // Sutherland temperature 18 | 19 | amrex::Real smallr = 1.e-19; 20 | amrex::Real smallp = 1.e-10; 21 | 22 | void Initialize (); 23 | }; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /ExampleCodes/GPU/CNS/Source/CNS_parm.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | void Parm::Initialize () 5 | { 6 | constexpr amrex::Real Ru = amrex::Real(8.31451e7); 7 | cv = Ru / (eos_mu * (eos_gamma-amrex::Real(1.0))); 8 | cp = eos_gamma * Ru / (eos_mu * (eos_gamma-amrex::Real(1.0))); 9 | } 10 | -------------------------------------------------------------------------------- /ExampleCodes/GPU/CNS/Source/Make.package: -------------------------------------------------------------------------------- 1 | 2 | CEXE_sources += main.cpp 3 | 4 | CEXE_headers += CNS.H CNS_K.H CNS_index_macros.H CNS_tagging.H CNS_derive.H 5 | CEXE_sources += CNS_advance.cpp CNS.cpp CNSBld.cpp CNS_io.cpp CNS_setup.cpp CNS_bcfill.cpp CNS_derive.cpp 6 | 7 | CEXE_headers += CNS_parm.H 8 | CEXE_sources += CNS_parm.cpp 9 | -------------------------------------------------------------------------------- /ExampleCodes/GPU/CNS/Source/diffusion/Make.package: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ExampleCodes/GPU/CNS/Source/hydro/Make.package: -------------------------------------------------------------------------------- 1 | 2 | CEXE_headers += CNS_hydro_K.H 3 | 4 | 5 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (AMReX_SPACEDIM EQUAL 1) 2 | return() 3 | endif () 4 | 5 | set(_sources 6 | main.cpp 7 | MyTest.cpp 8 | initProb.cpp 9 | MyTestPlotfile.cpp 10 | MyTest.H 11 | initProb_K.H) 12 | 13 | file( GLOB_RECURSE _input_files LIST_DIRECTORIES false ${CMAKE_CURRENT_LIST_DIR}/input* ) 14 | 15 | setup_tutorial(_sources _input_files) 16 | 17 | unset(_sources) 18 | unset(_input_files) 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/GNUmakefile: -------------------------------------------------------------------------------- 1 | DEBUG = FALSE 2 | 3 | USE_MPI = TRUE 4 | USE_OMP = FALSE 5 | 6 | USE_HYPRE = FALSE 7 | USE_PETSC = FALSE 8 | 9 | COMP = gnu 10 | 11 | DIM = 3 12 | 13 | AMREX_HOME ?= ../../../../amrex 14 | 15 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 16 | 17 | include ./Make.package 18 | 19 | Pdirs := Base Boundary LinearSolvers/MLMG 20 | 21 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 22 | 23 | include $(Ppack) 24 | 25 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 26 | 27 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/Make.package: -------------------------------------------------------------------------------- 1 | 2 | CEXE_sources += main.cpp 3 | CEXE_sources += MyTest.cpp initProb.cpp MyTestPlotfile.cpp 4 | CEXE_headers += MyTest.H 5 | CEXE_headers += initProb_K.H MyTest_K.H 6 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/inputs: -------------------------------------------------------------------------------- 1 | 2 | max_level = 1 3 | ref_ratio = 2 4 | n_cell = 128 5 | max_grid_size = 64 6 | 7 | composite_solve = 1 # composite solve or level by level? 8 | 9 | # In this tutorial, we set up two examples. 10 | prob_type = 1 11 | # prob_type = 2 12 | 13 | # For MLMG 14 | verbose = 2 15 | bottom_verbose = 0 16 | max_iter = 100 17 | max_fmg_iter = 0 # # of F-cycles before switching to V. To do pure V-cycle, set to 0 18 | linop_maxorder = 2 19 | agglomeration = 1 # Do agglomeration on AMR Level 0? 20 | consolidation = 1 # Do consolidation? 21 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/inputs-inhomNeumann: -------------------------------------------------------------------------------- 1 | 2 | max_level = 0 3 | n_cell = 128 4 | max_grid_size = 64 5 | 6 | # In this tutorial, we set up two examples. 7 | # prob_type = 1 8 | # prob_type = 2 9 | prob_type = 3 # ABecLaplacian with inhomogeneous Neumann 10 | 11 | # For MLMG 12 | verbose = 2 13 | bottom_verbose = 0 14 | max_iter = 100 15 | max_fmg_iter = 0 # # of F-cycles before switching to V. To do pure V-cycle, set to 0 16 | linop_maxorder = 2 17 | agglomeration = 1 # Do agglomeration on AMR Level 0? 18 | consolidation = 1 # Do consolidation? 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/inputs-rt-abeclap-com: -------------------------------------------------------------------------------- 1 | 2 | max_level = 2 3 | ref_ratio = 2 4 | n_cell = 128 5 | max_grid_size = 64 6 | 7 | composite_solve = 1 # composite solve or level by level? 8 | 9 | # In this tutorial, we set up two examples. 10 | # prob_type = 1 11 | prob_type = 2 12 | 13 | # For MLMG 14 | verbose = 2 15 | bottom_verbose = 0 16 | max_iter = 100 17 | max_fmg_iter = 100 # # of F-cycles before switching to V. To do pure V-cycle, set to 0 18 | linop_maxorder = 3 19 | agglomeration = 1 # Do agglomeration on AMR Level 0? 20 | consolidation = 1 # Do consolidation? 21 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/inputs-rt-poisson-lev: -------------------------------------------------------------------------------- 1 | 2 | max_level = 2 3 | ref_ratio = 2 4 | n_cell = 128 5 | max_grid_size = 64 6 | 7 | composite_solve = 0 # composite solve or level by level? 8 | 9 | # In this tutorial, we set up two examples. 10 | prob_type = 1 11 | # prob_type = 2 12 | 13 | # For MLMG 14 | verbose = 2 15 | bottom_verbose = 0 16 | max_iter = 100 17 | max_fmg_iter = 100 # # of F-cycles before switching to V. To do pure V-cycle, set to 0 18 | linop_maxorder = 3 19 | agglomeration = 1 # Do agglomeration on AMR Level 0? 20 | consolidation = 1 # Do consolidation? 21 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/inputs.petsc: -------------------------------------------------------------------------------- 1 | 2 | max_level = 1 3 | ref_ratio = 2 4 | n_cell = 64 5 | max_grid_size = 32 6 | 7 | composite_solve = 0 # composite solve or level by level? 8 | 9 | # In this tutorial, we set up two examples. 10 | prob_type = 1 11 | # prob_type = 2 12 | 13 | # For MLMG 14 | verbose = 2 15 | bottom_verbose = 0 16 | max_iter = 100 17 | max_fmg_iter = 0 # # of F-cycles before switching to V. To do pure V-cycle, set to 0 18 | linop_maxorder = 2 19 | agglomeration = 1 # Do agglomeration on AMR Level 0? 20 | consolidation = 1 # Do consolidation? 21 | 22 | ##################################################################### 23 | 24 | amrex.fpe_trap_invalid = 1 25 | use_petsc = 1 26 | bottom_verbose = 2 27 | composite_solve = 0 28 | max_coarsening_level = 3 # No. of GMG coarsening level before calling petsc 29 | prob_type = 2 30 | max_level = 1 31 | linop_maxorder = 3 32 | 33 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "MyTest.H" 4 | 5 | int main (int argc, char* argv[]) 6 | { 7 | amrex::Initialize(argc, argv); 8 | 9 | { 10 | BL_PROFILE("main"); 11 | MyTest mytest; 12 | mytest.solve(); 13 | mytest.writePlotfile(); 14 | } 15 | 16 | amrex::Finalize(); 17 | } 18 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/scalingtest/inputs.test: -------------------------------------------------------------------------------- 1 | 2 | max_level = 0 3 | ref_ratio = 2 4 | n_cell = 256 5 | max_grid_size = 64 6 | 7 | composite_solve = 0 # composite solve or level by level? 8 | 9 | # In this tutorial, we set up two examples. 10 | # prob_type = 1 11 | prob_type = 2 12 | 13 | # For MLMG 14 | verbose = 0 15 | bottom_verbose = 0 16 | max_iter = 100 17 | max_fmg_iter = 0 # # of F-cycles before switching to V. To do pure V-cycle, set to 0 18 | linop_maxorder = 3 19 | agglomeration = 1 # Do agglomeration on AMR Level 0? 20 | consolidation = 1 # Do consolidation? 21 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/scalingtest/main.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Tutorials/LinearSolvers/ABecLaplacian_C/main.cpp b/Tutorials/LinearSolvers/ABecLaplacian_C/main.cpp 2 | index 77fd37b..1898cb8 100644 3 | --- a/Tutorials/LinearSolvers/ABecLaplacian_C/main.cpp 4 | +++ b/Tutorials/LinearSolvers/ABecLaplacian_C/main.cpp 5 | @@ -8,9 +8,18 @@ int main (int argc, char* argv[]) 6 | 7 | { 8 | BL_PROFILE("main"); 9 | - MyTest mytest; 10 | - mytest.solve(); 11 | - mytest.writePlotfile(); 12 | + { 13 | + MyTest mytest; 14 | + mytest.solve(); 15 | + } 16 | + { 17 | + MyTest mytest; 18 | + { 19 | + BL_PROFILE_REGION("LinearSolver"); 20 | + mytest.solve(); 21 | + } 22 | + } 23 | +// mytest.writePlotfile(); 24 | } 25 | 26 | amrex::Finalize(); 27 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/scalingtest/results.org: -------------------------------------------------------------------------------- 1 | 2 | This is a combination of weak and strong scaling 3 | Thread Multiple time 4 | 5 | * comit 37a0164e 6 | | node | time | TM time | 7 | |------+--------+---------+ 8 | | 1 | 0.3183 | 0.3152 | 9 | | 2 | 0.2297 | 0.2329 | 10 | | 4 | 0.1885 | 0.1873 | 11 | |------+--------+---------+ 12 | | 8 | 0.4038 | 0.3884 | 13 | | 16 | 0.2991 | 0.2900 | 14 | | 32 | 0.2469 | 0.2416 | 15 | |------+--------+---------+ 16 | | 64 | 0.4388 | 0.4431 | 17 | | 128 | 0.3269 | 0.3264 | 18 | | 256 | 0.2751 | 0.2717 | 19 | |------+--------+---------+ 20 | | 512 | 0.5295 | 0.5309 | 21 | | 1024 | 0.4029 | 0.4099 | 22 | | 2048 | 0.3317 | 0.3386 | 23 | 24 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/scalingtest/run-1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #BSUB -P CSC308 3 | #BSUB -W 0:20 4 | #BSUB -nnodes 1 5 | #BSUB -J amrex 6 | #BSUB -o amrexo.%J 7 | #BSUB -e amrexe.%J 8 | module load gcc 9 | module load cuda 10 | module list 11 | set -x 12 | 13 | omp=1 14 | export PAMI_DISABLE_IPC=1 15 | export OMP_NUM_THREADS=${omp} 16 | 17 | EXE="./main3d.gnu.TPROF.MPI.CUDA.ex" 18 | SMPIARGS= --smpiargs="-x PAMI_DISABLE_CUDA_HOOK=1 -disable_gpu_hooks" 19 | 20 | NUMNODES=6 21 | NUMCELLS=256 22 | 23 | jsrun -n ${NUMNODES} -a 1 -g 1 -c 1 --bind=packed:${omp} ${SMPIARGS} ${EXE} inputs.test n_cell=${NUMCELLS} verbose=0 max_fmg_iter=0 > output_1_${LSB_JOBID}.txt 24 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/scalingtest/run-1024.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #BSUB -P CSC308 3 | #BSUB -W 0:20 4 | #BSUB -nnodes 1024 5 | #BSUB -J amrex 6 | #BSUB -o amrexo.%J 7 | #BSUB -e amrexe.%J 8 | 9 | module load gcc 10 | module load cuda 11 | module list 12 | set -x 13 | 14 | omp=1 15 | export PAMI_DISABLE_IPC=1 16 | export OMP_NUM_THREADS=${omp} 17 | 18 | EXE="./main3d.gnu.TPROF.MPI.CUDA.ex" 19 | SMPIARGS= --smpiargs="-x PAMI_DISABLE_CUDA_HOOK=1 -disable_gpu_hooks" 20 | 21 | NUMNODES=6144 22 | NUMCELLS=2048 23 | 24 | jsrun -n ${NUMNODES} -a 1 -g 1 -c 1 --bind=packed:${omp} ${SMPIARGS} ${EXE} inputs.test n_cell=${NUMCELLS} verbose=0 max_fmg_iter=0 > output_1024_${LSB_JOBID}.txt 25 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/scalingtest/run-128.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #BSUB -P CSC308 3 | #BSUB -W 0:20 4 | #BSUB -nnodes 128 5 | #BSUB -J amrex 6 | #BSUB -o amrexo.%J 7 | #BSUB -e amrexe.%J 8 | 9 | module load gcc 10 | module load cuda 11 | module list 12 | set -x 13 | 14 | omp=1 15 | export PAMI_DISABLE_IPC=1 16 | export OMP_NUM_THREADS=${omp} 17 | 18 | EXE="./main3d.gnu.TPROF.MPI.CUDA.ex" 19 | SMPIARGS= --smpiargs="-x PAMI_DISABLE_CUDA_HOOK=1 -disable_gpu_hooks" 20 | 21 | NUMNODES=768 22 | NUMCELLS=1024 23 | 24 | jsrun -n ${NUMNODES} -a 1 -g 1 -c 1 --bind=packed:${omp} ${SMPIARGS} ${EXE} inputs.test n_cell=${NUMCELLS} verbose=0 max_fmg_iter=0 > output_128_${LSB_JOBID}.txt 25 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/scalingtest/run-16.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #BSUB -P CSC308 3 | #BSUB -W 0:20 4 | #BSUB -nnodes 16 5 | #BSUB -J amrex 6 | #BSUB -o amrexo.%J 7 | #BSUB -e amrexe.%J 8 | module load gcc 9 | module load cuda 10 | module list 11 | set -x 12 | 13 | omp=1 14 | export PAMI_DISABLE_IPC=1 15 | export OMP_NUM_THREADS=${omp} 16 | 17 | EXE="./main3d.gnu.TPROF.MPI.CUDA.ex" 18 | SMPIARGS= --smpiargs="-x PAMI_DISABLE_CUDA_HOOK=1 -disable_gpu_hooks" 19 | 20 | NUMNODES=96 21 | NUMCELLS=512 22 | 23 | jsrun -n ${NUMNODES} -a 1 -g 1 -c 1 --bind=packed:${omp} ${SMPIARGS} ${EXE} inputs.test n_cell=${NUMCELLS} verbose=0 max_fmg_iter=0 > output_16_${LSB_JOBID}.txt 24 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/scalingtest/run-2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #BSUB -P CSC308 3 | #BSUB -W 0:20 4 | #BSUB -nnodes 2 5 | #BSUB -J amrex 6 | #BSUB -o amrexo.%J 7 | #BSUB -e amrexe.%J 8 | module load gcc 9 | module load cuda 10 | module list 11 | set -x 12 | 13 | omp=1 14 | export PAMI_DISABLE_IPC=1 15 | export OMP_NUM_THREADS=${omp} 16 | 17 | EXE="./main3d.gnu.TPROF.MPI.CUDA.ex" 18 | SMPIARGS= --smpiargs="-x PAMI_DISABLE_CUDA_HOOK=1 -disable_gpu_hooks" 19 | 20 | NUMNODES=12 21 | NUMCELLS=256 22 | 23 | jsrun -n ${NUMNODES} -a 1 -g 1 -c 1 --bind=packed:${omp} ${SMPIARGS} ${EXE} inputs.test n_cell=${NUMCELLS} verbose=0 max_fmg_iter=0 > output_2_${LSB_JOBID}.txt 24 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/scalingtest/run-2048.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #BSUB -P CSC308 3 | #BSUB -W 0:20 4 | #BSUB -nnodes 2048 5 | #BSUB -J amrex 6 | #BSUB -o amrexo.%J 7 | #BSUB -e amrexe.%J 8 | 9 | module load gcc 10 | module load cuda 11 | module list 12 | set -x 13 | 14 | omp=1 15 | export PAMI_DISABLE_IPC=1 16 | export OMP_NUM_THREADS=${omp} 17 | 18 | EXE="./main3d.gnu.TPROF.MPI.CUDA.ex" 19 | SMPIARGS= --smpiargs="-x PAMI_DISABLE_CUDA_HOOK=1 -disable_gpu_hooks" 20 | 21 | NUMNODES=12288 22 | NUMCELLS=2048 23 | 24 | jsrun -n ${NUMNODES} -a 1 -g 1 -c 1 --bind=packed:${omp} ${SMPIARGS} ${EXE} inputs.test n_cell=${NUMCELLS} verbose=0 max_fmg_iter=0 > output_2048_${LSB_JOBID}.txt 25 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/scalingtest/run-256.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #BSUB -P CSC308 3 | #BSUB -W 0:20 4 | #BSUB -nnodes 256 5 | #BSUB -J amrex 6 | #BSUB -o amrexo.%J 7 | #BSUB -e amrexe.%J 8 | 9 | module load gcc 10 | module load cuda 11 | module list 12 | set -x 13 | 14 | omp=1 15 | export PAMI_DISABLE_IPC=1 16 | export OMP_NUM_THREADS=${omp} 17 | 18 | EXE="./main3d.gnu.TPROF.MPI.CUDA.ex" 19 | SMPIARGS= --smpiargs="-x PAMI_DISABLE_CUDA_HOOK=1 -disable_gpu_hooks" 20 | 21 | NUMNODES=1536 22 | NUMCELLS=1024 23 | 24 | jsrun -n ${NUMNODES} -a 1 -g 1 -c 1 --bind=packed:${omp} ${SMPIARGS} ${EXE} inputs.test n_cell=${NUMCELLS} verbose=0 max_fmg_iter=0 > output_256_${LSB_JOBID}.txt 25 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/scalingtest/run-32.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #BSUB -P CSC308 3 | #BSUB -W 0:20 4 | #BSUB -nnodes 32 5 | #BSUB -J amrex 6 | #BSUB -o amrexo.%J 7 | #BSUB -e amrexe.%J 8 | module load gcc 9 | module load cuda 10 | module list 11 | set -x 12 | 13 | omp=1 14 | export PAMI_DISABLE_IPC=1 15 | export OMP_NUM_THREADS=${omp} 16 | 17 | EXE="./main3d.gnu.TPROF.MPI.CUDA.ex" 18 | SMPIARGS= --smpiargs="-x PAMI_DISABLE_CUDA_HOOK=1 -disable_gpu_hooks" 19 | 20 | NUMNODES=192 21 | NUMCELLS=512 22 | 23 | jsrun -n ${NUMNODES} -a 1 -g 1 -c 1 --bind=packed:${omp} ${SMPIARGS} ${EXE} inputs.test n_cell=${NUMCELLS} verbose=0 max_fmg_iter=0 > output_32_${LSB_JOBID}.txt 24 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/scalingtest/run-4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #BSUB -P CSC308 3 | #BSUB -W 0:20 4 | #BSUB -nnodes 4 5 | #BSUB -J amrex 6 | #BSUB -o amrexo.%J 7 | #BSUB -e amrexe.%J 8 | module load gcc 9 | module load cuda 10 | module list 11 | set -x 12 | 13 | omp=1 14 | export PAMI_DISABLE_IPC=1 15 | export OMP_NUM_THREADS=${omp} 16 | 17 | EXE="./main3d.gnu.TPROF.MPI.CUDA.ex" 18 | SMPIARGS= --smpiargs="-x PAMI_DISABLE_CUDA_HOOK=1 -disable_gpu_hooks" 19 | 20 | NUMNODES=24 21 | NUMCELLS=256 22 | 23 | jsrun -n ${NUMNODES} -a 1 -g 1 -c 1 --bind=packed:${omp} ${SMPIARGS} ${EXE} inputs.test n_cell=${NUMCELLS} verbose=0 max_fmg_iter=0 > output_4_${LSB_JOBID}.txt 24 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/scalingtest/run-512.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #BSUB -P CSC308 3 | #BSUB -W 0:20 4 | #BSUB -nnodes 512 5 | #BSUB -J amrex 6 | #BSUB -o amrexo.%J 7 | #BSUB -e amrexe.%J 8 | 9 | module load gcc 10 | module load cuda 11 | module list 12 | set -x 13 | 14 | omp=1 15 | export PAMI_DISABLE_IPC=1 16 | export OMP_NUM_THREADS=${omp} 17 | 18 | EXE="./main3d.gnu.TPROF.MPI.CUDA.ex" 19 | SMPIARGS= --smpiargs="-x PAMI_DISABLE_CUDA_HOOK=1 -disable_gpu_hooks" 20 | 21 | NUMNODES=3072 22 | NUMCELLS=2048 23 | 24 | jsrun -n ${NUMNODES} -a 1 -g 1 -c 1 --bind=packed:${omp} ${SMPIARGS} ${EXE} inputs.test n_cell=${NUMCELLS} verbose=0 max_fmg_iter=0 > output_512_${LSB_JOBID}.txt 25 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/scalingtest/run-64.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #BSUB -P CSC308 3 | #BSUB -W 0:20 4 | #BSUB -nnodes 64 5 | #BSUB -J amrex 6 | #BSUB -o amrexo.%J 7 | #BSUB -e amrexe.%J 8 | 9 | module load gcc 10 | module load cuda 11 | module list 12 | set -x 13 | 14 | omp=1 15 | export PAMI_DISABLE_IPC=1 16 | export OMP_NUM_THREADS=${omp} 17 | 18 | EXE="./main3d.gnu.TPROF.MPI.CUDA.ex" 19 | SMPIARGS= --smpiargs="-x PAMI_DISABLE_CUDA_HOOK=1 -disable_gpu_hooks" 20 | 21 | NUMNODES=384 22 | NUMCELLS=1024 23 | 24 | jsrun -n ${NUMNODES} -a 1 -g 1 -c 1 --bind=packed:${omp} ${SMPIARGS} ${EXE} inputs.test n_cell=${NUMCELLS} verbose=0 max_fmg_iter=0 > output_64_${LSB_JOBID}.txt 25 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/scalingtest/run-8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #BSUB -P CSC308 3 | #BSUB -W 0:20 4 | #BSUB -nnodes 8 5 | #BSUB -J amrex 6 | #BSUB -o amrexo.%J 7 | #BSUB -e amrexe.%J 8 | module load gcc 9 | module load cuda 10 | module list 11 | set -x 12 | 13 | omp=1 14 | export PAMI_DISABLE_IPC=1 15 | export OMP_NUM_THREADS=${omp} 16 | 17 | EXE="./main3d.gnu.TPROF.MPI.CUDA.ex" 18 | SMPIARGS= --smpiargs="-x PAMI_DISABLE_CUDA_HOOK=1 -disable_gpu_hooks" 19 | 20 | NUMNODES=48 21 | NUMCELLS=512 22 | 23 | jsrun -n ${NUMNODES} -a 1 -g 1 -c 1 --bind=packed:${omp} ${SMPIARGS} ${EXE} inputs.test n_cell=${NUMCELLS} verbose=0 max_fmg_iter=0 > output_8_${LSB_JOBID}.txt 24 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/threadmultiple_test/inputs.test: -------------------------------------------------------------------------------- 1 | 2 | max_level = 0 3 | ref_ratio = 2 4 | n_cell = 256 5 | max_grid_size = 64 6 | 7 | composite_solve = 0 # composite solve or level by level? 8 | 9 | # In this tutorial, we set up two examples. 10 | # prob_type = 1 11 | prob_type = 2 12 | 13 | # For MLMG 14 | verbose = 0 15 | bottom_verbose = 0 16 | max_iter = 100 17 | max_fmg_iter = 0 # # of F-cycles before switching to V. To do pure V-cycle, set to 0 18 | linop_maxorder = 3 19 | agglomeration = 1 # Do agglomeration on AMR Level 0? 20 | consolidation = 1 # Do consolidation? 21 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/threadmultiple_test/knl-mpi-1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 1 3 | #SBATCH -C knl 4 | #SBATCH -q debug 5 | #SBATCH -t 00:10:00 6 | #SBATCH -o 1-MPI.out 7 | 8 | #OpenMP settings: 9 | export OMP_NUM_THREADS=1 10 | export OMP_PLACES=threads 11 | export OMP_PROC_BIND=spread 12 | 13 | NCELLS=256 14 | 15 | export MPICH_MAX_THREAD_SAFETY=multiple 16 | 17 | #run the application: 18 | srun -n 64 -c 4 --cpu_bind=cores main3d.gnu.mic-knl.TPROF.MPI.ex inputs.test n_cell=${NCELLS} 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/threadmultiple_test/knl-mpi-16.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 16 3 | #SBATCH -C knl 4 | #SBATCH -q debug 5 | #SBATCH -t 00:10:00 6 | #SBATCH -o 16-MPI.out 7 | 8 | #OpenMP settings: 9 | export OMP_NUM_THREADS=1 10 | export OMP_PLACES=threads 11 | export OMP_PROC_BIND=spread 12 | 13 | NCELLS=1024 14 | 15 | export MPICH_MAX_THREAD_SAFETY=multiple 16 | 17 | #run the application: 18 | srun -n 1024 -c 4 --cpu_bind=cores main3d.gnu.mic-knl.TPROF.MPI.ex inputs.test n_cell=${NCELLS} 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/threadmultiple_test/knl-mpi-2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 2 3 | #SBATCH -C knl 4 | #SBATCH -q debug 5 | #SBATCH -t 00:10:00 6 | #SBATCH -o 2-MPI.out 7 | 8 | #OpenMP settings: 9 | export OMP_NUM_THREADS=1 10 | export OMP_PLACES=threads 11 | export OMP_PROC_BIND=spread 12 | 13 | NCELLS=512 14 | 15 | export MPICH_MAX_THREAD_SAFETY=multiple 16 | 17 | #run the application: 18 | srun -n 128 -c 4 --cpu_bind=cores main3d.gnu.mic-knl.TPROF.MPI.ex inputs.test n_cell=${NCELLS} 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/threadmultiple_test/knl-mpi-32.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 32 3 | #SBATCH -C knl 4 | #SBATCH -q debug 5 | #SBATCH -t 00:10:00 6 | #SBATCH -o 32-MPI.out 7 | 8 | #OpenMP settings: 9 | export OMP_NUM_THREADS=1 10 | export OMP_PLACES=threads 11 | export OMP_PROC_BIND=spread 12 | 13 | NCELLS=1024 14 | 15 | export MPICH_MAX_THREAD_SAFETY=multiple 16 | 17 | #run the application: 18 | srun -n 2048 -c 4 --cpu_bind=cores main3d.gnu.mic-knl.TPROF.MPI.ex inputs.test n_cell=${NCELLS} 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/threadmultiple_test/knl-mpi-4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 4 3 | #SBATCH -C knl 4 | #SBATCH -q debug 5 | #SBATCH -t 00:10:00 6 | #SBATCH -o 4-MPI.out 7 | 8 | #OpenMP settings: 9 | export OMP_NUM_THREADS=1 10 | export OMP_PLACES=threads 11 | export OMP_PROC_BIND=spread 12 | 13 | NCELLS=512 14 | 15 | export MPICH_MAX_THREAD_SAFETY=multiple 16 | 17 | #run the application: 18 | srun -n 256 -c 4 --cpu_bind=cores main3d.gnu.mic-knl.TPROF.MPI.ex inputs.test n_cell=${NCELLS} 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/threadmultiple_test/knl-mpi-64.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 64 3 | #SBATCH -C knl 4 | #SBATCH -q debug 5 | #SBATCH -t 00:10:00 6 | #SBATCH -o 64-MPI.out 7 | 8 | #OpenMP settings: 9 | export OMP_NUM_THREADS=1 10 | export OMP_PLACES=threads 11 | export OMP_PROC_BIND=spread 12 | 13 | NCELLS=1024 14 | 15 | export MPICH_MAX_THREAD_SAFETY=multiple 16 | 17 | #run the application: 18 | srun -n 4096 -c 4 --cpu_bind=cores main3d.gnu.mic-knl.TPROF.MPI.ex inputs.test n_cell=${NCELLS} 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/threadmultiple_test/knl-mpi-8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 8 3 | #SBATCH -C knl 4 | #SBATCH -q debug 5 | #SBATCH -t 00:10:00 6 | #SBATCH -o 8-MPI.out 7 | 8 | #OpenMP settings: 9 | export OMP_NUM_THREADS=1 10 | export OMP_PLACES=threads 11 | export OMP_PROC_BIND=spread 12 | 13 | NCELLS=512 14 | 15 | export MPICH_MAX_THREAD_SAFETY=multiple 16 | 17 | #run the application: 18 | srun -n 512 -c 4 --cpu_bind=cores main3d.gnu.mic-knl.TPROF.MPI.ex inputs.test n_cell=${NCELLS} 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/threadmultiple_test/knl-omp-1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 1 3 | #SBATCH -C knl 4 | #SBATCH -q debug 5 | #SBATCH -t 00:10:00 6 | #SBATCH -o 1-OMP.out 7 | 8 | #OpenMP settings: 9 | export OMP_NUM_THREADS=8 10 | export OMP_PLACES=threads 11 | export OMP_PROC_BIND=spread 12 | 13 | NCELLS=256 14 | 15 | export MPICH_MAX_THREAD_SAFETY=multiple 16 | 17 | #run the application: 18 | srun -n 8 -c 32 --cpu_bind=cores main3d.gnu.mic-knl.TPROF.MPI.OMP.ex inputs.test n_cell=${NCELLS} 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/threadmultiple_test/knl-omp-16.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 16 3 | #SBATCH -C knl 4 | #SBATCH -q debug 5 | #SBATCH -t 00:10:00 6 | #SBATCH -o 16-OMP.out 7 | 8 | #OpenMP settings: 9 | export OMP_NUM_THREADS=8 10 | export OMP_PLACES=threads 11 | export OMP_PROC_BIND=spread 12 | 13 | NCELLS=1024 14 | 15 | export MPICH_MAX_THREAD_SAFETY=multiple 16 | 17 | #run the application: 18 | srun -n 128 -c 32 --cpu_bind=cores main3d.gnu.mic-knl.TPROF.MPI.OMP.ex inputs.test n_cell=${NCELLS} 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/threadmultiple_test/knl-omp-2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 2 3 | #SBATCH -C knl 4 | #SBATCH -q debug 5 | #SBATCH -t 00:10:00 6 | #SBATCH -o 2-OMP.out 7 | 8 | #OpenMP settings: 9 | export OMP_NUM_THREADS=8 10 | export OMP_PLACES=threads 11 | export OMP_PROC_BIND=spread 12 | 13 | NCELLS=512 14 | 15 | export MPICH_MAX_THREAD_SAFETY=multiple 16 | 17 | #run the application: 18 | srun -n 16 -c 32 --cpu_bind=cores main3d.gnu.mic-knl.TPROF.MPI.OMP.ex inputs.test n_cell=${NCELLS} 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/threadmultiple_test/knl-omp-32.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 32 3 | #SBATCH -C knl 4 | #SBATCH -q debug 5 | #SBATCH -t 00:10:00 6 | #SBATCH -o 32-OMP.out 7 | 8 | #OpenMP settings: 9 | export OMP_NUM_THREADS=8 10 | export OMP_PLACES=threads 11 | export OMP_PROC_BIND=spread 12 | 13 | NCELLS=1024 14 | 15 | export MPICH_MAX_THREAD_SAFETY=multiple 16 | 17 | #run the application: 18 | srun -n 256 -c 32 --cpu_bind=cores main3d.gnu.mic-knl.TPROF.MPI.OMP.ex inputs.test n_cell=${NCELLS} 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/threadmultiple_test/knl-omp-4.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 4 3 | #SBATCH -C knl 4 | #SBATCH -q debug 5 | #SBATCH -t 00:10:00 6 | #SBATCH -o 4-OMP.out 7 | 8 | #OpenMP settings: 9 | export OMP_NUM_THREADS=8 10 | export OMP_PLACES=threads 11 | export OMP_PROC_BIND=spread 12 | 13 | NCELLS=512 14 | 15 | export MPICH_MAX_THREAD_SAFETY=multiple 16 | 17 | #run the application: 18 | srun -n 32 -c 32 --cpu_bind=cores main3d.gnu.mic-knl.TPROF.MPI.OMP.ex inputs.test n_cell=${NCELLS} 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/threadmultiple_test/knl-omp-64.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 64 3 | #SBATCH -C knl 4 | #SBATCH -q debug 5 | #SBATCH -t 00:10:00 6 | #SBATCH -o 64-OMP.out 7 | 8 | #OpenMP settings: 9 | export OMP_NUM_THREADS=8 10 | export OMP_PLACES=threads 11 | export OMP_PROC_BIND=spread 12 | 13 | NCELLS=1024 14 | 15 | export MPICH_MAX_THREAD_SAFETY=multiple 16 | 17 | #run the application: 18 | srun -n 512 -c 32 --cpu_bind=cores main3d.gnu.mic-knl.TPROF.MPI.OMP.ex inputs.test n_cell=${NCELLS} 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/threadmultiple_test/knl-omp-8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 8 3 | #SBATCH -C knl 4 | #SBATCH -q debug 5 | #SBATCH -t 00:10:00 6 | #SBATCH -o 8-OMP.out 7 | 8 | #OpenMP settings: 9 | export OMP_NUM_THREADS=8 10 | export OMP_PLACES=threads 11 | export OMP_PROC_BIND=spread 12 | 13 | NCELLS=512 14 | 15 | export MPICH_MAX_THREAD_SAFETY=multiple 16 | 17 | #run the application: 18 | srun -n 64 -c 32 --cpu_bind=cores main3d.gnu.mic-knl.TPROF.MPI.OMP.ex inputs.test n_cell=${NCELLS} 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_C/threadmultiple_test/main.diff: -------------------------------------------------------------------------------- 1 | diff --git a/Tutorials/LinearSolvers/ABecLaplacian_C/main.cpp b/Tutorials/LinearSolvers/ABecLaplacian_C/main.cpp 2 | index 77fd37b..1898cb8 100644 3 | --- a/Tutorials/LinearSolvers/ABecLaplacian_C/main.cpp 4 | +++ b/Tutorials/LinearSolvers/ABecLaplacian_C/main.cpp 5 | @@ -8,9 +8,18 @@ int main (int argc, char* argv[]) 6 | 7 | { 8 | BL_PROFILE("main"); 9 | - MyTest mytest; 10 | - mytest.solve(); 11 | - mytest.writePlotfile(); 12 | + { 13 | + MyTest mytest; 14 | + mytest.solve(); 15 | + } 16 | + { 17 | + MyTest mytest; 18 | + { 19 | + BL_PROFILE_REGION("LinearSolver"); 20 | + mytest.solve(); 21 | + } 22 | + } 23 | +// mytest.writePlotfile(); 24 | } 25 | 26 | amrex::Finalize(); 27 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_F/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if ( (AMReX_SPACEDIM EQUAL 1) OR (NOT AMReX_FORTRAN_INTERFACES) ) 2 | return() 3 | endif () 4 | 5 | set(_sources main.F90 mytest.F90 init_prob.F90) 6 | 7 | file( GLOB_RECURSE _input_files LIST_DIRECTORIES false ${CMAKE_CURRENT_LIST_DIR}/input*) 8 | 9 | setup_tutorial(_sources _input_files HAS_FORTRAN_MODULES) 10 | 11 | unset(_sources) 12 | unset(_input_files) 13 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_F/GNUmakefile: -------------------------------------------------------------------------------- 1 | DEBUG = FALSE 2 | 3 | USE_MPI = TRUE 4 | USE_OMP = FALSE 5 | USE_F_INTERFACES = TRUE 6 | 7 | COMP = gnu 8 | 9 | DIM = 3 10 | 11 | AMREX_HOME ?= ../../../../amrex 12 | 13 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 14 | 15 | include ./Make.package 16 | 17 | Pdirs := Base Boundary AmrCore LinearSolvers/MLMG 18 | Pdirs += F_Interfaces/Base F_Interfaces/AmrCore F_Interfaces/LinearSolvers 19 | 20 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 21 | 22 | include $(Ppack) 23 | 24 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 25 | 26 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_F/Make.package: -------------------------------------------------------------------------------- 1 | 2 | F90EXE_sources += main.F90 mytest.F90 init_prob.F90 3 | 4 | 5 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_F/inputs: -------------------------------------------------------------------------------- 1 | 2 | max_level = 1 3 | ref_ratio = 2 4 | n_cell = 128 5 | max_grid_size = 64 6 | 7 | composite_solve = 1 # composite solve or level by level? 8 | 9 | # In this tutorial, we set up two examples. 10 | prob_type = 1 11 | # prob_type = 2 12 | 13 | # For MLMG 14 | verbose = 2 15 | bottom_verbose = 0 16 | max_iter = 100 17 | max_fmg_iter = 0 # # of F-cycles before switching to V. To do pure V-cycle, set to 0 18 | linop_maxorder = 2 19 | agglomeration = 1 # Do agglomeration on AMR Level 0? 20 | consolidation = 1 # Do consolidation? 21 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_F/inputs-rt-abeclap-lev: -------------------------------------------------------------------------------- 1 | 2 | max_level = 1 3 | ref_ratio = 2 4 | n_cell = 128 5 | max_grid_size = 64 6 | 7 | composite_solve = 0 # composite solve or level by level? 8 | 9 | # In this tutorial, we set up two examples. 10 | # prob_type = 1 11 | prob_type = 2 12 | 13 | # For MLMG 14 | verbose = 2 15 | bottom_verbose = 0 16 | max_iter = 100 17 | max_fmg_iter = 0 # # of F-cycles before switching to V. To do pure V-cycle, set to 0 18 | linop_maxorder = 2 19 | agglomeration = 1 # Do agglomeration on AMR Level 0? 20 | consolidation = 1 # Do consolidation? 21 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_F/inputs-rt-poisson-com: -------------------------------------------------------------------------------- 1 | 2 | max_level = 2 3 | ref_ratio = 4 4 | n_cell = 32 5 | max_grid_size = 16 6 | 7 | composite_solve = 1 # composite solve or level by level? 8 | 9 | # In this tutorial, we set up two examples. 10 | prob_type = 1 11 | # prob_type = 2 12 | 13 | # For MLMG 14 | verbose = 2 15 | bottom_verbose = 0 16 | max_iter = 100 17 | max_fmg_iter = 0 # # of F-cycles before switching to V. To do pure V-cycle, set to 0 18 | linop_maxorder = 2 19 | agglomeration = 1 # Do agglomeration on AMR Level 0? 20 | consolidation = 1 # Do consolidation? 21 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/ABecLaplacian_F/main.F90: -------------------------------------------------------------------------------- 1 | 2 | program main 3 | 4 | use amrex_base_module, only : amrex_init, amrex_finalize 5 | 6 | use mytest_module, only : init, finalize, solve, write_plotfile 7 | 8 | implicit none 9 | 10 | call amrex_init() 11 | 12 | call init() 13 | 14 | call solve() 15 | 16 | call write_plotfile() 17 | 18 | call finalize() 19 | 20 | call amrex_finalize() 21 | 22 | end program main 23 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/GMRES/Poisson/GNUmakefile: -------------------------------------------------------------------------------- 1 | # AMREX_HOME defines the directory in which we will find all the AMReX code. 2 | AMREX_HOME ?= ../../../../../amrex 3 | 4 | DEBUG = FALSE 5 | USE_MPI = FALSE 6 | USE_OMP = FALSE 7 | COMP = gnu 8 | DIM = 3 9 | 10 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 11 | 12 | include ./Make.package 13 | 14 | include $(AMREX_HOME)/Src/Base/Make.package 15 | include $(AMREX_HOME)/Src/LinearSolvers/Make.package 16 | 17 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 18 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/GMRES/Poisson/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp GMRES_Poisson.cpp 2 | CEXE_headers += GMRES_Poisson.H 3 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/GMRES/Poisson/inputs: -------------------------------------------------------------------------------- 1 | n_cell = 32 2 | max_grid_size = 16 3 | 4 | use_precond = 1 5 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/MultiComponent/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | 3 | DEBUG ?= FALSE 4 | DIM ?= 3 5 | COMP ?= gnu 6 | 7 | USE_MPI ?= TRUE 8 | USE_OMP ?= FALSE 9 | 10 | USE_HYPRE = FALSE 11 | 12 | TINY_PROFILE ?= TRUE 13 | PROFILE ?= FALSE 14 | COMM_PROFILE ?= FALSE 15 | TRACE_PROFILE ?= FALSE 16 | 17 | DEFINES += -DAMREX_SOFT_PERF_COUNTERS 18 | 19 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 20 | 21 | include ./Make.package 22 | include $(AMREX_HOME)/Src/Base/Make.package 23 | include $(AMREX_HOME)/Src/Boundary/Make.package 24 | include $(AMREX_HOME)/Src/LinearSolvers/MLMG/Make.package 25 | 26 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 27 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/MultiComponent/Make.package: -------------------------------------------------------------------------------- 1 | 2 | CEXE_sources += main.cpp MCNodalLinOp.cpp 3 | 4 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/NodalPoisson/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_sources main.cpp MyTest.cpp MyTest.H MyTestPlotfile.cpp) 2 | 3 | file( GLOB_RECURSE _input_files LIST_DIRECTORIES false ${CMAKE_CURRENT_LIST_DIR}/input*) 4 | 5 | setup_tutorial(_sources _input_files) 6 | 7 | unset(_sources) 8 | unset(_input_files) 9 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/NodalPoisson/GNUmakefile: -------------------------------------------------------------------------------- 1 | DEBUG = FALSE 2 | 3 | USE_MPI = TRUE 4 | USE_OMP = FALSE 5 | 6 | COMP = gnu 7 | 8 | DIM = 3 9 | 10 | AMREX_HOME ?= ../../../../amrex 11 | 12 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 13 | 14 | include ./Make.package 15 | 16 | Pdirs := Base Boundary AmrCore LinearSolvers/MLMG 17 | 18 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 19 | 20 | include $(Ppack) 21 | 22 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 23 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/NodalPoisson/Make.package: -------------------------------------------------------------------------------- 1 | 2 | CEXE_sources += main.cpp 3 | CEXE_sources += MyTest.cpp MyTestPlotfile.cpp 4 | CEXE_headers += MyTest.H 5 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/NodalPoisson/inputs-rt: -------------------------------------------------------------------------------- 1 | 2 | max_level = 1 3 | ref_ratio = 2 4 | n_cell = 128 5 | max_grid_size = 64 6 | 7 | composite_solve = 1 # composite solve or level by level? 8 | 9 | # For MLMG 10 | verbose = 2 11 | bottom_verbose = 0 12 | max_iter = 100 13 | max_fmg_iter = 0 # # of F-cycles before switching to V. To do pure V-cycle, set to 0 14 | reltol = 1.e-11 15 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/NodalPoisson/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "MyTest.H" 4 | 5 | int main (int argc, char* argv[]) 6 | { 7 | amrex::Initialize(argc, argv); 8 | 9 | { 10 | BL_PROFILE("main"); 11 | MyTest mytest; 12 | mytest.solve(); 13 | mytest.compute_norms(); 14 | mytest.writePlotfile(); 15 | } 16 | 17 | amrex::Finalize(); 18 | } 19 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/NodeTensorLap/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_sources main.cpp MyTest.cpp MyTest.H MyTestPlotfile.cpp) 2 | set(_input_files) 3 | 4 | setup_tutorial(_sources _input_files ) 5 | 6 | unset(_sources) 7 | unset(_input_files) 8 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/NodeTensorLap/GNUmakefile: -------------------------------------------------------------------------------- 1 | DEBUG = FALSE 2 | 3 | USE_MPI = TRUE 4 | USE_OMP = FALSE 5 | 6 | USE_HYPRE = FALSE 7 | 8 | COMP = gnu 9 | 10 | DIM = 2 11 | 12 | AMREX_HOME ?= ../../../../amrex 13 | 14 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 15 | 16 | include ./Make.package 17 | 18 | Pdirs := Base Boundary AmrCore LinearSolvers/MLMG 19 | 20 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 21 | 22 | include $(Ppack) 23 | 24 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 25 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/NodeTensorLap/Make.package: -------------------------------------------------------------------------------- 1 | 2 | CEXE_sources += main.cpp 3 | CEXE_sources += MyTest.cpp MyTestPlotfile.cpp 4 | CEXE_headers += MyTest.H 5 | -------------------------------------------------------------------------------- /ExampleCodes/LinearSolvers/NodeTensorLap/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "MyTest.H" 4 | 5 | int main (int argc, char* argv[]) 6 | { 7 | amrex::Initialize(argc, argv); 8 | 9 | { 10 | BL_PROFILE("main"); 11 | MyTest mytest; 12 | mytest.solve(); 13 | mytest.compute_norms(); 14 | mytest.writePlotfile(); 15 | } 16 | 17 | amrex::Finalize(); 18 | } 19 | -------------------------------------------------------------------------------- /ExampleCodes/ML/PYTORCH/Exec/inputs: -------------------------------------------------------------------------------- 1 | n_cell = 64 2 | max_grid_size = 32 3 | model_file = "model.pt" 4 | -------------------------------------------------------------------------------- /ExampleCodes/ML/PYTORCH/Exec/model.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/ExampleCodes/ML/PYTORCH/Exec/model.pt -------------------------------------------------------------------------------- /ExampleCodes/ML/PYTORCH/README.md: -------------------------------------------------------------------------------- 1 | This tutorial presents an example of using a pre-trained Pytorch model in the AMReX framework. 2 | 3 | The source code is located in the directory `/Source`. 4 | 5 | Please refer to the [documentation](https://amrex-codes.github.io/amrex/tutorials_html/ML_Tutorial.html) for more information and instructions on how to run this tutorial. 6 | 7 | 8 | 11 | -------------------------------------------------------------------------------- /ExampleCodes/ML/PYTORCH/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | CEXE_headers += myfunc.H 3 | -------------------------------------------------------------------------------- /ExampleCodes/ML/PYTORCH/Source/myfunc.H: -------------------------------------------------------------------------------- 1 | #ifndef MYFUNC_H_ 2 | #define MYFUNC_H_ 3 | 4 | void main_main (); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /ExampleCodes/MPMD/Case-1/Source_1/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../../amrex 2 | 3 | DEBUG = TRUE 4 | 5 | DIM = 3 6 | 7 | COMP = gcc 8 | 9 | USE_MPI = TRUE 10 | 11 | USE_OMP = FALSE 12 | USE_CUDA = FALSE 13 | USE_HIP = FALSE 14 | 15 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 16 | 17 | include ./Make.package 18 | include $(AMREX_HOME)/Src/Base/Make.package 19 | 20 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 21 | -------------------------------------------------------------------------------- /ExampleCodes/MPMD/Case-1/Source_1/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main_1.cpp 2 | -------------------------------------------------------------------------------- /ExampleCodes/MPMD/Case-1/Source_2/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../../amrex 2 | 3 | DEBUG = TRUE 4 | 5 | DIM = 3 6 | 7 | COMP = gcc 8 | 9 | USE_MPI = TRUE 10 | 11 | USE_OMP = FALSE 12 | USE_CUDA = FALSE 13 | USE_HIP = FALSE 14 | 15 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 16 | 17 | include ./Make.package 18 | include $(AMREX_HOME)/Src/Base/Make.package 19 | 20 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 21 | -------------------------------------------------------------------------------- /ExampleCodes/MPMD/Case-1/Source_2/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main_2.cpp 2 | -------------------------------------------------------------------------------- /ExampleCodes/MPMD/Case-1/mpmd_cpu.conf: -------------------------------------------------------------------------------- 1 | 0-7 ./Source_1/main3d.gnu.x86-milan.DEBUG.MPI.ex 2 | 8-11 ./Source_2/main3d.gnu.x86-milan.DEBUG.MPI.ex 3 | -------------------------------------------------------------------------------- /ExampleCodes/MPMD/Case-1/mpmd_cpu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 1 # Total number of nodes 3 | #SBATCH -n 12 # Total number of tasks 4 | #SBATCH -c 4 # number of processors per MPI task 5 | #SBATCH -C cpu 6 | #SBATCH -q debug 7 | #SBATCH -J mpmd_test 8 | #SBATCH -t 00:05:00 9 | #SBATCH -A mpxxx 10 | 11 | #OpenMP settings: 12 | export OMP_NUM_THREADS=1 13 | export OMP_PLACES=threads 14 | export OMP_PROC_BIND=spread 15 | 16 | #run the application: 17 | srun --multi-prog --cpu_bind=cores ./mpmd_cpu.conf 18 | -------------------------------------------------------------------------------- /ExampleCodes/MPMD/Case-1/mpmd_gpu.conf: -------------------------------------------------------------------------------- 1 | 0-7 ./Source_1/main3d.gnu.DEBUG.MPI.CUDA.ex 2 | 8-11 ./Source_2/main3d.gnu.DEBUG.MPI.CUDA.ex 3 | -------------------------------------------------------------------------------- /ExampleCodes/MPMD/Case-1/mpmd_gpu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 3 # Total number of nodes 3 | #SBATCH -n 12 # Total number of tasks 4 | #SBATCH -c 4 # number of processors per MPI task 5 | #SBATCH -C gpu 6 | #SBATCH -G 12 # Total number of GPUs 7 | #SBATCH -q debug 8 | #SBATCH -J mpmd_test 9 | #SBATCH -t 00:05:00 10 | #SBATCH -A mpxxx 11 | 12 | source ./perlmutter_gpu.profile 13 | 14 | #OpenMP settings: 15 | export OMP_NUM_THREADS=1 16 | export OMP_PLACES=threads 17 | export OMP_PROC_BIND=spread 18 | # Taken from WarpX 19 | export MPICH_OFI_NIC_POLICY=GPU 20 | GPU_AWARE_MPI="amrex.use_gpu_aware_mpi=1" 21 | 22 | #run the application: 23 | srun --multi-prog --cpu_bind=cores --gpu-bind=single:1 ./mpmd_gpu.conf 24 | -------------------------------------------------------------------------------- /ExampleCodes/MPMD/Case-1/perlmutter_gpu.profile: -------------------------------------------------------------------------------- 1 | # required dependencies 2 | module load gpu 3 | module load PrgEnv-gnu 4 | module load craype 5 | module load craype-x86-milan 6 | module load craype-accel-nvidia80 7 | module load cudatoolkit 8 | module load cmake/3.24.3 9 | 10 | # necessary to use CUDA-Aware MPI and run a job 11 | export CRAY_ACCEL_TARGET=nvidia80 12 | 13 | # optimize CUDA compilation for A100 14 | export AMREX_CUDA_ARCH=8.0 15 | 16 | # optimize CPU microarchitecture for AMD EPYC 3rd Gen (Milan/Zen3) 17 | # note: the cc/CC/ftn wrappers below add those 18 | export CXXFLAGS="-march=znver3" 19 | export CFLAGS="-march=znver3" 20 | 21 | # compiler environment hints 22 | export CC=cc 23 | export CXX=CC 24 | export FC=ftn 25 | export CUDACXX=$(which nvcc) 26 | export CUDAHOSTCXX=CC 27 | -------------------------------------------------------------------------------- /ExampleCodes/MPMD/Case-2/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | 3 | DEBUG = TRUE 4 | 5 | DIM = 3 6 | 7 | COMP = gcc 8 | 9 | USE_MPI = TRUE 10 | 11 | USE_OMP = FALSE 12 | USE_CUDA = FALSE 13 | USE_HIP = FALSE 14 | 15 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 16 | 17 | include ./Make.package 18 | include $(AMREX_HOME)/Src/Base/Make.package 19 | 20 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 21 | -------------------------------------------------------------------------------- /ExampleCodes/MPMD/Case-2/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | -------------------------------------------------------------------------------- /ExampleCodes/MPMD/Case-2/mpmd_cpu.conf: -------------------------------------------------------------------------------- 1 | 0-7 main3d.gnu.x86-milan.DEBUG.MPI.ex 2 | 8-11 python main.py 3 | -------------------------------------------------------------------------------- /ExampleCodes/MPMD/Case-2/mpmd_cpu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 1 # Total number of nodes 3 | #SBATCH -n 12 # Total number of tasks 4 | #SBATCH -c 4 # number of processors per MPI task 5 | #SBATCH -C cpu 6 | #SBATCH -q debug 7 | #SBATCH -J mpmd_test 8 | #SBATCH -t 00:05:00 9 | #SBATCH -A mpxxx 10 | 11 | # Activate the virtual environment 12 | source /path/to/pyamrex-gpu/bin/activate 13 | 14 | #OpenMP settings: 15 | export OMP_NUM_THREADS=1 16 | export OMP_PLACES=threads 17 | export OMP_PROC_BIND=spread 18 | 19 | #run the application: 20 | srun --multi-prog --cpu_bind=cores ./mpmd_cpu.conf 21 | 22 | deactivate 23 | -------------------------------------------------------------------------------- /ExampleCodes/MPMD/Case-2/mpmd_gpu.conf: -------------------------------------------------------------------------------- 1 | 0-7 main3d.gnu.DEBUG.MPI.CUDA.ex 2 | 8-11 python main.py 3 | -------------------------------------------------------------------------------- /ExampleCodes/MPMD/Case-2/mpmd_gpu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH -N 3 # Total number of nodes 3 | #SBATCH -n 12 # Total number of tasks 4 | #SBATCH -c 4 # number of processors per MPI task 5 | #SBATCH -C gpu 6 | #SBATCH -G 12 # Total number of GPUs 7 | #SBATCH -q debug 8 | #SBATCH -J mpmd_test 9 | #SBATCH -t 00:05:00 10 | #SBATCH -A mpxxx 11 | 12 | source ./perlmutter_gpu.profile 13 | # Activate the virtual environment 14 | source /path/to/pyamrex-gpu/bin/activate 15 | 16 | #OpenMP settings: 17 | export OMP_NUM_THREADS=1 18 | export OMP_PLACES=threads 19 | export OMP_PROC_BIND=spread 20 | # Taken from WarpX 21 | export MPICH_OFI_NIC_POLICY=GPU 22 | GPU_AWARE_MPI="amrex.use_gpu_aware_mpi=1" 23 | 24 | #run the application: 25 | srun --multi-prog --cpu_bind=cores --gpu-bind=single:1 ./mpmd_gpu.conf 26 | 27 | deactivate 28 | -------------------------------------------------------------------------------- /ExampleCodes/MPMD/Case-2/perlmutter_gpu.profile: -------------------------------------------------------------------------------- 1 | # required dependencies 2 | module load gpu 3 | module load PrgEnv-gnu 4 | module load craype 5 | module load craype-x86-milan 6 | module load craype-accel-nvidia80 7 | module load cudatoolkit 8 | module load cmake/3.24.3 9 | # Required for pyAMReX 10 | module load cray-python/3.11.5 11 | 12 | # necessary to use CUDA-Aware MPI and run a job 13 | export CRAY_ACCEL_TARGET=nvidia80 14 | 15 | # optimize CUDA compilation for A100 16 | export AMREX_CUDA_ARCH=8.0 17 | 18 | # optimize CPU microarchitecture for AMD EPYC 3rd Gen (Milan/Zen3) 19 | # note: the cc/CC/ftn wrappers below add those 20 | export CXXFLAGS="-march=znver3" 21 | export CFLAGS="-march=znver3" 22 | 23 | # compiler environment hints 24 | export CC=cc 25 | export CXX=CC 26 | export FC=ftn 27 | export CUDACXX=$(which nvcc) 28 | export CUDAHOSTCXX=CC 29 | -------------------------------------------------------------------------------- /ExampleCodes/MUI/Exec_01/GNUmakefile: -------------------------------------------------------------------------------- 1 | # AMREX_HOME defines the directory in which we will find all the AMReX code. 2 | # If you set AMREX_HOME as an environment variable, this line will be ignored 3 | AMREX_HOME ?= ../../../../amrex 4 | MUI_HOME ?= ../../../../MUI/ 5 | 6 | DEBUG = FALSE 7 | USE_MPI = TRUE 8 | USE_OMP = FALSE 9 | COMP = gnu 10 | DIM = 3 11 | 12 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 13 | 14 | include ../Source_01/Make.package 15 | VPATH_LOCATIONS += ../Source_01 16 | INCLUDE_LOCATIONS += ../Source_01 17 | INCLUDE_LOCATIONS += $(MUI_HOME) 18 | 19 | include $(AMREX_HOME)/Src/Base/Make.package 20 | 21 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 22 | 23 | -------------------------------------------------------------------------------- /ExampleCodes/MUI/Exec_02/GNUmakefile: -------------------------------------------------------------------------------- 1 | # AMREX_HOME defines the directory in which we will find all the AMReX code. 2 | # If you set AMREX_HOME as an environment variable, this line will be ignored 3 | AMREX_HOME ?= ../../../../amrex 4 | MUI_HOME ?= ../../../../MUI/ 5 | 6 | DEBUG = FALSE 7 | USE_MPI = TRUE 8 | USE_OMP = FALSE 9 | COMP = gnu 10 | DIM = 2 11 | 12 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 13 | 14 | include ../Source_02/Make.package 15 | VPATH_LOCATIONS += ../Source_02 16 | INCLUDE_LOCATIONS += ../Source_02 17 | INCLUDE_LOCATIONS += $(MUI_HOME) 18 | 19 | include $(AMREX_HOME)/Src/Base/Make.package 20 | 21 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 22 | 23 | -------------------------------------------------------------------------------- /ExampleCodes/MUI/Exec_coupled/cmd_mpirun: -------------------------------------------------------------------------------- 1 | 2 | # The following script builds each executable independently, 3 | # and then runs both simultaneously in parallel 4 | 5 | ## Cleanup current directory (optional) 6 | rm -r plt* Backtrace.* 7 | 8 | ## Refresh/remove old executable files (optional) 9 | rm ../Exec_01/main*.ex 10 | rm ../Exec_02/main*.ex 11 | 12 | ## Build 3D executable 13 | cd ../Exec_01 14 | make -j DIM=3 15 | 16 | ## Build 2D executable 17 | cd ../Exec_02 18 | make -j DIM=2 19 | 20 | ## Run both executables together 21 | cd ../Exec_coupled 22 | mpirun -np 8 ../Exec_01/main3d.gnu.MPI.ex inputs : -np 16 ../Exec_02/main2d.gnu.MPI.ex inputs 23 | -------------------------------------------------------------------------------- /ExampleCodes/MUI/Exec_coupled/inputs: -------------------------------------------------------------------------------- 1 | verbosity = 1 ! Set verbosity greater than 0 to print MUI send/receive pairs to terminal 2 | plot_int = 1 ! If plot_int set to zero, will not plot results 3 | 4 | n_cell = 8 ! Total number of cells in domain along x, y, (and z) 5 | max_grid_size_3d = 4 ! Maximum grid/box dimension for 3D portion 6 | max_grid_size_2d = 2 ! Maximum grid/box dimension for 2D portion 7 | -------------------------------------------------------------------------------- /ExampleCodes/MUI/Source_01/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main_01.cpp 2 | 3 | CEXE_headers += myfunc.H 4 | FEXE_headers += myfunc_F.H 5 | 6 | f90EXE_sources += init_phi_3d.f90 7 | -------------------------------------------------------------------------------- /ExampleCodes/MUI/Source_01/myfunc.H: -------------------------------------------------------------------------------- 1 | #ifndef MYFUNC_H_ 2 | #define MYFUNC_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | void main_main (); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /ExampleCodes/MUI/Source_01/myfunc_F.H: -------------------------------------------------------------------------------- 1 | #ifndef MYFUNC_F_H_ 2 | #define MYFUNC_F_H_ 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" 8 | { 9 | #endif 10 | 11 | void init_phi(const int* lo, const int* hi, 12 | amrex_real* data, const int* dlo, const int* dhi, 13 | const amrex_real* dx, const amrex_real* prob_lo, const amrex_real* prob_hi); 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ExampleCodes/MUI/Source_02/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main_02.cpp 2 | 3 | CEXE_headers += myfunc.H -------------------------------------------------------------------------------- /ExampleCodes/MUI/Source_02/myfunc.H: -------------------------------------------------------------------------------- 1 | #ifndef MYFUNC_H_ 2 | #define MYFUNC_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | void main_main (); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /ExampleCodes/MUI/doc/iface_rect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AMReX-Codes/amrex-tutorials/a33567d2e3f0f589cb630f428e1e477538bd94e9/ExampleCodes/MUI/doc/iface_rect.png -------------------------------------------------------------------------------- /ExampleCodes/Particles/CellSortedParticles/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if ( NOT (AMReX_SPACEDIM EQUAL 3) OR NOT CMAKE_Fortran_COMPILER_LOADED OR AMReX_CUDA OR AMReX_HIP) 2 | return () 3 | endif () 4 | 5 | set(_sources cell_sorted_3d.F90 cell_sorted_F.H CellSortedPC.cpp CellSortedPC.H main.cpp ) 6 | set(_input_files inputs) 7 | 8 | setup_tutorial(_sources _input_files HAS_FORTRAN_MODULES) 9 | 10 | unset(_sources) 11 | unset(_input_files) 12 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/CellSortedParticles/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | 3 | DEBUG = TRUE 4 | DEBUG = FALSE 5 | 6 | DIM = 3 7 | 8 | COMP = gcc 9 | 10 | TINY_PROFILE = TRUE 11 | USE_PARTICLES = TRUE 12 | 13 | PRECISION = DOUBLE 14 | 15 | USE_MPI = TRUE 16 | USE_OMP = FALSE 17 | 18 | ################################################### 19 | 20 | EBASE = main 21 | 22 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 23 | 24 | include ./Make.package 25 | include $(AMREX_HOME)/Src/Base/Make.package 26 | include $(AMREX_HOME)/Src/Particle/Make.package 27 | 28 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 29 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/CellSortedParticles/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp CellSortedPC.cpp 2 | CEXE_headers += CellSortedPC.H 3 | 4 | CEXE_headers += cell_sorted_F.H 5 | F90EXE_sources += cell_sorted_$(DIM)d.F90 6 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/CellSortedParticles/cell_sorted_F.H: -------------------------------------------------------------------------------- 1 | #ifndef _CELL_SORTED_F_H_ 2 | #define _CELL_SORTED_F_H_ 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" 8 | { 9 | #endif 10 | 11 | void move_particles(void* particles, 12 | const int *np, 13 | const int *lo, 14 | const int *hi, 15 | int** c_vectors, 16 | int* sizes, 17 | const int* clo, 18 | const int* chi, 19 | const amrex_real* plo, 20 | const amrex_real* dx, 21 | const amrex_real* dt); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif /*_EM_PIC_F_H_*/ 28 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/CellSortedParticles/inputs: -------------------------------------------------------------------------------- 1 | 2 | ncell = (32, 32, 32) 3 | nppc = (4, 4, 4) 4 | 5 | max_grid_size = 16 6 | 7 | nsteps = 10 8 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectromagneticPIC/Exec/CUDA/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../../../amrex 2 | 3 | DEBUG = TRUE 4 | DEBUG = FALSE 5 | 6 | DIM = 3 7 | 8 | COMP = gcc 9 | 10 | TINY_PROFILE = TRUE 11 | USE_PARTICLES = TRUE 12 | 13 | PRECISION = DOUBLE 14 | 15 | USE_MPI = TRUE 16 | USE_OMP = FALSE 17 | USE_ACC = FALSE 18 | USE_CUDA = TRUE 19 | 20 | Bpack := ./Make.package 21 | Blocs := . 22 | 23 | include ../../Make.EMPIC 24 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectromagneticPIC/Exec/CUDA/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += Evolve.cpp EMParticleContainer.cpp 2 | 3 | CEXE_headers += em_pic_K.H 4 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectromagneticPIC/Exec/CUDA/inputs: -------------------------------------------------------------------------------- 1 | 2 | ncell = (128, 128, 128) 3 | nppc = (4, 4, 4) #number of particles per cell 4 | 5 | max_grid_size = 64 6 | 7 | problem_type = Langmuir #has exact solution, good for checking accuracy 8 | #problem_type = UniformPlasma #good for performance testing; loads of work 9 | 10 | nsteps = 10 11 | 12 | cfl = 1.0 13 | 14 | write_plot = false 15 | write_particles = false 16 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectromagneticPIC/Exec/OpenACC/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../../../amrex 2 | 3 | DEBUG = TRUE 4 | DEBUG = FALSE 5 | 6 | DIM = 3 7 | 8 | COMP = pgi 9 | 10 | TINY_PROFILE = TRUE 11 | USE_PARTICLES = TRUE 12 | 13 | PRECISION = DOUBLE 14 | 15 | USE_MPI = TRUE 16 | USE_OMP = FALSE 17 | USE_ACC = TRUE 18 | USE_CUDA = TRUE 19 | 20 | Bpack := ./Make.package 21 | Blocs := . 22 | 23 | include ../../Make.EMPIC 24 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectromagneticPIC/Exec/OpenACC/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += Evolve.cpp EMParticleContainer.cpp 2 | 3 | CEXE_headers += em_pic_F.H 4 | F90EXE_sources += em_pic_$(DIM)d.F90 5 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectromagneticPIC/Exec/OpenACC/inputs: -------------------------------------------------------------------------------- 1 | 2 | ncell = (128, 128, 128) 3 | nppc = (4, 4, 4) #number of particles per cell 4 | 5 | max_grid_size = 64 6 | 7 | problem_type = Langmuir #has exact solution, good for checking accuracy 8 | #problem_type = UniformPlasma #good for performance testing; loads of work 9 | 10 | nsteps = 10 11 | 12 | cfl = 1.0 13 | 14 | write_plot = false 15 | write_particles = false 16 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectromagneticPIC/Exec/OpenMP/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../../../amrex 2 | 3 | DEBUG = TRUE 4 | DEBUG = FALSE 5 | 6 | DIM = 3 7 | 8 | COMP = ibm 9 | 10 | TINY_PROFILE = TRUE 11 | USE_PARTICLES = TRUE 12 | 13 | PRECISION = DOUBLE 14 | 15 | USE_MPI = TRUE 16 | USE_OMP = FALSE 17 | USE_ACC = FALSE 18 | USE_OMP_OFFLOAD = TRUE 19 | USE_CUDA = TRUE 20 | 21 | Bpack := ./Make.package 22 | Blocs := . 23 | 24 | include ../../Make.EMPIC 25 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectromagneticPIC/Exec/OpenMP/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += Evolve.cpp EMParticleContainer.cpp 2 | 3 | CEXE_headers += em_pic_F.H 4 | F90EXE_sources += em_pic_$(DIM)d.F90 5 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectromagneticPIC/Exec/OpenMP/inputs: -------------------------------------------------------------------------------- 1 | 2 | ncell = (128, 128, 128) 3 | nppc = (4, 4, 4) #number of particles per cell 4 | 5 | max_grid_size = 64 6 | 7 | problem_type = Langmuir #has exact solution, good for checking accuracy 8 | #problem_type = UniformPlasma #good for performance testing; loads of work 9 | 10 | nsteps = 10 11 | 12 | cfl = 1.0 13 | 14 | write_plot = false 15 | write_particles = false 16 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectromagneticPIC/Make.EMPIC: -------------------------------------------------------------------------------- 1 | EMPIC_DIR ?= ../../../ElectromagneticPIC 2 | 3 | TOP := $(EMPIC_DIR) 4 | 5 | EBASE := main 6 | 7 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 8 | 9 | Bdirs := Source 10 | Bpack += $(foreach dir, $(Bdirs), $(TOP)/$(dir)/Make.package) 11 | Blocs += $(foreach dir, $(Bdirs), $(TOP)/$(dir)) 12 | 13 | include $(Bpack) 14 | 15 | INCLUDE_LOCATIONS += $(Blocs) 16 | VPATH_LOCATIONS += $(Blocs) 17 | 18 | Pdirs := Base Particle 19 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 20 | 21 | include $(Ppack) 22 | 23 | all: $(executable) 24 | @echo SUCCESS 25 | 26 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 27 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectromagneticPIC/Source/Constants.H: -------------------------------------------------------------------------------- 1 | #ifndef CONSTANTS_H_ 2 | #define CONSTANTS_H_ 3 | 4 | #include 5 | 6 | namespace PhysConst 7 | { 8 | static constexpr amrex::Real c = 299792458.; 9 | static constexpr amrex::Real ep0 = 8.854187817e-12; 10 | static constexpr amrex::Real mu0 = 1.2566370614359173e-06; 11 | static constexpr amrex::Real q_e = 1.6021764620000001e-19; 12 | static constexpr amrex::Real m_e = 9.10938291e-31; 13 | static constexpr amrex::Real m_p = 1.6726231000000001e-27; 14 | } 15 | 16 | namespace MathConst 17 | { 18 | static constexpr amrex::Real pi = 3.14159265358979323846; 19 | } 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectromagneticPIC/Source/IO.H: -------------------------------------------------------------------------------- 1 | #ifndef IO_H_ 2 | #define IO_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "EMParticleContainer.H" 9 | 10 | void 11 | WritePlotFile (const amrex::MultiFab& Ex, const amrex::MultiFab& Ey, const amrex::MultiFab& Ez, 12 | const amrex::MultiFab& Bx, const amrex::MultiFab& By, const amrex::MultiFab& Bz, 13 | const amrex::MultiFab& jx, const amrex::MultiFab& jy, const amrex::MultiFab& jz, 14 | const amrex::Geometry& geom, amrex::Real time, int step); 15 | 16 | void 17 | WriteParticleFile (const EMParticleContainer& PC, const std::string& name, int step); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectromagneticPIC/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp IO.cpp NodalFlags.cpp EMParticleContainerInit.cpp 2 | CEXE_headers += Constants.H Particles.H IO.H NodalFlags.H 3 | CEXE_headers += Evolve.H EMParticleContainer.H 4 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectromagneticPIC/Source/NodalFlags.H: -------------------------------------------------------------------------------- 1 | #ifndef NODAL_FLAGS_H_ 2 | #define NODAL_FLAGS_H_ 3 | 4 | #include 5 | 6 | class YeeGrid { 7 | public: 8 | static amrex::IntVect Bx_nodal_flag; 9 | static amrex::IntVect By_nodal_flag; 10 | static amrex::IntVect Bz_nodal_flag; 11 | 12 | static amrex::IntVect Ex_nodal_flag; 13 | static amrex::IntVect Ey_nodal_flag; 14 | static amrex::IntVect Ez_nodal_flag; 15 | 16 | static amrex::IntVect jx_nodal_flag; 17 | static amrex::IntVect jy_nodal_flag; 18 | static amrex::IntVect jz_nodal_flag; 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectromagneticPIC/Source/NodalFlags.cpp: -------------------------------------------------------------------------------- 1 | #include "NodalFlags.H" 2 | 3 | using namespace amrex; 4 | 5 | IntVect YeeGrid::Bx_nodal_flag(1,0,0); 6 | IntVect YeeGrid::By_nodal_flag(0,1,0); 7 | IntVect YeeGrid::Bz_nodal_flag(0,0,1); 8 | 9 | IntVect YeeGrid::Ex_nodal_flag(0,1,1); 10 | IntVect YeeGrid::Ey_nodal_flag(1,0,1); 11 | IntVect YeeGrid::Ez_nodal_flag(1,1,0); 12 | 13 | IntVect YeeGrid::jx_nodal_flag(0,1,1); 14 | IntVect YeeGrid::jy_nodal_flag(1,0,1); 15 | IntVect YeeGrid::jz_nodal_flag(1,1,0); 16 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectrostaticPIC/example/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../../amrex 2 | 3 | DEBUG = TRUE 4 | DEBUG = FALSE 5 | 6 | DIM = 2 7 | 8 | COMP = gcc 9 | 10 | TINY_PROFILE = TRUE 11 | USE_PARTICLES = TRUE 12 | 13 | PRECISION = DOUBLE 14 | 15 | USE_MPI = TRUE 16 | USE_OMP = FALSE 17 | USE_ACC = FALSE 18 | USE_CUDA = FALSE 19 | 20 | Blocs := . 21 | 22 | include ../Make.ESPIC 23 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectrostaticPIC/example/inputs: -------------------------------------------------------------------------------- 1 | max_level = 1 2 | n_cell = 64 3 | n_buffer = 2 4 | max_grid_size = 64 5 | max_step = 50000 6 | dt = 1.0e-10 7 | plot_int = 1000 8 | particle_output_int = 1000 9 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectrostaticPIC/src/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectrostaticPIC/src/PhysConst.H: -------------------------------------------------------------------------------- 1 | #ifndef PHYSCONST_H_ 2 | #define PHYSCONST_H_ 3 | 4 | #include 5 | 6 | // Physical constants 7 | namespace PhysConst 8 | { 9 | static constexpr amrex::Real ep0 = 8.854187817e-12; 10 | static constexpr amrex::Real q_e = 1.6021764620000001e-19; 11 | static constexpr amrex::Real m_e = 9.10938291e-31; 12 | } 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectrostaticPIC/src/diagnostics/FieldIO.H: -------------------------------------------------------------------------------- 1 | #ifndef FIELD_IO_H_ 2 | #define FIELD_IO_H_ 3 | 4 | #include "particles/ElectrostaticParticleContainer.H" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | void WritePlotFile (const amrex::Vector& rhs, 13 | const amrex::Vector& phi, 14 | const amrex::Vector >& E, 15 | const ElectrostaticParticleContainer& pc, 16 | const amrex::Vector& geom, 17 | int nstep); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectrostaticPIC/src/diagnostics/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += FieldIO.cpp 2 | CEXE_sources += ParticleIO.cpp -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectrostaticPIC/src/diagnostics/ParticleIO.cpp: -------------------------------------------------------------------------------- 1 | #include "particles/ElectrostaticParticleContainer.H" 2 | 3 | void ElectrostaticParticleContainer::writeParticles(int n) { 4 | const std::string& pltfile = amrex::Concatenate("particles", n, 5); 5 | WriteAsciiFile(pltfile); 6 | } 7 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectrostaticPIC/src/field_solver/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += FieldSolver.cpp -------------------------------------------------------------------------------- /ExampleCodes/Particles/ElectrostaticPIC/src/particles/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += ElectrostaticParticleContainer.cpp -------------------------------------------------------------------------------- /ExampleCodes/Particles/NeighborList/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # # 2 | # # This test requires CUDA and Particles to be enabled 3 | # # 4 | # if (NOT AMReX_CUDA OR NOT AMReX_PARTICLES) 5 | # return () 6 | # endif () 7 | set(_sources CheckPair.H Constants.H main.cpp MDParticleContainer.cpp MDParticleContainer.H) 8 | set(_input_files inputs) 9 | 10 | setup_tutorial(_sources _input_files) 11 | 12 | unset(_sources) 13 | unset(_input_files) 14 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/NeighborList/CheckPair.H: -------------------------------------------------------------------------------- 1 | #ifndef MD_K_H_ 2 | #define MD_K_H_ 3 | 4 | #include "Constants.H" 5 | 6 | struct CheckPair 7 | { 8 | template 9 | AMREX_GPU_DEVICE AMREX_FORCE_INLINE 10 | bool operator()(const P& p1, const P& p2) const 11 | { 12 | amrex::Real d0 = (p1.pos(0) - p2.pos(0)); 13 | amrex::Real d1 = (p1.pos(1) - p2.pos(1)); 14 | amrex::Real d2 = (p1.pos(2) - p2.pos(2)); 15 | amrex::Real dsquared = d0*d0 + d1*d1 + d2*d2; 16 | return (dsquared <= 25.0*Params::cutoff*Params::cutoff); 17 | } 18 | }; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/NeighborList/Constants.H: -------------------------------------------------------------------------------- 1 | #ifndef CONSTANTS_H_ 2 | #define CONSTANTS_H_ 3 | 4 | #include 5 | 6 | namespace Params 7 | { 8 | // This is designed to represent MFiX-like conditions where the grid spacing is 9 | // roughly 2.5 times the particle diameter. In main.cpp we set grid spacing to 1 10 | // so here we set cutoff to diameter = 1/2.5 --> cutoff = 0.2 11 | static constexpr amrex::Real cutoff = 0.2 ; 12 | static constexpr amrex::Real min_r = 1.e-4; 13 | } 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/NeighborList/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../amrex 2 | 3 | DEBUG = FALSE 4 | 5 | DIM = 3 6 | 7 | COMP = gcc 8 | 9 | USE_MPI = TRUE 10 | USE_OMP = FALSE 11 | USE_CUDA = TRUE 12 | 13 | TINY_PROFILE = TRUE 14 | USE_PARTICLES = TRUE 15 | 16 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 17 | 18 | include ./Make.package 19 | include $(AMREX_HOME)/Src/Base/Make.package 20 | include $(AMREX_HOME)/Src/Particle/Make.package 21 | 22 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 23 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/NeighborList/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp MDParticleContainer.cpp 2 | 3 | CEXE_headers += MDParticleContainer.H Constants.H CheckPair.H 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/NeighborList/README.md: -------------------------------------------------------------------------------- 1 | This tutorial initializes particles, and steps through "nsteps" time steps where in each time step 2 | we 3 | * compute the timestep = cfl * "cutoff" (particle radius) / max_particle_vel 4 | * compute or update the grid neighbors 5 | * calculate particle neighbor lists 6 | * compute forces due to particle-particle collisions 7 | * update the particle velocities then particle positions. 8 | 9 | At every time step we print out dt and the number of particles. 10 | -------------------------------------------------------------------------------- /ExampleCodes/Particles/NeighborList/inputs: -------------------------------------------------------------------------------- 1 | 2 | size = (32, 32, 32) 3 | 4 | max_grid_size = 16 5 | 6 | nsteps = 1000 7 | 8 | print_neighbor_list = false 9 | 10 | print_minimum_distance = false 11 | 12 | print_num_particles = false 13 | 14 | write_particles = false 15 | 16 | num_rebuild = 25 17 | 18 | cfl = 0.1 19 | 20 | num_ppc = 2 21 | -------------------------------------------------------------------------------- /ExampleCodes/SDC/MISDC_ADR_2d/Exec/GNUmakefile: -------------------------------------------------------------------------------- 1 | # AMREX_HOME defines the directory in which we will find all the AMReX code. 2 | AMREX_HOME ?= ../../../../../amrex 3 | 4 | DEBUG = FALSE 5 | USE_MPI = FALSE 6 | USE_OMP = FALSE 7 | COMP = gnu 8 | DIM = 2 9 | 10 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 11 | 12 | include ../Source/Make.package 13 | VPATH_LOCATIONS += ../Source 14 | INCLUDE_LOCATIONS += ../Source 15 | 16 | Pdirs := Base Boundary AmrCore LinearSolvers/MLMG SDC 17 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 18 | 19 | include $(Ppack) 20 | 21 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 22 | -------------------------------------------------------------------------------- /ExampleCodes/SDC/MISDC_ADR_2d/Exec/inputs_2d: -------------------------------------------------------------------------------- 1 | # Time step is set to Tfin/nsteps 2 | Nsteps = 4 3 | Tfin = 0.5 4 | 5 | plot_int = 1 6 | # Spatial size 7 | n_cell = 128 8 | max_grid_size = 32 9 | 10 | # Define SDC parameters 11 | Nnodes=5 12 | Npieces=3 13 | Nsweeps=8 14 | 15 | # Define the advection, diffusion, and reaction parameters 16 | a=1.0 17 | d=0.1 18 | r=1.0 19 | 20 | # We have to use periodic b.c. for exact solution 21 | # 0 = periodic 22 | bc_lo = 0 0 23 | bc_hi = 0 0 24 | -------------------------------------------------------------------------------- /ExampleCodes/SDC/MISDC_ADR_2d/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp SDC_sweeper.cpp 2 | 3 | CEXE_headers += myfunc.H 4 | FEXE_headers += myfunc_F.H 5 | 6 | f90EXE_sources += init_phi_2d.f90 7 | f90EXE_sources += functions_2d.f90 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrCore/Exec/Make.Adv: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../../amrex 2 | ADR_DIR ?= $(AMREX_HOME)/Tutorials/SENSEI/Advection_AmrCore 3 | 4 | TOP := $(ADR_DIR) 5 | 6 | EBASE := main 7 | 8 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 9 | 10 | Bdirs := Source Source/Src_nd Source/Src_$(DIM)d 11 | Bpack += $(foreach dir, $(Bdirs), $(TOP)/$(dir)/Make.package) 12 | Blocs += $(foreach dir, $(Bdirs), $(TOP)/$(dir)) 13 | 14 | include $(Bpack) 15 | 16 | INCLUDE_LOCATIONS += $(Blocs) 17 | VPATH_LOCATIONS += $(Blocs) 18 | 19 | Pdirs := Base Boundary AmrCore 20 | ifeq ($(USE_SENSEI_INSITU),TRUE) 21 | Pdirs += Amr Extern/SENSEI 22 | endif 23 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 24 | 25 | include $(Ppack) 26 | 27 | all: $(executable) 28 | @echo SUCCESS 29 | 30 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 31 | 32 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrCore/Exec/SingleVortex/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../../../amrex 2 | 3 | PRECISION = DOUBLE 4 | PROFILE = FALSE 5 | 6 | DEBUG = FALSE 7 | 8 | DIM = 2 9 | 10 | COMP = gnu 11 | 12 | USE_MPI = TRUE 13 | USE_OMP = FALSE 14 | 15 | USE_SENSEI_INSITU = TRUE 16 | 17 | Bpack := ./Make.package 18 | Blocs := . 19 | 20 | include ../Make.Adv 21 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrCore/Exec/SingleVortex/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += Prob.f90 face_velocity_$(DIM)d.f90 2 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrCore/Exec/SingleVortex/sensei/histogram_python.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | numBins=10 5 | meshName='mesh' 6 | arrayName='phi' 7 | arrayCen=1 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrCore/Exec/SingleVortex/sensei/render_iso_catalyst_2d.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrCore/Exec/SingleVortex/sensei/render_iso_catalyst_3d.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrCore/Exec/SingleVortex/sensei/render_iso_libsim_2d.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrCore/Exec/SingleVortex/sensei/render_iso_libsim_3d.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrCore/Exec/SingleVortex/sensei/write_vtk.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrCore/README: -------------------------------------------------------------------------------- 1 | Advection_AmrCore: This tutorial contains an AMR advection code that advects a single 2 | scalar field with a velocity field that is specified on faces. 3 | 4 | It is an AMReX based code designed to run in parallel using MPI/OMP. 5 | 6 | This example uses source code from the amrex/Src/Base, Boundary, and AmrCore directories. 7 | Notably, this example does not use source code from amrex/Src/Amr 8 | (see the tutorial Advection_AmrLevel). 9 | 10 | The directory Exec/SingleVortex includes a makefile and a sample inputs file. 11 | Plotfiles are generated that can be viewed with amrvis2d / amrvis3d 12 | (CCSE's native vis / spreadsheet tool, downloadable separately from ccse.lbl.gov) 13 | or with VisIt. 14 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrCore/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp AmrCoreAdv.cpp 2 | 3 | CEXE_headers += AmrCoreAdv.H 4 | 5 | F90EXE_sources += bc_fill_nd.F90 6 | 7 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrCore/Source/Src_2d/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += Adv_$(DIM)d.f90 2 | f90EXE_sources += slope_$(DIM)d.f90 3 | f90EXE_sources += compute_flux_$(DIM)d.f90 4 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrCore/Source/Src_3d/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += Adv_$(DIM)d.f90 2 | f90EXE_sources += slope_$(DIM)d.f90 3 | f90EXE_sources += compute_flux_$(DIM)d.f90 4 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrCore/Source/Src_nd/Make.package: -------------------------------------------------------------------------------- 1 | 2 | f90EXE_sources += Tagging_nd.f90 3 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/Make.Adv: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../../amrex 2 | ADR_DIR ?= $(AMREX_HOME)/Tutorials/SENSEI/Advection_AmrLevel 3 | 4 | TOP := $(ADR_DIR) 5 | 6 | EBASE := main 7 | 8 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 9 | 10 | Bdirs := Source Source/Src_nd Source/Src_$(DIM)d 11 | Bpack += $(foreach dir, $(Bdirs), $(TOP)/$(dir)/Make.package) 12 | Blocs += $(foreach dir, $(Bdirs), $(TOP)/$(dir)) 13 | 14 | include $(Bpack) 15 | 16 | INCLUDE_LOCATIONS += $(Blocs) 17 | VPATH_LOCATIONS += $(Blocs) 18 | 19 | Pdirs := Base Boundary AmrCore Amr Particle 20 | ifeq ($(USE_SENSEI_INSITU),TRUE) 21 | Pdirs += Extern/SENSEI 22 | endif 23 | Ppack += $(foreach dir, $(Pdirs), $(AMREX_HOME)/Src/$(dir)/Make.package) 24 | 25 | include $(Ppack) 26 | 27 | all: $(executable) 28 | @echo SUCCESS 29 | 30 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 31 | 32 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../../../../amrex 2 | 3 | USE_EB = FALSE 4 | PRECISION = DOUBLE 5 | PROFILE = FALSE 6 | 7 | DEBUG = FALSE 8 | 9 | DIM = 2 10 | 11 | COMP = gnu 12 | 13 | USE_PARTICLES = TRUE 14 | 15 | USE_MPI = TRUE 16 | USE_OMP = FALSE 17 | 18 | USE_SENSEI_INSITU = TRUE 19 | 20 | Bpack := ./Make.package 21 | Blocs := . 22 | 23 | include ../Make.Adv 24 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += Prob.f90 face_velocity_$(DIM)d.f90 2 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/probin: -------------------------------------------------------------------------------- 1 | &tagging 2 | 3 | phierr = 1.01d0, 1.1d0, 1.5d0 4 | 5 | max_phierr_lev = 10 6 | 7 | / 8 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/histogram_python.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | numBins=10 5 | meshName='mesh' 6 | arrayName='phi' 7 | arrayCen=1 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/iso_extract.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 7 | 1.5 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/read_adios2_bp4_default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/read_adios2_sst_default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/render_iso_catalyst_2d.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/render_iso_catalyst_3d.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/render_iso_libsim_2d.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/render_iso_libsim_3d.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/render_libsim.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/render_particles_catalyst_3d.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/write_adios2_bp4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/write_adios2_sst.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/write_pvd_m.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | phi 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/write_pvd_p.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | u 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/write_pvd_pm.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | phi 5 | 6 | 7 | 8 | 9 | u 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Exec/SingleVortex/sensei/write_vtk.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/README: -------------------------------------------------------------------------------- 1 | Advection_AmrLevel: This tutorial contains an AMR advection code that advects a single 2 | scalar field with a velocity field that is specified on faces. 3 | 4 | It is an AMReX based code designed to run in parallel using MPI/OMP. 5 | 6 | This example uses source code from the amrex/Src/Base, Boundary, AmrCore , and 7 | Amr directories. 8 | 9 | The directories Exec/SingleVortex and Exec/UniformVelocity each include 10 | a makefile and a sample inputs file. 11 | Plotfiles are generated that can be viewed with amrvis2d / amrvis3d 12 | (CCSE's native vis / spreadsheet tool, downloadable separately from ccse.lbl.gov) 13 | or with VisIt. 14 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += AmrLevelAdv.cpp LevelBldAdv.cpp main.cpp 2 | 3 | CEXE_headers += AmrLevelAdv.H 4 | 5 | FEXE_headers += Adv_F.H 6 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Source/Src_2d/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += Adv_$(DIM)d.f90 2 | f90EXE_sources += slope_$(DIM)d.f90 3 | f90EXE_sources += compute_flux_$(DIM)d.f90 4 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Source/Src_3d/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += Adv_$(DIM)d.f90 2 | f90EXE_sources += slope_$(DIM)d.f90 3 | f90EXE_sources += compute_flux_$(DIM)d.f90 4 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Source/Src_nd/Adv_nd.f90: -------------------------------------------------------------------------------- 1 | subroutine nullfill(adv,adv_lo,adv_hi,domlo,domhi,delta,xlo,time,bc) bind(C, name="nullfill") 2 | implicit none 3 | integer :: adv_lo(3),adv_hi(3) 4 | integer :: bc(*) 5 | integer :: domlo(3), domhi(3) 6 | double precision :: delta(3), xlo(3), time 7 | double precision :: adv(adv_lo(1):adv_hi(1),adv_lo(2):adv_hi(2),adv_lo(3):adv_hi(3)) 8 | ! no physical boundaries to fill because it is all periodic 9 | return 10 | end subroutine nullfill 11 | -------------------------------------------------------------------------------- /ExampleCodes/SENSEI/Advection_AmrLevel/Source/Src_nd/Make.package: -------------------------------------------------------------------------------- 1 | f90EXE_sources += Adv_nd.f90 2 | f90EXE_sources += Tagging_nd.f90 tagging_params.f90 3 | -------------------------------------------------------------------------------- /ExampleCodes/SUNDIALS/Reaction-Diffusion/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (AMReX_SPACEDIM EQUAL 1) 2 | return() 3 | endif () 4 | 5 | # List of source files 6 | set(_sources main.cpp myfunc.H) 7 | list(TRANSFORM _sources PREPEND "Source/") 8 | 9 | # List of input files 10 | file( GLOB_RECURSE _input_files LIST_DIRECTORIES false Exec/input* ) 11 | 12 | setup_tutorial(_sources _input_files) 13 | 14 | unset( _sources ) 15 | unset( _input_files ) 16 | -------------------------------------------------------------------------------- /ExampleCodes/SUNDIALS/Reaction-Diffusion/Exec/GNUmakefile: -------------------------------------------------------------------------------- 1 | # AMREX_HOME defines the directory in which we will find all the AMReX code. 2 | AMREX_HOME ?= ../../../../../amrex 3 | 4 | DEBUG = FALSE 5 | USE_MPI = TRUE 6 | USE_OMP = FALSE 7 | COMP = gnu 8 | DIM = 3 9 | USE_SUNDIALS = TRUE 10 | 11 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 12 | 13 | include ../Source/Make.package 14 | VPATH_LOCATIONS += ../Source 15 | INCLUDE_LOCATIONS += ../Source 16 | 17 | include $(AMREX_HOME)/Src/Base/Make.package 18 | 19 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 20 | -------------------------------------------------------------------------------- /ExampleCodes/SUNDIALS/Reaction-Diffusion/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | CEXE_headers += myfunc.H 3 | -------------------------------------------------------------------------------- /ExampleCodes/SUNDIALS/Reaction-Diffusion/Source/myfunc.H: -------------------------------------------------------------------------------- 1 | #ifndef MYFUNC_H_ 2 | #define MYFUNC_H_ 3 | 4 | void main_main (); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /ExampleCodes/SUNDIALS/Single-Rate/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (AMReX_SPACEDIM EQUAL 1) 2 | return() 3 | endif () 4 | 5 | # List of source files 6 | set(_sources main.cpp myfunc.H) 7 | list(TRANSFORM _sources PREPEND "Source/") 8 | 9 | # List of input files 10 | file( GLOB_RECURSE _input_files LIST_DIRECTORIES false Exec/input* ) 11 | 12 | setup_tutorial(_sources _input_files) 13 | 14 | unset( _sources ) 15 | unset( _input_files ) 16 | -------------------------------------------------------------------------------- /ExampleCodes/SUNDIALS/Single-Rate/Exec/GNUmakefile: -------------------------------------------------------------------------------- 1 | # AMREX_HOME defines the directory in which we will find all the AMReX code. 2 | AMREX_HOME ?= ../../../../../amrex 3 | 4 | DEBUG = FALSE 5 | USE_MPI = TRUE 6 | USE_OMP = FALSE 7 | COMP = gnu 8 | DIM = 3 9 | USE_SUNDIALS = TRUE 10 | 11 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 12 | 13 | include ../Source/Make.package 14 | VPATH_LOCATIONS += ../Source 15 | INCLUDE_LOCATIONS += ../Source 16 | 17 | include $(AMREX_HOME)/Src/Base/Make.package 18 | 19 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 20 | -------------------------------------------------------------------------------- /ExampleCodes/SUNDIALS/Single-Rate/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | CEXE_headers += myfunc.H 3 | -------------------------------------------------------------------------------- /ExampleCodes/SUNDIALS/Single-Rate/Source/myfunc.H: -------------------------------------------------------------------------------- 1 | #ifndef MYFUNC_H_ 2 | #define MYFUNC_H_ 3 | 4 | void main_main (); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /GuidedTutorials/HeatEquation/Exec/GNUmakefile: -------------------------------------------------------------------------------- 1 | # AMREX_HOME defines the directory in which we will find all the AMReX code. 2 | AMREX_HOME ?= ../../../../amrex 3 | 4 | DEBUG = FALSE 5 | USE_MPI = FALSE 6 | USE_OMP = FALSE 7 | COMP = gnu 8 | DIM = 3 9 | 10 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 11 | 12 | include ../Source/Make.package 13 | VPATH_LOCATIONS += ../Source 14 | INCLUDE_LOCATIONS += ../Source 15 | 16 | include $(AMREX_HOME)/Src/Base/Make.package 17 | 18 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 19 | -------------------------------------------------------------------------------- /GuidedTutorials/HeatEquation/Exec/inputs: -------------------------------------------------------------------------------- 1 | n_cell = 32 2 | max_grid_size = 16 3 | 4 | nsteps = 1000 5 | plot_int = 100 6 | 7 | dt = 1.e-5 8 | -------------------------------------------------------------------------------- /GuidedTutorials/HeatEquation/Source/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | CEXE_headers += myfunc.H 3 | -------------------------------------------------------------------------------- /GuidedTutorials/HeatEquation/Source/myfunc.H: -------------------------------------------------------------------------------- 1 | #ifndef MYFUNC_H_ 2 | #define MYFUNC_H_ 3 | 4 | void main_main (); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /GuidedTutorials/HeatEquation_Simple/GNUmakefile: -------------------------------------------------------------------------------- 1 | # AMREX_HOME defines the directory in which we will find all the AMReX code. 2 | AMREX_HOME ?= ../../../amrex 3 | 4 | DEBUG = FALSE 5 | USE_MPI = FALSE 6 | USE_OMP = FALSE 7 | COMP = gnu 8 | DIM = 3 9 | 10 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 11 | 12 | include ./Make.package 13 | 14 | include $(AMREX_HOME)/Src/Base/Make.package 15 | 16 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 17 | -------------------------------------------------------------------------------- /GuidedTutorials/HeatEquation_Simple/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | 3 | -------------------------------------------------------------------------------- /GuidedTutorials/HeatEquation_Simple/inputs: -------------------------------------------------------------------------------- 1 | n_cell = 32 2 | max_grid_size = 16 3 | 4 | nsteps = 1000 5 | plot_int = 100 6 | 7 | dt = 1.e-5 8 | -------------------------------------------------------------------------------- /GuidedTutorials/HelloWorld/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../amrex 2 | 3 | DEBUG = FALSE 4 | DEBUG = TRUE 5 | 6 | DIM = 3 7 | 8 | COMP = gcc 9 | 10 | USE_MPI = FALSE 11 | USE_OMP = FALSE 12 | USE_CUDA = FALSE 13 | USE_HIP = FALSE 14 | 15 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 16 | 17 | include ./Make.package 18 | include $(AMREX_HOME)/Src/Base/Make.package 19 | 20 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 21 | -------------------------------------------------------------------------------- /GuidedTutorials/HelloWorld/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | -------------------------------------------------------------------------------- /GuidedTutorials/HelloWorld/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | int main(int argc, char* argv[]) 6 | { 7 | amrex::Initialize(argc,argv); 8 | { 9 | amrex::Print() << "Hello world from AMReX version " << amrex::Version() << "\n"; 10 | } 11 | amrex::Finalize(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /GuidedTutorials/MultiFab/GNUmakefile: -------------------------------------------------------------------------------- 1 | AMREX_HOME ?= ../../../amrex 2 | 3 | DEBUG = FALSE 4 | DEBUG = TRUE 5 | 6 | DIM = 3 7 | 8 | COMP = gcc 9 | 10 | USE_MPI = FALSE 11 | USE_OMP = FALSE 12 | USE_CUDA = FALSE 13 | USE_HIP = FALSE 14 | 15 | include $(AMREX_HOME)/Tools/GNUMake/Make.defs 16 | 17 | include ./Make.package 18 | include $(AMREX_HOME)/Src/Base/Make.package 19 | 20 | include $(AMREX_HOME)/Tools/GNUMake/Make.rules 21 | -------------------------------------------------------------------------------- /GuidedTutorials/MultiFab/Make.package: -------------------------------------------------------------------------------- 1 | CEXE_sources += main.cpp 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repository contains tutorials built using the AMReX adaptive 2 | mesh refinement framework, available at: https://github.com/AMReX-Codes/amrex/ 3 | 4 | Corresponding documentation for these tutorials is available at: 5 | https://amrex-codes.github.io/amrex/tutorials_html/ 6 | 7 | 8 | NOTICE. This Software was developed under funding from the 9 | U.S. Department of Energy and the U.S. Government consequently retains 10 | certain rights. As such, the U.S. Government has been granted for 11 | itself and others acting on its behalf a paid-up, nonexclusive, 12 | irrevocable, worldwide license in the Software to reproduce, 13 | distribute copies to the public, prepare derivative works, and perform 14 | publicly and display publicly, and to permit other to do so. 15 | 16 | The license for these tutorials can be found at [LICENSE](LICENSE). 17 | --------------------------------------------------------------------------------