Commit d9236aae authored by William F Godoy's avatar William F Godoy

Adding test for DustGravity

parent f965f380
plots_cells,plots_size,plots_size_L0,plots_size_L1,plots_size_L2,caseID,caseDir
4096,472612.0,461951.0,0.0,0.0,case12,plt_3d_00000
8192,945273.0,923914.0,0.0,0.0,case12,plt_3d_00002
12288,1.417935e6,1.385877e6,0.0,0.0,case12,plt_3d_00004
16384,1.890595e6,1.84784e6,0.0,0.0,case12,plt_3d_00006
20480,2.363255e6,2.309803e6,0.0,0.0,case12,plt_3d_00008
24576,2.835917e6,2.771766e6,0.0,0.0,case12,plt_3d_00010
This diff is collapsed.
......@@ -116,8 +116,8 @@ function _get_independent_variables(extractor::AbstractAmrex, parameters)::Dict{
maxLevel = get(parameters, "amr.max_level", "")
independentVariables["amr.max_level"] = maxLevel == "" ? 1 : parse(Int32, maxLevel)
regrid = prod(parse.(Int64, split(get(parameters, "amr.regrid_int", ["0"]))))
independentVariables["amr.regrid_int"] = regrid == "" ? 1 : parse(Int64, regrid)
regrid = prod(parse.(Int64, split(get(parameters, "amr.regrid_int", ["0"]))))
independentVariables["amr.regrid_int"] = regrid
return independentVariables
......
......@@ -92,7 +92,7 @@ function _get_linear_model_X(extractor::AmrexCastro)::DataFrames.DataFrame
# get outputDir name
independentVariables["caseID"] = helper_get_relative_path(outputDir)
if !isXInit
if isXInit == false
X = DataFrames.DataFrame(independentVariables)
isXInit = true
else
......@@ -141,7 +141,7 @@ function _run_linear_models_plots_size_step(extractor::AmrexCastro, X::DataFrame
counter::Int32 = 1
# extract ncells
ncells = X["amr.ncells"][index]
ncells = X[!,"amr.ncells"][index]
# caseID
caseID = helper_get_relative_path(outputDir)
......@@ -199,63 +199,3 @@ function _run_linear_models_plots_size_step(extractor::AmrexCastro, X::DataFrame
#readline()
end
# dead function
function _run_linear_model_plots_size(extractor::AmrexCastro, X::DataFrames.DataFrame)
outputDirs = helper_get_prefix_directories(extractor.outputPrefix)
# single column DataFrame Y in the linear model
plotsSizesData = DataFrames.DataFrame(plots_sizes = Int64[])
for outputDir in outputDirs
# TODO refactor this later
inputFile::String = _get_input_file(extractor, outputDir)
parameters = _input_parser(extractor, inputFile)
rootPlotName = get(parameters, "amr.plot_file", "")
# find all directories with rootPlotName and get its size
plotFileDirs = helper_get_prefix_directories(string(outputDir, "/", rootPlotName))
plotsSize::Int64 = 0
for plotFileDir in plotFileDirs
sizeDir::Int64 = helper_get_directory_size(plotFileDir)
plotsSize += sizeDir
end
push!(plotsSizesData, [plotsSize])
end
println(plotsSizesData)
# Prepare the X independent variables in the linear model
XNames::Array{String} = extractor.outputs["plots_size"]
col1 = Symbol("amr.nplot_files")
col2 = Symbol("amr.ncells")
insert!(plotsSizesData, 2, X[!, col1] .* X[!, col2], :new_data)
#plotsSizesData[!,col1] =
#for XName in XNames
#columnName = Symbol(XName)
# this syntax [!, symbol] does not make a copy, use [:, symbol] for copies
#plotsSizesData[!, columnName] = X[!, columnName]
#end
# formula from https://discourse.julialang.org/t/glm-jl-with-unknown-column-names/20692/5
response = Symbol(names(plotsSizesData)[1])
predictors = Symbol.(names(plotsSizesData)[2:end])
println(plotsSizesData)
f = @eval(GLM.@formula($response ~ (+)($(predictors...))))
ols = GLM.lm(f, plotsSizesData)
println("I/O linear model formula:")
println(ols)
#import Plots
#display(Plots.plot(X, Y))
end
CheckPointVersion_1.0
3
0
0
0
(0 (0,0,0)(93750000,93750000,93750000) 1)
(RealBox 0 1500000000 0 1500000000 0 1500000000 )((0,0,0) (15,15,15) (0,0,0))P(0,0,0)
0.00036333937718578777
0.00036333937718578777
1
0
0
0
(0 (0,0,0)(93750000,93750000,93750000) 1)
(RealBox 0 1500000000 0 1500000000 0 1500000000 )((0,0,0) (15,15,15) (0,0,0))P(0,0,0)
(4 0
((0,0,0) (15,7,7) (0,0,0))
((0,0,8) (15,7,15) (0,0,0))
((0,8,0) (15,15,7) (0,0,0))
((0,8,8) (15,15,15) (0,0,0))
)4
((0,0,0) (15,15,15) (0,0,0))
(4 0
((0,0,0) (15,7,7) (0,0,0))
((0,0,8) (15,7,15) (0,0,0))
((0,8,0) (15,15,7) (0,0,0))
((0,8,8) (15,15,15) (0,0,0))
)-0.00036333937718578777
-0.00036333937718578777
0
0
1
Level_0/SD_0_New_MF
((0,0,0) (15,15,15) (0,0,0))
(4 0
((0,0,0) (15,7,7) (0,0,0))
((0,0,8) (15,7,15) (0,0,0))
((0,8,0) (15,15,7) (0,0,0))
((0,8,8) (15,15,15) (0,0,0))
)-0.00036333937718578777
-0.00036333937718578777
0
0
1
Level_0/SD_1_New_MF
((0,0,0) (15,15,15) (0,0,0))
(4 0
((0,0,0) (15,7,7) (0,0,0))
((0,0,8) (15,7,15) (0,0,0))
((0,8,0) (15,15,7) (0,0,0))
((0,8,8) (15,15,15) (0,0,0))
)-0.00036333937718578777
-0.00036333937718578777
0
0
0
((0,0,0) (15,15,15) (0,0,0))
(4 0
((0,0,0) (15,7,7) (0,0,0))
((0,0,8) (15,7,15) (0,0,0))
((0,8,0) (15,15,7) (0,0,0))
((0,8,8) (15,15,15) (0,0,0))
)-0.00036333937718578777
-0.00036333937718578777
0
0
1
Level_0/SD_3_New_MF
1
1
10
0
(4 0
((0,0,0) (15,7,7) (0,0,0))
((0,0,8) (15,7,15) (0,0,0))
((0,8,0) (15,15,7) (0,0,0))
((0,8,8) (15,15,15) (0,0,0))
)
4
FabOnDisk: SD_0_New_MF_D_00000 0
FabOnDisk: SD_0_New_MF_D_00002 0
FabOnDisk: SD_0_New_MF_D_00001 0
FabOnDisk: SD_0_New_MF_D_00003 0
4,10
1.0013580322265625e-05,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,1.5000150001500012e+15,1.5000150001500012e+15,1.4432683425637485e-01,1.0013580322265625e-05,1.0013580322265626e-35,1.0013580322265626e-35,
1.0013580322265625e-05,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,1.5000150001500012e+15,1.5000150001500012e+15,1.4432683425637485e-01,1.0013580322265625e-05,1.0013580322265626e-35,1.0013580322265626e-35,
1.0013580322265625e-05,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,1.5000150001500012e+15,1.5000150001500012e+15,1.4432683425637485e-01,1.0013580322265625e-05,1.0013580322265626e-35,1.0013580322265626e-35,
1.0013580322265625e-05,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,1.5000150001500012e+15,1.5000150001500012e+15,1.4432683425637485e-01,1.0013580322265625e-05,1.0013580322265626e-35,1.0013580322265626e-35,
4,10
1.0000000000000000e+09,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,1.5000150001500018e+15,1.5000150001500018e+15,1.4413109957829760e+13,1.0000000000000000e+09,1.0000000000000001e-21,1.0000000000000001e-21,
1.0000000000000000e+09,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,1.5000150001500018e+15,1.5000150001500018e+15,1.4413109957829760e+13,1.0000000000000000e+09,1.0000000000000001e-21,1.0000000000000001e-21,
1.0000000000000000e+09,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,1.5000150001500018e+15,1.5000150001500018e+15,1.4413109957829760e+13,1.0000000000000000e+09,1.0000000000000001e-21,1.0000000000000001e-21,
1.0000000000000000e+09,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,1.5000150001500018e+15,1.5000150001500018e+15,1.4413109957829760e+13,1.0000000000000000e+09,1.0000000000000001e-21,1.0000000000000001e-21,
1
1
1
1
(4 0
((0,0,0) (15,7,7) (0,0,0))
((0,0,8) (15,7,15) (0,0,0))
((0,8,0) (15,15,7) (0,0,0))
((0,8,8) (15,15,15) (0,0,0))
)
4
FabOnDisk: SD_1_New_MF_D_00000 0
FabOnDisk: SD_1_New_MF_D_00002 0
FabOnDisk: SD_1_New_MF_D_00001 0
FabOnDisk: SD_1_New_MF_D_00003 0
4,1
0.0000000000000000e+00,
0.0000000000000000e+00,
0.0000000000000000e+00,
0.0000000000000000e+00,
4,1
0.0000000000000000e+00,
0.0000000000000000e+00,
0.0000000000000000e+00,
0.0000000000000000e+00,
1
1
7
4
(4 0
((0,0,0) (15,7,7) (0,0,0))
((0,0,8) (15,7,15) (0,0,0))
((0,8,0) (15,15,7) (0,0,0))
((0,8,8) (15,15,15) (0,0,0))
)
4
FabOnDisk: SD_3_New_MF_D_00000 0
FabOnDisk: SD_3_New_MF_D_00002 0
FabOnDisk: SD_3_New_MF_D_00001 0
FabOnDisk: SD_3_New_MF_D_00003 0
4,7
0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,
0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,
0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,
0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,
4,7
0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,
0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,
0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,
0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,0.0000000000000000e+00,
==============================================================================
Castro Job Information
==============================================================================
job name: Castro
inputs file: inputs_3d_fullstar
number of MPI processes: 4
hydro tile size: (1024,16,16)
CPU time used since start of simulation (CPU-hours): 2.64398e-05
==============================================================================
Plotfile Information
==============================================================================
output date / time: Fri Sep 18 12:45:06 2020
output dir: /gpfs/alpine/csc310/proj-shared/wgodoy/amrex/Castro/Exec/gravity_tests/DustCollapse/case12
I/O time (s): 0.0123682
==============================================================================
Build Information
==============================================================================
build date: 2020-09-02 10:14:31.161672
build machine: Linux login1 4.14.0-115.21.2.el7a.ppc64le #1 SMP Thu May 7 22:22:31 UTC 2020 ppc64le ppc64le ppc64le GNU/Linux
build dir: /gpfs/alpine/csc310/proj-shared/wgodoy/amrex/Castro/Exec/gravity_tests/DustCollapse
AMReX dir: ../../../external/amrex
COMP: gnu
COMP version: 6.4.0
C++ compiler: mpicxx
C++ flags: -Werror=return-type -g -O3 -pthread -DBL_USE_MPI -DAMREX_USE_MPI -DGPU_COMPATIBLE_PROBLEM -DAMREX_GIT_VERSION="20.06" -DBL_GCC_VERSION=6.4.0 -DBL_GCC_MAJOR_VERSION=6 -DBL_GCC_MINOR_VERSION=4 -DAMREX_LAUNCH= -DAMREX_DEVICE= -DAMREX_CUDA_FORT_GLOBAL= -DAMREX_CUDA_FORT_DEVICE= -DAMREX_CUDA_FORT_HOST= -DAMREX_CUDA_FORT_HOST_DEVICE= -DBL_SPACEDIM=3 -DAMREX_SPACEDIM=3 -DBL_FORT_USE_UNDERSCORE -DAMREX_FORT_USE_UNDERSCORE -DBL_Linux -DAMREX_Linux -DAMREX_DIMENSION_AGNOSTIC -DCRSEGRNDOMP -DSPONGE -DGRAVITY -DCASTRO_MLMG -DPROB_PARAMS -I. -I../../../external/amrex/Src/Base -I../../../external/amrex/Src/AmrCore -I../../../external/amrex/Src/Amr -I../../../external/amrex/Src/Boundary -I../../../external/amrex/Src/LinearSolvers/C_CellMG -I../../../external/amrex/Src/LinearSolvers/MLMG -I../../../external/Microphysics/util -I. -I../../../Source/driver -I../../../Source/hydro -I../../../Source/problems -I../../../Source/sources -I../../../Source/scf -I../../../Util/model_parser -I../../../Util/conservative_interpolate -I../../../Source/hydro -I../../../Source/gravity -I../../../external/Microphysics/EOS -I../../../external/Microphysics/EOS/gamma_law -I../../../external/Microphysics/networks/general_null -I../../../external/Microphysics/EOS -I../../../external/Microphysics/networks -I../../../external/Microphysics/interfaces -I../../../external/Microphysics/constants -Itmp_build_dir/castro_sources/3d.gnu.MPI.EXE -I../../../external/amrex/Tools/C_scripts
Fortran comp: mpif90
Fortran flags: -g -O3 -ffree-line-length-none -fno-range-check -fno-second-underscore -fimplicit-none
Link flags: -L. -L/autofs/nccs-svm1_sw/summit/gcc/6.4.0/bin/../lib/gcc/powerpc64le-none-linux-gnu/6.4.0/../../../../lib64/
Libraries: -lmpi_ibm_mpifh -lmpi_ibm -lgfortran
EOS: ../../../external/Microphysics/EOS/gamma_law
NETWORK: ../../../external/Microphysics/networks/general_null
Castro git describe: 20.06-dirty
AMReX git describe: 20.06
Microphysics git describe: 20.06
==============================================================================
Grid Information
==============================================================================
level: 0
number of boxes = 4
maximum zones = 16 16 16
Boundary conditions
-x: outflow
+x: outflow
-y: outflow
+y: outflow
-z: outflow
+z: outflow
Domain geometry info
center: 7.5e+08 , 7.5e+08 , 7.5e+08
geometry.is_periodic: 0 0 0
geometry.coord_sys: 0
geometry.prob_lo: 0 0 0
geometry.prob_hi: 1.5e+09 1.5e+09 1.5e+09
amr.n_cell: 16 16 16
amr.max_level: 0
amr.ref_ratio:
==============================================================================
Species Information
==============================================================================
index name A Z
------------------------------------------------------------------------------
0 C12 12 6
1 O16 16 8
2 Mg24 24 12
==============================================================================
Inputs File Parameters
==============================================================================
castro.state_interp_order = 1
castro.lin_limit_state_interp = 0
castro.state_nghost = 0
castro.do_reflux = 1
castro.update_sources_after_reflux = 1
castro.apply_sources_consecutively = 0
castro.difmag = 0.1
[*] castro.small_dens = 1e-06
[*] castro.small_temp = 0.001
[*] castro.small_pres = 1e-200
[*] castro.small_ener = 1e-200
[*] castro.do_hydro = 1
castro.time_integration_method = 0
castro.limit_fourth_order = 1
castro.initialization_is_cell_average = 0
castro.use_reconstructed_gamma1 = 0
castro.add_ext_src = 0
castro.hybrid_hydro = 0
castro.ppm_type = 1
castro.ppm_temp_fix = 0
castro.plm_iorder = 2
castro.plm_limiter = 2
castro.hybrid_riemann = 0
castro.riemann_solver = 0
castro.cg_maxiter = 12
castro.cg_tol = 1e-05
castro.cg_blend = 2
castro.use_eos_in_riemann = 0
castro.use_flattening = 1
castro.transverse_use_eos = 0
castro.transverse_reset_density = 1
castro.transverse_reset_rhoe = 0
castro.dual_energy_eta1 = 1
castro.dual_energy_eta2 = 0.0001
castro.use_pslope = 1
castro.pslope_cutoff_density = -1e+20
castro.limit_fluxes_on_small_dens = 0
castro.limit_fluxes_on_large_vel = 0
castro.speed_limit = 2.99792e+10
[*] castro.do_sponge = 1
castro.sponge_implicit = 1
castro.ext_src_implicit = 0
castro.source_term_predictor = 0
castro.first_order_hydro = 0
castro.xl_ext_bc_type = fillme
castro.xr_ext_bc_type = fillme
castro.yl_ext_bc_type = fillme
castro.yr_ext_bc_type = fillme
castro.zl_ext_bc_type = fillme
castro.zr_ext_bc_type = fillme
castro.hse_zero_vels = 0
castro.hse_interp_temp = 0
castro.hse_reflect_vels = 0
castro.fill_ambient_bc = 0
castro.ambient_fill_dir = -1
castro.ambient_outflow_vel = 0
castro.clamp_ambient_temp = 0
castro.ambient_safety_factor = 1.1
castro.sdc_order = 2
castro.sdc_quadrature = 0
castro.sdc_extra = 0
castro.sdc_solver = 1
castro.sdc_solver_tol_dens = 1e-06
castro.sdc_solver_tol_spec = 1e-06
castro.sdc_solver_tol_ener = 1e-06
castro.sdc_solver_atol = 1e-10
castro.sdc_solver_relax_factor = 1
castro.sdc_solve_for_rhoe = 1
castro.sdc_use_analytic_jac = 1
castro.fixed_dt = -1
castro.initial_dt = -1
castro.dt_cutoff = 1e-12
castro.max_dt = 1e+200
[*] castro.cfl = 0.5
[*] castro.init_shrink = 0.1
[*] castro.change_max = 1.05
castro.plot_per_is_exact = 0
castro.small_plot_per_is_exact = 0
castro.use_retry = 1
castro.retry_subcycle_factor = 0.5
castro.use_post_step_regrid = 0
castro.max_subcycles = 10
castro.sdc_iters = 2
castro.dtnuc_e = 1e+200
castro.dtnuc_T = 1e+200
castro.dtnuc_X = 1e+200
castro.dtnuc_X_threshold = 0.001
[*] castro.do_react = 0
castro.react_T_min = 0
castro.react_T_max = 1e+200
castro.react_rho_min = 0
castro.react_rho_max = 1e+200
castro.disable_shock_burning = 0
castro.T_guess = 1e+08
castro.reactions_max_solve_level = 100
[*] castro.do_grav = 1
castro.moving_center = 0
castro.grav_source_type = 4
castro.do_rotation = -1
castro.do_acc = -1
castro.bndry_func_thread_safe = 1
castro.grown_factor = 1
castro.star_at_center = -1
castro.do_scf_initial_model = 0
castro.scf_maximum_density = -1e+06
castro.scf_equatorial_radius = -1e+09
castro.scf_polar_radius = -1e+09
castro.scf_relax_tol = 0.001
castro.scf_max_iterations = 30
castro.do_special_tagging = 0
castro.spherical_star = 0
castro.verbose = 0
castro.dump_old = 0
castro.domain_is_plane_parallel = 0
castro.print_fortran_warnings = 0
castro.print_update_diagnostics = 0
castro.track_grid_losses = 0
[*] castro.sum_interval = 1
castro.sum_per = -1
castro.show_center_of_mass = 0
castro.job_name = Castro
castro.output_at_completion = 1
castro.reset_checkpoint_time = -1e+200
castro.reset_checkpoint_step = -1
castro.use_point_mass = 0
castro.point_mass = 0
castro.point_mass_fix_solution = 0
[*] gravity.gravity_type = MonopoleGrav
gravity.const_grav = 0
gravity.direct_sum_bcs = 0
[*] gravity.drdxfac = 4
gravity.lnum = 0
gravity.verbose = 0
gravity.no_sync = 0
gravity.no_composite = 0
gravity.do_composite_phi_correction = 1
gravity.max_solve_level = 14
gravity.get_g_from_phi = 0
gravity.mlmg_max_fmg_iter = 0
gravity.mlmg_agglomeration = 1
gravity.mlmg_consolidation = 1
gravity.mlmg_nsolve = 0
[*] eos_gamma = 1.666660000
eos_assume_neutral = T
small_x = 0.1000000000E-29
use_tables = F
use_c12ag_deboer17 = F
fortin parameters:
r_old = 650000000.0
rho_0 = 1000000000.
[*] rho_ambient = 0.1000000000E-04
r_0 = 650000000.0
[*] p_0 = 0.1000000000E+16
[*] smooth_delta = 4000000.000
r_offset = 0.000000000
offset_smooth_delta = 1.000000000
[*] center_x = 750000000.0
[*] center_y = 750000000.0
[*] center_z = 750000000.0
nsub = 5
density
xmom
ymom
zmom
rho_E
rho_e
Temp
rho_C12
rho_O16
rho_Mg24
CheckPointVersion_1.0
3
0.0011463584437322346
0
0
(0 (0,0,0)(93750000,93750000,93750000) 1)
(RealBox 0 1500000000 0 1500000000 0 1500000000 )((0,0,0) (15,15,15) (0,0,0))P(0,0,0)
0.00021030537325734882
0.00021030537325734882
1
5
5
0
(0 (0,0,0)(93750000,93750000,93750000) 1)