Giter Club home page Giter Club logo

Comments (4)

adtzlr avatar adtzlr commented on September 28, 2024 1

If you rely on this feature, then please open a pull request. We can improve this in the future if necessary.

from felupe.

ZAARAOUI999 avatar ZAARAOUI999 commented on September 28, 2024

Hi @adtzlr , I'm not sure if my suggestion can solve this issue, but we can add a callback to the mesh.update method, so after updating the mesh the callback will be called internally; let's take a look:

def update(self, points=None, cells=None, cell_type=None, callback=None):
        "Update the cell and dimension attributes with a given cell array."

        if points is not None:
            self.points = points

        if cells is not None:
            self.cells = cells

        ...
        
        ############## - Added - ################
        if callable(callback):
            callback(self)
        #########################################  

And then, the

mesh.update(points=mesh.rotate(angle_deg=-90, axis=2).points)

# this is important!
region.reload(mesh)

is replaced with the;

mesh.update(points=mesh.rotate(angle_deg=-90, axis=2).points, callback=region.reload)

from felupe.

adtzlr avatar adtzlr commented on September 28, 2024

Hi, thanks! I was thinking about that too, i.e. to add an update-method to a region like region.update(mesh=None, element=None, quadrature=None). However, this could lead to problems with the subsequent usage of template classes like RegionHexahedron. Currently, all FElupe classes are more or less "stand alone concepts". Your approach wouldn't change that. I'm still not sure if I should add callbacks here and there in FElupe as I think they are not very "pythonic".

from felupe.

ZAARAOUI999 avatar ZAARAOUI999 commented on September 28, 2024

Hi, thanks! I was thinking about that too, i.e. to add an update-method to a region like region.update(mesh=None, element=None, quadrature=None). However, this could lead to problems with the subsequent usage of template classes like RegionHexahedron. Currently, all FElupe classes are more or less "stand alone concepts". Your approach wouldn't change that. I'm still not sure if I should add callbacks here and there in FElupe as I think they are not very "pythonic".

Okey then, I'm sure that there's no a just one solution👌🙂, it's a matter of time, hope this fixed.

from felupe.

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.