Home > Software engineering >  Define a non-cartesian mesh in fipy
Define a non-cartesian mesh in fipy

Time:09-16

I am trying to simulate the elementary unit of a 2D system that have a P6mm symmetry in fipy and I would like to define a non-cartesian mesh that describes the system described below. Yet,

mesh = fipy.Grid2D(nx = 10, ny = 10, dx = 1., dy = 1.)

only returns uniform meshes. I thought of changing the FaceVariable, but it seems it only accepts Boolean variables. I could also simulate a cartesian system equivalent to this one, but there would be redondant data. Would someone have a better approach?

System that I want to modelise, with is a mesoporous silica. The different colours indicate different domains, that are regions with different diffusion coefficients.

Alternative system description

Alternatively, I could define my system this way. Is there any objection in doing so ?

CodePudding user response:

FiPy does not provide a mesh class for what you want. UniformGrid2D could be used as the starting point for an equilateral triangular mesh (or a hexahedral mesh, if really required). StackOverflow isn't the right venue for that, though. Please open an issue if you'd like to pursue that.

Gmsh will produce structured, triangular meshes, but I'm not sure it can be forced to produce regular, equilateral triangles.

  • Related