CNF:Mesh Sizing for CNF data: Difference between revisions

From crtc.cs.odu.edu
Jump to navigation Jump to search
Ctsolakis (talk | contribs)
Created page with "__TOC__ = Gradient-based approach for a mesh sizing = == Abstract== The data we acquire from Jlab represented evaluations of a “function” on a cube. What it needed is to..."
 
Ctsolakis (talk | contribs)
Line 34: Line 34:
* In step 3.2 the square is just a convinient transofmation but in some other case another polynomial or even other function, exp,log, tanh could be more appropriate. We can also look in the documentation of AFLR about sizing function in Boundary layer meshes ot any other sizing specific information.
* In step 3.2 the square is just a convinient transofmation but in some other case another polynomial or even other function, exp,log, tanh could be more appropriate. We can also look in the documentation of AFLR about sizing function in Boundary layer meshes ot any other sizing specific information.


Similar to the surface case described in the introduction the gradient
== Examples ==
== 2D ==
 
== 3D ==

Revision as of 20:14, 10 September 2019

Gradient-based approach for a mesh sizing

Abstract

The data we acquire from Jlab represented evaluations of a “function” on a cube. What it needed is to provide a mesh with a gradation that captures the changes of this values.

Introduction

A similar problem is solved when one refines/adapts a surface mesh with the goal of capturing the curvature of the mesh. In this situation the usual (but not unique) approach is to identify areas of high curvature by styding the deviation of neighboring normals on the surface. If the (normalized) inner product ( ) between the normals of two neighboring triangles is close to 1 there is a small angle between them and thus no need for extra refinement . On the other hand as the values of the inner produces decreases the angle between the vectors increases (TODO add note) and a finer mesh and thus more points are needed to resolve the curvature. The limit and amount of refinement are usually user defined, (see also refine on refinning the boundary of the mesh).

Similarly for the case in hand a method based on the local rate of change of values are used.

Method

1. Evaluate the gradient of the image. In the case of the CNF data a simple finite difference stencil is enough, since accuracy is not an issue. ITK has a filter for that already https://itk.org/Doxygen/html/classitk_1_1GradientMagnitudeImageFilter.html (TODO hint amount direction)

2. Perform some kind of preprocessing on these data. There are many options here, a literature review of gradient based sizing eg (https://link.springer.com/article/10.1007/s00366-006-0014-1) could be usefull. For the results below the transformation is

\left(\frac{\max(x) -x}{\max(x)} \right)^2

Intuition:

2.1 “invert” the range by mapping small gradient(small rate of change) to small values and big gradient magnidute (high rate of change) to big values. <math display="block"> \max(x) -x </math>

2.2 normalize by max to acquire values between 0,1 , in order to remove the notion of size and make it easier to manipulate for the mesh generator program. <math display="block"> \frac{\max(x) -x}{\max(x)} </math>

2.3 Optionally use the square of the fraction to slowdown the size increase (size x^2 < x for x in [0,1])

3. Pass this second image to the mesh generator, scale the value by diagonal of the boundaing box to bring it to input data dimensions and use it to constrain the size of the elements. Optionally support also min and max size as cut-off values.

Notes

  • In step 2.2 by nomalizing by max we also loose the “natural” sizing of the data
  • In step 3.2 the square is just a convinient transofmation but in some other case another polynomial or even other function, exp,log, tanh could be more appropriate. We can also look in the documentation of AFLR about sizing function in Boundary layer meshes ot any other sizing specific information.

Examples

2D

3D