Uniform Refinement Regions

Uniform regions let you enforce size constraints in regoins of refine-generated meshes. The regions can be boxes or cylinders where the cylinder can have different radii to generalize it to a point, line, frustrum, cone, cylinder. The base class defines the properties of the size constraint, and the two subclasses define the geometry.

Uniform regions are stored in the refine classes in the uniform_regions list of the refine objects. They are added to the command line arguments when refine executes.

Base Class

class pyrefine.refine.uniform_region.UniformRegionBase

Bases: object

h0

reference element length

Type

float

decay_distance

reference distance for quadratic decay of sizing constraint enforcement. Distance measured from shape surface (positive distance designates interior enforcement).

Type

float

property limit

Type of sizing constraint enforced in region (ceil or floor).

Type

str

get_commandline_arguments()

Returns the refine commandline arguments to activate a uniform refinement region.

Return type

str

Box

class pyrefine.refine.uniform_region.UniformBox(xmin=0.0, ymin=0.0, zmin=0.0, xmax=1.0, ymax=1.0, zmax=1.0)

Bases: UniformRegionBase

set_box_bounds(xmin, ymin, zmin, xmax, ymax, zmax)

Define Cartesian box extents by coordinates of two diagonally opposed points.

get_commandline_arguments()

Returns the refine commandline arguments to activate a uniform refinement region.

Return type

str

Cylinder

class pyrefine.refine.uniform_region.UniformCylinder(base_x=0.0, base_y=0.0, base_z=0.0, base_radius=1.0, top_x=0.0, top_y=0.0, top_z=1.0, top_radius=1.0)

Bases: UniformRegionBase

A cylinder, in general, has two radii and can degenerate to a point, line, cone, fustrum, or cylinder. A cylinder is defined by the coordinates of two points and the radius at those point. The radii of the cylinder are perpendicular to the axis connecting the two points.

Parameters
  • base_x (float) – x coordinate of cylinder base center

  • base_y (float) – y coordinate of cylinder base center

  • base_z (float) – z coordinate of cylinder base center

  • base_radius (float) – radius of cylinder base

  • top_x (float) – x coordinate of cylinder top center

  • top_y (float) – y coordinate of cylinder top center

  • top_z (float) – z coordinate of cylinder top center

  • top_radius (float) – radius of cylinder top

set_base(x, y, z, radius)

Set the center and radius of the bottom circle

Parameters
  • x (float) – x coordinate

  • y (float) – y coordinate

  • z (float) – z coordinate

  • radius (float) – radius of face

set_top(x, y, z, radius)

Set the center and radius of the top circle

Parameters
  • x (float) – x coordinate

  • y (float) – y coordinate

  • z (float) – z coordinate

  • radius (float) – radius of face

get_commandline_arguments()

Returns the refine commandline arguments to activate a uniform refinement region.

Return type

str