-
Notifications
You must be signed in to change notification settings - Fork 53
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
Feature curved pyramids #1036
Open
jfussbro
wants to merge
21
commits into
main
Choose a base branch
from
feature_curved_pyramids
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature curved pyramids #1036
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
bd3420e
added numbering for pyramid element in t8_eclass.c
jfussbro f40381a
added cad pyramid test
jfussbro 34f4664
added comment with link to issue
jfussbro ea35996
Merge remote-tracking branch 'origin/main' into feature_curved_pyramids
jfussbro 2bdcf9d
Merge branch 'feature-puma_patches_batch_processing_geometry3' into t…
jfussbro 10f5526
Merge remote-tracking branch 'origin/main' into feature_curved_pyramids
jfussbro 16ff7e1
Corrected fault in lookup table
jfussbro 01cdd29
Added mapping algorithm for cad pyramids
jfussbro aaa3911
Adapted test for cad pyramids to now existing mapping algorithm
jfussbro 108b2c1
Merge branch 'feature-puma_patches_batch_processing_geometry3' into f…
jfussbro 3e493c6
Merge branch 'feature-puma_patches_batch_processing_geometry3' into f…
jfussbro 5f71d4d
enabled read-in of cad-linked pyramids
jfussbro 0dae72b
bug fix - wrong scaling factor of edges of pyramid face 4
jfussbro 156f53c
added element centroid as testing point
jfussbro 62bf412
Merge remote-tracking branch 'origin/main' into feature_curved_pyramids
jfussbro a95045f
bug fix
jfussbro 9af614c
Merge remote-tracking branch 'origin/main' into feature_curved_pyramids
jfussbro 4b69d74
indent
jfussbro a10bae6
removed old todo
jfussbro cbfd3f4
indent
jfussbro 1d645c9
added suggestions from code review
jfussbro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -411,6 +411,77 @@ t8_geom_get_scaling_factor_of_edge_on_face_tet (const int edge, const int face, | |
return (1.0 - (orthogonal_vector[edge][face] / max_orthogonal_vector[edge][face])); | ||
} | ||
|
||
double | ||
t8_geom_get_scaling_factor_of_edge_on_face_pyramid (const int edge, const int face, const double *ref_coords) | ||
{ | ||
/* Save the orthogonal direction and the maximum of that direction | ||
* of an edge in reference space on one of the neighbouring faces. | ||
* /| | ||
* / | | ||
* / | | ||
* / | | ||
* / |--edge | ||
* / --|--face | ||
* / | | ||
* / <~~| orthogonal direction | ||
* /<----o--| maximum othogonal direction | ||
* /_________| | ||
*/ | ||
const double orthogonal_direction[8][5] | ||
= { { ref_coords[2], 0, 0, 0, ref_coords[0] }, | ||
{ 0, ref_coords[2], 0, 0, (1 - ref_coords[0]) }, | ||
{ 0, 0, ref_coords[2], 0, ref_coords[1] }, | ||
{ 0, 0, 0, ref_coords[2], (1 - ref_coords[1]) }, | ||
{ (ref_coords[1] - ref_coords[2]), 0, (ref_coords[0] - ref_coords[2]), 0, 0 }, | ||
{ 0, (ref_coords[1] - ref_coords[2]), (1 - ref_coords[0]), 0, 0 }, | ||
{ 0, (1 - ref_coords[1]), 0, (1 - ref_coords[0]), 0 }, | ||
{ (1 - ref_coords[1]), 0, 0, (ref_coords[0] - ref_coords[2]), 0 } }; | ||
const double max_orthogonal_direction[8][5] = { { ref_coords[1], 0, 0, 0, 1 }, | ||
{ 0, ref_coords[1], 0, 0, 1 }, | ||
{ 0, 0, ref_coords[0], 0, 1 }, | ||
{ 0, 0, 0, ref_coords[0], 1 }, | ||
{ (1 - ref_coords[2]), 0, (1 - ref_coords[0]), 0, 0 }, | ||
{ 0, (1 - ref_coords[2]), (1 - ref_coords[2]), 0, 0 }, | ||
{ 0, (1 - ref_coords[2]), 0, (1 - ref_coords[2]), 0 }, | ||
{ (1 - ref_coords[2]), 0, 0, (1 - ref_coords[2]), 0 } }; | ||
|
||
/* Check that the combination of edge and face is valid */ | ||
T8_ASSERT (face == t8_edge_to_face[T8_ECLASS_PYRAMID][edge][0] | ||
|| face == t8_edge_to_face[T8_ECLASS_PYRAMID][edge][1]); | ||
|
||
/* If the maximum orthogonal direction is 1, the reference coordinate lies on | ||
* one of the edge nodes and the scaling factor is therefore 0, because the displacement | ||
* at the nodes is always 0. | ||
* In all other cases the scaling factor is determined with one minus the relation of the orthogonal direction | ||
* to the maximum orthogonal direction. */ | ||
if (max_orthogonal_direction[edge][face] == 0) { | ||
return 0; | ||
} | ||
else { | ||
return (1.0 - (orthogonal_direction[edge][face] / max_orthogonal_direction[edge][face])); | ||
} | ||
} | ||
|
||
double | ||
t8_geom_get_scaling_factor_face_through_volume_pyramid (const int face, const double *ref_coords) | ||
{ | ||
/* The function computes the scaling factor of any displacement of a pyramid face, throughout the | ||
* volume of the element. The scaling factor is calculated accordingly to | ||
* t8_geom_get_scaling_factor_of_edge_on_face_pyramid with 1 - (orthogonal_direction / max_orthogonal_direction) */ | ||
|
||
const double orthogonal_direction[5] = { (ref_coords[0] - ref_coords[2]), (1 - ref_coords[0]), | ||
(ref_coords[1] - ref_coords[2]), (1 - ref_coords[1]), ref_coords[2] }; | ||
const double max_orthogonal_direction[5] | ||
= { (1 - ref_coords[2]), (1 - ref_coords[2]), (1 - ref_coords[2]), (1 - ref_coords[2]), | ||
(ref_coords[0] >= ref_coords[1] ? ref_coords[1] : ref_coords[0]) }; | ||
Comment on lines
+472
to
+476
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are they not used? |
||
|
||
if (max_orthogonal_direction[face] == 0) { | ||
return 1.0; | ||
} | ||
|
||
return (1.0 - (orthogonal_direction[face] / max_orthogonal_direction[face])); | ||
} | ||
|
||
void | ||
t8_geom_get_tet_face_intersection (const int face, const double *ref_coords, double face_intersection[3]) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
Most of the values are calculated and not used
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.
Every value which is not 0 will get used at some point. Removing the 0's is not possible, since calling the lookup with the edge number wouldn't be possible anymore