fipy | FiPy is a Finite Volume PDE solver written in Python

 by   usnistgov Python Version: 3.4.4 License: Non-SPDX

kandi X-RAY | fipy Summary

kandi X-RAY | fipy Summary

fipy is a Python library. fipy has no bugs, it has no vulnerabilities, it has build file available and it has high support. However fipy has a Non-SPDX License. You can install using 'pip install fipy' or download it from GitHub, PyPI.

FiPy is a Finite Volume PDE solver written in Python
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              fipy has a highly active ecosystem.
              It has 413 star(s) with 143 fork(s). There are 30 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 141 open issues and 575 have been closed. On average issues are closed in 289 days. There are 4 open pull requests and 0 closed requests.
              It has a positive sentiment in the developer community.
              The latest version of fipy is 3.4.4

            kandi-Quality Quality

              fipy has 0 bugs and 0 code smells.

            kandi-Security Security

              fipy has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              fipy code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              fipy has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              fipy releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              fipy saves you 11695 person hours of effort in developing the same functionality from scratch.
              It has 23638 lines of code, 2090 functions and 470 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed fipy and discovered the below as its top functions. This is intended to give you an instant insight into fipy implemented functionality, and help decide if they suit your requirements.
            • Test if this is a binary operation .
            • Run leveler .
            • Compute the union of two meshes .
            • Compute the shape of an index .
            • Test method .
            • Return a dict of command - line arguments .
            • Reads the node data .
            • Runs a simple trench system
            • Open a . mmh file .
            • Builds a diffusion term equation
            Get all kandi verified functions for this library.

            fipy Key Features

            No Key Features are available at this moment for fipy.

            fipy Examples and Code Snippets

            No Code Snippets are available at this moment for fipy.

            Community Discussions

            QUESTION

            Chosen dt in sweep in FiPy package changes time domain of solution?
            Asked 2022-Feb-02 at 14:00

            I am currently trying to solve a large PDE system with 18 PDEs and ODEs (which is why I use FiPy and not odeint from scipy). One of the equations is quite simple: dROS/dt = 0.06 which I implemented as follows:

            ...

            ANSWER

            Answered 2022-Feb-02 at 14:00

            [Answered on GitHub. Please ask in one location or the other, but not both]

            You are taking 3650 steps of size 1e-5, for a total duration of 3.65e-2, so I would expect ROS to be 0.00219 at the end, which is what happens.

            This equation is linear in ROS, so there's no need to sweep it.

            Source https://stackoverflow.com/questions/70955808

            QUESTION

            How to represent these non-standard pdes with FiPy?
            Asked 2021-Dec-29 at 18:43

            I am trying to solve a set of PDEs with FiPy, but not sure how to represent the equations: see the PDEs here.

            The terms give me trouble are those in red rectangle and blue rectangle. The one in red rectangle is a convection term times a function depending on x, T1 and T2; The one in blue rectangle is a transient term times another function depending on x, T1 and T2.

            I couldn't find any example including this kind of terms. Could you please give me some suggestions, or share me an example?

            I appreciate any help. Thanks in advance.

            ...

            ANSWER

            Answered 2021-Dec-29 at 18:43

            This question is similar to cellvariable*Diffusion in fipy, but for convection instead of diffusion. The solution is the same though. Use,

            to convert the red terms into a convection term with a coefficient of f and a source term.

            For the blue terms do exactly the same to get a transient term with a coefficient and a source term.

            Edit: if we assume that then we can still use

            and approximate explicitly (with f as a variable in FiPy and use grad). However, we can take it further and use,

            and approximate the final explicitly.

            Again, we can go even further with,

            Again the last term can be solved explicitly. Depending on the form of f the last them should become more insignificant and thus, the explicitness less of an issue.

            Source https://stackoverflow.com/questions/70479155

            QUESTION

            Reverse diffusion with FiPy
            Asked 2021-Dec-20 at 19:05

            Still with my bird migration, I would like to represent the return of the birds in Europe after spending time in Africa.

            To achieve that, I need to be able to "reverse" the diffusion of the birds. I tried to put a negative coefficient for diffusion, but it doesn't work of course. So I wonder if it is possible to achieve this with FiPy.

            ...

            ANSWER

            Answered 2021-Dec-20 at 19:05

            That won't work. Diffusion is not a reversible operator. Try to define the problem with maths and then we can help to implement the equations in FiPy.

            Source https://stackoverflow.com/questions/70406443

            QUESTION

            Evolutive advection coefficient with time in FiPy, advection - diffusion equation (2D)
            Asked 2021-Dec-15 at 15:35

            I am trying to develop a model that represent the stork migration from France to middle Africa. I chose to go with FiPy.

            I would like to set the time as a full migration time : First, storks diffuse randomly in France, but when the time gets to a limit value, migration begins and an advection coefficient appear.

            I tried first with the Diffusion coefficient and it works :

            ...

            ANSWER

            Answered 2021-Dec-15 at 15:35

            QUESTION

            How to solve 1D Poisson equation with Dirichlet and Neumann boundary conditions on the same side using FiPy
            Asked 2021-Dec-06 at 19:26

            Clearly an 1D Poisson equation with a constant source has an unique solution even if both Dirichlet and Newmann boundary conditions are on the same side. However I can't think of a way to solve this in FiPy. Please advise. I tried:

            ...

            ANSWER

            Answered 2021-Dec-06 at 19:26

            Having both a Dirichlet and a Neumann on the same face in FV turns the nature of the problem from a boundary value problem into an initial value problem. In that sense the problem becomes over-specified as the right hand side boundary condition is still required. There may be ways to handle it with FD/FV with some hacks. However, FiPy certainly isn't set up to handle this type of problem.

            Source https://stackoverflow.com/questions/70222994

            QUESTION

            viewer error when running the stokesCavity.py example
            Asked 2021-Nov-17 at 22:44

            Running Manjaro stable with python-3.9 and python-fipy-3.4.2.1-1.

            Just got started with FiPy, ultimately interested in writing single and two-phase flow code. Naturally I tried to run examples/flow/stokesCavity.py (stripped down from all rst text) with: python stokesCavity.py and it throws the following error:

            ...

            ANSWER

            Answered 2021-Nov-17 at 22:44

            QUESTION

            How can I utilize JAX library to speed up my code?
            Asked 2021-Oct-03 at 16:29

            I have written a code that gets some vertex and rearranged them based on some rules. When the input contains big data, the code runs very slowly e.g. for 60000 loops it will take about 15 hours on google colab TPU runtime. I have found JAX is one of the best libraries to do so and trying to use it, but due to lack of experience in dealing with such big data and its related methods such as parallelization, I have faced to some problems. The following small sample is created to show what does the code doing:

            ...

            ANSWER

            Answered 2021-Oct-03 at 16:29

            Writing efficient JAX code is very similar to writing efficient NumPy code: generally if you are using a for loop over rows of your data, your code will not be very efficient. Instead, you should strive to write your computations in terms of vectorized operations.

            In your code, it looks like you are relying on many non-JAX elements (e.g. NumPy masked arrays, operations in FiPy, etc.) so it's unlikely that JAX will be able to improve your runtime. I'd focus instead on rewriting your code to make efficient use of NumPy, replacing the for-loop logic with NumPy vectorized operations.

            Here is an example of expressing your function in terms of vectorized operations:

            Source https://stackoverflow.com/questions/69422078

            QUESTION

            Can we find out which mesh a point belongs to in FiPy by searching with the coordinate?
            Asked 2021-Sep-29 at 11:44

            I have two meshes defined in FiPY as follows:

            ...

            ANSWER

            Answered 2021-Sep-29 at 11:44

            FiPy doesn't provide any capability like this and isn't likely to. If your meshes were simply connected and convex, then you could use scipy.spatial.tsearch with the mesh vertices. Unfortunately, based on your previous questions, this approach won't work for you.

            Many years ago, I did some work with semiconductor heterostructures, where I needed to account for different domain geometries built up during successive lithographic and electrodeposition steps. I used the Shapely package to define abstract geometrical domains and then converted those domains to a FiPy mesh with Gmsh. Shapely can be used to check point containment, even when the domains are concave or disconnected. The specifics were a bit different from what you're doing, but I believe it's still applicable.

            This gist illustrates building multiple complex domains, checking point containment in them, and then generating a single FiPy mesh from them (which was my use-case; you could generate separate meshes from separate domains).

            Source https://stackoverflow.com/questions/69364776

            QUESTION

            Can you create separate meshes in FiPy by reading "physical names" from Gmsh?
            Asked 2021-Sep-28 at 14:22

            I have the following code representing a .geo file for Gmsh that I want to load in FiPy for process simulation. It contains: (i) Oxide, (ii) Silicon and (iii) Gas as physical entities that needs to identified as separate meshes.

            ...

            ANSWER

            Answered 2021-Aug-12 at 15:47

            Here is a refinement on the brute-force solution I initially offered:

            Source https://stackoverflow.com/questions/68734234

            QUESTION

            Define a non-cartesian mesh in fipy
            Asked 2021-Sep-16 at 08:59

            I am trying to simulate the elementary unit of a 2D system that have a P6mm symmetry in fipy and I would like to define a non-cartesian mesh that describes the system described below. Yet,

            ...

            ANSWER

            Answered 2021-Sep-15 at 18:21

            FiPy does not provide a mesh class for what you want. UniformGrid2D could be used as the starting point for an equilateral triangular mesh (or a hexahedral mesh, if really required). StackOverflow isn't the right venue for that, though. Please open an issue if you'd like to pursue that.

            Gmsh will produce structured, triangular meshes, but I'm not sure it can be forced to produce regular, equilateral triangles.

            Source https://stackoverflow.com/questions/69196642

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install fipy

            You can install using 'pip install fipy' or download it from GitHub, PyPI.
            You can use fipy like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install FiPy

          • CLONE
          • HTTPS

            https://github.com/usnistgov/fipy.git

          • CLI

            gh repo clone usnistgov/fipy

          • sshUrl

            git@github.com:usnistgov/fipy.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link