Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add mesh tutorials to the main tutorials branch #1908
base: doc/new-tutorials-section
Are you sure you want to change the base?
Add mesh tutorials to the main tutorials branch #1908
Changes from all commits
811adde
2266b73
9da611a
d02b96d
7480d30
3c31dd2
9a66fca
8e10754
6be9e21
e2111e0
29785f1
58e0364
b5f5365
79d57f8
f34dd4d
871f90d
56bd290
54476a9
af705b2
9338b6e
2e743e9
5791181
1f7af61
189b308
298f134
4e6e043
56cbec3
f1a9376
8b5b5f9
b9da160
f03e48e
5c43ae4
947f646
e666e27
98d4a97
ccc731b
882c3a2
cc3325c
e708660
ea88101
5684f6a
a7c26d6
11a44f4
4256566
b44ea3d
69b9c1b
4f3b349
ae30d91
8ba9f0a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should work too. It avoids using the
np.nditer
function and handles dimensions before executing any logic:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great implementation and great suggestion by Jorge as well.
Numpy operations are multidimensional, and knowing how to take advantage of this will greatly simplify things. For example, you can directly determine the index of a node within a DPFArray of nodes as suggested below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this updated function will take
my_nodes_coordinates_data
directly as input.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you choose to go with the previous suggestion, then you just need to do this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, you would still need to take care of the suggestions already given by Jorge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By storing constants in variables, the readability of this code can be improved: