Flow123d  jenkins-Flow123d-windows32-release-multijob-28
main.cc
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2007 Technical University of Liberec. All rights reserved.
4  *
5  * Please make a following refer to Flow123d on your project site if you use the program for any purpose,
6  * especially for academic research:
7  * Flow123d, Research Centre: Advanced Remedial Technologies, Technical University of Liberec, Czech Republic
8  *
9  * This program is free software; you can redistribute it and/or modify it under the terms
10  * of the GNU General Public License version 3 as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along with this program; if not,
17  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 021110-1307, USA.
18  *
19  *
20  * $Id$
21  * $Revision$
22  * $LastChangedBy$
23  * $LastChangedDate$
24  *
25  * @file main.cc
26  * @brief This file should contain only creation of Application object.
27  *
28  */
29 
30 
31 #include <petsc.h>
32 
33 #include "system/system.hh"
34 #include "system/sys_profiler.hh"
35 #include "system/python_loader.hh"
37 #include "input/input_type.hh"
38 #include "input/type_output.hh"
39 #include "input/accessors.hh"
40 #include "input/json_to_storage.hh"
41 //#include "io/output.h"
42 
43 #include <iostream>
44 #include <fstream>
45 #include <boost/program_options/parsers.hpp>
46 #include <boost/program_options/variables_map.hpp>
47 #include <boost/program_options/options_description.hpp>
48 
49 #include "main.h"
50 //#include "io/read_ini.h"
51 
52 #include "rev_num.h"
53 
54 /// named version of the program
55 #define _PROGRAM_VERSION_ "0.0.0"
56 
57 #ifndef _PROGRAM_REVISION_
58  #define _PROGRAM_REVISION_ "(unknown revision)"
59 #endif
60 
61 #ifndef _PROGRAM_BRANCH_
62  #define _PROGRAM_BRANCH_ "(unknown branch)"
63 #endif
64 
65 #ifndef _COMPILER_FLAGS_
66  #define _COMPILER_FLAGS_ "(unknown compiler flags)"
67 #endif
68 
69 //static void main_convert_to_output();
70 
71 
72 namespace it = Input::Type;
73 
74 // this should be part of a system class containing all support information
75 //static Record system_rec("System", "Record with general support data.");
76 //system_rec.finish();
78  = it::Record("Root", "Root record of JSON input for Flow123d.")
79  //main_rec.declare_key("system", system_rec, "");
81  "Simulation problem to be solved.")
82  .declare_key("pause_after_run", it::Bool(), it::Default("false"),
83  "If true, the program will wait for key press before it terminates.");
84 // .declare_key("output_streams", it::Array( OutputTime::input_type ),
85 // "Array of formated output streams to open.");
86 
87 
88 
89 Application::Application( int argc, char ** argv)
90 : ApplicationBase(argc, argv),
91  main_input_dir_("."),
92  main_input_filename_(""),
93  passed_argc_(0),
94  passed_argv_(0),
95  use_profiler(true)
96 {
97  // initialize python stuff if we have
98  // nonstandard python home (release builds)
99 #ifdef HAVE_PYTHON
100  PythonLoader::initialize(argv[0]);
101 #endif
102 
103 }
104 
105 
106 void Application::split_path(const string& path, string& directory, string& file_name) {
107 
108  size_t delim_pos=path.find_last_of(DIR_DELIMITER);
109  if (delim_pos < string::npos) {
110 
111  // It seems, that there is some path in fname ... separate it
112  directory =path.substr(0,delim_pos);
113  file_name =path.substr(delim_pos+1); // till the end
114  } else {
115  directory = ".";
116  file_name = path;
117  }
118 }
119 
121  // Say Hello
122  // make strings from macros in order to check type
123  string version(_VERSION_NAME_);
124  string revision(_GIT_REVISION_);
125  string branch(_GIT_BRANCH_);
126  string url(_GIT_URL_);
127  string build = string(__DATE__) + ", " + string(__TIME__) + " flags: " + string(_COMPILER_FLAGS_);
128 
129 
130  xprintf(Msg, "This is Flow123d, version %s revision: %s\n", version.c_str(), revision.c_str());
131  xprintf(Msg,
132  "Branch: %s\n"
133  "Build: %s\n"
134  "Fetch URL: %s\n",
135  branch.c_str(), build.c_str() , url.c_str() );
136  Profiler::instance()->set_program_info("Flow123d", version, branch, revision, build);
137 }
138 
139 
140 
142  if (main_input_filename_ == "") {
143  cout << "Usage error: The main input file has to be specified through -s parameter.\n\n";
144  cout << program_arguments_desc_ << "\n";
145  exit( exit_failure );
146  }
147 
148  // read main input file
150  std::ifstream in_stream(fname.c_str());
151  if (! in_stream) {
152  xprintf(UsrErr, "Can not open main input file: '%s'.\n", fname.c_str());
153  }
154  try {
155  Input::JSONToStorage json_reader(in_stream, input_type );
157  } catch (Input::JSONToStorage::ExcInputError &e ) {
158  e << Input::JSONToStorage::EI_File(fname); throw;
159  } catch (Input::JSONToStorage::ExcNotJSONFormat &e) {
160  e << Input::JSONToStorage::EI_File(fname); throw;
161  }
162 
163  return root_record;
164 }
165 
166 
167 
168 
169 void Application::parse_cmd_line(const int argc, char ** argv) {
170  namespace po = boost::program_options;
171 
172 
173  // Declare the supported options.
174  po::options_description desc("Allowed options");
175  desc.add_options()
176  ("help", "produce help message")
177  ("solve,s", po::value< string >(), "Main input file to solve.")
178  ("input_dir,i", po::value< string >()->default_value("input"), "Directory for the ${INPUT} placeholder in the main input file.")
179  ("output_dir,o", po::value< string >()->default_value("output"), "Directory for all produced output files.")
180  ("log,l", po::value< string >()->default_value("flow123"), "Set base name for log files.")
181  ("version", "Display version and build information and exit.")
182  ("no_log", "Turn off logging.")
183  ("no_profiler", "Turn off profiler output.")
184  ("full_doc", "Prints full structure of the main input file.")
185  ("JSON_template", "Prints description of the main input file as a valid CON file.")
186  ("latex_doc", "Prints description of the main input file in Latex format using particular macros.")
187  ("JSON_machine", "Prints full structure of the main input file as a valid CON file.")
188  ("petsc_redirect", po::value<string>(), "Redirect all PETSc stdout and stderr to given file.");
189 
190  ;
191 
192  // parse the command line
193  po::variables_map vm;
194  po::parsed_options parsed = po::basic_command_line_parser<char>(argc, argv).options(desc).allow_unregistered().run();
195  po::store(parsed, vm);
196  po::notify(vm);
197 
198  // get unknown options
199  vector<string> to_pass_further = po::collect_unrecognized(parsed.options, po::include_positional);
200  passed_argc_ = to_pass_further.size();
201  passed_argv_ = new char * [passed_argc_+1];
202 
203  // first copy the program executable in argv[0]
204  int arg_i=0;
205  if (argc > 0) passed_argv_[arg_i++] = xstrcpy( argv[0] );
206 
207  for(int i=0; i < passed_argc_; i++) {
208  passed_argv_[arg_i++] = xstrcpy( to_pass_further[i].c_str() );
209  }
210  passed_argc_ = arg_i;
211 
212  // if there is "help" option
213  if (vm.count("help")) {
214  cout << desc << "\n";
215  exit( exit_output );
216  }
217 
218  if (vm.count("version")) {
219  display_version();
220  exit( exit_output );
221  }
222 
223  // if there is "full_doc" option
224  if (vm.count("full_doc")) {
226  Input::Type::OutputText type_output(&input_type);
227  type_output.set_filter(":Field:.*");
228  cout << type_output;
229  exit( exit_output );
230  }
231 
232  if (vm.count("JSON_template")) {
235  exit( exit_output );
236  }
237 
238  if (vm.count("latex_doc")) {
240  Input::Type::OutputLatex type_output(&input_type);
241  type_output.set_filter("");
242  cout << type_output;
243  exit( exit_output );
244  }
245 
246  if (vm.count("JSON_machine")) {
249  exit( exit_output );
250  }
251 
252  if (vm.count("petsc_redirect")) {
253  this->petsc_redirect_file_ = vm["petsc_redirect"].as<string>();
254  }
255 
256  // if there is "solve" option
257  if (vm.count("solve")) {
258  string input_filename = vm["solve"].as<string>();
260  }
261 
262  // possibly turn off profilling
263  if (vm.count("no_profiler")) use_profiler=false;
264 
265  string input_dir;
266  string output_dir;
267  if (vm.count("input_dir")) {
268  input_dir = vm["input_dir"].as<string>();
269  }
270  if (vm.count("output_dir")) {
271  output_dir = vm["output_dir"].as<string>();
272  }
273 
274  // assumes working directory "."
275  FilePath::set_io_dirs(".", main_input_dir_, input_dir, output_dir );
276 
277  if (vm.count("log")) {
278  this->log_filename_ = vm["log"].as<string>();
279  }
280 
281  if (vm.count("no_log")) {
282  this->log_filename_="//"; // override; do not open log files
283  }
284 
285  ostringstream tmp_stream(program_arguments_desc_);
286  tmp_stream << desc;
287  // TODO: catch specific exceptions and output usage messages
288 }
289 
290 
291 
292 
293 
295  //use_profiler=true;
296 
297 
298  display_version();
299 
300  Input::Record i_rec = read_input();
301 
302 
303  {
304  using namespace Input;
305 
306  // get main input record handle
307 
308  // should flow123d wait for pressing "Enter", when simulation is completed
309  sys_info.pause_after_run = i_rec.val<bool>("pause_after_run");
310  // read record with problem configuration
311  Input::AbstractRecord i_problem = i_rec.val<AbstractRecord>("problem");
312 
313  if (i_problem.type() == HC_ExplicitSequential::input_type ) {
314 
315  HC_ExplicitSequential *problem = new HC_ExplicitSequential(i_problem);
316 
317  // run simulation
318  problem->run_simulation();
319 
320  delete problem;
321  } else {
322  xprintf(UsrErr,"Problem type not implemented.");
323  }
324 
325  }
326 }
327 
328 
329 
330 
333  printf("\nPress <ENTER> for closing the window\n");
334  getchar();
335  }
336 }
337 
338 
339 
340 
343  Profiler::instance()->output(PETSC_COMM_WORLD);
345  }
346 }
347 
348 
349 //=============================================================================
350 
351 /**
352  * FUNCTION "MAIN"
353  */
354 int main(int argc, char **argv) {
355  try {
356  Application app(argc, argv);
357  app.init(argc, argv);
358  } catch (std::exception & e) {
359  std::cerr << e.what();
361  } catch (...) {
362  std::cerr << "Unknown exception" << endl;
364  }
365 
366  // Say Goodbye
368 }
369 
370 
371 
372 
373 
374 
375 
376 
377 
378 
379 
380 
381 
382 
383 
384 
385 
386 
387 
388 
389 
390 
391 
392 
393 
394 
395 
396 
397 
398 
399 /**
400  * FUNCTION "MAIN" FOR CONVERTING FILES TO POS
401  */
402 /*void main_convert_to_output() {
403  // TODO: implement output of input data fields
404  // Fields to output:
405  // 1) volume data (simple)
406  // sources (Darcy flow and transport), initial condition, material id, partition id
407  // 2) boundary data (needs "virtual fractures" in output mesh)
408  // flow and transport bcd
409 
410  xprintf(Err, "Not implemented yet in this version\n");
411 }*/
412 #if 0
413 /**
414  * FUNCTION "MAIN" FOR COMPUTING MIXED-HYBRID PROBLEM
415  */
416 void main_compute_mh(struct Problem *problem) {
417  int type=OptGetInt("Global", "Problem_type", NULL);
418  switch (type) {
419  case STEADY_SATURATED:
420  main_compute_mh_steady_saturated(problem);
421  break;
422  case UNSTEADY_SATURATED:
423  main_compute_mh_unsteady_saturated(problem);
424  break;
425  case PROBLEM_DENSITY:
426  // main_compute_mh_density(problem);
427  break;
428  default:
429  xprintf(UsrErr,"Unsupported problem type: %d.",type);
430  }
431 }
432 
433 /**
434  * FUNCTION "MAIN" FOR COMPUTING MIXED-HYBRID PROBLEM FOR UNSTEADY SATURATED FLOW
435  */
436 void main_compute_mh_unsteady_saturated(struct Problem *problem)
437 {
438 
439  const string& mesh_file_name = IONameHandler::get_instance()->get_input_file_name(OptGetStr("Input", "Mesh", NULL));
440  MeshReader* meshReader = new GmshMeshReader();
441 
442  Mesh* mesh = new Mesh();
443  meshReader->read(mesh_file_name, mesh);
444  mesh->setup_topology();
445  mesh->setup_materials(* problem->material_database);
446  Profiler::instance()->set_task_size(mesh->n_elements());
447  OutputTime *output_time;
448  TimeMarks * main_time_marks = new TimeMarks();
449  int i;
450 
451  // setup output
452  string output_file = IONameHandler::get_instance()->get_output_file_name(OptGetFileName("Output", "Output_file", "\\"));
453  output_time = new OutputTime(mesh, output_file);
454 
455  DarcyFlowMH *water = new DarcyFlowLMH_Unsteady(main_time_marks,mesh, problem->material_database);
456  DarcyFlowMHOutput *water_output = new DarcyFlowMHOutput(water);
457  const TimeGovernor &water_time=water->get_time();
458 
459  // set output time marks
460  TimeMark::Type output_mark_type = main_time_marks->new_strict_mark_type();
461  main_time_marks->add_time_marks(0.0, OptGetDbl("Global", "Save_step", "1.0"), water_time.end_time(), output_mark_type );
462 
463  while (! water_time.is_end()) {
464  water->compute_one_step();
465  water_output->postprocess();
466 
467  if ( main_time_marks->is_current(water_time, output_mark_type) ) {
468  output_time->get_data_from_mesh();
469  // call output_time->register_node_data(name, unit, 0, data) to register other data on nodes
470  // call output_time->register_elem_data(name, unit, 0, data) to register other data on elements
471  output_time->write_data(water_time.t());
472  output_time->free_data_from_mesh();
473  }
474  }
475 }
476 
477 /**
478  * FUNCTION "MAIN" FOR COMPUTING MIXED-HYBRID PROBLEM FOR STEADY SATURATED FLOW
479  */
480 void main_compute_mh_steady_saturated(struct Problem *problem)
481 {
482  const string& mesh_file_name = IONameHandler::get_instance()->get_input_file_name(OptGetStr("Input", "Mesh", NULL));
483  MeshReader* meshReader = new GmshMeshReader();
484 
485  Mesh* mesh = new Mesh();
486  meshReader->read(mesh_file_name, mesh);
487  mesh->setup_topology();
488  mesh->setup_materials(* problem->material_database);
489  Profiler::instance()->set_task_size(mesh->n_elements());
490 
491  TimeMarks * main_time_marks = new TimeMarks();
492 
493  /*
494  Mesh* mesh;
495  ElementIter elm;
496  struct Side *sde;
497  FILE *out;
498  int i;
499  mesh=problem->mesh;
500  */
501 
502  problem->water=new DarcyFlowMH_Steady(main_time_marks, mesh, problem->material_database);
503  // Pointer at Output should be in this object
504  DarcyFlowMHOutput *water_output = new DarcyFlowMHOutput(problem->water);
505 
506  problem->water->compute_one_step();
507 
508  if (OptGetBool("Transport", "Transport_on", "no") == true) {
509  problem->otransport = new ConvectionTransport(problem->material_database, mesh);
510  problem->transport_os = new TransportOperatorSplitting(problem->material_database, mesh);
511  }
512 
513 
514  water_output->postprocess();
515 
516  /* Write static data to output file */
517  string out_fname = IONameHandler::get_instance()->get_output_file_name(OptGetFileName("Output", "Output_file", NULL));
518  Output *output = new Output(mesh, out_fname);
519  output->get_data_from_mesh();
520  // call output->register_node_data(name, unit, data) here to register other data on nodes
521  // call output->register_elem_data(name, unit, data) here to register other data on elements
522  output->write_data();
523  output->free_data_from_mesh();
524  delete output;
525 
526  // pracovni vystup nekompatibilniho propojeni
527  // melo by to byt ve water*
528  /*
529  {
530  ElementIter ele;
531  Element *ele2;
532  int ngi;
533  Neighbour *ngh;
534  Mesh* mesh = problem->mesh;
535 
536  double sum1,sum2;
537  DarcyFlowMH *w=problem->water;
538  double *x = w->schur0->vx;
539 
540 
541  FOR_ELEMENTS_IT( ele ) {
542  FOR_ELM_NEIGHS_VV( ele, ngi ) {
543  ngh = ele->neigh_vv[ ngi ];
544  // get neigbour element, and set appropriate column
545  ele2 = ( ngh->element[ 0 ] == &(*ele) ) ? ngh->element[ 1 ] : ngh->element[ 0 ];
546 
547  double out_flux=0.0;
548  for(i=0;i<=ele->dim;i++) out_flux+=x[w->side_row_4_id[ele->side[i]->id]];
549  xprintf(Msg,"El 1 (%f,%f) %d %f %g\n",
550  ele->centre[0],
551  ele->centre[1],
552  ele->dim,
553  x[w->el_row_4_id[ele->id]],out_flux);
554 
555  out_flux=0.0;
556  for(i=0;i<=ele2->dim;i++) out_flux+=x[w->side_row_4_id[ele2->side[i]->id]];
557 
558  xprintf(Msg,"El 2 (%f,%f) %d %f %g\n",
559  ele2->centre[0],
560  ele2->centre[1],
561  ele2->dim,
562  x[w->el_row_4_id[ele2->id]],out_flux);
563  }
564  }
565  }
566 
567  out = xfopen("pepa.txt","wt");
568 
569  FOR_ELEMENTS(elm)
570  elm->aux = 0;
571 
572  FOR_ELEMENTS(elm)
573  FOR_ELEMENT_SIDES(elm,i)
574  if(elm->side[i]->type == EXTERNAL)
575  if((elm->side[i]->centre[2] - elm->centre[2]) > 0.0)
576  if(elm->side[i]->normal[2] != 0.0)
577  if((elm->side[i]->centre[2]) > 300.0)
578  if((elm->material->id == 2200) || (elm->material->id == 2207) || (elm->material->id == 2212) || (elm->material->id == 2217) || (elm->material->id == 9100) || (elm->material->id == 9107) || (elm->material->id == 9112) || (elm->material->id == 9117))
579  elm->aux = 1;
580 
581  FOR_ELEMENTS(elm)
582  if(elm->aux == 1)
583  xfprintf(out,"%d\n",elm->id);
584 
585  xfclose(out);
586  */
587 
588  if (OptGetBool("Transport", "Transport_on", "no") == true) {
589  problem->otransport->convection();
590  }
591 
592  /*
593  if (OptGetBool("Transport", "Reactions", "no") == true) {
594  read_reaction_list(transport);
595  }
596 */
597  //if (rank == 0) {
598 
599  //}
600 
601  // TODO: there is an uncoditioned jump in open_temp_files
602  // also this function should be moved to btc.*
603  // btc should be documented and have an clearly defined interface
604  // not strictly dependent on Transport.
605  //btc_check(transport);
606 
607 
608 
609  /*
610  if(problem->cross_section == true)
611  {
612  elect_cross_section_element(problem);
613  output_transport_init_CS(problem);
614  output_transport_time_CS(problem, 0 * problem->time_step);
615  }
616  */
617 }
618 //-----------------------------------------------------------------------------
619 // vim: set cindent:
620 //-----------------------------------------------------------------------------
621 #endif
622 #if 0
623 
624 /**
625  * FUNCTION "MAIN" FOR COMPUTING MIXED-HYBRID PROBLEM FOR UNSTEADY SATURATED FLOW
626  */
627 void main_compute_mh_density(struct Problem *problem)
628 {
629  Mesh* mesh = (Mesh*) ConstantDB::getInstance()->getObject(MESH::MAIN_INSTANCE);
630  int i, j, dens_step, n_step, frame = 0, rank;
631  double save_step, stop_time; // update_dens_time
632  char statuslog[255];
633  FILE *log;
634  OutputTime *output_time = NULL;
635 
636  MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
637 
638 /*
639  transport_output_init(problem->otransport->transport_out_fname);
640  transport_output(problem->otransport->out_conc,problem->otransport->substance_name ,problem->otransport->n_substances, 0.0, ++frame,problem->otransport->transport_out_fname);
641 */
642 
643  if(rank == 0) {
644  output_time = new OutputTime(mesh, problem->otransport->transport_out_fname);
645  }
646 
647  //save_step = problem->save_step;
648  //stop_time = problem->stop_time;
649  //trans->update_dens_time = problem->save_step / (ceil(problem->save_step / trans->dens_step));
650  //dens_step = (int) ceil(problem->stop_time / trans->update_dens_time);
651  //n_step = (int) (problem->save_step / trans->update_dens_time);
652 
653  // DF problem - I don't understend to this construction !!!
654  //problem->save_step = problem->stop_time = trans->update_dens_time;
655 
656 
657  /*
658 
659 
660 
661  //------------------------------------------------------------------------------
662  // Status LOG head
663  //------------------------------------------------------------------------------
664  //sprintf( statuslog,"%s.txt",problem->log_fname);
665  sprintf(statuslog, "density_log.txt");
666  log = xfopen(statuslog, "wt");
667 
668  xfprintf(log, "Stop time = %f (%f) \n", trans->update_dens_time * dens_step, stop_time);
669  xfprintf(log, "Save step = %f \n", save_step);
670  xfprintf(log, "Density step = %f (%d) \n\n", trans->update_dens_time, trans->dens_step);
671  xfprintf(log, "Time\t Iteration number\n");
672  //------------------------------------------------------------------------------
673 
674  for (i = 0; i < dens_step; i++) {
675  xprintf(Msg, "dens step %d \n", i);
676  save_time_step_C(problem);
677 
678  for (j = 0; j < trans->max_dens_it; j++) {
679  xprintf(Msg, "dens iter %d \n", j);
680  save_restart_iteration_H(problem);
681  //restart_iteration(problem);
682  //calculation_mh(problem);
683  //problem->water=new DarcyFlowMH(*mesh);
684  //problem->water->solve();
685  restart_iteration_C(problem);
686  //postprocess(problem);
687  convection(trans, output_time);
688 
689  if (trans->dens_implicit == 0) {
690  xprintf(Msg, "no density iterations (explicit)", j);
691  break;
692  }
693  if (compare_dens_iter(problem) && (j > 0)) {
694  break; //at least one repeat of iteration is necessary to update both conc and pressure
695  }
696  }
697 
698  xprintf(Msg, "step %d finished at %d density iterations\n", i, j);
699  xfprintf(log, "%f \t %d\n", (i + 1) * trans->update_dens_time, j); // Status LOG
700  }
701 
702  if(rank == 0) {
703  delete output_time;
704  }
705 
706  xfclose(log); */
707 //}
708 #endif
709 
void add_time_marks(double time, double dt, double end_time, TimeMark::Type type)
Definition: time_marks.cc:108
unsigned long int Type
Definition: time_marks.hh:59
virtual void run()
Definition: main.cc:294
double end_time() const
End time.
Definition: system.hh:75
virtual void parse_cmd_line(const int argc, char **argv)
Definition: main.cc:169
Class Input::Type::Default specifies default value of keys of a Input::Type::Record.
Definition: type_record.hh:39
Class for declaration of the input of type Bool.
Definition: type_base.hh:321
string main_input_filename_
filename of main input file
Definition: main.h:100
static Profiler * instance()
virtual void after_run()
Definition: main.cc:331
Application(int argc, char **argv)
Application constructor.
Definition: main.cc:89
bool is_end() const
Returns true if the actual time is greater than or equal to the end time.
static Input::Type::AbstractRecord input_type
static Default obligatory()
Definition: type_record.hh:87
Coupling of a transport model with a reaction model by operator splitting.
bool OptGetBool(const char *section, const char *key, const char *defval)
Definition: read_ini.cc:279
Definition: mesh.h:108
Class for create JSON machine readable documentation.
Definition: type_output.hh:427
void set_filter(string regex_filter)
Initializes and allocates regular expression filter regex_filter.
Definition: type_output.cc:47
char * xstrcpy(const char *src)
MAKE BRAND NEW COPY OF STRING.
Definition: system.cc:322
double t() const
Basic time management functionality for unsteady (and steady) solvers (class Equation).
char * OptGetFileName(const char *section, const char *key, const char *defval)
Definition: read_ini.cc:232
bool use_profiler
If true, we do output of profiling information.
Definition: main.h:109
???
static void uninitialize()
unsigned int n_elements() const
Definition: mesh.h:137
static const int exit_failure
bool is_current(const TimeGovernor &tg, const TimeMark::Type &mask) const
Definition: time_marks.cc:127
static void lazy_finish()
Finishes all registered lazy types.
Definition: type_base.cc:86
void setup_topology()
Definition: mesh.cc:224
static const int exit_success
Return codes of application.
Accessor to the data with type Type::Record.
Definition: accessors.hh:308
const Ret val(const string &key) const
#define xprintf(...)
Definition: system.hh:104
string main_input_dir_
directory of main input file (used to resolve relative paths of other input files) ...
Definition: main.h:98
void display_version()
Definition: main.cc:120
Mixed-hybrid model of linear Darcy flow, possibly unsteady.
long int OptGetInt(const char *section, const char *key, const char *defval)
Definition: read_ini.cc:242
The class for outputing data during time.
Definition: output_time.hh:37
void split_path(const string &path, string &directory, string &file_name)
Definition: main.cc:106
char ** passed_argv_
Definition: main.h:103
void set_program_info(string program_name, string program_version, string branch, string revision, string build)
double OptGetDbl(const char *section, const char *key, const char *defval)
Definition: read_ini.cc:260
This class is a collection of time marks to manage various events occurring during simulation time...
Definition: time_marks.hh:168
static Input::Type::Record input_type
int passed_argc_
Definition: main.h:102
int main(int argc, char **argv)
Definition: main.cc:354
void init(int argc, char **argv)
Accessor to the polymorphic input data of a type given by an AbstracRecord object.
Definition: accessors.hh:423
virtual void read(const std::string &file_name, Mesh *)=0
#define MPI_Comm_rank
Definition: mpi.h:236
#define _COMPILER_FLAGS_
Definition: main.cc:66
Definition: system.hh:75
Class for create documentation in Latex format using particular macros.
Definition: type_output.hh:388
static void set_io_dirs(const string working_dir, const string root_input, const string input, const string output)
Definition: file_path.cc:42
static Input::Type::Record input_type
Root of the Input::Type tree. Description of whole input structure.
Definition: main.h:45
Class for create and JSON template documentation.
Definition: type_output.hh:326
static const int exit_output
virtual int write_data(void)=0
Edge lumped mixed-hybrid solution of unsteady Darcy flow.
string program_arguments_desc_
Description of possible command line arguments.
Definition: main.h:106
#define DIR_DELIMITER
Definition: system.hh:59
SystemInfo sys_info
Definition: system.cc:55
Mixed-hybrid of steady Darcy flow with sources and variable density.
Class for create text documentation.
Definition: type_output.hh:290
Record type proxy class.
Definition: type_record.hh:161
Class for solution of steady or unsteady flow with sequentially coupled explicit transport.
static bool is_initialized()
Reader for (slightly) modified JSON files.
virtual ~Application()
Destructor.
Definition: main.cc:341
Input::Record root_record
root input record
Definition: main.h:112
void output(MPI_Comm comm, ostream &os)
char * OptGetStr(const char *section, const char *key, const char *defval)
Create new string from selected variable from ini file.
Definition: read_ini.cc:205
int pause_after_run
Definition: system.hh:84
Input::Record read_input()
Definition: main.cc:141
Record & declare_key(const string &key, const KeyType &type, const Default &default_value, const string &description)
Definition: type_record.cc:390