MIDAS  0.75
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
point.cpp
Go to the documentation of this file.
1 #include "point.h"
2 
3 #include "attribute.h"
4 
5 #include "gelib.h"
6 #include "arrays.h"
7 #include "librw.h"
8 
9 #include <math.h>
10 
11 
12 namespace midaspace {
13 
17 void Point :: attributes_allocation (char attflag, const Attributes *masterat)
18 {
19  if (attributes) errol;
20  if (attflag == '-') errol; //attributes = NULL;
21 
22  if (masterat) {
23  if (attflag == 'h') attributes = new HNAttribs(this, (PointAttribs*)masterat);
24  else if (attflag == 'r') attributes = new RANAttribs(this, (PointAttribs*)masterat);
25  else if (attflag == 'n') attributes = new PointAttribs(this, masterat);
26  else _errorr0;
27  }
28  else {
29  PointAttribs *na = NULL;
30  long prop = this->give_property();
31  if (prop) na = Pd->give_NdAt_with_prop(prop);
32 
33  if (na && na->give_classid() == classHNAttribs) { if (attflag != 'n') errol; else attflag = 'h'; }
34  if (na && na->give_classid() == classRANAttribs) { if (attflag != 'n') errol; else attflag = 'r'; }
35 
36  if (attflag == 'h') attributes = new HNAttribs(this, (long)0, NULL, na);
37  else if (attflag == 'r') attributes = new RANAttribs(this, (long)0, NULL, na);
38  else if (attflag == 'n') attributes = new PointAttribs(this, (long)0, NULL, na);
39  else _errorr0;
40  }
41 }
44 {
45  if (this->pointAttribs()->give_DOFbc() == NULL || this->pointAttribs()->give_DOFbc()->give_mask() == NULL)
46  return Pd->give_DOFspnod();
47 
48  return DPN_Void;
49 }
50 
52 Point :: Point (const Geometry *owner, long gid, const PoinT *coo, char attflag) : GeometryComponent (owner, gid, gid, 0)
53 {
54  if (coo==NULL) coords.zero();
55  else coords.copy(coo);
56 
57  superedges.initialize(0,2);
58  superfaces.initialize(0,2);
59  superelems.initialize(0,2);
60 
61  duplmaster = NULL;
62 
63  subdom = -1;
64 
65  if (attflag != '-') this->attributes_allocation(attflag, NULL);
66 }
68 Point :: Point (const Point *src, char attflag) : GeometryComponent (src)
69 {
70  coords.copy(&src->coords);
71  subdom = src->subdom;
72 
73  superedges.be_copy_of(&src->superedges);
74  superfaces.be_copy_of(&src->superfaces);
75  superelems.be_copy_of(&src->superelems);
76 
77  duplmaster = NULL; if (src->duplmaster) errol;
78 
79  if (attflag != '-') {
80  const Attributes *a = (const Attributes*)src->give_pointAttribs(); if (!a) errol;
81  this->attributes_allocation(attflag, a);
82  }
83 }
86 {
87 }
88 
91 {
93 }
96 {
98 
100 
101  long i;
102  long hinge = pointAttribs()->give_hinge();
103  pointAttribs()->set_hinge(0);
104 
106  switch (hinge) {
107  case 1: // full hinge
108  //for (i=0; i<superelems(); i++)
109  // ((Element*)superelems[i])->set_fullhinge_at(this);
110  errol;
111  break;
112  case 2: { // cross hinge
113  if (superelems() != 4) errol;
114  Beam *b1 = (Beam*)dynamic_cast<const Beam*>(superelems[0]); if (!b1) errol; // if (b11->give_nno() != 2) errol;
115  Beam *b2 = (Beam*)dynamic_cast<const Beam*>(superelems[1]); if (!b2) errol; // if (b12->give_nno() != 2) errol;
116  Beam *b3 = (Beam*)dynamic_cast<const Beam*>(superelems[2]); if (!b3) errol; // if (b21->give_nno() != 2) errol;
117  Beam *b4 = (Beam*)dynamic_cast<const Beam*>(superelems[3]); if (!b4) errol; // if (b22->give_nno() != 2) errol;
118 
121  if (false) {
124  VectoR v1, v2, v3, v4;
125  b1->give_vector(&v1);
126  b2->give_vector(&v2);
127  b3->give_vector(&v3);
128  b4->give_vector(&v4);
129 
130  if (v1.is_parallel_with(&v2, ZERO)) {
131  if (!v3.is_parallel_with(&v4, ZERO)) _errorr("non straight beam in cross-hinge");
132  if ( v1.is_parallel_with(&v3, ZERO)) _errorr("two straight beam in cross-hinge are parallel");
133  }
134  else {
135  if (v1.is_parallel_with(&v3, ZERO)) {
136  if (!v2.is_parallel_with(&v4, ZERO)) _errorr("non straight beam in cross-hinge");
137  Beam *aux = b2;
138  b2 = b3;
139  b3 = aux;
140  }
141  else {
142  if (!v1.is_parallel_with(&v4, ZERO)) _errorr("non straight beam in cross-hinge");
143  if (!v2.is_parallel_with(&v3, ZERO)) _errorr("non straight beam in cross-hinge");
144  Beam *aux = b2;
145  b2 = b4;
146  b4 = aux;
147  }
148  }
149  }
150  if (true) {
152  const CrossSection *cs1 = b1->give_elemAttribs()->give_cs();
153  if (cs1 == b2->give_elemAttribs()->give_cs()) {
154  if (cs1 == b3->give_elemAttribs()->give_cs()) _errorr("cross-hinge: mismatch in cross-sections");
155  }
156  else {
157  if (cs1 == b3->give_elemAttribs()->give_cs()) {
158  Beam *aux = b2;
159  b2 = b3;
160  b3 = aux;
161  }
162  else {
163  if (cs1 != b4->give_elemAttribs()->give_cs()) _errorr("cross-hinge: mismatch in cross-sections");
164  Beam *aux = b2;
165  b2 = b4;
166  b4 = aux;
167  }
168  }
169 
170  if (b3->give_elemAttribs()->give_cs() != b4->give_elemAttribs()->give_cs()) _errorr("cross-hinge: mismatch in cross-sections");
171  }
172 
173  Node *node1 = dynamic_cast<Node*>(this); if (!node1) errol;
174  Node *node2 = new HangingNode(node1);
175 
176  double aux = 1.0;
177  if (this->give_DOFspnod() != DPN_DxyzRxyz) errol;
178  int n = 6;
179  int val[6];
180  val[0] = val[1] = val[2] = 2;
181  val[3] = val[4] = val[5] = 0;
182 
183  ((HNAttribs*)node2->pointAttribs())->initialize_general(1, (const Node**)&node1, &aux, n, val);
184 
185  ((Geometry*)Geom)->add_another_Pjnt(node2);
186 
187  node1->delete_connectivity();
188  node2->delete_connectivity();
189 
190  b3->switch_node_pointer_in_all_components(node1, node2, false);
191  b4->switch_node_pointer_in_all_components(node1, node2, false);
192 
193  b1->connectivity_assembling(true);
194  b2->connectivity_assembling(true);
195  b3->connectivity_assembling(true);
196  b4->connectivity_assembling(true);
197 
198  break;
199  }
200  default: if (hinge > 0) errol;
201  }
202 
206  DOFsPerNode dpnfn = this->give_DOFspnod(); // dofs per node from node
207 
209  if (dpnfn == DPN_Void) {
210  for (i=0; i<superelems(); i++)
211  if (superelems[i]->give_elemAttribs()->give_conDOFs(this))
212  errol;
213  }
214  else {
215  // breakne se, kdyz element ma stejny dpnfn && nema conDOF => pak podpira plne uzel a vse je v poradku
216  for (i=0; i<superelems(); i++)
217  if (superelems[i]->give_elemAttribs()->give_conDOFs(this) == NULL && superelems[i]->give_elemAttribs()->give_dpn() == dpnfn)
218  break;
219 
220  // nebylo breaknuto, tak to je hinge
221  if (i == superelems()) {
222  DOFsPerNode dpne; // dofs per node from element
223  // kontrola, ze to je skutecne full hinge
224  // MOMENTALNE ZAKOMENTOVANY, U 2D PRIKLADUS SE STANE ZE give_conDOFs(this) VRATI NULL, TIM PADEM CHYBA
225  for (i=0; i<superelems(); i++) {
226  dpne = superelems[i]->give_elemAttribs()->give_dpn();
227  if ( dpne != DPN_DxyzR___ && ( dpne != DPN_DxyzRxyz || (! superelems[i]->give_elemAttribs()->give_conDOFs(this)->is_full_hinge()) ) )
228  errol;
229 
231  }
232  }
233  }
234 
236 
237  //pointAttribs()->finitialize();
238 }
240 void Point :: checkConsistency (void) const
241 {
243 
244  // attributes
245  //attributes->checkConsistency();
246 }
247 
249 const Edge* Point :: give_superedge (long nn, const Point **nods) const
250 {
251  for (int i=0; i<superedges(); i++)
252  if (superedges[i]->give_nno() == nn)
253  if ( superedges[i]->give_points()->has_these_members(nn, nods) )
254  return superedges[i];
255 
256  return NULL;
257 }
258 
260 long Point :: give_property (void) const
261 {
262  if (mproperty.give_size()) { if (mproperty.give_size() > 1) errol; return mproperty[0]; }
263  if (eproperty.give_size()) { if (eproperty.give_size() > 1) errol; return eproperty[0]; }
264  if (fproperty.give_size()) { if (fproperty.give_size() > 1) errol; return fproperty[0]; }
265  if (vproperty.give_size()) { if (vproperty.give_size() > 1) errol; return vproperty[0]; }
266  return -1;
267 }
269 long Point :: give_property (int dim, long id) const
270 {
271  switch (dim) {
272  case 0: if (! mproperty.give_size() > id) errol; return mproperty[id]; break;
273  case 1: if (! eproperty.give_size() > id) errol; return eproperty[id]; break;
274  case 2: if (! fproperty.give_size() > id) errol; return fproperty[id]; break;
275  case 3: if (! vproperty.give_size() > id) errol; return vproperty[id]; break;
276  default: _errorr("unsupported dimension");
277  }
278  return -1;
279 }
281 void Point :: set_property (int dim, long val)
282 {
283  switch (dim) {
284  case 0: if (!mproperty.give_size()) { mproperty.resize_ignore_vals(1); mproperty[0] = val; } else _errorr("main property set already"); break;
285  case 1: if (!eproperty.give_size()) { eproperty.resize_ignore_vals(1); eproperty[0] = val; } else _errorr("edge property set already"); break;
286  case 2: if (!fproperty.give_size()) { fproperty.resize_ignore_vals(1); fproperty[0] = val; } else _errorr("face property set already"); break;
287  case 3: if (!vproperty.give_size()) { vproperty.resize_ignore_vals(1); vproperty[0] = val; } else _errorr("volm property set already"); break;
288  default: _errorr("unsupported dimension");
289  }
290 }
292 void Point :: reset_property (int dim, long val)
293 {
294  switch (dim) {
295  case 0: mproperty.resize_ignore_vals(1); mproperty[0] = val; break;
296  case 1: eproperty.resize_ignore_vals(1); eproperty[0] = val; break;
297  case 2: fproperty.resize_ignore_vals(1); fproperty[0] = val; break;
298  case 3: vproperty.resize_ignore_vals(1); vproperty[0] = val; break;
299  default: _errorr("unsupported dimension");
300  }
301 }
303 void Point :: add_property (int dim, long val)
304 {
305  switch (dim) {
306  case 0: mproperty.add(val); break;
307  case 1: eproperty.add(val); break;
308  case 2: fproperty.add(val); break;
309  case 3: vproperty.add(val); break;
310  default: _errorr("unsupported dimension");
311  }
312 }
313 
314 
315 
316 // ********************************************************
317 // *** DUPLICITY **************************************
318 // ********************************************************
319 //
320 void Point :: make_invisible (Point *master, bool duplcheck)
321 {
323 
324  int i;
325  for (i=0; i<superedges(); i++) const_cast<Edge* >(superedges[i])->switch_node_pointer (this, master, duplcheck);
326  for (i=0; i<superfaces(); i++) const_cast<Face* >(superfaces[i])->switch_node_pointer (this, master, duplcheck);
327  for (i=0; i<superelems(); i++) {
328  Element *elem = const_cast<Element*>(superelems[i]);
329  elem->switch_node_pointer (this, master, duplcheck);
330  }
331 
332  ((Problem*)Pd)->switch_node_pointer (this, master);
333 }
334 
337 {
338  if (this->duplmaster) _errorr ("this is slave already");
339 
340  // zatim tady davam ze to musi byt equal, pac nevim jestli mam akumulovat attributy nebo ne
342 
343  superedges.add_unique (slave->give_superedges()[0]);
344  superfaces.add_unique (slave->give_superfaces()[0]);
345  superelems.add_unique (slave->give_superelems()[0]);
346  //udelej ascendent dodelat
347 }
348 
351 {
352  // flag is here for compatibility with Cell::invisible_duplicated
353 
354  // no duplicity
355  if (duplmaster == NULL) return false;
356 
357  // duplicated
359  this->make_invisible(duplmaster, true);
360 
361  return true;
362 }
363 
365 
367 void Point :: print_row_VTK (FILE *stream) const
368 {
369  // local coords
370  fprintf (stream, "% .6e % .6e % .6e\n", coords[0], coords[1], coords[2]);
371 }
372 void Point :: print_row_VTX (char *str) const
373 {
374  // local coords
375  sprintf (str, "% .6e % .6e % .6e", coords[0], coords[1], coords[2]);
376 }
377 
378 
383 Vertex :: Vertex (const Geometry *owner, long gid, const PoinT *coo, char attflag) : Point (owner, gid, coo, attflag)
384 {
385 }
386 //)
387 
390 {
391 
392 }
393 
396 {
398 
399  long hinge = pointAttribs()->give_hinge();
400  if (hinge == 1) {
402 
403  pointAttribs()->set_hinge(0);
404 
405  for (long i=0; i<superelems(); i++)
406  ((Element*)superelems[i])->set_fullhinge_at(this);
407  }
408 
409 }
410 
411 void Vertex :: print_row (FILE *stream, femFileFormat fff, bool endline, long did) const
412 {
413  switch (fff) {
414  case FFF_T3d:
415  // name + id
416  fprintf (stream, "vertex %3ld xyz ", this->ID+1);
417 
418  // local coords
419  for (int i=0; i<3; i++) fprintf (stream, " %21.14e", this->give_coord(i));
420 
421  // property
422  fprintf (stream, " property %ld", this->ID+1);
423  break;
424  default: errol;
425  }
426 
427  // end
428  if (endline) fprintf (stream, "\n");
429 }
430 
431 
436 Node :: Node (const Geometry *owner, long gid, const PoinT *coo, char attflag) : Point (owner, gid, coo, attflag)
437 {
438  cdom = 0; lid = NULL;
439  mdl_masterex = NULL;
440  mdl_masterel = NULL;
441  mdl_masteref = NULL;
442  resultsN = NULL;
443  resultsE = NULL;
444 }
445 
447 Node :: Node (const Vertex *src, char attflag) : Point (src, attflag)
448 {
449  cdom = 0; //if (src->cdom ) errol;
450  lid = NULL; //if (src->lid ) errol;
451  mdl_masterex = NULL;
452  mdl_masterel = NULL;
453  mdl_masteref = NULL;
454  resultsN = NULL; //if (src->results) errol;
455  resultsE = NULL; //if (mdl_mstr->results) errol;
456 }
458 Node :: Node (const Node *src, char attflag) : Point (src, attflag)
459 {
460  cdom = 0; if (src->cdom ) errol;
461  lid = NULL; if (src->lid ) errol;
462  mdl_masterex = NULL; //if (src->mdl_masterex) errol;
463  mdl_masterel = NULL; //if (src->mdl_masterel) errol;
464  mdl_masteref = NULL;
465  resultsN = NULL; if (src->resultsN ) errol;
466  resultsE = NULL; if (src->resultsE ) errol;
467 }
470 {
471  delete [] lid;
472  deallocateCheckUno (resultsN, Msh()->give_rslts_nsteps(), cRTN, false);
473 
474  if (resultsE) {
475  for (long i=0; i<Msh()->give_nRegions(); i++)
476  if (resultsE[i])
477  deallocateCheckUno (resultsE[i], Msh()->give_rslts_nsteps(), cRTE, false);
478 
479  delete [] resultsE;
480  }
481 }
482 
485 {
487 }
489 void Node :: checkConsistency (void) const
490 {
492 
493  // *** check of position node in domains ***
494  if ( cdom == 1 || cdom > NumDomains() )
495  _errorr ("Mishmash in domains");
496 
497 # ifdef DEBUG
498 # endif
499 }
500 
503 {
504  if (mdl_masterel) {
505  if (mdl_masterel->give_dimension() == 2)
506  return ((Gelement*)mdl_masterel)->give_cg()->give_lcs();
507  else if (mdl_masterel->give_dimension() == 1) {
508  const Edge* edge = mdl_masterel->give_edge(0);
509  if (edge->give_numsuperface() != 1) errol;
510  if (edge->give_superface(0)->give_numsuperelem() != 1) errol;
511  return ((Element*)edge->give_superface(0)->give_superelem(0))->give_cg()->give_lcs();
512  }
513  }
514 
515  if (mdl_masterex) {
516  if (mdl_masterex->give_numsuperface() != 1) errol;
518 
519  return ((Element*)mdl_masterex->give_superface(0)->give_superelem(0))->give_cg()->give_lcs();
520  }
521 
522  errol;
523  return NULL;
524 }
525 
526 
527 
529 void Node :: initialize_domli (bool shared, long dom, long li)
530 {
531  if (!Parallel()) errol;
532 
533  // cdom, lid
534  if (shared){ cdom = 1; lid = new long[NumDomains()]; fill_all_by (lid, NumDomains(), (long)-1); lid[dom] = li; } // node is shared
535  else { cdom = -dom; lid = new long[ 1 ]; lid[ 0 ] = li; } // node is not shared
536 }
537 
539 void Node :: initialize_parallel (long nd, long *dom)
540 {
541 # ifdef DEBUG
542  if (cdom!=0 || lid!=NULL) _errorr ("ERROR");
543 # endif
544 
545  cdom = nd;
546  if (nd<1 && dom==NULL) { lid = new long[1]; lid[0] = ((Mesh*)Msh())->NumNodes_plus(-nd); }
547  else if (nd>1 && dom!=NULL) { lid = new long[NumDomains()];
548  fill_all_by (lid, NumDomains(), (long)-1);
549  for (int i=0; i<nd; i++) lid[dom[i]] = ((Mesh*)Msh())->NumNodes_plus(dom[i]);
550  }
551  else _errorr0;
552 }
553 
555 void Node :: add_domain (long gid, const char *&str, femFileFormat fff, bool shared, long dom, long li)
556 {
557  switch (fff) {
558  case FFF_T3d: {
559  PoinT coo;
560  coo.scan_xyz (str);
561  if (!coords.is_identical_to(&coo)) _errorr ("coords differ");
562 
563  long parentdim, trash, prop;
564 
565  SP_scan_number (str, parentdim);
566  SP_scan_number (str, trash);
567  SP_scan_number (str, prop);
568 
569  if (prop != give_property (EntityType_type2dim_jktkT3d (parentdim), 0)) _errorr ("property differs");
570 
571  break;
572  }
573  default: _errorr("unsupported fem file format");
574  }
575 
576  if (!Parallel()) _errorr ("There no lid for non-Parallel analysis");
577  if (!shared) _errorr ("The node has to be shared");
578  if (cdom<=0) {
579  // toto odstranuje Danovu neschopnost tisknout u prvniho file glob cisla shareovanych uzlu s minusem
580  if (dom==1 && li<4) {
581  gid=lid[0]; delete lid;
582  lid = new long[NumDomains()]; fill_all_by (lid, NumDomains(), (long)-1);
583  lid[-cdom] = gid; cdom = 1;
584  }
585  else _errorr ("The node has to be shared, cdom<=0");
586  }
587  lid[dom] = li;
588  cdom++;
589 }
590 
591 
593 bool Point :: is_on_3d_element (void) const
594 {
595  for (long i=0; i<superelems(); i++)
596  if (superelems[i]->give_dimension() == 3)
597  return true;
598 
599  return false;
600 }
601 
602 // prida existujici node (nemusi se allocovat) do domeny == rozsiri se lid[]
604 {
605  if (!Parallel()) _errorr ("There no lid for non-Parallel analysis");
606 
607  if (this->give_lid(did) != -1) return;
608 
609  if (cdom<1) {
610  long aux = lid[0];
611  delete [] lid;
612  lid = new long [NumDomains()];
613  for (int i=0;i<NumDomains();i++) lid[i] = -1;
614  lid[-cdom] = aux;
615  cdom = 1;
616  }
617  cdom++;
618  lid[did] = ((Mesh*)Msh())->NumNodes_plus(did);
619 }
620 
621 // find parent subdomain
622 bool Node :: find_parent_subdom (long sdid, long *nn, long *level)
623 {
624  if ( subdom >= 0 ) {
625  if (level[0] && subdom != sdid) _errorr4("Error in subdom, %ld != %ld, ID = %ld", subdom, sdid, ID);
626  return false; // subdom flag already set
627  }
628 
629  level[0]++;
630 
631  if (level[0] > 50000) return true; // allowed number of recursive loops
632 
633  nn[0]++;
634  subdom = sdid;
635 
636  for (long i=0; i<superelems(); i++)
637  for (long j=0; j<superelems[i]->give_nno(); j++)
638  if ( ((Node*)superelems[i]->give_point(j))->find_parent_subdom (sdid,nn,level) ) {
639  nn[0]--;
640  subdom = -2;
641  level[0]--;
642  return true;
643  }
644 
645  level[0]--;
646  return false;
647 }
648 
649 //double Node :: give_absDisp (void) const
650 //{
651 // return sqrt (displ[0]*displ[0] + displ[1]*displ[1] + displ[2]*displ[2]);
652 //}
653 
654 
656 double Node :: give_ssstate (Dvctr *data, SStype SST, RVType rvtype, char type, long step)
657 {
658  double w, elw;
659  Dvctr eldata;
660 
661  w = 0.0;
662  data->resize_ignore_vals(6);
663  data->zero();
664  for (long i=0; i<superelems(); i++) {
665  elw = ((FElement*)superelems[i])->give_ssstate (&eldata, SST, rvtype, type, step, this);
666  if (eldata.give_size() == 6) {
667  w += elw;
668  data->addtms(eldata, elw);
669  }
670  }
671  if(w>1.0e-10)
672  data->dvdby(w);
673  return w;
674 }
675 
676 
678 void Node :: set_master_component (long prop, const Model *model, int parenttype)
679 {
680  if (parenttype == 1) mdl_masterex = dynamic_cast<const Vertex *>(model->give_Pjnt(prop-1));
681  else if (prop <= model->give_Nels()) mdl_masterel = dynamic_cast<const Gelement *>(model->give_Elem(prop-1));
682  else {
683  switch (EntityType_type2dim_jktkT3d (parenttype)) {
684  case 1: mdl_masteref = model->give_Edge(prop - model->give_Nels() - 1); break;
685  case 2: mdl_masteref = model->give_Face(prop - model->give_Nels() - 1); break;
686  default: errol;
687  }
688  }
689 # ifdef DEBUG
690  if (mdl_masterex == NULL && mdl_masterel == NULL && mdl_masteref == NULL) errol;
691 # endif
692 }
693 
694 const PointDOFsBCPM* give_uniq_dofbc (int dim, const GPA<const Element> *superelems, const char *name, long id)
695 {
696  const PointDOFsBCPM *dofbc, *dofbc2;
697 
698  int i;
699  long supid;
700  dofbc = NULL;
701 
702  for (; dim<=3; dim++) {
703  for (i=0; i<(*superelems)(); i++) {
704  if ( dim != (*superelems)[i]->give_dimension() ) continue;
705 
706  dofbc2 = ((const Gelement*)(*superelems)[i])->give_gelemAttribs()->give_dofbc();
707  if (dofbc2) {
708  if (dofbc==NULL) { dofbc = dofbc2; supid = (*superelems)[i]->give_ID(); }
709  else
710  if (!dofbc->is_identical_with(dofbc2))
711  _errorr5("Different boundary conditions at elements %ld and %ld meet at %s %ld", supid+1, (*superelems)[i]->give_ID()+1, name, id+1);
712  }
713  }
714 
715  if (dofbc) break;
716  }
717 
718  return dofbc;
719 }
720 
723 void Node :: read_input (const char *&str, femFileFormat fff)
724 {
725  switch (fff) {
726  case FFF_T3d: {
727  coords.scan_xyz (str);
728 
729  long parenttype, trash, prop;
730 
731  SP_scan_number (str, parenttype);
732  SP_scan_number (str, trash);
733  SP_scan_number (str, prop);
734 
735  if (prop) this->set_property(EntityType_type2dim_jktkT3d (parenttype), prop);
736 
737  // master model element
738  const Model *model = ((Mesh*)Geom)->give_Master_model();
739 
740  // master model element
741  // toto musim predelat na kontrolu vsech property, az mi dan zacne davat oproperty
742  //
743  if (model) {
744  this->set_master_component (prop, model, parenttype);
746  }
747  else
748  this->attributes_allocation('n', NULL);
749 
750  //* inherit boundary condition
751  if (model) {
752  const PointDOFsBCPM *dofbc = this->pointAttribs()->give_DOFbc();
753 
754  if (dofbc) break;
755 
756  if (mdl_masterex)
757  dofbc = give_uniq_dofbc (1, mdl_masterex->give_superelems(), "vertex", mdl_masterex->give_ID());
758  else if (mdl_masterel) {
760  dofbc = give_uniq_dofbc (fe->give_dimension(), fe->give_superelems(), "element", mdl_masterel->give_ID());
761  }
762  else
763  dofbc = give_uniq_dofbc (mdl_masteref->give_dimension(), mdl_masteref->give_superelems(), "edge/face", -1);
764 
765  if (dofbc)
766  this->pointAttribs()->set_dofbc_copy_of(dofbc);
767  }
768  break;
769  }
770  case FFF_OOFEM:
771  SP_scan_expected_word_exit (str, "coords", "Invalid structure of the given OOFEM input file", CASE);
772  SP_scan_expected_number_exit (str, 3, "Invalid structure of the given OOFEM input file, the number of coords");
773 
774  coords.scan_xyz (str);
775 
776  pointAttribs()->initialize_from (str, fff);
777  break;
778  case FFF_SIFEL:
779  coords.scan_xyz (str);
780 
781  pointAttribs()->initialize_from (str, fff);
782  break;
783  case FFF_JKTK:
784  coords.scan_xyz (str);
785 
786  long i, auxl, et, prop;
787  SP_scan_number (str, auxl);
788  for (i=0; i<auxl; i++) {
789  SP_scan_number (str, et);
790  SP_scan_number (str, prop);
791  if (prop) this->add_property (EntityType_type2dim_jktkT3d (et), prop);
792  }
793  break;
794  default: _errorr("unsupported fem file format");
795  }
796 }
797 
798 
800 void Node :: read_output_OOFEM (FILE *stream, long step, ResultTypesAtNode rt)
801 {
802  const PointDOFsBCPM* bc = pointAttribs()->give_DOFbc();
803  if (rt == RTN_reaction && (bc == NULL || bc->is_supported() == false)) return;
804 
805  const char *str;
806  char LINE[1023];
807 
808  int ndofs = this->give_pointAttribs()->give_nDOFs();
809  Dvctr *values = new Dvctr(ndofs);
810 
811  if (rt == RTN_displacement) {
812  fgets (LINE, 1023, stream); str=LINE;
813  SP_scan_expected_word3_exit (str, "Node", "RigidArmNode", "HangingNode", "Invalid structure of OOFEM output file", CASE);
814  SP_scan_expected_number_exit (str, ID+1, "Invalid structure of OOFEM output file");
815 
816  //
817  for (int i=0; i<ndofs; i++) {
818  fgets (LINE, 1023, stream); str=LINE;
819  // dof
820  SP_scan_expected_word_exit (str, "dof", "Invalid structure of OOFEM output file", CASE);
821  SP_scan_expected_number_exit (str, i+1, "Invalid structure of OOFEM output file");
822  // d
823  SP_scan_expected_word_exit (str, "d", "Invalid structure of OOFEM output file", CASE);
824  SP_scan_number (str, (*values)[i]);
825  }
826  }
827  else if (rt == RTN_reaction) {
828  values->zero();
829 
830  for (int i=0; i<ndofs; i++) {
831  if (bc->give_att(i)) {
832  fgets (LINE, 1023, stream); str=LINE;
833  SP_scan_expected_word_exit (str, "Node" , "Invalid structure of OOFEM output file", CASE);
834  SP_scan_expected_number_exit (str, this->ID+1, "Invalid structure of OOFEM output file");
835  SP_scan_expected_word_exit (str, "iDof" , "Invalid structure of OOFEM output file", CASE);
836  SP_scan_expected_number_exit (str, i+1, "Invalid structure of OOFEM output file");
837  SP_scan_expected_word_exit (str, "reaction", "Invalid structure of OOFEM output file", CASE);
838 
839  SP_scan_number (str, (*values)[i]);
840 
841  SP_scan_expected_word_exit (str, "[bc-id:" , "Invalid structure of OOFEM output file", CASE);
842  SP_scan_expected_word_exit (str, "1]" , "Invalid structure of OOFEM output file", CASE);
843  }
844  }
845  }
846  else errol;
847 
848  this->add_resultN (values, step, rt);
849 }
850 
852 void Node :: read_output_SIFEL (FILE *stream, long step, ResultTypesAtNode rt)
853 {
854  const PointDOFsBCPM* bc = pointAttribs()->give_DOFbc();
855  if (rt == RTN_reaction && (bc == NULL || bc->is_supported() == false)) return;
856 
857  const char *str;
858  char LINE[1023];
859 
860  if (rt == RTN_displacement) {
861  int ndofs = this->give_pointAttribs()->give_nDOFs();
862 
863  Dvctr *values = new Dvctr(ndofs);
864 
865  fgets (LINE, 1023, stream); str=LINE;
866  SP_scan_expected_word_exit (str, "Node", "Invalid structure of SIFEL output file", CASE);
867  SP_scan_expected_number_exit (str, ID+1, "Invalid structure of SIFEL output file");
868 
869  //
870  char r[6];
871  for (int i=0; i<ndofs; i++) {
872  sprintf(r,"r_%d=",i+1);
873  SP_scan_expected_word_exit (str, r, "Invalid structure of SIFEL output file", CASE);
874  SP_scan_number (str, (*values)[i]);
875  }
876  this->add_resultN (values, step, rt);
877  }
878  else if (rt == RTN_transpunknowns) {
879  int nmed = this->give_pointAttribs()->give_nDOFs();
880  Dvctr *values = new Dvctr(nmed);
881 
882  fgets (LINE, 1023, stream); str=LINE;
883  SP_scan_expected_word_exit (str, "Node", "Invalid structure of SIFEL output file", CASE);
884  SP_scan_expected_number_exit (str, ID+1, "Invalid structure of SIFEL output file");
885 
886  //
887  char r[6];
888  for (int i=0; i<nmed; i++) {
889  sprintf(r,"r_%d=",i+1);
890  SP_scan_expected_word_exit (str, r, "Invalid structure of SIFEL output file", CASE);
891  SP_scan_number (str, (*values)[i]);
892  }
893  this->add_resultN (values, step, rt);
894  }
895  else if (rt == RTN_reaction) {
896  int ndofs = this->give_pointAttribs()->give_nDOFs();
897 
898  Dvctr *values = new Dvctr(ndofs);
899  values->zero();
900 
901  fgets (LINE, 1023, stream); str=LINE;
902  SP_scan_expected_word_exit (str, "Node", "Invalid structure of SIFEL output file", CASE);
903  SP_scan_expected_number_exit (str, ID+1, "Invalid structure of SIFEL output file");
904 
905  //
906  char r[6];
907  for (int i=0; i<ndofs; i++) {
908  sprintf(r,"R_%d=",i+1);
909  SP_scan_expected_word_exit (str, r, "Invalid structure of SIFEL output file", CASE);
910  SP_scan_number (str, (*values)[i]);
911  if (!bc->give_att(i)) {
912  if ((*values)[i] > 1.e-12) errol;
913  else (*values)[i] = 0.0;
914  }
915  }
916  this->add_resultN (values, step, rt);
917  }
918  else errol;
919 }
920 
923 void Node :: print_row (FILE *stream, femFileFormat fff, bool endline, long did) const
924 {
925  char flag = 'a'; // to je tady historicky, posilalo se to jako argument, ale ted to nikdo nevola, tak jsem to zrusil
926  long i;
927 
928  if (fff == FFF_OOFEM) {
929  if (flag == 'a' || flag == 's') {
930  // name + id
931  fprintf (stream, "%s %4ld", this->give_node_name(), this->give_lid_id(did)+1);
932 
933  // local coords
934  fprintf (stream, " coords 3");
935  for (i=0; i<3; i++) fprintf (stream, " %16.9e", this->give_coord(i));
936 
937  // global id
938  if (Parallel()) fprintf (stream, " globNum %4ld", this->give_ID()+1);
939 
940  // boundary conditions
941  this->pointAttribs()->print_row(stream, fff, did);
942  }
943  if (flag == 'a' || flag == 'e') {
944  // parallel, shared
945  if (this->is_shared()) {
946  fprintf (stream, " Shared partitions %4ld", this->give_cdom()-1);
947  for (i=0; i<NumDomains(); i++)
948  if (this->give_lid(i)!=-1 && i!=did)
949  fprintf (stream," %4ld",i);
950  }
951  }
952  }
953  else if (fff == FFF_SIFEL) {
954  fprintf (stream, "%6ld", this->give_ID()+1);
955 
956  // local coords
957  for (i=0; i<3; i++) fprintf (stream, " %13.6e", this->give_coord(i));
958 
959  // boundary conditions
960  this->pointAttribs()->print_row(stream, fff, did);
961  }
962  else if (fff == FFF_ANSYS) {
963  fprintf (stream, "N,%6ld", this->give_ID()+1);
964 
965  // local coords
966  for (i=0; i<3; i++) fprintf (stream, ", %13.6e", this->give_coord(i));
967  }
968  else if (fff == FFF_JKTK) {
969  if (Pd->give_PDBO(PDBO_melnik)) {
970  fprintf (stream, "%ld", this->give_ID()+1);
971  // local coords
972  for (i=0; i<3; i++) fprintf (stream, " %16.10e", this->give_coord(i));
973  // properties
975  //if (nprop == 0) _errorr2("There is no property at node %ld, required by JKTK file format", this->give_ID()+1);
976  fprintf (stream, " %ld", nprop);
977  for (i=0; i<vproperty.give_size(); i++) fprintf (stream, " %d %ld", EntityType_dim2type_jktkT3d(3), vproperty[i]);
978  for (i=0; i<fproperty.give_size(); i++) fprintf (stream, " %d %ld", EntityType_dim2type_jktkT3d(2), fproperty[i]);
979  for (i=0; i<eproperty.give_size(); i++) fprintf (stream, " %d %ld", EntityType_dim2type_jktkT3d(1), eproperty[i]);
980  for (i=0; i<mproperty.give_size(); i++) fprintf (stream, " %d %ld", EntityType_dim2type_jktkT3d(0), mproperty[i]);
981 
982  // if (this->give_mproperty_cnt()) fprintf (stream, " 1 4 %ld", this->give_propertyORzero());
983  // else if (oproperty.give_size()) {
984  // fprintf (stream, " %ld", oproperty.give_size()/2);
985  // for (i=0; i<oproperty.give_size(); i+=2)
986  // fprintf (stream, " %ld %ld", oproperty[i], oproperty[i+1]);
987  // }
988  }
989  else {
990  fprintf (stream, "%8ld", this->give_ID()+1);
991  // local coords
992  for (i=0; i<3; i++) fprintf (stream, " %13.6e", this->give_coord(i));
993  // properties
994  // properties
996  if (nprop == 0) _errorr2("There is no property at node %ld, required by JKTK file format", this->give_ID()+1);
997  fprintf (stream, " %ld", nprop);
998 
999  if (mproperty.give_size() == 0)
1000  fprintf (stream, " %d %d", EntityType_dim2type_jktkT3d(0), 0);
1001  else
1002  for (i=0; i<mproperty.give_size(); i++) fprintf (stream, " %d %ld", EntityType_dim2type_jktkT3d(0), mproperty[i]);
1003 
1004  for (i=0; i<eproperty.give_size(); i++) fprintf (stream, " %d %ld", EntityType_dim2type_jktkT3d(1), eproperty[i]);
1005  for (i=0; i<fproperty.give_size(); i++) fprintf (stream, " %d %ld", EntityType_dim2type_jktkT3d(2), fproperty[i]);
1006  for (i=0; i<vproperty.give_size(); i++) fprintf (stream, " %d %ld", EntityType_dim2type_jktkT3d(3), vproperty[i]);
1007  }
1008  }
1009  else errol;
1010 
1011  fprintf (stream, "\n");
1012 }
1013 
1015 {
1016  if (resultsN) return;
1017 
1018  if (Msh()->give_rslts_nsteps() == 0) _errorr("allocate results with nsteps == 0, mayby replace -IN_VTKaddata by -IN_VTKaddataRSLT");
1019 
1020  resultsN = new Array1d**[Msh()->give_rslts_nsteps()];
1021 
1022  for (long i=0; i<Msh()->give_rslts_nsteps(); i++) {
1023  resultsN[i] = new Array1d*[cRTN];
1024  memset (resultsN[i], 0, cRTN*sizeof(Array1d*));
1025  }
1026 }
1027 
1028 void Node :: allocate_resultsE (long regid)
1029 {
1030  if (resultsE && resultsE[regid]) return;
1031 
1032  if (resultsE == NULL) {
1033  resultsE = new Array***[Msh()->give_nRegions()];
1034  memset (resultsE, 0, Msh()->give_nRegions()*sizeof(Array***));
1035  }
1036 
1037  long nsteps = Msh()->give_rslts_nsteps(); if (nsteps == 0) _errorr("allocate results with nsteps == 0, mayby replace -IN_VTKaddata by -IN_VTKaddataRSLT");
1038 
1039  resultsE[regid] = new Array**[nsteps];
1040 
1041  while(nsteps--) {
1042  resultsE[regid][nsteps] = new Array*[cRTE];
1043  memset (resultsE[regid][nsteps], 0, cRTE*sizeof(Array*));
1044  }
1045 }
1046 
1047 void Node :: add_resultN ( Xvctr *rslt, long step, ResultTypesAtNode rt) { this->allocate_resultsN(); if (this->resultsN [step][rt]) errol; this->resultsN [step][rt] = rslt; }
1048 void Node :: set_resultN (long s, const double *rslt, long step, ResultTypesAtNode rt) { this->allocate_resultsN(); if (this->resultsN [step][rt]) errol; this->resultsN [step][rt] = new Dvctr(s, rslt); }
1049 void Node :: set_resultN ( const double rslt, long step, ResultTypesAtNode rt) { this->allocate_resultsN(); if (this->resultsN [step][rt]) errol; this->resultsN [step][rt] = new Dscal( rslt); }
1050 void Node :: add_resultE ( Dvctr *rslt, long regid, long step, ResultTypesAtElem rt) { this->allocate_resultsE(regid); if (this->resultsE[regid][step][rt]) errol; this->resultsE[regid][step][rt] = rslt; }
1051 void Node :: set_resultE ( const Dmtrx *rslt, long regid, long step, ResultTypesAtElem rt) { this->allocate_resultsE(regid); if (this->resultsE[regid][step][rt]) errol; this->resultsE[regid][step][rt] = new Dmtrx( rslt); }
1052 void Node :: set_resultE ( const VectoR *rslt, long regid, long step, ResultTypesAtElem rt) { this->allocate_resultsE(regid); if (this->resultsE[regid][step][rt]) errol; this->resultsE[regid][step][rt] = new Dvctr( rslt); }
1053 
1054 const Dscal* Node :: give_resultsN_ds ( long step, ResultTypesAtNode rt) const { if (resultsN [step][rt] == NULL) return NULL; Dscal *rslt = dynamic_cast<Dscal*>(resultsN [step][rt]); if (!rslt) errol; return rslt; }
1055 const Dvctr* Node :: give_resultsN_dv ( long step, ResultTypesAtNode rt) const { if (resultsN [step][rt] == NULL) return NULL; Dvctr *rslt = dynamic_cast<Dvctr*>(resultsN [step][rt]); if (!rslt) errol; return rslt; }
1056 //
1057 const Dvctr* Node :: give_resultsE_dv (long regid, long step, ResultTypesAtElem rt) const { if (resultsE == NULL || resultsE[regid] == NULL) return NULL;
1058  if (resultsE[regid][step][rt] == NULL) return NULL; Dvctr *rslt = dynamic_cast<Dvctr*>(resultsE[regid][step][rt]); if (!rslt) errol; return rslt; }
1059 const Dmtrx* Node :: give_resultsE_dm (long regid, long step, ResultTypesAtElem rt) const { if (resultsE == NULL || resultsE[regid] == NULL) return NULL;
1060  if (resultsE[regid][step][rt] == NULL) return NULL; Dmtrx *rslt = dynamic_cast<Dmtrx*>(resultsE[regid][step][rt]); if (!rslt) errol; return rslt; }
1061 
1064 {
1065  if (rt != RTN_displacement && rt != RTN_reaction) errol;
1066 
1067  const Dvctr *values = this->give_resultsN_dv(step, rt);
1068 
1069  if (values) pointAttribs()->setup_full_alloc_DOFvals(answer, values);
1070  else answer->resize_ignore_vals(0);
1071 }
1072 
1073 void Node :: give_displcmnt_in_all_steps(Dvctr *data, int indx) const
1074 {
1075  if (! this->give_resultsN_dv(0, RTN_displacement)) errol;
1076 
1077  for (long i=0; i<Msh()->give_rslts_nsteps(); i++)
1078  data[0][i] = (*(Dvctr*)this->resultsN[i][RTN_displacement])[indx];
1079 
1080 }
1081 
1082 
1083 
1089 {
1091 
1093 }
1096 {
1098 
1099  // *** check attributes ***
1100  if ( dynamic_cast<HNAttribs *>(attributes) == NULL ) _errorr0;
1101 
1102  //
1103  if (Parallel()) {
1104  for (int did=0; did<NumDomains(); did++) {
1105  if (cdom<1) did = -cdom;
1106  else if (lid[did] == -1) continue;
1107 
1108  this->give_HNattrb()->check_masters_at_domain(did);
1109 
1110  if (cdom<1) break;
1111  }
1112  }
1113 }
1114 
1117 {
1118  if (!Parallel()) return;
1119 
1120  for (int did=0; did<NumDomains(); did++) {
1121  if (cdom<1) did = -cdom;
1122  else if (lid[did] == -1) continue;
1123 
1124  ((HNAttribs*)attributes)->add_masters_to_domain(did);
1125 
1126  if (cdom<1) break;
1127  }
1128 }
1130 void HangingNode :: initialize_hn (const PoinT *cartcoord, const Cell *mc, long dimMC, long ordMC, long countMN, const Node **nodes, const PoinT *natcoord)
1131 {
1132  coords.copy(cartcoord);
1133 
1134  ((HNAttribs*)attributes)->initialize_atelemet (mc, dimMC, ordMC, countMN, nodes, natcoord);
1135 }
1136 
1139 //void HangingNode :: read_input_OOFEM (const char *str){}
1140 
1142 void HangingNode :: print_one_row_HN (FILE *stream, long hid) const
1143 {
1144  ((HNAttribs*)attributes)->print_one_row (stream, hid);
1145 
1146  if (Parallel()){
1147  fprintf (stream," gid %ld cdom %3ld lid", ID+Msh()->give_Nn(), cdom);
1148  if (cdom<1) fprintf (stream," %ld",lid[0]);
1149  else for (long i=0; i<NumDomains(); i++) fprintf (stream," %ld", lid[i]);
1150  }
1151 }
1152 
1153 
1159 {
1161 
1163  //if (property2 != -1) {
1164  // _errorr0;
1165  // //prpos2 = Pd->give_RAN_prpos (property2);
1166  // //if (prpos2 == -1) _errorr3 ("Error give_RAN_prpos, property1 = %d, property2 = %d", property, property2);
1167  // //
1168  // //if (Pd->give_RAN_prpos(this->property) != -1)
1169  // // Pd->give_NdAt(this->property)->checkEqualityWith (Pd->give_NdAt(this->property2));
1170  //}
1171 
1172  // *** finding shared rigid arm node masters ***
1173  if (Parallel())
1174  for (int did=0; did<NumDomains(); did++) {
1175  if (cdom<1) did = -cdom;
1176  else if (lid[did] == -1) continue;
1177 
1178  ((RANAttribs*)attributes)->add_master_to_domain(did);
1179 
1180  if (cdom<1) break;
1181  }
1182 }
1185 {
1187 
1188  // *** check attributes ***
1189  if ( dynamic_cast<RANAttribs *>(attributes) == NULL ) _errorr0;
1190 
1191 # ifdef DEBUG
1192 # endif
1193 }
1194 
1196 //const Node* RigidArmNode :: give_RANmaster (void) const
1197 //{
1198 // return ((RANAttribs*)attributes)->give_master();
1199 //}
1200 
1202 //void RigidArmNode :: print_row_OOFEM (FILE *stream, long did, char flag) const
1203 //{
1204 // if (flag != 'a') _errorr ("error");
1205 //
1206 // Node :: print_row_OOFEM(stream, did, 's');
1207 //
1208 //
1209 // //long i, ndofs;
1210 // // master
1211 // if (this->property2 == -1)
1212 // ;
1213 // //pointAttribs()->print_row_OOFEM (stream, did);
1214 // else {
1215 // _errorr0;
1216 // //const RANode *ran1 = Pd->give_RAN(this->prpos );
1217 // //const RANode *ran2 = Pd->give_RAN(this->prpos2);
1218 // //
1219 // //int m1 = ran1->give_master()->give_lid (did)+1;
1220 // //int m2 = ran2->give_master()->give_lid (did)+1;
1221 // //ndofs = Pd->give_NdAt(this->give_property())->give_nDOFs();
1222 // //int *mstr = new int [ndofs];
1223 // //int *mmsk = new int [ndofs];
1224 // //int *dftp = new int [ndofs];
1225 // //
1226 // //int aux1,aux2;
1227 // //for (i=0; i<ndofs; i++) {
1228 // // aux1 = ran1->give_mask(i);
1229 // // aux2 = ran2->give_mask(i);
1230 // // if (aux1*aux2) _errorr ("RAN mismatch");
1231 // // if (aux1) mstr[i] = m1; else if (aux2) mstr[i] = m2; else mstr[i] = 0;
1232 // // if (aux1) mmsk[i] = aux1; else if (aux2) mmsk[i] = aux2; else mmsk[i] = 0;
1233 // // dftp[i] = (aux1+aux2 ? 2 : 0);
1234 // //}
1235 // //fprintf (stream," masters %ld", ndofs); for (i=0; i<ndofs; i++) fprintf (stream," %d", mstr[i]);
1236 // //fprintf (stream," dofType %ld", ndofs); for (i=0; i<ndofs; i++) fprintf (stream," %d", dftp[i]);
1237 // //fprintf (stream," masterMask %ld", ndofs); for (i=0; i<ndofs; i++) fprintf (stream," %d", mmsk[i]);
1238 // //
1239 // //delete [] mstr; delete [] mmsk; delete [] dftp;
1240 // }
1241 //
1242 // Node :: print_row_OOFEM(stream, did, 'e');
1243 //}
1245 //RigidArmNode :: RigidArmNode (long gid, const Mesh *mg) : Node (gid, mg)
1246 //{
1247 // // prpos2 = -1;
1248 // //property2 = -1;
1249 //}
1251 //RigidArmNode :: RigidArmNode (long gid, long prop, const Mesh *mg, double *coo, bool shared, long dom, long li) : Node (gid, prop, mg, coo, shared, dom, li)
1252 //{
1253 // //prpos2 = -1;
1254 // //
1255 // if (property>9999999) {
1256 // _errorr0;
1257 // //property2 = property%10000;
1258 // //property = property/10000;
1259 // }
1260 // //else property2 = -1;
1261 //}
1262 
1263 } // namespace midaspace
const GPA< const Element > * give_superelems(void) const
Definition: cell.h:189
long NumDomains(void) const
Definition: geomcomp.h:145
const Face * give_Face(long i) const
Definition: geometry.h:70
bool is_parallel_with(const VectoR *that, double relZero) const
Definition: arrays.h:191
virtual const char * give_node_name(void) const
return name of node used in input file for static soft
Definition: point.h:290
void setup_full_alloc_DOFvals(Dvctr *answer, const Dvctr *values) const
Definition: attribute.cpp:1875
void set_master_component(long prop, const Model *model, int parenttype)
Definition: point.cpp:678
long * lid
Definition: point.h:188
femFileFormat
Definition: alias.h:632
virtual ~Point()
DESTRUCTOR.
Definition: point.cpp:85
void print_one_row_HN(FILE *stream, long hid) const
*** READ ***
Definition: point.cpp:1142
void print_row_VTX(char *str) const
Definition: point.cpp:372
bool give_PDBO(ProbDescBoolOpt pdbo) const
Definition: problem.h:187
void checkEqualityWith(const PointAttribs *slave) const
Definition: attribute.cpp:1894
virtual void checkConsistency(void) const
Checks data consistency.
Definition: point.cpp:1095
const Facedge * mdl_masteref
Parent model entity - master Edge or Face.
Definition: point.h:196
int give_hinge(void) const
Definition: attribute.h:1059
void set_hinge(int val)
Definition: attribute.h:1042
void allocate_resultsN(void)
Definition: point.cpp:1014
void add_domain(long gid, const char *&str, femFileFormat fff, bool shared, long dom, long li)
initialize shared node on next domain
Definition: point.cpp:555
bool is_on_3d_element(void) const
any parent element is 3-dimensional
Definition: point.cpp:593
const GPA< const Edge > * give_superedges(void) const
Definition: point.h:114
Lvctr fproperty
Definition: point.h:35
DOFsPerNode
Definition: alias.h:700
double give_ssstate(Dvctr *data, SStype SST, RVType rvtype, char type, long step)
give stress-strain state averaged to node
Definition: point.cpp:656
PoinT coords
Definition: point.h:27
PointAttribs * give_NdAt_with_prop(long prop) const
Definition: problem.cpp:312
bool is_identical_to(const Elem3D *p, double zero) const
Definition: arrays.h:55
#define ZERO
Definition: alias.h:51
void make_invisible(Point *master, bool duplcheck)
Definition: point.cpp:320
General functions.
GPA< const Edge > superedges
CONNECTIVITY - full connectivity initiated only when Geom->connectivity_is_assembled() == true...
Definition: point.h:48
const Gelement * mdl_masterel
Parent model entity - master Element.
Definition: point.h:194
void dvdby(double val)
Definition: arrays.cpp:384
virtual void finitialize(void)
finalize preprocessing
Definition: geomcomp.h:96
#define SP_scan_expected_word_exit(_1, _2, _3, _4)
Definition: librw.h:201
const Edge * give_superedge(long i) const
Definition: point.h:111
void integrate_duplicated_point(Point *slave)
Definition: point.cpp:336
sifel i/o native ff
Definition: alias.h:644
Input / output function.
void add_me_to_domain(long did)
adds existing node (nemusi se allocovat) to domain == rozsiri se lid[]
Definition: point.cpp:603
long give_property(void) const
Definition: point.cpp:260
long give_Nels(void) const
Definition: geometry.h:67
Point.
bool is_supported(void) const
Definition: substructs.h:153
long give_rslts_nsteps(void) const
Definition: geometry.h:328
virtual void finitialize(void)
finalize preprocessing
Definition: point.cpp:95
int give_dimension(void) const
return type of element geometry, is identical with class derived from FElement
Definition: cell.h:32
#define SP_scan_expected_number_exit(_1, _2, _3)
Definition: librw.h:229
const Dvctr * give_resultsE_dv(long regid, long step, ResultTypesAtElem rt) const
Definition: point.cpp:1057
void check_masters_at_domain(long did) const
Definition: attribute.cpp:2474
void deallocateCheckUno(ArgType *p, bool check=true)
Definition: gelib.h:197
virtual void print_row(FILE *stream, femFileFormat fff, bool endline=true, long did=0) const
*** PRINT ***
Definition: point.cpp:411
void check_connectivity(void) const
Definition: geomcomp.h:146
bool is_shared(void) const
ATRIBUTES.
Definition: point.h:270
void add_resultN(Xvctr *rslt, long step, ResultTypesAtNode rt)
Definition: point.cpp:1047
const LCS_pure * give_mdl_lcs(void)
funkce je udelana na rycholo, pro jine nez polygon rovinny bude hazet hovadiny
Definition: point.cpp:502
virtual long give_size(void) const
Definition: arrays.h:387
unknows in transport, N=ndofs
Definition: alias.h:207
const Mesh * Msh(void) const
Definition: point.h:258
PointAttribs * pointAttribs()
Definition: point.h:82
long give_cdom(void) const
Definition: point.h:271
long ID
(global) identification number == position in list of members; zero-based numbering.
Definition: subject.h:22
virtual ~Node()
DESTRUCTOR.
Definition: point.cpp:469
long give_ID() const
Definition: subject.h:45
void connectivity_assembling(bool re=false)
Function assembles connectivity between element and its nodes, edges and faces (which are allocated i...
Definition: cell.cpp:852
Point * duplmaster
DUPLICITY there is no chain as on element.
Definition: point.h:53
#define errol
Definition: gelib.h:142
GPA< const Face > superfaces
Definition: point.h:49
Vertex(const Geometry *owner, long gid, const PoinT *coo, char attflag='!')
CONSTRUCTOR.
Definition: point.cpp:383
oofem i/o native ff
Definition: alias.h:643
void switch_node_pointer_in_all_components(Point *slave, Point *master, bool duplcheck)
switch node pointer from oldnode/slave to newnode/master on this and all components (edges...
Definition: cell.cpp:1001
const PointDOFsBCPM * give_DOFbc(void) const
Definition: attribute.h:1057
bool is_identical_with(const PointDOFsAttributes *src) const
Definition: substructs.h:80
#define _errorr2(_1, _2)
Definition: gelib.h:145
long give_numsuperface(void) const
Definition: cell.h:269
Attributes * attributes
ATTRIBUTES.
Definition: geomcomp.h:73
void attributes_allocation(char attflag, const Attributes *masterat)
*** *** *** *** CLASS POINT *** *** *** ***
Definition: point.cpp:17
virtual ~Vertex()
DESTRUCTOR.
Definition: point.cpp:389
Array **** resultsE
INTERPOLATED RESULTS 1d array of pointers to 2d array of pointers to Dvctr.
Definition: point.h:214
void give_displcmnt_in_all_steps(Dvctr *data, int indx) const
Definition: point.cpp:1073
Elem3D * zero(void)
Definition: arrays.h:64
void initialize_hn(const PoinT *cartcoord, const Cell *mc, long dimMC, long ordMC, long countMN, const Node **nodes, const PoinT *natcoord)
initialize hanging node
Definition: point.cpp:1130
void set_property(int dim, long val)
Definition: point.cpp:281
void initialize_domli(bool shared, long dom, long li)
Definition: point.cpp:529
bool Parallel(void) const
*** FEMesh ***
Definition: geomcomp.h:144
const Element * give_superelem(long i) const
Definition: cell.h:188
long subdom
Definition: point.h:28
long give_lid(long dom) const
vraci lid of node pro domenu dom, pokud node v domene nelezi, vraci -1
Definition: point.h:277
Attributes.
const PointDOFsBCPM * give_uniq_dofbc(int dim, const GPA< const Element > *superelems, const char *name, long id)
Definition: point.cpp:694
Structs Elem3D, PoinT and VectoR; classes Array, Array1d, Xscal, Dscal, Xvctr, Lvctr, Dvctr, Xmtrx, Lmtrx and Dmtrx.
void zero(void)
Definition: arrays.h:630
Dvctr * resize_ignore_vals(long newsize)
Definition: arrays.h:595
void give_vector(VectoR *v) const
Definition: cell.cpp:2199
t3d i/o native ff
Definition: alias.h:641
virtual void print_row(FILE *stream, femFileFormat fff, long did) const
print row to solver input file
Definition: attribute.cpp:2008
virtual void initialize(void)
initiate/sets data
Definition: point.cpp:395
void read_input(const char *&str, femFileFormat fff)
*** READ ***
Definition: point.cpp:723
PointAttribs * give_pointAttribs(void)
Definition: point.h:93
bool find_parent_subdom(long sdid, long *nn, long *level)
Definition: point.cpp:622
const Face * give_superface(long i) const
Definition: cell.h:270
void add_property(int dim, long val)
Definition: point.cpp:303
int give_att(int i) const
Definition: substructs.h:73
const Edge * give_edge(long i) const
Definition: cell.h:94
reaction, N=ndofs
Definition: alias.h:206
const Problem * Pd
Pointer to owner = parent problem.
Definition: subject.h:24
Point(const Geometry *owner, long gid, const PoinT *coo, char attflag)
CONSTRUCTOR.
Definition: point.cpp:52
void reset_dofbc_support_all_rot_dofs(void)
Definition: attribute.cpp:1867
const Dmtrx * give_resultsE_dm(long regid, long step, ResultTypesAtElem rt) const
Definition: point.cpp:1059
void initialize_parallel(long nd, long *dom)
initialize atributes cdom and lid
Definition: point.cpp:539
const Dscal * give_resultsN_ds(long step, ResultTypesAtNode rt) const
Definition: point.cpp:1054
Geometry description.
Definition: geometry.h:29
virtual void checkConsistency(void) const
Checks data consistency.
Definition: geomcomp.h:98
void add_resultE(Dvctr *rslt, long regid, long step, ResultTypesAtElem rt)
Definition: point.cpp:1050
const Edge * give_Edge(long i) const
Definition: geometry.h:69
void read_output_OOFEM(FILE *stream, long step, ResultTypesAtNode rt)
Definition: point.cpp:800
ElemAttribs * give_elemAttribs(void)
Definition: cell.h:402
bool scan_xyz(FILE *stream)
Definition: arrays.h:71
const Geometry * Geom
Pointer to owner == parent geometry.
Definition: subject.h:59
void delete_connectivity(void)
remove superiors
Definition: point.h:106
Lvctr * resize_ignore_vals(long newsize)
resize, ignore values
Definition: arrays.h:472
virtual void initialize(void)
initiate/sets data
Definition: point.cpp:1088
GPA - Generic Pointer Array, template class manages 1d array of pointers to objects of type T...
Definition: gpa.h:23
virtual void print_row(FILE *stream, femFileFormat fff, bool endline=true, long did=0) const
print node row output for solver
Definition: point.cpp:923
const Face * give_superface(long i) const
Definition: point.h:112
#define _errorr(_1)
Definition: gelib.h:151
Derived class for management of boundary conditions and physical meanings of DOFs (Degrees Of Freedom...
Definition: substructs.h:131
void add(long val)
add value to size++ position
Definition: arrays.h:460
Attributes * give_attributes(void)
Definition: geomcomp.h:139
SStype
type of stress/strain state of element; especially results depends on this variable => described at M...
Definition: alias.h:954
const HNAttribs * give_HNattrb(void) const
Definition: point.h:343
long give_numsuperface(void) const
Definition: point.h:109
ansys i/o native ff
Definition: alias.h:642
int EntityType_type2dim_jktkT3d(long val)
Conversion from "entity type by t3d and jktk" to "dimension".
Definition: alias.h:317
void reset_property(int dim, long val)
Definition: point.cpp:292
#define CASE
Definition: alias.h:43
virtual void switch_node_pointer(Point *slave, Point *master, bool duplcheck)
switch node pointer form slave to master
Definition: cell.cpp:1010
DOFsPerNode give_DOFspnod(void) const
Definition: problem.h:256
ResultTypesAtElem
Result type at element.
Definition: alias.h:240
void setup_full_alloc_DOFvals_at(Dvctr *d, ResultTypesAtNode rt, long step) const
Definition: point.cpp:1063
const Facedge * give_same_dimension_facedge(void) const
Returns edge/face/volume of same dimension as receiver (Beam returns edge, etc.)
Definition: cell.cpp:836
virtual void initialize(void)
initiate/sets data
Definition: point.cpp:90
void set_resultE(const Dmtrx *rslt, long regid, long step, ResultTypesAtElem rt)
Definition: point.cpp:1051
const Element * give_Elem(long i) const
Definition: geometry.h:71
Lvctr vproperty
Definition: point.h:36
#define _errorr5(_1, _2, _3, _4, _5)
Definition: gelib.h:148
bool SP_scan_number(const char *&src, int &dest)
... number of type int/long/double
Definition: librw.cpp:595
virtual bool invisible_duplicated(char flag='a')
make invisible if duplicated
Definition: point.cpp:350
void read_output_SIFEL(FILE *stream, long step, ResultTypesAtNode rt)
Definition: point.cpp:852
*** *** *** *** CLASS COMPONENT *** *** *** ***
Definition: geomcomp.h:22
Local coordinate system defined by 2 vectors.
Definition: taux.h:179
const Vertex * mdl_masterex
Parent model entity - master Vertex.
Definition: point.h:192
void allocate_resultsE(long regid)
Definition: point.cpp:1028
#define SP_scan_expected_word3_exit(_1, _2, _3, _4, _5, _6)
Definition: librw.h:203
virtual void initialize(void)
initiate/sets data
Definition: point.cpp:1158
DOFsPerNode give_DOFspnod(void) const
return DOFspnod inherited from Problem, or NULL if
Definition: point.cpp:43
#define _errorr4(_1, _2, _3, _4)
Definition: gelib.h:147
void mg_connectivity_assembling(void)
Definition: geomcomp.h:150
ResultTypesAtNode
Result type at node.
Definition: alias.h:204
void set_resultN(long s, const double *rslt, long step, ResultTypesAtNode rt)
Definition: point.cpp:1048
count of ...
Definition: alias.h:211
virtual classID give_classid() const
Returns classID - class identification.
Definition: attribute.h:1019
void addtms(const Dvctr &src, double tms)
Definition: arrays.cpp:381
#define _errorr0
Definition: gelib.h:143
const GPA< const Element > * give_superelems(void) const
Definition: point.h:116
RVType
Result variable type.
Definition: alias.h:194
virtual void initialize(void)
initiate/sets data
Definition: geomcomp.h:94
const CrossSection * give_cs(void) const
Definition: attribute.h:845
void set_dofbc_copy_of(const PointDOFsBCPM *src)
Definition: attribute.h:1050
long give_nRegions(void) const
Definition: geometry.h:330
long give_lid_id(long dom) const
vraci lid of node, pro non-Parallel vraci id
Definition: point.h:275
GPA< const Element > superelems
Definition: point.h:50
virtual void checkConsistency(void) const
Checks data consistency.
Definition: point.cpp:1184
void print_row_VTK(FILE *stream) const
*** READ ***
Definition: point.cpp:367
PoinT * copy(const PoinT *p)
Definition: arrays.h:99
int EntityType_dim2type_jktkT3d(int val)
Conversion from "dimension" to "entity type by t3d and jktk".
Definition: alias.h:332
Array1d *** resultsN
NATIVE RESULTS 2d array of pointers to Xvctr.
Definition: point.h:206
virtual void checkConsistency(void) const
Checks data consistency.
Definition: point.cpp:489
jktk i/o
Definition: alias.h:639
virtual void initialize(void)
initiate/sets data
Definition: point.cpp:484
virtual bool initialize_from(const char *&str, femFileFormat ff, bool all=true)
initialize form input string
Definition: attribute.cpp:1761
void initialize_masters_at_domains(void)
add masters to HN domains
Definition: point.cpp:1116
const Point * give_Pjnt(long i) const
Definition: geometry.h:68
const Dvctr * give_resultsN_dv(long step, ResultTypesAtNode rt) const
Definition: point.cpp:1055
const GPA< const Face > * give_superfaces(void) const
Definition: point.h:115
Problem description.
Definition: problem.h:74
Node(const Geometry *owner, long gid, const PoinT *coo, char attflag='n')
CONSTRUCTOR.
Definition: point.cpp:436
virtual void checkConsistency(void) const
Checks data consistency.
Definition: point.cpp:240
int give_nDOFs(void) const
Definition: attribute.h:1056
displacement, N=ndofs
Definition: alias.h:205
Lvctr eproperty
Definition: point.h:34
void fill_all_by(ArgType *p, long a, ArgType value)
*** *** *** *** FILL TEMPLATES *** *** *** ***
Definition: gelib.h:238
double give_coord(int i) const
Definition: point.h:90
long give_numsuperelem(void) const
Definition: cell.h:187