diff --git a/include/ALL.hpp b/include/ALL.hpp index 1995258b4e2127a90a380b343b9f7c09e07b6c44..7852a5c71996ece2cd06009a50dc9e4c0c3b94d9 100644 --- a/include/ALL.hpp +++ b/include/ALL.hpp @@ -912,7 +912,8 @@ template <class T, class W> void ALL<T,W>::print_vtk_outlines(int step) work->SetNumberOfComponents(1); work->SetNumberOfTuples(1); work->SetName("work"); - work->SetValue(0, work_array->at(0)); + W total_work = std::accumulate(work_array->begin(),work_array->end(),(W)0); + work->SetValue(0, total_work); // determine extent of system W global_extent[6]; @@ -920,13 +921,33 @@ template <class T, class W> void ALL<T,W>::print_vtk_outlines(int step) W local_max[3]; W global_min[3]; W global_max[3]; + W width[3]; + W volume = (W)1.0; for(int i = 0; i < 3; ++i) { local_min[i] = outline->at(i); local_max[i] = outline->at(3+i); + width[i] = local_max[i] - local_min[i]; + volume *= width[i]; } + W surface = (W)2.0 * width[0] * width[1] + + (W)2.0 * width[1] * width[2] + + (W)2.0 * width[0] * width[2]; + + auto expanse = vtkSmartPointer<vtkFloatArray>::New(); + expanse->SetNumberOfComponents(6); + expanse->SetNumberOfTuples(1); + expanse->SetName("expanse"); + expanse->SetValue(0, width[0]); + expanse->SetValue(1, width[0]); + expanse->SetValue(2, width[0]); + expanse->SetValue(3, volume); + expanse->SetValue(4, surface); + expanse->SetValue(5, surface/volume); + + MPI_Allreduce(&local_min,&global_min,3,mpi_data_type_W,MPI_MIN,communicator); MPI_Allreduce(&local_max,&global_max,3,mpi_data_type_W,MPI_MAX,communicator); @@ -941,6 +962,7 @@ template <class T, class W> void ALL<T,W>::print_vtk_outlines(int step) unstructuredGrid->SetPoints(points); unstructuredGrid->SetCells(VTK_VOXEL, cellArray); unstructuredGrid->GetCellData()->AddArray(work); + unstructuredGrid->GetCellData()->AddArray(expanse);