Skip to content
Snippets Groups Projects

Feature/amalgamated

3 files
+ 42
1
Compare changes
  • Side-by-side
  • Inline

Files

+ 22
0
@@ -49,6 +49,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -49,6 +49,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <string>
#include <string>
#include <vector>
#include <vector>
 
#include <sys/stat.h>
 
#include <cerrno>
 
#ifdef ALL_VTK_OUTPUT
#ifdef ALL_VTK_OUTPUT
#include <vtkCellArray.h>
#include <vtkCellArray.h>
#include <vtkCellData.h>
#include <vtkCellData.h>
@@ -651,6 +654,9 @@ public:
@@ -651,6 +654,9 @@ public:
unstructuredGrid->GetCellData()->AddArray(rnk);
unstructuredGrid->GetCellData()->AddArray(rnk);
unstructuredGrid->GetCellData()->AddArray(tag);
unstructuredGrid->GetCellData()->AddArray(tag);
 
if(!createDirectory("vtk_outline")) throw FilesystemErrorException(
 
__FILE__, __func__, __LINE__,
 
"Could not create output directory.");
std::ostringstream ss_local;
std::ostringstream ss_local;
ss_local << "vtk_outline/ALL_vtk_outline_" << std::setw(7)
ss_local << "vtk_outline/ALL_vtk_outline_" << std::setw(7)
<< std::setfill('0') << step << "_" << local_rank << ".vtu";
<< std::setfill('0') << step << "_" << local_rank << ".vtu";
@@ -795,6 +801,9 @@ public:
@@ -795,6 +801,9 @@ public:
unstructuredGrid->GetCellData()->AddArray(work);
unstructuredGrid->GetCellData()->AddArray(work);
unstructuredGrid->GetCellData()->AddArray(cell);
unstructuredGrid->GetCellData()->AddArray(cell);
 
if(!createDirectory("vtk_vertices")) throw FilesystemErrorException(
 
__FILE__, __func__, __LINE__,
 
"Could not create output directory.");
std::ostringstream filename;
std::ostringstream filename;
filename << "vtk_vertices/ALL_vtk_vertices_" << std::setw(7)
filename << "vtk_vertices/ALL_vtk_vertices_" << std::setw(7)
<< std::setfill('0') << step << ".vtu";
<< std::setfill('0') << step << ".vtu";
@@ -863,6 +872,19 @@ private:
@@ -863,6 +872,19 @@ private:
}
}
}
}
 
/// create directory if it does not already exist
 
/// @result int 0 on success 1 if directory could not be created
 
int createDirectory(const char *filename) {
 
errno = 0;
 
mode_t mode = S_IRWXU | S_IRWXG; // rwx for user and group
 
if(!mkdir(filename, mode)) {
 
if(errno == EEXIST) return 0;
 
return 1;
 
}
 
return 0;
 
}
 
 
/// limit for the estimation procedure, which is an experimental way to use
/// limit for the estimation procedure, which is an experimental way to use
/// non-updated work-loads to provide better results for the final vertex
/// non-updated work-loads to provide better results for the final vertex
/// positions
/// positions
Loading