Skip to content

structuralcodes - Repository examples#113

Draft
DanielGMorenaFhecor wants to merge 44 commits intofib-international:devfrom
MestreCarlos:nb_examples
Draft

structuralcodes - Repository examples#113
DanielGMorenaFhecor wants to merge 44 commits intofib-international:devfrom
MestreCarlos:nb_examples

Conversation

@DanielGMorenaFhecor
Copy link
Collaborator

This draft pull request has been linked to the main repository to work on the examples 👍 . This pull request is not intended to be merged with the dev branch; it is solely for notifications and tracking purposes.

Contributors

@MestreCarlos : Main contributor, working on examples proposed by @aperezcaldentey .
@DanielGMorenaFhecor : Reviewer, providing suggestions to improve the repository's usability from an end-user perspective.

Initial Plan

We initially planned to create a separate repository for these examples and use pip install git+[...] to install the dev branch. However, this was not possible due to the missing setup.py file (correct me if I am wrong). Although adding the repo as a submodule was considered, we decided to continue working in the same repository. We will migrate to a different repository when the first version is released.

Next Steps and Contributions

  • Develop More Examples: We have created some examples, but additional examples are welcome. These can be based on our experience, meetings with fib-TG10.3, or basic getting started examples. A bullet list of current examples will be posted in the comments with the current developed ones—please feel free to suggest more.

  • Improving Usability: @MestreCarlos and I have been discussing how to enhance the repository's usability from an end-user perspective. Notes from our discussions will be posted in the comments. Your feedback and contributions are welcome.

Feel free to comment, add, or discard any suggestions provided.

mortenengen and others added 30 commits December 13, 2022 21:01
Co-authored-by: talledodiego <38036285+talledodiego@users.noreply.github.com>
@DanielGMorenaFhecor
Copy link
Collaborator Author

DanielGMorenaFhecor commented Jul 29, 2024

Current state of the examples

  • Instant and long-term deflections in a concrete beam (EC2-2004)
  • Crack width computation in a concrete beam (EC2-2004)
  • Shear calculations in a concrete beam (EC2-2004)
  • Longitudinal shear reinforcement sizing (EC2-2004)
  • Sizing of slender concrete elements (EC2-2004)
  • Feel free to add..

@DanielGMorenaFhecor
Copy link
Collaborator Author

DanielGMorenaFhecor commented Jul 29, 2024

Usability Suggestions and Issues Detected

During the development of the examples, @MestreCarlos and I noticed some issues and approaches to improve usability.

@MestreCarlos did a good job in some of these points and validated the results of our current 'structuralcodes' library with an already validated tool that we are using in FHECOR.

Feel free to add, comment, discard, or ask for clarification:

  • The abstract signature of the constitutive law is get_tangent(self, eps: float) -> float: but all implementations are get_tangent(self, eps: ArrayLike) -> ArrayLike: The same applies to get_stress. Consider changing the abstract class signature for clarity. Improve Typing in ConstitutiveLaw abstract class #111
  • It is not possible to compute GrossProperties in a SurfaceGeometry (Point 1 in this file) fix: Update GenericSection to accept SurfaceGeometry #130
  • Some gross properties are not working properly if coordinates are defined negative (Point 2 in this file) fix: gross properties sign #131
  • We cannot access the properties of the materials in an instance of a GenericSection. Could we create an attribute for storing the material(s) and not just the constitutive laws? fix: accept only material in shell geometry #273
  • The property area is not equal to reinforcement area + surface area (Point 3 in this file) fix: area computation on Generic Section #132
  • Computed beding strength of same section but different rotations do not lead to same result (Point 4 in this file)
  • As creating rectangular reinforced concrete sections is a common task, it would be convenient to have a utility method and your _._add_._ operator to create something like this: section.rectangular(b, h, mat) + steel_reinf(…) + steel_reinf(…) + … feat: Draft Add sections framework #27 feat: Rectangular Section #200 feat: Add circular geometries #207 feat: Add for point geometries #261
  • We think the sign criteria may need a little bit more explanation in the documentation (Point 5 in this file) docs: Add theory for sections and materials #197 docs: explain sign convention for moments #316
  • When using the set_design_code method to configure my global code standard, I incorrectly passed ‘ec2_2024’, and the rest of the code was not working because this method uses get to get the standard from the dictionary, but None was set. It would be useful to raise a warning or an error if the code does not exist.
  • Error in the computation of the bearing capacity with external axial load (Point 6 in this file)
  • Sometimes we miss information about units in the docstrings within the functions or the sections classes.
  • There are some small discrepancies when N=0 in the My-Mz diagram (Point 9 in this file)
  • N-M diagram not computed properly (Point 10 in this file)
  • We missed a calculate_cracking_moment method in the section class, so we had to implement it outside for the sake of the example.
  • In one example, we needed to compute the elastic modulus taking into consideration the creep coefficient phi. We needed to extract this computation from the ConcreteEC2_2004. How are we finally going to deal with this time-dependency in the concrete classes?
  • Discrepancies in the moment-curvature diagram (Point 11 in this file)
  • In the GrossProperties attributes from the GenericSection class, we can obtain the reinforcement area, but what about the possibility of querying these areas by the position of the reinforcement or by the diameter used? This may also apply to other properties inside the GrossProperties class.
  • There is no possibility of computing the inertia of a homogenized cross section. In this case, we have used a "concrete reinforcement" with the steel areas multiplied by Es/Ec.
  • It would be useful to add new methods to the Section classes. In this case, we needed to compute the crack width in a concrete section, so wrapping all the calculations behind section.wk(M,…) would be very convenient. Of course, this implementation depends on the material of the cross section and the structural code to be used, so whether to use inheritance or conditional checking inside the method is to be discussed.
  • Feel free to add more suggestions…

For all the validations and full description of these points, please, check this notebook.

@DanielGMorenaFhecor
Copy link
Collaborator Author

DanielGMorenaFhecor commented Jul 29, 2024

Also, @MestreCarlos has developed some methods that were needed to compute the results. These functions would be helpful to include them at some point in the package (as utility classes or new methods in the current classes is to be discussed). These functions are:

  • def calculate_strain_profile_batch(sec: GenericSection, n_ed, my_ed) : Get the moment curvature diagram. Then interpolate to get curvature for my_d
  • def calculate_strain_profile(section: GenericSection, n_ed=0, m_ed=0): Get the stress in a given point (y,z) inside the cross section.
  • def calculate_cracking_moment(section: GenericSection, n=0, plot=False): Calculate the cracking moment of a R.C section in N*mm.
  • def calculate_width_at_z(geometry: CompoundGeometry | GenericSection, z): Calculate the width of a section or a section part at a certain level of z
  • def effective_depth(section: GenericSection, neg_bending: bool = False): Calculate the width of a section or a section part at a certain level of z.

For the implementation, please, take a look into this file.

talledodiego added a commit that referenced this pull request Aug 7, 2024
Fixed issue mentioned in #113: the gross properties were not working with section defined with negative coordinates.
talledodiego added a commit that referenced this pull request Aug 7, 2024
This fix an issue mentioned in PR #113: the area should be the sum of surface + reinforcement area.
mortenengen pushed a commit that referenced this pull request Aug 7, 2024
Fixed issue mentioned in #113: the gross properties were not working with section defined with negative coordinates.
mortenengen pushed a commit that referenced this pull request Aug 9, 2024
* Fix area computation on Generic Section

This fix an issue mentioned in PR #113: the area should be the sum of surface + reinforcement area.

* Revert "Fix area computation on Generic Section"

This reverts commit c06b47c.

* Removed unecessary area_surface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants