muMECH  1.0
inclusion.cpp
Go to the documentation of this file.
1 //********************************************************************************************************
2 // code: ### ### ##### #### ## ##
3 // ## ## ######## ## ## ## ## ##
4 // ## ## ## ## ## ### ## ######
5 // ## ## ## ## ## ## ## ## ##
6 // ##### ## ## ##### #### ## ##
7 // ##
8 //
9 // name: inclusion.cpp
10 // author(s): Ladislav Svoboda
11 // language: C, C++
12 // license: This program is free software; you can redistribute it and/or modify
13 // it under the terms of the GNU Lesser General Public License as published by
14 // the Free Software Foundation; either version 2 of the License, or
15 // (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU Lesser General Public License for more details.
21 //
22 // You should have received a copy of the GNU Lesser General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 //********************************************************************************************************
26 
27 #include "inclusion.h"
28 
29 #include "macros.h"
30 #include "matrixOperations.h"
31 #include "problem.h"
32 
33 #include "esuf.h"
34 #include "esuf_Sphere.h"
35 #include "esuf_OblateSpheroid.h"
36 #include "esuf_ProlateSpheroid.h"
37 #include "esuf_Penny.h"
38 #include "esuf_FlatEllipsoid.h"
39 #include "esuf_EllipticCylinder.h"
40 #include "esuf_Cylinder.h"
41 
42 #include "esei.h"
43 #include "esei_Ellipsoid.h"
44 #include "esei_Sphere.h"
45 #include "esei_OblateSpheroid.h"
46 #include "esei_ProlateSpheroid.h"
47 #include "esei_Penny.h"
48 #include "esei_FlatEllipsoid.h"
49 #include "esei_EllipticCylinder.h"
50 #include "esei_Cylinder.h"
51 
52 #include "transformTensors.h"
53 #include "stiffness.h"
54 #include "mesoface.h"
55 
56 #include "matrix_vector.h"
57 #include "gelib.h"
58 #include "tixy2.h"
59 
60 
61 namespace mumech {
62 
63 //using namespace transformTensor;
64 
66 Inclusion :: Inclusion (long i, const Problem *p)
67 {
68  //
69  // INPUT DATA
70  //
71  id = i;
72  this->P = p;
73 
74  shape = IS_VOID;
75  E = nu = 0.0;
76 
77  origin = new double[3]; // 3 coordinates also for 2d in order to print 3 coordinates to vtk file
78 
79  int vr = p->give_VECT_RANGE(); // vector range, 2 or 3
80  int tr = p->give_VM_TENS_RANGE(); // reduced vector range, 3 or 6
81  int ir = p->give_ISO_C_RANGE(); // reduced eshelby tensor, 5 or 12
82 
83  a = new double[vr];
84  eAngles = new double[P->give_EA_RANGE()];
85  //Remote_strains = NULL;
86 
87  //
88  // PRE-COMPUTED DATA, when AF->char = true
89  //
91 
92  noActingIncls = 0;
93  actingIncls = NULL;
94 
95  Epsilon_Tau = NULL;
96 
98  approx_points = NULL;
99  approx_points_eps_tau = NULL;
100  approx_coef = NULL;
101 
103 
104  rotated = true;
105  volume = -1.0;
106 
107  C = new double[ir];
108  S = new double[ir];
109  SInv = new double[ir];
110 
111  //
112  T = new double[vr*vr];
113  TInv = new double[vr*vr];
114  Te = new double[tr*tr];
115  TeInv = new double[tr*tr];
116 }
117 
120 {
121  delete [] origin;
122  delete [] a;
123  delete [] eAngles;
124 
125  // if (Remote_strains != NULL) {
126  // for (int i=0; i<P->give_nlc(); i++)
127  // delete [] Remote_strains[i];
128  //
129  // delete [] Remote_strains;
130  // }
131 
132  delete [] actingIncls;
133 
134  if (C) delete [] C;
135  if (S) delete [] S;
136  if (SInv) delete [] SInv;
137 
138  if (T) delete [] T;
139  if (TInv) delete [] TInv;
140  if (Te) delete [] Te;
141  if (TeInv) delete [] TeInv;
142 
144 
148 }
149 
152 {
153  return ST_scan_array (stream, P->give_EA_RANGE(), this->eAngles);
154 }
157 {
158  if (this->scan_eAngles_RAD(stream) == false) return false;
159 
160  this->EAdeg2rad();
161  return true;
162 }
163 
166 {
167  int nlc = P->give_nLC();
168  if (nlc==0) _errorr("zero nlc");
169 
170  // if (Remote_strains != NULL) _errorr("Remote_strains allocated already");
171  // Remote_strains = new double*[nlc];
172  // for (int i=0; i<nlc; i++)
173  // Remote_strains[i] = new double[P->give_TENS_RANGE()];
174 
175  if (globPert_displc == NULL)
177 
178  if (Epsilon_Tau == NULL) {
180  // termitovo pokud je to mozne, tak to cleanovat az na miste prirazeni
182  }
183 }
184 
186 {
187  if (actingIncls) _errorr("nonzero actingIncls");
188 
189  if (noActingIncls == 0) return;
190 
191  actingIncls = new int[noActingIncls];
192 }
193 
195 int Inclusion :: find_overlap (const Inclusion *incl) const
196 {
197  double epsilon = 1.0e-10;
198 
199  // intersection of circumsribed spheres
200  double axes = this->a[0] + incl->a[0];
201  double dist;
202  if (P->twodim) dist = DIST_POINTS_SQR_2D( this->origin, incl->origin );
203  else dist = DIST_POINTS_SQR_3D( this->origin, incl->origin );
204 
205  if (dist > axes * axes + epsilon) return false;
206 
207  //
208  if (P->twodim) { if (this->shape == IS_CIRCLE && incl->shape == IS_CIRCLE) return true; }
209  else { if (this->shape == IS_SPHERE && incl->shape == IS_SPHERE) return true; }
210 
211  if (P->twodim) return MesoFace::ellipses_overlap ( this, incl );
212  else return MesoFace::ellipsoids_overlap ( this, incl );
213 
214  return 0;
215 }
216 
218 bool Inclusion :: is_inside_of_BB (const double *bb1, const double *bb2) const
219 {
220  if (this->shape != IS_CIRCLE && this->shape != IS_SPHERE) errol;
221 
222  double aa = (1 - 1e-4) * a[0];
223 
224  ; if ( (origin[0] - aa) < bb1[0] || bb2[0] < (origin[0] + aa) ) return false;
225  ; if ( (origin[1] - aa) < bb1[1] || bb2[1] < (origin[1] + aa) ) return false;
226  if (P->twodim == false) if ( (origin[2] - aa) < bb1[2] || bb2[2] < (origin[2] + aa) ) return false;
227 
228  return true;
229 }
230 
231 
232 //
233 // DIRECT API
234 //
235 void Inclusion :: set_centroids (double x, double y) { P->check_dim(2); origin[0] = x; origin[1] = y; origin[2] = 0.0; } // 3. coordinate in order to print 3 coordinates to vtk file
236 void Inclusion :: set_centroids (double x, double y, double z) { P->check_dim(3); origin[0] = x; origin[1] = y; origin[2] = z; }
237 void Inclusion :: set_Semiaxes_dimensions (double x, double y) { P->check_dim(2); a[0] = x; a[1] = y; }
238 void Inclusion :: set_Semiaxes_dimensions (double x, double y, double z) { P->check_dim(3); a[0] = x; a[1] = y; a[2] = z; }
239 void Inclusion :: set_Euller_angles_deg (double x) { P->check_dim(2); eAngles[0] = x; this->EAdeg2rad(); }
240 void Inclusion :: set_Euller_angles_deg (double x, double y, double z) { P->check_dim(3); eAngles[0] = x; eAngles[1] = y; eAngles[2] = z; this->EAdeg2rad(); }
241 //
242 void Inclusion :: set_all_2d (double x, double y, double e, double n, double a1, double a2, double e1)
243 {
244  this->set_centroids(x, y);
245  this->set_Youngs_modulus(e);
246  this->set_Poissons_ratio(n);
247  this->set_Semiaxes_dimensions(a1, a2);
248  this->set_Euller_angles_deg (e1);
249 }
250 void Inclusion :: set_all_3d (double x, double y, double z, double e, double n,
251  double a1, double a2, double a3, double e1, double e2, double e3 )
252 {
253  this->set_centroids(x, y, z);
254  this->set_Youngs_modulus(e);
255  this->set_Poissons_ratio(n);
256  this->set_Semiaxes_dimensions(a1, a2, a3);
257  this->set_Euller_angles_deg (e1, e2, e3);
258 }
259 
260 
261 
262 //void InclusionRecord :: set_Remote_strains_for_lc (int lc, const double *r1)
263 //{
264 // CopyVector(r1, Remote_strains[lc], P->give_TENS_RANGE());
265 //}
266 
268 {
269  if (P->is_converted_to_equivalent() == false) {
270  // conversion infinity axes given in input file by -1.0 to INFTY
271  for (int i=0; i<P->give_VECT_RANGE(); i++)
272  if (a[i] < 0.0) {
273  if (a[i] == -1.0) a[i] = INFTY;
274  else _errorr("negative axis is not equal to -1.0");
275  }
276 
277  // detection of inclusion shape
279  }
280  else {
281  // conversion infinity axes given in input file by -1.0 to INFTY
282  for (int i=0; i<P->give_VECT_RANGE(); i++)
283  if (a[i] < 0.0)
284  _errorr("negative axis");
285 
286  // detection of inclusion shape
287  if (shape == IS_VOID) _errorr("error");
288 
289  //initialize SQR action radii
290  this->SQRactionRadius = SQR( this->actionRadius );
291 
292  TransformTensors::give_TInv (this->TInv, this->T, this->shape);
293  }
294 
295  //
296  rotated = true;
297  if (this->shape == IS_SPHERE || this->shape == IS_CIRCLE)
298  rotated = false;
299  else {
300  if (eAngles[0] == 0.0) rotated = false;
301  if (P->twodim == false)
302  if (eAngles[1] != 0.0 || eAngles[2] != 0.0)
303  rotated = true;
304  }
305 
306  // set the size of the derivative steps
307 
308  // standovo nastaveni
309  // this->ndiff_1 = (this->a[0] + this->a[1] + this->a[2])/3.*0.005;
310  // this->ndiff_2 = this->ndiff_1;
311  // nebo
312  // _NDIFF_H_MULTIPLIER_ = 0.008
313  // if (this->a[2]>0) this->ndiff_1 = this->a[2] * _NDIFF_H_MULTIPLIER_;
314  // else this->ndiff_1 = this->a[1] * _NDIFF_H_MULTIPLIER_;
315 
316  // puvodni hodnoty
317  this->ndiff_1 = 1.0e-4;
318  this->ndiff_2 = this->ndiff_1;
319 
320  // allocate
321  this->allocate_nlc_fields();
322 }
323 
329 bool Inclusion :: point_is_inside (const double *coords, double epsilon) const
330 {
331  double l;
332  double loc[3];
333 
334  // GLOBAL->LOCAL transform of the point coordinates
335  this->transformCoords_G2L(coords, loc);
336 
337  switch (this->shape) {
338  case IS_ELLIPSOID :
339  case IS_SPHERE :
340  //case IS_PENNY :
341  //case IS_FLAT_ELLIPSOID :
342  case IS_OBLATE_SPHEROID :
343  case IS_PROLATE_SPHEROID : l = SQR( loc[0]/a[0] ) + SQR( loc[1]/a[1] ) + SQR( loc[2]/a[2] ); break;
344  //case IS_ELLIPTIC_CYLINDER :
345  //case IS_CYLINDER : l = SQR( loc[1]/a[1] ) + SQR( loc[2]/a[2] ); break;
346 
347  case IS_ELLIPSE :
348  case IS_CIRCLE : l = SQR( loc[0]/a[0] ) + SQR( loc[1]/a[1] ) ; break;
349 
350  default:
351  _errorr( "InclusionRecord :: point_is_inside: unknown inclusion shape\n");
352  }
353 
354  return l <= SQR(1 + epsilon);
355 }//end of function: point_is_inside ()
356 
358 void Inclusion :: transformCoords_G2L (const double *glob, double *loc) const
359 {
360  //swap of coordinate systems
361  SubtractTwoVectors (glob, this->origin, loc, P->give_VECT_RANGE());
362 
363  //rotating of the coordinate system
364  if (rotated)
365  giveMatrixVectorProduct (T, loc, loc, P->give_VECT_RANGE());
366 }
367 
369 void Inclusion :: transformCoords_L2G (const double *loc, double *glob) const
370 {
371  // termitovo tato fce je docasne zbastlena pro ucely approx funkci
372 
373  if (rotated) errol;
374  //MatrixOperations::giveMatrixVectorProduct(TInv, loc, glob, P->give_VECT_RANGE());
375 
376  if (loc == glob) {
377  // termitovo switchnout na :
378  // AddVector(this->origin, glob, P->give_VECT_RANGE());
379  for (int i = 0; i < P->give_VECT_RANGE(); i++)
380  glob[i] += this->origin[i];
381  }
382  else
383  errol;
384 }
385 
387 void Inclusion :: rotateDisplc_L2G (const double *loc, double *glob) const
388 {
389  if (rotated)
390  giveMatrixVectorProduct (this->TInv, loc, glob, P->give_VECT_RANGE());
391  else
392  if (glob != loc) CopyVector (loc, glob, P->give_VECT_RANGE());
393 }
394 
395 
397 void Inclusion :: rotateStrain_G2L (const double *glob, double *loc) const
398 {
399  if (rotated)
400  giveMatrixVectorProduct (this->Te, glob, loc, P->give_VM_TENS_RANGE());
401  else
402  if (glob != loc) CopyVector (glob, loc, P->give_VM_TENS_RANGE());
403 }
405 void Inclusion :: rotateStrain_L2G (const double *loc, double *glob) const
406 {
407  if (rotated)
408  giveMatrixVectorProduct (this->TeInv, loc, glob, P->give_VM_TENS_RANGE() );
409  else
410  if (glob != loc) CopyVector (loc, glob, P->give_VM_TENS_RANGE());
411 }
412 
413 
414 
415 
417 {
418  if( volume < 0.0 )
419  this->computeVolume();
420 
421  return this->volume;
422 }
423 
426 {
427  if (P->approximation == 1 && this->n_approx_points) {
428  for (int j = 0; j < P->give_VM_TENS_RANGE(); j++)
429  this->Epsilon_Tau[strainID][j] = 0.;
430  for (int i = 0; i < this->n_approx_points; i++)
431  for (int j = 0; j < P->give_VM_TENS_RANGE(); j++)
432  this->Epsilon_Tau[strainID][j] += this->approx_points_eps_tau[i][j];
433  for (int j = 0; j < P->give_VM_TENS_RANGE(); j++)
434  this->Epsilon_Tau[strainID][j] /= this->n_approx_points;
435 
436 
437  for (int i = 0; i < P->give_dimension(); i++) {
438  for (int j = 0; j < P->give_VM_TENS_RANGE(); j++)
439  this->approx_coef[strainID][i][j] = 1. / (this->a[i] * P->approx_point_pos1*2.)*(this->approx_points_eps_tau[2 * i + 2][j] - this->approx_points_eps_tau[2 * i + 1][j]);
440  }
441  /*for (int i = 0; i < P->give_dimension(); i++) {
442  for (int j = 0; j < P->give_VM_TENS_RANGE(); j++)
443  printf("%lf ",this->approx_coef[strainID][i][j]);
444  printf("\n");
445  }
446  enter();*/
447  }
448  else if (P->approximation == 2 && this->n_approx_points) {
449  if (P->give_dimension() == 2) {
450  vektor R(6);
451  matice M(6, 6);
452  double x, y, x2, y2, x3, y3, x4, y4;
453  for (int i = 0; i < P->give_VM_TENS_RANGE(); i++) {
454  R.vynulovat();
455  M.vynulovat();
456  /*
457  R=[sum(z.*1);sum(z.*x);sum(z.*y);sum(z.*x.*x);sum(z.*y.*y);sum(z.*x.*y)];
458 
459  M=[ 9 sum(x) sum(y) sum(x.*x) sum(y.*y) sum(x.*y);
460  sum(x) sum(x.*x) sum(x.*y) sum(x.*x.*x) sum(x.*y.*y) sum(x.*x.*y);
461  sum(y) sum(x.*y) sum(y.*y) sum(x.*x.*y) sum(y.*y.*y) sum(x.*y.*y);
462  sum(x.*x) sum(x.*x.*x) sum(x.*x.*y) sum(x.*x.*x.*x) sum(x.*x.*y.*y) sum(x.*x.*x.*y);
463  sum(y.*y) sum(x.*y.*y) sum(y.*y.*y) sum(x.*x.*y.*y) sum(y.*y.*y.*y) sum(x.*y.*y.*y);
464  sum(x.*y) sum(x.*x.*y) sum(x.*y.*y) sum(x.*x.*x.*y) sum(x.*y.*y.*y) sum(x.*x.*y.*y)
465  ]; */
466  for (int j = 0; j < this->n_approx_points; j++) {
467  x = this->approx_points[j][0] - this->origin[0];x2 = x*x;x3 = x*x*x;x4 = x*x*x*x;
468  y = this->approx_points[j][1] - this->origin[1];y2 = y*y;y3 = y*y*y;y4 = y*y*y*y;
469  R.v[0] += this->approx_points_eps_tau[j][i];
470  R.v[1] += this->approx_points_eps_tau[j][i] * x;
471  R.v[2] += this->approx_points_eps_tau[j][i] * y;
472  R.v[3] += this->approx_points_eps_tau[j][i] * x * x;
473  R.v[4] += this->approx_points_eps_tau[j][i] * y * y;
474  R.v[5] += this->approx_points_eps_tau[j][i] * x * y;
475 
476  M.g(0, 0) += 1.;
477  M.g(0, 1) += x;
478  M.g(0, 2) += y;
479  M.g(0, 3) += x2;
480  M.g(0, 4) += y2;
481  M.g(0, 5) += x*y;
482 
483  M.g(1, 0) += x;
484  M.g(1, 1) += x2;
485  M.g(1, 2) += x*y;
486  M.g(1, 3) += x3;
487  M.g(1, 4) += x*y2;
488  M.g(1, 5) += x2*y;
489 
490  M.g(2, 0) += y;
491  M.g(2, 1) += x*y;
492  M.g(2, 2) += y2;
493  M.g(2, 3) += x2*y;
494  M.g(2, 4) += y3;
495  M.g(2, 5) += x*y2;
496 
497  M.g(3, 0) += x2;
498  M.g(3, 1) += x3;
499  M.g(3, 2) += x2*y;
500  M.g(3, 3) += x4;
501  M.g(3, 4) += x2*y2;
502  M.g(3, 5) += x3*y;
503 
504  M.g(4, 0) += y2;
505  M.g(4, 1) += x*y2;
506  M.g(4, 2) += y3;
507  M.g(4, 3) += x2*y2;
508  M.g(4, 4) += y4;
509  M.g(4, 5) += x*y3;
510 
511  M.g(5, 0) += x*y;
512  M.g(5, 1) += x2*y;
513  M.g(5, 2) += x*y2;
514  M.g(5, 3) += x3*y;
515  M.g(5, 4) += x*y3;
516  M.g(5, 5) += x2*y2;
517  }
518 
519  //M.print(stdout);
520  //R.print(stdout);
521  gaussovaEliminace(M, R);
522  //R.print(stdout);
523  //enter();
524  for (int j = 0; j < 5; j++)
525  this->approx_coef[strainID][j][i] = R.v[j+1];
526  this->Epsilon_Tau[strainID][i] = R.v[0];
527  }
528  }
529  }
530  else {
531  _errorr("Not implemented yet.");
532  }
533 
534  /*printf("\nIncl EpsTau:\n");
535  for (int i = 0; i < this->n_approx_points; i++) {
536  //for (int j = 0; j < P->give_VM_TENS_RANGE(); j++)
537  printf("%lf %lf %lf\n", this->approx_points_eps_tau[i][0], this->approx_points_eps_tau[i][1], this->approx_points_eps_tau[i][2]);
538  }*/
539  //enter();
540 }
541 
543 void Inclusion :: Eps02EpsTau (double *e_tau, const double *e_0)
544 {
545  if (P->give_dimension() == 2) {
546  ((InclusionRecord2D*)this)->pointInside = 1;
547  ((InclusionRecord2D*)this)->x[0] = 0.0;
548  ((InclusionRecord2D*)this)->x[1] = 0.0;
549  ((InclusionRecord2D*)this)->compute_matrix_D();
550  }
551  else
552  _errorr("3D not implemented yet.");
553 
555  double m[5], n[5], Cs[5], B[5], e_z[3], e_z_t[3];
556 
557  SubtractTwoVectors(C, P->matrix->C, Cs, 5);
558 
560  AddVector(P->matrix->C, n, 5);
563  MultiplyVector(B, 5, -1.0);
564  //for (int i = 0; i < 3; i++)e_z_t[i] = P->matrix->remote_strains()[strainID][i] + e_z_add[i];
565  rotateStrain_G2L(e_0, e_z);
567 }
568 
569 
572 {
573  for (int i=0; i<P->give_EA_RANGE(); i++)
574  eAngles[i] = DEG2RAD( eAngles[i] );
575 }
576 
577 
578 //local constant and macros definitions
579 //*************************************
580 #define _ACT_RAD_MULT_2d 6. //must be type double
581 #define _ACT_RAD_MULT_3d 6. //must be type double
582 
583 //Macros of the function: giveTransformationStrainOperator:
584 //--------------------------------------------------------
585 #define Power( a, b ) ( ( b == 2 )? SQR( a ) : pow( a, b ) )//because of MATHEMATICA CForm[] syntax
586 //Components of stiffness tensor C
587 /* 1st row */
588 #define L1111 C[__1111_]
589 #define L1122 C[__1122_]
590 #define L1133 C[__1133_]
591 /* 2nd row */
592 #define L2211 C[__2211_]
593 #define L2222 C[__2222_]
594 #define L2233 C[__2233_]
595 /* 3rd row */
596 #define L3311 C[__3311_]
597 #define L3322 C[__3322_]
598 #define L3333 C[__3333_]
599 /* 4th row */
600 #define L1212 C[__1212_]
601 /* 5th row */
602 #define L2323 C[__2323_]
603 /* 6th row */
604 #define L1313 C[__1313_]
605 //Components of stiffness tensor C1
606 /* 1st row */
607 #define Ll1111 C1[__1111_]
608 #define Ll1122 C1[__1122_]
609 #define Ll1133 C1[__1133_]
610 /* 2nd row */
611 #define Ll2211 C1[__2211_]
612 #define Ll2222 C1[__2222_]
613 #define Ll2233 C1[__2233_]
614 /* 3rd row */
615 #define Ll3311 C1[__3311_]
616 #define Ll3322 C1[__3322_]
617 #define Ll3333 C1[__3333_]
618 /* 4th row */
619 #define Ll1212 C1[__1212_]
620 /* 5th row */
621 #define Ll2323 C1[__2323_]
622 /* 6th row */
623 #define Ll1313 C1[__1313_]
624 //Components of the Eshelby tensor
625 /* 1st row */
626 #define S1111 S[__1111_]
627 #define S1122 S[__1122_]
628 #define S1133 S[__1133_]
629 /* 2nd row */
630 #define S2211 S[__2211_]
631 #define S2222 S[__2222_]
632 #define S2233 S[__2233_]
633 /* 3rd row */
634 #define S3311 S[__3311_]
635 #define S3322 S[__3322_]
636 #define S3333 S[__3333_]
637 /* 4th row */
638 #define S1212 S[__1212_]
639 /* 5th row */
640 #define S2323 S[__2323_]
641 /* 6th row */
642 #define S1313 S[__1313_]
643 
644 
646 void Inclusion :: giveTransformationStrainOperator (double oper[12], const double C[12], const double C1[12], const double S[12])
647 {
648  //S[__1133_] = S[__2233_] = S[__3311_] = S[__3322_] = S[__2323_] = S[__1313_] = S[__3333_] = 0.0;
649  //C[__1133_] = C[__2233_] = C[__3311_] = C[__3322_] = C[__2323_] = C[__1313_] = C[__3333_]= 0.0;
650 
651  double
652  B = Power(L1111,3) + 2*Power(L1122,3) - Power(Ll1111 - Ll1122,2)*(Ll1111 + 2*Ll1122)*
655  Power(L1111,2)*(Ll1122*(S1122 + S1133 + S2211 + S2233 + S3311 + S3322) +
656  Ll1111*(S1111 + S2222 + S3333)) +
657  Power(L1122,2)*(Ll1111*(-S1111 + S1122 + S1133 + S2211 - S2222 + S2233 + S3311 + S3322 - S3333) +
658  2*Ll1122*(S1111 + S2222 + S3333)) +
660  S2211*S3322 + S1133*(S2211 - S2222 + S3322) -
661  S1111*(S2233 + S3322) - (S1122 + S2211)*S3333) +
662  2*Ll1122*(S1122*S2211 + S1133*S3311 + S2233*S3322 - S2222*S3333 -
663  S1111*(S2222 + S3333))) -
664  L1111*(3*Power(L1122,2) + L1122*(Ll1111*(S1122 + S1133 + S2211 + S2233 + S3311 + S3322) +
665  Ll1122*(2*S1111 + S1122 + S1133 + S2211 + 2*S2222 + S2233 +
666  S3311 + S3322 + 2*S3333)) +
668  S2222*S3333 - S1111*(S2222 + S3333)) +
670  S2233*S3322 + S1133*(S2211 - S2222 + S3311 + S3322) +
671  S1122*(S2211 + S2233 + S3311 - S3333) - (S2211 + S2222)*S3333 -
672  S1111*(S2222 + S2233 + S3322 + S3333))));
673  //end of euxiliary variable definitions
674 
675  //----------------------------------------------------------------------------------------------------
676  //Components of the @oper tensor:
677  /* 1st row */
678  oper[__1111_] = (-(Power(L1111,2)*Ll1111) + Power(L1122,2)*(Ll1111 - 2*Ll1122) +
679  Power(Ll1111 - Ll1122,2)*(Ll1111 + 2*Ll1122)*(S2233*S3322 - S2222*S3333) +
680  L1122*(Ll1111 - Ll1122)*(Ll1111*(S2233 + S3322) + 2*Ll1122*(S2222 + S3333)) +
681  L1111*(2*L1122*Ll1122 - (Ll1111 - Ll1122)*(Ll1111*(S2222 + S3333) +
682  Ll1122*(S2222 + S2233 + S3322 + S3333))))/B;
683 
684  oper[__1122_] = -((Power(L1122,2)*Ll1111 + Power(L1111,2)*Ll1122 - L1111*
685  (L1122*(Ll1111 + Ll1122) + (Ll1111 - Ll1122)*
686  (Ll1111*S1122 + Ll1122*(S1122 + S1133 + S3322 - S3333))) +
687  L1122*(Ll1111 - Ll1122)*(2*Ll1122*S1122 + Ll1111*(S1133 + S3322 - S3333)) +
688  Power(Ll1111 - Ll1122,2)*(Ll1111 + 2*Ll1122)*(S1133*S3322 - S1122*S3333))/B);
689 
690  oper[__1133_] = (-(Power(L1122,2)*Ll1111) - Power(L1111,2)*Ll1122 +
692  L1122*(Ll1111 - Ll1122)*(2*Ll1122*S1133 + Ll1111*(S1122 - S2222 + S2233)) +
693  L1111*(L1122*(Ll1111 + Ll1122) + (Ll1111 - Ll1122)*
694  (Ll1111*S1133 + Ll1122*(S1122 + S1133 - S2222 + S2233))))/B;
695 
696  //----------------------------------------------------------------------------------------------------
697  /* 2nd row */
698  oper[__2211_] = -((Power(L1122,2)*Ll1111 + Power(L1111,2)*Ll1122 -
699  L1111*(L1122*(Ll1111 + Ll1122) + (Ll1111 - Ll1122)*
700  (Ll1111*S2211 + Ll1122*(S2211 + S2233 + S3311 - S3333))) +
701  L1122*(Ll1111 - Ll1122)*(2*Ll1122*S2211 + Ll1111*(S2233 + S3311 - S3333)) +
702  Power(Ll1111 - Ll1122,2)*(Ll1111 + 2*Ll1122)*(S2233*S3311 - S2211*S3333))/B);
703 
704  oper[__2222_] = -((Power(L1111,2)*Ll1111 - Power(L1122,2)*(Ll1111 - 2*Ll1122) -
705  Power(Ll1111 - Ll1122,2)*(Ll1111 + 2*Ll1122)*(S1133*S3311 - S1111*S3333) -
706  L1122*(Ll1111 - Ll1122)*(Ll1111*(S1133 + S3311) + 2*Ll1122*(S1111 + S3333)) +
707  L1111*(-2*L1122*Ll1122 + (Ll1111 - Ll1122)*
708  (Ll1111*(S1111 + S3333) + Ll1122*(S1111 + S1133 + S3311 + S3333))))/B);
709 
710  oper[__2233_] = -((Power(L1122,2)*Ll1111 + Power(L1111,2)*Ll1122 -
711  L1122*(Ll1111 - Ll1122)*(Ll1111*(S1111 - S1133 - S2211) - 2*Ll1122*S2233) +
712  Power(Ll1111 - Ll1122,2)*(Ll1111 + 2*Ll1122)*(S1133*S2211 - S1111*S2233) -
713  L1111*(L1122*(Ll1111 + Ll1122) + (Ll1111 - Ll1122)*
714  (Ll1111*S2233 + Ll1122*(-S1111 + S1133 + S2211 + S2233))))/B);
715 
716  //----------------------------------------------------------------------------------------------------
717  /* 3rd row */
718  oper[__3311_] = (-(Power(L1122,2)*Ll1111) - Power(L1111,2)*Ll1122 +
720  L1122*(Ll1111 - Ll1122)*(2*Ll1122*S3311 + Ll1111*(S2211 - S2222 + S3322)) +
721  L1111*(L1122*(Ll1111 + Ll1122) + (Ll1111 - Ll1122)*
722  (Ll1111*S3311 + Ll1122*(S2211 - S2222 + S3311 + S3322))))/B;
723 
724  oper[__3322_] = (-(Power(L1122,2)*Ll1111) - Power(L1111,2)*Ll1122 +
725  L1122*(Ll1111 - Ll1122)*(Ll1111*(S1111 - S1122 - S3311) - 2*Ll1122*S3322) -
726  Power(Ll1111 - Ll1122,2)*(Ll1111 + 2*Ll1122)*(S1122*S3311 - S1111*S3322) +
727  L1111*(L1122*(Ll1111 + Ll1122) + (Ll1111 - Ll1122)*
728  (Ll1111*S3322 + Ll1122*(-S1111 + S1122 + S3311 + S3322))))/B;
729 
730  oper[__3333_] = (-(Power(L1111,2)*Ll1111) + Power(L1122,2)*(Ll1111 - 2*Ll1122) +
732  L1122*(Ll1111 - Ll1122)*(Ll1111*(S1122 + S2211) + 2*Ll1122*(S1111 + S2222)) +
733  L1111*(2*L1122*Ll1122 - (Ll1111 - Ll1122)*
734  (Ll1111*(S1111 + S2222) + Ll1122*(S1111 + S1122 + S2211 + S2222))))/B;
735 
736  //----------------------------------------------------------------------------------------------------
737  /* 4th row */
738  oper[__1212_] = -(Ll1212/(L1212 + Ll1212*S1212));
739 
740  //----------------------------------------------------------------------------------------------------
741  /* 5th row */
742  oper[__2323_] = -(Ll1212/(L1212 + Ll1212*S2323));
743 
744  //----------------------------------------------------------------------------------------------------
745  /* 6th row */
746  oper[__1313_] = -(Ll1212/(L1212 + Ll1212*S1313));
747 
748  //----------------------------------------------------------------------------------------------------
749 
750 #ifdef TOM_DEBUG
751  //oper[__1133_] = oper[__2233_] = oper[__3311_] = oper[__3322_] = oper[__2323_] = oper[__1313_] = oper[__3333_] = 0.0;
752 
753  std::cout << "Matice C" << std::endl;
754  for (int i = 0; i < 12; i++)
755  std::cout << "C[" << i << "] = " << C[i] << std::endl;
756  std::cout << std::endl;
757 
758  std::cout << "Matice C* = C1 - C" << std::endl;
759  for (int i = 0; i < 12; i++)
760  std::cout << "C*[" << i << "] = " << C1[i] << std::endl;
761  std::cout << std::endl;
762 
763  std::cout << "Matice S" << std::endl;
764  for (int i = 0; i < 12; i++)
765  std::cout << "S[" << i << "] = " << S[i] << std::endl;
766  std::cout << std::endl;
767 
768  std::cout << "Matice B" << std::endl;
769  for (int i = 0; i < 12; i++)
770  std::cout << "B[" << i << "] = " << oper[i] << std::endl;
771  std::cout << std::endl;
772 #endif
773 
774  return ;
775 } // end of function: giveTransformationStrainOperator( )
776 
778 void Inclusion :: give_EshelbyMatrixFull (double** answer) const
779 {
780 #ifdef DEBUG
781  if (answer == NULL) _errorr( "Field for Eshelby tensor must be allocated" );
782 #endif
783 
786 }
787 
789 void Inclusion :: give_EshelbyMatrixReduced (double* answer) const
790 {
791 #ifdef DEBUG
792  if (answer == NULL) _errorr( "Field for Eshelby tensor must be allocated" );
793 #endif
794 
795  CopyVector(this->S, answer, P->give_ISO_C_RANGE());
796 }
797 
799 void Inclusion :: give_StiffnessMatrixFull (double* answer) const
800 {
801 #ifdef DEBUG
802  if (answer == NULL) _errorr( "Field for Eshelby tensor must be allocated" );
803 #endif
804 
807 }
808 
810 void Inclusion :: give_StiffnessMatrixReduced (double* answer) const
811 {
812 #ifdef DEBUG
813  if (answer == NULL) _errorr( "Field for Eshelby tensor must be allocated" );
814 #endif
815 
816  CopyVector (this->C, answer, P->give_ISO_C_RANGE());
817 }
818 
820 void Inclusion :: give_TeMatrix_G2L (double* answer) const
821 {
822 #ifdef DEBUG
823  if (answer == NULL) _errorr( "Field for Eshelby tensor must be allocated" );
824 #endif
825 
826  CopyVector(this->Te, answer, P->give_VM_TENS_RANGE() * P->give_VM_TENS_RANGE());
827 }
829 void Inclusion :: give_TeMatrix_L2G (double* answer) const
830 {
831 #ifdef DEBUG
832  if (answer == NULL) _errorr( "Field for Eshelby tensor must be allocated" );
833 #endif
834 
835  CopyVector(this->TeInv, answer, P->give_VM_TENS_RANGE() * P->give_VM_TENS_RANGE());
836 }
837 
838 
839 
840 
841 
842 
843 
845 const double** Inclusion :: give_EshelbyPertDisplc_internal (int lc, int nlc, const double *coords)
846 {
847  if (P->twodim) ((InclusionRecord2D*)this)->getDisplacement(coords, globPert_displc, lc, nlc, 1);
848  else ((InclusionRecord3D*)this)->esuf->giveEshelbyDisplacementOfOnePoint (globPert_displc, coords, lc, nlc);
849 
850  return (const double **)globPert_displc;
851 }
853 //void Inclusion :: give_EshelbyPertDisplc_internal (double **displc, int lc, int nlc, const double *coords)
854 //{
855 // CopyArray2D(this->give_EshelbyPertDisplc_internal(lc, nlc, coords), displc, nlc, P->give_VECT_RANGE());
856 //}
857 
858 
859 
861 const double **Inclusion :: give_EshelbyPertStrain_internal (int lc, int nlc)
862 {
863  if (globPert_strain == NULL) {
864  globPert_strain = new double*[P->give_nLC()];
865  memset (globPert_strain, 0, P->give_nLC() * sizeof(double*));
866  }
867 
868  for (int i = lc; i<lc + nlc; i++)
869  if (globPert_strain[i] == NULL) {
870  globPert_strain[i] = new double[P->give_VM_TENS_RANGE()];
871 
873  else MatrixOperations::giveTVproduct_6is6x6to12and6(globPert_strain[i], this->S, ((InclusionRecord3D*)this)->locEigStrain_LC[i]);
874 
876  }
877 
878  return (const double **)globPert_strain + lc;
879 }
881 //void Inclusion :: give_EshelbyPertStrain_internal (double **strain, int lc, int nlc)
882 //{
883 // CopyArray2D(this->give_EshelbyPertStrain_internal(lc, nlc), strain, nlc, P->give_VM_TENS_RANGE());
884 //}
885 
886 
887 
889 const double** Inclusion :: give_EshelbyPertStress_internal (int lc, int nlc)
890 {
891  if (globPert_stress == NULL) {
892  globPert_stress = new double*[P->give_nLC()];
893  memset (globPert_stress, 0, P->give_nLC() * sizeof(double*));
894  }
895 
896  // termitovo tady udela vypocet pres this->C, je to rychlejsi mozna
897  for (int i=lc; i<lc+nlc; i++)
898  if (globPert_stress[i] == NULL) {
899  globPert_stress[i] = new double[P->give_VM_TENS_RANGE()];
900 
901  if (P->twodim) {
902  vektor eps(3);
903 
904  eps.vynulovat();
905  //eps.odecist(((InclusionRecord2D*)this)->Epsilon_Tau[i]);
906  for (int j = 0; j < P->give_VM_TENS_RANGE(); j++)eps.v[j] -= ((InclusionRecord2D*)this)->Epsilon_Tau[i][j];
907  rotate_vector(eps, -((InclusionRecord2D*)this)->eAngles[0]);
908 
909  AddVector (*this->give_EshelbyPertStrain_internal(i, 1), eps.v, 3);
910 
912  }
913  else {
914  double effStrain[6];
915  SubtractTwoVectors (*this->give_EshelbyPertStrain_internal(i, 1), ((InclusionRecord3D*)this)->globEigStrain_LC[i], effStrain, 6);
916 
918  }
919  }
920 
921  return (const double **)globPert_stress+lc;
922 }
923 // ///
924 // void Inclusion :: give_EshelbyPertStress_internal (double **stress, int lc, int nlc)
925 // {
926 // CopyArray2D(this->give_EshelbyPertStress_internal(lc, nlc), stress, nlc, P->give_VM_TENS_RANGE());
927 // }
928 
929 
930 
931 // ///
932 // void Inclusion::add_EshelbyPertDisplc_internal_SIFCM(double **displc, int lc, int nlc, const double *coords, double **e_t_SIFCM) {
933 // errol;
934 // }
935 
936 
938 void Inclusion::add_EshelbyPertStrain_internal_SIFCM(double **strain, int lc, int nlc, double **e_t_SIFCM)
939 {
940  double *globPert_strain_SIFCM = new double[P->give_VM_TENS_RANGE()];
941 
942  for (int i = 0; i < nlc; i++) {
943  if (P->twodim) MatrixOperations::giveTVproduct_3is3x3to5and3 (globPert_strain_SIFCM, this->S, e_t_SIFCM[i]);
944  else MatrixOperations::giveTVproduct_6is6x6to12and6(globPert_strain_SIFCM, this->S, e_t_SIFCM[i]);
945 
946  this->rotateStrain_L2G (globPert_strain_SIFCM, globPert_strain_SIFCM);
947  AddVector(globPert_strain_SIFCM, strain[i], P->give_VM_TENS_RANGE());
948  }
949 
950  delete [] globPert_strain_SIFCM;
951 }
953 void Inclusion::add_EshelbyPertStress_internal_SIFCM(double **stress, int lc, int nlc, double **e_t_SIFCM, double **e_s_ext_add)
954 {
955  double *globPert_stress_SIFCM = new double[P->give_VM_TENS_RANGE()];
956 
957  for (int i = 0; i < nlc; i++) {
958 
959  if (P->twodim) {
960  vektor eps(3);
961  for (int j = 0; j < 3; j++) eps.v[j] = -e_t_SIFCM[i][j];
962 
963  rotate_vector (eps, -((InclusionRecord2D*)this)->eAngles[0]);
964 
965  for (int j = 0; j < 3; j++) eps.v[j] += e_s_ext_add[i][j];
966 
967  MatrixOperations::giveTVproduct_3is3x3to5and3 (globPert_stress_SIFCM, P->matrix->C, eps.v);
968 
969  AddVector(globPert_stress_SIFCM, stress[i], P->give_VM_TENS_RANGE());
970 
971  }
972  else {
973  errol; // tady to neni spravne, ne?
974  //double effStrain[6];
975  //SubtractTwoVectors(*this->give_EshelbyPertStrain_internal(i, 1), ((InclusionRecord3D*)this)->globEigStrain_LC[i], effStrain, 6);
976 
977  //MatrixOperations::giveTVproduct_6is6x6to12and6(globPert_stress_SIFCM, P->matrix->C, effStrain);
978  }
979 
980  }
981 }
982 
983 
984 
986 void Inclusion :: give_EshelbyPertFields_external (Point *point, int lc, int nlc, bool disp, bool strn)
987 {
988  if (P->twodim) {
989  if (strn) ((InclusionRecord2D*)this)->giveExtStrainPert (point->x, point->strain, lc, nlc);
990  if (disp) ((InclusionRecord2D*)this)->getDisplacement (point->x, point->displacement, lc, nlc, 0);
991  }
992  else
993  ((InclusionRecord3D*)this)->esuf->giveEshelbyFieldsOfOnePoint(point, lc, nlc, disp, strn);
994 
995 }
996 
999 {
1000  // ted si tady pocitam nejaky picovinky, Mura ma na tuto energii vzorecek
1001 
1002  // Suplement of the isotropic elastic stiffness tensor of an inclusion stored in reduced form.
1003  double *Cs = new double[P->give_ISO_C_RANGE()];
1004  SubtractTwoVectors (this->C, P->matrix->C, Cs, P->give_ISO_C_RANGE());
1005 
1006  double *stress = new double[P->nstrain_one()];
1007 
1010 
1011 
1012  double E = give_VectorVectorProduct (P->matrix->remote_strains()[lc], stress, P->nstrain_one());
1013  E *= this->give_volume();
1014 
1015  delete [] Cs;
1016 
1017  return E;
1018 }
1019 
1020 
1021 // //********************************************************************************************************
1022 // // description: function prints the record of an inclusion
1023 // // last edit: 02. 03. 2010
1024 // // -------------------------------------------------------------------------------------------------------
1025 // // note: @inclRec - inclusion record of one inclusion
1026 // //********************************************************************************************************
1027 // void inclRecordInit::printInclRecord( InclusionRecord inclRec, const char * notice )
1028 // {
1029 // matrixOperations mtrxOper;
1030 // eshelbySoluUniformField eshSolu;
1031 //
1032 // /*
1033 // if verbose
1034 // double auxMtrx[36] = { 0., 0., 0., 0., 0., 0.,
1035 // 0., 0., 0., 0., 0., 0.,
1036 // 0., 0., 0., 0., 0., 0.,
1037 // 0., 0., 0., 0., 0., 0.,
1038 // 0., 0., 0., 0., 0., 0.,
1039 // 0., 0., 0., 0., 0., 0.,
1040 // };
1041 // double auxVector[6] = { 0., 0., 0., 0., 0., 0. };
1042 //
1043 // mtrxOper.giveMatrixMatrixProduct( inclRec.TeInv, inclRec.Te, auxMtrx, 6 );
1044 // mtrxOper.giveMatrixVectorProduct( inclRec.TeInv, inclRec.locRemoteStrain, auxVector, 6 );
1045 // #endif
1046 // */
1047 //
1048 // printf( "%s", notice );
1049 // printf( "Poisson's ratio: %e\n", inclRec.nu );
1050 // printf( "Young's modulus: %e\n", inclRec.E );
1051 // printf( "Shape: %d\n", ( int ) inclRec.shape );
1052 // mtrxOper.printVectorRowForm( inclRec.origin, 3, "Origin:\n" );
1053 // mtrxOper.printVectorRowForm( inclRec.a, 3, "Semiaxes dimensions:\n" );
1054 // mtrxOper.printVectorRowForm( inclRec.sort_a, 3, "Sorted semiaxes dimensions:\n" );
1055 // mtrxOper.printVectorRowForm( inclRec.eAngles, 3, "Euller angles:\n" );
1056 // mtrxOper.printVectorRowForm( inclRec.globRemoteStrain[0], 6, "Global remote strain field:\n" );
1057 // mtrxOper.printVectorRowForm( inclRec.locRemoteStrain[0], 6, "Local remote strain field:\n" );
1058 // eshSolu.printIsoTensor( inclRec.SInv, "Inverse Eshelby tensor:\n", _STANDARD_SYNTAX_ );
1059 // mtrxOper.printMatrix( inclRec.T, 3, "Global->local vector transformation matrix:\n" );
1060 // mtrxOper.printMatrix( inclRec.TInv, 3, "Local->global vector transformation matrix:\n" );
1061 // mtrxOper.printMatrix( inclRec.Te, 6, "Global->local strain tensor transformation matrix:\n" );
1062 // mtrxOper.printMatrix( inclRec.TeInv, 6, "Local->global strain tensor transformation matrix:\n" );
1063 // /*
1064 // if verbose
1065 // mtrxOper.printMatrix( auxMtrx, 6, "debug: Te * TeInv (suppose to be unit matrix):\n" );
1066 // mtrxOper.printVectorRowForm( auxVector, 6, "debug: Global remote strain field:\n" );
1067 // #endif
1068 // */
1069 // printf( "Action radius: %e\n", inclRec.actionRadius );
1070 // printf( "Number of acting inclusions: %d\n", inclRec.noActingIncls );
1071 // mtrxOper.printVectorRowForm( inclRec.actingIncls, inclRec.noActingIncls,
1072 // "Numbers of acting inclusions:\n" );
1073 // eshSolu.printIsoTensor( inclRec.C, "Total stifness matrix:\n", _STANDARD_SYNTAX_ );
1074 // mtrxOper.printVectorRowForm( inclRec.locEigStrain[0], 6, "Initial local equivalent eigenstrain:\n" );
1075 // mtrxOper.printVectorRowForm( inclRec.globEigStrain[0], 6, "Initial global equivalent eigenstrain:\n" );
1076 // mtrxOper.printVectorRowForm( inclRec.globEigStrainTotal[0], 6, "Initial total global equivalent eigenstrain:\n" );
1077 //
1078 // return ;
1079 // }//end of function: printInclRecord( )
1080 
1081 
1082 
1083 
1084 
1085 
1086 
1087 
1088 
1089 // ***********************************************************************************************************
1090 // *** 3D INCLUSION RECORD ***
1091 // ***********************************************************************************************************
1092 
1095 {
1097  ellInt = NULL;
1098  esuf = NULL;
1099 }
1100 
1103 {
1106 
1107  delete ellInt;
1108  delete esuf;
1109 }
1110 
1113 {
1114  if (locEigStrain_LC == NULL) this->allocate_nlc_fields ();
1115  return ST_scan_array (stream, P->give_VM_TENS_RANGE(), this->locEigStrain_LC[lc]);
1116 }
1119 {
1120  if (globEigStrain_LC == NULL) this->allocate_nlc_fields ();
1121  return ST_scan_array (stream, P->give_VM_TENS_RANGE(), this->globEigStrain_LC[lc]);
1122 }
1123 
1126 {
1127  switch(shape) {
1128  case IS_ELLIPSOID :
1129  case IS_SPHERE :
1130  //case IS_PENNY :
1131  //case IS_FLAT_ELLIPSOID :
1132  case IS_OBLATE_SPHEROID :
1133  case IS_PROLATE_SPHEROID :
1134  this->volume = 4.0/3.0 * PI * a[0] * a[1] * a[2];
1135  break;
1136  //case IS_ELLIPTIC_CYLINDER :
1137  //case IS_CYLINDER :
1138  // _errorr( "Not yet defined" );
1139  // break;
1140  default:
1141  _errorr( "Undefined shape" );
1142  break;
1143  }
1144 }
1145 
1146 
1149 {
1151 
1152  int nlc = P->give_nLC();
1153  if (nlc==0) _errorr("zero nlc");
1154 
1155  if (locEigStrain_LC == NULL) {
1156  // termitovo predelat na fci AllocateArray..
1157  locEigStrain_LC = new double*[nlc];
1158  for (int i=0; i<nlc; i++)
1159  locEigStrain_LC [i] = new double[P->give_VM_TENS_RANGE()];
1160  }
1161 
1162  if (globEigStrain_LC == NULL) {
1163  globEigStrain_LC = new double*[nlc];
1164  for (int i=0; i<nlc; i++)
1165  globEigStrain_LC [i] = new double[P->give_VM_TENS_RANGE()];
1166  }
1167 }
1168 
1171 {
1172  InclusionGeometry shp_n;
1173 
1174  double min = P->give_semiaxes_min_difference();
1175  double max = P->give_semiaxes_max_difference();
1176 
1177  bool chmin = P->give_semiaxis_min_difference_change();
1178  //termitovo ne co chmax?? bool chmax = P->give_semiaxis_max_difference_change();
1179 
1180  //semiaxes definition and initialization: a1 > a2 > a3
1181  double a1 = a[0], a2 = a[1], a3 = a[2];
1182 
1183  if (a1 < a2 || a2 < a3) _errorr("semiaxes not sorted");
1184  if (a1 < 0.0) _errorr("negative semiaxis");
1185 
1186  if (shp_o) {
1187  switch (shp_o) {
1188  case IS_ELLIPSOID: if (!( a1 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is infinite", this->id+1, IST_e2s (shp_o));
1189  if (!( a2 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 2. axis is infinite", this->id+1, IST_e2s (shp_o));
1190  if (!( a3 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 3. axis is infinite", this->id+1, IST_e2s (shp_o));
1191  if (!( a1 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is 0.0", this->id+1, IST_e2s (shp_o));
1192  if (!( a2 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 2. axis is 0.0", this->id+1, IST_e2s (shp_o));
1193  if (!( a3 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 3. axis is 0.0", this->id+1, IST_e2s (shp_o));
1194  if (!( a1 > a2)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is not bigger then 2. one", this->id+1, IST_e2s (shp_o));
1195  if (!( a2 > a3)) _errorr3("inclusion %ld with prescribed %s shape: 2. axis is not bigger then 3. one", this->id+1, IST_e2s (shp_o));
1196  break;
1197  case IS_SPHERE: if (!( a1 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is infinite", this->id+1, IST_e2s (shp_o));
1198  if (!( a1 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is 0.0", this->id+1, IST_e2s (shp_o));
1199  if (!( a1 == a2)) _errorr3("inclusion %ld with prescribed %s shape: 1. and 2. axes are not equal", this->id+1, IST_e2s (shp_o));
1200  if (!( a2 == a3)) _errorr3("inclusion %ld with prescribed %s shape: 2. and 3. axes are not equal", this->id+1, IST_e2s (shp_o));
1201  break;
1202  case IS_OBLATE_SPHEROID: if (!( a1 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is infinite", this->id+1, IST_e2s (shp_o));
1203  if (!( a3 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 3. axis is infinite", this->id+1, IST_e2s (shp_o));
1204  if (!( a1 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is 0.0", this->id+1, IST_e2s (shp_o));
1205  if (!( a3 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 3. axis is 0.0", this->id+1, IST_e2s (shp_o));
1206  if (!( a1 == a2)) _errorr3("inclusion %ld with prescribed %s shape: 1. and 2. axes are not equal", this->id+1, IST_e2s (shp_o));
1207  if (!( a1 > a3)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is not bigger then 3. one", this->id+1, IST_e2s (shp_o));
1208  break;
1209  case IS_PROLATE_SPHEROID: if (!( a1 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is infinite", this->id+1, IST_e2s (shp_o));
1210  if (!( a2 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 2. axis is infinite", this->id+1, IST_e2s (shp_o));
1211  if (!( a1 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is 0.0", this->id+1, IST_e2s (shp_o));
1212  if (!( a2 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 2. axis is 0.0", this->id+1, IST_e2s (shp_o));
1213  if (!( a1 > a2)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is not bigger then 2. one", this->id+1, IST_e2s (shp_o));
1214  if (!( a2 == a3)) _errorr3("inclusion %ld with prescribed %s shape: 2. and 3. axes are not equal", this->id+1, IST_e2s (shp_o));
1215  break;
1216  //case IS_ELLIPTIC_CYLINDER: if (!( a1 == INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is not infinite", this->id+1, IST_e2s (shp_o));
1217  // if (!( a2 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 2. axis is infinite", this->id+1, IST_e2s (shp_o));
1218  // if (!( a3 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 3. axis is infinite", this->id+1, IST_e2s (shp_o));
1219  // if (!( a2 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 2. axis is 0.0", this->id+1, IST_e2s (shp_o));
1220  // if (!( a3 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 3. axis is 0.0", this->id+1, IST_e2s (shp_o));
1221  // if (!( a2 > a3)) _errorr3("inclusion %ld with prescribed %s shape: 2. axis is not bigger then 3. one", this->id+1, IST_e2s (shp_o));
1222  // break;
1223  //case IS_CYLINDER: if (!( a1 == INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is not infinite", this->id+1, IST_e2s (shp_o));
1224  // if (!( a2 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 2. axis is infinite", this->id+1, IST_e2s (shp_o));
1225  // if (!( a2 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 2. axis is 0.0", this->id+1, IST_e2s (shp_o));
1226  // if (!( a2 == a3)) _errorr3("inclusion %ld with prescribed %s shape: 2. and 3. axes are not equal", this->id+1, IST_e2s (shp_o));
1227  // break;
1228  //case IS_PENNY: if (!( a1 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is infinite", this->id+1, IST_e2s (shp_o));
1229  // if (!( a1 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is 0.0", this->id+1, IST_e2s (shp_o));
1230  // if (!( a1 == a2)) _errorr3("inclusion %ld with prescribed %s shape: 1. and 2. axes are not equal", this->id+1, IST_e2s (shp_o));
1231  // if (!( a3 == 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 3. axis is not 0.0", this->id+1, IST_e2s (shp_o));
1232  // break;
1233  //case IS_FLAT_ELLIPSOID: if (!( a1 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is infinite", this->id+1, IST_e2s (shp_o));
1234  // if (!( a2 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 2. axis is infinite", this->id+1, IST_e2s (shp_o));
1235  // if (!( a1 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is 0.0", this->id+1, IST_e2s (shp_o));
1236  // if (!( a2 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 2. axis is 0.0", this->id+1, IST_e2s (shp_o));
1237  // if (!( a1 > a2)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is not bigger then 2. one", this->id+1, IST_e2s (shp_o));
1238  // if (!( a3 == 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 3. axis is not 0.0", this->id+1, IST_e2s (shp_o));
1239  // break;
1240  default: _errorr2("Not supported inclusion shape %s", IST_e2s (shp_o));
1241  }
1242  }
1243 
1244  // detection of the shape with stable analysis
1245  // a1 = 0
1246  if (a1 == 0.0) _errorr2("inclusion %ld: zero 1. axis - unsupported", this->id+1);
1247  // a1 = infty
1248  else if (a1 == INFTY) {
1249  // a2 = 0
1250  if (a2 == 0.0) _errorr2("inclusion %ld: infinity 1. axis and zero 2. axis - unsupported ", this->id+1);
1251  // a2 = a1
1252  else if (a2 == INFTY) _errorr2("inclusion %ld: infinity 1. axis and infinity 2. axis - unsupported", this->id+1);
1253  // a2 = any
1254  else {
1255  // a3 = 0
1256  if (a3 < max*a2) _errorr2("inclusion %ld: infinity 1. axis and zero 3. axis - unsupported ", this->id+1);
1257  // a3 = a2
1258  else if (a2 - a3 < min*a2) errol; //shp_n = IS_CYLINDER;
1259  // a3 = any
1260  else errol; //shp_n = IS_ELLIPTIC_CYLINDER;
1261  }
1262  }
1263  // a1 = any
1264  else {
1265  // a2 = 0.0
1266  if (a2 < max*a1) _errorr2("inclusion %ld: any 1. axis and zero 2. axis - unsupported ", this->id+1);
1267  // a2 = a1
1268  else if (a1 - a2 < min*a1) {
1269  // a3 = 0
1270  if (a3 < max*a2) errol; //shp_n = IS_PENNY;
1271  // a3 = a2
1272  else if (a2 - a3 < min*a2) shp_n = IS_SPHERE;
1273  // a3 = any
1274  else shp_n = IS_OBLATE_SPHEROID;
1275  }
1276  // a2 = any
1277  else {
1278  // a3 = 0
1279  if (a3 < max*a2) shp_n = IS_ELLIPSOID;
1280  // a3 = a2
1281  else if (a2 - a3 < min*a2) shp_n = IS_PROLATE_SPHEROID;
1282  // a3 = any
1283  else shp_n = IS_ELLIPSOID;
1284  }
1285  }
1286 
1287  // Toto se musi promyslet, ktere konkretni kombinace tvaru mohou tvarove degenerovat.
1288  //
1289  if (shp_o) {
1290  if (shp_o != shp_n) {
1291  switch (shp_n) {
1292  case IS_SPHERE:
1293  if (chmin) {
1294  if (shp_o == IS_ELLIPSOID) {
1295  _warningg3("inclusion %ld with prescribed %s shape: shape is different - it was changed", this->id+1, IST_e2s (shp_o));
1296  return shp_n;
1297  }
1298  else _errorr3("inclusion %ld with prescribed %s shape: unsupported shape conversion", this->id+1, IST_e2s (shp_o));
1299  }
1300  else { _warningg("shape is different"); return shp_o; }
1301  break;
1302  default: _errorr2("Not supported inclusion shape %s", IST_e2s (shp_o));
1303  }
1304  }
1305  else
1306  return shp_o;
1307  }
1308  else
1309  return shp_n;
1310 
1311  _errorr("return have to be used above");
1312  return IS_VOID;
1313 }
1314 
1317 {
1319 
1320  if (P->is_converted_to_equivalent() == false) {
1321  ;
1322  }
1323  else {
1324  ;
1325  }
1326 
1327  if (this->ellInt) errol;
1328  switch (this->shape) {
1329  case IS_ELLIPSOID : ellInt = new eshelbySoluEllipticIntegralsEllipsoid(this); break;
1330  case IS_SPHERE : ellInt = new eshelbySoluEllipticIntegralsSphere(this); break;
1333  //case IS_ELLIPTIC_CYLINDER : ellInt = new eshelbySoluEllipticIntegralsEllipticCylinder(this); break;
1334  //case IS_CYLINDER : ellInt = new eshelbySoluEllipticIntegralsCylinder(this); break;
1335  //case IS_PENNY : ellInt = new eshelbySoluEllipticIntegralsPenny(this); break;
1336  //case IS_FLAT_ELLIPSOID : ellInt = new eshelbySoluEllipticIntegralsFlatEllipsoid(this); break;
1337  default:
1338  _errorr( "Unknown shape of inclusion " );
1339  }
1340 
1341  if (this->esuf) errol;
1342  switch (this->shape) {
1343  case IS_ELLIPSOID : esuf = new eshelbySoluUniformField(this); break;
1344  case IS_SPHERE : esuf = new eshelbySoluUniformFieldSphere(this); break;
1347  //case IS_ELLIPTIC_CYLINDER : esuf = new eshelbySoluUniformFieldEllipticCylinder(this); break;
1348  //case IS_CYLINDER : esuf = new eshelbySoluUniformFieldCylinder(this); break;
1349  //case IS_PENNY : esuf = new eshelbySoluUniformFieldPenny(this); break;
1350  //case IS_FLAT_ELLIPSOID : esuf = new eshelbySoluUniformFieldFlatEllipsoid(this); break;
1351  default:
1352  _errorr( "Unknown shape of inclusion " );
1353  }
1354 }
1355 
1358 {
1359  const InclusionRecord3D *prevInclRec3D;
1360 
1361  if (prevInclRec) {
1362  prevInclRec3D = dynamic_cast<const InclusionRecord3D*>(prevInclRec);
1363  if (!prevInclRec3D) _errorr("");
1364  }
1365  else
1366  prevInclRec3D = NULL;
1367 
1368  // elliptical Ferers-Dyson potentials of internal points
1369  this->ellInt->giveEllipticIntegrals (this->eInt, 0., true);
1370 
1371  // Eshelby tensor
1372  //eshSolu.giveEshelbyTensor( this->inclRec[i].S, this->inclRec[i].sort_a, this->inclRec[i].nu,
1373  //this->inclRec[i].eInt, this->inclRec[i].shape ); // ORIGINAL CODE. Bug?
1374  this->esuf->giveEshelbyTensor (this->S, this->eInt);
1375 
1376  // inverse of the Eshelby tensor
1377  this->esuf->giveEshelbyTensorInverse (this->SInv, this->S);
1378  // global->local transformation matrices
1379  TransformTensors::give_T (this->T, this->eAngles, _ZXZ_, this->shape);
1380  TransformTensors::give_Te(this->Te, this->T, this->shape);
1381 
1382  //local->global transformation matrices
1383  TransformTensors::give_TInv (this->TInv, this->T, this->shape);
1384  TransformTensors::give_TeInv(this->TeInv, this->Te, this->shape);
1385 
1386  // initialize action radii
1387  this->actionRadius = _ACT_RAD_MULT_3d * this->a[0];
1388  this->SQRactionRadius = SQR( this->actionRadius );
1389 
1390  // total and complementary stifness of inclusion
1391  if (prevInclRec3D && prevInclRec3D->E == this->E && prevInclRec3D->nu == this->nu)
1392  // convenient if identical stiffnesses in few sets
1393  CopyVector (prevInclRec3D->C, this->C, 12);
1394  else
1395  Stiffness::giveReducedIsoStiffMatrix (this->C, this->E, this->nu, false);
1396 
1397 #ifdef TOM_DEBUG
1398  std::cout << "Matice B" << std::endl;
1399  std::cout << inclRec[0].transfTensOper[4] << std::endl;
1400  std::cout << inclRec[0].transfTensOper[5] << std::endl;
1401  std::cout << inclRec[0].transfTensOper[7] << std::endl;
1402  std::cout << inclRec[0].transfTensOper[8] << std::endl;
1403  std::cout << inclRec[0].transfTensOper[10] << std::endl;
1404  std::cout << std::endl;
1405 
1406  std::cout << "LocRemoteStrain" << std::endl;
1407  for (int i = 0; i < 6; i++)
1408  std::cout << "[" << i << "]" << inclRec[0].locRemoteStrain[0][i] << std::endl;
1409  std::cout << std::endl;
1410 
1411  std::cout << "LocEigStrain" << std::endl;
1412  for (int i = 0; i < 6; i++)
1413  std::cout << "[" << i << "]" << inclRec[0].locEigStrain[0][i] << std::endl;
1414  std::cout << std::endl;
1415  std::cout << std::endl;
1416 #endif
1417 
1418 }
1419 
1420 
1427 {
1428  double locRemoteStrain[6];
1429 
1430  // Local remote strain initialization.
1431  this->rotateStrain_G2L(P->matrix->Remote_strain[lc], locRemoteStrain);
1432 
1433 
1434  double Cs[12];
1435  SubtractTwoVectors (this->C, P->matrix->C, Cs, 12);
1436 
1438  double B[12];
1439 
1440 
1441  this->giveTransformationStrainOperator (B, P->matrix->C, Cs, this->S);
1442 
1443 
1444 
1445  // Local transformation eigenstrain this->locEigStrain initialization.
1446  // A transformation eigenstrain is given by the remote strain applied to an infinite matrix surrounding each inclusion.
1447  // Matrix-vector multiplication B(6x6) * eps(6x1). Matrix B is in the same form as material stiffness matrix.
1449 
1450  // Global transformation eigenstrain initialization.
1451  this->rotateStrain_L2G(this->locEigStrain, this->globEigStrainTotal);
1452 
1453  return ;
1454 }//end of function: updateStrainsInInclRecord( )
1455 
1456 
1462 {
1463  double auxStrain[6] = { 0., 0., 0., 0., 0., 0. };
1464 
1465  //local strain preturbation
1466  this->rotateStrain_G2L(point->strain[0], auxStrain);
1467 
1468  //calculation of local transformation strain
1470 
1471  AddVector(auxStrain, locEigStrainTot, 6);
1472 
1473  return;
1474 }//end of function: updateGlobAndLocStrainsInInclRecord( )
1475 
1478 {
1480 
1481  //calculation of global transformation strain
1483 
1484  //final update of global total transformation strain
1486 }
1487 
1488 
1490 bool InclusionRecord3D :: point_is_affected (const double *point) const
1491 {
1492  double rx = this->origin[0] - point[0];
1493  double ry = this->origin[1] - point[1];
1494  double rz = this->origin[2] - point[2];
1495 
1496  if ( ABS( rx ) < this->actionRadius &&
1497  ABS( ry ) < this->actionRadius &&
1498  ABS( rz ) < this->actionRadius ) {
1499  double r = VEC_SQR_NORM_3D( rx, ry, rz );
1500  if (r <= this->SQRactionRadius)
1501  return true;
1502  }
1503 
1504  return false;
1505 }
1506 
1507 
1510 {
1513 }
1514 
1515 
1516 // ***********************************************************************************************************
1517 // *** 2D ONLY - START 2D INCLUSION RECORD ***
1518 // ***********************************************************************************************************
1519 
1522 {
1523  // for standa: dusledne tady vse vynulovat, a porovnat jako v .h
1524  x[0]=0.0;
1525  x[1]=0.0;
1526  x_last_derivation[0] = 0.0;
1527  x_last_derivation[1] = 0.0;
1528  x_last_IS[0] = 0.0;
1529  x_last_IS[1] = 0.0;
1530  lambda=0.0;
1531  h=0.0;
1532  H=0.0;
1533  D.define(3,3);
1534  L.define(2, 3);
1535  Sext.define(3,3);
1536  e_t.define(3);
1537 
1538  delta_e_s.define(3);
1539  delta_e_t.define(3);
1541  any_IS_computed = false;
1542 }
1543 
1546 {
1547 
1548 }
1549 
1552 {
1553  if (Epsilon_Tau == NULL) this->allocate_nlc_fields ();
1554  return ST_scan_array (stream, P->give_VM_TENS_RANGE(), this->Epsilon_Tau[lc]);
1555 }
1556 
1557 
1560 {
1562 }
1563 
1564 
1567 {
1568  InclusionGeometry shp_n;
1569 
1570  double min = P->give_semiaxes_min_difference();
1571  double max = P->give_semiaxes_max_difference();
1572 
1573  bool chmin = P->give_semiaxis_min_difference_change();
1574  // termitovo: na co toto? bool chmax = P->give_semiaxis_max_difference_change();
1575 
1576  //semiaxes definition and initialization: a1 > a2 > a3
1577  double a1 = a[0], a2 = a[1];
1578 
1579  if (a1 < a2) _errorr("semiaxes not sorted");
1580  if (a1 < 0.0) _errorr("negative semiaxis");
1581 
1582  if (shp_o) {
1583  switch (shp_o) {
1584  case IS_ELLIPSE: if (!( a1 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is infinite", this->id+1, IST_e2s (shp_o));
1585  if (!( a2 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 2. axis is 0.0", this->id+1, IST_e2s (shp_o));
1586  if (!( a1 > a2)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is not bigger then 2. one", this->id+1, IST_e2s (shp_o));
1587  break;
1588  case IS_CIRCLE: if (!( a1 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is infinite", this->id+1, IST_e2s (shp_o));
1589  if (!( a1 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is 0.0", this->id+1, IST_e2s (shp_o));
1590  if (!( a1 == a2)) _errorr3("inclusion %ld with prescribed %s shape: 1. and 2. axes are not equal", this->id+1, IST_e2s (shp_o));
1591  break;
1592  //case IS_STRIP: if (!( a1 == INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is not infinite", this->id+1, IST_e2s (shp_o));
1593  // if (!( a2 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 2. axis is infinite", this->id+1, IST_e2s (shp_o));
1594  // if (!( a2 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 2. axis is 0.0", this->id+1, IST_e2s (shp_o));
1595  // break;
1596  //case IS_CRACK: if (!( a1 < INFTY)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is infinite", this->id+1, IST_e2s (shp_o));
1597  // if (!( a1 > 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 1. axis is 0.0", this->id+1, IST_e2s (shp_o));
1598  // if (!( a2 == 0.0)) _errorr3("inclusion %ld with prescribed %s shape: 3. axis is not 0.0", this->id+1, IST_e2s (shp_o));
1599  // break;
1600  default: _errorr2("Not supported inclusion shape %s", IST_e2s (shp_o));
1601  }
1602  }
1603 
1604  // detection of the shape with stable analysis
1605  // a1 = 0
1606  if (a1 == 0.0) _errorr2("inclusion %ld: zero 1. axis - unsupported", this->id+1);
1607  // a1 = infty
1608  else if (a1 == INFTY) {
1609  // a2 = 0
1610  if (a2 == 0.0) _errorr2("inclusion %ld: infinity 1. axis and zero 2. axis - unsupported ", this->id+1);
1611  // a2 = a1
1612  else if (a2 == INFTY) _errorr2("inclusion %ld: infinity 1. axis and infinity 2. axis - unsupported", this->id+1);
1613  // a2 = any
1614  else errol; //shp_n = IS_STRIP;
1615  }
1616  // a1 = any
1617  else {
1618  // a2 = 0
1619  if (a2 < max*a1) errol; //shp_n = IS_CRACK;
1620  // a2 = a1
1621  else if (a1 - a2 < min*a1) shp_n = IS_CIRCLE;
1622  // a2 = any
1623  else shp_n = IS_ELLIPSE;
1624  }
1625 
1626  // Toto se musi promyslet, ktere konkretni kombinace tvaru mohou tvarove degenerovat.
1627  //
1628  if (shp_o) {
1629  if (shp_o != shp_n) {
1630  switch (shp_n) {
1631  case IS_CIRCLE:
1632  if (chmin) {
1633  if (shp_o == IS_ELLIPSE) {
1634  _warningg3("inclusion %ld with prescribed %s shape: shape is different - it was changed", this->id+1, IST_e2s (shp_o));
1635  return shp_n;
1636  }
1637  else _errorr3("inclusion %ld with prescribed %s shape: unsupported shape conversion", this->id+1, IST_e2s (shp_o));
1638  }
1639  else { _warningg("shape is different"); return shp_o; }
1640  break;
1641  default: _errorr2("Not supported inclusion shape %s", IST_e2s (shp_o));
1642  }
1643  }
1644  else
1645  return shp_o;
1646  }
1647  else
1648  return shp_n;
1649 
1650  _errorr("");
1651  return IS_VOID;
1652 }
1653 
1656 {
1658 
1659  if (P->is_converted_to_equivalent() == false) {
1660  ;
1661  }
1662  else {
1663  ;
1664  }
1665 
1666  this->h = this->derivative_step(100000000);
1667  this->H = this->derivative_step(10000);
1668 }
1669 
1672 {
1673  const InclusionRecord2D *prevInclRec2D;
1674 
1675  if (prevInclRec) {
1676  prevInclRec2D = dynamic_cast<const InclusionRecord2D*>(prevInclRec);
1677  if (!prevInclRec2D) _errorr("");
1678  }
1679  else
1680  prevInclRec2D = NULL;
1681 
1682 
1684 
1685  //
1686  if (prevInclRec2D != NULL && prevInclRec2D->E == this->E && prevInclRec2D->nu == this->nu){
1687  CopyVector (prevInclRec2D->C, this->C, 5);
1688  }
1689  else
1690  Stiffness::giveReducedIsoStiffMatrix (this->C, this->E, this->nu, true);
1691 
1692  this->compute_S_int();
1693 
1694  // global->local transformation matrices
1695  TransformTensors::give_T (this->T, this->eAngles, _NONE_, this->shape);
1696  TransformTensors::give_Te(this->Te, this->T, this->shape);
1697 
1698  //local->global transformation matrices
1699  TransformTensors::give_TInv (this->TInv, this->T, this->shape);
1700  TransformTensors::give_Te (this->TeInv, this->TInv, this->shape);
1701 }
1702 
1705 {
1706  this->compute_initial_eps_tau(lc);
1707  CopyVector(this->e_t.v, this->Epsilon_Tau[lc], P->give_VM_TENS_RANGE());
1708  this->delta_e_t.rovna_se(this->e_t);
1709 }
1710 
1711 
1713 bool InclusionRecord2D :: point_is_affected (const double *point) const
1714 {
1715  return ( VEC_SQR_NORM_2D ( origin[0] - point[0], origin[1] - point[1] ) <= this->actionRadius * this->actionRadius );
1716 }
1717 
1720 {
1721  if (x_last_IS[0] != x[0] || x_last_IS[1] != x[1] || any_IS_computed == false){
1722  compute_I_S();
1723  x_last_IS[0] = x[0];
1724  x_last_IS[1] = x[1];
1725  any_IS_computed = true;
1726  }
1727  if(index==1111)return Sext.g(0,0);
1728  if(index==2222)return Sext.g(1,1);
1729  if(index==1122)return Sext.g(0,1);
1730  if(index==2211)return Sext.g(1,0);
1731  if(index==1212)return Sext.g(2,2);
1732  return 0.0;
1733 }
1734 
1736 double InclusionRecord2D :: I(int index)
1737 {
1738  if (x_last_IS[0] != x[0] || x_last_IS[1] != x[1] || any_IS_computed == false){
1739  compute_I_S();
1740  x_last_IS[0] = x[0];
1741  x_last_IS[1] = x[1];
1742  any_IS_computed = true;
1743  }
1744  if(index==1)return I1;
1745  if(index==2)return I2;
1746  if(index==11)return I11;
1747  if(index==22)return I22;
1748  if(index==12 || index==21)return I12;
1749  return 0.0;
1750 }
1751 
1754 {
1755  if(delitel==0)delitel=1000000;
1756  if(a[0]<a[1]){return a[0]/delitel;}else{return a[1]/delitel;}
1757 }
1758 
1761 {
1762  int i;
1763  P_a[0].x[0]=x[0]; P_a[0].x[1]=x[1]+h;
1764  P_a[1].x[0]=x[0]+h; P_a[1].x[1]=x[1];
1765  P_b[0].x[0]=x[0]-H; P_b[0].x[1]=x[1]+H;
1766  P_b[1].x[0]=x[0]; P_b[1].x[1]=x[1]+H;
1767  P_b[2].x[0]=x[0]+H; P_b[2].x[1]=x[1]+H;
1768  P_b[3].x[0]=x[0]-H; P_b[3].x[1]=x[1];
1769  P_b[4].x[0]=x[0]+H; P_b[4].x[1]=x[1];
1770  P_b[5].x[0]=x[0]-H; P_b[5].x[1]=x[1]-H;
1771  P_b[6].x[0]=x[0]; P_b[6].x[1]=x[1]-H;
1772  P_b[7].x[0]=x[0]+H; P_b[7].x[1]=x[1]-H;
1773  for(i=0;i<8;i++){
1774  P_b[i].a[0]=a[0];
1775  P_b[i].a[1]=a[1];
1776  }
1777  for(i=0;i<2;i++){
1778  P_a[i].a[0]=a[0];
1779  P_a[i].a[1]=a[1];
1780  }
1781  for(i=0;i<8;i++)P_b[i].spocitat();
1782  for(i=0;i<2;i++)P_a[i].spocitat();
1783 }
1784 
1785 // Pa: 0
1786 // X 1
1787 //
1788 // Pb: 0 1 2
1789 // 3 X 4
1790 // 5 6 7
1791 
1793 double InclusionRecord2D :: dI(int index,int smer1,int smer2)
1794 {
1795  if (P->diffType != DT_NUMERICAL)_errorr("Only numerical derivation is available.");
1796  if (pointInside)return 0.0;
1797  if (x_last_derivation[0] != x[0] || x_last_derivation[1] != x[1] || any_derivative_preparation_computed == false){
1799  x_last_derivation[0] = x[0];
1800  x_last_derivation[1] = x[1];
1802  }
1803  if(smer2==0){
1804  if(smer1==1)return (P_a[1].I(index)-I(index))/(h);
1805  if(smer1==2)return (P_a[0].I(index)-I(index))/(h);
1806  }
1807  else{
1808  if(smer1==smer2){
1809  if(smer1==1)return ( P_b[4].I(index) - 2.*I(index) + P_b[3].I(index) )/(H*H);
1810  if(smer1==2)return ( P_b[1].I(index) - 2.*I(index) + P_b[6].I(index) )/(H*H);
1811  }
1812  else{
1813  return (P_b[2].I(index)+P_b[5].I(index)-P_b[0].I(index)-P_b[7].I(index))/(4*H*H);
1814  }
1815  }
1816  return 0;
1817 }
1818 
1821 {
1822  if (a[0] == a[1]){
1823  if (pointInside){
1824  lambda = 0.;
1825  I1 = I2 = 2.*PI;
1826  I11 = I22 = I12 = PI / pow(a[0], 2);
1827  Sext.g(1, 1) = Sext.g(0, 0) = 3. / (8. * PI*(1. - P->matrix->nu()))*a[0] * a[0] * I11 + (1. - 2. * P->matrix->nu()) / (8. * PI*(1. - P->matrix->nu()))*I1;
1828  Sext.g(1, 0) = Sext.g(0, 1) = 1. / (8. * PI*(1. - P->matrix->nu()))*a[0] * a[0] * I12 - (1. - 2. * P->matrix->nu()) / (8. * PI*(1. - P->matrix->nu()))*I1;
1829  Sext.g(2, 2) = 1. / (1. - P->matrix->nu())*((a[0] * a[0] + a[1] * a[1]) / (2.*(a[0] + a[1])*(a[0] + a[1])) + (0.5 - P->matrix->nu()));
1830  }
1831  else{
1832  lambda = x[0] * x[0] + x[1] * x[1] - a[0] * a[0];
1833  I1 = I2 = 2.*PI*a[0] * a[0] / (a[0] * a[0] + lambda);
1834  I11 = I22 = I12 = PI*a[0] * a[0] / pow(a[0] * a[0] + lambda, 2);
1835  Sext.g(1, 1) = Sext.g(0, 0) = 1. / 8. / PI / (1. - P->matrix->nu())*((2. * P->matrix->nu()*I1 - I1 + a[0] * a[0] * I11) + 2. * (a[0] * a[0] * I11 - I1 + (1. - P->matrix->nu())*I1*2.));
1836  Sext.g(1, 0) = Sext.g(0, 1) = 1. / 8. / PI / (1. - P->matrix->nu())*((2. * P->matrix->nu()*I1 - I2 + a[0] * a[0] * I12));
1837  Sext.g(2, 2) = 2. / 8. / PI / (1. - P->matrix->nu())*(a[0] * a[0] * I12 - I2 + (1. - P->matrix->nu())*(I1 + I2));
1838  }
1839  }
1840  else{
1841  if (pointInside){
1842  lambda = 0.;
1843  I1 = 4.*PI*a[1] / (a[0] + a[1]);
1844  I2 = 4.*PI*a[0] / (a[0] + a[1]);
1845  I12 = 4.*PI / (a[0] * a[0] + 2.*a[0] * a[1] + a[1] * a[1]);
1846  I11 = 1. / 3. * (4. * PI / (a[0] * a[0]) - I12);
1847  I22 = 1. / 3. * (4. * PI / (a[1] * a[1]) - I12);
1848  Sext.g(0, 0) = 3. / (8. * PI*(1. - P->matrix->nu()))*a[0] * a[0] * I11 + (1. - 2. * P->matrix->nu()) / (8. * PI*(1. - P->matrix->nu()))*I1;
1849  Sext.g(1, 1) = 3. / (8. * PI*(1. - P->matrix->nu()))*a[1] * a[1] * I22 + (1. - 2. * P->matrix->nu()) / (8. * PI*(1. - P->matrix->nu()))*I2;
1850  Sext.g(0, 1) = 1. / (8. * PI*(1. - P->matrix->nu()))*a[1] * a[1] * I12 - (1. - 2. * P->matrix->nu()) / (8. * PI*(1. - P->matrix->nu()))*I1;
1851  Sext.g(1, 0) = 1. / (8. * PI*(1. - P->matrix->nu()))*a[0] * a[0] * I12 - (1. - 2. * P->matrix->nu()) / (8. * PI*(1. - P->matrix->nu()))*I2;
1852  Sext.g(2, 2) = 2. / (2. - 2.*P->matrix->nu())*((a[0] * a[0] + a[1] * a[1]) / (2.*(a[0] + a[1])*(a[0] + a[1])) + (1. - 2.*P->matrix->nu()) / 2.);
1853  }
1854  else{
1855  double b = a[0] * a[0] + a[1] * a[1] - x[0] * x[0] - x[1] * x[1];
1856  double c = a[0] * a[0] * a[1] * a[1] - x[0] * x[0] * a[1] * a[1] - x[1] * x[1] * a[0] * a[0];
1857  double Di = b*b - 4. * c;
1858  lambda = 0.5*(-b + sqrt(Di));
1859  I1 = 4.*PI*a[0] * a[1] / (a[1] * a[1] - a[0] * a[0])*(sqrt((a[1] * a[1] + lambda) / (a[0] * a[0] + lambda)) - 1.);
1860  I2 = 4.*PI*a[0] * a[1] / (a[0] * a[0] - a[1] * a[1])*(sqrt((a[0] * a[0] + lambda) / (a[1] * a[1] + lambda)) - 1.);
1861  I12 = 1.*(I2 - I1) / (a[0] * a[0] - a[1] * a[1]);
1862  I11 = 1. / 3. * ((I1 + I2) / (a[0] * a[0] + lambda) - I12);
1863  I22 = 1. / 3. * ((I1 + I2) / (a[1] * a[1] + lambda) - I12);
1864  Sext.g(0, 0) = 1. / 8. / PI / (1. - P->matrix->nu())*((2 * P->matrix->nu()*I1 - I1 + a[0] * a[0] * I11) + 2. * (a[0] * a[0] * I11 - I1 + (1. - P->matrix->nu())*(I1 + I1)));
1865  Sext.g(1, 1) = 1. / 8. / PI / (1. - P->matrix->nu())*((2 * P->matrix->nu()*I2 - I2 + a[1] * a[1] * I22) + 2. * (a[1] * a[1] * I22 - I2 + (1. - P->matrix->nu())*(I2 + I2)));
1866  Sext.g(0, 1) = 1. / 8. / PI / (1. - P->matrix->nu())*((2 * P->matrix->nu()*I1 - I2 + a[0] * a[0] * I12));
1867  Sext.g(1, 0) = 1. / 8. / PI / (1. - P->matrix->nu())*((2 * P->matrix->nu()*I2 - I1 + a[1] * a[1] * I12));
1868  Sext.g(2, 2) = 2. / 8. / PI / (1. - P->matrix->nu())*(a[0] * a[0] * I12 - I2 + (1. - P->matrix->nu())*(I1 + I2));
1869  }
1870  }
1871 }
1872 
1875 {
1876  double _I1,_I2,_I11,_I22,_I12;
1877  if (a[0] == a[1]){
1878  _I1 = _I2 = 2.*PI;
1879  _I11 = _I22 = _I12 = PI / (a[0] * a[0]);
1880  S[0] = S[3] = 3. / (8. * PI*(1. - P->matrix->nu()))*a[0] * a[0] * _I11 + (1. - 2. * P->matrix->nu()) / (8. * PI*(1. - P->matrix->nu()))*_I1;
1881  S[1] = S[2] = 1. / (8. * PI*(1. - P->matrix->nu()))*a[0] * a[0] * _I12 - (1. - 2. * P->matrix->nu()) / (8. * PI*(1. - P->matrix->nu()))*_I1;
1882  S[4] = 1. / (1. - P->matrix->nu())*((a[0] * a[0] + a[1] * a[1]) / (2.*(a[0] + a[1])*(a[0] + a[1])) + (0.5 - P->matrix->nu()));
1883  }
1884  else{
1885  _I1 = 4.*PI*a[1] / (a[0] + a[1]);
1886  _I2 = 4.*PI*a[0] / (a[0] + a[1]);
1887  _I12 = 4.*PI / ((a[0] + a[1])*(a[0] + a[1]));
1888  _I11 = 1. / 3. * (4. * PI / (a[0] * a[0]) - _I12);
1889  _I22 = 1. / 3. * (4. * PI / (a[1] * a[1]) - _I12);
1890  S[0] = 3. / (8. * PI*(1. - P->matrix->nu()))*a[0] * a[0] * _I11 + (1. - 2. * P->matrix->nu()) / (8. * PI*(1. - P->matrix->nu()))*_I1;
1891  S[3] = 3. / (8. * PI*(1. - P->matrix->nu()))*a[1] * a[1] * _I22 + (1. - 2. * P->matrix->nu()) / (8. * PI*(1. - P->matrix->nu()))*_I2;
1892  S[1] = 1. / (8. * PI*(1. - P->matrix->nu()))*a[1] * a[1] * _I12 - (1. - 2. * P->matrix->nu()) / (8. * PI*(1. - P->matrix->nu()))*_I1;
1893  S[2] = 1. / (8. * PI*(1. - P->matrix->nu()))*a[0] * a[0] * _I12 - (1. - 2. * P->matrix->nu()) / (8. * PI*(1. - P->matrix->nu()))*_I2;
1894  S[4] = 1. / (1. - P->matrix->nu())*((a[0] * a[0] + a[1] * a[1]) / (2.*(a[0] + a[1])*(a[0] + a[1])) + (0.5 - P->matrix->nu()));
1895  }
1896 }
1898 double InclusionRecord2D :: r(int i,int j)
1899 {
1900  if(i==j)return 1.0;
1901  return 0.0;
1902 }
1903 
1905 double InclusionRecord2D :: compute_D(int i,int j,int k,int l)
1906 {
1907  return 1.0/(8.0*PI*(1.0-P->matrix->nu()))*(
1908  8.0*PI*(1.0-P->matrix->nu())*S_give(1000*i+100*j+10*k+l)+2.0*P->matrix->nu()*r(k,l)*x[i-1]*dI(i,j,0)
1909  +(1.0-P->matrix->nu())*( r(i,l)*x[k-1]*dI(k,j,0) + r(j,l)*x[k-1]*dI(k,i,0) + r(i,k)*x[l-1]*dI(l,j,0) + r(j,k)*x[l-1]*dI(l,i,0) )
1910  -r(i,j)*x[k-1]*(dI(k,l,0)-pow(a[i-1],2)*dI(10*k+i,l,0)) - (r(i,k)*x[j-1]+r(j,k)*x[i-1])*(dI(j,l,0)-pow(a[i-1],2)*dI(10*i+j,l,0))
1911  -(r(i,l)*x[j-1]+r(j,l)*x[i-1])*(dI(j,k,0)-pow(a[i-1],2)*dI(10*i+j,k,0))-x[i-1]*x[j-1]*(dI(j,l,k)-pow(a[i-1],2)*dI(10*i+j,l,k))
1912  );
1913 }
1914 
1917 {
1918  D.g(0, 0) = compute_D(1, 1, 1, 1);
1919  D.g(1, 1) = compute_D(2, 2, 2, 2);
1920  D.g(0, 1) = compute_D(1, 1, 2, 2);
1921  D.g(1, 0) = compute_D(2, 2, 1, 1);
1922  D.g(2, 2) = 2.*compute_D(1, 2, 1, 2) - Sext.g(2, 2);
1923  D.g(0, 2) = 2.*compute_D(1, 1, 1, 2);
1924  D.g(1, 2) = 2.*compute_D(2, 2, 1, 2);
1925  D.g(2, 0) = compute_D(1, 2, 1, 1);
1926  D.g(2, 1) = compute_D(1, 2, 2, 2);
1927 }
1930 {
1931  pointInside = 1;
1932  x[0] = 0.0;
1933  x[1] = 0.0;
1934  compute_matrix_D();
1935  matice D_inv(3, 3);
1936  D_inv.inverze_3x3(D);
1937  vektor es(3);
1938  rotateStrain_G2L(e_s_.v, es.v);
1939  MaticexVektor(e_t_, D_inv, es);
1940 }
1942 void InclusionRecord2D :: compute_strain_pert_from_eps_zero_ext(const double *point, double *es, double *ez)
1943 {
1944  pointInside = 1;
1945  x[0] = 0.0;
1946  x[1] = 0.0;
1947  compute_matrix_D();
1948  //int i;
1949 
1950  double m[5], n[5], Cs[5], B[5], e_z[3]; //, e_z_t[3];
1951  vektor vet(3),ves(3);
1952  SubtractTwoVectors(C, P->matrix->C, Cs, 5);
1953 
1955  AddVector(P->matrix->C, n, 5);
1958  MultiplyVector(B, 5, -1.0);
1959  rotateStrain_G2L(ez, e_z);
1961 
1962  pointInside = 0;
1963  this->transformCoords_G2L(point, x);
1964  compute_matrix_D();
1965 
1966  MaticexVektor(ves, D, vet);
1967  rotateStrain_L2G(ves.v, es);
1968 }
1970 void InclusionRecord2D::compute_strain_pert_from_eps_zero_int(const double *point, double *es, double *ez)
1971 {
1972  pointInside = 1;
1973  x[0] = 0.0;
1974  x[1] = 0.0;
1975  compute_matrix_D();
1976  //int i;
1977 
1978  double m[5], n[5], Cs[5], B[5], e_z[3]; //, e_z_t[3];
1979  vektor vet(3), ves(3);
1980  SubtractTwoVectors(C, P->matrix->C, Cs, 5);
1981 
1983  AddVector(P->matrix->C, n, 5);
1986  MultiplyVector(B, 5, -1.0);
1987  rotateStrain_G2L(ez, e_z);
1989 
1990  MaticexVektor(ves, D, vet);
1991  rotateStrain_L2G(ves.v, es);
1992 }
1993 
1995 void InclusionRecord2D :: compute_from_eps_tau(const double *point, vektor &es, vektor &et)
1996 {
1997  pointInside = 0;
1998  this->transformCoords_G2L(point, x);
1999  compute_matrix_D();
2000 
2001  MaticexVektor(es, D, et);
2002  rotateStrain_L2G(es.v, es.v);
2003 }
2004 
2007 {
2008  // termitovo:
2009  // zeptat se standy jestli je e_t v globalu nebo lokalu
2010 
2011  pointInside = 1;
2012  x[0]=0.0;
2013  x[1]=0.0;
2014  compute_matrix_D();
2015 
2017  double m[5], n[5], Cs[5], B[5], e_z[3];
2018 
2019  SubtractTwoVectors (C, P->matrix->C, Cs, 5);
2020 
2022  AddVector(P->matrix->C, n, 5);
2025  MultiplyVector(B, 5, -1.0);
2026  rotateStrain_G2L(P->matrix->remote_strains()[strainID], e_z);
2028 }
2029 
2031 void InclusionRecord2D :: update_eps_tau (int strainID, const double *e_z_add)
2032 {
2033  pointInside = 1;
2034  x[0] = 0.0;
2035  x[1] = 0.0;
2036  compute_matrix_D();
2037  int i;
2039  double m[5], n[5], Cs[5], B[5], e_z[3],e_z_t[3];
2040 
2041  SubtractTwoVectors(C, P->matrix->C, Cs, 5);
2042 
2044  AddVector(P->matrix->C, n, 5);
2047  MultiplyVector(B, 5, -1.0);
2048  for (i = 0; i < 3; i++)e_z_t[i] = P->matrix->remote_strains()[strainID][i]+ e_z_add[i];
2049  rotateStrain_G2L(e_z_t, e_z);
2051 }
2052 
2054 void InclusionRecord2D :: compute_eps_tau(int strainID,double *e_tau, double *e_z_add,bool add)
2055 {
2056  // termitovo tady se pocita porad stejne D znovu pro vsechny body na inkluzi, nebo se mi tozda
2057  pointInside = 1;
2058  x[0] = 0.0;
2059  x[1] = 0.0;
2060  compute_matrix_D();
2061  int i;
2063  double m[5], n[5], Cs[5], B[5], e_z[3], e_z_t[3];
2064 
2065  SubtractTwoVectors(C, P->matrix->C, Cs, 5);
2066 
2068  AddVector(P->matrix->C, n, 5);
2071  MultiplyVector(B, 5, -1.0);
2072  if(add) for (i = 0; i < 3; i++)e_z_t[i] = P->matrix->remote_strains()[strainID][i] + e_z_add[i];
2073  else for (i = 0; i < 3; i++)e_z_t[i] = e_z_add[i];
2074  rotateStrain_G2L(e_z_t, e_z);
2076 }
2077 
2079 void InclusionRecord2D :: giveExtStrainPert (const double *point, double **strain, int lc, int nlc)
2080 {
2081  pointInside = 0;
2082  this->transformCoords_G2L(point, x);
2083  compute_matrix_D();
2084  vektor epsTau(3);
2085 
2086 
2087  vektor v(3);
2088  for (int i = lc; i < lc + nlc; i++) {
2089 
2090  for (int j = 0; j < 3; j++)
2091  epsTau.v[j] = this->Epsilon_Tau[i][j];
2092  //new begin
2093  // now it is just a FAKE polynomial eigenstrain solution...
2094  if (P->approximation >= 1)
2095  for (int j = 0; j < P->give_VM_TENS_RANGE(); j++) {
2096  epsTau.v[j] += 1.0*(this->approx_coef[i][0][j] * x[0]) / ((1. + this->lambda));
2097  epsTau.v[j] += 1.0*(this->approx_coef[i][1][j] * x[1]) / ((1. + this->lambda));
2098  if(P->give_dimension()==3)epsTau.v[j] += 1.0*(this->approx_coef[i][2][j] * x[2]) / ((1. + this->lambda));
2099  }
2100  if (P->approximation >= 2) {
2101  if (P->give_dimension() == 2) {
2102  for (int j = 0; j < P->give_VM_TENS_RANGE(); j++) {
2103  epsTau.v[j] += 1.0*(this->approx_coef[i][2][j] * x[0] * x[0]) / (SQR(1. + this->lambda));
2104  epsTau.v[j] += 1.0*(this->approx_coef[i][3][j] * x[1] * x[1]) / (SQR(1. + this->lambda));
2105  epsTau.v[j] += 1.0*(this->approx_coef[i][4][j] * x[0] * x[1]) / (SQR(1. + this->lambda));
2106  }
2107  }
2108  else {
2109 
2110  }
2111 
2112  }
2113 
2114 
2115 
2116 
2117  //new end
2118  MaticexVektor(v, D, epsTau);
2119  rotateStrain_L2G(v.v, strain[i - lc]);
2120  }
2121 }
2122 
2124 void InclusionRecord2D::getDisplacement(const double *point, double **displacement, int lc, int nlc, int _pointInside)
2125 {
2126  pointInside = _pointInside;
2127  this->transformCoords_G2L(point, x);
2128 
2129  double _2nu = 2.0 * P->matrix->nu();
2130  double _1min2nu = 1. - _2nu;
2131  double multTRN = 1. / (8. * PI * (1. - P->matrix->nu()));
2132 
2133  L.g(0, 0) = multTRN * (x[0] * (_1min2nu * I(1) + 3. * a[0] * a[0] * I(11)));
2134  if (!pointInside)L.g(0, 0) += multTRN * x[0] * x[0] * (-dI(1, 1, 0) + a[0] * a[0] * dI(11, 1, 0));
2135  L.g(1, 1) = multTRN * (x[1] * (_1min2nu * I(2) + 3. * a[1] * a[1] * I(22)));
2136  if (!pointInside)L.g(1, 1) += multTRN * x[1] * x[1] * (-dI(2, 2, 0) + a[1] * a[1] * dI(22, 2, 0));
2137  L.g(0, 1) = multTRN * (x[0] * (_2nu * I(1) - I(2) + a[0] * a[0] * I(12)));
2138  if (!pointInside)L.g(0, 1) += multTRN * x[0] * x[1] * (-dI(2, 2, 0) + a[0] * a[0] * dI(12, 2, 0));
2139  L.g(1, 0) = multTRN * (x[1] * (_2nu * I(2) - I(1) + a[1] * a[1] * I(21)));
2140  if (!pointInside)L.g(1, 0) += multTRN * x[0] * x[1] * (-dI(1, 1, 0) + a[1] * a[1] * dI(21, 1, 0));
2141  L.g(0, 2) = 2.*multTRN * (x[1] * (_1min2nu * I(2) + a[0] * a[0] * I(12)));
2142  if (!pointInside)L.g(0, 2) += 2.*multTRN * x[0] * x[0] * (-dI(1, 2, 0) + a[0] * a[0] * dI(11, 2, 0));
2143  L.g(1, 2) = 2.*multTRN * (x[0] * (_1min2nu * I(1) + a[1] * a[1] * I(21)));
2144  if (!pointInside)L.g(1, 2) += 2.*multTRN * x[0] * x[1] * (-dI(1, 2, 0) + a[1] * a[1] * dI(21, 2, 0));
2145 
2146  vektor vect(2), etset(3);
2147  for (int i = lc; i < lc + nlc; i++) {
2148  for (int j = 0; j < 3; j++)
2149  etset.v[j] = this->Epsilon_Tau[i][j];
2150 
2151  MaticexVektor(vect, L, etset);
2152  this->rotateDisplc_L2G (vect.v, displacement[i - lc]);
2153  }
2154 }
2157 {
2158  switch( shape ) {
2159  case IS_ELLIPSE:
2160  case IS_CIRCLE:
2161  this->volume = PI * a[0] * a[1];
2162  break;
2163  //case IS_STRIP:
2164  //case IS_CRACK:
2165  // _errorr( "Not yet defined" );
2166  // break;
2167  default:
2168  _errorr( "Undefined shape" );
2169  }
2170 }
2171 
2172 // ***********************************************************************************************************
2173 // **************** 2D ONLY - END **********************************************************************
2174 // ***********************************************************************************************************
2175 
2176 
2177 } // end of namespace mumech
2178 
2179 /*end of file*/
#define VEC_SQR_NORM_3D(x, y, z)
Definition: macros.h:206
#define Ll1212
Definition: inclusion.cpp:619
Class eshelbySoluUniformField.
void set_Euller_angles_deg(double x)
Definition: inclusion.cpp:239
void set_centroids(double x, double y)
Definition: inclusion.cpp:235
Class eshelbySoluEllipticIntegralsPenny.
void update_approximations(int lc)
Definition: inclusion.cpp:425
int give_VM_TENS_RANGE(void) const
Gives range of a second order tensor in Voigt-Mandel notation.
Definition: problem.h:98
double * origin
coordinates of the inclusions&#39; centorids
Definition: inclusion.h:75
const char * IST_e2s(InclusionGeometry ig)
Inclusion shapes&#39; type - enum to string.
Definition: types.h:174
bool point_is_inside(const double *coords, double epsilon=0.0) const
Function returns the position of a given point related to an inclusion.
Definition: inclusion.cpp:329
void addtot()
Function add locEigTot to globEigTot.
Definition: inclusion.cpp:1477
void update_eps_tau(int strainID, const double *e_z_add)
Definition: inclusion.cpp:2031
InclusionGeometry giveInclusionGeometry(InclusionGeometry shp_o) const
Function detects the inclusion geometry according the mutual aspect ratio among the semiaxes...
Definition: inclusion.cpp:1566
#define __1313_
Definition: types.h:309
void copy2DeshelbyTensor_reduced2full(const double *a, double **b)
Function copies and converts 2D eshelby/stiffness tensor saved in reduced row-wise vector &#39;a&#39; to full...
#define _warningg(_1)
Definition: gelib.h:163
int give_dimension(void) const
Definition: problem.h:86
double r(int i, int j)
Kronecker delta.
Definition: inclusion.cpp:1898
#define __2323_
Definition: types.h:307
Class eshelbySoluEllipticIntegralsEllipsoid.
double * T
GLOBAL->LOCAL displacement vector transfrmation matrix; 3x3 or 2x2 for 3d or 2d.
Definition: inclusion.h:92
Class of the functions calculating the values of elliptic integrals and its derivatives of oblate sph...
virtual int give_nLC(void) const
Give number of load cases, e.i. number of load cases, i.e. number of Remote_strain fields...
Definition: problem.h:334
InclusionGeometry giveInclusionGeometry(InclusionGeometry shp_o) const
Function detects the inclusion geometry according the mutual aspect ratio among the semiaxes...
Definition: inclusion.cpp:1170
void set_all_3d(double x, double y, double z, double e, double n, double a1, double a2, double a3, double e1, double e2, double e3)
Definition: inclusion.cpp:250
Class of the functions returning the Ferers-Dysons elliptic integral values as well as its derivative...
Definition: esei_Sphere.h:45
#define S1313
Definition: inclusion.cpp:642
bool point_is_affected(const double *point) const
Returns true, if the given point is inside of the action radius of the receiver.
Definition: inclusion.cpp:1490
void give_Te(double *Te, const double *T, InclusionGeometry inclGeometry)
Function calculates the transformation matrix for strain/stress tensors saved in vectors with TNTV_TH...
double * C
isotropic stiffness matrix of the infinite medium (infinite matrix), saved in reduced form...
Definition: matrix.h:66
void init_EigStrain_LC(int lc)
Definition: inclusion.cpp:1509
Class InclusionRecord contains and handles all inclusion data.
Definition: inclusion.h:60
const double ** give_EshelbyPertDisplc_internal(int lc, int nlc, const double *coords)
Definition: inclusion.cpp:845
Problem description.
Definition: problem.h:154
void rovna_se(vektor &co)
Definition: matrix_vector.h:35
Class vector and matrix.
General functions.
void rotate_vector(vektor &V, double angle)
void add_EshelbyPertStrain_internal_SIFCM(double **strain, int lc, int nlc, double **e_t_SIFCM)
Definition: inclusion.cpp:938
#define S3311
Definition: inclusion.cpp:634
int give_EA_RANGE(void) const
Gives vector range, same as dimension.
Definition: problem.h:94
double & g(int radek, int sloupec)
Definition: matrix_vector.h:93
double give_volume(void)
Definition: inclusion.cpp:416
void copy3DeshelbyTensor_reduced2full(const double *a, double **b)
Function copies and converts 3D eshelby/stiffness tensor saved in reduced row-wise vector &#39;a&#39; to full...
int nstrain_one(void) const
Definition: problem.h:89
const Problem * P
problem description
Definition: inclusion.h:69
eshelbySoluUniformField * esuf
Definition: inclusion.h:285
void Eps02EpsTau(double *e_tau, const double *e_0)
Definition: inclusion.cpp:543
Namespace MatrixOperations.
void initialize(const Inclusion *prevInclRec)
Initialization of this inclusion. Computes characteristic matrices: Eshelby tensor, ...
Definition: inclusion.cpp:1671
bool twodim
2 dimension problem; 3d is default; twodim == true - 2d, twodim == false - 3d
Definition: problem.h:66
double ** displacement
Calculated value - global displacement field.
Definition: matrix.h:153
virtual void computeVolume()
Definition: inclusion.cpp:2156
double x[3]
Global coordinates of a point.
Definition: matrix.h:136
void giveReducedIsoStiffMatrix(double *C, double E, double nu, bool twodim)
Function gives the reduced isotropic stiffness matrix of a homogeneous material.
Definition: stiffness.cpp:35
void give_StiffnessMatrixFull(double *answer) const
Copy stiffness tensor into full matrix answer.
Definition: inclusion.cpp:799
int give_VECT_RANGE(void) const
Gives vector range, same as dimension.
Definition: problem.h:92
#define PI
Definition: macros.h:71
void inverze_3x3(matice &d)
#define _warningg3(_1, _2, _3)
Definition: gelib.h:167
double actionRadius
Action radius of the inclusion.
Definition: inclusion.h:106
void CopyVector(const double *src, double *dest, long n)
Function copy given number of components from vector, &#39;a&#39; to vector &#39;b&#39;.
void give_EshelbyMatrixFull(double **answer) const
Copy Eshelby tensor into full matrix answer.
Definition: inclusion.cpp:778
void add_EshelbyPertStress_internal_SIFCM(double **stress, int lc, int nlc, double **e_t_SIFCM, double **e_s_ext_add)
Definition: inclusion.cpp:953
#define _ACT_RAD_MULT_2d
Definition: inclusion.cpp:580
int approximation
Approximation of epsilon tau - 0 = constant, 1 = linear, ...
Definition: problem.h:197
virtual bool is_converted_to_equivalent(void) const
Give type of ...
Definition: problem.h:483
InclusionRecord3D(long i, const Problem *p)
Constructor.
Definition: inclusion.cpp:1094
void giveEshelbyTensor(double S[12], const double eInt[13])
Function gives the Eshelby tensor of an inclusion of arbitrary shape.
Definition: esuf.cpp:225
void giveInverseMatrix3x3to5(double *answer, const double *m)
Function computes inverse of the eshelby-like 3x3 matrix &#39;m&#39; saved in reduced 3x3to5 form...
void set_Semiaxes_dimensions(double x, double y)
Definition: inclusion.cpp:237
#define DIST_POINTS_SQR_2D(P1, P2)
Definition: macros.h:209
Class eshelbySoluEllipticIntegralsCylinder.
double * SInv
Inverse of Eshelby tensor.
Definition: inclusion.h:88
void giveTVproduct_6is6x6to12and6(double *result, const double *T, const double *vect)
Function gives product of tensor and vector - &#39;result = T * vect&#39;.
double * C
Isotropic elastic stiffness tensor of an inclusion stored in reduced form (from the total 9/36 matrix...
Definition: inclusion.h:86
double dI(int index, int smer1, int smer2)
Gives the derivation of I.
Definition: inclusion.cpp:1793
const double ** give_EshelbyPertStress_internal(int lc, int nlc)
Definition: inclusion.cpp:889
int MaticexVektor(vektor &res, matice &mat, vektor &vek)
Namespace Stiffness.
void SBA_updateGlobAndLocStrains(Point *point)
Function modifies/updates the actuall local and global eigenstrains in inclusion centroids due to the...
Definition: inclusion.cpp:1461
virtual void computeVolume()=0
#define DIST_POINTS_SQR_3D(P1, P2)
Definition: macros.h:210
#define L1122
Definition: inclusion.cpp:589
#define L1111
Definition: inclusion.cpp:588
#define __2233_
Definition: types.h:299
void giveMatrixVectorProduct(const double *mtrx, const double *vect, double *resVect, long n)
Function gives the product of a regular matrix with a vector.
bool scan_globEigStrain_LC(Stream *stream, int lc)
Definition: inclusion.cpp:1118
eshelbySoluUniformFieldOblateSpheroid class declaration
void give_EshelbyPertFields_external(Point *point, int lc, int nlc, bool disp, bool strn)
Function gives the &#39;Eshelby&#39; STRAIN and DISPLACEMENT field in an arbitrary EXTERNAL point for given l...
Definition: inclusion.cpp:986
double derivative_step(double delitel)
Function sets the size of a derivative step according to the semiaxes size.
Definition: inclusion.cpp:1753
#define __3333_
Definition: types.h:303
#define S1212
Definition: inclusion.cpp:638
#define errol
Definition: gelib.h:151
#define S1122
Definition: inclusion.cpp:627
Class eshelbySoluEllipticIntegrals.
The header file of usefull macros.
3D inclusion record.
Definition: inclusion.h:278
double globEigStrainTotal[6]
total global eigenstrain field evaluated by &#39;self_balance&#39; algorithm
Definition: inclusion.h:297
#define _errorr2(_1, _2)
Definition: gelib.h:154
void SubtractTwoVectors(const double *v1, const double *v2, double *answer, long n)
Function subtracts two vectors of entries. answer = v1 - v2.
double * eAngles
Euller angles.
Definition: inclusion.h:77
void rotateStrain_L2G(const double *loc, double *glob) const
Function rotate local strain to global.
Definition: inclusion.cpp:405
void CleanArray2d(double **a, long rows, long columns)
Function cleans an 2d &#39;double&#39; array, initialize each value being 0-zero.
#define L1212
Definition: inclusion.cpp:600
#define __3322_
Definition: types.h:302
Inclusion(long i, const Problem *p)
Constructor.
Definition: inclusion.cpp:66
void compute_from_eps_tau(const double *point, vektor &es, vektor &et)
Computes strain perturbation for the set epsilon_tau=et.
Definition: inclusion.cpp:1995
virtual void allocate_nlc_fields(void)
Definition: inclusion.cpp:165
Class eshelbySoluEllipticIntegralsOblateSpheroid.
int give_ISO_C_RANGE(void) const
Gives range of ...
Definition: problem.h:100
eshelbySoluUniformFieldProlateSpheroid class declaration
#define ABS(a)
Definition: macros.h:118
double * Te
GLOBAL->LOCAL strain/stress tensor transfrmation matrix; full matrix 6x6 or 3x3 for 3d or 2d...
Definition: inclusion.h:96
void define(long n)
Definition: matrix_vector.h:37
double ** globPert_displc
u star - Global perturbation displacement. Toto muze byt alokovany v problemu a odtud jen ukazovatko...
Definition: inclusion.h:124
double ** locEigStrain_LC
predchazejici arrays slouzi vsude v balancingu pro vypocet v danem lc, tyto pole schovavaji vysledky ...
Definition: inclusion.h:299
void set_all_2d(double x, double y, double e, double n, double a1, double a2, double e1)
Definition: inclusion.cpp:242
bool scan_eAngles_RAD(Stream *stream)
Definition: inclusion.cpp:151
Single Point data structure - contribution from Single inclusion.
Definition: matrix.h:133
#define _ACT_RAD_MULT_3d
Definition: inclusion.cpp:581
double give_semiaxes_min_difference(void) const
Give the variable min_axes_diff.
Definition: problem.h:501
void compute_initial_eps_tau(int strainID)
Definition: inclusion.cpp:2006
void compute_strain_pert_from_eps_zero_ext(const double *point, double *es, double *ez)
Definition: inclusion.cpp:1942
double ** strain
Calculated value - global strain fields.
Definition: matrix.h:154
double ** approx_points_eps_tau
Definition: inclusion.h:121
bod_pomocny P_a[2]
Definition: inclusion.h:421
void give_TeInv(double *TeInv, const double *Te, InclusionGeometry inclGeometry)
Function calculates the inverse of transformation matrix for strain/stress tensors saved in vectors w...
bool point_is_affected(const double *point) const
Returns true, if the given point is inside of the action radius of the receiver.
Definition: inclusion.cpp:1713
void SBA_computeInitialStrains(int lc)
Function computes basic/own eigen strains (not influenced by other inclusions) of lc-th load case...
Definition: inclusion.cpp:1426
double * TInv
LOCAL->GLOBAL displacement vector transfrmation matrix; TInv = T^-1 (inversion) = T^T (transposed) ...
Definition: inclusion.h:93
eshelbySoluEllipticIntegrals * ellInt
Definition: inclusion.h:284
double eInt[13]
elliptic potentials of an internal point (position independent)
Definition: inclusion.h:290
void giveTTproduct_3x3to5is3x3to5and3x3to5(double *result, const double *T1, const double *T2)
Function gives product of tensor and tensor - &#39;result = T1 * T2&#39;.
void SumTwoVectors(const double *v1, const double *v2, double *answer, long n)
Function sums two vectors of entries. resVec = vec1 - vec2.
Class eshelbySoluEllipticIntegralsFlatEllipsoid.
#define __1111_
Definition: types.h:293
virtual ~InclusionRecord2D()
Destructor.
Definition: inclusion.cpp:1545
#define S3333
Definition: inclusion.cpp:636
#define S3322
Definition: inclusion.cpp:635
double compute_D(int i, int j, int k, int l)
Definition: inclusion.cpp:1905
double ndiff_1
derivative step for the first derivations
Definition: inclusion.h:108
bool is_inside_of_BB(const double *bb1, const double *bb2) const
check the receiver is inside of the bounding box defined by lower left bb1 and upper right bb2 corner...
Definition: inclusion.cpp:218
TinyXML functions.
virtual ~InclusionRecord3D()
Destructor.
Definition: inclusion.cpp:1102
double ** approx_points
Definition: inclusion.h:120
double ** globPert_stress
sigma star - Global perturbation stress.
Definition: inclusion.h:126
Class inclusion contains and handles all inclusion data.
void compute_strain_pert_from_eps_zero_int(const double *point, double *es, double *ez)
Definition: inclusion.cpp:1970
double locEigStrain[6]
actual local eigenstrain used during &#39;self_balance&#39; algorithm
Definition: inclusion.h:295
void give_T(double *T, const double *eullerAngles, EullerRotations flag, InclusionGeometry inclGeometry)
Function calculates the transformation matrix from given Euller angles.
void check_dim(int i) const
Definition: problem.h:496
const double ** give_EshelbyPertStrain_internal(int lc, int nlc)
Definition: inclusion.cpp:861
Class eshelbySoluEllipticIntegralsProlateSpheroid.
void rotateDisplc_L2G(const double *loc, double *glob) const
Definition: inclusion.cpp:387
const double ** remote_strains(void) const
Definition: matrix.h:108
void give_TeMatrix_G2L(double *answer) const
Copy Te (G2L strain transformation matrix) tensor into full matrix answer.
Definition: inclusion.cpp:820
bool any_derivative_preparation_computed
Definition: inclusion.h:426
#define S2222
Definition: inclusion.cpp:631
Return the Eshelby solution of a spherical inclusion loaded by the uniform strain/stress field...
Definition: esuf_Sphere.h:41
Class of the functions returning the Eshelby solution of an inclusion of an ellipsoidal shape loaded ...
Definition: esuf.h:46
double nu
Poisson&#39;s ratio.
Definition: inclusion.h:73
void define(int radku, int sloupcu)
Definition: matrix_vector.h:82
#define SQR(a)
Definition: macros.h:97
#define S2233
Definition: inclusion.cpp:632
#define __1212_
Definition: types.h:305
bod_pomocny P_b[8]
Definition: inclusion.h:422
double * a
Inclusion semiaxes&#39; dimensions in global arrangement.
Definition: inclusion.h:76
double I(int index)
Definition: inclusion.cpp:1736
#define __1133_
Definition: types.h:295
static bool ellipses_overlap(const Inclusion *inc1, const Inclusion *inc2)
Definition: mesoface.cpp:53
void MultiplyVector(double *a, long n, double val)
Function multiplies &#39;n&#39; components of field &#39;a&#39; by value &#39;val&#39;.
void EAdeg2rad(void)
Euller angles conversion from degrees to radians.
Definition: inclusion.cpp:571
double ** Epsilon_Tau
field of epsilon tau, set by SBalgorithm for every load
Definition: inclusion.h:115
void rotateStrain_G2L(const double *glob, double *loc) const
Definition: inclusion.cpp:397
double locEigStrainTot[6]
actual local eigenstrain used during &#39;self_balance&#39; algorithm
Definition: inclusion.h:296
#define _errorr(_1)
Definition: gelib.h:160
double S_give(int index)
Function checks if the tensor S is computed for the current point and then returns the asked componen...
Definition: inclusion.cpp:1719
void transformCoords_L2G(const double *loc, double *glob) const
Function transforms (shift according to origin and rotate) local coordinates to global.
Definition: inclusion.cpp:369
#define __1122_
Definition: types.h:294
void SBA_computeInitialStrains(int lc)
Function computes basic/own eigen strains (not influenced by other inclusions) of lc-th load case...
Definition: inclusion.cpp:1704
virtual InclusionGeometry giveInclusionGeometry(InclusionGeometry shp_o) const =0
Function detects the inclusion geometry according the mutual aspect ratio among the semiaxes...
InclusionGeometry
Inclusion shapes&#39; type.
Definition: types.h:161
#define _errorr3(_1, _2, _3)
Definition: gelib.h:155
static double epsilon
Definition: meso2d.cpp:172
void giveTVproduct_3is3x3to5and3(double *result, const double *T, const double *vect)
Function gives product of tensor and vector - &#39;result = T * vect&#39;.
double ** globPert_strain
epsilon star - Global perturbation strain.
Definition: inclusion.h:125
void getDisplacement(const double *point, double **displacement, int lc, int nlc, int _pointInside)
Computes displacement perturbation.
Definition: inclusion.cpp:2124
void gaussovaEliminace(matice &m, vektor &right)
double compute_supplement_energy(int lc)
Definition: inclusion.cpp:998
virtual void computeVolume()
Definition: inclusion.cpp:1125
void give_TeMatrix_L2G(double *answer) const
Copy TeInv (L2G strain transformation matrix) tensor into full matrix answer.
Definition: inclusion.cpp:829
void give_TInv(double *TInv, const double *T, InclusionGeometry inclGeometry)
Function calculates the inverse of transformation matrix for vectors.
#define Ll1111
Definition: inclusion.cpp:607
virtual void giveEllipticIntegrals(double integrArray[13], double lambda, bool intpoint)=0
Function gives the values of Ferers-Dyson&#39;s elliptic integrals of the inclusion this->I.
void DeleteArray2D(bool **array, long d1)
Function deletes a 2D &#39;bool&#39; array of dimension d1 x ??, allocated by new.
#define VEC_SQR_NORM_2D(x, y)
Definition: macros.h:204
InclusionGeometry shape
inclusion shape
Definition: inclusion.h:71
DiffTypes diffType
the type of differentiation actually used. (just for testing purposes)
Definition: problem.h:200
void compute_eps_tau(int strainID, double *e_tau, double *e_z_add, bool add)
Definition: inclusion.cpp:2054
Class mesoface.
Class eshelbySoluEllipticIntegralsEllipticCylinder.
int noActingIncls
Number of acting inclusions.
Definition: inclusion.h:111
void ActingIncls_allocate(void)
Definition: inclusion.cpp:185
void derivative_preparation()
Function computes the integrals and tensor S in auxiliary points around the current point...
Definition: inclusion.cpp:1760
double ** Remote_strain
Remote strain fields == homogeneous strain tensor, stored in TVRN_THEORETICAL_FEEP notation...
Definition: matrix.h:58
double E
Young&#39;s modulus.
Definition: inclusion.h:72
void giveTransformationStrainOperator(double oper[12], const double C[12], const double C1[12], const double S[12])
Function gives the operator converting remote field to transformation eigenstrain of an inclusion...
Definition: inclusion.cpp:646
int find_overlap(const Inclusion *incl) const
Check overlap of the receiver and &#39;incl&#39; inclusion.
Definition: inclusion.cpp:195
double ** AllocateArray2D(long d1, long d2)
Operations with 2d, 3d, 4d arrays of various sizes.
double *** approx_coef
Definition: inclusion.h:122
double * S
Eshelby tensor.
Definition: inclusion.h:87
void set_Youngs_modulus(double val)
Definition: inclusion.h:186
#define Power(a, b)
Definition: inclusion.cpp:585
void initialize(const Inclusion *prevInclRec)
Initialization of this inclusion. Computes characteristic matrices: Eshelby tensor, ...
Definition: inclusion.cpp:1357
void give_EshelbyMatrixReduced(double *answer) const
Copy Eshelby tensor into reduced vector answer.
Definition: inclusion.cpp:789
Class eshelbySoluUniformFieldSphere; return the Eshelby solution of a spherical inclusion loaded by t...
Class eshelbySoluEllipticIntegralsSphere.
double nu(void) const
Definition: matrix.h:107
double approx_point_pos1
Definition: problem.h:198
double give_semiaxes_max_difference(void) const
Give the variable max_axes_diff.
Definition: problem.h:503
virtual void input_data_initialize_and_check_consistency(void)
Definition: inclusion.cpp:267
#define DEG2RAD(a)
Definition: macros.h:132
#define __2211_
Definition: types.h:297
double * TeInv
LOCAL->GLOBAL strain/stress tensor transfrmation matrix; full matrix 6x6 or 3x3 for 3d or 2d...
Definition: inclusion.h:97
Class of the functions calculating the values of elliptic integrals and its derivatives of general el...
bool ST_scan_array(Stream *src, int n, int *dest)
scan/copy array of numbers from src to dest, src pointer is shifted over the field ...
Definition: tixy2.cpp:55
bool scan_locEigStrain_LC(Stream *stream, int lc)
Definition: inclusion.cpp:1112
int * actingIncls
Set of inclusions which act to the "this" one.
Definition: inclusion.h:112
#define __2222_
Definition: types.h:298
double give_VectorVectorProduct(const double *v1, const double *v2, long n)
Operations with 1d arrays of various length.
#define __3311_
Definition: types.h:301
bool scan_locEigStrain_LC(Stream *stream, int lc)
Definition: inclusion.cpp:1551
static int ellipsoids_overlap(const Inclusion *inc1, const Inclusion *inc2)
Definition: mesoface.cpp:37
void set_Poissons_ratio(double val)
Definition: inclusion.h:187
void input_data_initialize_and_check_consistency(void)
Initialize input data readed form vtk file.
Definition: inclusion.cpp:1316
double ndiff_2
derivative step for the second derivations
Definition: inclusion.h:109
void giveExtStrainPert(const double *point, double **strain, int lc, int nlc)
Computes strain perturbation for the epsilon_tau, computed in the ballancing process.
Definition: inclusion.cpp:2079
void AddVector(const double *a, double *b, long n)
Function add given number of components from vector &#39;a&#39; to vector &#39;b&#39;, b += a.
void compute_eps_tau_back(vektor &e_s_, vektor &e_t_)
Definition: inclusion.cpp:1929
virtual void giveEshelbyTensorInverse(double SInv[12], const double S[12])
Function gives the inverse of the Eshelby tensor of an inclusion of arbitrary shape.
Definition: esuf.cpp:348
virtual ~Inclusion()
Destructor.
Definition: inclusion.cpp:119
InclusionRecord2D(long i, const Problem *p)
Constructor.
Definition: inclusion.cpp:1521
#define S2211
Definition: inclusion.cpp:630
Class Problem.
#define S2323
Definition: inclusion.cpp:640
#define S1111
Definition: inclusion.cpp:626
void transformCoords_G2L(const double *glob, double *loc) const
Function transforms (shift according to origin and rotate) global coordinates to local.
Definition: inclusion.cpp:358
double SQRactionRadius
Action radius of the inclusion ^2.
Definition: inclusion.h:107
#define INFTY
Definition: macros.h:143
MatrixRecord * matrix
matrix record
Definition: problem.h:187
void give_StiffnessMatrixReduced(double *answer) const
Copy stiffness tensor into reduced vector answer.
Definition: inclusion.cpp:810
#define S1133
Definition: inclusion.cpp:628
bool give_semiaxis_min_difference_change(void) const
Give the variable min_axes_diff_change.
Definition: problem.h:505
double I(int index)
Definition: inclusion.h:364
void e(int i)
Namespace TransformTensors.
void input_data_initialize_and_check_consistency(void)
Initialize input data readed form vtk file.
Definition: inclusion.cpp:1655
bool scan_eAngles_DEG(Stream *stream)
Definition: inclusion.cpp:156
Class of the functions calculating the values of elliptic integrals and its derivatives of prolate sp...
#define Ll1122
Definition: inclusion.cpp:608