简体   繁体   English

python 中的多处理用于求解偏微分方程

[英]Multi-processing in python for solving PDEs

I am solving a partial differential equation called Navier-Stokes equation using python.我正在使用 python 求解一个称为 Navier-Stokes 方程的偏微分方程。 This problem is a time-dependent problem which means that the solution is being carried out step by step, and each step is used as initial condition for the next step (basically it is for loop solution).这个问题是一个时间相关的问题,这意味着解决方案是逐步执行的,并且每个步骤都用作下一步的初始条件(基本上它是用于循环解决方案)。

I have realized that the python code is using only one CPU while solving, and I would like to accelerate this process and I have a dual-core processor (4-logical processors).我已经意识到 python 代码在求解时只使用一个 CPU,我想加速这个过程,我有一个双核处理器(4 个逻辑处理器)。 So my question: Is there any way to solve each time step using 2 or three CPUs, I mean can I use two CPUs to solve the first time step, then the two CPUS to solve the second and so one.所以我的问题是:有没有办法使用 2 个或三个 CPU 来解决每个时间步,我的意思是我可以使用两个 CPU 来解决第一个时间步,然后两个 CPU 来解决第二个等等。

You might want to check out some existing packages, such as Oasis.您可能想查看一些现有的软件包,例如Oasis。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM