Difference between revisions of "TopoSet"

From OpenFOAMWiki
(Modify to be coherent with the new framework and update to OF21 - work in progress)
(Completion of the set sources - end)
Line 41: Line 41:
  
 
==List of sources==
 
==List of sources==
===cell sources===
+
===cellSet sources===
 
*boxToCell: Select all cells with cellCentre within bounding box
 
*boxToCell: Select all cells with cellCentre within bounding box
 
<tt>boxToCell (MINX MINY MINZ) (MAXX MAXY MAXZ)</tt>
 
<tt>boxToCell (MINX MINY MINZ) (MAXX MAXY MAXZ)</tt>
Line 47: Line 47:
 
<tt>cellToCell CELLSET</tt>
 
<tt>cellToCell CELLSET</tt>
 
*cylinderAnnulusToCell: Select all cells with cell centre within bounding cylinder annulus
 
*cylinderAnnulusToCell: Select all cells with cell centre within bounding cylinder annulus
<tt>cylinderAnnulusToCell (p1X p1Y p1Z) (p2X p2Y p2Z) outerRadius innerRadius</tt>
+
<tt>cylinderAnnulusToCell (P1X P1Y P1Z) (P2X P2Y P2Z) OUTERRADIUS INNERRADIUS</tt>
 
*cylinderToCell: Select all cells with cell centre within bounding cylinder
 
*cylinderToCell: Select all cells with cell centre within bounding cylinder
<tt>cylinderToCell (p1X p1Y p1Z) (p2X p2Y p2Z) radius</tt>
+
<tt>cylinderToCell (P1X P1Y P1Z) (P2X P2Y P2Z) RADIUS</tt>
 
*faceToCell: Select cells that are the owner|neighbour|any of the faces in the faceSet or where all faces are in the faceSet
 
*faceToCell: Select cells that are the owner|neighbour|any of the faces in the faceSet or where all faces are in the faceSet
 
<tt>faceToCell FACESET neighbour|owner|any|all</tt>
 
<tt>faceToCell FACESET neighbour|owner|any|all</tt>
Line 58: Line 58:
 
*labelToCell: Select cells by cellLabel
 
*labelToCell: Select cells by cellLabel
 
<tt>labelToCell (I0 I1 .. In)</tt>
 
<tt>labelToCell (I0 I1 .. In)</tt>
*nbrToCell: Select all cells with only NNBR or less neighbouring cells
+
*nbrToCell: Select all cells with only <tt>NNBR</tt> or less neighbouring cells
 
<tt>nbrToCell NNBR</tt>
 
<tt>nbrToCell NNBR</tt>
*nearestToCell: Select the nearest cell for each of the points pt0 ..ptn
+
*nearestToCell: Select the nearest cell for each of the points <tt>PT0 .. PTN</tt>
 
<tt>nearestToCell (PT0 .. PTN)</tt>
 
<tt>nearestToCell (PT0 .. PTN)</tt>
 
*pointToCell: Select all cells with any point in the pointSet
 
*pointToCell: Select all cells with any point in the pointSet
Line 70: Line 70:
 
*shapeToCell: Select all cells of given cellShape (splitHex hardcoded with internal angle < 10 degrees).
 
*shapeToCell: Select all cells of given cellShape (splitHex hardcoded with internal angle < 10 degrees).
 
<tt>shapeToCell tet|pyr|prism|hex|tetWedge|wedge|splitHex</tt>
 
