diff --git a/tst/regression/test_suites/cluster_agn_triggering/cluster_agn_triggering.py b/tst/regression/test_suites/cluster_agn_triggering/cluster_agn_triggering.py index 76b74789..b2624c8c 100644 --- a/tst/regression/test_suites/cluster_agn_triggering/cluster_agn_triggering.py +++ b/tst/regression/test_suites/cluster_agn_triggering/cluster_agn_triggering.py @@ -345,69 +345,69 @@ def accretion_mask(Z, Y, X, inner_state, outer_state): return False initial_analytic_components = { - "Density": lambda Z, Y, X, time: np.ones_like(Z) + "cons_Density": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_rho.in_units("code_mass/code_length**3").v, - "MomentumDensity1": lambda Z, Y, X, time: np.ones_like(Z) + "cons_MomentumDensity1": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_Mx.in_units( "code_mass*code_length**-2*code_time**-1" ).v, - "MomentumDensity2": lambda Z, Y, X, time: np.ones_like(Z) + "cons_MomentumDensity2": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_My.in_units( "code_mass*code_length**-2*code_time**-1" ).v, - "MomentumDensity3": lambda Z, Y, X, time: np.ones_like(Z) + "cons_MomentumDensity3": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_Mz.in_units( "code_mass*code_length**-2*code_time**-1" ).v, - "TotalEnergyDensity": lambda Z, Y, X, time: np.ones_like(Z) + "cons_TotalEnergyDensity": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_energy_density.in_units( "code_mass*code_length**-1*code_time**-2" ).v, - "Velocity1": lambda Z, Y, X, time: np.ones_like(Z) + "prim_Velocity1": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_ux.in_units("code_length*code_time**-1").v, - "Velocity2": lambda Z, Y, X, time: np.ones_like(Z) + "prim_Velocity2": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_uy.in_units("code_length*code_time**-1").v, - "Velocity3": lambda Z, Y, X, time: np.ones_like(Z) + "prim_Velocity3": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_uz.in_units("code_length*code_time**-1").v, - "Pressure": lambda Z, Y, X, time: np.ones_like(Z) + "prim_Pressure": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_pres.in_units( "code_mass/(code_length*code_time**2)" ).v, } final_analytic_components = { - "Density": lambda Z, Y, X, time: accretion_mask( + "cons_Density": lambda Z, Y, X, time: accretion_mask( Z, Y, X, final_rho, self.uniform_gas_rho ) .in_units("code_mass/code_length**3") .v, - "MomentumDensity1": lambda Z, Y, X, time: accretion_mask( + "cons_MomentumDensity1": lambda Z, Y, X, time: accretion_mask( Z, Y, X, final_Mx, self.uniform_gas_Mx ) .in_units("code_mass*code_length**-2*code_time**-1") .v, - "MomentumDensity2": lambda Z, Y, X, time: accretion_mask( + "cons_MomentumDensity2": lambda Z, Y, X, time: accretion_mask( Z, Y, X, final_My, self.uniform_gas_My ) .in_units("code_mass*code_length**-2*code_time**-1") .v, - "MomentumDensity3": lambda Z, Y, X, time: accretion_mask( + "cons_MomentumDensity3": lambda Z, Y, X, time: accretion_mask( Z, Y, X, final_Mz, self.uniform_gas_Mz ) .in_units("code_mass*code_length**-2*code_time**-1") .v, - "TotalEnergyDensity": lambda Z, Y, X, time: accretion_mask( + "cons_TotalEnergyDensity": lambda Z, Y, X, time: accretion_mask( Z, Y, X, final_energy_density, self.uniform_gas_energy_density ) .in_units("code_mass*code_length**-1*code_time**-2") .v, - "Velocity1": lambda Z, Y, X, time: np.ones_like(Z) + "prim_Velocity1": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_ux.in_units("code_length*code_time**-1").v, - "Velocity2": lambda Z, Y, X, time: np.ones_like(Z) + "prim_Velocity2": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_uy.in_units("code_length*code_time**-1").v, - "Velocity3": lambda Z, Y, X, time: np.ones_like(Z) + "prim_Velocity3": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_uz.in_units("code_length*code_time**-1").v, - "Pressure": lambda Z, Y, X, time: accretion_mask( + "prim_Pressure": lambda Z, Y, X, time: accretion_mask( Z, Y, X, final_pres, self.uniform_gas_pres ) .in_units("code_mass/(code_length*code_time**2)") diff --git a/tst/regression/test_suites/cluster_hse/cluster_hse.py b/tst/regression/test_suites/cluster_hse/cluster_hse.py index de150c4c..3f9c99b1 100644 --- a/tst/regression/test_suites/cluster_hse/cluster_hse.py +++ b/tst/regression/test_suites/cluster_hse/cluster_hse.py @@ -360,10 +360,10 @@ def rk4(f, y0, T): return False profile_comparison_vars = ( - (analytic_P, he_sphere_P, "Pressure"), - (analytic_K, he_sphere_K, "Entropy"), - (analytic_rho, he_sphere_rho, "Density"), - (analytic_g, he_sphere_g, "Gravity"), + (analytic_P, he_sphere_P, "pressure"), + (analytic_K, he_sphere_K, "entropy"), + (analytic_rho, he_sphere_rho, "density"), + (analytic_g, he_sphere_g, "gravity"), ) fig, axes = plt.subplots(2, 2) @@ -441,8 +441,10 @@ def analytic_gold(Z, Y, X, analytic_var): return analytic_interp analytic_components = { - "Pressure": lambda Z, Y, X, time: analytic_gold(Z, Y, X, analytic_P).v, - "Density": lambda Z, Y, X, time: analytic_gold(Z, Y, X, analytic_rho).v, + "prim_Pressure": lambda Z, Y, X, time: analytic_gold(Z, Y, X, analytic_P).v, + "prim_Density": lambda Z, Y, X, time: analytic_gold( + Z, Y, X, analytic_rho + ).v, } # Use a very loose tolerance, linf relative error diff --git a/tst/regression/test_suites/cluster_hydro_agn_feedback/cluster_hydro_agn_feedback.py b/tst/regression/test_suites/cluster_hydro_agn_feedback/cluster_hydro_agn_feedback.py index 0caec690..d75a9a56 100644 --- a/tst/regression/test_suites/cluster_hydro_agn_feedback/cluster_hydro_agn_feedback.py +++ b/tst/regression/test_suites/cluster_hydro_agn_feedback/cluster_hydro_agn_feedback.py @@ -420,48 +420,48 @@ def agn_feedback(Z, Y, X, dt): return False initial_analytic_components = { - "Density": lambda Z, Y, X, time: np.ones_like(Z) + "cons_Density": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_rho.in_units("code_mass/code_length**3").v, - "MomentumDensity1": lambda Z, Y, X, time: np.ones_like(Z) + "cons_MomentumDensity1": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_Mx.in_units( "code_mass*code_length**-2*code_time**-1" ).v, - "MomentumDensity2": lambda Z, Y, X, time: np.ones_like(Z) + "cons_MomentumDensity2": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_My.in_units( "code_mass*code_length**-2*code_time**-1" ).v, - "MomentumDensity3": lambda Z, Y, X, time: np.ones_like(Z) + "cons_MomentumDensity3": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_Mz.in_units( "code_mass*code_length**-2*code_time**-1" ).v, - "TotalEnergyDensity": lambda Z, Y, X, time: np.ones_like(Z) + "cons_TotalEnergyDensity": lambda Z, Y, X, time: np.ones_like(Z) * self.uniform_gas_energy_density.in_units( "code_mass*code_length**-1*code_time**-2" ).v, } final_analytic_components = { - "Density": lambda Z, Y, X, time: ( + "cons_Density": lambda Z, Y, X, time: ( self.uniform_gas_rho + agn_feedback(Z, Y, X, time)[0] ) .in_units("code_mass/code_length**3") .v, - "MomentumDensity1": lambda Z, Y, X, time: ( + "cons_MomentumDensity1": lambda Z, Y, X, time: ( self.uniform_gas_Mx + agn_feedback(Z, Y, X, time)[1] ) .in_units("code_mass*code_length**-2*code_time**-1") .v, - "MomentumDensity2": lambda Z, Y, X, time: ( + "cons_MomentumDensity2": lambda Z, Y, X, time: ( self.uniform_gas_My + agn_feedback(Z, Y, X, time)[2] ) .in_units("code_mass*code_length**-2*code_time**-1") .v, - "MomentumDensity3": lambda Z, Y, X, time: ( + "cons_MomentumDensity3": lambda Z, Y, X, time: ( self.uniform_gas_Mz + agn_feedback(Z, Y, X, time)[3] ) .in_units("code_mass*code_length**-2*code_time**-1") .v, - "TotalEnergyDensity": lambda Z, Y, X, time: ( + "cons_TotalEnergyDensity": lambda Z, Y, X, time: ( self.uniform_gas_energy_density + agn_feedback(Z, Y, X, time)[4] ) .in_units("code_mass*code_length**-1*code_time**-2") diff --git a/tst/regression/test_suites/cluster_magnetic_tower/cluster_magnetic_tower.py b/tst/regression/test_suites/cluster_magnetic_tower/cluster_magnetic_tower.py index 2aad2e77..b7de8b0b 100644 --- a/tst/regression/test_suites/cluster_magnetic_tower/cluster_magnetic_tower.py +++ b/tst/regression/test_suites/cluster_magnetic_tower/cluster_magnetic_tower.py @@ -482,10 +482,10 @@ def B_scaled_linf_err(gold, test, B0): # Construct lambda functions for initial and final analytically # expected density and total energy density densities_analytic_components = { - "Density": lambda Z, Y, X, time: density_func(Z, Y, X, rho0) + "cons_Density": lambda Z, Y, X, time: density_func(Z, Y, X, rho0) .in_units("code_mass*code_length**-3") .v, - "TotalEnergyDensity": lambda Z, Y, X, time: ( + "cons_TotalEnergyDensity": lambda Z, Y, X, time: ( internal_energy_density_func(Z, Y, X, rho0) + b_energy_func(Z, Y, X, B_field) ) diff --git a/tst/regression/test_suites/cluster_tabular_cooling/cluster_tabular_cooling.py b/tst/regression/test_suites/cluster_tabular_cooling/cluster_tabular_cooling.py index 00da888e..44a9454c 100644 --- a/tst/regression/test_suites/cluster_tabular_cooling/cluster_tabular_cooling.py +++ b/tst/regression/test_suites/cluster_tabular_cooling/cluster_tabular_cooling.py @@ -259,19 +259,29 @@ def Analyse(self, parameters): return False analytic_uniform_gas_components = { - "Density": lambda Z, Y, X, time: (np.ones_like(X) * self.uniform_gas_rho) + "prim_Density": lambda Z, Y, X, time: ( + np.ones_like(X) * self.uniform_gas_rho + ) .in_units("code_mass*code_length**-3") .v, - "Velocity1": lambda Z, Y, X, time: (np.ones_like(X) * self.uniform_gas_ux) + "prim_Velocity1": lambda Z, Y, X, time: ( + np.ones_like(X) * self.uniform_gas_ux + ) .in_units("code_length*code_time**-1") .v, - "Velocity2": lambda Z, Y, X, time: (np.ones_like(X) * self.uniform_gas_uy) + "prim_Velocity2": lambda Z, Y, X, time: ( + np.ones_like(X) * self.uniform_gas_uy + ) .in_units("code_length*code_time**-1") .v, - "Velocity3": lambda Z, Y, X, time: (np.ones_like(X) * self.uniform_gas_uz) + "prim_Velocity3": lambda Z, Y, X, time: ( + np.ones_like(X) * self.uniform_gas_uz + ) .in_units("code_length*code_time**-1") .v, - "Pressure": lambda Z, Y, X, time: (np.ones_like(X) * self.uniform_gas_pres) + "prim_Pressure": lambda Z, Y, X, time: ( + np.ones_like(X) * self.uniform_gas_pres + ) .in_units("code_mass*code_length**-1*code_time**-2") .v, } @@ -356,7 +366,7 @@ def zero_corrected_linf_err(gold, test): { k: v for k, v in analytic_uniform_gas_components.items() - if k != "Pressure" + if k != "prim_Pressure" }, err_func=zero_corrected_linf_err, tol=self.machine_epsilon,