MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / setCellSet

Function setCellSet

src/fvOptions/cellSetOption/cellSetOption.C:92–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91
92void Foam::fv::cellSetOption::setCellSet()
93{
94 switch (selectionMode_)
95 {
96 case smPoints:
97 {
98 Info<< indent << "- selecting cells using points" << endl;
99
100 labelHashSet selectedCells;
101
102 forAll(points_, i)
103 {
104 label celli = mesh_.findCell(points_[i]);
105 if (celli >= 0)
106 {
107 selectedCells.insert(celli);
108 }
109
110 label globalCelli = returnReduce(celli, maxOp<label>());
111 if (globalCelli < 0)
112 {
113 WarningInFunction
114 << "Unable to find owner cell for point " << points_[i]
115 << endl;
116 }
117
118 }
119
120 cells_ = selectedCells.toc();
121
122 break;
123 }
124 case smCellSet:
125 {
126 Info<< indent
127 << "- selecting cells using cellSet " << cellSetName_ << endl;
128
129 cellSet selectedCells(mesh_, cellSetName_);
130 cells_ = selectedCells.toc();
131
132 break;
133 }
134 case smCellZone:
135 {
136 Info<< indent
137 << "- selecting cells using cellZone " << cellSetName_ << endl;
138
139 label zoneID = mesh_.cellZones().findZoneID(cellSetName_);
140 if (zoneID == -1)
141 {
142 FatalErrorInFunction
143 << "Cannot find cellZone " << cellSetName_ << endl
144 << "Valid cellZones are " << mesh_.cellZones().names()
145 << exit(FatalError);
146 }
147 cells_ = mesh_.cellZones()[zoneID];
148
149 break;

Callers 2

cellSetOption.CFile · 0.85
isActiveFunction · 0.85

Calls 8

returnReduceFunction · 0.85
forAllFunction · 0.50
exitFunction · 0.50
reduceFunction · 0.50
insertMethod · 0.45
nCellsMethod · 0.45
VMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected