Skip to content
Merged
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
9 changes: 6 additions & 3 deletions src/porepy/viz/data_saving_model_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,13 @@ def initialize_data_saving(self):
super().initialize_data_saving()
# Having a separate exporter for iterations avoids distinguishing between
# iterations and time steps in the regular exporter's history.
folder = Path(self.params["folder_name"])
folder_iterations = folder.parent / (folder.name + "_iterations")
self.iteration_exporter = pp.Exporter(
self.mdg,
file_name=self.params["file_name"],
folder_name=self.params["folder_name"] + "_iterations",
folder_name=folder_iterations,
length_scale=self.units.m,
)

def data_to_export_iteration(self):
Expand Down Expand Up @@ -332,7 +335,7 @@ def save_data_iteration(self):
self.data_to_export_iteration(),
time_dependent=True,
time_step=self.nonlinear_solver_statistics.num_iteration
+ r * self.time_manager.time_index,
+ 10**r * self.time_manager.time_index,
)

def after_nonlinear_iteration(self, solution_vector: np.ndarray) -> None:
Expand Down Expand Up @@ -467,7 +470,7 @@ def ensure_array(
# the normal traction.
traction_loc = traction[
cell_offsets_nd[id] : cell_offsets_nd[id + 1]
].reshape((3, -1), order="F")
].reshape((self.nd, -1), order="F")
# Avoid division by zero. If normal traction is zero (open fractures), we
# set it to 1.
zero_inds = np.isclose(traction_loc[-1], 0)
Expand Down