1

I have square mesh (array) and a value for each cell; all the cells have the same area initially. I would like to adjust the size (area) of each cell according to a coefficient, so each square cell would become a quadrilateral with their side lengths changed to meet the area constraint. Below I have a small example (the scale is not very precise, but it should convey the idea):

enter image description here

The brute force approach of going through each cell and adjusting each size length depending on the surrounding cell size seems very costly. I would expect such a task to be common in FEA and graphics generation, but haven't found much info on it. I found an algorithm to warp images given a (warped) mesh, but in this case you already have a warped mesh.

I am hoping someone here has experience with a similar problem and can point me to some literature that solves similar problems. Thanks.

supvato
  • 33
  • 5
  • I don't think this is possible in general; _eg_, a big number surrounded by small numbers, without some extra constraint. – Neil May 22 '23 at 21:48

1 Answers1

0

The general topic is mesh adaptation, more specifically isotropic mesh adaptation (size map).

If you want to keep connectivity of the cells, you're looking at r-adataption, or smoothing.

Now, I doubt you'll find any software to solve your problem, simply because mesh adaptation software always assumes a fixed boundary. These are used to produce better meshes for numerical schemes, where the domain is fixed throughout adaptation/simulation steps. This is because the domain boundary represents something of interest geometrically, like a mechanical piece or an airplane in a fluid simulation. But here, you need your quads to "push" outer edges further out, or allow them to come further in.

This also means your problem is ill-posed. Unless you have constraints you're not telling us about, there's an infinity of solutions to your problem; for instance, if you find a solution, you can just offset it and that's still a solution. This does not bode well for optimization approaches.

Still, you could try optimizing a quality function depending on the vertices. First, define the element quality function

Then, for every point P belonging to the elements , define (for example):

I put k in there as a parameter to play with. Higher values of k (don't go crazy) will minimize more strongly the maximum value of Q_K. You can also take the maximum over the element qualities, but that wouldn't be smooth (no derivatives).

This doesn't solve the well-posedness. Any solution will be a saddle point with flat directions. This is generally not very appreciated by optimization algorithms. To address this, you could simply add a penalization term such as

to the quality at P, where P_0 is the initial (before optim) position of P. You could even set the penalization to 0 if the distance is lower than some threshold that seems reasonable to you, and start increasing from there. Better yet, only add this term to boundary points, not the interior ones who should be free to move.

Finally, you'll want to put all of that in a function, and give it to an optimization method. If you don't want to compute derivatives, you can use Nelder-Mead, the "improved simplex method", DIRECT, and many others. This mostly depends on what packages/libraries you have available.

EDIT: Forgot to mention, you can look at [Knupp, Patrick M. "Algebraic mesh quality metrics." 2001] for other possible element quality functions.

Sardine
  • 153
  • 5
  • Thanks for the response. I hadn't thought about the the edges and any other constraints but, after reading your response, there is an important one that comes to mind. Ideally, I would like to conserve the total area, so assuming the initial grid has 8 (2x4) units, then the warped grid should also have eight units. This would also solve the edge issue because the total area would have to be conserved. So the coefficients would just mean that a cell with area=5 would be five times larger than one with area=1. I'll take a look at r-adaptation. Thanks again. – supvato May 23 '23 at 14:34