-
Notifications
You must be signed in to change notification settings - Fork 8
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
use face_coordinates from mesh_topology variable #56
Comments
"D-Flow FM utilizes the circumcenter as the basis of the definition of the elementary flow variables ’water level’ and ’flow velocity’. The water level is defined at the circumcenter, whereas the face normal flow velocity is defined at the orthogonal projection of the circumcenter onto the cell face, i.e., the midpoint of the cell face." xugrid computes the centroids, whereas FM writes the circumcenters in the |
Some thoughts:
|
Reading this again: the problem is that a circumcenter is defined for triangles, but not for arbitrary n-gons. The Ugrid2d class should probably have the face coordinates as an additional parameter, which is then maintained. When nothing exists, centroids are returned as the default option for face coordinates. The question then arises how to set specify the face coordinates as circumcenters. In principle, this could be made to work: grid.face_coordinates = grid.circumcenters But that does not provide easy access via an accessor for DataArrays or Datasets; that's probably best achieved via the def assign_face_coords(self, centroid: bool=True) -> UgridDataset: Using circumcenters if false. This would then also set the face_coordinates on the underlying grid. |
face_coordinates are not read from mesh_topology variable, but computed instead. There is a discrepancy between the center of mass and circumcenter of triangles here. Solve by using face_coordinates if available.
The text was updated successfully, but these errors were encountered: