MCPcopy Create free account
hub / github.com/Kitware/VTK / MakeMesh

Method MakeMesh

IO/Geometry/vtkMFIXReader.cxx:211–600  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

209
210//------------------------------------------------------------------------------
211void vtkMFIXReader::MakeMesh(vtkUnstructuredGrid* output)
212{
213 output->Allocate();
214
215 if (this->MakeMeshFlag == 0)
216 {
217 // Points->SetNumberOfPoints((this->IMaximum2+1)
218 // *(this->JMaximum2+1)*(this->KMaximum2+1));
219
220 //
221 // Cartesian type mesh
222 //
223 if (!strcmp(this->CoordinateSystem, "CARTESIAN") && (this->KMaximum2 != 1))
224 {
225 double pointX = -this->Dx->GetValue(0);
226 double pointY = -this->Dy->GetValue(0);
227 double pointZ = -this->Dz->GetValue(0);
228 for (int k = 0; k <= this->KMaximum2; k++)
229 {
230 for (int j = 0; j <= this->JMaximum2; j++)
231 {
232 for (int i = 0; i <= this->IMaximum2; i++)
233 {
234 this->Points->InsertNextPoint(pointX, pointY, pointZ);
235 if (i == this->IMaximum2)
236 {
237 pointX = pointX + this->Dx->GetValue(i - 1);
238 }
239 else
240 {
241 pointX = pointX + this->Dx->GetValue(i);
242 }
243 }
244 pointX = -this->Dx->GetValue(0);
245 if (j == this->JMaximum2)
246 {
247 pointY = pointY + this->Dy->GetValue(j - 1);
248 }
249 else
250 {
251 pointY = pointY + this->Dy->GetValue(j);
252 }
253 }
254 pointY = -this->Dy->GetValue(0);
255 if (k == this->KMaximum2)
256 {
257 pointZ = pointZ + this->Dz->GetValue(k - 1);
258 }
259 else
260 {
261 pointZ = pointZ + this->Dz->GetValue(k);
262 }
263 }
264 }
265 else if (!strcmp(this->CoordinateSystem, "CARTESIAN") && (this->KMaximum2 == 1))
266 {
267 double pointX = -this->Dx->GetValue(0);
268 double pointY = -this->Dy->GetValue(0);

Callers 1

RequestDataMethod · 0.95

Calls 15

GetVariableAtTimestepMethod · 0.95
FillVectorVariableMethod · 0.95
SetScalarsMethod · 0.80
cosFunction · 0.50
sinFunction · 0.50
NewFunction · 0.50
AllocateMethod · 0.45
GetValueMethod · 0.45
InsertNextPointMethod · 0.45
SetPointsMethod · 0.45
SetIdMethod · 0.45

Tested by

no test coverage detected