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

Function to set additional loads #8

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

korbireischl
Copy link

@korbireischl korbireischl commented Nov 2, 2024

A function has been added for setting additional load on blocks. This works like density_setup by defining a dictionary with entries for each block.
To work in the correct units, I adjusted the calculation of the self-weight in external_force_setup by adding a variable for gravitational acceleration. Now the calculation of the external forces uses SI units. To pass the tests, I had to set the value of gravity in them to 1.

What type of change is this?

  • Bug fix in a backwards-compatible manner.
  • New feature in a backwards-compatible manner.
  • Breaking change: bug fix or new feature that involve incompatible API changes.
  • Other (e.g. doc update, configuration, etc)

Checklist

  • I added a line to the CHANGELOG.md file in the Unreleased section under the most fitting heading (e.g. Added, Changed, Removed).
  • I ran all tests on my computer and it's all green (i.e. invoke test).
  • I ran lint on my computer and there are no errors (i.e. invoke lint).
  • I added new functions/classes and made them available on a second-level import, e.g. compas.datastructures.Mesh.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

I added a short documentation in the code and docs/api. Do you need additional documentation? And should I provide an example that uses external loads?
To display the added loads in the compas_viewer, the weight function must be adapted. I will come to this shortly.

@korbireischl
Copy link
Author

I noticed that when calculating forces in SI units, the values became too large for the solver and it no longer converged reliably. I reverted to using block mass rather than weight for the force vector. Instead I normalized the additional loads by dividing them by the variable for gravitational acceleration, ensuring they remain in the same mass-based units.

Now the solution behaves as intended, and I’ve restored the original test files. Users can still define the additional load in their preferred units (by default in Newtons with $g = 9.81$).

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.

1 participant