muMECH  1.0
matrixOperations.cpp
Go to the documentation of this file.
1 //********************************************************************************************************
2 // code: ### ### ##### #### ## ##
3 // ## ## ######## ## ## ## ## ##
4 // ## ## ## ## ## ### ## ######
5 // ## ## ## ## ## ## ## ## ##
6 // ##### ## ## ##### #### ## ##
7 // ##
8 //
9 // name: matrixOperations.cpp
10 // author(s): Jan Novak
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 "matrixOperations.h"
28 #include "elementaryFunctions.h"
29 #include "macros.h"
30 #include <math.h>
31 
32 
33 namespace mumech {
34 
35 
43 double MatrixOperations :: giveTTproduct_1is2x2to3and2x2to3_SS (const double *T1, const double *T2)
44 {
45  return T1[0]*T2[0] + T1[1]*T2[1] + 2.0*T1[2]*T2[2];
46 }
47 
48 
49 //********************************************************************************************************
50 // description: function prints a field which is saved as 2D array
51 // last edit: 25. 01. 2010
52 // -------------------------------------------------------------------------------------------------------
53 // note: @field - '@n x @m' matrix
54 // @n - number of rows of printed field
55 // @m - number of columns of printed field
56 //********************************************************************************************************
57 void MatrixOperations :: printField( double ** field, int n, int m, const char * notice )
58 {
59  printf( "%s", notice );
60  for( int i = 0; i < n; i++ ){
61  for( int j = 0; j < m; j++ ){
62  if( ABS( field[i][j] ) > MACHINE_EPS_PRN ){
63  printf( "%.6e ", field[i][j] );
64  }
65  else{
66  printf( "%.6e ", 0. );
67  }
68  }printf( "\n" );
69  }
70 
71  return ;
72 }//end of function: printField( )
73 
75 void MatrixOperations :: giveIsoTensAndVectorProduct (const double *tens, const double *vect, double *result, int dim)
76 {
77  if( vect == result ){//in-place product
78  double *auxVec = new double[dim];
79  //product calculation
80  if (dim == 3) {
81  auxVec[0] = tens[0] * vect[0] + tens[3] * vect[1] + tens[5] * vect[2];
82  auxVec[1] = tens[3] * vect[0] + tens[1] * vect[1] + tens[4] * vect[2];
83  auxVec[2] = tens[5] * vect[0] + tens[4] * vect[1] + tens[2] * vect[2];
84  }
85  else if (dim == 2) {
86  auxVec[0] = tens[0] * vect[0] + tens[2] * vect[1];
87  auxVec[1] = tens[2] * vect[0] + tens[1] * vect[1];
88  }
89  else _errorr("unsupported dimension");
90 
91  //result initialization
92  CopyVector(auxVec, result, dim);
93  delete [] auxVec;
94  }
95  else{//ou-of-place product
96  //product calculation and result initialization
97  if (dim == 3) {
98  result[0] = tens[0] * vect[0] + tens[3] * vect[1] + tens[5] * vect[2];
99  result[1] = tens[3] * vect[0] + tens[1] * vect[1] + tens[4] * vect[2];
100  result[2] = tens[5] * vect[0] + tens[4] * vect[1] + tens[2] * vect[2];
101  }
102  else if (dim == 2) {
103  result[0] = tens[0] * vect[0] + tens[2] * vect[1];
104  result[1] = tens[2] * vect[0] + tens[1] * vect[1];
105  }
106  else _errorr("unsupported dimension");
107  }
108 
109  return ;
110 }//end of function: giveIsoTensAndVectorProduct( )
111 
113 void MatrixOperations :: giveTVproduct_6is6x6to12and6 (double *result, const double *T, const double *vect)
114 {
115  if( vect == result ){//in-place product
116  double auxVect[6];
117  //product calculation
118  auxVect[0] = T[0] * vect[0] + T[1] * vect[1] + T[2] * vect[2];
119  auxVect[1] = T[3] * vect[0] + T[4] * vect[1] + T[5] * vect[2];
120  auxVect[2] = T[6] * vect[0] + T[7] * vect[1] + T[8] * vect[2];
121  auxVect[3] = T[9] * vect[3];
122  auxVect[4] = T[10] * vect[4];
123  auxVect[5] = T[11] * vect[5];
124  //result initialization
125  CopyVector(auxVect, result, 6);
126  }
127  else{//ou-of-place product
128  //product calculation and result initialization
129  result[0] = T[0] * vect[0] + T[1] * vect[1] + T[2] * vect[2];
130  result[1] = T[3] * vect[0] + T[4] * vect[1] + T[5] * vect[2];
131  result[2] = T[6] * vect[0] + T[7] * vect[1] + T[8] * vect[2];
132  result[3] = T[9] * vect[3];
133  result[4] = T[10] * vect[4];
134  result[5] = T[11] * vect[5];
135  }
136 
137  return ;
138 }
139 
141 void MatrixOperations :: giveTVproduct_3is3x3to5and3 (double *result, const double *T, const double *vect)
142 {
143  if( vect == result ){//in-place product
144  double auxVect[3];
145  //product calculation
146  auxVect[0] = T[0] * vect[0] + T[1] * vect[1];
147  auxVect[1] = T[2] * vect[0] + T[3] * vect[1];
148  auxVect[2] = T[4] * vect[2];
149  //result initialization
150  CopyVector(auxVect, result, 3);
151  }
152  else{//ou-of-place product
153  //product calculation and result initialization
154  result[0] = T[0] * vect[0] + T[1] * vect[1];
155  result[1] = T[2] * vect[0] + T[3] * vect[1];
156  result[2] = T[4] * vect[2];
157  }
158 }
159 
161 double MatrixOperations :: giveVTVproduct_1is3and3x3to5and3 (const double *T, const double *vect)
162 {
163  return
164  vect[0] * ( T[0] * vect[0] + T[1] * vect[1]) +
165  vect[1] * ( T[2] * vect[0] + T[3] * vect[1]) +
166  vect[2] * ( T[4] * vect[2]);
167 }
168 
170 void MatrixOperations :: giveTTproduct_3x3to5is3x3to5and3x3to5 (double *result, const double *T1, const double *T2)
171 {
172  if (result == T1 || result == T2) { //in-place product
173  _errorr("in-place product not implemented yet");
174  }
175  else { //out-of-place product
176  result[0] = T1[0] * T2[0] + T1[1] * T2[2]; result[1] = T1[0] * T2[1] + T1[1] * T2[3];
177  result[2] = T1[2] * T2[0] + T1[3] * T2[2]; result[3] = T1[2] * T2[1] + T1[3] * T2[3];
178 
179  result[4] = T1[4] * T2[4];
180  }
181 }
182 
183 
184 
185 
186 
187 
188 
189 //********************************************************************************************************
190 // description: function prints a field which is saved as 2D array
191 // last edit: 24. 02. 2010
192 // -------------------------------------------------------------------------------------------------------
193 // note: @field - '@n x @m' matrix
194 // @n - number of rows of printed field
195 // @m - number of columns of printed field
196 // @lineBreak - a number after which the line break is expected (formating purposes)
197 //********************************************************************************************************
198 void MatrixOperations :: printField( double ** field, int n, int m, int lineBreak, const char * notice )
199 {
200  int i = 0, j = 0, k = 0;
201 
202  printf( "%s", notice );
203  for( i = 0; i < n; i++ ){
204  for( j = 0; j < m; j++, k++ ){
205  if( k == lineBreak ){
206  printf( "\n" );
207  k = 0;
208  }else ;
209  if( ABS( field[i][j] ) > MACHINE_EPS_PRN ){
210  ( k == 0 )? printf( "%.6e", field[i][j] ) : printf( " %.6e", field[i][j] );
211  }
212  else{
213  ( k == 0 )? printf( "%.6e", 0. ) : printf( " %.6e", 0. );
214  }
215  }printf( "\n\n" ); k = 0;
216  }
217 
218  return ;
219 }//end of function: printField( )
220 
221 //********************************************************************************************************
222 // description: function prints an anisotropic field of type 'double' which is saved as 2D anisotropic
223 // array
224 // last edit: 25. 02. 2010
225 // -------------------------------------------------------------------------------------------------------
226 // note: @field - '@n x @m' matrix
227 // @n - number of rows of printed field
228 // @m - pointer to a vecotor containig the length (number of entries) of each line
229 // @lineBreak - a number after which the line break is expected (formating purposes)
230 //********************************************************************************************************
231 void MatrixOperations :: printAnisoField( double ** field, int n, int * m, int lineBreak,
232  const char * notice )
233 {
234  int i = 0, j = 0, k = 0;
235 
236  printf( "%s", notice );
237  for( i = 0; i < n; i++ ){
238  for( j = 0; j < m[i]; j++, k++ ){
239  if( k == lineBreak ){
240  printf( "\n" );
241  k = 0;
242  }else ;
243  if( ABS( field[i][j] ) > MACHINE_EPS_PRN ){
244  ( k == 0 )? printf( "%.6e", field[i][j] ) : printf( " %.6e", field[i][j] );
245  }
246  else{
247  ( k == 0 )? printf( "%.6e", 0. ) : printf( " %.6e", 0. );
248  }
249  }printf( "\n\n" ); k = 0;
250  }
251 
252  return ;
253 }//end of function: printAnisoField( )
254 
255 //********************************************************************************************************
256 // description: function prints an anisotropic field ot type 'int' which is saved as 2D anisotropic array
257 // last edit: 25. 02. 2010
258 // -------------------------------------------------------------------------------------------------------
259 // note: @field - '@n x @m' matrix
260 // @n - number of rows of printed field
261 // @m - pointer to a vecotor containig the length (number of entries) of each line
262 // @lineBreak - a number after which the line break is expected (formating purposes)
263 //********************************************************************************************************
264 void MatrixOperations :: printAnisoField( int ** field, int n, int * m, int lineBreak,
265  const char * notice )
266 {
267  int i = 0, j = 0, k = 0;
268 
269  printf( "%s", notice );
270  for( i = 0; i < n; i++ ){
271  for( j = 0; j < m[i]; j++, k++ ){
272  if( k == lineBreak ){
273  printf( "\n" );
274  k = 0;
275  }else ;
276  if( ABS( field[i][j] ) > MACHINE_EPS_PRN ){
277  ( k == 0 )? printf( "%d", field[i][j] ) : printf( " %d", field[i][j] );
278  }
279  else{
280  ( k == 0 )? printf( "%d", 0 ) : printf( " %d", 0 );
281  }
282  }printf( "\n\n" ); k = 0;
283  }
284 
285  return ;
286 }//end of function: printAnisoField( )
287 
288 
289 
290 void ludcmp(double **a, int n, int *indx, double *d)
291 {
292  int i,imax,j,k;
293  double big,dum,temp=0;
294  double *vv;
295 
296  vv = new double [n];
297  *d=1.0;
298  for (i=0;i<n;i++) {
299  big=0.0;
300  for (j=0;j<n;j++) {
301  temp=fabs(a[i][j]);
302  if (temp > big) big=temp;
303  }
304  if (big == 0.0) _errorr1( "Singular matrix in routine ludcmp\n");
305  vv[i]=1.0/big;
306  }
307 
308  for (j=0;j<n;j++) {
309  for (i=0;i<j;i++)
310  {
311  for (k=0;k<i;k++)
312  a[i][j] -= a[i][k]*a[k][j];
313  }
314  big=0.0;
315  for (i=j;i<n;i++)
316  {
317  for (k=0;k<j;k++)
318  a[i][j] -= a[i][k]*a[k][j];
319  if((dum=vv[i]*fabs(a[i][j])) >= big)
320  {
321  big=dum;
322  imax=i;
323  }
324  }
325  if (j != imax)
326  {
327  for (k=0;k<n;k++)
328  {
329  dum=a[imax][k];
330  a[imax][k]=a[j][k];
331  a[j][k]=dum;
332  }
333  *d = -(*d);
334  vv[imax]=vv[j];
335  }
336  indx[j]=imax;
337  if (a[j][j] == 0.0)
338  a[j][j] = 1.0e-20;
339  if (j != n-1)
340  {
341  dum=1.0/(a[j][j]);
342  for (i=j+1;i<n;i++)
343  a[i][j] *= dum;
344  }
345  }
346  delete [] vv;
347 }
348 
349 void lubksb(double **a, int n, int *indx, double b[])
350 {
351  int i,ii=-1,ip,j;
352  double sum;
353 
354  for (i=0;i<n;i++) {
355  ip=indx[i];
356  sum=b[ip];
357  b[ip]=b[i];
358  if (ii>=0.0)
359  for (j=ii;j<i;j++) sum -= a[i][j]*b[j];
360  else if (sum) ii=i;
361  b[i]=sum;
362  }
363  for (i=n-1;i>-1;i--) {
364  sum=b[i];
365  for (j=i+1;j<n;j++) sum -= a[i][j]*b[j];
366  b[i]=sum/a[i][i];
367  }
368 }
369 
370 
377 void
379 {
380 #ifdef DEBUG
381  if (mtrx == NULL) _errorr( "No matrix for inversion defined" );
382  if (n == 0 ) _errorr( "Zero size of the matrix for inversion" );
383 #endif
384 
385  double **A = NULL;
386  AllocateArray2D (A,n,n);
387  copyMatrix_1Dto2D (mtrx, A, n);
388 
389  giveInverseMatrix_core (&mtrx, A, n, true);
390 
391  DeleteArray2D(A, n);
392 }
393 
400 void
402 {
403 #ifdef DEBUG
404  if (mtrx == NULL) _errorr( "No matrix for inversion defined" );
405  if (n == 0 ) _errorr( "Zero size of the matrix for inversion" );
406 #endif
407 
408  double **A = NULL;
409  AllocateArray2D (A,n,n);
410  CopyArray2D(mtrx, A, n, n);
411 
412  giveInverseMatrix_core (mtrx, A, n, true);
413 
414  DeleteArray2D(A, n);
415 }
416 
423 void
424 MatrixOperations :: giveInverseMatrix_core (double **answer, double **mtrx, int n, bool vect)
425 {
426 #ifdef DEBUG
427  if (answer == NULL) _errorr ("Field for answer must be allocated");
428  if (mtrx == NULL) _errorr( "No matrix for inversion defined" );
429  if (n == 0 ) _errorr( "Zero size of the matrix for inversion" );
430 #endif
431 
432  int i, j;
433  double d;
434 
435  double *col = new double [n];
436  int *indx = new int [n];
437 
438  ludcmp( mtrx, n, indx, &d );
439 
440  for ( j=0; j<n; j++ ) {
441  for ( i=0; i<n; i++ ) col[i] = 0.0;
442  col[j] = 1.0;
443  lubksb( mtrx, n, indx, col );
444  if (vect) for ( i=0; i<n; i++ ) answer[0][i*n + j] = col[i];
445  else for ( i=0; i<n; i++ ) answer [i ][j] = col[i];
446  }
447 
448  delete [] col;
449  delete [] indx;
450 }
451 
452 
453 
454 
455 
456 
458 
460 void MatrixOperations :: CopyTensorAndReduceToFeep (const double *a, double *b)
461 {
462  b[0] = a[0];
463  b[1] = a[4];
464  b[2] = a[8];
465  b[3] = a[1];
466  b[4] = a[5];
467  b[5] = a[2];
468 
469  return ;
470 }//end of function: CopyTensorAndReduceToFeep( )
471 
477 {
478  t[3] = t[1];
479  t[1] = t[2];
480 }
483 {
484  t[8] = t[2];
485  t[7] = t[4];
486  t[2] = t[5];
487  t[6] = t[5];
488  t[5] = t[7];
489  t[4] = t[1];
490  t[1] = t[3];
491 }
494 {
495  t[2] *= 2.0;
496 }
499 {
500  t[3] *= 2.0;
501  t[4] *= 2.0;
502  t[5] *= 2.0;
503 }
504 
507 {
508  if (t[1] != t[3] || t[2] != t[6] || t[5] != t[7]) _errorr("tensor is not symmetrical");
509  t[1] = t[4];
510  t[2] = t[8];
511  t[4] = t[7];
512  t[5] = t[6];
513  t[6] = t[7] = t[8] = 0.0;
514 }
517 {
518  if (t[1] != t[2]) _errorr("tensor is not symmetrical");
519  t[1] = t[3];
520  t[3] = 0.0;
521 }
522 
524 void MatrixOperations :: copy3Dto2Dtensors_FEEPreduced (const double *a, double *b)
525 {
526  b[0] = a[0];
527  b[1] = a[1];
528  b[2] = a[3];
529 }
531 void MatrixOperations :: copy2Dto3Dtensors_FEEPreduced (const double *a, double *b)
532 {
533  b[0] = a[0];
534  b[1] = a[1];
535  b[2] = 0.0;
536  b[3] = a[2];
537  b[4] = 0.0;
538  b[5] = 0.0;
539 }
540 
543 {
544  CleanArray2d (b, 6, 6);
545 
546  b[0][0] = a[0];
547  b[0][1] = a[1];
548  b[0][2] = a[2];
549 
550  b[1][0] = a[3];
551  b[1][1] = a[4];
552  b[1][2] = a[5];
553 
554  b[2][0] = a[6];
555  b[2][1] = a[7];
556  b[2][2] = a[8];
557 
558  b[3][3] = a[9];
559  b[4][4] = a[10];
560  b[5][5] = a[11];
561 }
564 {
565  CleanArray2d (b, 3, 3);
566 
567  b[0][0] = a[0];
568  b[0][1] = a[1];
569 
570  b[1][0] = a[2];
571  b[1][1] = a[3];
572 
573  b[2][2] = a[4];
574 }
575 
576 
577 
580 {
581  b[0] = a[0];
582  b[1] = a[1];
583  b[2] = a[2];
584 
585  b[3] = a[6];
586  b[4] = a[7];
587  b[5] = a[8];
588 
589  b[6] = a[12];
590  b[7] = a[13];
591  b[8] = a[14];
592 
593  b[ 9] = a[21];
594  b[10] = a[28];
595  b[11] = a[35];
596 }
597 
599 {
600  CleanVector(b, 6*6);
601 
602  b[ 0] = a[0];
603  b[ 1] = a[1];
604  b[ 2] = a[2];
605 
606  b[ 6] = a[3];
607  b[ 7] = a[4];
608  b[ 8] = a[5];
609 
610  b[12] = a[6];
611  b[13] = a[7];
612  b[14] = a[8];
613 
614  b[21] = a[9];
615  b[28] = a[10];
616  b[35] = a[11];
617 }
618 
620 {
621  b[0] = a[0];
622  b[1] = a[1];
623  b[2] = a[3];
624  b[3] = a[4];
625  b[4] = a[8];
626 }
628 {
629  CleanVector(b, 9);
630 
631  b[0] = a[0];
632  b[1] = a[1];
633  b[3] = a[2];
634  b[4] = a[3];
635  b[8] = a[4];
636 }
637 
638 
639 
640 // /**
641 // * Function prints an Isotropic tensor having only 12 nonzero entries in matrix form.
642 // * @param s[12] Eshelby tensor
643 // * @param flag _MATEMATHICA_SYNTAX_ or _STANDARD_SYNTAX_
644 // */
645 // void MatrixOperations :: printSMatrixReduced (double S[12], const char * notice, unsigned flag)
646 // {
647 // if( flag == _STANDARD_SYNTAX_ ){
648 // printf( "%s", notice );
649 // printf( "%e %e %e %e %e %e\n", S[0], S[1], S[2], 0., 0., 0. );
650 // printf( "%e %e %e %e %e %e\n", S[3], S[4], S[5], 0., 0., 0. );
651 // printf( "%e %e %e %e %e %e\n", S[6], S[7], S[8], 0., 0., 0. );
652 // printf( "%e %e %e %e %e %e\n", 0., 0., 0., S[9], 0., 0. );
653 // printf( "%e %e %e %e %e %e\n", 0., 0., 0., 0., S[10], 0. );
654 // printf( "%e %e %e %e %e %e\n", 0., 0., 0., 0., 0., S[11] );
655 // }
656 // else if( flag == _MATHEMATICA_SYNTAX_ ){//suitable for debuging
657 // printf( "%s", notice );
658 // printf( "{{%.6lf,%.6lf,%.6lf,%.6lf,%.6lf,%.6lf},", S[0], S[1], S[2], 0., 0., 0. );
659 // printf( "{%.6lf,%.6lf,%.6lf,%.6lf,%.6lf,%.6lf},", S[3], S[4], S[5], 0., 0., 0. );
660 // printf( "{%.6lf,%.6lf,%.6lf,%.6lf,%.6lf,%.6lf},", S[6], S[7], S[8], 0., 0., 0. );
661 // printf( "{%.6lf,%.6lf,%.6lf,%.6lf,%.6lf,%.6lf},", 0., 0., 0., S[9], 0., 0. );
662 // printf( "{%.6lf,%.6lf,%.6lf,%.6lf,%.6lf,%.6lf},", 0., 0., 0., 0., S[10], 0. );
663 // printf( "{%.6lf,%.6lf,%.6lf,%.6lf,%.6lf,%.6lf}}\n", 0., 0., 0., 0., 0., S[11] );
664 // }
665 // else{
666 // _errorr( "printIsoTensor: unknown syntax flag");
667 // }
668 //
669 // return ;
670 // }//end of function: printIsoTensor( )
671 
672 
673 
674 
675 } // end of namespace mumech
676 
677 /*end of file*/
void convert2Dtensor_TRtoVR_notation(double *t)
Function convert the symmetric double 2D tensor &#39;t&#39;.
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...
void printField(double **field, int n, int m, const char *notice)
Function prints a field which is saved as 2D array.
double giveTTproduct_1is2x2to3and2x2to3_SS(const double *T1, const double *T2)
Function gives scalar left-right product of tensor and tensor.
void convert3Dtensor_9ROWto6FEEP_notation(double *t)
void convert2Dtensor_4ROWto3FEEP_notation(double *t)
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...
Namespace MatrixOperations.
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;.
double giveVTVproduct_1is3and3x3to5and3(const double *T, const double *vect)
Function gives scalar left-right product of tensor and vector - &#39;result = vect^T * T * vect&#39;...
void giveTVproduct_6is6x6to12and6(double *result, const double *T, const double *vect)
Function gives product of tensor and vector - &#39;result = T * vect&#39;.
void printAnisoField(double **field, int n, int *m, int lineBreak, const char *notice)
Function prints an anisotropic field of type &#39;double&#39; which is saved as 2D anisotropic array...
void CopyArray2D(const double *const *src, double **dest, long d1, long d2)
Function copy two 2D double arrays with dimensions d1xd2 from &#39;src&#39; to &#39;dest&#39;.
void copy2Dto3Dtensors_FEEPreduced(const double *a, double *b)
Function copy the symmetric double 2D tensor &#39;a&#39; to 3D tensor &#39;b&#39;.
The header file of usefull macros.
Collection of the functions of basic manipulations, some of them can be used instead of their counter...
void CleanArray2d(double **a, long rows, long columns)
Function cleans an 2d &#39;double&#39; array, initialize each value being 0-zero.
void copy2DeshelbyTensor_full2reduced(const double *a, double *b)
Function copies and converts 2D eshelby/stiffness tensor saved in full row-wise vector &#39;a&#39; to reduced...
#define ABS(a)
Definition: macros.h:118
void giveTTproduct_3x3to5is3x3to5and3x3to5(double *result, const double *T1, const double *T2)
Function gives product of tensor and tensor - &#39;result = T1 * T2&#39;.
void convert3Dtensor_TRtoVR_notation(double *t)
Function convert the symmetric double 3D tensor &#39;t&#39;.
#define MACHINE_EPS_PRN
Definition: macros.h:69
void convert2Dtensor_TRtoROW_notation(double *t)
Function convert the symmetric double 2D tensor &#39;t&#39;.
void giveIsoTensAndVectorProduct(const double *tens, const double *vec, double *result, int dim)
Function gives the product of the isotropic tensor of seccond order with a vector.
void lubksb(double **a, int n, int *indx, double b[])
void ludcmp(double **a, int n, int *indx, double *d)
#define _errorr(_1)
Definition: gelib.h:160
void copy3DeshelbyTensor_full2reduced(const double *a, double *b)
Function copies and converts 3D eshelby/stiffness tensor saved in full row-wise vector &#39;a&#39; to reduced...
void giveTVproduct_3is3x3to5and3(double *result, const double *T, const double *vect)
Function gives product of tensor and vector - &#39;result = T * vect&#39;.
void convert3Dtensor_TFEEPtoROW_notation(double *t)
Function convert the symmetric double 3D tensor &#39;t&#39;.
void DeleteArray2D(bool **array, long d1)
Function deletes a 2D &#39;bool&#39; array of dimension d1 x ??, allocated by new.
void giveInverseMatrix(double *mtrx, int n)
Function computes inversion of squared matrix mtrx.
void copy3Dto2Dtensors_FEEPreduced(const double *a, double *b)
Function copy the symmetric double 3D tensor &#39;a&#39; to 2D tensor &#39;b&#39;.
void giveInverseMatrix_core(double **answer, double **mtrx, int n, bool vect)
Function gives inversion of squared matrix mtrx.
#define _errorr1(_1)
Definition: gelib.h:153
double ** AllocateArray2D(long d1, long d2)
Operations with 2d, 3d, 4d arrays of various sizes.
void copyMatrix_1Dto2D(const double *v, double **m, long n)
Function copies 2D matrix saved in row-wise vector v[n * n] to 2d array m[n][n].
void CleanVector(double *a, long n)
Functin cleans a &#39;double&#39; vector, initialize each value being 0-zero.
void CopyTensorAndReduceToFeep(const double *a, double *b)
Function copy two double tensor, &#39;a&#39; -> &#39;b&#39;, saved as 9 component vectors.