butterfly.gradingutil module

class butterfly.gradingutil.GradientProperties(ln, k, r, n, ds, de)

Bases: tuple

de

Alias for field number 5

ds

Alias for field number 4

k

Alias for field number 1

ln

Alias for field number 0

n

Alias for field number 3

r

Alias for field number 2

butterfly.gradingutil.find_cc_ratio(k, ds, ln, n)[source]
butterfly.gradingutil.grading_by_ds_ccratio_count(ds, k, n)[source]

Calculate grading properties.

Parameters:
  • ds – Start cell size
  • k – Cell-to-cell expansion (or geometric growth ratio)
  • n – Number of cells
Returns:

grading properties as a namedtuple.

ln: Total length k: Cell-to-cell expansion (or geometric growth ratio) r: Total expansion ratio (=bias factor in Ansys Meshing) n: Number of cells ds: Start cell size de: End cell size

butterfly.gradingutil.grading_by_length_de_ccratio(ln, de, k, min_ds=1)[source]

Calculate grading properties.

Parameters:
  • ln – Total length
  • de – End cell size
  • k – Cell-to-cell expansion (or geometric growth ratio)
  • min_ds – Minimum size for start cell size.
Returns:

grading properties as a namedtuple.

ln: Total length k: Cell-to-cell expansion (or geometric growth ratio) r: Total expansion ratio (=bias factor in Ansys Meshing) n: Number of cells ds: Start cell size de: End cell size

butterfly.gradingutil.grading_by_length_ds_ccratio(ln, ds, k)[source]

Calculate grading properties.

Parameters:
  • ln – Total length
  • ds – Start cell size
  • k – Cell-to-cell expansion (or geometric growth ratio)
Returns:

grading properties as a namedtuple.

ln: Total length k: Cell-to-cell expansion (or geometric growth ratio) r: Total expansion ratio (=bias factor in Ansys Meshing) n: Number of cells ds: Start cell size de: End cell size

butterfly.gradingutil.grading_by_length_ds_de(ln, ds, de)[source]

Calculate grading properties.

Parameters:
  • ln – Total length
  • ds – Start cell size
  • de – End cell size
Returns:

grading properties as a namedtuple.

ln: Total length k: Cell-to-cell expansion (or geometric growth ratio) r: Total expansion ratio (=bias factor in Ansys Meshing) n: Number of cells ds: Start cell size de: End cell size

butterfly.gradingutil.secant(f, x0, x1, eps, ds, ln, n)[source]

The secant method to solve nonlinear equation to find expansion ratio.

From: http://hplgit.github.io/Programming-for-Computations/pub/p4c/p4c-sphinx-Python/ ._pylight007.html