muMECH  1.0
homogenizationMethods.cpp
Go to the documentation of this file.
1 //********************************************************************************************************
2 // code: ### ### ##### #### ## ##
3 // ## ## ######## ## ## ## ## ##
4 // ## ## ## ## ## ### ## ######
5 // ## ## ## ## ## ## ## ## ##
6 // ##### ## ## ##### #### ## ##
7 // ##
8 //
9 // name: homogenization.cpp
10 // author(s): Jan Vorel, 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 // toto je kvuli WIN32_LEAN_AND_MEAN
28 #include "types.h"
29 
30 #include "homogenizationMethods.h"
31 #include "problem.h"
32 #include "mesh.h"
33 #include "mnode.h"
34 #include "melement.h"
35 #include "elementaryFunctions.h"
36 #include "matrixOperations.h"
37 #include "esuf.h"
38 
39 #include <algorithm>
40 
41 
42 namespace mumech {
43 
44 // ********************************************************************
45 // ************ DILUTE METHOD *****************************************
46 // ********************************************************************
48 void
50 {
51 #ifdef DEBUG
52  if( answer == NULL ) _errorr( "Field for stiffness matrix must be allocated" );
53 #endif
54 
55  int mSize = this->giveSizeOfReducedMatrix();
56  int mSizeFull = this->giveSizeOfFullMatrix()*this->giveSizeOfFullMatrix();
57  double *Ai = new double[mSize];
58  double *Cm = new double[mSize];
59  double *CmInv = new double[mSize];
60  double *Ci_Cm = new double[mSize];
61  double *Aig = new double[mSizeFull];
62  double *dum1 = new double[mSizeFull];
63 
64  double ci_sum = 0.0;
65 
66  ProblemType pT = this->giveProblemType();
67 
69  giveInverseOfReducedMatrix(CmInv, Cm, pT);
70 
71 
72  // Dilute homogenization
73  giveFullMatrixFromReducedMatrix(answer, Cm, pT); // answer = Cm;
74 
75  for( int i = 0; i < this->giveNumberOfInclusions(); i++) {
76  if (! inside[i])
77  continue;
78 
79  // concentration factor in local coordinate system
81 
82  // transformation to global coordinate system
83  // Ci and Cm are isotropic => no rotation needed
85 
86  giveProductOfReducedMatrixRegularMatrix(dum1, Ci_Cm, Aig, pT, this->giveSizeOfFullMatrix()); // dum1 = Ci_Cm*Ai;
87 
88  AddVectorMultipledBy(giveVolumeFractionOfInclusion(i), dum1, answer, mSizeFull); // answer += ci*dum1 ( =(ci*(Ci-Cm)*Ai) )
89 
90  ci_sum += giveVolumeFractionOfInclusion(i);
91  }
92 
93  if( ci_sum > 1. ) {
94  _errorr1( "Volume of inclusions is greater then 1" );
95  }
96 
97  delete [] Ai;
98  delete [] Cm;
99  delete [] CmInv;
100  delete [] Ci_Cm;
101  delete [] Aig;
102  delete [] dum1;
103 }
104 
115 void
116 Dilute :: giveDiluteReducedConcentrationFactorOfInclusionInLC( double* answer, double* matrix_inclStiffmat, double* matrixStiffMat, double* matrixComplMat, const long inclusionNumber )
117 {
118 #ifdef DEBUG
119  if( answer == NULL ) _errorr( "Field for Eshelby tensor must be allocated" );
120  if( matrix_inclStiffmat == NULL ) _errorr( "Field for matrix_inclStiffmat tensor must be allocated" );
121 #endif
122 
123  int mSize = this->giveSizeOfReducedMatrix();
124 
125  double *AiInv = new double[mSize];
126  double *Ci = new double[mSize];
127  double *S = new double[mSize];
128  double *dum1 = new double[mSize];
129  double *dum2 = new double[mSize];
130 
131  ProblemType pT = this->giveProblemType();
132 
133  giveReducedUnitMatrix(AiInv, pT); // AiInv = I
134 
135  giveReducedEshelbyMatrixOfInclusion(S, inclusionNumber);
136  giveReducedStiffnessMatrixOfInclusion(Ci, inclusionNumber);
137 
138  CopyVector(Ci, matrix_inclStiffmat, mSize); // Ci_Cm = Ci;
139  AddVectorMultipledBy(-1.0, matrixStiffMat, matrix_inclStiffmat, mSize); // Ci_Cm -= Cm;
140  giveProductOfReducedMatrices(dum1, matrixComplMat, matrix_inclStiffmat, pT); // dum1 = CmInv*Ci_Cm;
141  giveProductOfReducedMatrices(dum2, S, dum1, pT); // dum2 = S*dum1;
142 
143  AddVector(dum2, AiInv, mSize); // AiInv += dum2;
144  giveInverseOfReducedMatrix(answer, AiInv, pT); // Ai = AiInv^{-1};
145 
146  delete [] AiInv;
147  delete [] Ci;
148  delete [] S;
149  delete [] dum1;
150  delete [] dum2;
151 }
152 
163 void
164 Dilute :: giveFullDiluteConcentrationFactorOfInclusionInLC( double* answer, double* matrix_inclStiffmat, double* matrixStiffMat, double* matrixComplMat, const long inclusionNumber )
165 {
166 #ifdef DEBUG
167  if( answer == NULL ) _errorr( "Field for Eshelby tensor must be allocated" );
168  if( matrix_inclStiffmat == NULL ) _errorr( "Field for matrix_inclStiffmat tensor must be allocated" );
169 #endif
170 
171  int mSize = this->giveSizeOfFullMatrix();
172  int nElements = mSize * mSize;
173 
174  double *AiInv = new double[nElements];
175  double *Ci = new double[nElements];
176  double *S = new double[nElements];
177  double *dum1 = new double[nElements];
178  double *dum2 = new double[nElements];
179 
180  ProblemType pT = this->giveProblemType();
181 
182  if( pT != PT_3D ) {
183  _errorr( "Unsupported problem type, must be added" );
184  }
185 
186  giveFullUnitMatrix(AiInv, pT); // AiInv = I
187 
188  // Eshelby ttensor of inclusion in anisotropic matrix
189  InclusionRecord3D *incl = dynamic_cast <InclusionRecord3D*>(P->give_inclusion(inclusionNumber));
190  incl->esuf->giveSijkl(S, incl->a, matrixStiffMat, 15, 40);
191 
192  giveFullStiffnessMatrixOfInclusion(Ci, inclusionNumber);
193 
194  CopyVector(Ci, matrix_inclStiffmat, nElements); // Ci_Cm = Ci;
195  AddVectorMultipledBy(-1.0, matrixStiffMat, matrix_inclStiffmat, nElements); // Ci_Cm -= Cm;
196  giveMatrixMatrixProduct(matrixComplMat, matrix_inclStiffmat, dum1, mSize); // dum1 = CmInv*Ci_Cm;
197  giveMatrixMatrixProduct(S, dum1, dum2, mSize); // dum2 = S*dum1;
198 
199  AddVector(dum2, AiInv, nElements); // AiInv += dum2;
200 
201  CopyVector(AiInv, answer, nElements);
203 
204  delete [] AiInv;
205  delete [] Ci;
206  delete [] S;
207  delete [] dum1;
208  delete [] dum2;
209 }
210 
211 
212 // ********************************************************************
213 // ************ MORI-TANAKA METHOD ************************************
214 // ********************************************************************
217 void
219 {
220 #ifdef DEBUG
221  if( answer == NULL ) _errorr( "Field for stiffness matrix must be allocated" );
222 #endif
223 
224  int mSize = this->giveSizeOfReducedMatrix();
225  int mSizeFull = this->giveSizeOfFullMatrix()*this->giveSizeOfFullMatrix();
226  double *Ai = new double[mSize];
227  double *Cm = new double[mSize];
228  double *CmInv = new double[mSize];
229  double *Ci_Cm = new double[mSize];
230  double *Aig = new double[mSizeFull];
231  double *dum1 = new double[mSizeFull];
232  double *O = new double[mSizeFull];
233  double *I = new double[mSizeFull];
234  double *U = new double[mSizeFull];
235 
236  double ci_sum = 0.0;
237 
238  ProblemType pT = this->giveProblemType();
239 
241  giveInverseOfReducedMatrix(CmInv, Cm, pT);
242 
243 
244  // Mori-Tanaka homogenization
245  giveFullMatrixFromReducedMatrix(answer, Cm, pT); // answer = Cm;
246 
247  CleanVector(O, mSizeFull);
248  CleanVector(U, mSizeFull);
249  for( int i = 0; i < this->giveNumberOfInclusions(); i++) {
250  if (! inside[i])
251  continue;
252 
253  // concentration factor in local coordinate system
255 
256  // transformation to global coordinate system
257  // Ci and Cm are isotropic => no rotation needed
259 
261 
262  giveProductOfReducedMatrixRegularMatrix(dum1, Ci_Cm, Aig, pT, this->giveSizeOfFullMatrix()); // dum1 = Ci_Cm*Ai;
263  AddVectorMultipledBy(giveVolumeFractionOfInclusion(i), dum1, U, mSizeFull); // U += ci*dum1 ( =(ci*(Ci-Cm)*Ai) )
264 
265  ci_sum += giveVolumeFractionOfInclusion(i);
266  }
267 
268  if( ci_sum > 1. ) {
269  _errorr1( "Volume of inclusions is greater then 1" );
270  }
271 
273  AddVectorMultipledBy((1.-ci_sum), I, O, mSizeFull); // O += cm*I
274 
276 
277  giveMatrixMatrixProduct(U, O, dum1, this->giveSizeOfFullMatrix());
278 
279  AddVector(dum1, answer, mSizeFull);
280 
281  delete [] Ai;
282  delete [] Cm;
283  delete [] CmInv;
284  delete [] Ci_Cm;
285  delete [] Aig;
286  delete [] dum1;
287  delete [] O;
288  delete [] I;
289  delete [] U;
290 }
291 
292 
293 // ********************************************************************
294 // ************ REUSS BOUND *******************************************
295 // ********************************************************************
297 void
299 {
300 #ifdef DEBUG
301  if( answer == NULL ) _errorr( "Field for stiffness matrix must be allocated" );
302 #endif
303 
304  int mSize = this->giveSizeOfReducedMatrix();
305  double *C = new double[mSize];
306  double *CInv = new double[mSize];
307  double *answerRedInv = new double[mSize];
308  ProblemType pT = this->giveProblemType();
309 
310  double ci_sum = 0.0;
311 
312 
313  CleanVector(answerRedInv, mSize);
314  for( int i = 0; i < this->giveNumberOfInclusions(); i++) {
315  if (! inside[i])
316  continue;
317 
318  // inclusion stiffness matrix
320 
321  // transformation to global coordinate system
322  // inclusion stiffness matrix is isotropic => no rotation needed
323  giveInverseOfReducedMatrix(CInv, C, pT);
324 
325  AddVectorMultipledBy(giveVolumeFractionOfInclusion(i), CInv, answerRedInv, mSize);
326  ci_sum += giveVolumeFractionOfInclusion(i);
327  }
328 
329  if( ci_sum > 1. ) {
330  _errorr1( "Volume of inclusions is greater then 1" );
331  }
332 
334  giveInverseOfReducedMatrix(CInv, C, pT);
335 
336  AddVectorMultipledBy((1.-ci_sum), CInv, answerRedInv, mSize);
337 
338  // stiffness matrix from compliance matrix
339  giveInverseOfReducedMatrix(C, answerRedInv, pT);
340 
341  giveFullMatrixFromReducedMatrix(answer, C, pT);
342 
343  delete [] C;
344  delete [] CInv;
345  delete [] answerRedInv;
346 }
347 
348 
349 // ********************************************************************
350 // ************ VOIGHT BOUND ******************************************
351 // ********************************************************************
353 void
355 {
356 #ifdef DEBUG
357  if( answer == NULL ) _errorr( "Field for stiffness matrix must be allocated" );
358 #endif
359 
360  int mSize = this->giveSizeOfReducedMatrix();
361  double *C = new double[mSize];
362  double *answerRed = new double[mSize];
363  ProblemType pT = this->giveProblemType();
364 
365  double ci_sum = 0.0;
366 
367 
368  CleanVector(answerRed, mSize);
369  for( int i = 0; i < this->giveNumberOfInclusions(); i++) {
370  if (! inside[i])
371  continue;
372 
373  // inclusion stiffness matrix
375 
376  // transformation to global coordinate system
377  // inclusion stiffness matrix is isotropic => no rotation needed
378 
379  AddVectorMultipledBy(giveVolumeFractionOfInclusion(i), C, answerRed, mSize);
380  ci_sum += giveVolumeFractionOfInclusion(i);
381  }
382 
383  if( ci_sum > 1. ) {
384  _errorr1( "Volume of inclusions is greater then 1" );
385  }
386 
388 
389  AddVectorMultipledBy((1.-ci_sum), C, answerRed, mSize);
390 
391  giveFullMatrixFromReducedMatrix(answer, answerRed, pT);
392 
393  delete [] C;
394  delete [] answerRed;
395 }
396 
397 
398 // ********************************************************************
399 // ************ REGULAR GRID ******************************************
400 // ********************************************************************
402 
404 void
406 {
407 #ifdef DEBUG
408  if( answer == NULL ) _errorr( "Field for stiffness matrix must be allocated" );
409 #endif
410 
411  if (this->mesh) {
412  // CHECK
413  if (P->give_matrix()->remote_strain_is_unit() == false) _errorr("Remote strain is not equal to \"unit set\".");
414  if (P->is_converted_to_equivalent() == false) _errorr("Problem is not converted to equivalent.");
415  // tady be se melo zkontrolovat, ze v meshi jsou spocitany vsechny vysledky, tj. vsechny jednotkove stavy
416  }
417  else {
418  // tady se predpoklada, ze nejou zatezovaci stavy, neni prevedeno na equivalent problem
419  // to vse je treba dat do cajku, zkontrolovat, ze to je spocitano, popripade spocitat...
420 
421  // NO MESH, mesh has to be genereated inside of bounding box
422  //P->give_matrix()->set_unit_remote_strain();
423  //P->input_data_initialize_and_check_consistency();
424  //P->convert_to_equivalent_problem ();
425 
426  long n[3];
427  n[0] = n[1] = n[2] = 40;
428  if (P->give_twodim()) n[2] = 0;
429 
430  Mesh *bbmesh = P->give_new_mesh();
431  bbmesh->generate_regular_mesh (bb1, bb2, n);
432  bbmesh->compute_element_fields ('t', false, true, true, 0, 0, 0, PFCM_FULL);
433  mesh = bbmesh;
434  bbmesh = NULL;
435  }
436 
437  // debug
438  //mesh->print_geometry_file_vtk("homog/bounding_box.vtk",5,1);
439 
440  int tr = P->give_VM_TENS_RANGE();
441 
442  //
443  double *strain = Allocate1Ddz(tr*tr);
444  double *stress = Allocate1Ddz(tr*tr);
445 
446  bool rmsh = mesh->mtA == MT_REGULAR;
447  double voli, vol = 0.0;
448 
449  long i, j, k;
450  for (i=0; i<mesh->nElems; i++) {
451  if (rmsh) voli = 1.0;
452  else voli = mesh->Elems[i]->give_volume();
453 
454  vol += voli;
455 
456  // loop over load cases
457  for (j=0; j<tr; j++)
458  // loop over stress vector
459  for (k=0; k<tr; k++) {
460  strain[tr*k+j] += voli * mesh->Elems[i]->strain[0][j][k];
461  stress[tr*k+j] += voli * mesh->Elems[i]->stress[0][j][k];
462  }
463  }
464 
465  DivideVector (strain, tr*tr, vol);
466  DivideVector (stress, tr*tr, vol);
467 
469  // tady to musim prenasobit inversnim strainem, pac prumerny strain nebude jednotkovy, pac homogenizuju na prilis male oblasti, ne na nekonecnu
470  if (1) giveMatrixMatrixProduct (stress, strain, answer, tr);
471  else CopyVector(stress, answer, tr*tr);
472 
473  //
474  delete [] strain;
475  delete [] stress;
476 
477 }
478 
479 
480 // ********************************************************************
481 // ************ DIFFERENTIAL SCHEME ***********************************
482 // ********************************************************************
484 void
486 {
487 #ifdef DEBUG
488  if( answer == NULL ) _errorr( "Field for stiffness matrix must be allocated" );
489 #endif
490 
491  int mSize = this->giveSizeOfFullMatrix();
492  int nElements = mSize*mSize;
493 
494  double *Ceff = new double[nElements];
495  double *CeffInv = new double[nElements];
496  double *CeffLoc = new double[nElements];
497  double *CeffInvLoc = new double[nElements];
498  double *Ai = new double[nElements];
499  double *Ci_Cm = new double[nElements];
500  double *AiLoc = new double[nElements];
501  double *Ci_CmLoc = new double[nElements];
502  double *dum1 = new double[nElements];
503 
504  double ci_sum = 0.0;
505 
506  // sorting of inclusion based on their volume
507  Inclusion **incl = new Inclusion*[this->giveNumberOfInclusions()];
508  for( int i = 0; i < this->giveNumberOfInclusions(); i++) {
509  incl[i] = this->P->give_inclusion(i);
510  }
511  std::sort(incl, incl+this->giveNumberOfInclusions(), &ascendingSort);
512 
513 
514  P->matrix_giveFullStiffMatrix(Ceff); // stifness of the matrix (isotropic)
515  for( int i = 0; i < this->giveNumberOfInclusions(); i++) {
516 
517  // each inclusion is threated separately and effective stiffness is determined when new inclusion is added
518  // Dilute scheme is utilized in this task (// Ceff_{i} = Ceff_{i-1} + (ci*(Ci-Cm)*Ai))
519 
520  // id of the inclusion - based on the volume
521  int ii = incl[i]->id;
522 
523  CopyVector(Ceff, CeffInv, nElements);
524  MatrixOperations::giveInverseMatrix(CeffInv, mSize);
525  if( i > 0 ) {
526  // rotation to LC of the inclusion
527  giveFullMatrixInLCSFromFullMatrixInGCS(CeffLoc, Ceff, ii);
528  giveFullMatrixInLCSFromFullMatrixInGCS(CeffInvLoc, CeffInv, ii);
529  } else {
530  // Initial stiffness matrix is isotropic
531  CopyVector(Ceff, CeffLoc, nElements);
532  CopyVector(CeffInv, CeffInvLoc, nElements);
533  }
534 
535  // concentration factor in local coordinate system
536  giveFullDiluteConcentrationFactorOfInclusionInLC(AiLoc, Ci_CmLoc, CeffLoc, CeffInvLoc, ii);
537 
538  // transformation to global coordinate system
539  giveFullMatrixInGCSFromFullMatrixInLCS(Ci_Cm, Ci_CmLoc, ii);
541 
542 
543  giveMatrixMatrixProduct(Ci_Cm, Ai, dum1, mSize); // dum1 = Ci_Cm*Ai;
544 
545  AddVectorMultipledBy(giveVolumeFractionOfInclusion(ii), dum1, Ceff, nElements); // answer += ci*dum1 ( =(ci*(Ci-Cm)*Ai) )
546 
547  // calculation of total volume
548  ci_sum += giveVolumeFractionOfInclusion(ii);
549  }
550 
551  CopyVector(Ceff, answer, nElements);
552 
553  delete [] Ceff;
554  delete [] CeffInv;
555  delete [] CeffLoc;
556  delete [] CeffInvLoc;
557  delete [] Ai;
558  delete [] Ci_Cm;
559  delete [] AiLoc;
560  delete [] Ci_CmLoc;
561  delete [] dum1;
562  delete [] incl;
563 }
564 
565 } // end of namespace mumech
566 
567 /*end of file*/
MatrixRecord * give_matrix(void) const
Definition: problem.h:509
Class eshelbySoluUniformField.
int give_VM_TENS_RANGE(void) const
Gives range of a second order tensor in Voigt-Mandel notation.
Definition: problem.h:98
void generate_regular_mesh(const double *p1, const double *p2, const long *n)
Generate regular mesh geometry of rectangular cuboid shape compound of rectangular cuboid shape eleme...
Definition: mesh.cpp:260
file of various types and symbolic constant definitions
virtual void giveHomogenizedStiffnessMatrix(double *answer)
Function returning the homogenized stiffness matrix according the defined method. ...
void giveReducedUnitMatrix(double *answer, ProblemType pT)
Problem * P
Problem description.
virtual void giveSijkl(double S[36], const double sort_a[3], const double stiffMat[36], int M_partition, int N_partition)
Definition: esuf.cpp:473
void matrix_giveReducedStiffMatrix(double *m) const
Definition: problem.h:329
void AddVectorMultipledBy(double mlt, const double *a, double *b, long n)
Function add given number of components multiplied by &#39;mlt&#39; from vector &#39;a&#39; to vector &#39;b&#39;...
bool * inside
Flag - inclusion inside of the bounding box.
Class InclusionRecord contains and handles all inclusion data.
Definition: inclusion.h:60
eshelbySoluUniformField * esuf
Definition: inclusion.h:285
int giveNumberOfInclusions() const
Namespace MatrixOperations.
void giveDiluteReducedConcentrationFactorOfInclusionInLC(double *answer, double *matrix_inclStiffmat, double *matrixStiffMat, double *matrixComplMat, const long inclusionNumber)
!!! Everything is calculated in local coordinate system
double bb1[3]
Coordinates of lower corner of the bounding box.
Class Mesh.
virtual void giveHomogenizedStiffnessMatrix(double *answer)
Function returning the homogenized stiffness matrix according the defined method. ...
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;.
Inclusion * give_inclusion(long i) const
debug, for one function in tools
Definition: problem.h:402
virtual bool is_converted_to_equivalent(void) const
Give type of ...
Definition: problem.h:483
bool remote_strain_is_unit(void) const
Check the remote strain is unit.
Definition: matrix.cpp:180
ProblemType giveProblemType() const
void giveProductOfReducedMatrixRegularMatrix(double *answer, double *redA, double *B, ProblemType pT, int n)
Function returning full matrix stored row by row in vector array.
Class mElement, mesh element.
void giveFullStiffnessMatrixOfInclusion(double *answer, const long inclusionNumber)
void giveFullMatrixInGCSFromReducedMatrixInLCS(double *answer, double *ALoc, const long inclusionNumber)
void giveProductOfReducedMatrices(double *answer, double *A, double *B, ProblemType pT)
virtual void giveHomogenizedStiffnessMatrix(double *answer)
Function returning the homogenized stiffness matrix according the defined method. ...
void giveFullMatrixInLCSFromFullMatrixInGCS(double *answer, double *AGlob, const long inclusionNumber)
3D inclusion record.
Definition: inclusion.h:278
Collection of the functions of basic manipulations, some of them can be used instead of their counter...
double * Allocate1Ddz(long d1)
Function allocates (&#39;new&#39; command) a 1d array of double set to zero.
void matrix_giveFullStiffMatrix(double *m) const
Definition: problem.h:330
void giveFullUnitMatrix(double *answer, ProblemType pT)
virtual void giveHomogenizedStiffnessMatrix(double *answer)
Function returning the homogenized stiffness matrix according the defined method. ...
void giveReducedEshelbyMatrixOfInclusion(double *answer, const long inclusionNumber)
void giveFullMatrixFromReducedMatrix(double *answer, const double *A, ProblemType pT)
Function returning full matrix stored row by row in vector array.
void compute_element_fields(char flag, bool displc_flag, bool strain_flag, bool stress_flag, int pid, int lc, int nLC, PFCmode pfcMode)
predpokladame trojuhelnikove nebo tetrahedron prvky, tj. na elementu budeme drzet jednu hodnotu ...
Definition: mesh.cpp:1138
void giveFullMatrixInGCSFromFullMatrixInLCS(double *answer, double *ALoc, const long inclusionNumber)
void giveFullDiluteConcentrationFactorOfInclusionInLC(double *answer, double *matrix_inclStiffmat, double *matrixStiffMat, double *matrixComplMat, const long inclusionNumber)
!!! Everything is calculated in local coordinate system
virtual void giveHomogenizedStiffnessMatrix(double *answer)
Function returning the homogenized stiffness matrix according the defined method. ...
void DivideVector(double *a, long n, double val)
Function divides &#39;n&#39; components of field &#39;a&#39; by value &#39;val&#39;.
void giveMatrixMatrixProduct(const double *mtrx1, const double *mtrx2, double *resMtrx, long n)
Function gives the product of two regular matrices.
Class HomogenizationMethods.
double * a
Inclusion semiaxes&#39; dimensions in global arrangement.
Definition: inclusion.h:76
#define _errorr(_1)
Definition: gelib.h:160
Class mNode, mesh node.
long id
identification number
Definition: inclusion.h:68
int give_twodim(void) const
Definition: problem.h:84
Mesh * give_new_mesh(void)
Give verbose level.
Definition: problem.cpp:2076
double giveVolumeFractionOfInclusion(const long inclusionNumber)
void giveReducedStiffnessMatrixOfInclusion(double *answer, const long inclusionNumber)
void giveInverseMatrix(double *mtrx, int n)
Function computes inversion of squared matrix mtrx.
#define _errorr1(_1)
Definition: gelib.h:153
double bb2[3]
Coordinates of upper corner of the bounding box.
Class Mesh contains and handles all mesh data.
Definition: mesh.h:52
void CleanVector(double *a, long n)
Functin cleans a &#39;double&#39; vector, initialize each value being 0-zero.
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.
Class Problem.
virtual void giveHomogenizedStiffnessMatrix(double *answer)
Function returning the homogenized stiffness matrix according the defined method. ...
void giveInverseOfReducedMatrix(double *answer, const double *rM, ProblemType pT)