<tt>shapeToCell tet|pyr|prism|hex|tetWedge|wedge|splitHex</tt>
*surfaceToCell
+
*surfaceToCell: Select cells using a surface
<tt>surfaceToCell<surface> <outsidePoints> <cut> <inside> <outside> <near> <curvature></tt>
+
<tt>surfaceToCell SURFACE OUTSIDEPOINTS CUT INSIDE OUTSIDE NEAR CURVATURE</tt>
:<surface> name of triSurface
+
:SURFACE ''name'' of triSurface
:<outsidePoints> list of points that define outside
+
:OUTSIDEPOINTS ''list of points'' that define outside
:<cut> boolean whether to include cells cut by surface
+
:CUT ''boolean'' whether to include cells cut by surface
:<inside>  ,,                ,,      inside surface
+
:INSIDE ''boolean'' whether to include cells inside surface
:<outside>  ,,                ,,      outside surface
+
:OUTSIDE ''boolean'' whether to include cells outside surface
:<near> scalar; include cells with centre <= near to surface
+
:NEAR ''scalar''; include cells with centre <= near to surface
:<curvature> scalar; include cells close to strong curvature on surface (curvature defined as difference in surface normal at nearest point on surface for each vertex of cell)
+
:CURVATURE ''scalar''; include cells close to strong curvature on surface (curvature defined as difference in surface normal at nearest point on surface for each vertex of cell)
*zoneToCell: Select all cells of CELLZONE
+
*zoneToCell: Select all cells of <tt>CELLZONE</tt>
 
<tt>zoneToCell CELLZONE</tt>
 
<tt>zoneToCell CELLZONE</tt>
===cellZone sources===
+
===cellZoneSet sources===
*setToCellZone
+
*setToCellZone: Select all cells in the cellSet.
===face sources===
+
<tt>setToCellZone CELLSET</tt>
*boundaryToFace  
+
===faceSet sources===
*boxToFace  
+
*boundaryToFace: Select all boundary faces
*cellToFace  
+
<tt>boundaryToFace</tt>
*faceToFace  
+
*boxToFace: Select all face with faceCentre within bounding box
*labelToFace  
+
<tt>boxToFace ((MINX MINY MINZ) (MAXX MAXY MAXZ))</tt>
*normalToFace  
+
*cellToFace: Select all faces of cells in the ''cellSet'' (<tt>all</tt>) or faces where both neighbours are in the ''cellSet'' (<tt>both</tt>)
*patchToFace  
+
<tt>cellToFace CELLSET all|both</tt>
*pointToFace  
+
*faceToFace: Select all faces in the faceSet
*zoneToFace
+
<tt>faceToFace FACESET</tt>
===faceZone sources===
+
*labelToFace: Select faces by label
*faceZoneToFaceZone
+
<tt>labelToFace (I0 I1 .. IN)</tt>
*setsToFaceZone
+
*normalToFace: Select faces with normal aligned to unit vector <tt>(NX NY NZ)</tt> to within <tt>TOL</tt>
*setToFaceZone
+
<tt>normalToFace (NX NY NZ) TOL</tt>
===point sources===
+
*patchToFace: Select faces of the <tt>PATCH</tt>
*boxToPoint  
+
<tt>patchToFace PATCH</tt>
*cellToPoint  
+
*pointToFace: Select faces with any point in the ''pointSet'' (<tt>any</tt>) or all points in the ''pointSet'' (<tt>all</tt>)
*faceToPoint  
+
<tt>pointToFace POINTSET any|all</tt>
*labelToPoint
+
*zoneToFace: Select all faces of FACEZONE
*nearestToPoint
+
<tt>zoneToFace FACEZONE</tt>
*pointToPoint  
+
===faceZoneSet sources===
*surfaceToPoint
+
*faceZoneToFaceZone: Select all faces of FACEZONE
*zoneToPoint  
+
<tt>faceZoneToFaceZone FACEZONE</tt>
===pointZone sources===
+
*setsToFaceZone: Select all faces in the faceSet. Orientated so slave side is in cellSet.
*setToPointZone
+
<tt>setsToFaceZone FACESET SLAVECELLSET</tt>
 +
*setToFaceZone: Select all faces in the faceSet. Sets flipMap.
 +
<tt>setToFaceZone FACESET</tt>
 +
===pointSet sources===
 +
*boxToPoint: Select all points with coordinate within bounding box
 +
<tt>boxToPoint ((MINX MINY MINZ) (MAXX MAXY MAXZ))</tt>
 +
