Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/vary_run_example.ex.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@

# Get the initial values from the original input file
iteration_variable_names, original_iteration_variable_values = (
get_mfile_initial_ixc_values(input_file)
get_mfile_initial_ixc_values(input_file, vary_run.data)
)

# Get the initial values from the new input file produced by VaryRun
# VaryRun always produces a file called IN.DAT in the same directory
# as the conf file
_, updated_iteration_variable_values = get_mfile_initial_ixc_values(
Path(temp_dir.name) / "IN.DAT"
Path(temp_dir.name) / "IN.DAT", vary_run.data
)

# %% [markdown]
Expand Down
6 changes: 3 additions & 3 deletions process/core/caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def _call_models_once(self, xc: np.ndarray):
data_structure.numerics.ncalls += 1

# Convert variables
set_scaled_iteration_variable(xc, nvars)
set_scaled_iteration_variable(xc, nvars, self.data)

# Perform the various function calls
# Stellarator caller
Expand Down Expand Up @@ -342,11 +342,11 @@ def _call_models_once(self, xc: np.ndarray):
4 | KIT HCLL model
5 | DCLL model
"""
if data_structure.fwbs_variables.i_blanket_type == 1:
if self.data.fwbs.i_blanket_type == 1:
# CCFE HCPB model
self.models.ccfe_hcpb.run()

elif data_structure.fwbs_variables.i_blanket_type == 5:
elif self.data.fwbs.i_blanket_type == 5:
# DCLL model
self.models.dcll.run()

Expand Down
2 changes: 1 addition & 1 deletion process/core/final.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def finalise(models, data, ifail: int, non_idempotent_msg: str | None = None):
po.ocmmnt(constants.NOUT, non_idempotent_msg)

# Write output to OUT.DAT and MFILE.DAT
op.write(models, constants.NOUT)
op.write(models, data, constants.NOUT)


def output_evaluation(data):
Expand Down
20 changes: 7 additions & 13 deletions process/core/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from process.data_structure.current_drive_variables import init_current_drive_variables
from process.data_structure.dcll_variables import init_dcll_module
from process.data_structure.divertor_variables import init_divertor_variables
from process.data_structure.fwbs_variables import init_fwbs_variables
from process.data_structure.heat_transport_variables import (
init_heat_transport_variables,
)
Expand Down Expand Up @@ -270,7 +269,6 @@ def init_all_module_vars():
data_structure.numerics.init_numerics()
init_buildings_variables()
init_divertor_variables()
init_fwbs_variables()
data_structure.global_variables.init_global_variables()
init_ccfe_hcpb_module()
init_heat_transport_variables()
Expand Down Expand Up @@ -1169,27 +1167,23 @@ def check_process(inputs, data): # noqa: ARG001

# Set inboard blanket thickness to zero if no inboard blanket switch
# used (Issue #732)
if data_structure.fwbs_variables.i_blkt_inboard == 0:
if data.fwbs.i_blkt_inboard == 0:
data_structure.build_variables.dr_blkt_inboard = 0.0

# Ensure that blanket material fractions allow non-zero space for steel
# CCFE HCPB Model

if data_structure.stellarator_variables.istell == 0 and (
data_structure.fwbs_variables.i_blanket_type == 1
data.fwbs.i_blanket_type == 1
):
fsum = (
data_structure.fwbs_variables.breeder_multiplier
+ data_structure.fwbs_variables.vfcblkt
+ data_structure.fwbs_variables.vfpblkt
)
fsum = data.fwbs.breeder_multiplier + data.fwbs.vfcblkt + data.fwbs.vfpblkt
if fsum >= 1.0:
raise ProcessValidationError(
"Blanket material fractions do not sum to 1.0",
i_blanket_type=data_structure.fwbs_variables.i_blanket_type,
breeder_multiplier=data_structure.fwbs_variables.breeder_multiplier,
vfcblkt=data_structure.fwbs_variables.vfcblkt,
vfpblkt=data_structure.fwbs_variables.vfpblkt,
i_blanket_type=data.fwbs.i_blanket_type,
breeder_multiplier=data.fwbs.breeder_multiplier,
vfcblkt=data.fwbs.vfcblkt,
vfpblkt=data.fwbs.vfpblkt,
fsum=fsum,
)

Expand Down
Loading
Loading