-
Notifications
You must be signed in to change notification settings - Fork 9
3D Hierarchy support :) #93
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
Conversation
Signed-off-by: Umberto Zerbinati <zerbinati@maths.ox.ac.uk>
| nodes_to_correct_sorted.sort() | ||
| nodes_to_correct_index = np.unique(nodes_to_correct_sorted) | ||
| tic = time.time() | ||
| logger.info("\t\t\tSanpping the DMPlex to NETGEN mesh") |
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.
| logger.info("\t\t\tSanpping the DMPlex to NETGEN mesh") | |
| logger.info("\t\t\tSnapping the DMPlex to NETGEN mesh") |
| petscPlexCoordinates.setArray(petscCoordinates.reshape((-1,1))) | ||
| petscPlex.setCoordinatesLocal(petscPlexCoordinates) | ||
| toc = time.time() | ||
| logger.debug(f"\t\t\tSanp the DMPlex to NETGEN mesh. Time taken: {toc - tic} seconds") |
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.
| logger.debug(f"\t\t\tSanp the DMPlex to NETGEN mesh. Time taken: {toc - tic} seconds") | |
| logger.debug(f"\t\t\tSnap the DMPlex to NETGEN mesh. Time taken: {toc - tic} seconds") |
| :arg mesh: the Netgen/NGSolve mesh | ||
| :arg levs: the number of levels in the hierarchy | ||
| :arg netgen_flags: either a bool or a dictionray containing options for Netgen. | ||
| :arg flags: either a bool or a dictionray containing options for Netgen. |
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.
| :arg flags: either a bool or a dictionray containing options for Netgen. | |
| :arg flags: either a bool or a dictionary containing options for Netgen. |
| A[0,0] = (coordinates[cell[1]]-coordinates[cell[0]])[0] | ||
| A[0,1] = (coordinates[cell[1]]-coordinates[cell[0]])[1] | ||
| A[0,2] = (coordinates[cell[1]]-coordinates[cell[0]])[2] |
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.
| A[0,0] = (coordinates[cell[1]]-coordinates[cell[0]])[0] | |
| A[0,1] = (coordinates[cell[1]]-coordinates[cell[0]])[1] | |
| A[0,2] = (coordinates[cell[1]]-coordinates[cell[0]])[2] | |
| A[0,:] = coordinates[cell[1]] - coordinates[cell[0]] |
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.
Or even better
for i in range(3):
A[i, :] = coordinates[cell[i+1]] - coordinates[cell[i]]
| if np.linalg.det(A) > 0: | ||
| cells[i] = cell | ||
| else: | ||
| cells[i] = np.array([cell[0],cell[1],cell[2], cell[2]]) |
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.
What is going on here?
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.
Aren't cell[i] the vertices?
| cStart = start_end[0] | ||
| cEnd = start_end[1] |
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.
Style
| cStart = start_end[0] | |
| cEnd = start_end[1] | |
| cStart, cEnd = start_end |
| cStart = start_end[0] | ||
| cEnd = start_end[1] |
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.
| cStart = start_end[0] | |
| cEnd = start_end[1] | |
| cStart, cEnd = start_end |
| if np.linalg.det(A) > 0: | ||
| cells[i] = cell | ||
| else: | ||
| cells[i] = np.array([cell[0],cell[1],cell[2], cell[2]]) |
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.
| cells[i] = np.array([cell[0],cell[1],cell[2], cell[2]]) | |
| cells[i] = np.array([cell[0], cell[1], cell[3], cell[2]]) |
| for i in range(cStart,cEnd): | ||
| sIndex = sIndicies[i] | ||
| if len(sIndex)==4: | ||
| cell = list(set(cell_indicies[i])) |
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.
Choosing a better name can help clarifying the logic here
| cell = list(set(cell_indicies[i])) | |
| cell_verts = list(set(cell_indicies[i])) |
| cStart = start_end[0] | ||
| cEnd = start_end[1] |
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.
| cStart = start_end[0] | |
| cEnd = start_end[1] | |
| cStart, cEnd = start_end |
| for i in range(cStart,cEnd): | ||
| sIndex = sIndicies[i] | ||
| if len(sIndex)==4: | ||
| cell = list(set(cell_indicies[i])) |
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.
What is the role of casting into a set? Are we ever going to get repeated vertices or do we only want to sort the vertices?
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.
Remove duplicates
Signed-off-by: uzerbianati <zerbinati@maths.ox.ac.uk>
Signed-off-by: uzerbianati <zerbinati@maths.ox.ac.uk>
No description provided.