MIDAS  0.75
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
attribute.cpp
Go to the documentation of this file.
1 #include "attribute.h"
2 
3 #include "point.h"
4 #include "problem.h"
5 
6 #include "mathlib.h"
7 
8 #include <math.h>
9 
10 
11 namespace midaspace {
12 
13 //* ********************************************************************************************
14 //* *** *** *** *** CLASS ATTRIBUTE *** *** *** ***
15 //* ********************************************************************************************
17 void Attribute :: scan_linerec (const char *str)
18 {
19  SP_skip_space(str);
20  linerec = new char[giveLineLength(str) + 1];
21  SP_scan_line (str, linerec);
23 }
24 
26 void Attribute :: print_linerec (FILE *stream, bool pure) const
27 {
28  if (pure) fprintf (stream, "%s", linerec);
29  else {
30  const char *str = linerec;
31  SP_print_word (str, stream);
32  SP_print_space (str, stream);
33  if (str[0] == 'x') str++;
34  else _errorr2 ("There is no \"x\" in string \"%s\"", str);
35  fprintf (stream, "%ld%s", this->ID + 1, str);
36  }
37 }
38 
39 
40 //* ********************************************************************************************
41 //* *** *** *** *** CLASS PROBLEMANALYSIS *** *** *** ***
42 //* ********************************************************************************************
44 bool ProblemAnalysis :: initialize_from (const char *&str, femFileFormat fff, bool all)
45 {
46  if (fff == FFF_MIDAS || fff == FFF_OOFEM) {
47  char W[255];
48 
49  if (fff == FFF_MIDAS) {
50  SP_scan_word (str, W);
51  if (strcmp(W, "OOFEMrecord" ) == 0) type = PAT_OOFEM;
52  else if (strcmp(W, "mechanicsStaticLinAdapt") == 0) type = PAT_static_linear_adapt;
53  else if (strcmp(W, "transportStationary" ) == 0) type = PAT_stationary;
54  else if (strcmp(W, "mechanicsStaticLin" ) == 0) type = PAT_static_linear;
55  else if (strcmp(W, "mechanicsStabilityLin" ) == 0) type = PAT_stability_linear;
56  else _errorr2 ("Unsupported type of problem analysis \"%s\"", W);
57  }
58  else type = PAT_OOFEM;
59 
60  switch (type) {
61  case PAT_OOFEM: {
62  scan_linerec (str);
63  SP_scan_word (str, W);
66  bool scanned = true;
67  while (SP_scan_word (str, W)) {
68  if (strcmp(W, "nsteps") == 0) SP_scan_number (str, nsteps);
69  else scanned = false;
70  }
71  if (scanned) type = loctype;
72  break;
73  }
75  adpa = new AdaptivityParameters();
76  adpa->initialize_from(str, fff);
77  break;
79  while (SP_scan_word (str, W)) {
80  if (strcmp(W, "nroot") == 0) SP_scan_number(str, nroots);
81  else if (strcmp(W, "rtolv") == 0) SP_scan_number(str, tolerance);
82  else _errorr2 ("Unsupported key word in problem analysis line adaptivity \"%s\"", W);
83  }
84  break;
85  case PAT_static_linear:
86  break;
87  default: errol;
88  }
89  }
90  else errol;
91 
92  return true;
93 }
94 
97 {
98  if (fff == FFF_SIFEL) {
99  int auxi;
100  long auxl;
101  double auxd;
102 
103  fscanf (stream, "%d", &auxi); type = PAType_i2e_SIFEL(auxi); if ((int)type == 0) _errorr2("Unknown problem type in SIFEL input file %d", auxi);
105 
106  // transport
107  if (group == PAG_transport) {
108  // enum transmattert {nomedium=0,onemedium=1,twomediacoup=10,threemediacoup=30,fourmediacoup=40};
109  // enum mednamest {heat=1,moisture=2,heat_moisture=10,moisture_salt=20,
110  fscanf (stream, "%d %d", &transpmatter, &mediumname);
111  if (transpmatter == 1) fscanf (stream, "%lf" , &scaleofmed1);
112  if (transpmatter == 10) fscanf (stream, "%lf %lf", &scaleofmed1, &scaleofmed2);
113  }
114 
115  FP_skip_comment(stream);
116 
117  //
118  fscanf (stream, "%d", compder1); if (compder1[0]) fscanf (stream, "%d %d", compder1+1, compder1+1);
119  fscanf (stream, "%d", compder2); if (compder2[0]) fscanf (stream, "%d %d", compder2+1, compder2+1);
120  fscanf (stream, "%d", compoth1); if (compoth1[0]) fscanf (stream, "%d %d", compoth1+1, compoth1+1);
121  fscanf (stream, "%d", compoth2);// if (compoth2[0]) fscanf (stream, "%d %d", compoth2+1, compoth2+1); nevim jestli je to spravne zakomentovane, ale zatim to chodi
122 
123  if (group == PAG_transport) {
124  FP_skip_comment(stream);
125  fscanf (stream, "%d", &gravity);
126  }
127  FP_skip_comment(stream);
128  fscanf (stream, "%ld", &auxl); if (auxl) { adpa = new AdaptivityParameters(auxl); adpa->initialize_from(stream, fff); }
129  FP_skip_comment(stream);
130  fscanf (stream, "%d %d %d", &stoch, &homog, &renumb); if (stoch || homog || renumb) errol;
131 
132  if (type == PAT_nonstationary) {
133  FP_skip_comment(stream);
134  // enum timecontrtype {fixed=0, adaptive=1, adaptivemin=2, adaptivemax=3};
135  fscanf (stream, "%d", &timecontrtype); if (timecontrtype) errol;
136  fscanf (stream, "%lf %lf", &start_time, &end_time);
137  fscanf (stream, "%d %d", &nit, &tfunct); if (nit || tfunct) errol; // number of important times; type of funct 0==stat
138  fscanf (stream, "%lf", &timef); // time funct
139  fscanf (stream, "%lf", &auxd); // timetypeprint
140  fscanf (stream, "%ld", &auxl); if (auxl) errol; // // backup controler
141  fscanf (stream, "%lf", &auxd); // alpha
142  fscanf (stream, "%ld %ld", &auxl, &auxl); // conductmatstor, capacmatstor
143  fscanf (stream, "%ld %ld", &auxl, &auxl); // typelinsol, diagonalization of capacity matrix
144  }
145  else {
146  fscanf (stream, "%d", &auxi); stiffmattype = StiffMatrixType_i2e_SIFEL (auxi); if ((int)stiffmattype == 0) _errorr2("Unknown stiffness matrix type in SIFEL input file %d", auxi);
147  fscanf (stream, "%d", &auxi); linsoltype = LinearSolverType_i2e_SIFEL (auxi); if ((int)linsoltype == 0) _errorr2("Unknown linear solver type in SIFEL input file %d", auxi);
148  }
149  }
150  else errol;
151 
152  return true;
153 }
154 
156 void ProblemAnalysis :: print_row_OOFEM (FILE *stream) const
157 {
158  PAType t = type;
159 
160  // stability in oofem runs only for 1d elements
162  t = PAT_static_linear;
164  Pd->sodriver()->print_info_message_colour (SODE_row, ETC_D_VIOLET, " Linear stability was switched to linear static!!!!");
165  }
166 
167  switch (t) {
168  case PAT_OOFEM: fprintf (stream, "%s\n", linerec); break;
169  case PAT_stability_linear: fprintf (stream, "LinearStability nroot %ld rtolv %.6g\n", nroots, tolerance); break;
170  case PAT_static_linear: fprintf (stream, "LinearStatic nsteps 1\n"); if (nsteps != 1) errol; break;
171  default: errol;
172  }
173 }
174 
176 void ProblemAnalysis :: print_block_SIFEL (FILE *stream) const
177 {
179  fprintf (stream, "%d\n", PAType_e2i_SIFEL(type));
180  // transport
181  if (group == PAG_transport) {
182  fprintf (stream, "%d %d\n", transpmatter, mediumname);
183  if (transpmatter == 1) fprintf (stream, " %.1lf\n", scaleofmed1);
184  if (transpmatter == 10) fprintf (stream, " %.1lf %.1lf\n", scaleofmed1, scaleofmed2);
185  }
186 
188  fprintf (stream,"%d\n", compder1[0]); if (compder1[0]) fprintf (stream,"%d %d\n", compder1[1], compder1[2]);
189  fprintf (stream,"%d\n", compder2[0]); if (compder2[0]) fprintf (stream,"%d %d\n", compder2[1], compder2[2]);
190  fprintf (stream,"%d\n", compoth1[0]); if (compoth1[0]) fprintf (stream,"%d %d\n", compoth1[1], compoth1[2]);
191  fprintf (stream,"%d\n", compoth2[0]); if (compoth2[0]) fprintf (stream,"%d %d\n", compoth2[1], compoth2[2]);
192 
193  // transport
194  if (group == PAG_transport)
195  fprintf (stream, "%d\n", gravity);
196 
198  if (adpa) fprintf (stream,"%d %g %g %g\n",
199  (int)adpa->give_eetype(),
201  adpa->give_enlarg(),
202  adpa->give_reduct()
203  );
204  else fprintf (stream,"%d ", 0);
205 
207  fprintf (stream,"%d %d %d\n", stoch, homog, renumb);
209  fprintf (stream,"%d", StiffMatrixType_e2i_SIFEL(stiffmattype));
211  fprintf (stream," %d\n", LinearSolverType_e2i_SIFEL(linsoltype));
212 }
213 
214 
215 //* ********************************************************************************************
216 //* *** *** *** *** CLASS CROSSSECTION *** *** *** ***
217 //* ********************************************************************************************
219 bool CrossSection :: initialize_from (const char *&str, femFileFormat fff, bool all)
220 {
221  char W[255];
222  SP_scan_word (str, W);
223  if (strcmp(W, "OOFEMrecord" ) == 0) type = CST_OOFEM;
224  else if (strcmp(W, "SIFELrecord" ) == 0) type = CST_SIFEL;
225  else if (strcmp(W, "3Dcs" ) == 0) type = CST_3d;
226  else if (strcmp(W, "2Dcs" ) == 0) type = CST_2d;
227  else if (strcmp(W, "TRUSScs" ) == 0) type = CST_Truss;
228  else if (strcmp(W, "Rectangle" ) == 0) { type = CST_Beam; loctype = CST_Rectangle; }
229  else if (strcmp(W, "Rectangle_tube") == 0) { type = CST_Beam; loctype = CST_Rectangle_tube; tube = true; }
230  else if (strcmp(W, "Circle" ) == 0) { type = CST_Beam; loctype = CST_Circle; }
231  else if (strcmp(W, "Circle_tube" ) == 0) { type = CST_Beam; loctype = CST_Circle_tube; tube = true; }
232  else if (strcmp(W, "Circle_cable" ) == 0) { type = CST_Beam; loctype = CST_Circle_cable; cable = true; }
233  else if (strcmp(W, "1Dcs_rolled" ) == 0) { type = CST_Beam; loctype = CST_1d_rolled; }
234  else _errorr2 ("Unsupported name of cross section \"%s\"", W);
235 
236  switch (type) {
237  case CST_OOFEM: {
238  scan_linerec (str);
239  SP_scan_word (str, W);
240  if (strcmp(W, "SimpleCS") == 0) {
241  SP_scan_expected_word_exit (str, "x", "\"x\" word is expected after name of material in OOFEMrecord record", CASE);
242 
243  while (SP_scan_word (str, W)) {
244  if (strcmp(W, "area" ) == 0) SP_scan_number (str, area);
245  else if (strcmp(W, "thick" ) == 0) SP_scan_number (str, width);
246  else if (strcmp(W, "width" ) == 0) SP_scan_number (str, height);
247  else if (strcmp(W, "Iy" ) == 0) SP_scan_number (str, Iy);
248  else if (strcmp(W, "Iz" ) == 0) SP_scan_number (str, Iz);
249  else if (strcmp(W, "Ik" ) == 0) SP_scan_number (str, Ik);
250  else if (strcmp(W, "beamShearCoeff") == 0) SP_scan_number (str, bsc);
251  else loctype = CST_SimpleCS;
252  }
253 
254  if (loctype == CST_Void) {
255  if (area<0 && width <0 && height<0 && Iy<0 && Iz<0 && Ik<0) type = CST_3d;
256  else if (area>0 && width <0 && height<0 && Iy<0 && Iz<0 && Ik<0) type = CST_Truss;
257  else if (area<0 && width >0 && height<0 && Iy<0 && Iz<0 && Ik<0) { type = CST_2d; thickness = width; }
258  else if (area>0 && width >0 && height>0 && Iy>0 && Iz>0 && Ik>0) type = CST_Beam;
259  else errol;
260  }
261  }
262  else if (strcmp(W, "LayeredCS") == 0) {
264  SP_scan_expected_word_exit (str, "x", "\"x\" word is expected after name of material in OOFEMrecord record", CASE);
265 
266  while (SP_scan_word (str, W)) {
267  if (strcmp(W, "nLayers" ) == 0) SP_scan_number (str, nlayers);
268  else if (strcmp(W, "LayerMaterials") == 0) {
269  SP_scan_expected_number_exit (str, nlayers, "wrong number of LayerMaterials in OOFEMrecord material record");
270  mats.resizeup(nlayers);
271  int auxi;
272  for (int i=0; i<nlayers; i++) {
273  SP_scan_number (str, auxi);
274  mats.assign(i, Pd->give_Mat(auxi-1));
275  if (mats[i] == NULL) _errorr2("There is no material with ID = %d", auxi+1);
276  }
277  }
278  }
279  }
280  else if (strcmp(W, "FiberedCS") == 0) { loctype = CST_FiberedCS; }
281  else errol;
282  break;
283  }
284  case CST_SIFEL:
285  int auxi;
287  SP_scan_number (str, sifid); sifid--;
288  if (Pd->give_sifCSs(loctype) != sifid) errol;
289  ((Problem*)Pd)->add_sifCSs(loctype);
290  scan_linerec (str);
291  switch (type) {
292  case CST_2d: SP_scan_number (str, thickness); break;
293  case CST_Truss: SP_scan_number (str, area); break;
294  default: errol;
295  }
296  break;
297  case CST_3d:
298  break;
299  case CST_2d:
300  SP_scan_expected_word_exit (str, "thickness", "key word thickness expected in 2D cross-section", CASE);
301  SP_scan_number (str, thickness);
302  if (thickness <= 0.0) _errorr ("Wrong crosssection attributs - thickness");
303  break;
304  case CST_Truss:
305  SP_scan_expected_word_exit (str, "area", "key word area expected in TRUSS cross-section", CASE);
306  SP_scan_number (str, area);
307  if (area <= 0.0) _errorr ("Wrong crosssection attributs - area");
308  break;
309  case CST_Beam:
310  if (loctype == CST_1d_rolled) {
311  errol;
312 
313 
314  }
315  else {
316  while (SP_scan_word (str, W)) {
317  if (strcmp(W, "width") == 0) SP_scan_number (str, width);
318  else if (strcmp(W, "height") == 0) SP_scan_number (str, height);
319  else if (strcmp(W, "thickness") == 0) SP_scan_number (str, thickness);
320  else if (strcmp(W, "LCS") == 0) {
321  if (lcs) errol;
322  lcs = new LCS_beam();
323  lcs->initialize_from (str, FFF_MIDAS);
324  }
325  else _errorr2 ("Unsupported key word in cross-section line \"%s\"", W);
326  }
327 
328  // lcs
329  //if (lcsDir == 'z') interchange2 (width, height);
330  //else if (lcsDir != 'y') _errorr2 ("Unsupported direction in lcs \"%c\"", lcsDir);
331 
332  if (height < 0.0) height = width;
333  if (width < 0.0) width = height;
334 
335  if (width < 0.0 || height < 0.0 || (tube && thickness < 0.0)) _errorr ("Wrong crosssection attributs - width height thickness");
336  }
337  break;
338  default: errol;
339  }
340 
341  this->sifid = Pd->give_sifCSs(this->give_type()); // type, because sifel cs's are grouped by type, not loctype
342  ((Problem*)Pd)->add_sifCSs(this->give_type());
343 
344  return true;
345 }
346 
349 {
351 
353 
354  if (type == CST_Beam && loctype != CST_Void) {
355  area = Iy = Iz = Ik = 0.0;
356  ; add_areaYyYz ( width , height );
357  if (tube) add_areaYyYz (-width + 2*thickness, height - 2*thickness);
358 
359  if (cable) {
360  int down = 20;
361  Iy /= down;
362  Iz /= down;
363  Ik /= down;
364  }
365  }
366 }
367 
369 void CrossSection :: add_areaYyYz (double w, double h)
370 {
372  area += w * h;
373  Iy += 1.0 / 12.0 * w * h*h*h;
374  Iz += 1.0 / 12.0 * h * w*w*w;
375  Ik = area*area*area*area/40./(Iy+Iz); // ???????? += or =
376  //if (tube) Ik = Iy + Iz; ????
377  bsc = 0.84; // (5 + 5*ny) / (6 + 5*ny);
378  }
379  else if (loctype == CST_Circle ||
382  area += 0.25 * PIconst * w * h;
383  Iy += PIconst / 64.0 * w * h*h*h;
384  Iz += PIconst / 64.0 * h * w*w*w;
385  Ik += Iy + Iz;
386  bsc = 0.92; // (6 + 12*ny + 6*ny*ny)/(7 + 12*ny + 4*ny*ny);
387  }
388  else errol;
389 }
390 
391 
393 void CrossSection :: print_row (FILE *stream, femFileFormat fff, long did) const
394 {
395  if (fff == FFF_OOFEM) {
396  switch (type) {
397  case CST_OOFEM: this->print_linerec (stream, false); break;
398  case CST_3d: fprintf (stream, "SimpleCS %ld", this->ID+1); break;
399  case CST_2d: fprintf (stream, "SimpleCS %ld thick %.6g", this->ID+1, thickness); break;
400  case CST_Truss: fprintf (stream, "SimpleCS %ld area %.6g", this->ID+1, area); break;
401  case CST_Beam:
402  fprintf (stream, "SimpleCS %ld", this->ID+1);
403  fprintf (stream, " area %.6g Iy %.6g Iz %.6g Ik %.6g", area, Iy, Iz, Ik);
404  fprintf (stream, " beamShearCoeff %.6g thick %.6g width %.6g", bsc, width, height);
405  break;
406  default: _errorr ("Unsupported type of cross section ");
407  }
408  }
409  else if (fff == FFF_SIFEL) {
410  fprintf (stream, "%ld", this->sifid + 1);
411  switch (type) {
412  case CST_SIFEL: this->print_linerec (stream, true); break;
413  case CST_Truss: fprintf (stream, " %g", area); break;
414  default: _errorr ("Unsupported type of cross section ");
415  }
416  }
417  else if (fff == FFF_ANSYS) {
418  fprintf (stream, "\n");
419  switch (type) {
420  case CST_2d: fprintf (stream, "SECTYPE, %ld, SHELL\nSECDATA, %.6g\n\n", this->ID+1, thickness); break;
421  case CST_Beam:
422  fprintf (stream, "SECTYPE, %ld, BEAM", this->ID+1);
423  switch (loctype) {
424  case CST_Circle_tube:
425  if (width != height) _errorr("elipsoid cross-sectio not supported yet");
426  fprintf (stream, ", CTUBE\nSECDATA, %.6g, %.6g", width/2.0 - thickness, width/2.0);
427  break;
428  default: _errorr ("Unsupported loctype of beam cross section");
429  }
430  break;
431  default: _errorr ("Unsupported type of cross section ");
432  }
433  }
434  else errol;
435 
436  fprintf (stream, "\n");
437 }
438 
439 
440 //* ********************************************************************************************
441 //* *** *** *** *** CLASS MATERIAL *** *** *** ***
442 //* ********************************************************************************************
444 bool Material :: initialize_from (const char *&str, femFileFormat fff, bool all)
445 {
446  char W[255];
447  SP_scan_word (str, W);
448  if (strcmp(W, "OOFEMrecord") == 0) type = MAT_OOFEM;
449  else if (strcmp(W, "SIFELrecord") == 0) type = MAT_SIFEL;
450  else if (strcmp(W, "IsoLinEl") == 0) type = MAT_IsoLE;
451  else if (strcmp(W, "IsoLinHeat") == 0) type = MAT_IsoTrans;
452  else if (strcmp(W, "RigidBody") == 0) type = MAT_RIGID;
453  else _errorr2 ("Unsupported name of material \"%s\"", W);
454 
455  if (type == MAT_OOFEM) {
456  scan_linerec (str);
457  SP_scan_word (str, W);
459  if (loctype != MAT_Void) {
460  bool scanned = true;
461  SP_scan_expected_word_exit (str, "x", "\"x\" word is expected after name of material in OOFEMrecord record", CASE);
462  while (SP_scan_word (str, W)) {
463  if (strcmp(W, "d") == 0) SP_scan_number (str, density);
464  else if (strcmp(W, "E") == 0) SP_scan_number (str, E);
465  else if (strcmp(W, "n") == 0) SP_scan_number (str, ny);
466  else if (strcmp(W, "tAlpha") == 0) SP_scan_number (str, tAlpha);
467  else if (strcmp(W, "Ry") == 0) SP_scan_number (str, Ry);
468  else if (strcmp(W, "IHM") == 0) SP_scan_number (str, IHM);
469  else scanned = false;
470  }
471  if (scanned) type = loctype;
472  }
473  }
474  else if (type == MAT_SIFEL) {
475  // type
476  int auxi;
477  SP_scan_number (str, auxi);
479  if (loctype == MAT_Void) _errorr2 ("Unsupported type of material, type %d", auxi);
480  // sifel id
481  SP_scan_number (str, sifid); sifid--;
482  if (Pd->give_sifMats(loctype) != sifid) errol;
483  // record
484  scan_linerec (str);
485  bool scanned = true;
486  switch (loctype) {
487  case MAT_IsoLE: SP_scan_number (str, E); SP_scan_number (str, ny); break;
488  default: scanned = false;
489  }
490  if (scanned) type = loctype;
491  }
492  else {
493  while (SP_scan_word (str, W)) {
494  if (strcmp(W, "density") == 0) SP_scan_number (str, density);
495  else if (strcmp(W, "E") == 0) SP_scan_number (str, E);
496  else if (strcmp(W, "nu") == 0) SP_scan_number (str, ny);
497  else if (strcmp(W, "tAlpha") == 0) SP_scan_number (str, tAlpha);
498  else if (strcmp(W, "Capacity") == 0) SP_scan_number (str, Capac);
499  else if (strcmp(W, "Conductivity") == 0) SP_scan_number (str, Conduct);
500  else if (strcmp(W, "Ry") == 0) SP_scan_number (str, Ry);
501  else _errorr2 ("Unsupported key word in material line \"%s\"", W);
502  }
503  }
504 
505  this->sifid = Pd->give_sifMats(this->give_loctype());
506  ((Problem*)Pd)->add_sifMats(this->give_loctype());
507 
508  return true;
509 }
510 
512 void Material :: print_row (FILE *stream, femFileFormat fff, long did) const
513 {
514  if (fff == FFF_OOFEM) {
515  switch (type) {
516  case MAT_OOFEM:
517  this->print_linerec (stream, false);
518  break;
519  case MAT_j2mat:
520  fprintf (stream, "j2mat %ld", this->ID + 1);
521  //fprintf (stream, "%s %ld", MatTypeOO_e2s(typeOO), this->ID + 1);
522  fprintf (stream, " d %.3g", density);
523  if (E>1000) fprintf (stream, " E %.1lf", E);
524  else fprintf (stream, " E %e", E);
525  fprintf (stream, " n %.2lf", ny);
526  fprintf (stream, " tAlpha %lf", tAlpha);
527  fprintf (stream, " Ry %g", Ry);
528  if (IHM != 0.0) fprintf (stream, " IHM %g", IHM);
529  break;
530  case MAT_IsoLE:
531  fprintf (stream, "IsoLE %ld", this->ID + 1);
532  fprintf (stream, " d %.3g", density);
533  if (E>1000) fprintf (stream, " E %.1lf", E);
534  else fprintf (stream, " E %e", E);
535  fprintf (stream, " n %.2lf", ny);
536  fprintf (stream, " tAlpha %lf", tAlpha);
537  break;
538  case MAT_RIGID:
539  _errorr("rigid material is not implemented");
540  break;
541  default: _errorr ("Unsupported type of material ");
542  }
543  }
544  else if (fff == FFF_SIFEL) {
545  fprintf (stream, "%ld", this->sifid + 1);
546 
547  switch (this->give_loctype()) {
548  case MAT_SIFEL: this->print_linerec (stream, true); break;
549  case MAT_IsoLE: fprintf (stream, " %g %g", E, ny); break;
550  case MAT_IsoTrans: fprintf (stream, " %g %g", Capac, Conduct); break;
551  default: _errorr ("Unsupported type of material ");
552  }
553  }
554  else if (fff == FFF_ANSYS) {
555  fprintf (stream, "\n");
556  switch (this->give_loctype()) {
557  case MAT_IsoLE:
558  ; fprintf (stream, "MP, EX, %ld, %g\n", this->ID + 1, E);
559  ; fprintf (stream, "MP, PRXY, %ld, %g\n", this->ID + 1, ny);
560  if (density > 0.0) fprintf (stream, "MP, DENS, %ld, %g\n", this->ID + 1, density);
561  break;
562  default: _errorr ("Unsupported type of material ");
563  }
564  }
565  else errol;
566 
567  fprintf (stream, "\n");
568 }
569 
570 
571 
572 //* ********************************************************************************************
573 //* *** *** *** *** CLASS BoundaryCondition *** *** *** ***
574 //* ********************************************************************************************
576 bool BoundaryCond :: initialize_from (const char *&str, femFileFormat fff, bool all)
577 {
578  char W[255];
579  SP_scan_word (str, W);
580  if (strcmp(W, "OOFEMrecord") == 0) type = BC_OOFEM;
581  else if (strcmp(W, "NodalLoad") == 0) type = BC_NL;
582  else if (strcmp(W, "ConstantEdgeLoad") == 0) type = BC_CEL;
583  else if (strcmp(W, "ConstantSurfaceLoad") == 0) type = BC_CFL;
584  else if (strcmp(W, "ConstantBodyLoad") == 0) type = BC_CBL;
585  else if (strcmp(W, "DeadWeight") == 0) type = BC_DW;
586  else if (strcmp(W, "PrescribedValue") == 0) type = BC_PV;
587  else _errorr2 ("Unsupported name of boundary condition \"%s\"", W);
588 
589  if (type == BC_OOFEM) {
590  scan_linerec (str);
591  SP_scan_word (str, W);
593  if (loctype != BC_Void) {
594  bool scanned = true;
595  SP_scan_expected_word_exit (str, "x", "\"x\" word is expected after name of bc in OOFEMrecord record", CASE);
596  while (SP_scan_word (str, W)) {
597  if (strcmp(W, "loadTimeFunction") == 0) SP_scan_number (str, ltf);
598  else if (strcmp(W, "prescribedvalue") == 0) { ncomp = 1; components = new double[ncomp]; SP_scan_number (str, components[0]); }
599  else if (strcmp(W, "components") == 0) { SP_scan_number (str, ncomp); components = new double[ncomp]; SP_scan_array (str, ncomp, components); }
600  else scanned = false;
601  }
602  if (scanned) type = loctype;
603  }
604  }
605  else if (type == BC_PV) {
606  ncomp = 1;
607  components = new double[ncomp];
608  SP_scan_number (str, components[0]);
609  }
610  else {
611  scan_linerec (str);
612  while (SP_scan_word (str, W)) {
613  if (strcmp(W, "dpn") == 0) { SP_scan_word (str, W); dpn = DOFsPerNode_s2e(W); }
614  else if (strcmp(W, "components") == 0) {
615  SP_scan_number (str, ncomp);
616 
617  if (components) errol;
618  if (Pd->give_PDBO(PDBO_P_dw) && type == BC_DW) components = new double[6]; // DOCAS PDBO_P_dw
619  else components = new double[ncomp];
621  }
622  else if (strcmp(W, "ltf") == 0) {
623  SP_scan_number (str, ltf);
624  }
625  else errol;
626  }
627 
628  if (Pd->give_PDBO(PDBO_P_dw) && type == BC_DW) {
629  ncomp = 6;
630  components[3] = components[4] = components[5] = 0.0;
631  }
632 
633  if (type == BC_DW)
634  for (int i=0; i<ncomp; i++)
635  components[i] *= 9.81;
636 
637  }
638 
639  this->sifid = Pd->give_sifBCs(this->give_loctype());
640  ((Problem*)Pd)->add_sifBCs(this->give_loctype());
641 
642  return true;
643 }
645 {
646  type = BC_NL;
648  components = new double[ncomp];
649  this->scan_components (stream, ncomp);
650 }
651 
654 {
656 
657  if (this->give_loctype() != BC_PV && this->give_type() != BC_OOFEM)
658  if (this->ncomp != DOFsPerNode2nDOFs(this->give_dpn()))
659  _errorr2("Boundary condition %ld: number of components doesnot correspond with dpn", ID+1);
660 }
661 
662 
665 {
666  type = BC_SIFEL;
667  loctype = loct;
668  sifid = locid;
669  if (Pd->give_sifBCs(loctype) != sifid) errol;
670  ((Problem*)Pd)->add_sifBCs(loctype);
671 }
672 
675 {
676  type = loctype = BC_PV;
677  ncomp = 1;
678  components = new double[ncomp];
679  components[0] = 0;
680  ltf = 1;
681 }
684 {
685  if (type == BC_OOFEM) {
686  const char * str = linerec;
687  if ( ! SP_scan_expected_word (str, "BoundaryCondition", CASE) ) return false;
688  if ( ! SP_scan_expected_word (str, "x" , CASE) ) return false;
689  if ( ! SP_scan_expected_word (str, "loadTimeFunction" , CASE) ) return false;
690  if ( ! SP_scan_expected_word (str, "1" , CASE) ) return false;
691  if ( ! SP_scan_expected_word (str, "prescribedvalue" , CASE) ) return false;
692  if ( ! SP_scan_expected_word (str, "0" , CASE) &&
693  ! SP_scan_expected_word (str, "0.0" , CASE) ) return false;
694  }
695  else if (type == BC_PV) {
696  if ( ! ncomp == 1 ) return false;
697  if ( ! components[0] == 0.0 ) return false;
698  }
699  else return false;
700 
701  return true;
702 }
703 
705 void BoundaryCond :: print_row (FILE *stream, femFileFormat fff, long did) const
706 {
707  if (fff == FFF_OOFEM) {
708  switch (type) {
709  case BC_OOFEM: this->print_linerec (stream, false); break;
710  case BC_PV: fprintf (stream, "BoundaryCondition %ld loadTimeFunction %ld", this->ID + 1, ltf); fprintf (stream, " prescribedvalue %g", components[0]); break;
711  case BC_NL: fprintf (stream, "NodalLoad %ld loadTimeFunction %ld", this->ID + 1, ltf); this->print_components_oo(stream); break;
712  case BC_CEL: fprintf (stream, "ConstantEdgeLoad %ld loadTimeFunction %ld", this->ID + 1, ltf); fprintf (stream, " loadType 3 ndofs %d", this->ncomp); this->print_components_oo(stream); break;
713  case BC_CFL: fprintf (stream, "ConstantSurfaceLoad %ld loadTimeFunction %ld", this->ID + 1, ltf); fprintf (stream, " loadType 3 ndofs %d", this->ncomp); this->print_components_oo(stream); break;
714  case BC_DW: fprintf (stream, "DeadWeight %ld loadTimeFunction %ld", this->ID + 1, ltf); fprintf (stream, " valtype 2"); this->print_components_oo(stream); break;
715  default: _errorr2 ("Unsupported type of bc \"%d\"", type);
716  }
717  fprintf (stream, "\n");
718  }
719  else if (fff == FFF_SIFEL) {
720  if (type != BC_SIFEL) errol;
721  if (loctype != BC_PV) errol;
722  for (int i=0; i<ncomp; i++)
723  fprintf (stream, " %lf", components[i]);
724 
725  fprintf (stream, "\n");
726  }
727  else errol;
728 }
729 void BoundaryCond :: print_components_oo (FILE *stream) const
730 {
731  fprintf (stream, " components %d", this->ncomp);
732  for (int i=0; i<this->ncomp; i++)
733  fprintf (stream, " %.6lf", components[i]);
734 }
735 void BoundaryCond :: print_components (FILE *stream) const
736 {
737  for (int i=0; i<this->ncomp; i++)
738  fprintf (stream, "%14.6e", components[i]);
739 }
740 
741 
742 // ********************************************************************************************
743 // *** *** *** *** CLASS Assign *** *** *** ***
744 // ********************************************************************************************
747 {
749 
750  this->set_Geom (Pd->give_primary_geometry());
751 }
752 
753 // ********************************************************************************************
754 // *** *** *** *** CLASS AssignFix *** *** *** ***
755 // ********************************************************************************************
757 bool AssignFix :: initialize_from (const char *&str, femFileFormat ff, bool all)
758 {
759  SP_scan_number(str, elemid); elemid--;
760  //
761  char WORD[255];
762 
763  SP_scan_word (str, WORD);
764  if (strcmp(WORD, "nodes" ) == 0) node = true;
765  else if (strcmp(WORD, "elements") == 0) node = false;
766  else _errorr2 ("Unknown type of fixed entity \"%s\". Only \"nodes\" and \"elements\" supported.", WORD);
767 
768  SP_scan_word (str, WORD);
769  if (strcmp(WORD, "id" ) == 0) { type = ASG_id; SP_scan_array_alloc (str, ncn, icn); }
770  else _errorr2 ("Unknown type of assignment of BC \"%s\"", WORD);
771 
772  return true;
773 }
776 {
778 
779  if (type==ASG_id) {
780  const Gelement* gel = dynamic_cast<const Gelement*>(Geom->give_Elem(elemid));
781  if (gel == NULL) errol;
782  ((Gelement*)gel)->assign_fixed_entities_by_ID (node, ncn, icn);
783  }
784  else _errorr ("Unsupported type of assigment");
785 }
786 
787 
788 //* ********************************************************************************************
789 //* *** *** *** *** CLASS AssignBC *** *** *** ***
790 //* ********************************************************************************************
792 bool AssignBC :: initialize_from (const char *&str, femFileFormat ff, bool all)
793 {
794  // bs, check
795  bc = Pd->give_BC(ID-1); if (bc == NULL) _errorr2("There is no boundary condition with id %ld", ID);
796  BCType bct = bc->give_loctype();
797 
798  switch (this->give_classid()) {
799  case classABC_NLoad: if (bct != BC_NL) _errorr2 ("In block ASSIGN_NODAL_LOAD assigned to %d: assigned boundary condition is not of type NodalLoad", ID); break;
800  case classABC_CELoad: if (bct != BC_CEL) _errorr2 ("In block ASSIGN_CONST_EDGE_LOAD assigned to %d: assigned boundary condition is not of type Constant Edge Load", ID); break;
801  case classABC_CFLoad: if (bct != BC_CFL) _errorr2 ("In block ASSIGN_CONST_FACE_LOAD assigned to %d: assigned boundary condition is not of type Constant Face Load", ID); break;
802  case classABC_CBLoad: if (bct != BC_CBL && bct != BC_DW) _errorr2 ("In block ASSIGN_CONST_BODY_LOAD assigned to %d: assigned body condition is not of type Constant Body Load", ID); break;
803  default: _errorr0;
804  }
805  //
806  char WORD[255];
807  SP_scan_word (str, WORD);
808  if (strcmp(WORD, "id" ) == 0) { type = ASG_id; SP_scan_array_alloc (str, ncn, icn); }
809  else if (strcmp(WORD, "prop" ) == 0) { type = ASG_prop; SP_scan_array_alloc (str, ncn, icn); }
810  else if (strcmp(WORD, "coord" ) == 0) { type = ASG_coord; SP_scan_array_alloc (str, ncn, fcn); }
811  else if (strcmp(WORD, "surfprop" ) == 0) { type = ASG_faceprop; SP_scan_array_alloc (str, ncn, icn); }
812  else _errorr2 ("Unknown type of assignment of BC \"%s\"", WORD);
813 
814  return true;
815 }
818 {
820 }
821 
822 //* ***************************
823 //* *** CLASS ABC_NLOAD ***
824 //* ***************************
827 {
829 
830  long i;
831 
832  if (type==ASG_id) { for (i=0; i<ncn; i++) ((Geometry*)Geom)->assign_NodeLoad_by_point_ID (bc, icn[i]-1); }
833  else if (type==ASG_prop) { for (i=0; i<ncn; i++) ((Geometry*)Geom)->assign_NodeLoad_by_point_prop (bc, icn[i] ); }
834  else if (type==ASG_coord) { if (ncn%3) _errorr ("error"); PoinT coords;
835  for (i=0; i<ncn; ) { coords.x = fcn[i++]; coords.y = fcn[i++]; coords.z = fcn[i++];
836  ((Geometry*)Geom)->assign_NodeLoad_by_point_coords (bc, &coords); } }
837  else _errorr ("Unsupported type of assigment");
838 }
839 //* ****************************
840 //* *** CLASS ABC_CELOAD *** //* *** CEL - Constant Edge Loads ***
841 //* ****************************
844 {
846 
847  if (!ncn) return;
848 
849  ((Geometry*)Geom)->connectivity_assembling ();
850 
851  long i;
852  if (type==ASG_id) { for (i=0; i<ncn; i++) ((Geometry*)Geom)->assign_EdgeLoad_by_elem_ID (bc, icn[i]-1); }
853  else if (type==ASG_prop) { for (i=0; i<ncn; i++) ((Geometry*)Geom)->assign_EdgeLoad_by_elem_prop(bc, icn[i] ); }
854  else _errorr ("Unsupported type of assigment");
855 }
856 //* ****************************
857 //* *** CLASS ABC_CFLOAD *** //* *** CFL - Constant Face Loads ***
858 //* ****************************
861 {
863 
864  if (!ncn) return;
865 
866  ((Geometry*)Geom)->connectivity_assembling ();
867 
868  long i;
869  if (type==ASG_id) { for (i=0; i<ncn; i++) ((Geometry*)Geom)->assign_FaceLoad_by_elem_ID (bc, icn[i]-1); }
870  else if (type==ASG_prop) { for (i=0; i<ncn; i++) ((Geometry*)Geom)->assign_FaceLoad_by_elem_prop(bc, icn[i] ); }
871  else if (type==ASG_faceprop){ for (i=0; i<ncn; i++) ((Geometry*)Geom)->assign_FaceLoad_by_face_prop(bc, icn[i] ); }
872  else _errorr ("Unsupported type of assigment");
873 }
874 //* ****************************
875 //* *** CLASS ABC_CBLOAD *** //* *** CBL - Constant Body Loads ***
876 //* ****************************
878 {
880 
881  long i;
882 
883  if (type==ASG_id) { for (i=0; i<ncn; i++) ((Geometry*)Geom)->assign_BodyLoad_by_elem_ID (bc, icn[i]-1); }
884  else if (type==ASG_prop) { for (i=0; i<ncn; i++) ((Geometry*)Geom)->assign_BodyLoad_by_elem_prop(bc, icn[i] ); }
885  else _errorr ("Unsupported type of assigment");
886 }
887 
888 
889 
890 //* ********************************************************************************************
891 //* *** *** *** *** CLASS ATTRIBUTES *** *** *** ***
892 //* ********************************************************************************************
894 {
895  const BoundaryCond *bcnew = Pd->give_BC(i); if (bcnew == NULL) _errorr2("There is no boundary condition with ID = %d", i+1);
896  this->add_load (bcnew);
897 }
898 
899 //* ********************************************************************************************
900 //* *** *** *** *** CLASS FacedgeAttribs *** *** *** ***
901 //* ********************************************************************************************
904 {
905  if (loads()) errol; // DEBUG only
906  loads.be_copy_of(&src->loads);
907 }
908 
909 double FacedgeAttribs :: give_elemSize (void) const { return elemSize > 0.0 ? elemSize : GC->give_Pd()->give_IN_meshGen_elemSize(); } // nejde volat primo Pd, zjisti proc je NULL
911 
912 //* ********************************************************************************************
913 //* *** *** *** *** CLASS EdgeAttribs *** *** *** ***
914 //* ********************************************************************************************
917 {
919 
920  if (loads())
921  for (long i=0; i<loads(); i++) {
922  if (loads[i]->give_loctype() != BC_CEL) errol;
923  if (loads[i]->give_ncomp() != DOFsPerNode2nDOFs(owner()->give_main_masterel_uniq()->give_elemAttribs()->give_dpn())) errol;
924  }
925 }
926 
927 //* ********************************************************************************************
928 //* *** *** *** *** CLASS FaceAttribs *** *** *** ***
929 //* ********************************************************************************************
932 {
934 
935  if (loads())
936  for (long i=0; i<loads(); i++) {
937  if (loads[i]->give_loctype() != BC_CFL) errol;
938  if (loads[i]->give_ncomp() != DOFsPerNode2nDOFs(owner()->give_main_masterel_uniq()->give_elemAttribs()->give_dpn())) errol;
939  }
940 }
941 
942 //* ********************************************************************************************
943 //* *** *** *** *** CLASS ELEMENTATTRIBS *** *** *** ***
944 //* ********************************************************************************************
946 ElemAttribs :: ElemAttribs (const Element *ow, long p, ElAttLevel eal) : CellAttribs (ow, p)
947 {
948  EAL = eal;
949  if (owner()) {
950  Patt = (owner()->give_mproperty_cnt() ? Pd->give_ElAt_with_prop(owner()->give_mproperty()) : NULL);
951  Gatt = Pd->give_ElAt_with_geom(owner()->give_cellGeom());
953  }
954  else Patt = Gatt = Datt = NULL;
955  //
956  dpn = DPN_Void;
957  sst = SST_Void;
958  approx = FEA_Void;
959  expltype = FET_Void;
960  //
961  IPset = IPS_Void;
962  //
963  HNmstr = nlgeo = NULL;
964  //
965  lcs = NULL;
966  MatStiffMtrx = NULL;
967  //
968  //final_conDOFs = NULL;
969  conDOFs = NULL;
970  //
971  cs = NULL; mat = NULL;
972 }
974 ElemAttribs :: ElemAttribs (const Element *ow, const ElemAttribs *src, char samegeom) : CellAttribs (ow, src)
975 {
976  EAL = src->EAL; if (EAL != EAL_direct) errol;
977  Patt = src->Patt;
978  Gatt = src->Gatt;
979  Datt = src->Datt;
980  //
981  dpn = src->dpn;
982  sst = src->sst;
983  approx = src->approx;
984  expltype = src->expltype;
985  //
986  IPset = src->IPset;
987  //
988  cs = src->cs;
989  mat = src->mat;
990  lcs = src->lcs;
991  //
992  //for (int i=0; i<src->Ebc(); i++) Ebc.add( new GPA<const BoundaryCond>(src->Ebc[i]) );
993  //for (int i=0; i<src->Fbc(); i++) Fbc.add( new GPA<const BoundaryCond>(src->Fbc[i]) );
994  //
995  if (src->nlgeo) { nlgeo = new bool; nlgeo[0] = src->nlgeo[0]; } else nlgeo = NULL;
996  if (src->HNmstr) { HNmstr = new bool; HNmstr[0] = src->HNmstr[0]; } else HNmstr = NULL;
997  //
998  if (src->MatStiffMtrx) errol; // tady musim zjistit jestli matici copirovat nebo ne
999  MatStiffMtrx = NULL;
1000 
1001  conDOFs = NULL;
1002  if (src->conDOFs) {
1004  if (samegeom == 's') errol; // tady to natvrdo skopiruju
1006  else if (samegeom == 'd')
1007  //conDOFs = new GPA<DOFatt>; // conDOFs se nastavi v miste kde delam subdivision, pokud na to zapomenu, tak v initialize se nahlasi error
1008  errol; // tohle je tady docasne, az to nahlasi error, tak smaz a odkomentuj predchozi radek, coz by melo vest k chybe v initialize, pak musis udelat conDOFs naplneni v miste deleni
1010  else if (samegeom == 'm')
1012  else errol;
1013  }
1014 }
1017 {
1018  //Fbc.delete_objects();
1019  // Ebc.delete_objects();
1020  delete nlgeo;
1021  delete HNmstr;
1022  if (MatStiffMtrx) delete MatStiffMtrx;
1023  //delete final_conDOFs;
1024  if (conDOFs)
1025  conDOFs->delete_objects();
1026  delete conDOFs;
1027 }
1028 
1030 bool ElemAttribs :: initialize_from (const char *&str, femFileFormat ff, bool all)
1031 {
1032  if (ff == FFF_MIDAS || ff == FFF_OOFEM) {
1033  long auxl, auxl2;
1034  char WORD[255];
1035  while (SP_scan_word (str, WORD)) {
1036  if (STRCMP(WORD, "crossSect" ) == 0) { SP_scan_number (str, auxl); this->set_cs (auxl-1); }
1037  else if (STRCMP(WORD, "mat" ) == 0) { SP_scan_number (str, auxl); this->set_mat(auxl-1); }
1038  else if (STRCMP(WORD, "nlgeo" ) == 0) { SP_scan_number (str, auxl); this->set_nlgeo(auxl); }
1039  else if (STRCMP(WORD, "MI_HNmaster") == 0) { SP_scan_number (str, auxl); *HNmstr = auxl; }
1040  else if (STRCMP(WORD, "refNode" ) == 0) {
1041  lcs = new LCS_beam ();
1042  lcs->initialize_from (str, ff);
1043  }
1044  else if (STRCMP(WORD, "bodyLoads") == 0) {
1045  //if (EAL != EAL_direct) _errorr("Non direct bodyLoads forbidden, in ASSIGN_ATTRIBUTES_TO_ELEMENT_PROP");
1046  SP_scan_expected_number_exit (str, 1, "more then 1 of body loads on element - musis to tady rozsirit");
1047  SP_scan_number (str, auxl);
1048  ((Element*)owner())->set_load(auxl-1);
1049  }
1050  else if (STRCMP(WORD, "boundaryLoads") == 0) {
1051  if (EAL != EAL_direct) _errorr("Non direct boundaryLoads forbidden, in ASSIGN_ATTRIBUTES_TO_ELEMENT_PROP");
1052  SP_scan_expected_number_exit (str, 2, "more then 1 of boundary loads on element - musis to tady rozsirit");
1053  SP_scan_number (str, auxl);
1054  SP_scan_number (str, auxl2);
1055  ((Element*)owner())->set_load(auxl-1, auxl2-1);
1056  }
1057 
1058  else if (STRCMP(WORD, "symStiffMtrxOfMat") == 0) {
1059  if (MatStiffMtrx) errol;
1060  MatStiffMtrx = new Dvctr;
1061  SP_scan_Xvctr (str, MatStiffMtrx);
1062  }
1063  else if (STRCMP(WORD, "dofsToCondense") == 0) {
1064  int ndofs, nno, n, i, val, nodid;
1065 
1066  ndofs = DOFsPerNode2nDOFs(this->give_dpn());
1067  nno = owner()->give_nno();
1068  SP_scan_number (str, n);
1069 
1070  if (conDOFs) errol;
1071  conDOFs = new GPA<PointDOFsCondense>(nno);
1072 
1073  for (i=0; i<n; i++) {
1074  SP_scan_number (str, val); val--;
1075  nodid = val/ndofs;
1076  val = val%ndofs;
1077  if (conDOFs[0][nodid] == NULL) conDOFs->assign(nodid, new PointDOFsCondense(nodid, owner()));
1078  conDOFs[0][nodid]->set_att(val, 1);
1079  }
1080  }
1081  // else if (STRCMP(WORD, "fet") == 0) {
1082  // SP_scan_word (str, WORD);
1083  // FiniteElementTypeSet fets;
1084  // FETSet_s2set_OOFEM (WORD, &fets);
1085  // this->set_FETS(&fets);
1086  // }
1087  else if (ff == FFF_OOFEM) {
1088  if (STRCMP(WORD, "NIP") == 0) {
1089  SP_scan_number (str, auxl);
1090  FiniteElementTypeSet fetset;
1091  IPset = IPS_inputfile_value_i2e_OOFEM (auxl, this->give_FETS(&fetset));
1092  }
1093  else
1094  _errorr2 ("Unknown OOFEM element key word %s", WORD);
1095  }
1096  else if (ff == FFF_MIDAS) {
1097  if (STRCMP(WORD, "IPset" ) == 0) { SP_scan_word (str, WORD); IPset = IntPointSet_s2e(WORD); }
1098  else if (STRCMP(WORD, "approx" ) == 0) { SP_scan_word (str, WORD); approx = FEApproximation_s2e(WORD); }
1099  else if (STRCMP(WORD, "dpn" ) == 0) { SP_scan_word (str, WORD); dpn = DOFsPerNode_s2e(WORD); }
1100  else if (STRCMP(WORD, "sst" ) == 0) { SP_scan_word (str, WORD); sst = SStype_s2e(WORD); }
1101  else if (STRCMP(WORD, "expltype") == 0) { SP_scan_word (str, WORD); expltype = FET_s2e(WORD); }
1102  else _errorr2 ("Unknown MIDAS element key word %s", WORD);
1103  }
1104  } // end of while
1105  }
1106  else if (ff == FFF_SIFEL) {
1107  int auxi, id;
1108  // cross-sect
1109  SP_scan_number (str, auxi);
1110  if (auxi) {
1111  SP_scan_number (str, id);
1113  }
1114  else {
1115  if (cs) errol;
1116  if (owner()->give_classid() == classBrick)
1117  cs = (CrossSection*) ((Problem*)Pd)->give_3dCS();
1118  }
1119 
1120  if (Pd->give_analgroup() == PAG_mechanics) {
1121  SP_scan_number (str, auxi); if (auxi != 1) _errorr("more then 1 material per element in SIFEL input file");
1122  }
1123 
1124  SP_scan_number (str, auxi);
1125  SP_scan_number (str, id);
1127  }
1128  else errol;
1129 
1130  return true;
1131 }
1132 
1135 {
1137 
1138  if (lcs) lcs->initialize(this->Geom);
1139 }
1140 
1143 {
1144 }
1145 
1148 {
1150 
1151  if (EAL == EAL_Void) errol;
1152  if (EAL == EAL_direct && !owner() ) errol;
1153  if (EAL != EAL_direct && (owner() || Patt || Gatt || Datt)) errol;
1154 
1155  if (owner() && Pd->give_fulldata()) {
1156  long i;
1157  bool ok = true;
1158 
1159  //* *** MATERIAL ***
1160  //* assignment of cs
1161  if (this->give_mat() == NULL) {
1162  ok = false;
1163 
1164  // element ma LayeredCS, nema material primo prirazeny
1165  if (!ok) { if (this->give_cs() && this->give_cs()->give_loctype_or_type() == CST_LayeredCS) ok = true; }
1166 
1167  // element is virtual, no material
1168  if (!ok) {
1169  const GelemAttribs *gelat = dynamic_cast<const GelemAttribs*>(this);
1170  if (gelat && gelat->give_virtual()) ok = true;
1171  }
1172 
1173  if (ok == false) _errorr2("There is no material at element %ld", owner()->give_ID()+1);
1174  }
1175 
1176  //* *** CROSS-SECTION ***
1177  //* assignment of cs
1178  if (this->give_cs() == NULL) {
1179  ok = false;
1180 
1181  // element has MAT_RIGID material, no cs is needed
1182  if (!ok) { if (this->give_mat() && this->give_mat()->give_type() == MAT_RIGID) ok = true; }
1183 
1184  // element is virtual, no cs
1185  if (!ok) {
1186  const GelemAttribs *gelat = dynamic_cast<const GelemAttribs*>(this);
1187  if (gelat && gelat->give_virtual()) ok = true;
1188  }
1189 
1190  // cs is at nodes
1191  if (!ok) {
1192  ok = true;
1193  for (i=0; i<this->owner()->give_nno(); i++)
1194  if (this->owner()->give_point(i)->give_pointAttribs()->give_cs() == NULL)
1195  ok = false;
1196 
1197  }
1198 
1199  if (ok == false) _errorr2("There is no crossection at element %ld or at its nodes", owner()->give_ID()+1);
1200  }
1201  else {
1203  ;;
1204  }
1205 
1206  //* dimension of cross-section
1207  if (this->give_cs()) {
1208  switch (this->give_cs()->give_type()) {
1209  case CST_Truss: if (owner()->give_dimension() != 1 || this->give_dpn() != DPN_DxyzR___) _errorr2 ("element %ld has incompatible cross-section - truss cs ", owner()->give_ID()+1); break;
1210  //case CST_Rectangle:
1211  //case CST_Rectangle_tube:
1212  //case CST_Circle:
1213  //case CST_Circle_tube:
1214  //case CST_Circle_cable:
1215  case CST_Beam: if (owner()->give_dimension() != 1 ) _errorr2 ("1D cross-section at not 1D element %ld", owner()->give_ID()+1); break;
1216  case CST_2d: if (owner()->give_dimension() != 2 ) _errorr2 ("2D cross-section at not 2D element %ld", owner()->give_ID()+1); break;
1217  case CST_3d: if (owner()->give_dimension() != 3 ) _errorr2 ("3D cross-section at not 3D element %ld", owner()->give_ID()+1); break;
1218  case CST_OOFEM: break;
1219  case CST_SIFEL: break;
1220  default: _errorr2("Unknown cross-section type %d", this->give_cs()->give_type());
1221  }
1222  }
1223 
1224  //* *** LOAD ***
1225  if (loads())
1226  for (i=0; i<loads(); i++) {
1227  if (loads[i]->give_loctype() != BC_CBL && loads[i]->give_loctype() != BC_DW) errol;
1228  if (loads[i]->give_dpn() != this->give_dpn())
1229  loads[i]->check_dpn(this->give_dpn());
1230  // errol;
1231  }
1232  }
1233 }
1234 
1235 
1238 {
1239  if (prop != slv->prop ) _errorr ("Duplicity slave and master differ in ...");
1240  //
1241  if (EAL != slv->EAL ) _errorr ("Duplicity slave and master differ in ...");
1242  //
1243  if (Patt != slv->Patt ) _errorr ("Duplicity slave and master differ in ...");
1244  if (Gatt != slv->Gatt ) _errorr ("Duplicity slave and master differ in ...");
1245  if (Datt != slv->Datt ) _errorr ("Duplicity slave and master differ in ...");
1246  //
1247  if (dpn != slv->dpn ) _errorr ("Duplicity slave and master differ in ...");
1248  if (sst != slv->sst ) _errorr ("Duplicity slave and master differ in ...");
1249  if (approx != slv->approx) _errorr ("Duplicity slave and master differ in ...");
1250  if (expltype != slv->expltype) _errorr ("Duplicity slave and master differ in ...");
1251  //
1252  if (IPset != slv->IPset ) _errorr ("Duplicity slave and master differ in ...");
1253  if (cs != slv->cs ) _errorr ("Duplicity slave and master differ in ...");
1254  if (mat != slv->mat ) _errorr ("Duplicity slave and master differ in ...");
1255  if (lcs != slv->lcs ) _errorr ("Duplicity slave and master differ in ...");
1256 
1257  if (loads() || HNmstr || nlgeo || MatStiffMtrx) _errorr ("This check is not implemented");
1258  //if (!same_array_elements_asym(this->nno, this->nodes, slave->nno, slave->nodes, true)) _errorr ("Duplicity slave and master differ in nodes atribut");
1259 }
1260 
1261 
1262 
1263 //* ***********
1264 //* *** SET ***
1265 //* ***********
1268 {
1269  Patt = Pd->give_ElAt_with_prop(owner()->give_mproperty());
1270 }
1271 
1274 {
1275  if (set->cg != owner()->give_cellGeom()) errol;
1276  dpn = set->dpn;
1277  sst = set->sst;
1278  approx = set->approx;
1279  expltype = set->expltype;
1280  //int ord;
1281 }
1282 
1284 void ElemAttribs :: set_MatStiffMtrx(int n, double *src)
1285 {
1286  MatStiffMtrx = new Dvctr(n);
1287  MatStiffMtrx->beCopyOf(src);
1288 }
1289 
1290 
1291 //* ***********
1292 //* *** GET *** /// DEFAULT
1293 //* ***********
1296 {
1297  set->cg = this->owner()->give_cellGeom();
1298  set->dpn = this->give_dpn();
1299  set->sst = this->give_sst();
1300  set->approx = this->give_approx();
1301  set->expltype = this->give_expltype();
1302  set->ord = ord;
1303 
1304  return set;
1305 }
1306 
1310 
1311 
1314 {
1315  return conDOFs ? conDOFs[0][owner()->give_point_indx(p)] : NULL;
1316 }
1317 
1318 
1319 
1322 {
1323  switch (this->give_dpn()) {
1324  case DPN_DxyzR___: break;
1325  case DPN_DxyzRxyz:
1327 
1328  if (conDOFs[0][point]) errol;
1329  conDOFs->assign(point, new PointDOFsCondense(point, owner()));
1330  conDOFs[0][point]->set_full_hinge(false); // cross hinge
1331  break;
1332  default: errol;
1333  }
1334 }
1335 
1338 {
1339  if (conDOFs &&
1340  conDOFs->first() && conDOFs->last() &&
1341  conDOFs->first()->is_full_hinge() && conDOFs->last()->is_full_hinge())
1342  return true;
1343 
1344  return false;
1345 }
1346 
1349 {
1350  switch (this->give_dpn()) {
1351  case DPN_DxyzR___: break;
1352  case DPN_DxyzRxyz:
1353  if (this->has_fullhinge_ends()) {
1354  this->set_dpn(DPN_DxyzR___);
1355  conDOFs->delete_objects();
1356  delete conDOFs;
1357  conDOFs = NULL;
1358 
1359  if (loads()) {
1360  if (loads() != 1) errol;
1361  if (loads[0]->give_dpn() != DPN_DxyzRxyz) errol;
1362  if (loads[0]->give_loctype() != BC_DW) errol;
1363  loads.assign(0, ((Problem*)Pd)->switch_BC(loads[0], DPN_DxyzRxyz, DPN_DxyzR___));
1364  }
1365  }
1366  break;
1367  default: errol;
1368  }
1369 }
1370 
1371 //* *** PRINT ***
1372 
1374 void ElemAttribs :: print_Bbc_SIFEL (FILE *stream) const
1375 {
1376  if (loads() == 0) return;
1377  if (loads() > 1) errol; // vice zatizeni zatim nepodporuju
1378 
1379  fprintf (stream, "%6ld 1", owner()->give_ID()+1);
1380 
1381  loads[0]->print_components (stream);
1382  fprintf (stream, "\n");
1383 }
1385 void ElemAttribs :: print_Ebc_SIFEL (FILE *stream) const
1386 {
1387  const GPA<const Edge> *edges = owner()->give_edges();
1388  long i, nbc = 0;
1389  for (i=0; i<(*edges)(); i++) nbc += (*edges)[i]->give_cloads(owner());
1390 
1391  if (! nbc) return;
1392 
1393  const GPA<const BoundaryCond>* loades;
1394 
1395  fprintf (stream, "%ld ????????????????????????\n", owner()->give_ID()+1);
1396 
1397  for (i=0; i<(*edges)(); i++) {
1398  loades = (*edges)[ECN_convert_i2e (i, 1, this->give_ord(), owner()->give_cellGeom(), FFF_SIFEL)]->give_loads(owner());
1399 
1400  if (loades->give_size() > 1) errol; // vice zatizeni zatim nepodporuju
1401 
1402  if (loades->give_size() == 1) {
1403  fprintf (stream, " 1");
1404  (*loades)[0]->print_components(stream);
1405  fprintf (stream, "\n");
1406  }
1407  else
1408  fprintf (stream, " 0\n");
1409  }
1410 }
1412 void ElemAttribs :: print_Fbc_SIFEL (FILE *stream) const
1413 {
1414  const GPA<const Face> *faces = owner()->give_faces();
1415  long i, nbc = 0;
1416  for (i=0; i<(*faces)(); i++) nbc += (*faces)[i]->give_cloads(owner());
1417 
1418  if (! nbc) return;
1419 
1420  const GPA<const BoundaryCond>* loades;
1421 
1422  fprintf (stream, "%ld ????????????????????????\n", owner()->give_ID()+1);
1423 
1424  for (i=0; i<(*faces)(); i++) {
1425  loades = (*faces)[ECN_convert_i2e (i, 2, this->give_ord(), owner()->give_cellGeom(), FFF_SIFEL)]->give_loads(owner());
1426 
1427  if (loades->give_size() > 1) errol; // vice zatizeni zatim nepodporuju
1428 
1429  if (loades->give_size() == 1) {
1430  fprintf (stream, " 1");
1431  (*loades)[0]->print_components(stream);
1432  fprintf (stream, "\n");
1433  }
1434  else
1435  fprintf (stream, " 0\n");
1436  }
1437 }
1438 
1439 
1440 
1441 //* ********************************************************************************************
1442 //* *** *** *** *** CLASS FELEMENTATTRIBS *** *** *** ***
1443 //* ********************************************************************************************
1445 FElemAttribs :: FElemAttribs (const Element *ow, long p, ElAttLevel eal, const Problem *pd) : ElemAttribs (ow, p , eal)
1446 {
1447  if (ow) {
1448  if (pd) errol;
1449  const FElement* fo = dynamic_cast<const FElement*>(GC);
1450  if (!fo) errol;
1451  }
1452  else {
1453  if (!pd) errol;
1454  this->set_Pd(pd);
1455  }
1456 }
1458 FElemAttribs :: FElemAttribs (const Element *ow, const FElemAttribs *src, char samegeom) : ElemAttribs (ow, src, samegeom)
1459 {
1460  if (ow) {
1461  const FElement* fo = dynamic_cast<const FElement*>(GC);
1462  if (!fo) errol;
1463  }
1464 
1465  if (src->lcs) {
1466  if (!f_owner() || !src->f_owner()) errol; // neni dovoleny att bez ownera ale s lcs
1467  // zatim neni dovoleno kopirovat felem att s lcs
1468  // neumim rozhodnout, zda se ma lcs kopirovat, zda se ma kopirovat zavislost na mastrovi...
1469  // tady se musi zavolat copy constructor na lcs lcs = new LocalCoordSyst(src->lcs)
1470  errol; // docasne
1471  }
1472 }
1474 FElemAttribs :: FElemAttribs (const Element *ow, const GelemAttribs *src, char samegeom) : ElemAttribs (ow, (const ElemAttribs*)src, samegeom)
1475 {
1476  if (ow) {
1477  const FElement* fo = dynamic_cast<const FElement*>(ow);
1478  if (!fo) errol;
1479  }
1480  else errol; // kdyz kopiruju z gelementu, tak bych mel mit vzdycky ownera
1481 }
1484 {
1485  if (lcs) {
1486  //if (!f_owner) errol; // neni dovoleny att bez ownera ale s lcs, zatim
1487  if (f_owner() && f_owner()->give_mdl_masterel())
1488  lcs = NULL;
1489  else
1490  delete lcs;
1491  }
1492 }
1493 
1496 {
1498 
1499  //if (owner) this->set_fowner();
1500 
1501  // conDOFs se zkopiruje az tady, uz nevim proc se to nedela v /// CONSTRUCTOR COPY ElemAttribs :: ElemAttribs (
1502  if (conDOFs && (*conDOFs)() == 0) {
1503  EALdirectCheck();
1504 
1505  conDOFs->resizeup(owner()->give_nno());
1506 
1507  const Gelement* master = f_owner()->give_mdl_masterel(); if (!master) errol;
1508  const GPA<PointDOFsCondense>* masterconDOFs = master->give_gelemAttribs()->give_conDOFs(); if (!masterconDOFs) errol;
1509 
1510  int i,j;
1511  bool nocond = true;
1512  for (i=0; i<masterconDOFs[0](); i++) {
1513  if (masterconDOFs[0][i] == NULL) continue;
1514 
1515  for (j=0; j<owner()->give_nno(); j++) {
1516  if (f_owner()->give_node(j)->give_mdl_masterex() == master->give_point(i))
1517  break;
1518  }
1519  if (j == owner()->give_nno()) continue;
1520 
1521  if (conDOFs[0][j]) errol;
1522  conDOFs->assign(j, new PointDOFsCondense(masterconDOFs[0][i], owner()));
1523 
1524  nocond = false;
1525  }
1526 
1527  if (nocond) {
1528  delete conDOFs;
1529  conDOFs = NULL;
1530  }
1531  }
1532 }
1533 
1535 //void FElemAttribs :: set_fowner (void)
1536 //{
1537 // f_owner = dynamic_cast<const FElement*>(owner);
1538 // if (!f_owner)
1539 // errol;
1540 //}
1541 
1543 void FElemAttribs :: print_row (FILE *stream, femFileFormat fff, long did) const
1544 {
1545  if (fff == FFF_OOFEM) {
1546  EALdirectCheck();
1547 
1548  // lcs
1549  if (f_owner()->isBeam()) {
1550  fprintf (stream, " refNode");
1551  const LCS_beam *llccss = this->give_lcs_global();
1552 
1553  if (llccss) llccss->print_row_OOFEM(stream, did, (Beam*)owner());
1554  else fprintf (stream, " 0");
1555  }
1556 
1562  const CrossSection *c = this->give_cs(); if (c) fprintf (stream," crossSect %ld", c->give_ID()+1); else _errorr2 ("Element %ld: no crosssection assigned", owner()->give_ID()+1);
1563  const Material *m = this->give_mat(); if (m) fprintf (stream," mat %ld", m->give_ID()+1); else fprintf (stream," mat 1");
1565  IntPointSet ipset = this->give_IPset(); if (ipset) fprintf (stream," NIP %d", IPS_inputfile_value_e2i_OOFEM (ipset));
1566  //int nlg = this->give_nlgeo(); if (nlg>0) fprintf (stream," nlgeo %d", nlg);
1567 
1569  if (MatStiffMtrx) {
1570  fprintf (stream," symStiffMtrxOfMat %ld", MatStiffMtrx->give_size());
1571  for (int i=0; i<MatStiffMtrx->give_size(); i++)
1572  fprintf (stream, " %.6g", (*MatStiffMtrx)[i]);
1573  }
1574 
1576  if (loads()) {
1577  fprintf (stream," bodyLoads %ld", loads());
1578  for (long i=0; i<loads(); i++) fprintf (stream," %ld", loads[i]->give_ID()+1);
1579  }
1580 
1582  long i, nedl, nfal;
1583  const GPA<const Edge>* edges = owner()->give_edges();
1584  const GPA<const Face>* faces = owner()->give_faces();
1585 
1586  nedl = nfal = 0;
1587  for (i=0; i<(*edges)(); i++) nedl += (*edges)[i]->give_cloads(owner());
1588  for (i=0; i<(*faces)(); i++) nfal += (*faces)[i]->give_cloads(owner());
1589 
1590  if (nedl + nfal) {
1591  long j;
1592  const GPA<const BoundaryCond>* loades;
1593 
1594  fprintf (stream," boundaryLoads %ld", 2 * (nedl + nfal));
1595 
1596  if (nedl)
1597  for (i=0; i<(*edges)(); i++) {
1598  loades = (*edges)[i]->give_loads(owner());
1599  if (loades)
1600  for (j=0; j<(*loades)(); j++)
1601  fprintf (stream," %ld %d", (*loades)[j]->give_ID()+1, ECN_convert_i2e (i, 1, this->give_ord(), owner()->give_cellGeom(), fff) + 1);
1602  }
1603  if (nfal)
1604  for (i=0; i<(*faces)(); i++) {
1605  loades = (*faces)[i]->give_loads(owner());
1606  if (loades)
1607  for (j=0; j<(*loades)(); j++)
1608  fprintf (stream," %ld %d", (*loades)[j]->give_ID()+1, ECN_convert_i2e (i, 2, this->give_ord(), owner()->give_cellGeom(), fff) + 1);
1609  }
1610  }
1611  }
1612  else if (fff == FFF_ANSYS) {
1614  const CrossSection *c = this->give_cs(); if (c) fprintf (stream,"SECNUM, %ld\n", c->give_ID()+1); else _errorr2 ("Element %ld: no crosssection assigned", owner()->give_ID()+1);
1615  const Material *m = this->give_mat(); if (m) fprintf (stream,"MAT, %ld\n", m->give_ID()+1); else _errorr2 ("Element %ld: no material assigned", owner()->give_ID()+1);
1616  }
1617  else if (fff == FFF_SIFEL) {
1618  // code numbers
1619  fprintf (stream, " 0");
1620 
1622  // cross-section
1623  const CrossSection *c = this->give_cs();
1624  if (c) {
1626  fprintf (stream, " %d", csid);
1627  if (csid)
1628  fprintf (stream, " %ld", c->give_sifid()+1);
1629  }
1630  else _errorr2 ("Element %ld: no crosssection assigned", owner()->give_ID()+1);
1631  // only one material
1632  if (Pd->give_analgroup() == PAG_mechanics) fprintf (stream," 1");
1633  // material
1634  const Material *m = this->give_mat(); if (m) fprintf (stream, " %d %ld", MaterialType_e2i_SIFEL(m->give_loctype(), Pd->give_analgroup()), m->give_sifid()+1); else _errorr2 ("Element %ld: no material assigned", owner()->give_ID()+1);
1635  }
1636  else errol;
1637 }
1638 
1639 //* ********************************************************************************************
1640 //* *** *** *** *** CLASS GELEMENTATTRIBS *** *** *** ***
1641 //* ********************************************************************************************
1644 {
1646 
1647  if (virt) {
1648  if (dpn != DPN_Void ||
1649  sst != SST_Void ||
1650  approx != FEA_Void ||
1651  expltype != FET_Void ||
1652  //
1653  IPset != IPS_Void ||
1654  //
1655  HNmstr || nlgeo ||
1656  //
1657  //lcs || lukas zadava lcs plosne vsude, nejde se tomu vyhnout
1658  MatStiffMtrx ||
1659  //
1660  conDOFs ||
1661  //
1662  cs || mat ||
1663  loads()
1664  )
1665  _errorr("attribute at virtual element");
1666  }
1667 
1668 #ifdef DEBUG
1669  if (conDOFs && conDOFs->give_num_nonNULL_ptrs() == 0)
1670  errol;
1671 #endif
1672 }
1673 
1675 void GelemAttribs :: set_nDOFs_BC (int nd, int *bc)
1676 {
1677  if (dofbc) _errorr ("dofbc != NULL");
1678  if (!owner()) errol; // docasne
1679  dofbc = new PointDOFsBCPM((long)0, owner());
1680  dofbc->set_ndofsatt(nd, bc);
1681 }
1682 void GelemAttribs :: set_nDOFs_BC (int nd, long *bc)
1683 {
1684  if (dofbc) _errorr ("dofbc != NULL");
1685  if (!owner()) errol; // docasne
1686  dofbc = new PointDOFsBCPM((long)0, owner());
1687  dofbc->set_ndofsatt(nd, bc);
1688 }
1689 // void GelemAttribs :: set_nDOFs_BC (const PointDOFsBCPM *src)
1690 // {
1691 // if (src == NULL) _errorr2("There is no set of prescribed values with ID = %d",i+1);
1692 // if (dofbc) _errorr ("dofbc != NULL");
1693 // if (!owner()) errol; // docasne
1694 // dofbc = new PointDOFsBCPM(src, owner());
1695 // }
1696 
1697 
1698 //* ********************************************************************************************
1699 //* *** *** *** *** CLASS NODEATTRIBS *** *** *** ***
1700 //* ********************************************************************************************
1702 PointAttribs :: PointAttribs (const Point *ow, long p, const Problem *pd, const PointAttribs *gena) : Attributes (ow, p)
1703 {
1704  if (GC) { if (pd) errol; }
1705  else { if (!pd) errol; this->set_Pd(pd); }
1706 
1707  genatt = gena;
1708  hinge = -1;
1709  dofbc = NULL;
1710  cs = NULL;
1711  lcs = NULL;
1712 }
1714 PointAttribs :: PointAttribs (const Point *ow, const Attributes *src) : Attributes (ow, src)
1715 {
1716  if (owner() == NULL) errol;
1717 
1718  classID cid = src->give_classid();
1719  if (cid == classPointAttribs) {
1720  const PointAttribs *na = dynamic_cast<const PointAttribs *>(src);
1721  if (!na) errol;
1722 
1723  genatt = na->genatt;
1724 
1725  //* give dofbc have to be local, pointer to superior attribs is inherited
1726  if (na->dofbc) dofbc = new PointDOFsBCPM(na->dofbc, owner());
1727  else dofbc = NULL;
1728 
1729  hinge = na->hinge;
1730 
1731  cs = na->cs;
1732 
1733  if (na->lcs) errol; lcs = NULL;
1734  }
1735  else if (cid == classGelemAttribs) {
1736  const GelemAttribs *ga = dynamic_cast<const GelemAttribs *>(src);
1737  if (!ga) errol;
1738 
1739  genatt = NULL;
1740 
1741  //* give_dofbc have to be global, to get value recursively from superior elem. attribs
1742  if (ga->give_dofbc()) dofbc = new PointDOFsBCPM(ga->give_dofbc(), owner());
1743  else dofbc = NULL;
1744 
1745  hinge = -1;
1746  cs = NULL;
1747  lcs = NULL;
1748 
1749  loads.resize_zero();
1750  }
1751  else errol;
1752 }
1755 {
1756  delete dofbc;
1757  delete lcs;
1758 }
1759 
1761 bool PointAttribs :: initialize_from (const char *&str, femFileFormat ff, bool all)
1762 {
1763  if (ff == FFF_MIDAS || ff == FFF_OOFEM) {
1764  //bool result = false;
1765  long auxl;
1766  char WORD[255];
1767  while (SP_scan_word (str, WORD)) {
1768  if (strcmp(WORD, "bc") == 0) {
1769  if (dofbc) dofbc->scan_att_ndofs_expected (str);
1770  else { dofbc = owner() ? new PointDOFsBCPM((long)0, owner()) : new PointDOFsBCPM((long)0, Pd); dofbc->scan_att_ndofs_new (str); }
1771  }
1772  else if (strcmp(WORD, "DofIDMask") == 0) {
1774  }
1775  else if (strcmp(WORD, "load") == 0) {
1776  SP_scan_expected_number_exit (str, 1, "uz to podporuju, jen tady dodelej smyci nacitani");
1777  SP_scan_number (str, auxl);
1778  this->add_load(auxl-1);
1779  }
1780  else if (strcmp(WORD, "ndofs") == 0) {
1781  if (dofbc) dofbc->scan_ndofs_expected (str);
1782  else { dofbc = owner() ? new PointDOFsBCPM((long)0, owner()) : new PointDOFsBCPM((long)0, Pd); dofbc->scan_ndofs_new (str); }
1783  }
1784  else if (strcmp(WORD, "lcs") == 0) {
1785  if (lcs) errol;
1786  lcs = new LCS_pure();
1787  lcs->initialize_from(str, ff);
1788  }
1789  else
1790  if (all)
1791  _errorr3 ("Unknown OOFEM node key word \"%s\", att id = %d", WORD, prop);
1792  else {
1793  SP_unscan_word (str, WORD);
1794  break;
1795  }
1796 
1797  //result = true;
1798  }
1799  }
1800  else if (ff == FFF_SIFEL) {
1801  SP_skip_space(str);
1802  if (str[0] == '-')
1803  return false;
1804 
1805  int auxi, id;
1806  dofbc = owner() ? new PointDOFsBCPM((long)0, owner()) : new PointDOFsBCPM((long)0, Pd);
1807  dofbc->scan_ndofs_new (str);
1809 
1810  SP_scan_number (str, auxi);
1811  if (auxi) {
1812  SP_scan_number (str, id);
1814  }
1815  if (Pd->give_analgroup() == PAG_mechanics) {
1816  SP_scan_number (str, auxi); if (auxi) errol;
1817  }
1818  }
1819  else errol;
1820 
1821  return true;
1822 }
1825 {
1827 }
1828 
1830 {
1831 }
1832 
1835 {
1837 
1838  if (dofbc) dofbc->checkConsistency();
1839 
1840  if (owner())
1841  if (loads())
1842  for (long i=0; i<loads(); i++)
1843  if (loads[i]->give_type() == BC_NL)
1844  if ( loads[i]->give_ncomp() != owner()->give_pointAttribs()->give_nDOFs())
1845  errol;
1846 
1847 }
1848 
1850 void PointAttribs :: set_nDOFs_BC (int nd, int *bc)
1851 {
1852  if (dofbc) _errorr ("dofbc != NULL");
1853  dofbc = owner() ? new PointDOFsBCPM((long)0, owner()) : new PointDOFsBCPM((long)0, Pd);
1854  dofbc->set_ndofsatt(nd, bc);
1855 }
1856 void PointAttribs :: set_nDOFs_BC (int nd, long *bc)
1857 {
1858  if (dofbc) _errorr ("dofbc != NULL");
1859  dofbc = owner() ? new PointDOFsBCPM((long)0, owner()) : new PointDOFsBCPM((long)0, Pd);
1860  dofbc->set_ndofsatt(nd, bc);
1861 }
1863 {
1864  if (dofbc) _errorr ("dofbc != NULL");
1865  dofbc = new PointDOFsBCPM(src, owner());
1866 }
1868 {
1869  if (this->give_DOFbc() && dofbc==NULL) errol; // tohle musim teprve vyspekulovat, asi odshora prirazeny dofbc zkopiruju do lokalu a upravim
1870  if (!dofbc) dofbc = owner() ? new PointDOFsBCPM((long)0, owner()) : new PointDOFsBCPM((long)0, Pd);
1872 }
1873 
1875 void PointAttribs :: setup_full_alloc_DOFvals (Dvctr *answer, const Dvctr *values) const
1876 {
1877  //
1878  answer->resize_ignore_vals(6);
1879  int ndofs = this->give_nDOFs();
1880  const int *mask = this->give_dofBCmask();
1881 
1882  if (ndofs != 6) answer->zero();
1883 
1884  while (ndofs--) (*answer)[mask[ndofs]-1] = (*values)[ndofs];
1885 
1886  if (lcs) {
1887  MatriX rotmat;
1888  lcs->setup_rotmat_l2g(&rotmat);
1889  rotmat.rotate(answer);
1890  }
1891 }
1892 
1895 {
1896  if (this->give_nDOFs() != slave->give_nDOFs()) _errorr ("node attributes are not equal - in nDOFs attribute");
1897  if (dofbc && !dofbc->is_identical_with(slave->dofbc)) _errorr ("node attributes are not equal - in dofbc attribute");
1898 
1899  if (!loads.is_identical_with(slave->loads)) _errorr ("node attributes are not equal - in bc attribute");
1900 }
1901 
1902 
1903 //* *** READ ***
1904 void PointAttribs :: read_bc (FILE *stream, femFileFormat fff)
1905 {
1906  if (fff == FFF_SIFEL) {
1907  if (loads()) errol;
1908 
1909  BoundaryCond *lbc = new BoundaryCond (Pd, -1);
1910  lbc->initialize_BC_NL_SIFEL(stream);
1911 
1912  loads.add(((Problem*)Pd)->add_find_BC(lbc));
1913  }
1914  else errol;
1915 }
1916 
1917 //* *** PRINT ***
1922 {
1923  if (fff == FFF_OOFEM) {
1924  if (!dofbc) return false;
1925  fprintf (stream, " bc %d", dofbc->give_ndofs());
1926  for (int i=0; i<dofbc->give_ndofs(); i++)
1927  fprintf (stream, " %d", dofbc->give_att(i));
1928 
1930  return dofbc->rer();
1931  }
1932  return false;
1933 }
1936 {
1937  const PointDOFsBCPM *dofat = this->give_DOFbc();
1938  if (!dofat || !dofat->is_supported()) return;
1939 
1940  if (fff == FFF_SIFEL) {
1941  fprintf (stream, "%ld", owner()->give_ID()+1);
1942 
1943  for (int i=0; i<dofat->give_ndofs(); i++)
1944  fprintf (stream, " %d", dofat->BC_give_att_SIFEL_NODEBC_reverted(i));
1945 
1946  fprintf (stream, "\n");
1947  }
1948  else if (fff == FFF_ANSYS) {
1949  const int* att = dofat->give_att ();
1950  const int* mask = dofat->give_mask();
1951  if (!mask)
1952  mask = Pd->give_DOFbc_mask();
1953 
1954  for (int i=0; i<dofat->give_ndofs(); i++)
1955  if (att[i])
1956  fprintf (stream, "D, %6ld, %s, 0.0\n", owner()->give_ID()+1, DOFtype_i2s_ANSYS((DOFtype)mask[i]));
1957 
1958  fprintf (stream, "\n");
1959  }
1960  else errol;
1961 }
1962 
1964 void PointAttribs :: print_DofIDMask_OOFEM (FILE *stream) const
1965 {
1966  if (dofbc->mask_is_null()) return;
1967  fprintf (stream, " ndofs %d DofIDMask %d", dofbc->give_ndofs(), dofbc->give_ndofs());
1968  for (int i=0; i<dofbc->give_ndofs(); i++)
1969  fprintf (stream, " %d", dofbc->give_mask(i));
1970 }
1972 void PointAttribs :: print_bc (FILE *stream, femFileFormat fff) const
1973 {
1974  if (loads() == 0) return;
1975 
1976  if (fff == FFF_OOFEM) {
1977  fprintf (stream," load %ld", loads());
1978  for (int i=0; i<loads(); i++)
1979  fprintf (stream, " %ld", loads[i]->give_ID()+1);
1980  }
1981  else if (fff == FFF_SIFEL) {
1982  if (loads() != 1) errol; // more bc not supported now
1983 
1984  fprintf (stream, "%ld", owner()->give_ID()+1);
1985 
1986  loads[0]->print_components(stream);
1987  fprintf (stream, "\n");
1988  }
1989  else if (fff == FFF_ANSYS) {
1990  if (loads() != 1) errol; // more bc not supported now
1991 
1992  ; int ndofs = this->give_nDOFs();
1993  const int* mask = this->give_dofBCmask();
1994 
1995  double comp;
1996  for (int i=0; i<ndofs; i++) {
1997  comp = loads[0]->give_component(mask[i]-1);
1998  if (comp != 0.0)
1999  fprintf (stream, "F, %6ld, %s, %g\n", owner()->give_ID()+1, DOFtype_i2s_force_ANSYS((DOFtype)mask[i]), comp);
2000  }
2001 
2002  fprintf (stream, "\n");
2003  }
2004 
2005  else errol;
2006 }
2008 void PointAttribs :: print_row (FILE *stream, femFileFormat fff, long did) const
2009 {
2010  if (fff == FFF_OOFEM) {
2011  bool lcsb = false;
2012  if (dofbc) lcsb = this->print_prescribed_values(stream, fff);
2013  else if (genatt) lcsb = genatt->print_prescribed_values(stream, fff);
2014 
2015  // lcs
2016  if (lcsb) {
2017  const LCS_pure *lcsl;
2018  if (lcs) lcsl = lcs;
2019  else lcsl = ((Node*)owner())->give_mdl_lcs();
2020 
2021  fprintf (stream, " lcs 6");
2022  fprintf (stream, " %lf %lf %lf", lcsl->n1()->x, lcsl->n1()->y, lcsl->n1()->z);
2023  fprintf (stream, " %lf %lf %lf", lcsl->n2()->x, lcsl->n2()->y, lcsl->n2()->z);
2024  }
2025 
2026  if (dofbc) this->print_DofIDMask_OOFEM(stream);
2027  else if (genatt) genatt->print_DofIDMask_OOFEM(stream);
2028 
2029  if (loads()) this->print_bc(stream, fff);
2030  else if (genatt) genatt->print_bc(stream, fff);
2031  //fprintf (stream, "%s", oostring);
2032  }
2033  else if (fff == FFF_SIFEL) {
2034  fprintf (stream, " %d", this->give_nDOFs());
2035 
2036  const CrossSection *locs = this->give_cs();
2037  if (locs) {
2038  if (locs->give_type() != CST_SIFEL) _errorr2("no sifel cross section at node %ld", owner()->give_ID()); // docasne omezeni, zatim muzu pouzit jen CST_SIFEL, dalsi na to nejsou zarizeny
2039  fprintf (stream, " %d", CrossSectType_e2i_SIFEL(locs->give_loctype_or_type(), Pd->give_analgroup()));
2040  fprintf (stream, " %ld", locs->give_sifid()+1);
2041  }
2042  else fprintf (stream, " 0");
2043 
2044  // transformation
2045  if (Pd->give_analgroup() == PAG_mechanics) fprintf (stream, " 0");
2046  }
2047  else errol;
2048 }
2049 
2050 
2051 //* ********************************************************************************************
2052 //* *** *** *** *** CLASS RANATTRIBS *** *** *** ***
2053 //* ********************************************************************************************
2055 RANAttribs :: RANAttribs (const Point *ow, long p, const Problem *pd, const PointAttribs *gena) : PointAttribs (ow, p, pd, gena)
2056 {
2057  AUX_msprop = -1;
2058  AUX_mslid = -1;
2059  master = NULL;
2060  doftype = NULL;
2061 }
2064 {
2065  master = NULL;
2066  delete doftype;
2067 }
2068 
2070 bool RANAttribs :: initialize_from (const char *&str, femFileFormat ff, bool all)
2071 {
2072  char WORD[255];
2073  while (SP_scan_word (str, WORD))
2074  if (strcmp(WORD, "mstrprop") == 0)
2075  SP_scan_number (str, AUX_msprop);
2076  else if (strcmp(WORD, "master") == 0)
2077  SP_scan_number (str, AUX_mslid);
2078  else if (strcmp(WORD, "dofType") == 0) {
2079  if (doftype) errol;
2080  doftype = new PointDOFsRANHN((long)0, owner());
2082  }
2083  else if (strcmp(WORD, "masterMask") == 0) {
2085  else { doftype = new PointDOFsRANHN((long)0, owner()); doftype->scan_mask_ndofs_new (str); }
2086  }
2087  else {
2088  SP_unscan_word (str, WORD);
2089  if (! PointAttribs :: initialize_from (str, ff, false) )
2090  _errorr3 ("Unknown OOFEM RANode key word \"%s\", att id = %d", WORD, prop);
2091  }
2092 
2093  return true;
2094 }
2095 
2098 {
2100 
2101  if (AUX_msprop+1) {
2102  if (master) _errorr0;
2103 
2104  const GPA<Point> *nodes = Pd->give_Mesh(0)->give_Pjnts();
2105  long nn = (*nodes)();
2106 
2107  long i;
2108  bool propex;
2109 
2110  propex = false;
2111  for (i=0; i<nn; i++) {
2112  if ((*nodes)[i]->has_mproperty(AUX_msprop)) {
2113  master = Pd->give_Mesh(0)->give_Node(i);
2114  break;
2115  }
2116  if ((*nodes)[i]->has_mproperty(prop))
2117  propex = true;
2118  }
2119  if (master == NULL && propex) _errorr2 ("Rigid arm node master with property was not found, property : %d", AUX_msprop);
2120 
2121  AUX_msprop = -1;
2122  }
2123  if (AUX_mslid+1) {
2124  if (master) _errorr0;
2125 
2127 
2128  AUX_mslid = -1;
2129  }
2130 
2132 }
2133 
2136 {
2138 
2139  if (AUX_msprop+1 || AUX_mslid+1) _errorr0;
2140  if ( genatt && ( master || doftype)) _errorr0;
2141  if (!genatt && (!master || !doftype)) _errorr0;
2142 
2143  if (doftype) {
2145  //if (doftype->give_ndofs() != Pd->give_global_nDOFs()) _errorr ("Mishmash in nDOFs");
2146  if (dofbc)
2147  if (dofbc->give_ndofs() != doftype->give_ndofs()) _errorr ("Mishmash in nDOFs");
2148  }
2149 }
2150 
2152 {
2153  master = mstr;
2154  doftype = new PointDOFsRANHN((long)0, owner());
2155  doftype->set_ndofs(this->give_nDOFs());
2157 }
2158 
2161 {
2162  if (!master) return ((RANAttribs*)genatt)->add_master_to_domain (did);
2163 
2164  ((Node*)master)->add_me_to_domain (did);
2165 }
2166 
2168 void RANAttribs :: print_row (FILE *stream, femFileFormat fff, long did) const
2169 {
2170  if (fff == FFF_OOFEM) {
2171  if (owner()) PointAttribs :: print_row (stream, fff, did);
2172 
2173  if (!master) return genatt->print_row (stream, fff, did);
2174 
2175  const Node *nmaster = dynamic_cast<const Node *>(master);
2176  if (nmaster == NULL) errol;
2177 
2178  fprintf (stream, " master %ld", nmaster->give_lid_id (did)+1);
2179  long i;
2180  fprintf (stream, " dofType %d", give_nDOFs()); for (i=0; i<give_nDOFs(); i++) fprintf (stream," %d", doftype->give_att (i));
2181  fprintf (stream, " masterMask %d", give_nDOFs()); for (i=0; i<give_nDOFs(); i++) fprintf (stream," %d", doftype->give_mask(i));
2182  }
2183  else if (fff == FFF_SIFEL) {
2184  _errorr("RAN for SIFEL is not implemented");
2185  }
2186  else errol;
2187 }
2188 
2189 
2190 //* ********************************************************************************************
2191 //* *** *** *** *** CLASS HNATTRIBS *** *** *** ***
2192 //* ********************************************************************************************
2194 HNAttribs :: HNAttribs (const Point *ow, long p, const Problem *pd, const PointAttribs *gena) : PointAttribs (ow, p, pd, gena)
2195 {
2196  type = 0; cm = 0; AUX_msprops = NULL; AUX_mslids = NULL;
2197  masters = NULL; doftype = NULL;
2198  contrib = NULL;
2199  MC = NULL; dimMC = ordMC = 0; nc = NULL;
2200 }
2202 HNAttribs :: HNAttribs (const Point *ow, const PointAttribs *src) : PointAttribs (ow, src)
2203 {
2204  if (src->give_classid() == classPointAttribs) {
2205  type = 0; cm = 0; AUX_msprops = NULL; AUX_mslids = NULL;
2206  masters = NULL; doftype = NULL;
2207  contrib = NULL;
2208  MC = NULL; dimMC = ordMC = 0; nc = NULL;
2209  }
2210  else errol;
2211 }
2214 {
2215  delete [] AUX_msprops; delete [] AUX_mslids;
2216  delete [] masters; delete doftype;
2217  delete [] contrib;
2218  delete nc; MC = NULL;
2219 }
2220 
2222 bool HNAttribs :: initialize_from (const char *&str, femFileFormat fff, bool all)
2223 {
2224  if (fff == FFF_OOFEM || fff == FFF_MIDAS) {
2225  char WORD[255];
2226  while (SP_scan_word (str, WORD))
2227  if (strcmp(WORD, "type") == 0) {
2228  SP_scan_number (str, type);
2229  if (type == 0) type = 1;
2230  else {
2231  dimMC = type%10; type = type/10;
2232  ordMC = type%10; type = type/10;
2233  if (cm==0) cm = type;
2234  else if (cm != type) _errorr ("Invalid number of masters");
2235  type = 2;
2236  nc = new PoinT;
2237  nc->zero();
2238  }
2239  }
2240  else if (strcmp(WORD, "mstrprops") == 0) {
2241  if (cm) SP_scan_expected_number_exit (str, cm, "Invalid number of mstrprops");
2242  else SP_scan_number (str, cm);
2243  AUX_msprops = new long[cm];
2244  SP_scan_array (str, cm, AUX_msprops);
2245  }
2246  else if (strcmp(WORD, "masters") == 0) {
2247  if (cm) SP_scan_expected_number_exit (str, cm, "Invalid number of mstrprops");
2248  else SP_scan_number (str, cm);
2249  AUX_mslids = new long[cm];
2250  SP_scan_array (str, cm, AUX_mslids);
2251  }
2252  else if (strcmp(WORD, "weights") == 0) {
2253  if (cm) SP_scan_expected_number_exit (str, cm, "Invalid number of contribs");
2254  else SP_scan_number (str, cm);
2255  if (contrib != NULL) _errorr ("contribs != NULL");
2256  contrib = new double[cm];
2257  SP_scan_array (str, cm, contrib);
2258  }
2259  else if (strcmp(WORD, "dofType") == 0) {
2261  else { doftype = new PointDOFsRANHN((long)0, owner()); doftype->scan_att_ndofs_new (str); }
2262  }
2263  else if (strcmp(WORD, "masterMask") == 0) {
2265  else { doftype = new PointDOFsRANHN((long)0, owner()); doftype->scan_mask_ndofs_new (str); }
2266  }
2267  else if (strcmp(WORD, "ksi") == 0) { if (!nc) _errorr0; SP_scan_number (str, nc->x); }
2268  else if (strcmp(WORD, "eta") == 0) { if (!nc) _errorr0; SP_scan_number (str, nc->y); }
2269  else if (strcmp(WORD, "dzeta") == 0) { if (!nc) _errorr0; SP_scan_number (str, nc->z); }
2270  else {
2271  SP_unscan_word (str, WORD);
2272  if (! PointAttribs :: initialize_from (str, fff, false) )
2273  _errorr3 ("Unknown OOFEM HNode key word \"%s\", att id = %d", WORD, prop);
2274  }
2275  }
2276  else if (fff == FFF_SIFEL) {
2277  Lvctr aux;
2278 
2279  type = 2;
2280  //
2281  SP_scan_number (str, cm); cm *= -1;
2282  AUX_mslids = new long[cm];
2283  aux.resize_ignore_vals(cm);
2284  aux.scan(str);
2285  if (nc) errol;
2286  nc = new PoinT;
2287  nc->scan_xyz(str);
2288 
2289  SP_scan_number (str, dimMC);
2290  switch (dimMC) {
2291  case 1: // isolinear1d
2292  if (cm != 2) errol;
2293  ordMC = 1;
2294  dimMC = 1;
2295  break;
2296  case 5: // isolinear2d
2297  if (cm != 4) errol;
2298  ordMC = 1;
2299  dimMC = 2;
2300  break;
2301  case 13: // isolinear3d
2302  if (cm != 8) errol;
2303  ordMC = 1;
2304  dimMC = 3;
2305  break;
2306  default: errol;
2307  }
2308  SP_scan_expected_number_exit (str, 0, "0 expected");
2309  SP_scan_expected_number_exit (str, 0, "0 expected");
2310 
2312  int e, i;
2313  for (e=0; e<cm; e++) {
2314  if (ordMC != 0 && ordMC != 1) errol; // zatim nepocitam s jinym ord nez 1, na prvcich -4, pokud se to zmeni, tak v nasledujicim radku prepis -4 zpet na ordMC
2315  i = ECN_convert_e2i (e, 0, -4, CellGeometry_i2e_HN (100*cm + 10*ordMC + dimMC), fff);
2316  AUX_mslids[i] = aux[e];
2317  }
2318  }
2319  else errol;
2320 
2321  return true;
2322 }
2323 
2326 {
2328 
2329  if (AUX_msprops) {
2330  if (masters) _errorr0;
2331 
2332  const GPA<Point> *nodes = Pd->give_Mesh(0)->give_Pjnts();
2333  long nn = (*nodes)();
2334 
2335  long i, j;
2336  long auxCm = 0;
2337  const Node **auxMstrs = new const Node*[nn];
2338  double *auxCntrb = new double[nn];
2339 
2340  // find HN with prop
2341  for (i=0; i<nn; i++) if ((*nodes)[i]->has_mproperty(prop)) break;
2342  if (i==nn) _errorr2 ("Hanging node with property %d was not found", prop);
2343 
2344  // find masters
2345  for (i=0; i<cm; i++)
2346  for (j=0; j<nn; j++)
2347  if ((*nodes)[j]->has_mproperty(AUX_msprops[i])) {
2348  auxMstrs[auxCm ] = Pd->give_Mesh(0)->give_Node(j);
2349  auxCntrb[auxCm++] = contrib[i];
2350  }
2351 
2352  if (!auxCm) _errorr2 ("Hanging node with property %d has no master node", prop);
2353 
2354  ; cm = auxCm;
2355  delete [] AUX_msprops; masters = new const Node* [cm];
2356  delete [] contrib; contrib = new double [cm];
2357 
2358  for (i=0; i<cm; i++) {
2359  masters[i] = auxMstrs[i];
2360  contrib[i] = auxCntrb[i];
2361  }
2362 
2363  delete [] auxMstrs;
2364  delete [] auxCntrb;
2365 
2366  AUX_msprops = NULL;
2367  }
2368  if (AUX_mslids) {
2369  if (masters) _errorr0;
2370 
2371  masters = new const Node* [cm];
2372 
2373  for (long i=0; i<cm; i++)
2374  masters[i] = Pd->give_Mesh(0)->give_Node(AUX_mslids[i]-1);
2375 
2376  delete [] AUX_mslids;
2377  AUX_mslids = NULL;
2378  }
2379 
2380  if (!doftype && type == 2) {
2381  doftype = new PointDOFsRANHN((long)0, owner());
2383  }
2384 
2386 }
2387 
2390 {
2392 
2394 
2395  if ( genatt && (type || cm || masters || doftype || contrib || MC || nc)) _errorr0;
2396  if (!genatt) {
2397  if (type != 1 && type != 2) _errorr0;
2398  if (!masters || !doftype) _errorr0;
2399  if (type == 1 && !contrib) _errorr0;
2400  if (type == 2 && (!nc)) _errorr0;
2401  }
2402 
2403  if (doftype) {
2405  //if (doftype->give_ndofs() != Pd->give_global_nDOFs()) _errorr ("Mishmash in nDOFs");
2406  if (dofbc)
2407  if (dofbc->give_ndofs() != doftype->give_ndofs()) _errorr ("Mishmash in nDOFs");
2408  }
2409 
2410  // check sum of contrib of hanging nodes
2411  if (type == 1) {
2412  double sum = 0.0;
2413  for (long i=0; i<cm; i++) sum += contrib[i];
2414  if (isNonZero(sum-1.0, 1e-7))
2415  //_errorr3 ("checkingConsistency: suma of coefficients of master contributions(%f) != 1.0, property %ld", sum, prop);
2416  _warningg3 ("checkingConsistency: suma of coefficients of master contributions(%f) != 1.0, property %ld", sum, prop);
2417  }
2418 }
2419 
2421 void HNAttribs :: initialize_general (long countMN, const Node **mns, const double *cntrb, int n, int *val)
2422 {
2423  if (type) errol;
2424  type = 1;
2425 
2426  cm = countMN;
2427  masters = new const Node* [cm];
2428  contrib = new double [cm];
2429 
2430  for (int i=0; i<cm; i++) {
2431  masters[i] = mns[i];
2432  contrib[i] = cntrb[i];
2433  }
2434 
2435  doftype = new PointDOFsRANHN((long)0, owner());
2436  doftype->set_ndofsatt(n, val);
2437 }
2438 
2440 void HNAttribs :: initialize_atelemet (const Cell *mc, long dimmc, long ordmc, long countMN, const Node **mns, const PoinT *natcoords)
2441 {
2442  if (type) _errorr0;
2443  type = 2;
2444 
2445  if (Pd->give_fulldata() && this->give_nDOFs() != 3) _errorr0;
2446  doftype = new PointDOFsRANHN((long)0, owner());
2447  doftype->set_ndofs(3);
2449 
2450  MC = mc;
2451  dimMC = dimmc;
2452  if (ordmc != -4)
2453  errol;
2454  ordMC = 1; //ordmc;
2455  cm = countMN;
2456 
2457  masters = new const Node* [cm];
2458  nc = new PoinT;
2459 
2460  int i;
2461  for (i=0; i<cm; i++) masters[i] = mns[i];
2462  nc->copy(natcoords)->round2abszero(ZERO_NC);
2463 }
2464 
2467 {
2468  if (!masters) return ((HNAttribs*)genatt)->add_masters_to_domain (did);
2469 
2470  for (long i=0; i<cm; i++)
2471  ((Node*)masters[i])->add_me_to_domain (did);
2472 }
2475 {
2476  if (!masters) return ((HNAttribs*)genatt)->check_masters_at_domain (did);
2477 
2478  for (long i=0; i<cm; i++)
2479  if (masters[i]->give_lid(did) == -1)
2480  _errorr2 ("Hanging node and its master are not on same domain, global node number: %d", this->prop+1);
2481 }
2484 {
2485  if (type != 2) _errorr0;
2486 
2487  // 3d - domain podle MC
2488  if (dimMC == 3) {
2489  ((Node*)owner())->initialize_parallel (-((FElement*)MC)->give_domain(), NULL);
2490  return;
2491  }
2492 
2493  long i;
2494  // edge/surface is not shared
2495  for (i=0; i<cm; i++)
2496  if (!masters[i]->is_shared()) {
2497  ((Node*)owner())->initialize_parallel (-masters[i]->give_domain(), NULL);
2498  return;
2499  }
2500 
2501  // ... is shared
2502  const GPA<const Element> *superelem = ((Facedge*)MC)->give_superelems();
2503  long ned = superelem[0]();
2504  long *superdom = new long[ned];
2505 
2506  for (i=0; i<ned; i++)
2507  superdom[i] = ((FElement*)superelem[0][i])->give_domain();
2508 
2509  shaker (ned, superdom);
2510  ((Node*)owner())->initialize_parallel (ned, superdom);
2511  delete [] superdom;
2512 }
2513 
2515 void HNAttribs :: print_one_row (FILE *stream, long hid) const
2516 {
2517  if (type != 2) _errorr0;
2518 
2519  fprintf (stream," hn %3ld dimM %ld order %ld", hid+1, dimMC, ordMC);
2520 
2521  const PoinT *coo = owner()->give_coords();
2522  fprintf (stream," coords %12.5f%12.5f%12.5f MNs ", coo->x, coo->y, coo->z);
2523 
2524  for (long i=0; i<cm; i++)
2525  fprintf (stream, " %5ld", masters[i]->give_ID()+1);
2526 
2527  if (dimMC > 0) fprintf (stream," ksi %5.2f", nc->x);
2528  if (dimMC > 1) fprintf (stream," eta %5.2f", nc->y);
2529  if (dimMC > 2) fprintf (stream," dzeta %5.2f",nc->z);
2530 }
2531 
2533 void HNAttribs :: print_row (FILE *stream, femFileFormat fff, long did) const
2534 {
2535  long e,i;
2536  CellGeometry cg = CG_Void;
2537 
2538  if (type == 2) {
2539  cg = CellGeometry_i2e_HN (100*cm + 10*ordMC + dimMC);
2540  if (MC && MC->give_cellGeom() != cg) errol;
2541  }
2542 
2543  if (fff == FFF_OOFEM) {
2544  if (owner()) PointAttribs :: print_row (stream, fff, did);
2545 
2546  if (!masters) return genatt->print_row (stream, fff, did);
2547 
2549  bool general = (type==1) ? true : false;
2550 
2551  // type
2552  fprintf (stream, " type %ld", general ? 0 : 100*cm + 10*ordMC + dimMC);
2553  // dofType
2554  fprintf (stream, " dofType %d", give_nDOFs());
2555  for (i=0; i<give_nDOFs(); i++) fprintf (stream, " %d", doftype->give_att(i));
2556  // masters
2557  fprintf (stream, " masters %ld", cm);
2558  for (e=0; e<cm; e++) {
2559  if (ordMC != 0 && ordMC != 1) errol; // zatim nepocitam s jinym ord nez 1, na prvcich -4, pokud se to zmeni, tak v nasledujicim radku prepis -4 zpet na ordMC
2560  if (type == 2) i = ECN_convert_e2i (e, 0, -4, cg, fff); // ordMC
2561  else i = e;
2562  fprintf (stream," %ld", masters[i]->give_lid_id(did)+1);
2563  }
2564  //
2565  if (general) {
2566  // weights
2567  fprintf (stream, " weights %ld", cm);
2568  for (i=0; i<cm; i++) fprintf (stream, " %.8e", contrib[i]);
2569  }
2570  else {
2571  // ksi eta dzeta
2572  ; fprintf (stream," ksi %.9g", this->nc->x);
2573  if (this->dimMC > 1) fprintf (stream, " eta %.9g", this->nc->y);
2574  if (this->dimMC > 2) fprintf (stream, " dzeta %.9g",this->nc->z);
2575  }
2576  }
2577  else if (fff == FFF_SIFEL || fff == FFF_JKTK) {
2578  if (type!=2) _errorr("HN at finite element is supported only");
2579 
2580  // masters
2581  fprintf (stream, " -%ld", cm);
2582  for (e=0; e<cm; e++) {
2583  if (ordMC != 0 && ordMC != 1) errol; // zatim nepocitam s jinym ord nez 1, na prvcich -4, pokud se to zmeni, tak v nasledujicim radku prepis -4 zpet na ordMC
2584  i = ECN_convert_e2i (e, 0, -4, cg, fff);
2585  fprintf (stream," %ld", masters[i]->give_lid_id(did)+1);
2586  }
2587 
2588  // ksi eta dzeta
2589  fprintf (stream," %g %g %g", this->nc->x, this->nc->y, this->nc->z);
2590 
2591  // typ_entity of master
2592  fprintf (stream, " %d", CellGeometry_e2i_JKTK (cg));
2593 
2594  if (fff == FFF_SIFEL)
2595  fprintf (stream, " 0 0");
2596  }
2597  else errol;
2598 }
2599 
2600 } // namespace midaspace
void shaker(long &n, long *a)
zlikviduje vicenasobne cifry pro long in <0;..>
Definition: mathlib.cpp:19
const BoundaryCond * bc
Definition: attribute.h:461
virtual void checkConsistency(void) const
Checks data consistency.
Definition: attribute.cpp:2135
void setup_full_alloc_DOFvals(Dvctr *answer, const Dvctr *values) const
Definition: attribute.cpp:1875
DOFsPerNode DOFsPerNode_s2e(const char *val)
Definition: alias.h:708
AdaptivityParameters * adpa
Definition: attribute.h:102
FiniteElementType FET_s2e(const char *str)
string to FET
Definition: alias.h:1053
femFileFormat
Definition: alias.h:632
void SP_unscan_word(const char *&src, const char *w)
*** *** *** SCANNING *** *** *** unscan word == shift pointer back over word
Definition: librw.cpp:504
void set_load(int i, char flag='\0', int indx=-1)
LCS_pure * lcs
local coordinate systen at node
Definition: attribute.h:1008
int BC_give_att_SIFEL_NODEBC_reverted(int i) const
Definition: substructs.h:183
PAType PAType_i2e_SIFEL(int val)
Definition: alias.h:411
void set_cs(int i)
void set_NIP (int val) { NIP = val; }
Definition: attribute.h:790
void set_ndofsatt(int n, int *val)
Definition: substructs.h:68
bool give_PDBO(ProbDescBoolOpt pdbo) const
Definition: problem.h:187
void checkEqualityWith(const PointAttribs *slave) const
Definition: attribute.cpp:1894
const GPA< PointDOFsCondense > * give_conDOFs(void) const
Definition: attribute.h:830
Elem3D * round2abszero(double zr)
Definition: arrays.h:65
virtual void finitialize(void)
finalize preprocessing
Definition: attribute.cpp:1829
LinearSolverType LinearSolverType_i2e_SIFEL(int val)
Conversion from "SIFEL int" to "enum" identificator of "linear solver type".
Definition: alias.h:295
const Material * mat
Definition: attribute.h:741
virtual void checkConsistency(void) const
Checks data consistency.
Definition: attribute.cpp:2389
virtual void initialize(void)
= 0; = 0;
Definition: subject.h:37
virtual void print_row(FILE *stream, femFileFormat fff, long did) const
print row to solver input file
Definition: attribute.cpp:512
bool SP_print_word(const char *&src, FILE *stream)
... word
Definition: librw.cpp:635
DOFsPerNode give_dpn(void) const
Definition: attribute.h:372
ElemAttribs(const Element *ow, long p, ElAttLevel eal)
CONSTRUCTOR.
Definition: attribute.cpp:946
SStype SStype_s2e(const char *val)
Definition: alias.h:962
void initialize_from(const char *&str, femFileFormat ff)
Definition: taux.cpp:59
int MaterialType_e2i_SIFEL(MaterialType val, PAGroup pg)
Definition: alias.h:544
IntPointSet IPS_inputfile_value_i2e_OOFEM(int val, FiniteElementTypeSet *fets)
val je cislo ze vstupaku oofemu, keyword NIP
Definition: alias.h:1260
int give_ndofs(void) const
Definition: substructs.h:72
bool SP_print_space(const char *&src, FILE *stream)
*** *** *** PRINTING *** *** *** printing == print ...
Definition: librw.cpp:625
PAGroup give_analgroup(void) const
Definition: problem.cpp:179
CrossSectType type
Definition: attribute.h:174
const Point * owner() const
POINTERS TO SUPERIORS.
Definition: attribute.h:995
int DOFsPerNode2nDOFs(DOFsPerNode od)
Definition: alias.h:755
DOFsPerNode
Definition: alias.h:700
long give_point_indx(const Point *p) const
Definition: cell.h:101
const GPA< Point > * give_Pjnts(void) const
Definition: geometry.h:72
void EALdirectCheck(void) const
check this is nongeneral == this has to have owner
Definition: attribute.h:779
void print_linerec(FILE *stream, bool pure) const
Definition: attribute.cpp:26
FEApproximation give_approx(void) const
Definition: attribute.h:839
double give_elemSize(void) const
GLOBAL.
Definition: attribute.cpp:909
void set_cs_of_type(CrossSectType type, int id)
Definition: attribute.h:1043
virtual void checkConsistency(void) const
Checks data consistency.
Definition: subject.h:41
void set_nDOFs_BC(int nd, int *bc)
Definition: attribute.cpp:1675
virtual bool initialize_from(const char *&str, femFileFormat ff, bool all=true)
initialize form input string
Definition: attribute.cpp:2070
void set_FETS(const FiniteElementTypeSet *val)
Definition: attribute.cpp:1273
int PAType_e2i_SIFEL(PAType val)
Definition: alias.h:421
long SP_scan_word(const char *&src, char *dest)
... word; return value is length of the word
Definition: librw.cpp:528
const VectoR * n2(void) const
Definition: taux.h:192
const LCS_beam * give_lcs_global(void) const
Definition: attribute.h:850
virtual void initialize(void)
initialize yourself
Definition: attribute.cpp:1134
#define SP_scan_expected_word_exit(_1, _2, _3, _4)
Definition: librw.h:201
void set_MatStiffMtrx(int n, double *src)
Definition: attribute.cpp:1284
int give_IN_meshGen_elemCount(void) const
Definition: problem.h:196
bool only_1d_elements(void) const
only 1d elements
Definition: geometry.cpp:269
sifel i/o native ff
Definition: alias.h:644
virtual bool initialize_from(const char *&str, femFileFormat ff, bool all=true)
initialize form input string
Definition: attribute.cpp:219
DOFsPerNode give_dpn(void) const
Definition: attribute.h:837
double elemSize
vytvorit vedle edge a face jeste volume, pak presunout loads a size VALUES
Definition: attribute.h:626
GPA< const Material > mats
Definition: attribute.h:194
const PointDOFsBCPM * give_dofbc(void) const
Definition: attribute.h:968
Point.
bool is_supported(void) const
Definition: substructs.h:153
void print_components(FILE *stream) const
Definition: attribute.cpp:735
#define SP_scan_expected_number_exit(_1, _2, _3)
Definition: librw.h:229
void print_Bbc_SIFEL(FILE *stream) const
Definition: attribute.cpp:1374
void set_nDOFs_BC(int nd, int *bc)
Definition: attribute.cpp:1850
virtual void finitialize(void)
finalize preprocessing
Definition: attribute.cpp:1142
long give_mproperty_cnt(void) const
Definition: geomcomp.h:133
void read_bc(FILE *stream, femFileFormat fff)
Definition: attribute.cpp:1904
StiffMatrixType stiffmattype
Definition: attribute.h:114
#define _warningg3(_1, _2, _3)
Definition: gelib.h:158
void initialize_from(const char *&str, femFileFormat fff)
Definition: taux.cpp:196
const Material * give_mat(void) const
Definition: attribute.h:846
void RAN_set_full_slave_node(void)
Definition: substructs.h:243
void check_masters_at_domain(long did) const
Definition: attribute.cpp:2474
void initialize_atelemet(const Cell *mc, long dimmc, long ordmc, long countMN, const Node **mns, const PoinT *natcoords)
initialize hanging node at element type
Definition: attribute.cpp:2440
const PointAttribs * genatt
Definition: attribute.h:996
FEApproximation approx
Definition: attribute.h:729
void print_row_OOFEM(FILE *stream, int did, Beam *b) const
Definition: taux.cpp:166
virtual long give_size(void) const
Definition: arrays.h:387
virtual bool initialize_from(const char *&str, femFileFormat ff, bool all=true)
initialize form input string
Definition: attribute.cpp:576
#define STRCMP
Definition: alias.h:44
virtual void print_row(FILE *stream, femFileFormat fff, long did) const
print row to solver input file
Definition: attribute.cpp:705
ElAttLevel EAL
LEVEL.
Definition: attribute.h:716
void scan_att_ndofs_new(const char *&str)
Definition: substructs.h:91
virtual classID give_classid() const =0
Returns classID - class identification.
virtual ~PointAttribs()
DESTRUCTOR.
Definition: attribute.cpp:1754
#define PIconst
Pi constant.
Definition: alias.h:58
long ID
(global) identification number == position in list of members; zero-based numbering.
Definition: subject.h:22
double * contrib
type == 1 ** HN general
Definition: attribute.h:1161
PointDOFsRANHN * doftype
RAN DOF types - contain ndofs, dof type array, master mask array.
Definition: attribute.h:1108
virtual void print_row(FILE *stream, femFileFormat fff, long did) const
print row to solver input file
Definition: attribute.cpp:2533
long give_ID() const
Definition: subject.h:45
void set_new(const FacedgeAttribs *src)
Definition: attribute.cpp:903
LinearSolverType linsoltype
Definition: attribute.h:115
static const int ord
Definition: attribute.h:730
long give_sifid(void) const
*** SET *** *** GET ***
Definition: attribute.h:42
#define errol
Definition: gelib.h:142
CrossSectType loctype
Definition: attribute.h:175
Mesh * give_Mesh(long i) const
Definition: problem.h:357
void initialize_from(const char *&str, femFileFormat ff)
Definition: taux.cpp:132
void setup_rotmat_l2g(MatriX *rotmat)
Definition: taux.cpp:78
oofem i/o native ff
Definition: alias.h:643
const PointDOFsBCPM * give_DOFbc(void) const
Definition: attribute.h:1057
Derived class for management of RAN (rigid arm node) or HN (hanging node) connection of DOFs (Degrees...
Definition: substructs.h:232
virtual void initialize(void)
initialize yourself
Definition: attribute.cpp:860
void scan_mask_ndofs_new(const char *&str)
Definition: substructs.h:92
void scan_ndofs_new(const char *&str)
*** SCAN ***
Definition: substructs.h:90
bool is_identical_with(const PointDOFsAttributes *src) const
Definition: substructs.h:80
const CrossSection * give_cs(void) const
Definition: attribute.h:1058
#define _errorr2(_1, _2)
Definition: gelib.h:145
long give_sifMats(long i) const
Definition: problem.h:324
int transpmatter
[SIFEL] only - dej jim predponu SIF_
Definition: attribute.h:105
StiffMatrixType StiffMatrixType_i2e_SIFEL(int val)
Conversion from "SIFEL int" to "enum" identificator of "stiffness matrix type".
Definition: alias.h:271
CellGeometry give_cellGeom(void) const
Definition: cell.h:31
LCS_beam * lcs
OWNED OBJECTS.
Definition: attribute.h:751
bool scan(const char *&src)
Definition: arrays.h:485
const VectoR * n1(void) const
Definition: taux.h:191
void set_standard_att_according_to_ndofs(void)
Definition: substructs.h:201
MaterialType MaterialType_i2e_SIFEL(int val, PAGroup pg)
Definition: alias.h:527
long give_sifBCs(long i) const
Definition: problem.h:326
CellGeometry
Definition: alias.h:840
Elem3D * zero(void)
Definition: arrays.h:64
MaterialType loctype
Definition: attribute.h:247
void print_Fbc_SIFEL(FILE *stream) const
Definition: attribute.cpp:1412
void switch_dpn_Line(void)
Definition: attribute.cpp:1348
PointAttribs(const Point *ow, long p, const Problem *pd=NULL, const PointAttribs *gena=NULL)
CONSTRUCTOR.
Definition: attribute.cpp:1702
virtual void initialize(void)
initialize yourself
Definition: attribute.cpp:2097
int ECN_convert_e2i(int id, int compdim, int ord, CellGeometry cg, femFileFormat fff)
External to Internal conversion.
Definition: alias.h:1539
IntPointSet
Definition: alias.h:1248
int give_ord(void) const
Definition: attribute.h:821
Attributes.
virtual void checkConsistency(void) const
Checks data consistency.
Definition: attribute.cpp:931
void print_components_oo(FILE *stream) const
Definition: attribute.cpp:729
void initialize(const Geometry *geom)
Definition: taux.cpp:91
const Point * give_point(long i) const
Definition: cell.h:93
RANAttribs(const Point *ow, long p, const Problem *pd=NULL, const PointAttribs *gena=NULL)
CONSTRUCTOR.
Definition: attribute.cpp:2055
void zero(void)
Definition: arrays.h:630
int CrossSectType_e2i_SIFEL(CrossSectType val, PAGroup pg)
Definition: alias.h:480
CellGeometry CellGeometry_i2e_HN(int val)
Definition: alias.h:847
Local coordinate system at beam element.
Definition: taux.h:235
const Problem * give_Pd(void) const
Definition: subject.h:48
virtual bool initialize_from(const char *&str, femFileFormat ff, bool all=true)
initialize form input string
Definition: attribute.cpp:1030
Dvctr * resize_ignore_vals(long newsize)
Definition: arrays.h:595
bool rer(void) const
Definition: substructs.h:144
virtual void print_row(FILE *stream, femFileFormat fff, long did) const
print row to solver input file
Definition: attribute.cpp:2168
void beCopyOf(const PoinT &src)
Definition: arrays.h:632
virtual void initialize(void)
initialize yourself
Definition: attribute.cpp:775
virtual void print_row(FILE *stream, femFileFormat fff, long did) const
print row to solver input file
Definition: attribute.cpp:2008
GelemAttribs * give_gelemAttribs(void)
Definition: cell.h:467
const int * give_dofBCmask(void) const
Definition: attribute.h:1062
void scan_linerec(const char *str)
Definition: attribute.cpp:17
long SP_scan_line(const char *&src, char *dest)
... line; return value is length of the line
Definition: librw.cpp:544
PointAttribs * give_pointAttribs(void)
Definition: point.h:93
virtual void initialize(void)
initialize yourself
Definition: attribute.cpp:817
void initialize_BC_NL_SIFEL(FILE *stream)
Definition: attribute.cpp:644
virtual void checkConsistency(void) const
Checks data consistency.
Definition: attribute.cpp:1834
bool is_the_first_BC(void)
Definition: attribute.cpp:683
int give_att(int i) const
Definition: substructs.h:73
const GPA< const Face > * give_faces(void) const
Definition: cell.h:99
void print_bc(FILE *stream, femFileFormat fff) const
Definition: attribute.cpp:1972
void add_load(const BoundaryCond *val)
Definition: attribute.h:589
long giveLineLength(const char *src)
return length of line == sting compount of "line chars"
Definition: librw.cpp:43
virtual void initialize(void)
initialize yourself
Definition: attribute.cpp:826
bool has_fullhinge_ends(void) const
Definition: attribute.cpp:1337
const Edge * owner() const
POINTERS TO SUPERIORS.
Definition: attribute.h:678
virtual void print_row(FILE *stream, femFileFormat fff, long did) const
print row to solver input file
Definition: attribute.cpp:393
virtual void checkConsistency(void) const
finalize preprocessing
Definition: attribute.cpp:653
void print_info_message_colour(SODenum flag, ETCLR colour, const char *format,...) const
Definition: taux.cpp:253
const Problem * Pd
Pointer to owner = parent problem.
Definition: subject.h:24
const Vertex * give_mdl_masterex(void) const
Definition: point.h:285
virtual void checkConsistency(void) const
Checks data consistency.
Definition: substructs.h:58
void set_nlgeo(bool val)
Definition: attribute.h:796
void reset_dofbc_support_all_rot_dofs(void)
Definition: attribute.cpp:1867
FEApproximation FEApproximation_s2e(const char *val)
Definition: alias.h:944
Geometry description.
Definition: geometry.h:29
BCType BCType_s2e_OOFEM(const char *val)
Definition: alias.h:577
void BC_support_all_rot_dofs(void)
Definition: substructs.h:185
const ElemAttribs * Gatt
Definition: attribute.h:721
const char * DOFtype_i2s_ANSYS(DOFtype dt)
Definition: alias.h:807
bool isNonZero(double x, double tolerance)
Definition: mathlib.cpp:401
Geometry * give_primary_geometry(void) const
Definition: problem.cpp:197
int give_mask(int i) const
Definition: substructs.h:74
void print_supported_BC_to_line(FILE *stream, femFileFormat fff) const
Definition: attribute.cpp:1935
bool SP_skip_space(const char *&src)
... space == ' ' and '' characters
Definition: librw.cpp:465
virtual void checkConsistency(void) const
Checks data consistency.
Definition: attribute.cpp:916
void set_mat(int i)
Definition: attribute.h:792
virtual void initialize(void)
initialize yourself
Definition: attribute.cpp:843
ADPArameters give_eetype(void) const
Definition: taux.h:326
CrossSectType give_loctype_or_type(void) const
Definition: attribute.h:217
void integrate_duplicated_one(const ElemAttribs *slv)
Definition: attribute.cpp:1237
bool scan_xyz(FILE *stream)
Definition: arrays.h:71
const CrossSection * cs
POINTERS TO ATTRIBUTES listed in problem class cs, mat, ...
Definition: attribute.h:740
MaterialType MaterialType_s2e_OOFEM(const char *val)
Definition: alias.h:511
HNAttribs(const Point *ow, long a, const Problem *pd=NULL, const PointAttribs *gena=NULL)
CONSTRUCTOR.
Definition: attribute.cpp:2194
int LinearSolverType_e2i_SIFEL(LinearSolverType val)
Conversion from "enum" to "SIFEL int" identificator of "linear solver type".
Definition: alias.h:305
const Geometry * Geom
Pointer to owner == parent geometry.
Definition: subject.h:59
double give_enlarg(void) const
Definition: taux.h:330
BoundaryCond * give_BC(long i) const
Definition: problem.h:322
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
const GPA< const Edge > * give_edges(void) const
Definition: cell.h:98
GPA - Generic Pointer Array, template class manages 1d array of pointers to objects of type T...
Definition: gpa.h:23
GPA< PointDOFsCondense > * conDOFs
Definition: attribute.h:753
#define ZERO_NC
Definition: alias.h:52
void rotate(Dvctr *v) const
Definition: arrays.cpp:30
void complete_setup_yourself(const Node *mstr)
Definition: attribute.cpp:2151
#define _errorr(_1)
Definition: gelib.h:151
const Node * master
Definition: attribute.h:1106
Derived class for management of boundary conditions and physical meanings of DOFs (Degrees Of Freedom...
Definition: substructs.h:131
long give_sifCSs(long i) const
Definition: problem.h:325
SStype
type of stress/strain state of element; especially results depends on this variable => described at M...
Definition: alias.h:954
virtual ~ElemAttribs()
DESTRUCTOR.
Definition: attribute.cpp:1016
void add_areaYyYz(double w, double h)
Definition: attribute.cpp:369
MaterialType give_loctype(void) const
Definition: attribute.h:278
virtual void initialize(void)
initialize yourself
Definition: attribute.cpp:348
void print_one_row(FILE *stream, long hid) const
Definition: attribute.cpp:2515
#define _errorr3(_1, _2, _3)
Definition: gelib.h:146
PointDOFsRANHN * doftype
RAN DOF types - contain ndofs, dof type array, master mask array.
Definition: attribute.h:1158
DOFtype
DOF type == physical meaning of dof; see help.txt.
Definition: alias.h:698
MaterialType type
Definition: attribute.h:246
const Gelement * give_mdl_masterel(void) const
Definition: cell.h:645
const StdoutDriver * sodriver(void) const
Definition: problem.h:90
CrossSectType CrossSectType_i2e_SIFEL(int val, PAGroup pg)
Definition: alias.h:461
bool give_fulldata(void) const
Definition: problem.h:206
void set_Pd(const Problem *owner)
Definition: subject.cpp:12
Mathematic functions.
IntPointSet IntPointSet_s2e(const char *val)
Definition: alias.h:1305
bool mask_is_null(void) const
Definition: substructs.h:79
SStype give_sst(void) const
Definition: attribute.h:838
BCType give_loctype(void) const
Definition: attribute.h:369
const char * DOFtype_i2s_force_ANSYS(DOFtype dt)
Definition: alias.h:820
virtual void initialize(void)
initialize yourself
Definition: attribute.cpp:1824
virtual void checkConsistency(void) const
Checks data consistency.
Definition: attribute.cpp:1147
virtual void initialize(void)
initialize yourself
Definition: attribute.cpp:1495
virtual void initialize(void)
initialize yourself
Definition: attribute.cpp:2325
bool give_virtual(void) const
Definition: attribute.h:969
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
const CrossSection * cs
POINTERS TO ATTRIBUTES listed in problem class.
Definition: attribute.h:1005
DOFsPerNode give_dpn_default(void) const
DEFAULT.
Definition: attribute.cpp:1308
void print_DofIDMask_OOFEM(FILE *stream) const
Definition: attribute.cpp:1964
#define CASE
Definition: alias.h:43
const Face * owner() const
POINTERS TO SUPERIORS.
Definition: attribute.h:698
const int * give_DOFbc_mask(void) const
Definition: problem.h:258
const Cell * MC
type == 2 ** HN at finite element
Definition: attribute.h:1163
bool SP_scan_expected_word(const char *&src, const char *expctd, bool cs)
... word and compare with expected one
Definition: librw.cpp:580
Derived class for management of condensed DOFs (Degrees Of Freedom) at a node.
Definition: substructs.h:287
void initialize_general(long countMN, const Node **mns, const double *cntrb, int n, int *val)
initialize hanging node general
Definition: attribute.cpp:2421
double give_IN_meshGen_elemSize(void) const
Definition: problem.h:195
FiniteElementType expltype
Definition: attribute.h:731
PointDOFsBCPM * dofbc
OWNED OBJECTS.
Definition: attribute.h:936
const Element * give_Elem(long i) const
Definition: geometry.h:71
BCType give_type(void) const
Definition: attribute.h:368
bool SP_scan_array(const char *&src, int n, ArgType *a)
... array of numbers
Definition: librw.h:233
bool SP_scan_number(const char *&src, int &dest)
... number of type int/long/double
Definition: librw.cpp:595
CrossSectType give_type(void) const
Definition: attribute.h:215
bool scan_components(FILE *stream, int ncmp)
Definition: attribute.h:386
tato struktura by mela obsahovat vsechny potrebne informace pro urceni konkretni implementace konecne...
Definition: alias.h:1019
FiniteElementTypeSet * give_FETS(FiniteElementTypeSet *set) const
GLOBAL, EAL_direct only.
Definition: attribute.cpp:1295
void add_master_to_domain(long did)
Definition: attribute.cpp:2160
Local coordinate system defined by 2 vectors.
Definition: taux.h:179
PAType PAType_s2e_OOFEM(const char *str)
Definition: alias.h:399
bool print_prescribed_values(FILE *stream, femFileFormat fff) const
oofem a ansys berou podepreni jako predepsane posunuti velikosti 0.0 ale sifel zadava podepreni jako ...
Definition: attribute.cpp:1921
PointDOFsBCPM * dofbc
OWNED OBJECTS.
Definition: attribute.h:1002
double give_reduct(void) const
Definition: taux.h:331
long give_nno(void) const
Definition: cell.h:89
long give_size(void) const
Definition: gpa.h:241
void print_Ebc_SIFEL(FILE *stream) const
Definition: attribute.cpp:1385
const ElemAttribs * Patt
Definition: attribute.h:720
virtual bool initialize_from(const char *&str, femFileFormat ff, bool all=true)
initialize form input string
Definition: attribute.cpp:757
bool SP_scan_array_alloc(const char *&src, long &n, ArgType *&a)
Definition: librw.h:237
void print_row_OOFEM(FILE *stream) const
print analysis row of OOFEM input file
Definition: attribute.cpp:156
GPA< const BoundaryCond > loads
POINTERS TO ATTRIBUTES listed in problem class.
Definition: attribute.h:567
virtual ~RANAttribs()
DESTRUCTOR.
Definition: attribute.cpp:2063
void scan_mask_ndofs_expected(const char *&str)
Definition: substructs.h:96
virtual bool initialize_from(const char *&str, femFileFormat ff, bool all=true)
initialize form input string
Definition: attribute.cpp:444
int IPS_inputfile_value_e2i_OOFEM(IntPointSet val)
val je cislo ze vstupaku oofemu
Definition: alias.h:1291
void set_Geom(const Geometry *owner)
Definition: subject.cpp:23
const Node * give_Node(long i) const
Definition: geometry.h:353
int give_global_nDOFs(void) const
Definition: problem.h:257
IntPointSet IPset
VALUES.
Definition: attribute.h:734
virtual classID give_classid() const
Returns classID - class identification.
Definition: attribute.h:1019
int CellGeometry_e2i_JKTK(CellGeometry cg)
Definition: alias.h:880
virtual void initialize(void)
initialize yourself
Definition: attribute.cpp:746
DOFsPerNode dpn
FINITE ELEMENT TYPE SET // viz alias.h.
Definition: attribute.h:727
FElemAttribs(const Element *ow, long p, ElAttLevel eal, const Problem *pd=NULL)
CONSTRUCTOR.
Definition: attribute.cpp:1445
FiniteElementType give_expltype(void) const
Definition: attribute.h:840
ElemAttribs * give_ElAt_with_prop(long prop) const
Definition: problem.cpp:337
void initialize_the_first_BC(void)
Definition: attribute.cpp:674
virtual ~HNAttribs()
DESTRUCTOR.
Definition: attribute.cpp:2213
virtual void checkConsistency(void) const
Checks data consistency.
Definition: attribute.cpp:1643
#define _errorr0
Definition: gelib.h:143
void scan_ndofs_expected(const char *&str)
Definition: substructs.h:94
virtual DOFsPerNode give_DOFsPerNode_default(void) const =0
Returns edge/face/volume of same dimension as receiver (Beam returns edge, etc.)
SStype give_sst_default(void) const
Definition: attribute.cpp:1309
const Node ** masters
Definition: attribute.h:1155
ElemAttribs * give_ElAt_of_domain(void) const
Definition: problem.h:333
const CrossSection * give_cs(void) const
Definition: attribute.h:845
virtual SStype give_SSType_default(void) const =0
give default type of stress state
void set_mat_of_type(MaterialType type, int id)
Definition: attribute.h:798
double give_elemCount(void) const
Definition: attribute.cpp:910
double give_required_error(void) const
Definition: taux.h:329
const FElement * f_owner() const
POINTERS TO SUPERIORS.
Definition: attribute.h:906
long give_lid_id(long dom) const
vraci lid of node, pro non-Parallel vraci id
Definition: point.h:275
FEApproximation approx
Definition: alias.h:1024
void scan_att_ndofs_expected(const char *&str)
Definition: substructs.h:95
classID
Type introduced to distinguish between classes.
Definition: alias.h:142
void set_cs_of_type(CrossSectType type, int id)
Definition: attribute.h:791
PoinT * copy(const PoinT *p)
Definition: arrays.h:99
virtual bool initialize_from(const char *&str, femFileFormat ff, bool all=true)
initialize form input string
Definition: attribute.cpp:44
void find_hndomain(void)
Definition: attribute.cpp:2483
bool SP_cutcomment(char *src)
cut of comment == end of line starting by '#'
Definition: librw.cpp:438
virtual bool initialize_from(const char *&str, femFileFormat ff, bool all=true)
initialize form input string
Definition: attribute.cpp:792
jktk i/o
Definition: alias.h:639
bool SP_scan_Xvctr(const char *&src, ArgType *dest)
bool SP_scan_Dvctr (const char *&src, Dvctr *dest);
Definition: librw.h:252
virtual bool initialize_from(const char *&str, femFileFormat ff, bool all=true)
initialize form input string
Definition: attribute.cpp:1761
const Node * give_node(long i) const
Definition: cell.h:652
virtual classID give_classid() const
Returns classID - class identification.
Definition: subject.h:35
virtual bool initialize_from(const char *&str, femFileFormat ff, bool all=true)
initialize form input string
Definition: attribute.cpp:2222
Material * give_Mat(long i) const
Definition: problem.h:321
assignment of attributes to element
Definition: attribute.h:707
const ElemAttribs * Datt
Definition: attribute.h:723
Problem description.
Definition: problem.h:74
const PoinT * give_coords(void) const
Definition: point.h:89
IntPointSet give_IPset(void) const
Definition: attribute.h:842
Class Problem.
void HN_initialize_slave_node(void)
hanging node
Definition: substructs.h:252
PAGroup PAGroup_t2g(PAType val)
Definition: alias.h:383
virtual ~FElemAttribs()
DESTRUCTOR.
Definition: attribute.cpp:1483
int StiffMatrixType_e2i_SIFEL(StiffMatrixType val)
Conversion from "enum" to "SIFEL int" identificator of "stiffness matrix type".
Definition: alias.h:280
void add_masters_to_domain(long did)
Definition: attribute.cpp:2466
const Element * owner() const
POINTERS TO SUPERIORS.
Definition: attribute.h:719
int give_nDOFs(void) const
Definition: attribute.h:1056
void set_dpn(DOFsPerNode val)
Definition: attribute.h:784
const GeometryComponent * GC
Pointer to owner == parent geometry component.
Definition: subject.h:85
ElemAttribs * give_ElAt_with_geom(CellGeometry eg) const
Definition: problem.h:334
int ECN_convert_i2e(int id, int compdim, int ord, CellGeometry cg, femFileFormat fff)
INTERNAL to EXTERNAL conversion.
Definition: alias.h:1504
void set_fullhinge_at(int point)
Definition: attribute.cpp:1321
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
virtual void print_row(FILE *stream, femFileFormat fff, long did) const
print row to solver input file
Definition: attribute.cpp:1543
virtual void initialize(void)
initialize yourself
Definition: attribute.cpp:877
FiniteElementType expltype
Definition: alias.h:1026