Hi there,
Fenics 2016.1 with mpi
So, when we want to create mesh to be used later to solve independent problems we use mpi_comm_self (then one mesh for each process):
if rank_process==0:
mesh = UnitSquareMesh(mpi_comm_self(), 10, 10)
if rank_process==1:
mesh = UnitSquareMesh(mpi_comm_self(), 20, 20)
Then, what is the syntax when i import a mesh (without partition it!)
In a first program (that runs in serial without mpi) i have created a mesh and its meshfunction
mesh_= BoxMesh(Point(0.0, 0.0, 0.0), Point(length_0, length_1, length_2), n_0, n_1,n_2)
subdomains_ = MeshFunction('size_t', mesh_, 3)
Then i have marked it
class OmegaA(SubDomain):
def inside(self, x, on_boundary):
....
OmegaA().mark(subdomains_ , id_A)
OmegaB().mark(subdomains_ , id_B)
and then i have saved it:
File(Folder_Mesh_fenics + 'mesh.xml.gz') << mesh_
File(Folder_Mesh_fenics + 'mesh_function.xml.gz') << subdomains_
Now, i want I want to import mesh.xml.gz and mesh_function.xml.gz in a program with mpirun.
If i use the classic import symtax
mesh = Mesh(filepath)
Then the mesh is partitioned. I don't want this. I want to keep it unpartitioned.
# Instead of this:
mesh = Mesh(filepath_DOMAIN)
# Something like this:
if rank_process==0:
mesh = Mesh(mpi_comm_self(),filepath) # Does not work
if rank_process==1:
mesh = Mesh(mpi_comm_self(),filepath) # Does not work
If you wander why, i want to run independent calculation on the two subdomain (using submesh)
PS: i already know submesh with mpi is not immediate to get, for what i have read in the forum -> this will be my next issue. For now, i just want to get correctly the import.
Thanks for any help.