*cellToPoint: Select all points of cells in the cellSet
 +
<tt>cellToPoint CELLSET all</tt>
 +
*faceToPoint: Select all points of faces in the faceSet
 +
<tt>faceToPoint FACESET all</tt>
 +
*labelToPoint: Select points by label
 +
<tt>labelToPoint (I0 I1 .. IN)</tt>
 +
*nearestToPoint: Select the nearest point for each of the points PT0 ..PTN
 +
<tt>nearestToPoint (PT0 .. PTN)</tt>
 +
*pointToPoint: Select all points in the pointSet
 +
<tt>pointToPoint POINTSET</tt>
 +
*surfaceToPoint: Select point using a surface
 +
<tt>surfaceToPoint SURFACE NEAR INSIDE OUTSIDE</tt>
 +
:SURFACE ''name'' of triSurface
 +
:NEAR ''scalar''; include points with coordinate <= near to surface
 +
:INSIDE ''boolean'' whether to include points on the opposite side of surface normal
 +
:OUTSIDE ''boolean'' whether to include points on this side of the surface normal
 +
*zoneToPoint: Select all points of POINTZONE
 +
<tt>zoneToPoint POINTZONE</tt>
 +
 
 +
===pointZoneSet sources===
 +
*setToPointZone: Select all points in the pointSet.
 +
<tt>setToPointZone POINTSET</tt>
  
 
==Usage==
 
==Usage==

Revision as of 19:21, 6 September 2012

Valid versions: OF Version 21.png

topoSet is a utility that collects points, faces and cells in sets, based on different criteria, for later usage with different other utilities like subsetMesh and setSet.

1 Dictionary

The default dictionary is located in

/system/topoSetDict

Usually dictionaries created elsewhere have the extension .topoSet (i.e. myTopoSet.topoSet).


The dictionary looks like:

actions
(
  {
    name    selectedCells;
    type    cellSet;
    action  new;
    source  boxToCell;
    sourceInfo
    {
      box (x0 y0 z0) (x1 y1 z1);
    }
  }
  {
    name    selectedFaces;
    type    faceSet;
    action  new;
    source  patchToFace;
    sourceInfo
    {
      name bottomWall;
    }
  }
);

2 List of sources

2.1 cellSet sources

  • boxToCell: Select all cells with cellCentre within bounding box

boxToCell (MINX MINY MINZ) (MAXX MAXY MAXZ)

  • cellToCell: Select all cells in the cellSet

cellToCell CELLSET

  • cylinderAnnulusToCell: Select all cells with cell centre within bounding cylinder annulus

cylinderAnnulusToCell (P1X P1Y P1Z) (P2X P2Y P2Z) OUTERRADIUS INNERRADIUS

  • cylinderToCell: Select all cells with cell centre within bounding cylinder

cylinderToCell (P1X P1Y P1Z) (P2X P2Y P2Z) RADIUS

  • faceToCell: Select cells that are the owner|neighbour|any of the faces in the faceSet or where all faces are in the faceSet

faceToCell FACESET neighbour|owner|any|all

  • faceZoneToCell: Select master or slave side of the faceZone. Note:accepts wildcards for zone.

faceZoneToCell ZONE master|slave

  • fieldToCell: Select all cells with field value >= min and <= max

fieldToCell FIELD MIN MAX

  • labelToCell: Select cells by cellLabel

labelToCell (I0 I1 .. In)

  • nbrToCell: Select all cells with only NNBR or less neighbouring cells

nbrToCell NNBR

  • nearestToCell: Select the nearest cell for each of the points PT0 .. PTN

nearestToCell (PT0 .. PTN)

  • pointToCell: Select all cells with any point in the pointSet

pointToCell POINTSET any

  • regionToCell: Select all cells in the connected region containing point. If started inside the subCellSet keeps to it; if started outside stays outside.

