------------------------------------------------------------------------------
| 113 | } |
| 114 | //------------------------------------------------------------------------------ |
| 115 | vtkOverlappingAMR* GetAMRDataSet() |
| 116 | { |
| 117 | vtkNew<vtkOverlappingAMR> data; |
| 118 | int blocksPerLevel[2] = { 1, 3 }; |
| 119 | double globalOrigin[3] = { -2.0, -2.0, -2.0 }; |
| 120 | data->Initialize(2, blocksPerLevel); |
| 121 | data->SetOrigin(globalOrigin); |
| 122 | data->SetGridDescription(vtkStructuredData::VTK_STRUCTURED_XYZ_GRID); |
| 123 | |
| 124 | double origin[3]; |
| 125 | double h[3]; |
| 126 | int ndim[3]; |
| 127 | |
| 128 | // Root Block -- Block 0 |
| 129 | ndim[0] = 6; |
| 130 | ndim[1] = ndim[2] = 5; |
| 131 | h[0] = h[1] = h[2] = 1.0; |
| 132 | origin[0] = origin[1] = origin[2] = -2.0; |
| 133 | int blockId = 0; |
| 134 | int level = 0; |
| 135 | vtkSmartPointer<vtkUniformGrid> root; |
| 136 | root.TakeReference(AMRCommon::GetGrid(origin, h, ndim)); |
| 137 | vtkAMRBox box(origin, ndim, h, data->GetOrigin(), data->GetGridDescription()); |
| 138 | AttachPulseToGrid(root); |
| 139 | data->SetAMRBox(level, blockId, box); |
| 140 | data->SetDataSet(level, blockId, root); |
| 141 | |
| 142 | // Block 1 |
| 143 | ndim[0] = 3; |
| 144 | ndim[1] = ndim[2] = 5; |
| 145 | h[0] = h[1] = h[2] = 0.5; |
| 146 | origin[0] = origin[1] = origin[2] = -2.0; |
| 147 | blockId = 0; |
| 148 | level = 1; |
| 149 | vtkSmartPointer<vtkUniformGrid> grid1; |
| 150 | root.TakeReference(AMRCommon::GetGrid(origin, h, ndim)); |
| 151 | AttachPulseToGrid(grid1); |
| 152 | vtkAMRBox box1(origin, ndim, h, data->GetOrigin(), data->GetGridDescription()); |
| 153 | data->SetAMRBox(level, blockId, box1); |
| 154 | data->SetDataSet(level, blockId, grid1); |
| 155 | |
| 156 | // Block 2 |
| 157 | ndim[0] = 3; |
| 158 | ndim[1] = ndim[2] = 5; |
| 159 | h[0] = h[1] = h[2] = 0.5; |
| 160 | origin[0] = 0.0; |
| 161 | origin[1] = origin[2] = -1.0; |
| 162 | blockId = 1; |
| 163 | level = 1; |
| 164 | vtkSmartPointer<vtkUniformGrid> grid2; |
| 165 | grid2.TakeReference(AMRCommon::GetGrid(origin, h, ndim)); |
| 166 | AttachPulseToGrid(grid2); |
| 167 | vtkAMRBox box2(origin, ndim, h, data->GetOrigin(), data->GetGridDescription()); |
| 168 | data->SetAMRBox(level, blockId, box2); |
| 169 | data->SetDataSet(level, blockId, grid2); |
| 170 | |
| 171 | // Block 3 |
| 172 | ndim[0] = 3; |
no test coverage detected