muMECH  1.0
esei_FlatEllipsoid.cpp
Go to the documentation of this file.
1 //********************************************************************************************************
2 // code: ### ### ##### #### ## ##
3 // ## ## ######## ## ## ## ## ##
4 // ## ## ## ## ## ### ## ######
5 // ## ## ## ## ## ## ## ## ##
6 // ##### ## ## ##### #### ## ##
7 // ##
8 //
9 // name: eshelbySoluEllipticIntegralsFlatEllipsoid.cpp
10 // description: source file of the functions calculating the values of elliptic integrals
11 // and its derivatives of flat ellipsoid (a1 > a2 >> a3)
12 // author(s): Jan Novak, Tomas Janda
13 // place of birth: Czech Technical University in Prague, Faculty of Civil engineering
14 // last edit: 18-Oct-2013
15 // language: C, C++
16 // license: This program is free software; you can redistribute it and/or modify
17 // it under the terms of the GNU Lesser General Public License as published by
18 // the Free Software Foundation; either version 2 of the License, or
19 // (at your option) any later version.
20 //
21 // This program is distributed in the hope that it will be useful,
22 // but WITHOUT ANY WARRANTY; without even the implied warranty of
23 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 // GNU Lesser General Public License for more details.
25 //
26 // You should have received a copy of the GNU Lesser General Public License
27 // along with this program; if not, write to the Free Software
28 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 //********************************************************************************************************
30 
31 #include <stdio.h>
32 #include <stdlib.h>
33 #include <math.h>
34 #include <cmath>
35 #include <iostream>
36 
37 #include "macros.h"
38 #include "esei_FlatEllipsoid.h"
39 #include "eshelbySoluLambda.h"
40 #include "legendreIntegrals.h"
41 #include "elementaryFunctions.h"
42 #include "inclusion.h"
43 
44 namespace mumech {
45 
46 // Function gives the values of Ferers-Dysons integrals
47 // Last edit: 18-Oct-2013
48 // ATTENTION! The integral the last element in the J array is not I33 but a3^2*I33.
49 void eshelbySoluEllipticIntegralsFlatEllipsoid :: giveEllipticIntegrals (double J[13], double lambda, bool intpoint)
50 {
51  // Flat ellipsoid: a1 > a2 >> a3
52  if (I->a[0] <= I->a[1])
53  {
54  _warningg( "Values of semiaxes do not fit the condition for flat ellipsoid (a1 > a2). " );
55  std::cout << "a1, a2, a3 = " << I->a[0] << ", " << I->a[1] << ", " << I->a[2];
56  }
57 
58  double a1 = I->a[0];
59  double a2 = I->a[1];
60 
61  CleanVector(J, 13);
62  // termitovo: toto by se melo predelat na detekci podle intpoint, ale nevim jak to je tady s logikou bodu
63  if (lambda > MACHINE_EPS) // External point
64  return;
65 
66  // Internal point
67  J[0] = 0.;
68 
69  J[1] = 0.0; // I1
70  J[2] = 0.0; // I2
71  J[3] = _4PI_; // I3
72 
73  J[4] = 0.0; // I11
74  J[5] = 0.0; // I12
75  J[6] = _4PI_ / SQR(a1); // I13
76 
77  J[7] = 0.0; // I21
78  J[8] = 0.0; // I22
79  J[9] = _4PI_ / SQR(a2); // I23
80 
81  J[10] = _4PI_ / SQR(a1); // I31
82  J[11] = _4PI_ / SQR(a2); // I32
83  J[12] = _4PI_ / 3.0; // a3^2 * I33s
84 }
85 
86 // Function gives the derivatives of Ferers-Dysons integrals
87 // Last edit: 11-Sep-2013
88 // Flat shapes has zero drtivatives
90 {
91  CleanVector( point->dJi, 9 );
92  CleanVector( point->dJij, 27 );
93  CleanVector( point->ddJi, 27 );
94  CleanVector( point->ddJij, 81 );
95 }
96 
97 }
#define _warningg(_1)
Definition: gelib.h:163
void giveEllipticIntegrals(double J[13], double lambda, bool intpoint)
Function gives the the values of all elliptic integrals.
Class legendreIntegrals.
const InclusionRecord3D * I
Definition: esei.h:45
The header file of usefull macros.
Collection of the functions of basic manipulations, some of them can be used instead of their counter...
double ddJij[81]
Second derivatives of elliptic integral Iij.
Definition: matrix.h:145
Single Point data structure - contribution from Single inclusion.
Definition: matrix.h:133
Class eshelbySoluEllipticIntegralsFlatEllipsoid.
Class inclusion contains and handles all inclusion data.
#define SQR(a)
Definition: macros.h:97
double dJi[9]
First derivatives of elliptic integral Ii.
Definition: matrix.h:142
double * a
Inclusion semiaxes&#39; dimensions in global arrangement.
Definition: inclusion.h:76
double ddJi[27]
Second derivatives of elliptic integral Ii.
Definition: matrix.h:144
void giveDerivativesOfEllipticIntegrals(Point *point, bool intpoint)
Function gives the derivatives of Ferers-Dysons integrals.
double dJij[27]
First derivatives of elliptic integral Iij.
Definition: matrix.h:143
#define MACHINE_EPS
Definition: macros.h:68
#define _4PI_
Definition: types.h:50
void CleanVector(double *a, long n)
Functin cleans a &#39;double&#39; vector, initialize each value being 0-zero.