-
Notifications
You must be signed in to change notification settings - Fork 13
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
added_resample_mesh #536
base: master
Are you sure you want to change the base?
added_resample_mesh #536
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
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.
@fangohr @samjrholt, @swapneelap This MR introduces mesh.resample
. We don't strictly need it as it is just calling mesh.__init__
with the new n
. It might still be nice to have for consistency. What is your opinion?
``pmin`` and ``pmax`` stay unchanged. The values of the new cells are taken from | ||
the nearest old cell, no interpolation is performed. |
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.
``pmin`` and ``pmax`` stay unchanged. The values of the new cells are taken from | |
the nearest old cell, no interpolation is performed. | |
``pmin`` and ``pmax`` stay unchanged. |
The mesh does not have any values. Therefore this sentence does not apply.
n = np.array(n, dtype=int) | ||
new_n = self.n.copy() | ||
for i in range(len(n)): | ||
new_n[i] = n[i] | ||
|
||
return self.__class__( | ||
region=self.region, | ||
n=new_n, |
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.
n = np.array(n, dtype=int) | |
new_n = self.n.copy() | |
for i in range(len(n)): | |
new_n[i] = n[i] | |
return self.__class__( | |
region=self.region, | |
n=new_n, | |
return self.__class__( | |
region=self.region, | |
n=n, |
None of this should be required.
PR Type
Enhancement
Description
Added a new
resample
method to theMesh
class.Enables resampling of mesh with specified number of cells.
Includes detailed documentation and examples for usage.
Ensures boundaries remain unchanged during resampling.
Changes walkthrough 📝
mesh.py
Add `resample` method to `Mesh` class
discretisedfield/mesh.py
resample
method to theMesh
class.boundaries fixed.
region
andbc
.