muMECH  1.0
esei_Penny.cpp
Go to the documentation of this file.
1 //********************************************************************************************************
2 // code: ### ### ##### #### ## ##
3 // ## ## ######## ## ## ## ## ##
4 // ## ## ## ## ## ### ## ######
5 // ## ## ## ## ## ## ## ## ##
6 // ##### ## ## ##### #### ## ##
7 // ##
8 //
9 // name: eshelbySoluEllipticIntegralsPenny.cpp
10 // author(s): Jan Novak, Tomas Janda
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 <stdio.h>
28 #include <stdlib.h>
29 #include <math.h>
30 #include <cmath>
31 #include <iostream>
32 
33 #include "macros.h"
34 #include "esei_Penny.h"
35 #include "eshelbySoluLambda.h"
36 #include "legendreIntegrals.h"
37 #include "elementaryFunctions.h"
38 #include "inclusion.h"
39 
40 namespace mumech {
41 
42 // Function gives the values of Ferers-Dysons integrals
43 // Last edit: 18-Oct-2013
44 // ATTENTION! The last element in the J array is not I33 but a3^2*I33.
45 void eshelbySoluEllipticIntegralsPenny :: giveEllipticIntegrals (double J[13], double lambda, bool intpoint)
46 {
47  // Penny shape: a1 = a2 >> a3
48  if (I->a[0] != I->a[1])
49  {
50  _warningg( "Values of semiaxes do not fit the condition for penny shape (a1 = a2). " );
51  std::cout << "a1, a2, a3 = " << I->a[0] << ", " << I->a[1] << ", " << I->a[2];
52  }
53 
54  double a = I->a[0];
55 
56  CleanVector(J, 13);
57  // termitovo: toto by se melo predelat na detekci podle intpoint, ale nevim jak to je tady s logikou bodu
58  if (lambda > MACHINE_EPS) // External point
59  return;
60 
61  // Internal point
62  J[0] = 0.;
63 
64  J[1] = 0.0; // I1
65  J[2] = 0.0; // I2
66  J[3] = _4PI_; // I3
67 
68  J[4] = 0.0; // I11
69  J[5] = 0.0; // I12
70  J[6] = _4PI_ / SQR(a); // I13
71 
72  J[7] = 0.0; // I21
73  J[8] = 0.0; // I22
74  J[9] = _4PI_ / SQR(a); // I23
75 
76  J[10] = _4PI_ / SQR(a); // I31
77  J[11] = _4PI_ / SQR(a); // I32
78  J[12] = _4PI_ / 3.0; // a3^2 * I33s
79 }
80 
81 // Function gives the derivatives of Ferers-Dysons integrals
82 // Last edit: 11-Sep-2013
83 // Flat shapes has zero drtivatives
85 {
86  CleanVector( point->dJi, 9 );
87  CleanVector( point->dJij, 27 );
88  CleanVector( point->ddJi, 27 );
89  CleanVector( point->ddJij, 81 );
90 }
91 
92 }
void giveDerivativesOfEllipticIntegrals(Point *point, bool intpoint)
Function gives the derivatives of Ferers-Dysons integrals.
Definition: esei_Penny.cpp:84
Class eshelbySoluEllipticIntegralsPenny.
#define _warningg(_1)
Definition: gelib.h:163
Class legendreIntegrals.
const InclusionRecord3D * I
Definition: esei.h:45
void giveEllipticIntegrals(double J[13], double lambda, bool intpoint)
Function gives the the values of all elliptic integrals.
Definition: esei_Penny.cpp: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 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
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.