-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
does Mf6Splitter work for multilayer models? #2415
Comments
@ougx For your model to work you would need to change: array = np.ones([2, 1, 2], int)
array[:,0,1] = 2 to array = np.ones([1, 1, 2], int)
array[:,0,1] = 2 or array = np.ones([1, 2], int)
array[0, 1] = 2 For better load balancing with a large model, I'd recommend using the option: mfsplit = flopy.mf6.utils.Mf6Splitter(sim)
mask = mfsplit.optimize_splitting_mask(2)
new_sim = mfsplit.split_model(mask) |
Hi @jlarsen-usgs: thanks for your answer. But it doesn't seem to work for me: array = np.ones([1, 1, 2], int)
array[:,0,1] = 2
mfsplit = flopy.mf6.utils.Mf6Splitter(sim)
mask = mfsplit.optimize_splitting_mask(2)
new_sim = mfsplit.split_model(array)
new_sim.set_sim_path(".")
new_sim.write_simulation()
Traceback (most recent call last):
Cell In[387], line 6
new_sim = mfsplit.split_model(array)
File C:\Miniconda3\lib\site-packages\flopy\mf6\utils\model_splitter.py:3435 in split_model
paks = self._remap_package(package)
File C:\Miniconda3\lib\site-packages\flopy\mf6\utils\model_splitter.py:2971 in _remap_package
mapped_data = self._remap_array(item, value, mapped_data)
File C:\Miniconda3\lib\site-packages\flopy\mf6\utils\model_splitter.py:1204 in _remap_array
new_array[new_nodes] = original_arr[old_nodes]
IndexError: index 1 is out of bounds for axis 0 with size 1 or array = np.ones([1, 2], int)
array[0,1] = 2
mfsplit = flopy.mf6.utils.Mf6Splitter(sim)
mask = mfsplit.optimize_splitting_mask(2)
new_sim = mfsplit.split_model(array)
new_sim.set_sim_path(".")
new_sim.write_simulation()
Traceback (most recent call last):
Cell In[388], line 6
new_sim = mfsplit.split_model(array)
File C:\Miniconda3\lib\site-packages\flopy\mf6\utils\model_splitter.py:3435 in split_model
paks = self._remap_package(package)
File C:\Miniconda3\lib\site-packages\flopy\mf6\utils\model_splitter.py:2971 in _remap_package
mapped_data = self._remap_array(item, value, mapped_data)
File C:\Miniconda3\lib\site-packages\flopy\mf6\utils\model_splitter.py:1204 in _remap_array
new_array[new_nodes] = original_arr[old_nodes]
IndexError: index 1 is out of bounds for axis 0 with size 1 |
I see the issue now. I haven't wired in all of the support for GWE models yet, so the code itself it not recognizing that the GWE DIS package is a DIS package. Currently GWF and GWT are fully supported. I'll try to make the updates to support GWE models later today or tomorrow morning. |
I just noticed that you are building a GWF model and not a GWE model. As such, you should change your dis object to: dis = flopy.mf6.ModflowGwfdis(
gwf,
nlay=2,
nrow=1,
ncol=2,
delr=1,
delc=1,
top=2,
botm=[1,0]
) With that and using the code changes I had previously suggested, the splitter will work. Once the open PR is merged GWE packages will also be supported. |
Ahh, my bad, Good catch. @jlarsen-usgs! |
it does not seem to work for me with the version 3.9.1.
Below is a test:
The text was updated successfully, but these errors were encountered: