Skip to content

Commit

Permalink
Backport PR yt-project#3470: Don't get domain dimensions from cparam …
Browse files Browse the repository at this point in the history
…file for Boxlib frontend.
  • Loading branch information
atmyers authored and meeseeksmachine committed Oct 15, 2021
1 parent 6a90b96 commit dcc0587
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 60 deletions.
14 changes: 1 addition & 13 deletions yt/frontends/boxlib/data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,19 +743,7 @@ def _parse_cparams(self):
param, vals = (s.strip() for s in line.split("="))
except ValueError:
continue
if param == "amr.n_cell":
vals = self.domain_dimensions = np.array(vals.split(), dtype="int32")

# For 1D and 2D simulations in BoxLib usually only the relevant
# dimensions have a specified number of zones, but yt requires
# domain_dimensions to have three elements, with 1 in the additional
# slots if we're not in 3D, so append them as necessary.

if self.dimensionality == 1:
vals = self.domain_dimensions = np.array([vals[0], 1, 1])
elif self.dimensionality == 2:
vals = self.domain_dimensions = np.array([vals[0], vals[1], 1])
elif param == "amr.ref_ratio":
if param == "amr.ref_ratio":
vals = self.refine_by = int(vals[0])
elif param == "Prob.lo_bc":
vals = tuple(p == "1" for p in vals.split())
Expand Down
47 changes: 0 additions & 47 deletions yt/frontends/boxlib/definitions.py
Original file line number Diff line number Diff line change
@@ -1,47 +0,0 @@
# TODO: get rid of enzo parameters we do not need
parameterDict = {
"CosmologyCurrentRedshift": float,
"CosmologyComovingBoxSize": float,
"CosmologyOmegaMatterNow": float,
"CosmologyOmegaLambdaNow": float,
"CosmologyHubbleConstantNow": float,
"CosmologyInitialRedshift": float,
"DualEnergyFormalismEta1": float,
"DualEnergyFormalismEta2": float,
"MetaDataString": str,
"HydroMethod": int,
"DualEnergyFormalism": int,
"InitialTime": float,
"ComovingCoordinates": int,
"DensityUnits": float,
"LengthUnits": float,
"LengthUnit": float,
"TemperatureUnits": float,
"TimeUnits": float,
"GravitationalConstant": float,
"Gamma": float,
"MultiSpecies": int,
"CompilerPrecision": str,
"CurrentTimeIdentifier": int,
"RefineBy": int,
"BoundaryConditionName": str,
"TopGridRank": int,
"TopGridDimensions": int,
"EOSSoundSpeed": float,
"EOSType": int,
"NumberOfParticleAttributes": int,
}


# converts the Orion inputs file name to the Enzo/yt name expected
# throughout the code. key is Orion name, value is Enzo/yt equivalent
orion2enzoDict = {
"amr.n_cell": "TopGridDimensions",
"materials.gamma": "Gamma",
"amr.ref_ratio": "RefineBy",
"castro.use_comoving": "ComovingCoordinates",
"castro.redshift_in": "CosmologyInitialRedshift",
"comoving_OmL": "CosmologyOmegaLambdaNow",
"comoving_OmM": "CosmologyOmegaMatterNow",
"comoving_h": "CosmologyHubbleConstantNow",
}

0 comments on commit dcc0587

Please sign in to comment.