MIDAS  0.75
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
oofem_main.cpp
Go to the documentation of this file.
1 #include "compiler.h"
2 //
3 #include "oofemtxtdatareader.h"
4 #include "util.h"
5 #include "oofemdef.h"
6 #include "usrdefsub.h"
7 #include "error.h"
8 #include "logger.h"
9 #include "contextioerr.h"
10 #include "oofem_terminate.h"
11 
12 // #ifndef __MAKEDEPEND
13 #include <stdio.h>
14 #include <string.h>
15 #include <new>
16 // #endif
17 
18 using namespace oofem;
19 //using namespace std;
20 
21 
22 int gPF = 0;
23 
24 /* Default oofem loggers */
25 Logger oofem::oofem_logger(Logger :: LOG_LEVEL_INFO, stdout);
26 Logger oofem::oofem_errLogger(Logger :: LOG_LEVEL_WARNING, stderr);
27 
28 
29 int oofem_main (bool rn, const char *inputFileName, const char *oname)
30 {
31 #ifndef _MSC_VER
32  //std :: set_new_handler(freeStoreError); // prevents memory overflow
33 #endif
34 
35  if (oname) {
36  oofem_logger.appendlogTo(oname);
37  // print header to redirected output
38  LOG_FORCED_MSG(oofem_logger, PRG_HEADER_SM);
39  }
40 
41 
42  //if (!inputFileName) errol;
43  OOFEMTXTDataReader dr((char *)inputFileName);
44  EngngModel *problem = :: InstanciateProblem(& dr, _processor, 0);
45  dr.finish();
46 
47 
48  problem->checkProblemConsistency();
49  problem->init();
50 
51  if (rn) problem->setRenumberFlag();
52 
53 
54  try {
55  problem->solveYourself();
56  }
57  catch ( OOFEM_Terminate &c ) {
58  delete problem;
59  return 1;
60  }
61 
62  problem->terminateAnalysis();
63  // oofem_errLogger.printStatistics();
64  delete problem;
65 
66  return 0;
67 }
int oofem_main(bool rn, const char *inputFileName, const char *oname)
Definition: oofem_main.cpp:29
int gPF
Definition: oofem_main.cpp:22