regionToCell SUBCELLSET (X Y Z)

  • rotatedBoxToCell: Select all cells with cellCentre within parallelopiped

rotatedBoxToCell (ORIGINX ORIGINY ORIGINZ) (IX IY IZ) (JX JY JZ) (KX KY KZ)

  • shapeToCell: Select all cells of given cellShape (splitHex hardcoded with internal angle < 10 degrees).

shapeToCell tet|pyr|prism|hex|tetWedge|wedge|splitHex

  • surfaceToCell: Select cells using a surface

surfaceToCell SURFACE OUTSIDEPOINTS CUT INSIDE OUTSIDE NEAR CURVATURE

SURFACE name of triSurface
OUTSIDEPOINTS list of points that define outside
CUT boolean whether to include cells cut by surface
INSIDE boolean whether to include cells inside surface
OUTSIDE boolean whether to include cells outside surface
NEAR scalar; include cells with centre <= near to surface
CURVATURE scalar; include cells close to strong curvature on surface (curvature defined as difference in surface normal at nearest point on surface for each vertex of cell)
  • zoneToCell: Select all cells of CELLZONE

zoneToCell CELLZONE

2.2 cellZoneSet sources

  • setToCellZone: Select all cells in the cellSet.

setToCellZone CELLSET

2.3 faceSet sources

  • boundaryToFace: Select all boundary faces

boundaryToFace

  • boxToFace: Select all face with faceCentre within bounding box

boxToFace ((MINX MINY MINZ) (MAXX MAXY MAXZ))

  • cellToFace: Select all faces of cells in the cellSet (all) or faces where both neighbours are in the cellSet (both)

cellToFace CELLSET all|both

  • faceToFace: Select all faces in the faceSet

faceToFace FACESET

  • labelToFace: Select faces by label

labelToFace (I0 I1 .. IN)

  • normalToFace: Select faces with normal aligned to unit vector (NX NY NZ) to within TOL

normalToFace (NX NY NZ) TOL

  • patchToFace: Select faces of the PATCH

patchToFace PATCH

  • pointToFace: Select faces with any point in the pointSet (any) or all points in the pointSet (all)

pointToFace POINTSET any|all

  • zoneToFace: Select all faces of FACEZONE

zoneToFace FACEZONE

2.4 faceZoneSet sources

  • faceZoneToFaceZone: Select all faces of FACEZONE

faceZoneToFaceZone FACEZONE

  • setsToFaceZone: Select all faces in the faceSet. Orientated so slave side is in cellSet.

setsToFaceZone FACESET SLAVECELLSET

  • setToFaceZone: Select all faces in the faceSet. Sets flipMap.

setToFaceZone FACESET

2.5 pointSet sources

  • boxToPoint: Select all points with coordinate within bounding box

boxToPoint ((MINX MINY MINZ) (MAXX MAXY MAXZ))

  • cellToPoint: Select all points of cells in the cellSet

cellToPoint CELLSET all

  • faceToPoint: Select all points of faces in the faceSet

faceToPoint FACESET all

  • labelToPoint: Select points by label

labelToPoint (I0 I1 .. IN)

  • nearestToPoint: Select the nearest point for each of the points PT0 ..PTN

nearestToPoint (PT0 .. PTN)

  • pointToPoint: Select all points in the pointSet

pointToPoint POINTSET

  • surfaceToPoint: Select point using a surface

surfaceToPoint SURFACE NEAR INSIDE OUTSIDE

SURFACE name of triSurface
NEAR scalar; include points with coordinate <= near to surface
INSIDE boolean whether to include points on the opposite side of surface normal
OUTSIDE boolean whether to include points on this side of the surface normal
  • zoneToPoint: Select all points of POINTZONE

zoneToPoint POINTZONE

2.6 pointZoneSet sources

  • setToPointZone: Select all points in the pointSet.

setToPointZone POINTSET

3 Usage

topoSet

or

topoSet myTopoSet.topoSet

results in sets stored in

/constants/polyMesh/sets