Skip to content
Snippets Groups Projects

Feature/amalgamated

Closed Stephan Schulz requested to merge feature/amalgamated into refactor
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.
#include <string>
#include <vector>
#include <sys/stat.h>
#include <cerrno>
#ifdef ALL_VTK_OUTPUT
#include <vtkCellArray.h>
#include <vtkCellData.h>
@@ -651,6 +654,9 @@ public:
unstructuredGrid->GetCellData()->AddArray(rnk);
unstructuredGrid->GetCellData()->AddArray(tag);
if(!createDirectory("vtk_outline")) throw FilesystemErrorException(
__FILE__, __func__, __LINE__,
"Could not create output directory.");
std::ostringstream ss_local;
ss_local << "vtk_outline/ALL_vtk_outline_" << std::setw(7)
<< std::setfill('0') << step << "_" << local_rank << ".vtu";
@@ -795,6 +801,9 @@ public:
unstructuredGrid->GetCellData()->AddArray(work);
unstructuredGrid->GetCellData()->AddArray(cell);
if(!createDirectory("vtk_vertices")) throw FilesystemErrorException(
__FILE__, __func__, __LINE__,
"Could not create output directory.");
std::ostringstream filename;
filename << "vtk_vertices/ALL_vtk_vertices_" << std::setw(7)
<< std::setfill('0') << step << ".vtu";
@@ -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
/// non-updated work-loads to provide better results for the final vertex
/// positions
Loading