cape.pycart.options.Mesh: pyCart Meshing Options

This module provides options for creating volume meshes in Cart3D. This consists of three parts, with the latter two being the generally more useful capabilities.

  • Provides the name of a template input.c3d file; overrides the file created by autoInputs

  • Specifies instructions for Cart3D bounding boxes ("BBox") with an automated interface to specify boxes by giving the name of a component along with a margin, in addition to the capability to manually give the coordinates

  • Specifies instructions for Cart3D surface refinement options ("XLev") by name of component(s) or component index

These BBox and XLev instructions edit the file preSpec.c3d.cntl. The BBox instructions are applied via the method cape.pycart.cntl.Cntl.PreparePreSpecCntl(). This file is an input file to cubes and affects the resolution of the volume created.

See Also:
class cape.pycart.options.Mesh.Mesh(**kw)

Dictionary-based interface for options for Cart3D meshing

get_BBox()

Return the list of bounding boxes for volume mesh creation

There are two methods to specify a "BBox". The first is to give the name of a component taken from a Cart3d Config.xml file. The cape.tri.Tri class automatically finds the smallest bounding box that contains this component, and then the user can specify additional margins beyond this box (margins can also be negative). In addition, separate margins (or “pads”) on the minimum and maximum coordinates can be given following the convention "xm" (short for x-minus) on the minimum coordinate and "xp" for the maximum coordinate.

{
    "compID": "fin2",
    "n": 9,
    "pad": 2.0,
    "xpad": 3.0,
    "ym": -1.0,
    "yp": 3.0
}

The other method is to simply give the limits as a list of xmin, xmax, ymin, … In both methods n is the number of refinements to specify within the bounding ox.

{
    "n": 9,
    "xlim": [10.0, 13.5, 3.0, 3.7, -0.8, 0.8]
}
Call:
>>> BBox = opts.get_BBox()
Inputs:
opts: pyCart.options.Options

Options interface

Outputs:
BBox: list (dict)

List of bounding box specifications

See Also:
Versions:
  • 2014-10-08 @ddalle: First version

get_XLev()

Return the list of XLev specifications for surface refinements

An XLev specification tells cubes to perform a number of additional refinements on any cut cells that intersect a triangle from a named component. This refinement can violate the maxR command-line input to cubes and is very useful for ensuring that small features of the surface have adequate resolution in the initial volume mesh.

The following example specifies two additional refinements (after the initial run-through by cubes) on all triangles in the component "fins". These instructions are then written to preSpec.c3d.cntl.

{
    "compID": "fins",
    "n": 2
}
Call:
>>> XLev = opts.get_XLev()
Inputs:
opts: pyCart.options.Options

Options interface

Outputs:
XLev: list`(:class:`dict)

List of surface refinement specifications

Versions:
  • 2014-10-08 @ddalle: First version

get_inputC3d()

Get the cubes input file name if not using autoInputs

Call:
>>> fc3d = opts.get_inputC3d()
Inputs:
opts: pyCart.options.Options

Options interface

Outputs:
fc3d: str

Name of input file

Versions:
  • 2015-11-08 @ddalle: Redone

get_mesh2d(i=None)

Get the two-dimensional mesh status

Call:
>>> mesh2d = opts.get_mesh2d(i=None)
Inputs:
opts: pyCart.options.Options

Options interface

i: int or None

Run index

Outputs:
mesh2d: bool or list`(:class:`bool)

Two-dimensional if True, three-dimensional otherwise

Versions:
  • 2014-08-03 @ddalle: First version

set_BBox(BBox=None)

Set the list of bounding boxes

Call:
>>> opts.set_BBox(BBox)
Inputs:
opts: pyCart.options.Options

Options interface

BBox: list`(:class:`dict)

List of bounding box specifications

Versions:
  • 2014-10-08 @ddalle: First version

set_XLev(XLev=None)

Set the list of XLev specifications

Call:
>>> opts.set_BBox(BBox)
Inputs:
opts: pyCart.options.Options

Options interface

XLev: list`(:class:`dict)

List of surface refinement specifications

Versions:
  • 2014-10-08 @ddalle: First version

set_inputC3d(fc3d='input.c3d')

Set the cubes input file name if not using autoInputs

Call:
>>> opts.set_inputC3d(fc3d)
Inputs:
opts: pyCart.options.Options

Options interface

fc3d: str

Name of input file

Versions:
  • 2015-11-08 @ddalle: Redone

set_mesh2d(mesh2d=False, i=None)

Set the two-dimensional mesh status

Call:
>>> opts.set_mesh2d(mesh2d, i=None)
Inputs:
opts: pyCart.options.Options

Options interface

mesh2d: bool or list`(:class:`bool)

Two-dimensional if True, three-dimensional otherwise

i: int or None

Run index

Versions:
  • 2014-08-03 @ddalle: First version