-
Notifications
You must be signed in to change notification settings - Fork 6
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
MeshPy with Potential Interactions #72
Comments
The utility functions for creating header sections / input file parameters in 4C have a historic background. They were introduced to ease the creation of input files by wrapping common parameters. On one hand, this has the advantages of the MeshPy scripts being relative robust regarding changes in 4C. On the other hand, this requires a constant update of MeshPy to keep the parameter naming in 4C up to date. I personally only use these functions on rare occasions any more. For me it turned out to be simpler to just add all input file parameters directly as strings to the input file. However, I am not creating input scripts on a regular basis as I used to, so maybe I am biased there. Long story short, do as you seem best fit. In the near future I can envision a better encapsulation of the 4C specific functionality in MeshPy, similar to the ABAQUS functionaliy stored in
You have two options here:
Yes, that is easily possible. Try the following code snippet to fix all points at z=100: def find_node_on_plane(node, *, normal=None, origin_distance=None, tol=mpy.eps_pos):
"""Return the nodes lie on the plane defined by normal and origin_distance"""
projection = np.dot(node.coordinates, normal) / np.linalg.norm(normal)
return np.abs(projection - origin_distance) < tol
nodes_at_100 = input_file.get_nodes_by_function(
find_node_on_plane, normal=[0, 0, 1], origin_distance=100.0, tol=0.1
)
input_file.add(
BoundaryCondition(
GeometrySet(nodes_at_100),
"NUMDOF 9 ONOFF 1 1 1 1 1 1 0 0 0",
bc_type=mpy.bc.dirichlet,
)
) If this turns out to be used in many cases, we can add a file containing "node finding functions". To store commonly used functions like this one. |
Regarding the script you posted, looks good overall, two comments:
|
Thanks a lot @isteinbrecher for your elaborate and helpful input! Without that it would not have been possible to get such a good solution! I have pushed a first implementation to include potential interactions within MeshPy for 4C in #74 |
Currently I am further investigating the usage of MeshPy for the creation of multiple helices (based on #60) within a single input file including beam potential interactions.
In a simplified setting I have multiple helices with different start points, different axes, different twist angles and differing heights which are combined into a single 4C input file. Further, I want to enable potential interactions between individual fibers which results in the necessity to define each helix as an individual line.
As a simple proof of concept I use the following Python Code.
Code
This provides the necessary geometries and also adds each individual helix as a
DLINE-NODE TOPOLOGY
. To enable potential interactions within 4C I additionally need to add the header settings for the potential interactions:Finally, I need to add the interaction potential to each fiber as follows (each potential law needs to be added to each line, e.g., law 1 to line 1 and 2 and law 2 to line 1 and 2):
Regarding boundary conditions I want to fix all nodes at certain planes in all directions, e.g. fix all nodes at
z=0.0
and final geometry lengthz=100.0
.This leads to the following questions where I am unsure on how to proceed:
1. Would it be the best option to simply add the overall
BEAM POTENTIAL
settings viainput_file.add("""BEAM POTENTIAL ...""")
? Or is it useful to somehow implement this as a fixed function into MeshPy?2. Would it be ok to add a new runtime output for potential interactions to
header_functions.py ->set_runtime_output()
?3. Regarding the
DESIGN LINE BEAM POTENTIAL CHARGE CONDITIONS
; as a preferred way I would just add ahelix_set.add_potential_charge_condition(potlaw=1, value=13.123, function=none)
. Is it a good/doable thing within PyMesh? It would be nice if this could directly happen within the geometry creation as each geometry set already has all necessary information on its correspondingDLINE
. Currently I am unsure on how to proceed within MeshPy, would it make sense to create a new boundary condition?4. Regarding the boundary conditions; Is it possible to select specific nodes at a plane in space (e.g., z=100.0 or z=100.0+-0.01) and add a boundary condition to them? If not possible, would it make sense to include this option in MeshPy?
Thanks in advance for your help!
The text was updated successfully, but these errors were encountered: