-
Notifications
You must be signed in to change notification settings - Fork 47
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
Problems in Erobility strcture with 3D displacements #55
Comments
Hi @Picus-canus, from memory the coupled badlands/UDW does not allow for variable erodibility map... which might be the reason why you are having the issue. After your modifications, I think |
Thank you four your reply, @tristan-salles ! Yes, I noticed that the Btw, I think this may be the last step of the edit of code, for it is the time to I think using the Hope this function can be debugged successfully! Thank you again and looking forward to your reply. |
Hi again,
Maybe what also needs to be changed is at line 935 in the apply_XY_displacements function: Keavg[:, k] = numpy.average(Keavg[:, :, k], weights=weights, axis=1) return (
newTIN,
newelev,
newcum,
newhcum,
newfcum,
newwcum,
newcumf,
newscum,
newKe,
newTe,
) All the return variables here should have the same dimensions. Then in # Get erodibility from erosive layer thicknesses
self.erodibility = numpy.zeros(nbPts)
for k in range(self.layNb):
existIDs = numpy.where(
numpy.logical_and(
self.thickness[:, k] > 0.0, self.erodibility[:] == 0.0
)
)[0]
self.erodibility[existIDs] = self.Ke[existIDs, k]
if len(numpy.where(self.erodibility == 0)[0]) == 0:
break Basically |
Thanks agian, @tristan-salles ! I give myself a weekend off so I'm only replying now :) Yes, I modified Ke in the same way, because Th and Ke are both 2D arrays on # 912
Kevals = numpy.zeros((len(zvals), ids.shape[1], lay))
# 919
Kevals[:, k, :] = mTe[ids[:, k], :]
# 935
Keavg[:, k] = numpy.average(Kevals[:, :, k], weights=weights, axis=1) I think the code you pointed out to me is really the one I need right now! # in eroMesh.py
def update_erodibility(self, erodibility, Ke, thickness):
self.erodibility = numpy.zeros(len(Ke))
for k in range(self.Ke.shape[1]):
existIDs = numpy.where(
numpy.logical_and(
self.thickness[:, k] > 0.0, self.erodibility[:] == 0.0
)
)[0]
self.erodibility[existIDs] = self.Ke[existIDs, k]
if len(numpy.where(self.erodibility == 0)[0]) == 0:
break and also call this function in Model.py line 267: #line 266
else:
#line 267-270
self.mapero.update_erodibility(
self.mapero.erodibility,
self.mapero.Ke,
self.mapero.thickness
)
#line 271
self.flow.erodibility = self.mapero.erodibility The good news is that it can now complete a loop with no errors, but now it has a new problem. ![]() As the cycle can be completed, I believe it should be close to success. Thank you again and looking forward to your reply. |
I am currently working on a 3D model of uwgeodynamics, whose surface processes need to be coupled to badlands, and I want to give the region a different K value.
When running the code, I noticed that I would be placements at function apply_XY_displacements
This is because it is trying to assign a two-dimensional array to a one-dimensional array.
Combined with the code before and after this function, I think this paragraph is calculating properties for the new node in TIN, so I changed Tevals to a 3D array(line 911):
Tevals= numpy.zeros((len(zvals), ids.shape[1], lay))
Change the Tevals assignment to(line 918):
Tevals[:, k, :] = mTe[ids[:, k], :]
Average instead(line 934):
Teavg[:, k] = numpy.average(Tevals[:, :, k], weights=weights, axis=1)
It is now ready to run successfully from apply_XY_displacements
However, in flow.erodibility[1GIDs] in checkpoints, Th and Ke values contain addPts, resulting in the following errors:
I think this may have to do with the assignment to flow.erodibility in the _rebuild_mesh because mapero.erodibility is still a one-dimensional array without addPts and the assignment is not the same as the module above.

But I don't know much about the logic of this block and would like some help.
Thank you for your time. I appreciate any help and look forward to the reply.
The text was updated successfully, but these errors were encountered: