Skip to content
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

Implement a nurbs cylindrical shell sector #168

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eulovi
Copy link
Contributor

@eulovi eulovi commented Jan 9, 2025

In this MR, a cylindrical shell sector is implemented. This geometry is necessary for generating the surface of a half-cylinder.

@eulovi eulovi self-assigned this Jan 9, 2025
@eulovi eulovi force-pushed the define-cylindrical-plate branch from 499fca9 to 56cf723 Compare January 9, 2025 11:32
@eulovi eulovi requested a review from isteinbrecher January 9, 2025 11:34
Copy link
Collaborator

@isteinbrecher isteinbrecher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @eulovi for the contribution. Looks good, I left some minor comments.

@@ -102,6 +103,7 @@
"add_geomdl_nurbs_to_mesh",
# NURBS geometry functions
"create_nurbs_hollow_cylinder_segment_2d",
"create_nurbs_cylindrical_shell_sector",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we order these imports alphabetically? (I know they were not in that order to begin with...)

def create_nurbs_cylindrical_shell_sector(
radius, angle, length, *, n_ele_u=1, n_ele_v=1
):
"""Creates a patch of a surface of a 3-dimensional sector of a cylindrical
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can this pass the pre-commit hooks? Shouldn't the docstring be a single line and then a newline before the detailed description? @davidrudlstorfer any ideas?

Comment on lines +160 to +169
radius: double
cylindrical shell radius
angle: double
angle of the cylindrical shell (radians)
length: double
length of the cylindrical shell
n_ele_u: int
number of elements in the parametric u-direction
n_ele_v: int
number of elements in the parametric v-direction
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of specifying the type here, you can use type hints in the signature:

def create_nurbs_cylindrical_shell_sector(
    radius:float, angle:float, length:float, *, n_ele_u:int=1, n_ele_v:int=1
):


# Create the surface of a quarter of a hollow cylinder
surf_obj = create_nurbs_cylindrical_shell_sector(
1, np.pi / 3, 1, n_ele_u=4, n_ele_v=3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use values different from 1 here? Preferably values that don't have a "clear common denominator", e.g., 2.5 and 3.1.

input_file = InputFile()

# Add material
mat = MaterialStVenantKirchhoff(youngs_modulus=50, nu=0.19, density=5.3e-7)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you don't need to specify the values here.


# Create patch set
element_description = (
"KINEM linear EAS none THICK 1.0 STRESS_STRAIN plane_strain GP 3 3"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, you can use a dummy string here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants