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

Method Coarsen

Common/DataModel/vtkAMRBox.cxx:338–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336}
337
338void vtkAMRBox::Coarsen(int r)
339{
340 assert("pre: Input refinement ratio must be >= 2" && (r >= 2));
341 assert("pre: AMR Box instance is invalid" && !this->IsInvalid());
342
343 if (this->Empty())
344 {
345 std::cerr << "WARNING: tried refining an empty AMR box!\n";
346 std::cerr << "FILE:" << __FILE__ << std::endl;
347 std::cerr << "LINE:" << __LINE__ << std::endl;
348 std::cerr.flush();
349 return;
350 }
351 for (int q = 0; q < 3; ++q)
352 {
353 if (this->EmptyDimension(q))
354 {
355 continue;
356 }
357 this->LoCorner[q] =
358 ((this->LoCorner[q] < 0) ? -abs(this->LoCorner[q] + 1) / r - 1 : this->LoCorner[q] / r);
359 this->HiCorner[q] =
360 (this->HiCorner[q] < 0 ? -abs(this->HiCorner[q] + 1) / r - 1 : this->HiCorner[q] / r);
361 }
362 assert("post: Coarsened AMR box should not be empty!" && !this->Empty());
363 assert("post: Coarsened AMR Box instance is invalid" && !this->IsInvalid());
364}
365
366void vtkAMRBox::Refine(int r)
367{

Callers 5

GetGhostVectorMethod · 0.80
RemoveGhostsMethod · 0.80
GetCoarsenedAMRBoxMethod · 0.80

Calls 4

assertFunction · 0.50
absFunction · 0.50
EmptyMethod · 0.45
flushMethod · 0.45

Tested by 1