cape.pycart.options.meshopts: Cart3D-specific volume meshing options¶
This module provides options for creating volume meshes in Cart3D. This consists of three parts:
Provides the name of a template
input.c3dfile; overrides the file created byautoInputsSpecifies 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 coordinatesSpecifies 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.
- class cape.pycart.options.meshopts.MeshOpts(*args, **kw)¶
- get_BBox(j=None, i=None, **kw)¶
Get list of bounding boxes for volume mesh creation
This defines bounding boxes using the name of a component taken from a Cart3D
Config.xmlfile. Thecape.trifile.Triclass 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). Separate margins (or “pads”) on theminimum 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 }
- Call:
>>> BBox = opts.get_BBox(j=None, i=None, **kw)
- Inputs:
- opts: MeshOpts
options interface
- j: {
None} |int Phase index; use
Noneto just return v- i: {
None} |int|np.ndarray opts.x index(es) to use with
@expr,@map, etc.- vdef: {
None} |object Manual default
- mode: {
None} |0|1|2|3 Warning mode code
0:no checks
1:validate silently
2:validate and show warnings
3:raise an exception if invalid
- ring: {opts._optring[key]} |
True|False Override option to loop through phase inputs
- listdepth: {
0} |int> 0 Depth of list to treat as a scalar
- x: {
None} |dict Ref conditions to use with
@expr,@map, etc.; often a run matrix; used in combination with i- sample: {
True} |False Apply j, i, and other settings recursively if output is a
listordict
- Outputs:
- BBox: {
None} |BBoxOpts list of bounding boxes for volume mesh creation
- BBox: {
This defines bounding boxes using the name of a component taken from a Cart3D
Config.xmlfile. Thecape.trifile.Triclass 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). Separate margins (or “pads”) on theminimum 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 }
- get_XLev(j=None, i=None, **kw)¶
Get list of XLev specs for add’l surface refinements
An XLev specification tells
cubesto perform a number of additional refinements on any cut cells that intersect a triangle from a named (or numbered) component. This refinement can violate the maxR command-line input tocubesand 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 topreSpec.c3d.cntl.{ "compID": "fins", "n": 2 }
- Call:
>>> XLev = opts.get_XLev(j=None, i=None, **kw)
- Inputs:
- opts: MeshOpts
options interface
- j: {
None} |int Phase index; use
Noneto just return v- i: {
None} |int|np.ndarray opts.x index(es) to use with
@expr,@map, etc.- vdef: {
None} |object Manual default
- mode: {
None} |0|1|2|3 Warning mode code
0:no checks
1:validate silently
2:validate and show warnings
3:raise an exception if invalid
- ring: {opts._optring[key]} |
True|False Override option to loop through phase inputs
- listdepth: {
0} |int> 0 Depth of list to treat as a scalar
- x: {
None} |dict Ref conditions to use with
@expr,@map, etc.; often a run matrix; used in combination with i- sample: {
True} |False Apply j, i, and other settings recursively if output is a
listordict
- Outputs:
- XLev: {
None} |XLevOpts list of XLev specs for add’l surface refinements
- XLev: {
An XLev specification tells
cubesto perform a number of additional refinements on any cut cells that intersect a triangle from a named (or numbered) component. This refinement can violate the maxR command-line input tocubesand 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 topreSpec.c3d.cntl.{ "compID": "fins", "n": 2 }
- get_inputC3d(j=None, i=None, **kw)¶
Get file name of pre-generated
input.c3d- Call:
>>> inputC3d = opts.get_inputC3d(j=None, i=None, **kw)
- Inputs:
- opts: MeshOpts
options interface
- j: {
None} |int Phase index; use
Noneto just return v- i: {
None} |int|np.ndarray opts.x index(es) to use with
@expr,@map, etc.- vdef: {
None} |object Manual default
- mode: {
None} |0|1|2|3 Warning mode code
0:no checks
1:validate silently
2:validate and show warnings
3:raise an exception if invalid
- ring: {opts._optring[key]} |
True|False Override option to loop through phase inputs
- listdepth: {
0} |int> 0 Depth of list to treat as a scalar
- x: {
None} |dict Ref conditions to use with
@expr,@map, etc.; often a run matrix; used in combination with i- sample: {
True} |False Apply j, i, and other settings recursively if output is a
listordict
- Outputs:
- inputC3d: {
'input.c3d'} |str file name of pre-generated
input.c3d
- inputC3d: {
- get_mesh2d(j=None, i=None, **kw)¶
Get option to build 2D mesh
- Call:
>>> mesh2d = opts.get_mesh2d(j=None, i=None, **kw)
- Inputs:
- opts: MeshOpts
options interface
- j: {
None} |int Phase index; use
Noneto just return v- i: {
None} |int|np.ndarray opts.x index(es) to use with
@expr,@map, etc.- vdef: {
None} |object Manual default
- mode: {
None} |0|1|2|3 Warning mode code
0:no checks
1:validate silently
2:validate and show warnings
3:raise an exception if invalid
- ring: {opts._optring[key]} |
True|False Override option to loop through phase inputs
- listdepth: {
0} |int> 0 Depth of list to treat as a scalar
- x: {
None} |dict Ref conditions to use with
@expr,@map, etc.; often a run matrix; used in combination with i- sample: {
True} |False Apply j, i, and other settings recursively if output is a
listordict
- Outputs:
- mesh2d: {
False} |True option to build 2D mesh
- mesh2d: {
- set_BBox(v, j=None, mode=None)¶
Get list of bounding boxes for volume mesh creation
This defines bounding boxes using the name of a component taken from a Cart3D
Config.xmlfile. Thecape.trifile.Triclass 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). Separate margins (or “pads”) on theminimum 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 }
- Call:
>>> opts.set_BBox(BBox, j=None, i=None, **kw)
- Inputs:
- opts: MeshOpts
options interface
- BBox: {
None} |BBoxOpts list of bounding boxes for volume mesh creation
This defines bounding boxes using the name of a component taken from a Cart3D
Config.xmlfile. Thecape.trifile.Triclass 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). Separate margins (or “pads”) on theminimum 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 }
- set_XLev(v, j=None, mode=None)¶
Get list of XLev specs for add’l surface refinements
An XLev specification tells
cubesto perform a number of additional refinements on any cut cells that intersect a triangle from a named (or numbered) component. This refinement can violate the maxR command-line input tocubesand 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 topreSpec.c3d.cntl.{ "compID": "fins", "n": 2 }
- Call:
>>> opts.set_XLev(XLev, j=None, i=None, **kw)
- Inputs:
- opts: MeshOpts
options interface
- XLev: {
None} |XLevOpts list of XLev specs for add’l surface refinements
An XLev specification tells
cubesto perform a number of additional refinements on any cut cells that intersect a triangle from a named (or numbered) component. This refinement can violate the maxR command-line input tocubesand 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 topreSpec.c3d.cntl.
- set_inputC3d(v, j=None, mode=None)¶
Get file name of pre-generated
input.c3d- Call:
>>> opts.set_inputC3d(inputC3d, j=None, i=None, **kw)
- Inputs:
- opts: MeshOpts
options interface
- inputC3d: {
'input.c3d'} |str file name of pre-generated
input.c3d- j: {
None} |int Phase index; use
Noneto just return v- mode: {
None} |0|1|2|3 Warning mode code
0:no checks
1:validate silently
2:validate and show warnings
3:raise an exception if invalid
- listdepth: {
0} |int> 0 Depth of list to treat as a scalar
- set_mesh2d(v, j=None, mode=None)¶
Get option to build 2D mesh
- Call:
>>> opts.set_mesh2d(mesh2d, j=None, i=None, **kw)
- Inputs:
- opts: MeshOpts
options interface
- mesh2d: {
False} |True option to build 2D mesh
- j: {
None} |int Phase index; use
Noneto just return v- mode: {
None} |0|1|2|3 Warning mode code
0:no checks
1:validate silently
2:validate and show warnings
3:raise an exception if invalid
- listdepth: {
0} |int> 0 Depth of list to treat as a scalar