butterfly.refinementRegion module

Butterfly refinement region.

class butterfly.refinementRegion.Distance(levels)[source]

Bases: butterfly.refinementRegion._RefinementMode

Distance refinement mode.

levels

A list of (x, y) values for levels. ‘levels’ specifies per distance to the geometry the wanted refinement level.

class butterfly.refinementRegion.Inside(level)[source]

Bases: butterfly.refinementRegion._RefinementMode

Inside refinement mode.

level

Refinement level as an integer. All cells inside the geometry get refined up to the level. The geometry needs to be closed for this to be possible.

class butterfly.refinementRegion.Outside(level)[source]

Bases: butterfly.refinementRegion.Inside

Outside refinement mode.

level

Refinement level as an integer. All cells inside the geometry get refined up to the level. The geometry needs to be closed for this to be possible.

class butterfly.refinementRegion.RefinementRegion(name, vertices, face_indices, normals, refinement_mode)[source]

Bases: butterfly.geometry._BFMesh

Butterfly refinement region.

name

Name as a string (A-Z a-z 0-9 _).

vertices

A flatten list of (x, y, z) for vertices.

face_indices

A flatten list of (a, b, c) for indices for each face.

normals

A flatten list of (x, y, z) for face normals.

refinement_mode

Refinement mode (0: inside, 1: outside, 2: distance)

isRefinementRegion

Return True for Butterfly refinement region.

refinement_mode

Boundary condition.

butterfly.refinementRegion.refinementRegions_from_stl_file(filepath, refinement_mode)[source]

Create a RefinementRegion form an stl file.

butterfly.refinementRegion.refinement_mode_from_dict(d)[source]

Create a Refinement mode from a python dictionary.

The dictionary should have two keys for model and levels. {‘levels’: ‘((1.0 4) )’, ‘mode’: ‘inside’}