labelToFace.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "labelToFace.H"
00030 #include "polyMesh.H"
00031
00032 #include "addToRunTimeSelectionTable.H"
00033
00034
00035
00036 namespace Foam
00037 {
00038
00039 defineTypeNameAndDebug(labelToFace, 0);
00040
00041 addToRunTimeSelectionTable(topoSetSource, labelToFace, word);
00042
00043 addToRunTimeSelectionTable(topoSetSource, labelToFace, istream);
00044
00045 }
00046
00047
00048 Foam::topoSetSource::addToUsageTable Foam::labelToFace::usage_
00049 (
00050 labelToFace::typeName,
00051 "\n Usage: labelToFace (i0 i1 .. in)\n\n"
00052 " Select faces by label\n\n"
00053 );
00054
00055
00056
00057
00058 void Foam::labelToFace::combine(topoSet& set, const bool add) const
00059 {
00060 forAll(labels_, labelI)
00061 {
00062 addOrDelete(set, labels_[labelI], add);
00063 }
00064 }
00065
00066
00067
00068
00069
00070 Foam::labelToFace::labelToFace
00071 (
00072 const polyMesh& mesh,
00073 const labelList& labels
00074 )
00075 :
00076 topoSetSource(mesh),
00077 labels_(labels)
00078 {}
00079
00080
00081
00082 Foam::labelToFace::labelToFace
00083 (
00084 const polyMesh& mesh,
00085 const dictionary& dict
00086 )
00087 :
00088 topoSetSource(mesh),
00089 labels_(dict.lookup("value"))
00090 {}
00091
00092
00093
00094 Foam::labelToFace::labelToFace
00095 (
00096 const polyMesh& mesh,
00097 Istream& is
00098 )
00099 :
00100 topoSetSource(mesh),
00101 labels_(checkIs(is))
00102 {}
00103
00104
00105
00106
00107 Foam::labelToFace::~labelToFace()
00108 {}
00109
00110
00111
00112
00113 void Foam::labelToFace::applyToSet
00114 (
00115 const topoSetSource::setAction action,
00116 topoSet& set
00117 ) const
00118 {
00119 if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD))
00120 {
00121 Info<< " Adding faces mentioned in dictionary" << " ..." << endl;
00122
00123 combine(set, true);
00124 }
00125 else if (action == topoSetSource::DELETE)
00126 {
00127 Info<< " Removing faces mentioned dictionary" << " ..." << endl;
00128
00129 combine(set, false);
00130 }
00131 }
00132
00133
00134
Copyright © 2000-2009 OpenCFD Ltd