prj
June 10, 2021, 1:00pm
5
// run with MPI: ff-mpirun -np 4 script.edp
// NBPROC 4
load "PETSc" // PETSc plugin
macro dimension()2// EOM // 2D or 3D
include "macro_ddm.idp" // additional DDM functions
func Pk = P2; // finite element space
func Pkdc = P2dc; // finite element space
mesh Th = square(getARGV("-global", 40), getARGV("-global", 40));
mesh ThBackup = Th;
Mat A;
buildMat(Th, getARGV("-split", 1), A, Pk, mpiCommWorld)
fespace Vh(Th, Pk);
fespace Ph(Th, Pkdc);
Vh b = 1;
real a = 0.001;
func real f(real u) { return u*a+u-log(1+u); }
func real df(real u) { return a+u/(1+u); }
This file has been truncated. show original
You need to centralize your velocity first. Then, interpolate the centralized velocity. And eventually, dispatch the globally interpolated velocity on each subdomain.
You can also search the forum to find other ways to achieve this, e.g., Copy variables between different meshes with PETSc .