Giter Club home page Giter Club logo

Comments (3)

JWock82 avatar JWock82 commented on August 27, 2024 1

You've identified one of the hardest parts of finite element analysis - the shear amount of data and memory it consumes. I've had large models in commercial software run out of disk space when running calculations. For every 1 node you have 12 displacements multiplied by the number of load combinations to store.

What your code has done works, but purging the displacements for unused load combinations is basically purging all the results for those combinations too, since they are derived "on the fly" from the displacements. You could also use load combination tags to only run selected load combinations. That has already been implemented in a recent change. See "Tags" here https://pynite.readthedocs.io/en/latest/load_combo.html

I'll admit I've never worked with weak references. I am not a programmer by trade, I'm a structural engineer. My code is probably a little weak, but the math/science behind it is pretty solid. I skimmed the python docs on weak references, and it's an interesting concept for efficient memory management. Not sure how I'd go about implementing it in Pynite.

Regarding python-diskcache, it also looks interesting. I'd be hesitant to add any additional dependencies to the project.

from pynite.

SoundsSerious avatar SoundsSerious commented on August 27, 2024

Let me know if this is something that you'd support, and I can write a PR for this!

from pynite.

SoundsSerious avatar SoundsSerious commented on August 27, 2024

Sounds like this is absolutely a pain point for many an FEA tool! PyNite should have a solution for this, and maybe to speed up analysis by loading results from a previous run. That would prevent rework if say you accidentally shutdown your python session.

The more I think about it the more it would make sense to have some kind of remove,save,load combo set of functions that could save progress displacements into some user defined storage say via a callback or dict-like interface.

As far as weak references I didn't really get them until I learned about python garbage collection where an object is kept as long as it has references to it, as explained by this example https://eli.thegreenplace.net/2009/06/12/safely-using-destructors-in-python/.

As far as implementation I think it would be relatively straight forward. The node dictionaries would be replaced with the WeakValueDict so that the results automatically disappeared when removed from the primary storage dictionary. Likewise the load_combo routine would have to reattach these weakvaluedict's to work again.

I'll find some time to write a demo of this and see if there are any gotchas

BTW Glad to see those load combo tags made it into the repo! I will be able to merge my fork on the latest release before submitting a PR so itll be on the same branch. The reorganization looks wonderful with the analysis code segmented out!

from pynite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.