-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor:rigid-body rod contact friction examples
- Loading branch information
1 parent
aa5427a
commit fadc859
Showing
4 changed files
with
52 additions
and
33 deletions.
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
8 changes: 8 additions & 0 deletions
8
examples/RigidBodyCases/RodRigidBodyContact/rod_cylinder_contact_friction_case.py
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
if __name__ == "__main__": | ||
from examples.RigidBodyCases.RodRigidBodyContact.rod_cylinder_contact_friction import ( | ||
rod_cylinder_contact_friction_case, | ||
) | ||
|
||
total_energy = rod_cylinder_contact_friction_case( | ||
force_coefficient=0.1, normal_force_mag=10, POST_PROCESSING=True | ||
) |
25 changes: 25 additions & 0 deletions
25
examples/RigidBodyCases/RodRigidBodyContact/rod_cylinder_contact_friction_phase_space.py
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
if __name__ == "__main__": | ||
import multiprocessing as mp | ||
from examples.RigidBodyCases.RodRigidBodyContact.rod_cylinder_contact_friction import ( | ||
rod_cylinder_contact_friction_case, | ||
) | ||
from examples.RigidBodyCases.RodRigidBodyContact.post_processing import ( | ||
plot_force_vs_energy, | ||
) | ||
|
||
# total_energy = rod_cylinder_contact_friction_case(friction_coefficient=1.0, normal_force_mag=10, velocity_damping_coefficient=1E4, POST_PROCESSING=True) | ||
|
||
friction_coefficient = list([(float(x)) / 100.0 for x in range(0, 100, 5)]) | ||
|
||
with mp.Pool(mp.cpu_count()) as pool: | ||
result_total_energy = pool.map( | ||
rod_cylinder_contact_friction_case, friction_coefficient | ||
) | ||
|
||
plot_force_vs_energy( | ||
friction_coefficient, | ||
result_total_energy, | ||
friction_coefficient=0.5, | ||
filename="rod_energy_vs_force.png", | ||
SAVE_FIGURE=True, | ||
) |