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

Making a Team on FEM programming (BriefFiniteElement.NET) #36

Closed
epsi1on opened this issue Apr 18, 2020 · 15 comments
Closed

Making a Team on FEM programming (BriefFiniteElement.NET) #36

epsi1on opened this issue Apr 18, 2020 · 15 comments
Labels
Conversation Conversation about technical stuff of a new feature

Comments

@epsi1on
Copy link
Member

epsi1on commented Apr 18, 2020

Hi people,
This is Ehsan M.A, coordinator of BriefFiniteElement.NET opensource project.
I thought that it would be nice to make a team on coding simple to use finite element analysis in .net. Current BriefFiniteElement.NET code is designed and developed and maintains mostly by one person that is me (except some important features like sparse matrix operations etc).
As it was my first experiences in such projects, i believe the BriefFiniteElement code is not a Clean Code enough, neither architecture is not a Clean Architecture enough. Some people messaged me that code is complicated also currently it is maintained mostly by one person!

Can you people please give me some advice on how to continue this BriefFiniteElement project, or any suggestion on this?

  • Do you think that source code is complicated? how to reduce complication and make it simple to understand?
  • What other features do you think would be good? do you contribute for it?

Sincerely,
Ehsan M.A

I would tag all users that starred this repository.
@celeong , @spolarbear , @BenKenoby , @FSharpCSharp , @Fasngtao , @ForNeVeR , @GuofaHuang , @JetBrains , @Jonesbr49424 , @Loceno , @McGum , @nioel , @RichardWhitfieldTTW , @Sivolday , @TyGLM , @YFS11013 , @a5rGithub , @abc126 , @aurimasmb , @bennywolf , @bigworld12 , @ceanwang , @cyberpunk2099 , @dimtsap , @ejhg , @epsi1on , @eykaraduman , @fmarrabal , @haplokuon , @houqinglin , @init6dev , @joc74pt , @kaananu , @lmingle , @loading00123 , @luisggc , @milosuen , @nil-is-lin , @rellfy , @samuto , @shishizhao1988 , @snox , @sorlik-tr , @squarewheel7 , @sunyongmark , @tdy211 , @tmgerard , @wuxiaod1987 , @xiaoxiongnpu , @xpgo , @yifengzhimo , @dimtsap

@wuxiaod1987
Copy link

wuxiaod1987 commented Apr 18, 2020 via email

@rkmore
Copy link

rkmore commented Apr 18, 2020

Ehsan

I have been using and following this project for many years and fist and foremost want to thank you for your effort and dedication.

For someone who understands FEA and who is familiar with the .NET framework this project is not overly complicated. When compared with other open source (Frame3DD) and commercial (Engissol, Solverblaze) I actually find Brief somewhat better organized and easier to use (although the features are not exactly comparable).

I think the issue may be that potential users try to use the library without really having a strong background in the fundamentals.

Towards that end I think a large collection of examples that start really basic and walk through each concept would really help. Start with a simple cantilevered beam with a single point load on the end and proceed from there.

I would certainly be willing to contribute.

Thanks again
RKM

@Loceno
Copy link

Loceno commented Apr 18, 2020

Hi, @epsi1on
Hope you are fine.
I didn't follow the topic due to PhD research, so I don't know last upgrades. I used the BFE to generate some linar elastic model as step 0 of a probabilistic analysis of non linear FEM results, and it works fine.
Yes, maybe the code isn't too much firendly to understand but I think that the grade of complexity is needed for this ambitious project. Most of users maybe want a light FEM model to implemet in their projects. To meet their needs maybe some function can be implemented to manage the model easily.
To improve BFE I think that the further works can be focused on:

  • Improvement and validation of 1D, 2D and 3D linear Finite Elements;
  • Improve Documentation and examples;
  • Introducing meshes;
  • Introduce the possibility to define components of the stiffness matrix as functions;
  • Add Features to solve negative stiffness matrix;
  • Thinking at a pre/post processor development.
    Because my phd is finished but i started to work I can develop some examples for the wiki, and help to define strategies of development for nonlinear analysis.
    Best regards,

Alberto.

@celeong
Copy link

celeong commented Apr 20, 2020

Hi @epsi1on,

First and foremost a job well done for starting this project.
I am still new to BFE.Net and have not used it.
Looking at some of the code snippets, I think the OO design is easy to grasp.
Moving forward, I would suggest improving the documentation and adding more examples.

@epsi1on
Copy link
Member Author

epsi1on commented Apr 26, 2020

Towards that end I think a large collection of examples that start really basic and walk through each concept would really help. Start with a simple cantilevered beam with a single point load on the end and proceed from there.

Thanks for comment, I'll start for that but you can also create one and send it as a pull request, i'll merge it to documentation. This is empty file i've started:

https://github.com/BriefFiniteElementNet/BFE.Net.devdocs/blob/master/docs/example/simple-cantilever/index.rst

Another existing example:

https://github.com/BriefFiniteElementNet/BFE.Net.devdocs/blob/master/docs/example/loadcasecomb/index.rst

The examples are in ReStructuredText (rst) format. You can simply edit with a notepad as they are raw text files. Also if you can make picture of example with MSPaint etc. then I'll convert it to inkscape format like previous ones. For this what you should do I think is to first fork the project and make your own repository, then do changes on your own repo and finally merge the changes in your forked repository into the main repository and changes will be applied.
Also please do not worry about formatting etc, I'll handle it.

For someone who understands FEA and who is familiar with the .NET framework this project is not overly complicated. When compared with other open source (Frame3DD) and commercial (Engissol, Solverblaze) I actually find Brief somewhat better organized and easier to use (although the features are not exactly comparable).

Thanks :)
I did try to make it engage with dotnet features like serialization, object oriented stuff, etc.

Thanks

@epsi1on
Copy link
Member Author

epsi1on commented Apr 26, 2020

Hello @Loceno,
Thanks for your comments.

To improve BFE I think that the further works can be focused on:

* Improvement and validation of 1D, 2D and 3D linear Finite Elements;

It would be perfect if you define the details of how validation should be done.


* Introduce the possibility to define components of the stiffness matrix as functions;

Also can you please describe more about above item?


* Add Features to solve negative stiffness matrix;

There are several solvers available, there are also QR and LU for non positive definite matrices.


  Because my phd is finished but i started to work I can develop some examples for the wiki, and help to define strategies of development for nonlinear analysis.

i did put all documentation into another project (DevDoc ) and did not place examples in the wiki, so for adding new examples files should be added to the documentation repository.

@ArtemRash
Copy link

Hi, @epsi1on

I am engaged in a similar development. I like your engineering approach. I think it would be cool to add the following features to BriefFiniteElement:

  1. Definition of torsion constant for any cross sections
  2. Stiffness matrix calculation with hinge effect of the ends of beams
  3. Calculation taking into account possible global deformations
  4. Calculation by the initial offsets of nodes
  5. Calculation of influence lines (influence surfaces)
  6. Determination of stresses in the elements

@epsi1on
Copy link
Member Author

epsi1on commented Apr 30, 2020

Hi @ArtemRash ,
Thanks for reply, Can you contribute on item 1 (torsion constant) on arbitrary sections?
Some other features (like 2 and 6) are already implemented, also i did not understood the item 3,4 and 5. Can you please describe?
Thanks again

@ArtemRash
Copy link

Hi @ArtemRash ,
Thanks for reply, Can you contribute on item 1 (torsion constant) on arbitrary sections?
Some other features (like 2 and 6) are already implemented, also i did not understood the item 3,4 and 5. Can you please describe?
Thanks again

Hi @epsi1on !
The torsion constant definition is nontrivial task. To my regret I can not do this now, because of need to more knowledges of this theme.

