Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "topology/Topology.h"
00012 #include "time.h"
00013 int main(int ac, char* av[])
00014 {
00015
00016
00017
00018
00019 Teuchos::CommandLineProcessor command_line_processor;
00020
00021 command_line_processor.setDocString("Test of barycentric subdivision.\n"
00022 "Reads in a mesh and applies the barycentric subdivision algorithm.\n"
00023 "Restricted to simplicial complexes.\n");
00024
00025 std::string input_file = "input.e";
00026 command_line_processor.setOption("input", &input_file, "Input File Name");
00027
00028 std::string output_file = "output.e";
00029 command_line_processor.setOption("output", &output_file, "Output File Name");
00030
00031
00032 command_line_processor.recogniseAllOptions(true);
00033
00034
00035 command_line_processor.throwExceptions(false);
00036
00037
00038 Teuchos::CommandLineProcessor::EParseCommandLineReturn parse_return =
00039 command_line_processor.parse(ac, av);
00040
00041 if (parse_return == Teuchos::CommandLineProcessor::PARSE_HELP_PRINTED) {
00042 return 0;
00043 }
00044
00045 if (parse_return != Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL) {
00046 return 1;
00047 }
00048
00049
00050
00051
00052
00053 Teuchos::GlobalMPISession mpiSession(&ac, &av);
00054
00055 LCM::Topology topology(input_file, output_file);
00056
00057
00058
00059
00060
00061
00062 std::cout << "***********************" << std::endl;
00063 std::cout << "Before mesh subdivision" << std::endl;
00064 std::cout << "***********************" << std::endl;
00065
00066
00067
00068
00069
00070 topology.removeNodeRelations();
00071
00072
00073 std::string gviz_output = "before.dot";
00074 topology.outputToGraphviz(gviz_output);
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 clock_t start, end;
00085 double cpu_time_used;
00086 start = clock();
00087
00088
00089 topology.barycentricSubdivision_();
00090
00091 end = clock();
00092 cpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC;
00093
00094 std::cout << "*************************" << std::endl;
00095 std::cout << "After element subdivision" << std::endl;
00096 std::cout << "*************************" << std::endl;
00097 gviz_output = "after.dot";
00098 topology.outputToGraphviz(gviz_output);
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123 return 0;
00124
00125 }
00126
00127
00128