Short story:

I am posting because before I tried this, I was unable to find on this
mailing list a clear statement/warning that such an interpolation can run
slow (eat up computer time).  Is there a faster way to interpolate?

Long story:

I thought of an adaptive meshing scheme for examples.phase.anisotropy after

Ferreira, Alexandre Furtado, Leonardo de Olivé Ferreira, and Abner da Costa
Assis. “Numerical Simulation of the Solidification of Pure Melt by a
Phase-Field Model Using an Adaptive Computation Domain.” *Journal of the
Brazilian Society of Mechanical Sciences and Engineering* 33, no. 2 (June
2011): 125–30. https://doi.org/10.1590/S1678-58782011000200002.

Their adaptive meshing scheme is quite simple and the paper is short. They
do not interpolate, because they are writing their own code from the ground
up. But in FiPy, it seems necessary to interpolate a solution from an old
mesh to a new mesh after remeshing.

I wrote a script and it runs for tiny problems, but seems useless because
the interpolation in remeshing takes way too long (which defeats the
purpose of ~Ferreira et al 2011 adaptive meshing), with interpolation time
exploding as mesh cell count increases. I didn’t record the cell count
exactly, but let’s say at ~5E5 cells, after 3.5 hours in a single
interpolation, I gave up and hit ctrl-c. 2500 cells took less than 2
seconds, 2E4 cells 100 seconds, 6E4 cells 900 seconds. For 5E5 cells, my 4
core 2013 desktop PC shows multiple cores in use, but most cores at 50%
load; using about 1/3 of the 8 GB RAM.

Interpolation means transferring a FiPy solution from a first unstructured
mesh of triangles to a second unstructured mesh of triangles (2D):

value=oldPhase(newMesh.cellCenters,order=1), hasOld=True)

value=old_dT(newMesh.cellCenters,order=1), hasOld=True)

Mesh 2 always has more cells than mesh 1.  Eventually mesh 2 is the mesh in

Does anybody know a way to speed this interpolation up, within FiPy? I
don’t believe I can use Grid2D meshes because my final domain of interest
is not rectangular (examples.phase.anisotropy is just a beginner problem to
play with). The meshes are unstructured sets of triangular cells and are
created using gmsh via pygmsh/meshio. Mesh density varies with x,y
(nonuniform meshes).

Google seemed to lead me to various interpolation tools, but I do not see a
way to take the data outside of FiPy to do the interpolation and then bring
the data back into FiPy.  I looked at the FiPy CellVariable source code but
it is beyond me to mess around with it.  It looked like it might run fast
since it seems to operate on only the nearest neighbors, but maybe it is
slowed down by having to do one cell at a time?

fipy mailing list
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to