Category FiPy: Documentation, Examples & Development
Multi-Physics Code Coupling Without preCICE: Alternatives and Custom Approaches
Reading Time: 8 minutesWhen you work with multi-physics simulations, you often need to couple two or more specialized solvers so they exchange data during computation. preCICE is a mature open-source coupling library for partitioned multi-physics simulations, especially when connecting independent solvers such as FiPy, OpenFOAM, or CalculiX. But preCICE is not always an option. You may work in […]
Periodic, Symmetric, and Robin Boundary Conditions: Advanced FiPy Patterns
Reading Time: 8 minutesKey Takeaways Periodic boundaries in FiPy are most cleanly implemented with PeriodicGrid objects or Gmsh periodic mesh commands rather than manual face coupling. Symmetric boundaries are zero-flux Neumann conditions applied to symmetry planes. They are not a separate FiPy category, but a physical use of standard boundary condition patterns. Robin boundaries combine value and flux […]
The Scientific Python Ecosystem: Navigating SciPy, NumPy, SymPy, and Beyond
Reading Time: 8 minutesKey Takeaways NumPy is the foundation. It provides fast multidimensional arrays and the operations that most scientific Python libraries build on. SciPy sits on NumPy and provides high-level scientific routines, including optimization, integration, interpolation, linear algebra, and statistics. SymPy is pure Python and supports symbolic math, including exact algebra, calculus, and equation solving. Matplotlib, IPython, […]
Open-Source Development: Contributing to FiPy
Reading Time: 7 minutesOpen-source development is one of the best ways to learn how real software is built. It gives developers a chance to read production code, understand project structure, work with issues, write tests, improve documentation, and communicate with maintainers. For scientific software, open-source contribution is especially valuable. These projects do not only need clean code. They […]
Best Practices for Maintaining Scientific Code
Reading Time: 8 minutesScientific code often begins as a quick script. A researcher needs to clean a dataset, run a simulation, test a model, generate a figure, or check a hypothesis. At first, the code may be written for one person and one immediate task. But over time, that same script can become part of a published paper, […]
Tracking Code Changes and Updates in FiPy
Reading Time: 7 minutesFiPy is often used in research workflows where small software changes can matter. A new release may include documentation updates, dependency adjustments, solver-related fixes, examples, performance notes, or changes that affect how a simulation is configured. For casual experimentation, these updates may seem minor. For published research, teaching material, or long-running modeling projects, they can […]
Extending FiPy with Custom Modules
Reading Time: 8 minutesFiPy is most useful when you stop treating it as a collection of isolated example scripts and start using it as a flexible framework for building your own PDE workflows. That shift matters because real simulation projects rarely stay simple for long. A model that begins as one equation on one mesh often grows into […]
GPU Acceleration for FiPy Simulations: CuPy and Numba Integration Guide
Reading Time: 11 minutesFiPy simulations can achieve 10x to 100x speedups by moving compute-intensive operations to the GPU using CuPy (drop-in NumPy replacement) or Numba (JIT compilation). CuPy excels at array operations and requires minimal code changes, while Numba accelerates Python loops and custom functions. However, GPU acceleration isn’t always beneficial—small problems, memory-bound operations, and complex data structures […]
Adaptive Mesh Refinement in FiPy: Dynamic Resolution for Complex Phenomena
Reading Time: 10 minutesFiPy does not have built-in adaptive mesh refinement (AMR). Current approaches involve external mesh generation with Gmsh (inefficient for dynamic problems), integration with dedicated AMR libraries like libmesh (architecturally challenging), or switching to alternative phase-field codes that support AMR natively (MOOSE, PRISMS-PF). AMR provides significant speedups (often 2–10×) for phase-field problems with localized interfaces, but […]
Code Coupling with preCICE: Multi-Physics Simulations in Python
Reading Time: 9 minutesTL;DR Multi-physics simulations often require coupling multiple specialized solvers. preCICE is a mature, open-source coupling library that enables partitioned multi-physics simulations in Python. This tutorial shows how to couple FiPy with another solver using preCICE, covering installation, adapter implementation, configuration, and common pitfalls. You’ll learn when to use partitioned coupling, how to set up data […]