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

Method ProcessNode

Filters/HyperTree/vtkHyperTreeGridEvaluateCoarse.cxx:142–187  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

140
141//------------------------------------------------------------------------------
142void vtkHyperTreeGridEvaluateCoarse::ProcessNode(vtkHyperTreeGridNonOrientedCursor* outCursor)
143{
144 if (this->CheckAbort())
145 {
146 return;
147 }
148
149 vtkIdType currentId = outCursor->GetGlobalNodeIndex();
150
151 // Leaf/Masked cell: data does not change
152 if (outCursor->IsLeaf() || outCursor->IsMasked())
153 {
154 this->OutData->CopyData(this->InData, currentId, currentId);
155 return;
156 }
157
158 // Coarse cell: recurse and retrieve values
159 int nbArray = this->InData->GetNumberOfArrays();
160 std::vector<std::vector<std::vector<double>>> childrenValues(outCursor->GetNumberOfChildren());
161
162 for (int ichild = 0; ichild < outCursor->GetNumberOfChildren(); ++ichild)
163 {
164 this->ProcessChild(outCursor, ichild, childrenValues[ichild]);
165 }
166
167 // Reduction operation over the resulting array
168 for (int arrayId = 0; arrayId < nbArray; ++arrayId)
169 {
170 if (this->CheckAbort())
171 {
172 break;
173 }
174 vtkDataArray* arr = this->OutData->GetArray(arrayId);
175 int nbComponents = arr->GetNumberOfComponents();
176 for (int componentID = 0; componentID < nbComponents; ++componentID)
177 {
178 // Copy child values from every child array
179 std::vector<double> childVals(outCursor->GetNumberOfChildren(), 0.0);
180 for (unsigned char ichild = 0; ichild < outCursor->GetNumberOfChildren(); ichild++)
181 {
182 childVals[ichild] = childrenValues[ichild][arrayId][componentID];
183 }
184 arr->SetComponent(currentId, componentID, EvalCoarse(childVals));
185 }
186 }
187}
188
189//------------------------------------------------------------------------------
190void vtkHyperTreeGridEvaluateCoarse::ProcessChild(vtkHyperTreeGridNonOrientedCursor* outCursor,

Callers 2

ProcessTreesMethod · 0.95
ProcessChildMethod · 0.95

Calls 11

ProcessChildMethod · 0.95
CheckAbortMethod · 0.80
GetGlobalNodeIndexMethod · 0.45
IsLeafMethod · 0.45
IsMaskedMethod · 0.45
CopyDataMethod · 0.45
GetNumberOfArraysMethod · 0.45
GetNumberOfChildrenMethod · 0.45
GetArrayMethod · 0.45
GetNumberOfComponentsMethod · 0.45
SetComponentMethod · 0.45

Tested by

no test coverage detected