GSoC’19: Week 1 – Starting with the CrossSection class

The GSoC timeline started as soon as the projects were announced and so did the work on projects.

The Community bonding period ended last week. There wasn’t much work in the community bonding period. All I had to do was to extend my knowledge base related to the project and to familiarize with the development flow.

I started with going through the geometry module, which has a major role to play in the implementation of the Stage-I i.e. the implementation of CrossSection module. Also, I studied about the different properties of cross-sections, like, the first moment of area, polar modulus, section modulus, etc.

So the coding period started on 27th May and now the first week is completed. My task in the first week was to start the implementation of the CrossSection module. It majorly comprised of defining a new class CrossSection.

Major tasks inside the CrossSection class were:

  • Defining the different geometries using the geometry module:
    • Circle: A circular cross-section was easily defined by using class sympy.geometry.ellipses.Circle
    • Rectangle, I-section, T-section, triangle: These four shapes were defined using class sympy.geometry.polygons.Polygon. These geometries were defined using point to point mapping in the counter-clockwise direction in such a way that it starts at the origin and joins all the given points or vertices of the polygon in the given sequence.
    • All these geometries were defined in a way that they lie in the first quadrant, in order to get correct values of the centroid.
  • Defining different properties of the above cross-sections:
    • Area
    • Centroid
    • Second moment
    • Polar modulus
    • Section Modulus
    • First moment

Implementing these was not that difficult as area, centroid, the second moment are already implemented in the geometry module. On the other hand, polar modulus and section modulus were specifically defined in the CrossSection module separately for each geometry.

The problem of defining the first moment of area:

The way the first moment of area is calculated can be seen from here. And since the first moment of area is required majorly to calculate the Transverse shear stress on a beam, we are interested only in the first moment along the x-axis (or the horizontal axis).

But just a day pondering over it I realized that the first moment calculated as above calculates it for the extreme layer of the beam. Probably, we will have to return it in terms of y, so that the shear stress at any layer could be calculated.

where “y” is the distance of the layer of the beam from the neutral axis

So, I will be opening an issue-cum-discussion regarding the above problem to discuss it with the mentors. Also, I will soon be opening a work-in-progress PR regarding what has been implemented.

Next Week:

  • Completing the CrossSection class and linking it with the beam module via an add_cross_section() function.
  • Adding tests to the CrossSection module and in the Beam module
  • Completing documentation of the CrossSection module.

Since I had to travel this weekend there was a bit of delay in the progress. But I am positive that I will be able to compensate for it in the next week. Also, I will try to keep the work a bit in advance.

Will keep you updated!



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at

Up ↑

%d bloggers like this: