Difference between revisions of "SetSet"

From OpenFOAMWiki
m
m
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
setSet is a utility that collects points, faces and cells in sets, based on different criteria, for later usage with different other utilities like subSetMesh.{{VersionInfo}}{{Version1.5-dev}}
+
==Name==
 +
<tt>setSet</tt> - Manipulate a cell/face/point/ set or zone interactively.
 +
 
 +
{{VersionInfo}}{{Version2.1}}
 +
 
 +
==Synopsis==
 +
setSet [OPTIONS]
 +
 
 +
==Description==
 +
setSet is a command-line utility that collects points, faces and cells in sets, based on different criteria, for later usage with different other utilities like [[subsetMesh]].
 +
The defined sets are written in VTK format in the case folder (except if the option '''-noVTK''' is specified).
 +
 
 +
The syntax used by setSet is described below.
 +
 
 +
'''-batch''' ''FILE''
 +
:Process in batch mode, using input from specified file
 +
'''-loop'''
 +
:Execute batch commands for all timesteps
 +
'''-noSync'''
 +
:No synchronised selection across coupled patches
 +
'''-noVTK'''
 +
:Skip writing the VTK files
 +
 
 +
'''-noZero'''
 +
:Exclude the ''0'' directory from the times list
 +
'''-time''' ''RANGES''
 +
:Select time steps. ''RANGES'' follows the [[Tip_Advanced_Time_Selection_Options | time selection rules]]
 +
'''-latestTime'''
 +
:Apply only on the latest time available
 +
'''-constant'''
 +
:Include the ''constant'' directory in the times list
 +
 
 +
'''-parallel'''
 +
:Run the utility in parallel
 +
'''-roots''' ''"(DIR1 [...DIRN])"''
 +
:Directories through which the data are distributed
 +
'''-region''' ''NAME''
 +
:Specify a mesh region by its ''NAME''
 +
 
 +
'''-case''' ''DIR''
 +
:Execute the command on the case directory ''DIR''. If not provided, use the current directory
 +
'''-noFunctionObjects'''
 +
:Skip the execution of the [[functionObjects]]
 +
'''-help'''
 +
:Display the help and exit
 +
 
 +
This utility is used in the following tutorial:
 +
* lagrangian/reactingParcelFilmFoam/cylinder
 +
 
 +
==Command line usage==
 +
In command-line, setSet understands 5 commands:
 +
* <tt>help</tt>: Print out a help describing the structure of a ''set-command''
 +
* <tt>list</tt>: Show all currently defined sets and zones based on cells, faces and points.
 +
* <tt>time ''double''</tt>: Switch to the provided time step
 +
* <tt>quit</tt>: Exit setSet
 +
* a ''set-command'': create/modify/remove a cell/face/point set or cell/face/point zone
 +
 
 +
The structure of a ''set-command'' is
 +
''type''Set|''type''ZoneSet ''setName'' ''action''
 +
 
 +
*''type'' is the type of entity you want to select:<tt>cell</tt>, <tt>face</tt> or <tt>point</tt>
 +
*''setName'' name of the set you want to create/modify/remove
 +
*''action'' can be
 +
** <tt>list</tt>: Print the coordinates contained in the set
 +
** <tt>clear</tt>: Clear the set (clear its content)
 +
** <tt>invert</tt>: Invert the set (select all entities of the mesh that where not in the set)
 +
** <tt>remove</tt>: Remove the set
 +
** <tt>new ''source''</tt>: Set the set using the prescribed ''source''
 +
** <tt>add ''source''</tt>: Add the entities select by the ''source'' to the set
 +
** <tt>delete ''source''</tt>: Delete the entities select by the ''source'' from the set
 +
** <tt>subset ''source''</tt>: Combines the current set with the entities selected by the ''source''
 +
 
 +
The ''sources'' available depend on the type of entities. An exhaust list of the sources is available within the documentation of [[topoSet]].
 +
 
 +
Here are some examples provided in the official help:
 +
 
 +
*Pick up all faces of patch:
 +
faceSet f0 new patchToFace movingWall
 +
*Add faces 0,1,2:
 +
faceSet f0 add labelToFace (0 1 2)
 +
*Pick up all points used by faces in faceSet f0:
 +
pointSet p0 new faceToPoint f0 all
 +
*Pick up cell which has any face in f0:
 +
cellSet c0 new faceToCell f0 any
 +
*Add cells which have any point in p0:
 +
cellSet c0 add pointToCell p0 any
 +
*List set:
 +
cellSet c0 list
 +
*Zones can be set using zoneSets from corresponding sets:
 +
cellZoneSet c0Zone new setToCellZone c0
 +
faceZoneSet f0Zone new setToFaceZone f0
 +
 
 +
==Usage example==
 +
 
 +
{{VersionInfo}}{{Version1.5}}
  
 
Following is an example of the usage to fix an imported mesh that has small faults.
 
Following is an example of the usage to fix an imported mesh that has small faults.
Line 21: Line 115:
 
  Command>cellSet bubu subset
 
  Command>cellSet bubu subset
 
  Command>quit
 
  Command>quit
 +
</div>
 +
Last step is to remove the collected cells:
 +
<div align=left>
 
  foamJob -s subsetMesh bubu
 
  foamJob -s subsetMesh bubu
 
</div>
 
</div>
 +
 +
 +
[[Category:Mesh manipulation utilities]]

Latest revision as of 09:05, 7 May 2014

1 Name

setSet - Manipulate a cell/face/point/ set or zone interactively.

Valid versions: OF Version 21.png

2 Synopsis

setSet [OPTIONS]

3 Description

setSet is a command-line utility that collects points, faces and cells in sets, based on different criteria, for later usage with different other utilities like subsetMesh. The defined sets are written in VTK format in the case folder (except if the option -noVTK is specified).

The syntax used by setSet is described below.

-batch FILE

Process in batch mode, using input from specified file

-loop

Execute batch commands for all timesteps

-noSync

No synchronised selection across coupled patches

-noVTK

Skip writing the VTK files

-noZero

Exclude the 0 directory from the times list

-time RANGES

Select time steps. RANGES follows the time selection rules

-latestTime

Apply only on the latest time available

-constant

Include the constant directory in the times list

-parallel

Run the utility in parallel

-roots "(DIR1 [...DIRN])"

Directories through which the data are distributed

-region NAME

Specify a mesh region by its NAME

-case DIR

Execute the command on the case directory DIR. If not provided, use the current directory

-noFunctionObjects

Skip the execution of the functionObjects

-help

Display the help and exit

This utility is used in the following tutorial:

  • lagrangian/reactingParcelFilmFoam/cylinder

4 Command line usage

In command-line, setSet understands 5 commands:

  • help: Print out a help describing the structure of a set-command
  • list: Show all currently defined sets and zones based on cells, faces and points.
  • time double: Switch to the provided time step
  • quit: Exit setSet
  • a set-command: create/modify/remove a cell/face/point set or cell/face/point zone

The structure of a set-command is

typeSet|typeZoneSet setName action
  • type is the type of entity you want to select:cell, face or point
  • setName name of the set you want to create/modify/remove
  • action can be
    • list: Print the coordinates contained in the set
    • clear: Clear the set (clear its content)
    • invert: Invert the set (select all entities of the mesh that where not in the set)
    • remove: Remove the set
    • new source: Set the set using the prescribed source
    • add source: Add the entities select by the source to the set
    • delete source: Delete the entities select by the source from the set
    • subset source: Combines the current set with the entities selected by the source

The sources available depend on the type of entities. An exhaust list of the sources is available within the documentation of topoSet.

Here are some examples provided in the official help:

  • Pick up all faces of patch:
faceSet f0 new patchToFace movingWall
  • Add faces 0,1,2:
faceSet f0 add labelToFace (0 1 2)
  • Pick up all points used by faces in faceSet f0:
pointSet p0 new faceToPoint f0 all
  • Pick up cell which has any face in f0:
cellSet c0 new faceToCell f0 any
  • Add cells which have any point in p0:
cellSet c0 add pointToCell p0 any
  • List set:
cellSet c0 list
  • Zones can be set using zoneSets from corresponding sets:
cellZoneSet c0Zone new setToCellZone c0
faceZoneSet f0Zone new setToFaceZone f0

5 Usage example

Valid versions: OF version 15.png

Following is an example of the usage to fix an imported mesh that has small faults.

Figure 1. Domain overview

Running checkMesh on this geometry:

foamJob -s checkMesh -allTopology -allGeometry

generates some warnings and errors, but most important, several sets: cellZone_1, cellZone_2, concaveFaces, edgeFaces, nearPoints, nonOrthoFaces, skewFaces, undedeterminedCells, warpedFaces, wrongOrientedFaces. The next step is to collect all the cells that contain any of the concave faces, incorrect edge faces, warped faces, wrong oriented faces, or cells with a very small determinant:

foamJob -s setSet -constant
Command>list
Command>cellSet bubu new cellToCell underdeterminedCells any
Command>list
Command>cellSet bubu add faceToCell concaveFaces any
Command>cellSet bubu add faceToCell edgeFaces any
Command>cellSet bubu add faceToCell warpedFaces any
Command>cellSet bubu add faceToCell wrongOrientedFaces any
Command>cellSet bubu invert
Command>cellSet bubu subset
Command>quit

Last step is to remove the collected cells:

foamJob -s subsetMesh bubu