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

Function InitializeLocalAMR

IO/CatalystConduit/vtkConduitToDataObject.cxx:163–185  ·  view source on GitHub ↗

--------------------- initialize AMR: each rank has same structure nb of Levels and nb of Blocks per level. init each bloc with nullptr

Source from the content-addressed store, hash-verified

161// nb of Levels and nb of Blocks per level.
162// init each bloc with nullptr
163void InitializeLocalAMR(GlobalInfo& globalInfo, vtkOverlappingAMR* amr)
164{
165 std::vector<int> blocksPerLevelGlobal(globalInfo.NbOfLevels, 0);
166 for (vtkIdType level = 0; level < globalInfo.NbOfLevels; level++)
167 {
168 for (int rank = 0; rank < globalInfo.NbOfProcesses; rank++)
169 {
170 blocksPerLevelGlobal[level] +=
171 globalInfo.BlocksPerLevelAndRank[level + rank * globalInfo.NbOfLevels];
172 }
173 }
174 amr->Initialize(globalInfo.NbOfLevels, blocksPerLevelGlobal.data());
175 for (int level = 0; level < globalInfo.NbOfLevels; ++level)
176 {
177 for (int block = 0; block < blocksPerLevelGlobal[level]; ++block)
178 {
179 amr->SetDataSet(level, block, nullptr);
180 }
181 }
182
183 // set origin
184 amr->SetOrigin(globalInfo.Origin);
185}
186
187// ---------------------
188// Fill local data

Callers 1

FillAMRMeshFunction · 0.85

Calls 4

InitializeMethod · 0.45
dataMethod · 0.45
SetDataSetMethod · 0.45
SetOriginMethod · 0.45

Tested by

no test coverage detected