MIDAS  0.75
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
problem.cpp
Go to the documentation of this file.
1 #include "problem.h"
2 
3 #include "cell.h"
4 #include "point.h"
5 #include "attribute.h"
6 #include "dupl.h"
7 #include "taux.h"
8 #include "module_t3d.h"
9 #include "module_oofem.h"
10 
11 #include "librw.h"
12 #include "gelib.h"
13 #include "mathlib.h"
14 
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <math.h>
18 
19 
20 namespace midaspace {
21 
22 //* ********************************************************************************************
23 //* *** *** *** *** CLASS PROBDESC *** *** *** ***
24 //* ********************************************************************************************
27 {
28  so_driver = sodrv;
29 
30  //* *********************
31  //* *** AUXILIARY ***
32  //* *********************
33  solver_file_ptr = NULL;
34  solver_file_size = 0;
35  args = NULL;
36 
37  //* **********************
38  //* *** GENERAL INFO ***
39  //* **********************
40  memset(PDBO, 0, cPDBO*sizeof(bool));
41  PDBO[PDBO_cutRF] = true;
42 
43  //* OPERATION MODE
44  OM = OM_Void;
45  //* INPUT
46  IN_Path = NULL;
47  IN_ctrlfile = NULL;
48  IN_VTKaddata = NULL;
49  IN_VTKaddatasprs = NULL;
50  IN_file_results = NULL;
52  IN_file_bgm = NULL;
53  IN_meshGen_elemSize = -1.0;
55  IN_numdom = 1;
56  //* PROCESS
58  P_solverbinary = NULL;
59  P_mesher = MGT_T3d;
60  P_mesherbinary = NULL;
61  adpa = NULL;
62  //* OUTPUT
63  OUT_Path = NULL;
64  OUT_moFILE = NULL;
65  OUT_printStep = 1;
66  //* STATE
67  fulldata = false;
68  readedchars = false;
69 
70  //* ***********************
71  //* *** MESH DATA ***
72  //* ***********************
73  //* *** HEAD ***
74  comment = NULL;
75  ProbAnal = new ProblemAnalysis (this);
76  output_file = OOF_output_rec = NULL;
78  DOFbc_mask = NULL;
79  //* [SIFEL] only
82  text_output = 1;
83  to_nodes = 1; to_nodes_type = 1;
84  ton_displ = 1; ton_displ_type = 1;
87  ton_other = 0; ton_other_type = 1;
88  ton_react = 1;
89  to_elems = 1; to_elems_type = 1;
92  toe_other = 0; toe_other_type = 1;
93  toe_nevim = 0;
95  grafic_output = 0;
97  domainElAt = new FElemAttribs(NULL, -1, EAL_domain, this);
98  geomElAt.initialize((long)cCG);
103 } // end of CONSTRUCTOR
104 
107 {
108  //* *********************
109  //* *** AUXILIARY ***
110  //* *********************
111  if (solver_file_ptr)
112  free(solver_file_ptr);
113  deallocateCheck (args, false);
114 
115  //* **********************
116  //* *** GENERAL INFO ***
117  //* **********************
118  deallocateCheck (IN_Path, false);
119  delete IN_ctrlfile;
120  IN_mdlFiLes.delete_objects();
121  IN_mshFiLes.delete_objects();
122  delete IN_VTKaddata;
123  delete IN_VTKaddatasprs;
124  delete IN_file_results;
126  //
127  delete P_solverbinary;
128  delete P_mesherbinary;
129  delete adpa;
130  //
131  deallocateCheck (OUT_Path, false);
132  delete OUT_moFILE;
133 
134  //* ***********************
135  //* *** MESH DATA ***
136  //* ***********************
137  //* *** HEAD ***
138  deallocateCheck (comment, false);
139  delete ProbAnal;
140 
141  deallocateCheck (output_file, false);
143  delete [] DOFbc_mask;
144 
145  //* *** ATTRIBUTES ***
146  CSs .delete_objects();
147  Mats .delete_objects();
148  BCs .delete_objects();
149  //
150  PVs .delete_objects();
151  OOltfs .delete_objects();
152  OOextrs.delete_objects();
153  //
154  NLs .delete_objects();
155  CELs .delete_objects();
156  CFLs .delete_objects();
157  CBLs .delete_objects();
158  //
159  delete domainElAt;
160  geomElAt.delete_objects();
161  //
162  NdAts .delete_objects();
163  ElAts .delete_objects();
164 
165  //* *** GEOMETRY ***
166  Models.delete_objects();
167  Meshes.delete_objects();
168 
169 } // end of DESTRUCTOR
170 
171 // premistit
172 //char *argv[]
173 
174 
175 //* ********************************************************************************************
176 //* *** *** *** *** GENERAL INFO *** *** *** ***
177 //* ********************************************************************************************
182 long Problem :: give_nsteps (void) const { return ProbAnal->give_nsteps(); }
183 
186 {
187  //* spoctu boundary box, ale nevim ktere site, tak dam zatim natvrdo prvni model
188  if ( Meshes() || Models() != 1 || Models[0]->give_gp() != MMP_primary) errol;
189 
190  IN_meshGen_elemSize = Models[0]->give_boubox_diff()->give_sum();
191 }
192 
193 //* ********************************************************************************************
194 //* *** *** *** *** DATA *** *** *** ***
195 //* ********************************************************************************************
198 {
199  if ( (Meshes() && Meshes[0]->give_gp() == MMP_primary) ) return Meshes[0];
200  else if ( (Models() && Models[0]->give_gp() == MMP_primary) ) return Models[0];
201  else _errorr("Primary model and mesh mismatch");
202 
203  return NULL;
204 }
205 
206 
209 void Problem :: geomElAt_initialize_from (const char *str, CellGeometry cg) { this->alloc_geomElAt(cg); this->geomElAt[cg]->initialize_from(str, FFF_MIDAS); }
210 
213 
215 void Problem :: alloc_geomElAt (CellGeometry cg) { if (geomElAt[cg] == NULL) geomElAt.assign(cg, new FElemAttribs(NULL, -1, EAL_geometry, this)); }
217 void Problem :: set_geomElAt (CellGeometry cg, DOFsPerNode val) { this->alloc_geomElAt(cg); geomElAt[cg]->set_dpn (val); }
218 void Problem :: set_geomElAt (CellGeometry cg, SStype val) { this->alloc_geomElAt(cg); geomElAt[cg]->set_sst (val); }
219 void Problem :: set_geomElAt (CellGeometry cg, FEApproximation val) { this->alloc_geomElAt(cg); geomElAt[cg]->set_approx(val); }
220 
222 void Problem :: set_FETS (const char *skupina, const char *str)
223 {
224  if (STRCMP(skupina, "all" ) == 0) this->domainElAt_initialize_from(str);
225  else if (STRCMP(skupina, "1d" ) == 0) { this->geomElAt_initialize_from(str, CG_Line); this->geomElAt_initialize_from(str, CG_PolyLine); }
226  else if (STRCMP(skupina, "2d" ) == 0) { this->geomElAt_initialize_from(str, CG_Triangle); this->geomElAt_initialize_from(str, CG_Quadrangle); this->geomElAt_initialize_from(str, CG_Polygon); }
227  else if (STRCMP(skupina, "3d" ) == 0) errol; // CG_Tetra, CG_Brick,
228  else if (STRCMP(skupina, "line") == 0) errol;
229  else _errorr ("Unknown category");
230 }
232 void Problem :: set_lcs (LCSdirection dir, LCStype typ, long num)
233 {
234  this->domainElAt->set_lcs(dir, typ, num);
235 }
236 
239 {
240  BCs.add(val);
241  return val;
242 }
245 {
246  for (long i=0; i<BCs(); i++)
247  if (BCs[i]->is_identical_with(val)) {
248  delete val;
249  return BCs[i];
250  }
251 
252  return this->add_uniq_BC(val);
253 }
254 
256 {
257  if (bc->give_bcbr() && bc->give_bcbr()->give_dpn() == dpn_new)
258  return bc->give_bcbr();
259 
260  BoundaryCond* nbc = new BoundaryCond(this, bc->give_ID() + 1);
261  nbc->copy_bcbr(bc, dpn_old, dpn_new);
262 
263  if (bc->give_ID()+1 == BCs()) BCs.add(nbc);
264  else {
265  BCs.wedge(bc->give_ID()+1, nbc);
266  TF_GPA_reid (BCs);
267  }
268 
269  return nbc;
270 }
271 
272 // // momentalne maji listy id stoupajici, bez mezer, takze tato fce je momentalne nepotrebna
273 // template <class T>
274 // T* GPA_give_member_with_ID (long ID, const GPA<T> &list)
275 // {
276 // for (long i=0; i<list(); i++)
277 // if (list[i]->give_ID() == ID)
278 // return list[i];
279 //
280 // return NULL;
281 // }
282 
283 // PointDOFsBCPM* Problem :: give_PV_ofID (long i) const
284 // {
285 // return GPA_give_member_with_ID (i, PVs);
286 // }
287 
290 {
291  for (int i=0; i<CSs(); i++) {
292  if (CSs[i]->give_loctype_or_type() == type &&
293  CSs[i]->give_sifid() == id)
294  return CSs[i];
295  }
296  errol;
297  return NULL;
298 }
301 {
302  for (int i=0; i<Mats(); i++) {
303  if (Mats[i]->give_loctype() == type &&
304  Mats[i]->give_sifid() == id)
305  return Mats[i];
306  }
307  errol;
308  return NULL;
309 }
310 
313 {
314 #ifdef DEBUG
315  if (prop == 0) errol;
316 #endif
317 
318  for (int i=0; i<NdAts(); i++)
319  if (NdAts[i]->give_prop() == prop)
320  return NdAts[i];
321 
322  return NULL;
323 }
325 {
326 #ifdef DEBUG
327  if (prop == 0) errol;
328 #endif
329 
330  PointAttribs* na = this->give_NdAt_with_prop(prop);
331 
332  if (!na) na = NdAts.add(new PointAttribs (NULL, prop, this));
333 
334  return na;
335 }
338 {
339  for (int i=0; i<ElAts(); i++)
340  if (ElAts[i]->give_prop() == prop)
341  return ElAts[i];
342 
343  return NULL;
344 }
345 
347 {
348  for (int i=0; i<CSs(); i++)
349  if (CSs[i]->give_type() == CST_3d)
350  return CSs[i];
351 
352  CrossSection *csnew = new CrossSection (this, CSs());
353  csnew->set_type3d ();
354 
355  ((Problem*)this)->CSs.wedge(0, csnew);
356 
357  TF_GPA_reid(CSs);
358 
359  return CSs[0];
360 }
361 
362 
365 {
366  for (int i=0; i<Mats(); i++)
367  if (Mats[i]->give_type() == MAT_RIGID) {
368  Mats.delete_object(i);
370  }
371 }
372 
373 
374 //* ********************************************************************************************
375 //* *** *** *** *** MAIN *** *** *** ***
376 //* ********************************************************************************************
378 void Problem :: solve (void)
379 {
380  switch (this->OM) {
381  case OM_Convert:
382  case OM_Design2design:
383  case OM_Design2solver:
384  case OM_Solver2design: this->main_OM_design2solver2design(); break;
385  case OM_Test: this->main_OM_testing(); break;
386  default: _errorr ("OPERATION MODE not specified, use \"-OM_design2solver\" or \"-OM_convert\"");
387  }
388 }
389 
392 {
393  // steps
394  bool step_PostProc = false;
395 
396  switch (this->OM) {
397  case OM_Convert: step_PostProc = false; break;
398  case OM_Design2design: step_PostProc = true; break;
399  case OM_Design2solver: step_PostProc = false; break;
400  case OM_Solver2design: step_PostProc = true; break;
401  default: errol;
402  }
403 
404 
405  long i;
406 
407  // ************************************
408  // *** CHECK and SET PARAMETERS ***
409  // ************************************
410  //* check right number of mesh files for parallel version
411  if (IN_numdom>1) {
412  if (OM != OM_Design2solver) errol;
413  char file[255];
414  sprintf (file,"%s.%ld", IN_mshFiLes[0]->give_name(), IN_numdom);
415  FILE *in = fopen (file,"r");
416  if (in != NULL) {
417  fclose (in);
418  _errorr ("There are more mesh-input-files then domains");
419  }
420  }
421 
422  //* check ctrl file
424 
425  //* check primary model/mesh
426  bool mdl=false;
427  if ( (IN_mdlFiLes() && IN_mdlFiLes[0]->give_mmp() == MMP_primary) && (!IN_mshFiLes() || IN_mshFiLes[0]->give_mmp() != MMP_primary) ) mdl = true;
428  else if ( (IN_mshFiLes() && IN_mshFiLes[0]->give_mmp() == MMP_primary) && (!IN_mdlFiLes() || IN_mdlFiLes[0]->give_mmp() != MMP_primary) ) mdl = false;
429  else _errorr("Both first model neither first mesh are not primary");
430  //
431  for (i=1; i<IN_mdlFiLes(); i++) if (IN_mdlFiLes[i]->give_mmp() == MMP_primary) errol;
432  for (i=1; i<IN_mshFiLes(); i++) if (IN_mshFiLes[i]->give_mmp() == MMP_primary) errol;
433 
434  // termporary limitation
435  if (OM == OM_Solver2design && (mdl || IN_mshFiLes()>1)) _errorr("OM_Solver2design supports one mesh only and no model");
436  if (OM == OM_Convert) {
437  if ( mdl && IN_mshFiLes()>0) _errorr("OM_Convert supports one mesh only and no model");
438  if (!mdl && IN_mshFiLes()>1) _errorr("OM_Convert supports one mesh only and no model");
439  }
440 
441 
442  //* *******************************
443  //* *** READING INPUT FILES ***
444  //* *******************************
445  // do not change the sequence of following lines
446  if (IN_ctrlfile) this->read_ctrlfile();
447  if (IN_mshFiLes()) this->read_meshes ();
448  if (IN_mdlFiLes()) this->read_models ();
449  //
450  this->read_addata (mdl);
451 
452  //* check
453  if (OM == OM_Design2solver || OM == OM_Design2design)
454  if (! readedchars) _errorr("characteristics was not readed");
455 
456  // docasne pro rizeni stability parametrem
457  if (PDBO[PDBO_stability] == true)
458  this->ProbAnal->set_stability();
459 
460 
461  //* *************************************************
462  //* *** INITIALIZATION ALLOCATION CONSISTENCY ***
463  //* *************************************************
464  this->initialization ();
465  this->checkConsistency ();
466 
467  if (this->give_PDBO (PDBO_OUT_MeshStats)) {
468  for (i=0; i<Models(); i++) Models[i]->print_info();
469  for (i=0; i<Meshes(); i++) Meshes[i]->print_info();
470  }
471 
472  //* ***********************************
473  //* *** PREPROCESSOR OPERATIONS ***
474  //* ***********************************
475  //* all models are transformed to mesh
476  for (i=0; i<Models(); i++)
477  Models[i]->transform_to_mesh();
478 
479  for (i=1; i<Meshes(); i++) {
480  Meshes[0]->join_geom (Meshes[i]);
481  Meshes[i]->letoff_aa();
482  Meshes.delete_object(i);
483  Meshes.shake_down();
484  }
485 
487  if (OM == OM_Design2solver || OM == OM_Design2design) {
488  //* rigid material to RAN
489  Meshes[0]->RIGIDmatToRAN();
490  //this rm_mat
491 
492  //* duplicity
493  Meshes[0]->cleanup_duplicities ();
494  Meshes[0]->find_slaves ();
495  }
496 
497  //* vlna //Pd->give_Mesh(0)->vlna ();
498  //* SHAKE //shake_nodes (); //shake_elements ();
499 
500  this->finitialization ();
501  //* again, to be sure
502  this->checkConsistency ();
503 
504  Meshes[0]->print_geom_info ();
505 
506 
507  //* ********************************
508  //* *** PREPROCESSOR OUTPUT ***
509  //* ********************************
510  if (OM == OM_Design2solver || OM == OM_Design2design) {
511  if (OM == OM_Design2solver && OUT_moFILE)
512  switch (this->OUT_moFILE->give_ff()) {
513  case FFF_OOFEM: this->print_input_OOFEM(); break;
514  case FFF_SIFEL: this->print_input_SIFEL(); break;
515  case FFF_ANSYS: this->print_input_ANSYS(); break;
516  default: errol;
517  }
518 
519  //* docasne kvuli souckovi
520  if (PDBO[PDBO_ansys] == true) this->print_input_ANSYS();
521 
522 
523  if (OM == OM_Design2design && OUT_moFILE)
524  switch (this->P_solver) {
525  case SOL_OOFEM: this->print_input_OOFEM(); break;
526  default: errol;
527  }
528 
529  //
530  if ( PDBO[PDBO_OUT_Test ] ) this->print_control ();
531  //if ( PDBO[PDBO_OUT_CabTenOnly] ) Meshes[0]->print_cabletensileonly ();
532  if ( PDBO[PDBO_OUT_charVTK ] ) Meshes[0]->print_characteristics_to_VTK ();
533  }
534 
535  if (OM == OM_Convert) {
536  if (this->OUT_moFILE) {
537  switch (this->OUT_moFILE->give_ff()) {
538  case FFF_VTK:
539  case FFF_VTP:
540  case FFF_VTU: Meshes[0]->print_VTK (this->OUT_moFILE->give_ff(), ""); break;
541  case FFF_JKTK: Meshes[0]->print_JKTK (this->OUT_moFILE->give_ff(), ""); break;
542  case FFF_OOFEM: this->print_input_OOFEM(); break;
543  case FFF_SIFEL: this->print_input_SIFEL(); break;
544  default: _errorr("unsuported output file format of conversion mode");
545  }
546  }
547  //if (IN_mshFiLes[0]->give_ff() == FFF_OOFEM && PDBO[PDBO_OUT_solverINctrl]) this->print_OOFEM_input();
548  //if (IN_mshFiLes[0]->give_ff() == FFF_SIFEL && PDBO[PDBO_OUT_solverINctrl]) this->print_SIFEL_input();
549  }
550 
551 
552  //* ********************************
553  //* *** PROCESSOR OPERATIONS ***
554  //* ********************************
555  if (OM == OM_Design2design) {
556  switch (this->P_solver) {
557  case SOL_OOFEM:
558  if (IN_file_results != NULL) errol;
559  IN_file_results = new FiLe(FFF_OOFEM, this->OUT_moFILE->give_path(), this->OUT_moFILE->give_base(), ".oofem.out");
560 
561  FEM_solve_OOFEM (this);
562 
563  break;
564  default: errol;
565  }
566 
567  }
568 
569 
570 
571  //* ************************************
572  //* *** POSTPROCESSOR OPERATIONS ***
573  //* ************************************
574  if (step_PostProc) {
575  //* read output file from structural analysis package
576  Meshes[0]->read_structural_analysis_output();
577 
578  //* adaptivity
579  if ( this->give_adpa() ) Meshes[0]->adaptivity();
580 
581  //* output
582  if ( OUT_moFILE ) {
583  switch (this->OUT_moFILE->give_ff()) {
584  case FFF_VTK:
585  case FFF_VTP:
586  case FFF_VTU: Meshes[0]->print_results (); break;
587  default: _errorr("unsuported file format of \"results\" file");
588  }
589  }
590 
591  //* control print of oofem input, for testing only
593 
594  }
595 }
596 
597 
600 {
601  if (IN_mshFiLes()) errol;
602  if (IN_mdlFiLes()) this->read_models ();
603  //Models[0]->findRANofSkewLines ();
604 
605 }
606 
607 
610 {
611  this->sodriver()->print_info_message (SODE_start_blue_arrow, "Problem initialization");
612 
613  //* DO NOT CHANGE SEQUENCE OF BLOCKS OF THIS FUNCTION
614 
615  long i;
616 
617  //* ************************
618  //* *** GENERAL INFO ***
619  //* ************************
620  // *** initialization of attributes ***
621  if (IN_Path) {
623  for (i=0; i<IN_mdlFiLes(); i++) IN_mdlFiLes[i] ->addGlobPath(IN_Path);
624  for (i=0; i<IN_mshFiLes(); i++) IN_mshFiLes[i] ->addGlobPath(IN_Path);
629  }
630 
631  if (OUT_moFILE) {
634  else errol;
635 
637  }
638 
639  //* print arguments
640  if (this->give_PDBO(PDBO_OUT_args)) {
641  FILE *file = _openFilePNS ("w", "args file", NULL, OUT_moFILE->give_name(), ".args.out");
642  fprintf (file, "%s", this->args);
643  fclose (file);
644  }
645 
646  if (fulldata) {
647  //* DOFs of problem
648  if (DOFspnod == DPN_Void)
650 
651  //* ***********************
652  //* *** MESH DATA ***
653  //* ***********************
654  //* *** MESH + ATTRIBUTES ***
655  for (i=0; i<Meshes(); i++) Meshes[i]->initialize();
656  for (i=0; i<Models(); i++) Models[i]->initialize();
657 
658  for (i=0; i<NdAts (); i++) NdAts [i]->initialize();
659  for (i=0; i<ElAts (); i++) ElAts [i]->initialize();
660  //
661  for (i=0; i<CSs (); i++) CSs [i]->initialize();
662  for (i=0; i<Mats (); i++) Mats [i]->initialize();
663  for (i=0; i<BCs (); i++) BCs [i]->initialize();
664  //
665  for (i=0; i<PVs (); i++) PVs [i]->initialize();
666  for (i=0; i<OOltfs (); i++) OOltfs [i]->initialize();
667  for (i=0; i<OOextrs (); i++) OOextrs[i]->initialize();
668  //
669  for (i=0; i<NLs (); i++) NLs [i]->initialize();
670  for (i=0; i<CELs (); i++) CELs [i]->initialize();
671  for (i=0; i<CFLs (); i++) CFLs [i]->initialize();
672  for (i=0; i<CBLs (); i++) CBLs [i]->initialize();
673  for (i=0; i<Fixed (); i++) Fixed [i]->initialize(); Fixed.delete_objects();
674  //
676  for (i=0; i<geomElAt(); i++) if (geomElAt[i]) geomElAt[i]->initialize();
677  //
678  for (i=0; i<NdAts (); i++) NdAts [i]->initialize();
679  for (i=0; i<ElAts (); i++) ElAts [i]->initialize();
680 
681 
682  // initialization of first BC
683  if (BCs() && ! BCs[0]->is_the_first_BC() ) {
684  BoundaryCond *nbc;
685  nbc = new BoundaryCond(this, 0);
687 
688  BCs.wedge(0, nbc);
689  TF_GPA_reid(BCs);
690  }
691 
692  // initialization of first ltf
693  if (!OOltfs())
694  OOltfs.add(new LoadTimeFunction(this, 0)) -> initialize_first();
695 
696  }
697 
699 }
700 
703 {
704  this->sodriver()->print_info_message (SODE_start_blue_arrow, "Problem finalize preprocessing");
705 
706  //* DO NOT CHANGE SEQUENCE OF BLOCKS OF THIS FUNCTION
707 
708  if (fulldata) {
709  //* ***********************
710  //* *** MESH DATA ***
711  //* ***********************
712  //* *** MESH + ATTRIBUTES ***
713  if (Meshes() != 1) errol;
714 
715  Meshes[0]->finitialize();
716 
717  }
718 
720 }
721 
722 
725 {
726  this->sodriver()->print_info_message (SODE_start_blue_arrow, "Problem consistency check");
727 
728  //* Argument -OUT_print_model_parent is accepted only:
730  if (OM != OM_Design2design) _errorr("Argument -OUT_print_model_parent can be accepted only in OM_Design2design mode.");
731  for (int i=0; i<Meshes(); i++)
732  if (Meshes[i]->give_Master_model() == NULL)
733  _errorr("Argument -OUT_print_model_parent can be accepted only if the geometry is given as model.");
734 
735  }
736 
737  //* Argument -P_preserveGeometry is accepted only:
738  if (PDBO[PDBO_preserveGeom]) {
739  if (OM != OM_Design2design) errol;
740 
742  if (PDBO[PDBO_MultipNode ]) errol;
743  if (PDBO[PDBO_MultipElem ]) errol;
744  if (PDBO[PDBO_uncfrd ]) errol;
745 
746  if (IN_mshFiLes() != 1) errol;
747  if (OUT_moFILE == NULL) errol;
748 
749  if (IN_mshFiLes[0]->give_ff() != FFF_VTK &&
750  IN_mshFiLes[0]->give_ff() != FFF_VTP &&
751  IN_mshFiLes[0]->give_ff() != FFF_VTU ) errol;
752 
753  if (OUT_moFILE->give_ff() != FFF_VTK &&
754  OUT_moFILE->give_ff() != FFF_VTP &&
756 
757  }
758 
759  if (OM == OM_Design2design) {
760  if (this->P_solver == SOL_Void) _errorr("Solver was not specified. Please, use argument -P_solver*");
761 
762  if (this->P_solverbinary->is_empty()) {
763  switch (this->P_solver) {
764  case SOL_OOFEM:
765 #ifndef __OOFEM_MODULE
766  _errorr("OOFEM binary is given as \"-\", however the module __OOFEM_MODULE is not linked. Activate the module in Makefile please.");
767 #endif
768  break;
769  default: errol;
770  }
771  }
772  }
773 
774  if ( PDBO[PDBO_OUT_solverINctrl] ) {
775  if (OM != OM_Design2design && OM != OM_Solver2design) _errorr("Pomocny parametr PDBO_OUT_solverINctrl musi byt pouzit jen v modu d2d nebo s2d");
776  if (!OUT_moFILE) _errorr("Pomocny parametr PDBO_OUT_solverINctrl musi byt pouzit jen s OUT_moFILE");
777  }
778 
779 
780  long i;
781 
782  //
783  for (i=0; i<CSs (); i++) CSs [i]->checkConsistency();
784  for (i=0; i<Mats (); i++) Mats [i]->checkConsistency();
785  for (i=0; i<BCs (); i++) BCs [i]->checkConsistency();
786  for (i=0; i<NLs (); i++) NLs [i]->checkConsistency();
787  for (i=0; i<CELs (); i++) CELs [i]->checkConsistency();
788  for (i=0; i<CFLs (); i++) CFLs [i]->checkConsistency();
789  for (i=0; i<CBLs (); i++) CBLs [i]->checkConsistency();
790  for (i=0; i<NdAts (); i++) NdAts [i]->checkConsistency();
791  for (i=0; i<ElAts (); i++) ElAts [i]->checkConsistency();
792  for (i=0; i<OOltfs(); i++) OOltfs[i]->checkConsistency();
793 
794  if ( (Models() && Models[0]->give_gp() == MMP_primary) && (Meshes() && Meshes[0]->give_gp() == MMP_primary)
795  && Meshes[0]->give_Master_model() != Models[0] )
796  _errorr("Primary model[0] is not master of primary mesh[0]");
797 
798  //* MODEL
799  for (i=0; i<Models(); i++) Models[i]->checkConsistency();
800  //* MESH
801  for (i=0; i<Meshes(); i++) Meshes[i]->checkConsistency();
802 
803  // *** finding of number of PrintNode ***
804  // toto zkontroluje jen druhy bod, protoze ten by mel byt printing
805  //if (Nodes[1]->property != PRINT_NODE_PROPERTY)
806  // _errorr2 ("Second node is not \"printing node\", property: %d", PRINT_NODE_PROPERTY);
807 
808  if (this->give_PDBO(PDBO_BondEndRFran)) _errorr ("option BondEndRFran is not implemented, u teto hlasky je komentar, precti si ho");
809  //* zde je puvodni kod, musel by sis ho rozlustit a reimplementovat
810  //* castecne rozlusteni je toto:
811  //* pokud je cele celo phd ramu chyceno pomoci RAN na jednom mastrovi, tak nema cenu,
812  //* aby se konec polyline (reinforcement) chytal skrz HN na celo, ale chyti se rovnou
813  //* na na toho mastra
814  //* KOD:
815  // // pokud BondEndRFran...
816  // if (BondEndRFran) {
817  // // ... tak se zde vezme prpos prvniho HNmastra ...
818  // prpos = (dynamic_cast<const RigidArmNode *>(hn->give_MN(0)))->give_prpos();
819  // // ... a zkontroluje se asi, zda jso ostatni HN mastri zaveseni na stejnem mastrovi, nebo co ...
820  // for (k=1; k<hn->give_cMN(); k++)
821  // //////if ( Nodes[hn->masterNodes[k]]->give_RANposition() != prpos )
822  // if ( Pd->RANmaster[Nodes[hn->masterNodes[k]]->give_RANposition()] != Pd->RANmaster[prpos] )
823  // _errorr2 ("Hanging node is hanged on both rigid arm node and common node, hanging node: %d",hn->id);
824  // }
825  // // ... a pak se to vytiskne jako RAN mastrovi prvniho HNmastra ...
826  // // ... daslsi kod by mel byt tudiz obdobnej print sekci klasickeho RAN
827  // else { // hanged by rigid arm node
828  // // type + coord
829  // fprintf (out,"\nrigidArmNode %4ld coords 3 ",lid+1);
830  // for (k=0;k<3;k++) fprintf (out,"%.9e ",hn->give_coord(k));
831  // // property
832  // row = Pd->give_row (head,hn->give_MN(0)->give_property());
833  // fprintf (out,"%s",row);
834  // // master
835  // fprintf (out," master %ld masterMask %ld", Nodes[Pd->RANmaster[prpos]]->give_lid (did)+1, Pd->RANndofs[prpos]);
836  // for (k=0; k<Pd->RANndofs[prpos]; k++)
837  // fprintf (out," %ld", Pd->RANmask[prpos][k]);
838  // fprintf (out," dofType %ld", Pd->RANndofs[prpos]);
839  // for (k=0; k<Pd->RANndofs[prpos]; k++)
840  // fprintf (out," %d", (Pd->RANmask[prpos][k] ? 2 : 0));
841  // }
842 
844 }
845 
846 
848 //void Problem :: model_meshing (void)
849 //{
850 // this->sodriver()->print_info_message (SODE_start_blue_arrow, "Model meshing");
851 //
852 //
853 // this->sodriver()->print_info_message_core (SODE_green_ok);
854 //}
855 
856 
859 {
860  for (long i=0; i<NdAts(); i++) {
861  classID ct = NdAts[i]->give_classid();
862  if (ct == classRANAttribs || ct == classHNAttribs)
863  _errorr ("RAN or HN is nonzero while elimination of duplicities");
864  }
865 }
866 
867 
868 //* *********************************************************************************************
869 //* *********************************************************************************************
870 //* *** READING OF FILES ***
871 //* *********************************************************************************************
872 //* *********************************************************************************************
873 
874 //* ********************************************************************************************
875 //* *** *** *** *** XML *** *** *** ***
876 //* ********************************************************************************************
877 
880 void Problem :: read_head_and_chars (Stream *stream, char &DATASET)
881 {
882  const XMLNode *parent = stream->tixnod();
883 
884  //* declaration - pokud je pritomna, tak ji smazeme at dalsi fce zacina rovnou s datama
885  if (parent->FirstChild()->ToDeclaration() != NULL) stream->tixnod()->DeleteChild( stream->tixnod()->FirstChild() );
886 
887  //* comment - pokud je pritomen, tak ho smazeme at dalsi fce zacina rovnou s datama
888  while (true)
889  if (parent->FirstChild()->ToComment() != NULL) stream->tixnod()->DeleteChild( stream->tixnod()->FirstChild() );
890  else break;
891 
892  //
893  parent = XP_give_unique_expected_elem (parent, "VTKFile");
894  stream->relink_downF();
895 
897  if (strcmp(parent->ToElement()->Attribute("type"), "PolyData") == 0) DATASET='P';
898  else if (strcmp(parent->ToElement()->Attribute("type"), "UnstructuredGrid") == 0) DATASET='U';
899  else _errorr2 ("Unsupported DATATYPE \"%s\"", parent->ToElement()->Attribute("type"));
900 
901  XP_check_expected_attribute (parent, "version", "0.1");
902  XP_check_expected_attribute (parent, "byte_order", "LittleEndian");
903 
904  //
905  if (DATASET == 'P') parent = XP_give_unique_expected_elem (parent, "PolyData", false);
906  else parent = XP_give_unique_expected_elem (parent, "UnstructuredGrid", false);
907  stream->relink_downF();
908 
909  //
910  if (parent->NextSibling()) {
911  parent = parent->NextSibling();
912  stream->relink_next();
913 
914  if (strcmp(parent->Value(), "AppendedData") != 0) _errorr0;
915 
916  if (! (parent = parent->FirstChild ())) _errorr0;
917  if ( parent->Value()[0] != '_' ) _errorr("There is no character \'_\' at the start of section AppendedData");
918  stream->relink_downF();
919 
920  stream->relink_next();
921  this->read_characteristics (stream);
922  stream->relink_up();
923  stream->relink_prev();
924  }
925 
926  XP_give_unique_expected_elem (stream->tixnod(), "Piece");
927  stream->relink_downF();
928 }
929 
930 
931 
932 
933 
934 //* ********************************************************************************************
935 //* *** *** *** *** BLOCK *** *** *** ***
936 //* ********************************************************************************************
937 inline const char* BN_enum2char (BlockName bn)
938 {
939  switch (bn) {
940  case BN_COMM: return "PROBLEM_COMMENT"; break;
941  case BN_OFN: return "PROBLEM_OUTPUT_FILE_NAME"; break;
942  case BN_ANAL: return "PROBLEM_ANALYSIS"; break;
943  case BN_DOMN: return "PROBLEM_TYPE_DOF"; break; // PROBLEM_DOMAIN
944  case BN_OUTP: return "PROBLEM_OUTPUT"; break;
945 
946  case BN_CS: return "LIST_CROSS-SECTIONS"; break;
947  case BN_MAT: return "LIST_MATERIALS"; break;
948  case BN_BC: return "LIST_BOUNDARY_CONDITIONS"; break;
949  case BN_PV: return "LIST_SETS_IDS_PRESCRIBED_VALUES"; break;
950 
951  case BN_NODES: return "ASSIGN_ATTRIBUTES_TO_NODE_PROP"; break;
952  case BN_ELEMS: return "ASSIGN_ATTRIBUTES_TO_ELEMENT_PROP"; break;
953 
954  case BN_NL: return "ASSIGN_NODAL_LOAD"; break;
955  case BN_CEL: return "ASSIGN_CONST_EDGE_LOAD"; break;
956  case BN_CFL: return "ASSIGN_CONST_SURFACE_LOAD"; break;
957  case BN_CBL: return "ASSIGN_CONST_BODY_LOAD"; break;
958 
959  case BN_HN: return "HANGING_NODE_ATTRIBUTES"; break;
960  case BN_RAN: return "RIGID_ARM_NODE_ATTRIBUTES"; break;
961 
962  case BN_LTF: return "LTF"; break;
963  case BN_EXTRCT: return "EXTRACT"; break;
964 
965  case BN_Void: fprintf (stderr, "BN_void has assigned no string");
966  default: _errorr ("Unknown BLOCK name alias.h");
967  }
968  return 0;
969 }
970 
971 inline BlockName BN_char2enum (const char* bn)
972 {
973  if (strcmp(bn, "PROBLEM_COMMENT" ) == 0) return BN_COMM;
974  else if (strcmp(bn, "PROBLEM_OUTPUT_FILE_NAME" ) == 0) return BN_OFN;
975  else if (strcmp(bn, "PROBLEM_ANALYSIS" ) == 0) return BN_ANAL;
976  else if (strcmp(bn, "PROBLEM_TYPE_DOF" ) == 0) return BN_DOMN; //_DOMAIN
977  else if (strcmp(bn, "PROBLEM_OUTPUT" ) == 0) return BN_OUTP;
978 
979  else if (strcmp(bn, "LIST_CROSS-SECTIONS" ) == 0) return BN_CS;
980  else if (strcmp(bn, "LIST_MATERIALS" ) == 0) return BN_MAT;
981  else if (strcmp(bn, "LIST_BOUNDARY_CONDITIONS" ) == 0) return BN_BC;
982  else if (strcmp(bn, "LIST_PRESCRIBED_VALUES" ) == 0) return BN_PV;
983  else if (strcmp(bn, "LIST_SETS_IDS_PRESCRIBED_VALUES" ) == 0) return BN_PV;
984 
985  else if (strcmp(bn, "ASSIGN_ATTRIBUTES_TO_NODE_PROP" ) == 0) return BN_NODES;
986  else if (strcmp(bn, "ASSIGN_ATTRIBUTES_TO_ELEMENT_PROP") == 0) return BN_ELEMS;
987  else if (strcmp(bn, "ASSIGN_FIXED_TO_ELEMENT_ID" ) == 0) return BN_FIXED;
988 
989  else if (strcmp(bn, "ASSIGN_NODAL_LOAD" ) == 0) return BN_NL;
990  else if (strcmp(bn, "ASSIGN_CONST_EDGE_LOAD" ) == 0) return BN_CEL;
991  else if (strcmp(bn, "ASSIGN_CONST_SURFACE_LOAD" ) == 0) return BN_CFL;
992  else if (strcmp(bn, "ASSIGN_CONST_BODY_LOAD" ) == 0) return BN_CBL;
993 
994  else if (strcmp(bn, "HANGING_NODE_ATTRIBUTES" ) == 0) return BN_HN;
995  else if (strcmp(bn, "RIGID_ARM_NODE_ATTRIBUTES" ) == 0) return BN_RAN;
996 
997  else if (strcmp(bn, "LTF" ) == 0) return BN_LTF;
998  else if (strcmp(bn, "EXTRACT" ) == 0) return BN_EXTRCT;
999 
1000  else _errorr2 ("Unknown BLOCK name \"%s\"", bn);
1001  return BN_Void;
1002 }
1003 
1004 
1005 //* **************************************
1006 //* *** READING OF CHARACTERISTICS ***
1007 //* **************************************
1012 {
1013  this->sodriver()->print_info_message (SODE_start_blue_arrow, "Reading of file with characteristics");
1014 
1015  char *file = new char[255];
1016  strcpy(file, IN_ctrlfile->give_name());
1017 
1018  Stream *stream = new Stream();
1019  stream->open(STRM_void, "r", (const char*&)file);
1020 
1021  //* reading
1022  if (!stream->isFile()) stream->relink_downF();
1023  this->read_characteristics (stream);
1024 
1025  //* close
1026  stream->close();
1027  delete stream;
1028 
1030 }
1031 
1033 {
1034  fulldata = true;
1035 
1036  if (stream->isFile()) {
1037  const char *str;
1038  char WORD[255], LINE[5119];
1039  while (true) {
1040  while (true) {
1041  if (fgets (LINE, 5119, stream->file()) == NULL) _errorr("There is no line with '###' start sequence in char file");
1042  if (SP_scan_expected_word ((str=LINE), "###")) break;
1043  }
1044  SP_scan_word (str, WORD);
1045 
1046  if (strcmp(WORD, "END") == 0) break;
1047 
1048  //* reading of block
1049  this->read_characteristics_core(stream, WORD);
1050  }
1051  }
1052  else {
1053  if (strcmp(stream->tixel()->Value(), "Characteristics") != 0) _errorr0;
1054 
1055  stream->relink_downF();
1056  while (true) {
1057  //* reading of block
1058  this->read_characteristics_core (stream, stream->tixel()->Value());
1059  if (! stream->relink_next()) break;
1060  }
1061  stream->relink_up();
1062  }
1063 }
1064 
1066 void Problem :: read_characteristics_core (Stream *stream, const char *key)
1067 {
1068  BlockName bn = BN_char2enum (key);
1069 
1070  if (!stream->isFile()) {
1071  if (!stream->relink_downF()) _errorr2("error of xml vtk file nearby %s", key);
1072  stream->skip_commnet();
1073  }
1074 
1075  switch (bn) {
1076  case BN_COMM: if (comment) _errorr2 ("Block %s is duplicated", key); GP_scan_line_alloc (stream, comment); break;
1077  case BN_OFN: if (output_file) _errorr2 ("Block %s is duplicated", key); GP_scan_line_alloc (stream, output_file); break;
1078  case BN_DOMN: char W[255]; GP_scan_line (stream, W); this->set_DOFspnod (DOFsPerNode_s2e(W)); break;
1079  case BN_ANAL: this->read_block (stream, bn); break;
1080  case BN_OUTP: this->read_block_output (stream); break;
1081 
1082  case BN_CS: if (CSs ()) _errorr2 ("Block %s is duplicated", key); this->read_block (stream, bn); break;
1083  case BN_MAT: if (Mats()) _errorr2 ("Block %s is duplicated", key); this->read_block (stream, bn); break;
1084  case BN_BC: if (BCs ()) _errorr2 ("Block %s is duplicated", key); this->read_block (stream, bn); break;
1085  case BN_PV: if (PVs ()) _errorr2 ("Block %s is duplicated", key); this->read_block (stream, bn); break;
1086 
1087  case BN_NODES: this->read_block (stream, bn); break;
1088  case BN_ELEMS: if (ElAts ()) _errorr2 ("Block %s is duplicated", key); this->read_block (stream, bn); break;
1089 
1090  case BN_NL: if (NLs ()) _errorr2 ("Block %s is duplicated", key); this->read_block (stream, bn); break;
1091  case BN_CEL: if (CELs()) _errorr2 ("Block %s is duplicated", key); this->read_block (stream, bn); break;
1092  case BN_CFL: if (CFLs()) _errorr2 ("Block %s is duplicated", key); this->read_block (stream, bn); break;
1093  case BN_CBL: if (CBLs()) _errorr2 ("Block %s is duplicated", key); this->read_block (stream, bn); break;
1094 
1095  case BN_HN: this->read_block (stream, bn); break;
1096  case BN_RAN: this->read_block (stream, bn); break;
1097 
1098  case BN_FIXED: this->read_block (stream, bn); break;
1099 
1100  case BN_LTF: if (OOltfs ()) _errorr2 ("Block %s is duplicated", key); this->read_block (stream, bn); break;
1101  case BN_EXTRCT: if (OOextrs()) _errorr2 ("Block %s is duplicated", key); this->read_block (stream, bn); break;
1102 
1103  default: _errorr2 ("Wrong block name enum \"%s\"", key);
1104  }
1105 
1106  this->set_readedchars(true);
1107  if (!stream->isFile()) stream->relink_up();
1108 }
1109 
1112 {
1113  const char *str;
1114  char LINE[4095], WORD[255];
1115 
1116  //if (!stream->isFile() && i) stream->relink_next();
1117  if (GP_scan_line (stream, LINE) > 4094) _errorr("error"); str=LINE;
1118  while (SP_scan_word (str, WORD))
1119  if (STRCMP(WORD, "OOFEMrecord") == 0) {
1120  if (OOF_output_rec) _errorr ("keyword OOFEMrecord duplicated in block PROBLEM_ANALYSIS");
1122  }
1123  else _errorr2 ("Unsupported key name \"%s\" in block PROBLEM_OUTPUT", WORD);
1124 
1125 }
1126 
1129 {
1130  //* check block order
1131  if (bn == BN_NODES) if ( !BCs()) _warningg3 ("The block %s should be after block %s", BN_enum2char(BN_NODES), BN_enum2char(BN_BC));
1132  if (bn == BN_ELEMS) if (!CSs() || !Mats() || !BCs()) _warningg5 ("The block %s should be after blocks %s, %s and %s", BN_enum2char(BN_ELEMS), BN_enum2char(BN_CS), BN_enum2char(BN_MAT), BN_enum2char(BN_BC));
1133 
1134  if (bn == BN_NL) if (!BCs()) _warningg3 ("The block %s should be after block %s", BN_enum2char(BN_NL), BN_enum2char(BN_BC));
1135  if (bn == BN_CEL) if (!BCs()) _warningg3 ("The block %s should be after block %s", BN_enum2char(BN_CEL), BN_enum2char(BN_BC));
1136  if (bn == BN_CFL) if (!BCs()) _warningg3 ("The block %s should be after block %s", BN_enum2char(BN_CFL), BN_enum2char(BN_BC));
1137  if (bn == BN_CBL) if (!BCs()) _warningg3 ("The block %s should be after block %s", BN_enum2char(BN_CBL), BN_enum2char(BN_BC));
1138 
1139  //if (bn == BN_RAN) if (NdAt) _warningg3 ("The block %s should be before block %s", BN_enum2char(bn), BN_enum2char(BN_NODES));
1140  //if (bn == BN_HN) if (NdAt) _warningg3 ("The block %s should be before block %s", BN_enum2char(bn), BN_enum2char(BN_NODES));
1141 
1142  // count of rows
1143  int cr;
1144  if (bn == BN_ANAL)
1145  cr = 1;
1146  else {
1147  if (stream->isFile()) { fscanf (stream->file(), "%d", &cr); FP_skip_line (stream->file()); }
1148  else stream->tixel()->Parent()->ToElement()->QueryIntAttribute("Number", &cr);
1149  if (cr == 0) return;
1150  }
1151 
1152  // allocation of arrays
1153  switch (bn) {
1154  case BN_ANAL: break;
1155  case BN_CS: CSs .reallocup(cr); break;
1156  case BN_MAT: Mats .reallocup(cr); break;
1157  case BN_BC: BCs .reallocup(cr); break;
1158  case BN_PV: PVs .reallocup(cr); break;
1159  case BN_NL: NLs .reallocup(cr); break;
1160  case BN_CEL: CELs .reallocup(cr); break;
1161  case BN_CFL: CFLs .reallocup(cr); break;
1162  case BN_CBL: CBLs .reallocup(cr); break;
1163  case BN_FIXED: Fixed .reallocup(cr); break;
1164  case BN_HN:
1165  case BN_RAN:
1166  case BN_NODES: NdAts .reallocup(cr + NdAts()); break;
1167  case BN_ELEMS: ElAts .reallocup(cr); break;
1168  case BN_LTF: OOltfs .reallocup(cr); break;
1169  case BN_EXTRCT: OOextrs.reallocup(cr); break;
1170  default: _errorr2 ("Wrong block name enum \"%s\"", BN_enum2char(bn));
1171  }
1172 
1173  int id;
1174  const char *str;
1175  char LINE[4095];
1176 
1177  for (long i=0; i<cr; i++) {
1178  if (!stream->isFile() && i) { stream->relink_next(); stream->skip_commnet(); }
1179  if (GP_scan_line (stream, LINE) > 4094) _errorr("error"); str=LINE;
1180  if (bn!=BN_EXTRCT) SP_cutcomment (LINE);
1181  if (bn!=BN_LTF && bn!=BN_EXTRCT && bn!=BN_ANAL && bn!=BN_FIXED) SP_scan_number(str, id);
1182 
1183  if (bn == BN_RAN || bn == BN_HN) if (this->give_NdAt_with_prop(id)) _errorr2 ("Blocks RAN HN NODE problem with property %ld", id);
1184 
1185  switch (bn) {
1186  case BN_ANAL: ProbAnal->initialize_from (str, FFF_MIDAS); break;
1187  case BN_CS: if (id != i+1) _errorr ("Invalide id of cs"); CSs .add ( new CrossSection (this, i )) ->initialize_from (str, FFF_MIDAS); break;
1188  case BN_MAT: if (id != i+1) _errorr ("Invalide id of mat"); Mats.add ( new Material (this, i )) ->initialize_from (str, FFF_MIDAS); break;
1189  case BN_BC: if (id != i+1) _errorr ("Invalide id of bc"); BCs .add ( new BoundaryCond (this, i )) ->initialize_from (str, FFF_MIDAS); break;
1190  case BN_PV: SP_scan_expected_word_exit (str, "NodePV", "!NodePV", true); PVs.add(new PointDOFsBCPM(id, this)) ->scan_att_ndofs_new (str); break;
1191 
1192  case BN_NL: NLs .add ( new ABC_NLoad (this, id)) ->initialize_from (str, FFF_MIDAS); break;
1193  case BN_CEL: CELs.add ( new ABC_CELoad (this, id)) ->initialize_from (str, FFF_MIDAS); break;
1194  case BN_CFL: CFLs.add ( new ABC_CFLoad (this, id)) ->initialize_from (str, FFF_MIDAS); break;
1195  case BN_CBL: CBLs.add ( new ABC_CBLoad (this, id)) ->initialize_from (str, FFF_MIDAS); break;
1196  case BN_FIXED: Fixed.add ( new AssignFix (this, i )) ->initialize_from (str, FFF_MIDAS); break;
1197 
1198  case BN_HN: NdAts.add ( new HNAttribs (NULL, id, this)) ->initialize_from (str, FFF_MIDAS); break;
1199  case BN_RAN: NdAts.add ( new RANAttribs (NULL, id, this)) ->initialize_from (str, FFF_MIDAS); break;
1200  case BN_NODES: if (id == 0) _errorr("Zero property forbidden"); this->givealloc_NdAt_with_prop (id) ->initialize_from (str, FFF_MIDAS); break;
1201  case BN_ELEMS: ElAts.add ( new FElemAttribs(NULL, id, EAL_domain, this)) ->initialize_from (str, FFF_MIDAS); break;
1202  case BN_LTF: OOltfs.add ( new LoadTimeFunction(this, i )) ->initialize_from (str, FFF_MIDAS); break;
1203  case BN_EXTRCT: OOextrs.add ( new Attribute (this, i )) ->initialize_from (str, FFF_MIDAS); break;
1204 
1205  default: _errorr2 ("Wrong block name enum \"%s\"", BN_enum2char(bn));
1206  }
1207  }
1208 }
1209 
1210 
1211 //* **************************************
1212 //* *** READING OF MODEL / MESH ***
1213 //* **************************************
1218 {
1219  this->sodriver()->print_info_message (SODE_start_blue_arrow, "Reading of mesh files");
1220 
1221  for (int i=0; i<IN_mshFiLes(); i++) {
1222  Meshes.add(new Mesh(i, this, IN_numdom, IN_mshFiLes[i]->give_mmp()));
1223 
1224  switch (IN_mshFiLes[i]->give_ff()) {
1225  case FFF_T3d: Meshes[i]->read_mesh_T3d (IN_Path, IN_mshFiLes[i]->give_name()); break;
1226  case FFF_JKTK: Meshes[i]->read_mesh_JKTK (IN_Path, IN_mshFiLes[i]->give_name()); break;
1227  case FFF_VTK:
1228  case FFF_VTU:
1229  case FFF_VTP: this ->read_geometry_VTK (Meshes[i], IN_mshFiLes[i]->give_name()); break;
1230  case FFF_UNV: Meshes[i]->read_mesh_UNV (IN_Path, IN_mshFiLes[i]->give_name()); break;
1231  case FFF_ANSYS: Meshes[i]->read_mesh_ANSYS (IN_Path, IN_mshFiLes[i]->give_name()); break;
1232  case FFF_OOFEM: this ->read_mesh_OOFEM (Meshes[i], IN_mshFiLes[i]->give_name()); break;
1233  case FFF_SIFEL: this ->read_mesh_SIFEL (Meshes[i], IN_mshFiLes[i]->give_name()); break;
1234  //case FFF_VLNA: Meshes[i]->read_mesh_VLNA (path, filename[i]); break;
1235  default: _errorr2 ("Unknown type of mesh-input-file %ld", IN_mshFiLes[i]->give_ff());
1236  }
1237  }
1238 
1240 }
1243 {
1244  this->sodriver()->print_info_message (SODE_start_blue_arrow, "Reading of model files");
1245 
1246  for (int i=0; i<IN_mdlFiLes(); i++) {
1247  Models.add(new Model(i, this, IN_mdlFiLes[i]->give_mmp()));
1248 
1249  switch (IN_mdlFiLes[i]->give_ff()) {
1250  case FFF_POLYLINE: Models.last()->read_model_polylines (IN_Path, IN_mdlFiLes[i]->give_name()); break;
1251  case FFF_VTU:
1252  case FFF_VTK: this->read_geometry_VTK (Models[i], IN_mdlFiLes[i]->give_name()); break;
1253  case FFF_MELNIK: Models[i]->read_model_MELNIK(); break;
1254  default: _errorr2 ("Unknown type of model-input-file %ld", IN_mdlFiLes[i]->give_ff());
1255  }
1256  }
1257 
1259 }
1260 
1261 
1263 void Problem :: read_geometry_VTK (Geometry* geom, const char *filename)
1264 {
1265  char *file = new char[255];
1266  if (IN_Path) sprintf (file, "%s%s", IN_Path, filename);
1267  else sprintf (file, "%s", filename);
1268 
1269  Stream *stream = new Stream();
1270  stream->open(STRM_void, "r", (const char*&)file);
1271 
1272  //* reading
1273  this->read_geometry_VTK_core (geom, stream);
1274 
1275  //* close
1276  stream->close();
1277  delete stream;
1278 }
1281 {
1282  char DATASET = '-';
1283 
1284  if (stream->isFile()) {
1285  char WORD[255];
1286  // 1. 2. line
1287  FP_skip_line (stream->file(), 2);
1288  // 3. line
1289  FP_scan_expected_word_exit (stream->file(), "ASCII", "Invalid structure of the given VTK file", true);
1290  FP_skip_line (stream->file());
1291  // 4. line
1292  FP_scan_expected_word_exit (stream->file(), "DATASET", "Invalid structure of the given VTK file", true);
1293  FP_scan_word (stream->file(), WORD);
1294  FP_skip_line (stream->file());
1295 
1296  if (strcmp(WORD, "UNSTRUCTURED_GRID") == 0) DATASET='U';
1297  else if (strcmp(WORD, "POLYDATA") == 0) DATASET='P';
1298  else _errorr2 ("Unsupported DATATYPE \"%s\"", WORD);
1299  }
1300  else
1301  this->read_head_and_chars(stream, DATASET);
1302 
1303  //* ctrl file has to be readed before reading of geometry
1304  if (fulldata && ! readedchars) _errorr("ctrl characteristics are not given");
1305 
1306  //* *** READ GEOMETRY ***
1307  geom->read_VTK (DATASET, stream);
1308 }
1309 
1310 
1312 void Problem :: read_addata_VTK (Geometry* geom, const char *filename, bool sparse)
1313 {
1314  char *file = new char[255];
1315  if (IN_Path) sprintf (file, "%s%s", IN_Path, filename);
1316  else sprintf (file, "%s", filename);
1317 
1318  Stream *stream = new Stream();
1319  stream->open(STRM_void, "r", (const char*&)file);
1320 
1322  if (stream->isFile()) FP_skip_line (stream->file());
1323 
1324  //* reading
1325  if (!stream->isFile()) stream->relink_downF();
1326  geom->read_VTK ('-', stream, true, sparse);
1327 
1328  //* close
1329  stream->close();
1330  delete stream;
1331 }
1332 
1333 
1335 void read_line (FILE *stream, char *&dest, const char *name)
1336 {
1337  if (dest) _errorr2 ("\"%s\" line already given", name);
1338  FP_scan_line_alloc (stream, dest);
1339 }
1340 
1342 void Problem :: read_mesh_OOFEM (Mesh* mesh, const char *filename)
1343 {
1344  // open file
1345  FILE *in = _openFilePN("r", "OOFEM input file", IN_Path, filename);
1346 
1347  fulldata = true;
1348 
1349  // variable declaration
1350  long i;
1351  const char *str;
1352  char WORD[255], LINE[1023];
1353  int lLINE=1023;
1354 
1355 
1356  //* ****************
1357  //* *** HEAD ***
1358  //* ****************
1359  FP_skip_line_commented (in); read_line(in, output_file, "OUTPUT_FILE");
1360  if (output_file[0] == '0' && output_file[1] == '\0') {
1361  delete [] output_file;
1362  output_file = NULL;
1363  }
1364  //* comment
1365  FP_skip_line_commented (in); read_line(in, comment, "COMMENT");
1366  //* analysis description
1367  FP_scan_line_skip_emptyORcommented (in, LINE); str=LINE;
1369 
1370  //
1371  FP_scan_line_skip_emptyORcommented (in, LINE); str=LINE;
1372  SP_scan_expected_word_exit (str, "domain", "Invalid structure of the given OOFEM input file", CASE);
1373  SP_scan_word (str, WORD);
1374  this->set_DOFspnod (OOFEMdomain2DOFsPerNode(WORD));
1375  //
1376  read_line(in, OOF_output_rec, "OOFEM_OUTPUT");
1377  //
1378  long nn, ne, ccs, cmat, cbc, nic, cooltf;
1379  ; nn = ne = ccs = cmat = cbc = nic = cooltf = -1;
1380 
1381  fgets (LINE, lLINE, in); str=LINE;
1382  while (SP_scan_word (str, WORD))
1383  if (STRCMP(WORD, "ndofman" ) == 0) SP_scan_number (str, nn );
1384  else if (STRCMP(WORD, "nelem" ) == 0) SP_scan_number (str, ne );
1385  else if (STRCMP(WORD, "ncrosssect") == 0) SP_scan_number (str, ccs );
1386  else if (STRCMP(WORD, "nmat" ) == 0) SP_scan_number (str, cmat);
1387  else if (STRCMP(WORD, "nbc" ) == 0) SP_scan_number (str, cbc );
1388  else if (STRCMP(WORD, "nic" ) == 0) SP_scan_number (str, nic );
1389  else if (STRCMP(WORD, "nltf" ) == 0) SP_scan_number (str, cooltf);
1390  else _errorr2 ("Unsupported key name \"%s\"", WORD);
1391 
1392  if (nn<0 || ne<0 || ccs<0 || cmat<0 || cbc<0 || nic<0 || cooltf<0) _errorr("error");
1393 
1394  // skip nodes and elements
1395  long fpi = ftell (in);
1396  FP_skip_line_fast_skip_commented (in, nn + ne);
1397 
1398  //* *****************
1399  //* *** CHARS ***
1400  //* *****************
1402  //if (ccs > 9) _errorr ("Count of CS is > 10");
1403  CSs.reallocup(ccs);
1404 
1405  strcpy (LINE, "OOFEMrecord ");
1406  for (i=0; i<ccs; i++) {
1407  FP_scan_line_skip_emptyORcommented (in, LINE+13); str=LINE+13;
1408  SP_skip_word (str);
1409  SP_scan_expected_number_exit (str, i+1, "Invalide id of cs");
1410  ((char*)str)[-1] = 'x';
1411  if (i+1 >= 10) ((char*)str)[-2] = ' ';
1412  CSs.add(new CrossSection (this, i));
1413  CSs[i]->initialize_from (str=LINE, FFF_OOFEM);
1414  }
1415 
1417  if (cmat > 9) _errorr ("Count of Mat is > 10");
1418  Mats.reallocup(cmat);
1419 
1420  strcpy (LINE, "OOFEMrecord ");
1421  for (i=0; i<cmat; i++) {
1422  FP_scan_line_skip_emptyORcommented (in, LINE+13); str=LINE+13;
1423  SP_skip_word (str);
1424  SP_scan_expected_number_exit (str, i+1, "Invalide id of mat");
1425  ((char*)str)[-1] = 'x';
1426  Mats.add(new Material (this, i));
1427  Mats[i]->initialize_from (str=LINE, FFF_OOFEM);
1428  }
1429 
1431  if (cbc > 9) _errorr ("Count of BC is > 10");
1432  BCs.reallocup(cbc);
1433 
1434  strcpy (LINE, "OOFEMrecord ");
1435  for (i=0; i<cbc; i++) {
1436  FP_scan_line_skip_emptyORcommented (in, LINE+13); str=LINE+19;
1437  SP_skip_word (str);
1438  SP_scan_expected_number_exit (str, i+1, "Invalide id of bc");
1439  ((char*)str)[-1] = 'x';
1440  BCs.add(new BoundaryCond (this, i));
1441  BCs[i]->initialize_from (str=LINE, FFF_OOFEM);
1442  }
1443 
1445  if (nic != 0) _errorr ("nic is not equal to 0");
1446 
1447  //* LTF
1448  OOltfs.reallocup(cooltf);
1449 
1450  for (i=0; i<cooltf; i++) {
1451  FP_scan_line_skip_emptyORcommented (in, LINE); str=LINE;
1452  OOltfs.add(new LoadTimeFunction (this, i));
1453  OOltfs[i]->initialize_from (str, FFF_OOFEM);
1454  }
1455 
1456  //* EXTRACT
1457  if (getc (in) == '#') {
1458  ungetc('#',in);
1459  long cooex = FP_number_of_lines (in, true);
1460  OOextrs.reallocup(cooex);
1461  for (i=0; i<cooex; i++) {
1462  FP_scan_line (in, LINE); str=LINE;
1463  OOextrs.add(new Attribute (this, i));
1464  OOextrs[i]->initialize_from (str, FFF_OOFEM);
1465  }
1466  }
1467 
1468 
1469  fseek(in, fpi, SEEK_SET);
1470  //* ****************
1471  //* *** MESH ***
1472  //* ****************
1473  mesh->read_mesh_OOFEM (in, nn, ne);
1474 
1475  this->set_readedchars(true);
1476 
1477  //
1478  fclose (in);
1479 } //read_mesh_OOFEM
1480 
1482 void Problem :: read_mesh_SIFEL (Mesh* mesh, const char *filename)
1483 {
1484  // open file
1485  FILE *in = _openFilePN("r", "SIFEL input file", IN_Path, filename);
1486 
1487  fulldata = true;
1488 
1489  // variable declaration
1490  int auxi, ntyp, nptyp;
1491  long i, j, auxl;
1492  //double auxd;
1493  const char *str;
1494  char LINE[1023];
1495  FElement *elem;
1496 
1497  femFileFormat fff = FFF_SIFEL;
1498 
1499 
1500  //* ****************
1501  //* *** HEAD ***
1502  //* ****************
1503  FP_skip_line_commented (in); read_line(in, comment, "COMMENT");
1504  fscanf (in, "%d", &stdout_print_level);
1505  ProbAnal->initialize_from (in, fff);
1506 
1507  // skip nodes
1508  long fpi = ftell (in);
1509  FP_skip_comment(in); fscanf (in, "%ld", &auxl); FP_skip_line (in, auxl+1);
1510  FP_skip_comment(in); fscanf (in, "%ld", &auxl); FP_skip_line (in, auxl+1);
1511  FP_skip_comment(in); fscanf (in, "%ld", &auxl); FP_skip_line (in, auxl+1);
1512 
1513  //* *****************
1514  //* *** CHARS ***
1515  //* *****************
1516  //* MATERIALS
1517  FP_skip_comment(in); fscanf (in, "%d", &ntyp);
1518  strcpy (LINE, "SIFELrecord ");
1519  for (i=0; i<ntyp; i++) {
1520  fscanf (in, "%d", &auxi);
1521  sprintf (LINE+13, " %4d ", auxi);
1522  fscanf (in, "%d", &nptyp);
1523  Mats.reallocplus(nptyp);
1524  for (j=0; j<nptyp; j++) {
1525  FP_skip_line (in);
1526  FP_scan_line (in, LINE+19);
1527  Mats.add(new Material (this, Mats()));
1528  Mats.last()->initialize_from (str=LINE, FFF_SIFEL);
1529  }
1530  }
1531 
1532  //* CROSS SECTIONS
1533  FP_skip_comment(in); fscanf (in, "%d", &ntyp);
1534  strcpy (LINE, "SIFELrecord ");
1535  for (i=0; i<ntyp; i++) {
1536  fscanf (in, "%d", &auxi);
1537  sprintf (LINE+11, " %4d ", auxi);
1538  fscanf (in, "%d", &nptyp);
1539  CSs.reallocplus(nptyp);
1540  for (j=0; j<nptyp; j++) {
1541  FP_skip_line (in);
1542  FP_scan_line (in, LINE+17);
1543  CSs.add(new CrossSection (this, CSs()));
1544  CSs.last()->initialize_from (str=LINE, FFF_SIFEL);
1545  }
1546  }
1547 
1548  //* MESH + LOAD
1549  auxl = ftell (in);
1550  fseek(in, fpi, SEEK_SET);
1551  mesh->read_mesh_SIFEL (in);
1552  fseek(in, auxl, SEEK_SET);
1553 
1554  //* detecting of ... global nDOFs in SIFEL
1555  if (this->give_analgroup() == PAG_transport) {
1556  switch (Meshes[0]->give_Pjnt(0)->give_pointAttribs()->give_nDOFs()) {
1557  case 1: this->set_DOFspnod (DPN_TR_1); break;
1558  case 2: this->set_DOFspnod (DPN_TR_2); break;
1559  default: errol;
1560  }
1561  }
1562  else if (this->give_analgroup() == PAG_mechanics) {
1563  switch (Meshes[0]->give_Pjnt(0)->give_pointAttribs()->give_nDOFs()) {
1564  case 3: this->set_DOFspnod (DPN_DxyzR___); break;
1565  default: errol;
1566  }
1567  }
1568  else errol;
1569 
1570  //* LOAD CASES
1571  //GPA<const BoundaryCond> *bca;
1572  BoundaryCond *bc;
1573  int ncomp;
1574  long num, id, interedgeID;
1575  //if (probtype != PAT_statics_linear) errol;
1576  FP_skip_comment(in); fscanf (in, "%d", &auxi);
1577  if (auxi == 2 && this->give_analgroup() == PAG_transport) { fclose (in); return; }
1578  if (auxi != 1) errol; // nlc
1579 
1580  if (this->give_analgroup() == PAG_mechanics) {
1581  // number loaded nodes
1582  FP_scan_line_skip_emptyORcommented (in, LINE); str=LINE;
1583  SP_scan_number (str, num);
1584  for (i=0; i<num; i++) {
1585  fscanf (in, "%ld", &id); id--;
1586  ((Point*)mesh->give_Pjnt(id))->give_pointAttribs()->read_bc(in, fff);
1587  }
1588 
1589  // number loaded elems
1590  FP_scan_line_skip_emptyORcommented (in, LINE); str=LINE;
1591  SP_scan_number (str, num);
1592  for (i=0; i<num; i++) {
1593  _errorr ("--------------------------------toto soupni do stejne fce jako noudy---------------------------------------------------------------------------------------------------");
1594  fscanf (in, "%ld", &id); id--;
1595  elem = (FElement*)mesh->give_Elem(id);
1596  fscanf (in, "%d", &auxi);
1597  if (auxi == 2) { // 2 = edge
1598  for (j=0; j<elem->give_ned(); j++) {
1599  fscanf (in, "%d", &auxi);
1600  if (auxi) {
1601  interedgeID = ECN_convert_e2i (j, 1, elem->give_ord(), elem->give_cellGeom(), fff);
1602 
1603  ncomp = elem->give_nnoed(j) * elem->give_point(0)->give_pointAttribs()->give_nDOFs();
1604  bc = new BoundaryCond(this, BCs());
1605  bc->scan_components(in, ncomp);
1606 
1607  ((Edge*)elem->give_edge(interedgeID))->give_attributes()->add_load(this->add_find_BC(bc));
1608  }
1609  }
1610  }
1611  else if (auxi == 1) { // 1 = body
1612  ncomp = mesh->give_Elem(id)->give_nno() * mesh->give_Elem(id)->give_point(0)->give_pointAttribs()->give_nDOFs();
1613  bc = new BoundaryCond(this, BCs());
1614  bc->scan_components(in, ncomp);
1615 
1616  ((Element*)mesh->give_Elem(id))->give_attributes()->add_load(this->add_find_BC(bc)); bc = NULL;
1617  }
1618  }
1619 
1620  FP_skip_comment(in); fscanf (in, "%ld", &num); if (num != 0) errol; // number of prescribed nodal vals = displacements
1621  FP_skip_comment(in); fscanf (in, "%ld", &num); if (num != 0) errol; // tempr
1622  FP_skip_comment(in); fscanf (in, "%ld", &num); if (num != 0) errol; // eigenstr
1623  }
1624  else if (this->give_analgroup() == PAG_transport) {
1625  // prescribed quantities
1626  FP_scan_line_skip_emptyORcommented (in, LINE); str=LINE; SP_scan_number (str, num);
1627  if (this->give_analtype() == PAT_stationary) ncomp = 2;
1628  else errol;
1629  for (i=0; i<num; i++) {
1630  bc = new BoundaryCond(this, BCs());
1631  bc->scan_components(in, ncomp);
1632  bc->setadd_loctype_sifif (BC_PV, i);
1633 
1634  this->add_uniq_BC(bc); bc = NULL;
1635  }
1636 
1637  FP_skip_comment(in); fscanf (in, "%ld", &num); if (num != 0) errol; // the number of source
1638  FP_skip_comment(in); fscanf (in, "%ld", &num); if (num != 0) errol; // the number of elements with loaded edges
1639  FP_skip_comment(in); fscanf (in, "%ld", &num); if (num != 0) errol; // the number of nodal values for edge loads
1640  FP_skip_comment(in); fscanf (in, "%ld", &num); if (num != 0) errol; // the number of climatic conditions
1641  FP_skip_comment(in); fscanf (in, "%ld", &num); if (num != 0) errol; // the number of time functions
1642  }
1643 
1644  // text output ... filename
1645  FP_scan_line_skip_emptyORcommented (in, LINE); str=LINE;
1646  SP_scan_number (str, text_output);
1647  if (text_output == 1) {
1648  // file name
1650  read_line(in, output_file, "OUTPUT_FILE");
1651 
1652  //FP_skip_line (in, 2);
1653 
1654  // NODES
1655  // steps
1656  FP_skip_comment(in); fscanf (in, "%d", &to_nodes);
1657  if (to_nodes) {
1658  fscanf (in, "%d", &to_nodes_type); if (to_nodes_type != 1) errol;
1659  // unknown
1660  fscanf (in, "%d", &ton_displ); if (ton_displ) { fscanf (in, "%d", &ton_displ_type); if (ton_displ_type != 1) errol; }
1661  // strains / gradients
1662  fscanf (in, "%d", &ton_strain); if (ton_strain) { errol; } // errol protoze nevim co se stane kdyz to nebude predpokladana hodnota fscanf (in, "%d", &auxi);
1663  // stresses / fluxes
1664  fscanf (in, "%d", &ton_stress); if (ton_stress) { errol; } // errol protoze nevim co se stane kdyz to nebude predpokladana hodnota fscanf (in, "%d", &auxi);
1665  // other
1666  fscanf (in, "%d", &ton_other); if (ton_other) { errol; } // errol protoze nevim co se stane kdyz to nebude predpokladana hodnota fscanf (in, "%d", &auxi);
1667  // reactions / eq.flux nodes
1668  fscanf (in, "%d", &ton_react);
1669 
1670  if (this->give_analgroup() == PAG_transport) {
1671  fscanf (in, "%d", &auxi); if (auxi) errol;
1672  }
1673  }
1674 
1675  // ELEMES
1676  // steps
1677  FP_skip_comment(in); fscanf (in, "%d", &to_elems);
1678  if (to_elems) {
1679  fscanf (in, "%d", &to_elems_type); if (to_elems_type != 1) errol;
1680  // strains / gradients
1681  fscanf (in, "%d", &toe_strain); if (toe_strain) { fscanf (in, "%d %d", &toe_strain_type, &toe_strain_transf); if (toe_strain_type !=1 || toe_strain_transf != 0) errol; }
1682  // stresses / fluxes
1683  fscanf (in, "%d", &toe_stress); if (toe_stress) { fscanf (in, "%d %d", &toe_stress_type, &toe_stress_transf); if (toe_stress_type !=1 || toe_stress_transf != 0) errol; }
1684  // other
1685  fscanf (in, "%d", &toe_other); if (toe_other) { errol; } // errol protoze nevim co se stane kdyz to nebude predpokladana hodnota fscanf (in, "%d", &auxi);
1686  // reactions / eq.flux nodes
1687  fscanf (in, "%d", &toe_nevim); if (toe_nevim) { errol; } // errol protoze nevim co se stane kdyz to nebude predpokladana hodnota fscanf (in, "%d", &auxi);
1688  }
1689  }
1690 
1691  // grafic output
1692  FP_skip_comment(in);
1693  fscanf (in, "%d", &grafic_output); if (grafic_output) errol;
1694 
1696  fclose (in);
1697 }
1698 
1699 
1700 
1702 void Problem :: read_addata (bool mdl)
1703 {
1704  if (!IN_VTKaddata && !IN_VTKaddatasprs) return;
1705 
1706  //* add data are for primary model/mesh only
1707  Geometry *geom;
1708  if (mdl) geom = Models[0];
1709  else geom = Meshes[0];
1710 
1711  this->sodriver()->print_info_message (SODE_start_blue_arrow, "Reading of add data of VTK format");
1712 
1713  if (IN_VTKaddata ) this->read_addata_VTK (geom, IN_VTKaddata ->give_name(), false);
1714  if (IN_VTKaddatasprs) this->read_addata_VTK (geom, IN_VTKaddatasprs->give_name(), true);
1715 
1717 }
1718 
1719 
1720 
1721 //* ********************************************************************************************
1722 //* *** *** *** *** PRINT OUTPUT *** *** *** ***
1723 //* ********************************************************************************************
1725 {
1726  this->sodriver()->print_info_message (SODE_start_blue_arrow, "OOFEM input file print");
1727 
1728  if (!fulldata) _errorr("Full data (material, support) was not given => we cannot print OOFEM input file");
1729 
1730  FILE *out;
1731  long i, did;
1732  femFileFormat fff = FFF_OOFEM;
1733 
1734  // write to memory yes or not
1735  bool wmem;
1736  if (this->OM == OM_Design2design &&
1737  this->give_PDBO(PDBO_tmpFileWrite2hdd) == false &&
1738  Meshes[0]->give_Parallel() == false)
1739  wmem = true;
1740  else
1741  wmem = false;
1742 
1743  char suff[33], *end;
1744  if (PDBO[PDBO_OUT_solverINctrl]) { sprintf (suff, ".oofem.rslt.in"); end = suff+14; }
1745  else { sprintf (suff, ".oofem.in"); end = suff+9; }
1746 
1747  //* ***************************************
1748  //* *** *** PRINTING *** ***
1749  //* ***************************************
1750  for (did=0; did<Meshes[0]->give_NumDomains(); did++) {
1751  if (Meshes[0]->give_Parallel()) sprintf (end, ".%ld", did);
1752  //* open file stream
1753  //if (wmem) out = open_memstream(&solver_file_ptr, &solver_file_size);
1754  //else
1755  out = _openFilePNS ("w", "Parallel mesh", NULL, OUT_moFILE->give_name(), suff);
1756 
1757 
1758  //* *** HEAD ***
1759  //fprintf (out,"%s%s.out%s\n", Path, Filename, domsuff);
1760  if (output_file) fprintf (out,"%s\n", output_file);
1761  else fprintf (out,"0\n");
1762 
1763  // job comment
1764  if (comment) fprintf (out, "%s\n", comment);
1765  else fprintf (out, "this is default job comment\n");
1766  // analysis record
1767  ProbAnal->print_row_OOFEM(out);
1768  // domain type
1769  fprintf (out, "domain %s\n", DOFsPerNode2OOFEMdomain(DOFspnod));
1770  // output
1771  if (OOF_output_rec) fprintf (out, "%s\n", OOF_output_rec);
1772  else fprintf (out, "OutputManager tstep_all dofman_all element_all\n");
1773 
1774  // number of nodes
1775  fprintf (out, "ndofman %ld", Meshes[0]->give_NnAtDom(did));
1776  // number of elements
1777  fprintf (out, " nelem %ld" , Meshes[0]->give_NeAtDom(did));
1778  // number of ...
1779  fprintf (out, " ncrosssect %ld nmat %ld nbc %ld nic 0 nltf %ld\n",
1780  this->CSs(), this->Mats(), this->BCs(), this->OOltfs());
1781 
1782 
1783  //* *** NODES ***
1784  Meshes[0]->print_block_nodes(out, fff, did);
1785  if (wmem) {
1786  fflush(out);
1787  if (solver_file_size > 1e7) _errorr2("size of oofem.in exceeded 10MB, %d", solver_file_size/1e6);
1788  }
1789 
1790  //* *** ELEMENTS ***
1791  Meshes[0]->print_block_elems(out, fff, did);
1792  if (wmem) {
1793  fflush(out);
1794  if (solver_file_size > 1e7) _errorr2("size of oofem.in exceeded 10MB, %d", solver_file_size/1e6);
1795  }
1796 
1797  //* *** END BLOCK ***
1798  for (i=0; i<CSs (); i++) CSs [i]->print_row (out, fff, did);
1799  for (i=0; i<Mats (); i++) Mats [i]->print_row (out, fff, did);
1800  for (i=0; i<BCs (); i++) BCs [i]->print_row (out, fff, did);
1801  for (i=0; i<OOltfs (); i++) OOltfs [i]->print_row (out, fff, did);
1802  for (i=0; i<OOextrs(); i++) OOextrs[i]->print_row (out, fff, did);
1803 
1804  fclose (out);
1805 
1806  }// end of loop over domains
1807 
1809 }
1812 {
1813  this->sodriver()->print_info_message (SODE_start_blue_arrow, "SIFEL input file print");
1814 
1815  if (!fulldata) _errorr("Full data (material, support) was not given => we cannot print SIFEL input file");
1816 
1817  FILE *out;
1818  int domain = 0;
1819  //enumSolver sol = SOL_SIFEL;
1820  femFileFormat fff = FFF_SIFEL;
1821 
1822  char suff[16];
1823  if (PDBO[PDBO_OUT_solverINctrl]) sprintf (suff, ".sifel.rslt.in");
1824  else sprintf (suff, ".sifel.in");
1825 
1826  //* ***************************************
1827  //* *** *** PRINTING *** ***
1828  //* ***************************************
1829  out = _openFilePNS ("w", "Sifel mesh", NULL, OUT_moFILE->give_name(), suff);
1830 
1831  //* *** HEAD ***
1832  // job comment
1833  if (comment) fprintf (out, "%s\n", comment);
1834  else fprintf (out, "this is default job comment\n");
1835 
1836  //* stdout_print_level
1837  fprintf (out,"%d\n", stdout_print_level);
1838  // analysis record
1840 
1841  //* *** NODES ***
1842  fprintf (out,"\n\n%ld\n", Meshes[0]->give_Npts());
1843  Meshes[0]->print_block_nodes(out, fff, domain);
1844 
1845  //* supports
1846  Meshes[0]->print_block_supported_dofs(out, fff, domain);
1847 
1848  //* *** ELEMENTS ***
1849  fprintf (out,"\n\n%ld\n", Meshes[0]->give_Nels());
1850  Meshes[0]->print_block_elems(out, fff, domain);
1851 
1852  //* *** END BLOCK ***
1853  //* MATERIALS
1854  long i, j;
1855  fprintf (out,"\n\n# definition of materials\n");
1856  fprintf (out,"%ld\n", sifMats.give_number_of_nonzeros());
1857  for (i=1; i<cMaterialTypes; i++) {
1858  if (sifMats[i]) {
1859  fprintf (out,"%d %ld\n", MaterialType_e2i_SIFEL ((MaterialType)i, this->give_analgroup()), sifMats[i]);
1860  for (j=0; j<Mats(); j++) {
1861  if (Mats[j]->give_loctype() == i)
1862  Mats[j]->print_row (out, fff, domain);
1863  }
1864  }
1865  }
1866  //* CROSS SECTIONS
1867  fprintf (out,"\n\n# definition of cross-sections\n");
1868  int auxi = (sifCSs[CST_2d] ? 1 : 0) + (sifCSs[CST_Truss] ? 1 : 0) + (sifCSs[CST_Beam] ? 1 : 0);
1869  fprintf (out,"%d\n", auxi);
1870  for (i=1; i<cCrossSectTypes; i++) {
1871  if (i == CST_3d) continue;
1872  if (sifCSs[i]) {
1873  fprintf (out,"%d %ld\n", CrossSectType_e2i_SIFEL ((CrossSectType)i, this->give_analgroup()), sifCSs[i]);
1874  for (j=0; j<CSs(); j++) {
1875  if (CSs[j]->give_loctype_or_type() == i)
1876  CSs[j]->print_row (out, fff, domain);
1877  }
1878  }
1879  }
1880 
1881  //* LOAD CASES
1882  fprintf (out,"\n\n# number of load cases\n");
1883  fprintf (out,"%d\n", 1); // nlc
1884 
1885  if (this->give_analgroup() == PAG_mechanics) {
1886  long n, i;
1887  //* nodal load
1888  fprintf (out,"\n# nodal load\n");
1889  Meshes[0]->print_block_nodal_load(out, fff, domain);
1890 
1891  //* load of elements
1892  fprintf (out,"\n# load of elements\n");
1893  for (n=i=0; i<Meshes[0]->give_Nels(); i++) if (Meshes[0]->give_Elem(i)->give_elemAttribs()->is_loaded()) n++;
1894  fprintf (out,"%ld\n", n);
1895  for (i=0; i<Meshes[0]->give_Nels(); i++) {
1896  Meshes[0]->give_Elem(i)->give_elemAttribs()->print_Ebc_SIFEL(out);
1897  Meshes[0]->give_Elem(i)->give_elemAttribs()->print_Fbc_SIFEL(out);
1898  Meshes[0]->give_Elem(i)->give_elemAttribs()->print_Bbc_SIFEL(out);
1899  }
1900 
1901  //* prescribed displacements
1902  fprintf (out,"\n# prescribed displacements\n"); fprintf (out,"%d\n", 0);
1903  //* temperature load
1904  fprintf (out,"\n# temperature load\n"); fprintf (out,"%d\n", 0);
1905  //* eigenstrains
1906  fprintf (out,"\n# eigenstrains\n"); fprintf (out,"%d\n", 0);
1907 
1908  //* text output
1909  fprintf (out,"\n# text output\n");
1910  fprintf (out,"%d\n", text_output);
1911  if (text_output) {
1912  //* file name
1913  if (output_file) fprintf (out,"%s\n", output_file);
1914  else fprintf (out,"%s.sifel.out\n", OUT_moFILE->give_name());
1915  //* NODES
1916  fprintf (out,"#nodes\n");
1917  fprintf (out,"%d %d\n", to_nodes, to_nodes_type);
1918  fprintf (out,"%d", ton_displ); if (ton_displ) fprintf (out," %d\n", ton_displ_type); else fprintf (out,"\n");
1919  fprintf (out,"%d", ton_strain); if (ton_strain) fprintf (out," %d %d\n", ton_strain_type, ton_strain_transf); else fprintf (out,"\n");
1920  fprintf (out,"%d", ton_stress); if (ton_stress) fprintf (out," %d %d\n", ton_stress_type, ton_stress_transf); else fprintf (out,"\n");
1921  fprintf (out,"%d", ton_other); if (ton_other) errol; else fprintf (out,"\n");
1922  fprintf (out,"%d", ton_react); fprintf (out,"\n");
1923  //* ELEMENTS
1924  fprintf (out,"#elements\n");
1925  fprintf (out,"%d %d\n", to_elems, to_elems_type);
1926  fprintf (out,"%d", toe_strain); if (toe_strain) fprintf (out," %d %d\n", toe_strain_type, toe_strain_transf); else fprintf (out,"\n");
1927  fprintf (out,"%d", toe_stress); if (toe_stress) fprintf (out," %d %d\n", toe_stress_type, toe_stress_transf); else fprintf (out,"\n");
1928  fprintf (out,"%d", toe_other); if (toe_other) errol; else fprintf (out,"\n");
1929  fprintf (out,"%d", toe_nevim); fprintf (out,"\n");
1930  }
1931 
1932  //* grafic output, 0 supposed temporarily
1933  fprintf (out,"\n# grafic output\n");
1934  fprintf (out,"%d\n", grafic_output);
1935  }
1936  if (this->give_analgroup() == PAG_transport) {
1937  fprintf (out,"\n%ld\n", sifBCs[BC_PV]);
1938 
1939  for (i=0; i<BCs(); i++)
1940  if (BCs[i]->give_loctype() == BC_PV)
1941  BCs[i]->print_row(out, fff, domain);
1942 
1943  fprintf (out,"\n%d\n\n%d\n\n%d\n\n%d\n\n%d\n\n\n%d\n%d\n", 0, 0, 0, 0, 0, 0, 0); // ??
1944  }
1945  // //* output file name
1946  // if (output_file) fprintf (out,"%s\n", output_file);
1947  // else fprintf (out,"0\n");
1948  //* stdout_print_level
1949  //fprintf (out,"%d %d\n", stdout_print_level);
1950 
1951  fclose (out);
1952 
1954 }
1957 {
1958  this->sodriver()->print_info_message (SODE_start_blue_arrow, "ANSYS input file print");
1959 
1960  if (!fulldata) _errorr("Full data (material, support) was not given => we cannot print ANSYS input file");
1961 
1962  FILE *out;
1963  int i, domain = 0;
1964  femFileFormat fff = FFF_ANSYS;
1965 
1966  char suff[16];
1967  if (PDBO[PDBO_OUT_solverINctrl]) sprintf (suff, ".ansys.rslt.in");
1968  else sprintf (suff, ".ansys.in");
1969 
1970  //* ***************************************
1971  //* *** *** PRINTING *** ***
1972  //* ***************************************
1973  out = _openFilePNS ("w", "ANSYS mesh", NULL, OUT_moFILE->give_name(), suff);
1974 
1975  //* *** HEAD ***
1976  fprintf (out, "!! *************************************************\n");
1977  fprintf (out, "!! *** This file was generated by MIDAS 0.63 ***\n");
1978  fprintf (out, "!! *************************************************\n");
1979  fprintf (out, "\n");
1980 
1981  fprintf (out, "!!!\n");
1982  fprintf (out, "!!! START\n");
1983  fprintf (out, "!!!\n");
1984 
1985  fprintf (out, "fini\n");
1986  fprintf (out, "/CLEAR, start\n\n");
1987 
1988  fprintf (out, "/PREP7\n");
1989  fprintf (out, "btol, 1.e-6\n");
1990 
1991  fprintf (out, "\n\n");
1992 
1993  //* CS
1994  fprintf (out, "!!!\n");
1995  fprintf (out, "!!! Definition of cross sections\n");
1996  fprintf (out, "!!!\n");
1997  for (i=0; i<CSs (); i++) CSs [i]->print_row (out, fff, domain);
1998 
1999  //* MAT
2000  fprintf (out, "!!!\n");
2001  fprintf (out, "!!! Definition of materials properties\n");
2002  fprintf (out, "!!!\n");
2003  for (i=0; i<Mats(); i++) Mats[i]->print_row (out, fff, domain);
2004  fprintf (out, "\n");
2005 
2006  //* MESH
2007  fprintf (out, "!!!\n");
2008  fprintf (out, "!!! Mesh properties\n");
2009  fprintf (out, "!!!\n");
2010 
2011  for (i=FET_ANSYS_start+1; i<FET_ANSYS_end; i++) fprintf (out, "ET, %d, %s\n", i-FET_ANSYS_start, FETSet_e2s_ANSYS ((FiniteElementType)i));
2012  fprintf (out, "\n");
2013 
2014  //* NODES
2015  fprintf (out, "!!!\n");
2016  fprintf (out, "!!! Nodes\n");
2017  fprintf (out, "!!!\n");
2018  Meshes[0]->print_block_nodes(out, fff, domain);
2019  fprintf (out, "\n");
2020 
2021  //* *** CONSTRAINED dofs ***
2022  fprintf (out, "!!!\n");
2023  fprintf (out, "!!! Constrained dofs\n");
2024  fprintf (out, "!!!\n");
2025  Meshes[0]->print_block_supported_dofs(out, fff, domain);
2026  fprintf (out, "\n");
2027 
2028  //* *** ELEMENTS ***
2029  fprintf (out, "!!!\n");
2030  fprintf (out, "!!! Elements\n");
2031  fprintf (out, "!!!\n");
2032  Meshes[0]->print_block_elems(out, fff, domain);
2033 
2034  fprintf (out, "\nnumcmp,all\n\n");
2035 
2036  //* Nodal load
2037  fprintf (out, "!!!\n");
2038  fprintf (out, "!!! Nodal load\n");
2039  fprintf (out, "!!!\n");
2040  Meshes[0]->print_block_nodal_load(out, fff, domain);
2041  fprintf (out, "\n");
2042 
2043  //* Gravity load
2044  fprintf (out, "!!!\n");
2045  fprintf (out, "!!! Gravity load\n");
2046  fprintf (out, "!!!\n");
2047  Meshes[0]->print_block_gravity_load_ANSYS(out);
2048 
2049  //* Solution
2050  fprintf (out, "!!!\n");
2051  fprintf (out, "!!! Solution statika\n");
2052  fprintf (out, "!!!\n");
2053  fprintf (out, "FINISH\n");
2054  fprintf (out, "ALLSEL,ALL\n");
2055  fprintf (out, "\n");
2056  fprintf (out, "/SOLUTION\n");
2057  fprintf (out, "ANTYPE,STATIC\n");
2058  fprintf (out, "SOLVE\n");
2059  fprintf (out, "\n");
2060  fprintf (out, "\n");
2061  fprintf (out, "\n");
2062  fprintf (out, "!!!\n");
2063  fprintf (out, "!!! Solution stability\n");
2064  fprintf (out, "!!!\n");
2065  fprintf (out, "FINISH\n");
2066  fprintf (out, "ALLSEL,ALL\n");
2067  fprintf (out, "\n");
2068  fprintf (out, "/SOLUTION\n");
2069  fprintf (out, "pstres,on\n");
2070  fprintf (out, "SOLVE\n");
2071  fprintf (out, "FINISH\n");
2072  fprintf (out, "\n");
2073  fprintf (out, "/SOLUTION\n");
2074  fprintf (out, "ANTYPE,BUCKLE\n");
2075  fprintf (out, "BUCOPT,LANB,1\n");
2076  fprintf (out, "MXPAND,1,0,0,0,0.001,\n");
2077  fprintf (out, "SOLVE\n");
2078  fprintf (out, "FINISH\n");
2079  fprintf (out, "\n");
2080  fprintf (out, "\n");
2081  fprintf (out, "!!!\n");
2082  fprintf (out, "!!! Output\n");
2083  fprintf (out, "!!!\n");
2084  fprintf (out, "FINISH\n");
2085  fprintf (out, "NSEL,ALL\n");
2086  fprintf (out, "\n");
2087  fprintf (out, "/POST1\n");
2088  fprintf (out, "SET,LIST\n");
2089  fprintf (out, "SET,FIRST\n");
2090  fprintf (out, "\n");
2091  fprintf (out, "/POST1\n");
2092  fprintf (out, "/output,this.ansys.dat\n");
2093  fprintf (out, "prnsol,u,z\n");
2094  fprintf (out, "/output\n");
2095 
2096  fclose (out);
2097 
2099 }
2100 
2101 
2103 void Problem :: print_control (void) const
2104 {
2105  this->sodriver()->print_info_message (SODE_start_blue_arrow, "Control print");
2106 
2107  FILE *conout = _openFilePNS ("w", "Control output", NULL, OUT_moFILE->give_name(), ".test.ctrl");
2108 
2109  Meshes[0]->print_control (conout);
2110 
2111  if (Models()) {
2112  fprintf (conout,"\n\n\n");
2113  fprintf (conout," PPPPP OOOO L YY YY L II N N EEEEE SSSS \n");
2114  fprintf (conout," P P O O L YY YY L II NN N E S S \n");
2115  fprintf (conout," P P O O L YYYY L II N N N EEE SS \n");
2116  fprintf (conout," PPPPP O O L YY L II N N N EEE SS \n");
2117  fprintf (conout," PP O O L YY L II N NN E S S \n");
2118  fprintf (conout," PP OOOO LLLLL YY LLLLL II N N EEEEE SSSS \n");
2119 
2120  for (long i=0; i<Models(); i++)
2121  Models[i]->print_control (conout);
2122  }
2123 
2124  fclose (conout);
2125 
2127 }
2128 
2129 } // namespace midaspace
FiLe * IN_file_results_addataVTK
Definition: problem.h:112
void read_models(void)
Definition: problem.cpp:1242
DOFsPerNode DOFsPerNode_s2e(const char *val)
Definition: alias.h:708
bool relink_next(void)
Definition: tixy2.h:157
DOFsPerNode give_DOFsPerNode(void)
Definition: geometry.cpp:2797
GPA< AssignFix > Fixed
Definition: problem.h:278
femFileFormat
Definition: alias.h:632
FiLe * IN_VTKaddatasprs
Definition: problem.h:110
const CrossSection * give_3dCS(void)
Definition: problem.cpp:346
long GP_scan_line(Stream *stream, char *dest)
... line; return value is length of the line
Definition: tixy2.cpp:76
bool give_PDBO(ProbDescBoolOpt pdbo) const
Definition: problem.h:187
FiLe * IN_ctrlfile
Definition: problem.h:106
~Problem()
DESTRUCTOR.
Definition: problem.cpp:106
const char * DOFsPerNode2OOFEMdomain(DOFsPerNode od)
Definition: alias.h:740
void set_DOFspnod(DOFsPerNode val)
Definition: problem.h:248
void solve(void)
solve the problem - main function
Definition: problem.cpp:378
int FP_scan_word(FILE *src, char *dest)
... word; return value is length of the word
Definition: librw.cpp:356
void read_meshes(void)
reading of files with model/mesh and possibly info about solving
Definition: problem.cpp:1217
void set_empty_name_from_base(FiLe *src)
Definition: taux.h:106
const BoundaryCond * add_uniq_BC(BoundaryCond *val)
add new BC
Definition: problem.cpp:238
DOFsPerNode give_dpn(void) const
Definition: attribute.h:372
int MaterialType_e2i_SIFEL(MaterialType val, PAGroup pg)
Definition: alias.h:544
const XMLElement * XP_give_unique_expected_elem(const XMLNode *xelem, const char *name, bool uniq)
Definition: tixy2.cpp:117
PAGroup give_analgroup(void) const
Definition: problem.cpp:179
DOFsPerNode
Definition: alias.h:700
void FP_skip_line_commented(FILE *stream)
move file descriptor to the start of the new noncommented line, without checking of EOF ...
Definition: librw.cpp:145
void FP_skip_line_fast_skip_commented(FILE *stream, int n)
move file descriptor to the start of the n-th new line, without checking of EOF
Definition: librw.cpp:155
char * output_file
Definition: problem.h:223
PointAttribs * give_NdAt_with_prop(long prop) const
Definition: problem.cpp:312
General functions.
long give_nsteps(void) const
Definition: problem.cpp:182
FiLe * IN_file_bgm
Definition: problem.h:113
void FEM_solve_OOFEM(Problem *pd)
ProblemAnalysis * ProbAnal
Definition: problem.h:217
GPA< ElemAttribs > geomElAt
Definition: problem.h:281
CrossSectType
Definition: alias.h:435
void print_input_ANSYS(void) const
Definition: problem.cpp:1956
bool PDBO[cPDBO]
Definition: problem.h:99
bool relink_downF(void)
Definition: tixy2.h:154
virtual XMLComment * ToComment()
Safely cast to a Comment, or null.
Definition: tinyxml2.h:603
long SP_scan_word(const char *&src, char *dest)
... word; return value is length of the word
Definition: librw.cpp:528
AdaptivityParameters * give_adpa(void) const
Definition: problem.h:181
long FP_number_of_lines(FILE *stream, bool rwd)
count number of lines in file
Definition: librw.cpp:240
FILE * file(void)
*** GET ***
Definition: tixy2.h:139
GPA< Mesh > Meshes
Definition: problem.h:349
void XP_check_expected_attribute(const XMLNode *xelem, const char *name, const char *value)
Definition: tixy2.cpp:126
GPA< Attribute > OOextrs
Definition: problem.h:272
virtual void initialize(void)
initialize yourself
Definition: attribute.cpp:1134
GPA< FiLe > IN_mshFiLes
Definition: problem.h:108
GPA< Material > Mats
Definition: problem.h:267
void initialization(void)
initiate/sets data
Definition: problem.cpp:609
#define SP_scan_expected_word_exit(_1, _2, _3, _4)
Definition: librw.h:201
MIDAS i/o vtu ff.
Definition: alias.h:637
sifel i/o native ff
Definition: alias.h:644
Input / output function.
MeshGenerator P_mesher
Definition: problem.h:123
size_t solver_file_size
Definition: problem.h:82
void TF_GPA_shake_down_reid(GPA< T > &list)
clear out NULL components
Definition: taux.h:27
long FP_scan_line_skip_emptyORcommented(FILE *stream, char *dest)
*** *** *** SCANNING *** *** *** scanning == scan ...
Definition: librw.cpp:309
void read_mesh_OOFEM(Mesh *mesh, const char *filename)
read native input file to OOFEM
Definition: problem.cpp:1342
const BoundaryCond * switch_BC(const BoundaryCond *bc, DOFsPerNode dpn_old, DOFsPerNode dpn_new)
Definition: problem.cpp:255
Point.
OperationMode OM
Definition: problem.h:102
Interface to library T3D.
#define SP_scan_expected_number_exit(_1, _2, _3)
Definition: librw.h:229
void read_geometry_VTK(Geometry *geom, const char *filename)
Definition: problem.cpp:1263
#define _warningg3(_1, _2, _3)
Definition: gelib.h:158
void print_info_message(SODenum flag, const char *format,...) const
Definition: taux.cpp:240
MaterialType
Definition: alias.h:505
bool SP_skip_word(const char *&src, int n)
... word and space before
Definition: librw.cpp:472
const XMLNode * FirstChild() const
Get the first child node, or null if none exists.
Definition: tinyxml2.h:671
void read_block(Stream *stream, BlockName bn)
Definition: problem.cpp:1128
#define STRCMP
Definition: alias.h:44
void zero(void)
Definition: arrays.h:504
#define _openFilePN(_1, _2, _3, _4)
Definition: gelib.h:174
LCSdirection
Definition: taux.h:217
const BoundaryCond * give_bcbr(void) const
Definition: attribute.h:373
void print_info_message_core(SODenum flag, ETCLR color=ETC_DEFAULT, const char *buffer=NULL) const
Definition: taux.cpp:280
GPA< PointDOFsBCPM > PVs
Definition: problem.h:270
void read_mesh_SIFEL(Mesh *mesh, const char *filename)
read native input file to SIFEL
Definition: problem.cpp:1482
const char * give_path(void) const
Definition: taux.h:141
PAType give_loctype(void) const
Definition: attribute.h:148
long give_ID() const
Definition: subject.h:45
GPA< ABC_CFLoad > CFLs
Definition: problem.h:276
bool relink_up(void)
Definition: tixy2.h:156
Duplicity.
#define errol
Definition: gelib.h:142
void read_addata(bool mdl)
Definition: problem.cpp:1702
FiLe * P_solverbinary
Definition: problem.h:120
FiLe * IN_VTKaddata
Definition: problem.h:109
MIDAS i/o vtp ff.
Definition: alias.h:636
void set_geomElAt(CellGeometry cg, DOFsPerNode val)
Definition: problem.cpp:217
oofem i/o native ff
Definition: alias.h:643
#define _errorr2(_1, _2)
Definition: gelib.h:145
void rm_MAT_RIGID(void)
rm material MAT_RIGID
Definition: problem.cpp:364
FiLe * IN_file_results
Definition: problem.h:111
CellGeometry give_cellGeom(void) const
Definition: cell.h:31
StdoutDriver * so_driver
Definition: problem.h:88
long give_ned(void) const
Definition: cell.h:90
void read_characteristics(Stream *stream)
Definition: problem.cpp:1032
PAGroup give_group(void) const
initialize yourself
Definition: attribute.h:146
CellGeometry
Definition: alias.h:840
Classes Cell, Facedge, Edge, Face, Element, Gelement, PolyLine, Line, PolygonMdl, FElement...
bool isFile(void)
Definition: tixy2.h:150
void switch_node_pointer(Point *oldnod, Point *newnod)
clean up duplicity components
Definition: problem.cpp:858
void checkConsistency(void) const
Checks data consistency.
Definition: problem.cpp:724
GPA< ABC_NLoad > NLs
Definition: problem.h:274
FiLe * OUT_moFILE
Definition: problem.h:130
int ECN_convert_e2i(int id, int compdim, int ord, CellGeometry cg, femFileFormat fff)
External to Internal conversion.
Definition: alias.h:1539
void read_ctrlfile(void)
Definition: problem.cpp:1011
int stdout_print_level
Definition: problem.h:229
const char * give_base(void) const
Definition: taux.h:142
Attributes.
void read_addata_VTK(Geometry *geom, const char *filename, bool sparse)
Definition: problem.cpp:1312
PAType give_analloctype(void) const
Definition: problem.cpp:181
const Point * give_point(long i) const
Definition: cell.h:93
int CrossSectType_e2i_SIFEL(CrossSectType val, PAGroup pg)
Definition: alias.h:480
long give_nsteps(void) const
Definition: attribute.h:149
void set_lcs(LCSdirection dir, LCStype typ, long num)
Definition: problem.cpp:232
virtual bool initialize_from(const char *&str, femFileFormat ff, bool all=true)
initialize form input string
Definition: attribute.cpp:1030
bool relink_prev(void)
Definition: tixy2.h:158
const XMLNode * Parent() const
Get the parent of this node on the DOM.
Definition: tinyxml2.h:657
t3d i/o native ff
Definition: alias.h:641
long GP_scan_line_alloc(Stream *stream, char *&dest)
... line; return value is length of the line; dest is NULL and allocated here
Definition: tixy2.cpp:87
PointAttribs * give_pointAttribs(void)
Definition: point.h:93
long SP_scan_line_alloc(const char *&src, char *&dest)
... line; return value is length of the line; dest is NULL and allocated here
Definition: librw.cpp:559
const char * give_name(void) const
Definition: taux.h:146
ElemAttribs * domainElAt
Definition: problem.h:280
void skip_commnet(void)
if this XMLnode is XMLComment, skip to next noncomment
Definition: tixy2.h:161
const Edge * give_edge(long i) const
Definition: cell.h:94
XMLNode is a base class for every object that is in the XML Document Object Model (DOM)...
Definition: tinyxml2.h:579
MIDAS i/o unv ff.
Definition: alias.h:638
GPA< CrossSection > CSs
Definition: problem.h:266
const char * Value() const
The meaning of 'value' changes for the specific type.
Definition: tinyxml2.h:647
void set_approx(FEApproximation val)
Definition: attribute.h:786
long give_nnoed(int i) const
Definition: cell.h:640
const char * Attribute(const char *name, const char *value=0) const
Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.
Definition: tinyxml2.cpp:1226
GPA< Model > Models
Definition: problem.h:348
Geometry description.
Definition: geometry.h:29
bool FP_skip_line(FILE *stream, int n)
move file descriptor to the start of the n-th new line //[former read_line]
Definition: librw.cpp:167
void addGlobPath(const char *globpath)
Definition: taux.h:90
XMLElement * tixel(void)
Definition: tixy2.h:141
char * solver_file_ptr
Definition: problem.h:81
long FP_scan_line(FILE *stream, char *dest)
scan/copy line == string without ' ' from stream
Definition: librw.cpp:321
PointAttribs * givealloc_NdAt_with_prop(long prop)
Definition: problem.cpp:324
Geometry * give_primary_geometry(void) const
Definition: problem.cpp:197
Interface to library OOFEM.
AdaptivityParameters * adpa
Definition: problem.h:125
Material * give_Mat_of_type(MaterialType type, int id) const
Definition: problem.cpp:300
void open(Stream_type t, const char *rw, const char *&fn, XMLNode *node=NULL)
*** SET ***
Definition: tixy2.h:74
GPA< LoadTimeFunction > OOltfs
Definition: problem.h:271
void print_input_SIFEL(void) const
Definition: problem.cpp:1811
void copy_bcbr(const BoundaryCond *bc, DOFsPerNode dpn_old, DOFsPerNode dpn_new)
Definition: attribute.h:330
void read_VTK(char DATASET, Stream *stream, bool addata=false, bool sparse=false)
CORE read of VTK file.
Definition: geometry.cpp:561
Lvctr * resize_ignore_vals(long newsize)
resize, ignore values
Definition: arrays.h:472
void setadd_loctype_sifif(BCType loct, int locid)
Definition: attribute.cpp:664
bool is_empty(void) const
Definition: taux.h:150
void main_OM_testing(void)
main process of mode OM_Test
Definition: problem.cpp:599
const char * BN_enum2char(BlockName bn)
Definition: problem.cpp:937
void read_line(FILE *stream, char *&dest, const char *name)
reading of line from file
Definition: problem.cpp:1335
MIDAS i/o vtk ff.
Definition: alias.h:635
FiniteElementType
Definition: alias.h:995
#define _errorr(_1)
Definition: gelib.h:151
femFileFormat give_ff(void) const
Definition: taux.h:147
void read_head_and_chars(Stream *stream, char &DATASET)
zkontroluje hlavicku xml souboru a zpracuje pripadnou char sekci vraci XMLElement s vlastnimi geom da...
Definition: problem.cpp:880
Derived class for management of boundary conditions and physical meanings of DOFs (Degrees Of Freedom...
Definition: substructs.h:131
void set_FETS(const char *skupina, const char *str)
Finite Element Type Settings.
Definition: problem.cpp:222
SStype
type of stress/strain state of element; especially results depends on this variable => described at M...
Definition: alias.h:954
void read_characteristics_core(Stream *stream, const char *key)
Definition: problem.cpp:1066
const StdoutDriver * sodriver(void) const
Definition: problem.h:90
void print_control(void) const
Function prints contol data.
Definition: problem.cpp:2103
Mathematic functions.
void read_block_output(Stream *stream)
Definition: problem.cpp:1111
DOFsPerNode OOFEMdomain2DOFsPerNode(const char *od)
Definition: alias.h:726
void set_readedchars(bool val)
Definition: problem.h:165
int IN_meshGen_elemCount
Definition: problem.h:115
void main_OM_design2solver2design(void)
main process of mode OM_Design2solver2design
Definition: problem.cpp:391
void close(void)
Definition: tixy2.h:112
void print_block_SIFEL(FILE *stream) const
print analysis block of SIFEL input file
Definition: attribute.cpp:176
ansys i/o native ff
Definition: alias.h:642
Auxiliary functions; classes FiLe, LocalCoordSystem, AdaptivityParameters and StdoutDriver.
Problem(StdoutDriver *sodrv)
CONSTRUCTOR.
Definition: problem.cpp:26
long give_number_of_nonzeros(void) const
Definition: arrays.cpp:149
GPA< ABC_CBLoad > CBLs
Definition: problem.h:277
void TF_GPA_reid(GPA< T > &list)
reset ids ascending
Definition: taux.h:23
#define CASE
Definition: alias.h:43
int give_ord(void) const
Definition: cell.h:639
GPA< PointAttribs > NdAts
Definition: problem.h:283
void read_mesh_SIFEL(FILE *stream)
read native input file to SIFEL
Definition: geometry.cpp:1873
XMLError QueryIntAttribute(const char *name, int *value) const
Definition: tinyxml2.h:1220
bool SP_scan_expected_word(const char *&src, const char *expctd, bool cs)
... word and compare with expected one
Definition: librw.cpp:580
DOFsPerNode DOFspnod
Definition: problem.h:220
const Element * give_Elem(long i) const
Definition: geometry.h:71
bool SP_scan_number(const char *&src, int &dest)
... number of type int/long/double
Definition: librw.cpp:595
bool scan_components(FILE *stream, int ncmp)
Definition: attribute.h:386
LCStype
Definition: taux.h:218
void DeleteChild(XMLNode *node)
Delete a child of this node.
Definition: tinyxml2.cpp:651
long give_nno(void) const
Definition: cell.h:89
void finitialization(void)
finalize preprocessing
Definition: problem.cpp:702
void print_input_OOFEM(void)
Definition: problem.cpp:1724
GPA< ABC_CELoad > CELs
Definition: problem.h:275
#define _warningg5(_1, _2, _3, _4, _5)
Definition: gelib.h:160
void set_domainElAt(FEApproximation val)
Definition: problem.cpp:212
void print_row_OOFEM(FILE *stream) const
print analysis row of OOFEM input file
Definition: attribute.cpp:156
void set_Geom(const Geometry *owner)
Definition: subject.cpp:23
#define FP_scan_expected_word_exit(_1, _2, _3, _4)
Definition: librw.h:107
void initialize_the_first_BC(void)
Definition: attribute.cpp:674
ElemAttribs * give_ElAt_with_prop(long prop) const
Definition: problem.cpp:337
char * OOF_output_rec
Definition: problem.h:226
#define _errorr0
Definition: gelib.h:143
GPA< FiLe > IN_mdlFiLes
Definition: problem.h:107
void read_mesh_OOFEM(FILE *stream, long nn, long ne)
read native input file to OOFEM
Definition: geometry.cpp:1822
#define _openFilePNS(_1, _2, _3, _4, _5)
Definition: gelib.h:175
BlockName BN_char2enum(const char *bn)
Definition: problem.cpp:971
XMLNode * tixnod(void)
Definition: tixy2.h:140
double IN_meshGen_elemSize
Definition: problem.h:114
void set_lcs(LCSdirection dir, LCStype typ, long num)
Definition: attribute.h:806
void set_defautlt_meshGen_elemSize(void)
Definition: problem.cpp:185
void alloc_geomElAt(CellGeometry cg)
Definition: problem.cpp:215
long FP_scan_line_alloc(FILE *stream, char *&dest)
scan/copy line == string without ' ' from stream; dest is NULL and allocated here ...
Definition: librw.cpp:340
PAType give_analtype(void) const
Definition: problem.cpp:180
const BoundaryCond * add_find_BC(BoundaryCond *val)
find identical or add new BC
Definition: problem.cpp:244
classID
Type introduced to distinguish between classes.
Definition: alias.h:142
virtual bool initialize_from(const char *&str, femFileFormat ff, bool all=true)
initialize form input string
Definition: attribute.cpp:44
void deallocateCheck(ArgType *p, bool check=true)
*** *** *** *** DEALLOCATE TEMPLATES *** *** *** ***
Definition: gelib.h:192
GPA< ElemAttribs > ElAts
Definition: problem.h:284
CrossSection * give_CS_of_type(CrossSectType type, int id) const
Definition: problem.cpp:289
bool SP_cutcomment(char *src)
cut of comment == end of line starting by '#'
Definition: librw.cpp:438
virtual XMLDeclaration * ToDeclaration()
Safely cast to a Declaration, or null.
Definition: tinyxml2.h:611
MIDAS input native ff - for mesh of polylines.
Definition: alias.h:647
FiLe * P_mesherbinary
Definition: problem.h:124
virtual XMLElement * ToElement()
Safely cast to an Element, or null.
Definition: tinyxml2.h:595
GPA< BoundaryCond > BCs
Definition: problem.h:268
jktk i/o
Definition: alias.h:639
virtual bool initialize_from(const char *&str, femFileFormat ff, bool all=true)
initialize form input string
Definition: attribute.cpp:1761
const XMLNode * NextSibling() const
Get the next (right) sibling node of this node.
Definition: tinyxml2.h:723
const Point * give_Pjnt(long i) const
Definition: geometry.h:68
assignment of attributes to element
Definition: attribute.h:707
Problem description.
Definition: problem.h:74
PAGroup
The group of problem analysis.
Definition: alias.h:367
special one time format for bridge in Melnik
Definition: alias.h:650
Class Problem.
PAType give_type(void) const
Definition: attribute.h:147
int give_nDOFs(void) const
Definition: attribute.h:1056
FEApproximation
finite element approximation
Definition: alias.h:937
void read_geometry_VTK_core(Geometry *geom, Stream *stream)
Definition: problem.cpp:1280
const char * FETSet_e2s_ANSYS(FiniteElementType fet)
Definition: alias.h:1221
void geomElAt_initialize_from(const char *str, CellGeometry cg)
Definition: problem.cpp:209
MIDAS input native ff - pro specialni potreby.
Definition: alias.h:646
bool FP_skip_comment(FILE *stream)
*** *** *** *** FILE PROCESSING *** *** *** *** general rules for file processing: ...
Definition: librw.cpp:130
void domainElAt_initialize_from(const char *str)
Definition: problem.cpp:208