As for the hinges. As I saw, you implement hinge only by all degrees of freedom, is it true? It is very interesting to solve the task otherwise. I need to describe the hinge by one ore more degrees of freedom. The hinge might be by X only, for example. In this case you must do deletion the coincident row (and column) in a global stiffness matrix of element. I do this operation in my project and if you didn't, I can tell you how do this.

As for global deformations. Sometimes, end user have a solve in x0y plane, for example. There is no deformation by Z direction. There is 5 or 4 or 3 degrees of freedom in one node in this case. The rank of local stiffness matrix is lower then full deformation case.

As for initial offsets. I mean a tasks where initial displacements of nodes are given. It might be support movements, for example.
image

As for influence lines (surfaces). The influence line is the diagram, showen how the strength (stress) is changing in one section (point of section), when the unit force (P=1.0) move throw the some path (nodes). I do this operation in my project too.

image

@epsi1on
Copy link
Member Author

epsi1on commented May 1, 2020

Hi @ArtemRash

  • Definition of torsion constant for any cross sections

Not implemented

  • Stiffness matrix calculation with hinge effect of the ends of beams

implemented take a look at documents

  • Calculation taking into account possible global deformations
    As for global deformations. Sometimes, end user have a solve in x0y plane, for example. There is no deformation by Z direction. There is 5 or 4 or 3 degrees of freedom in one node in this case. The rank of local stiffness matrix is lower then full deformation case.

The DoF per node in always 6, but user can fix those that are not used. For example in X-Y plane problems, Dz, Rx and Ry of all nodes should be fixed.

  • Calculation by the initial offsets of nodes
    As for initial offsets. I mean a tasks where initial displacements of nodes are given. It might be support movements

This is implemented as settlements, Node.Settlements

  • Calculation of influence lines (influence surfaces)

Not implemented yet

  • Determination of stresses in the elements

Already implemented, take a look at documents

@epsi1on epsi1on added the Conversation Conversation about technical stuff of a new feature label Aug 9, 2020
@wo80
Copy link
Contributor

wo80 commented Aug 13, 2020

Hi @epsi1on

the above comments are mostly about usability and features, but an important aspect (especially when motivating people to collaborate on a project) is code quality, and as you already stated in your opening post BriefFiniteElement code is not a clean code.

  1. I think having a good coverage is crucial to ensure that people contributing code do not unintentionally break anything. OpenCover reports the following code coverage, which is (expectedly) low:
    Line coverage: 13.4% (2266 of 16832)
    Branch coverage: 13.0% ( 494 of 3788)

  2. When building the solution, Visual Studio reports 345 warnings, some of them warning about obsolete code usage, which should easily be fixed, but also many obsolete warnings, telling a feature is incomplete/not working. Such code should not be distributed via nuget (meaning not be part of the main project or master branch).

  3. Building the solution with enabled generation of documentation, 1185 warnings are reported. So there's also a massive lack of documentation, which might discourage people to contribute code (because they don't understand the intention of the code that's already there).

I've opened a separate issue where I took a closer look at the Matrix class of the BriefFiniteElementNet.Common project.

@epsi1on
Copy link
Member Author

epsi1on commented Aug 14, 2020

@wo80 , Yes I think you are right.
I think better to continue discuss about the cleaning up the code in #72 .
Thanks

@wo80
Copy link
Contributor

wo80 commented Aug 14, 2020

@epsi1on Improving the code quality will be a major effort and if the people following this post are willing to help, this must be carefully orchestrated. You could open an issue to keep track of the overall progress and then open separate issues with specific tasks (ideally assigned to one person). Lets keep #72 just for the Matrix class.

@epsi1on
Copy link
Member Author

epsi1on commented Aug 14, 2020

@wo80 , yes this is important issue, sorry for being hasty. I've opened another issue for this, named Project Code Cleanup - Improve Code Quality in #74

@epsi1on
Copy link
Member Author

epsi1on commented Sep 15, 2021

Please continue this issue discussion section:
#104

Thanks

@epsi1on epsi1on closed this as completed Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Conversation Conversation about technical stuff of a new feature
Projects
None yet
Development

No branches or pull requests

7 participants