-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXdmfGenerate.cxx
63 lines (50 loc) · 2.19 KB
/
XdmfGenerate.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*=========================================================================
Project : XdmfGenerator
Module : XdmfGenerate.cxx
Authors:
John Biddiscombe Jerome Soumagne
biddisco@cscs.ch soumagne@cscs.ch
Copyright (C) CSCS - Swiss National Supercomputing Centre.
You may use modify and and distribute this code freely providing
1) This copyright notice appears on all copies of source code
2) An acknowledgment appears with any substantial usage of the code
3) If this code is contributed to any other open source project, it
must not be reformatted such that the indentation, bracketing or
overall style is modified significantly.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This work has received funding from the European Community's Seventh
Framework Programme (FP7/2007-2013) under grant agreement 225967 “NextMuSE”
=========================================================================*/
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <sstream>
#include "XdmfGenerator.h"
int main(int argc, char *argv[])
{
if (argc < 3) {
printf("Usage: %s template_file hdf_file is_collection\n"
" template_file: path to file containing an Xdmf template description\n"
" hdf_file: path to an HDF file which has to be used by the Xdmf generator\n"
" is_collection: 0 or 1 (default): tell the generator to try to find other\n"
" hdf files in the same directory like the one already specified\n"
, argv[0]);
return EXIT_FAILURE;
}
XdmfGenerator *xdmfGenerator = new XdmfGenerator();
const char *lxdmfFileName = argv[1];
const char *hdfFileName = argv[2];
int isCollection = 0;
if (argc >= 4) {
isCollection = atoi(argv[3]);
}
if (isCollection) {
xdmfGenerator->GenerateTemporalCollection(lxdmfFileName, hdfFileName);
} else {
xdmfGenerator->Generate(lxdmfFileName, hdfFileName);
}
std::cout << xdmfGenerator->GetGeneratedFile() << std::endl;
delete xdmfGenerator;
return EXIT_SUCCESS;
}