dokken
February 4, 2025, 7:59pm
5
Currently no, but you can call it with a single map, as for instance done in:
README.md
# TODO
1. Create interface that reads in the original global index from MSH directly
```python
from mpi4py import MPI
import dolfinx.io
import numpy.typing as npt
import gmsh
gmsh.initialize()
This file has been truncated. show original
create_mesh.py
import gmsh
import numpy as np
import argparse
from pathlib import Path
parser = argparse.ArgumentParser(description="Create a mesh for a box in a channel")
parser.add_argument(
"--res", type=float, default=0.05, help="Resolution of the mesh (at inlet)"
)
parser.add_argument(
This file has been truncated. show original
mwe_failing.py
from dolfinx import fem
from dolfinx.fem.petsc import LinearProblem
from dolfinx.io.gmshio import model_to_mesh
from dolfinx.io import VTXWriter
import ufl
import gmsh
import dolfinx
from petsc4py import PETSc
from basix.ufl import element
from mpi4py import MPI
This file has been truncated. show original
There are more than three files. show original
which was made together with Cristian Ciraci.
filliong:
Also, I was wondering if it would be simpler to generate a periodic mesh directly with GMSH (or any other meshing tools). What would be the behavior of Fenicsx when loading such a mesh? Would it work directly with MPI? Or do we need some mappings somewhere, or some other features?
In theory, one could simplify the code I have made by using information from GMSH. I’ve not had time to do this yet. In the aforementioned example you see gmsh being used for the periodic map on a cube.
The function from script.py
should work with MPI out of the box.