muMECH  1.0
matrix.h
Go to the documentation of this file.
1 //********************************************************************************************************
2 // code: ### ### ##### #### ## ##
3 // ## ## ######## ## ## ## ## ##
4 // ## ## ## ## ## ### ## ######
5 // ## ## ## ## ## ## ## ## ##
6 // ##### ## ## ##### #### ## ##
7 // ##
8 //
9 // name: matrix_record.h
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 //********************************************************************************************************
32 #ifndef MUMECH_MATRIX_RECORD_H
33 #define MUMECH_MATRIX_RECORD_H
34 
35 //included libraries
36 #include "types.h"
37 #include "elementaryFunctions.h"
38 #include "matrix_vector.h"
39 
40 
41 namespace mumech {
42 
43 class Problem;
44 
47 {
48  friend class Problem;
49  friend class InclusionRecord3D;
50 
51  protected:
52  const Problem *P;
53 
54  double ym;
55  double pr;
56  double *origin;
57  int nRS;
58  double **Remote_strain;
59 
60  private:
61  double **globHomog_displc;
62  double **globHomog_strain;
63  double **globHomog_stress;
64 
65  public:
66  double *C;
67 
68  public:
72  MatrixRecord (const Problem *p);
74  virtual ~MatrixRecord ();
75 
76  // *** SET ***
78  void set_nlc (int n);
80  void set_E_nu (double e, double n);
82  void set_E_nu_rs (double e, double n, const double *r1) {
83  this->set_E_nu(e, n);
84  this->set_nlc(1);
85  this->set_Remote_strain_for_lc(0, r1);
86  }
87 
89  void set_origin (double x, double y);
90  void set_origin (double x, double y, double z);
92  void convert_RS_ROWtoFEEP (int lc);
94  void set_Remote_strain_for_lc (int lc, const double r1[]);
96  bool scan_Remote_strains (FILE *stream);
98  bool scan_Remote_strains (const char *stream);
100  void set_unit_remote_strain (void);
102  bool remote_strain_is_unit (void) const;
103 
104  // *** GET ***
106  double E (void) const { return ym; }
107  double nu (void) const { return pr; }
108  const double** remote_strains (void) const { return (const double**)Remote_strain; }
110  void giveReducedStiffMatrix (double *answer) const;
112  void giveFullStiffMatrix (double *answer) const;
113 
115  void allocate_nlc_fields (void);
117  const double* give_globHomog_Displc (int lc, const double *coords);
118  void give_globHomog_Displc (double *displ, int lc, const double *coords);
119  const double* give_globHomog_Strain (int lc);
120  void give_globHomog_Strain (double *strain, int lc);
121  const double* give_globHomog_Stress (int lc);
122  void give_globHomog_Stress (double *stress, int lc);
123 
125  void printYourself (const char *notice = NULL);
126 
127 }; // end of class definition
128 
129 // ********************************************************************************************************
130 // ************************** POINT *******************************************************************
131 // ********************************************************************************************************
133 class Point
134 {
135  public:
136  double x[3];
137  double loc_x[3];
138  //double E; ///< Actual Young's modulus.
139  //PointPositionFlag position; ///< Position flag (_INT_POINT_ / _EXT_POINT_).
140  double la;
141  double eInt[13];
142  double dJi[9];
143  double dJij[27];
144  double ddJi[27];
145  double ddJij[81];
146  double S[12];
147  double D[36];
148  double L[18];
149  //double C[12]; ///< Actual sotropic stiffness matrix.
150 
151  int nlc;
152 
153  double **displacement;
154  double **strain;
155  double **stress;
156 
158  Point ();
160  virtual ~Point ();
161 
163  void set_nlc (const Problem *p, int nlc);
164 
165 };
166 
167 
168 
169 } // end of namespace mumech
170 
171 #endif
172 
173 /*end of file*/
void convert_RS_ROWtoFEEP(int lc)
Definition: matrix.cpp:95
file of various types and symbolic constant definitions
const double * give_globHomog_Stress(int lc)
Definition: matrix.cpp:250
const double * give_globHomog_Strain(int lc)
Definition: matrix.cpp:239
double * C
isotropic stiffness matrix of the infinite medium (infinite matrix), saved in reduced form...
Definition: matrix.h:66
Problem description.
Definition: problem.h:154
double ** globHomog_strain
Global homogeneous strain fields.
Definition: matrix.h:62
Class vector and matrix.
void set_unit_remote_strain(void)
Sets a set of unit remote strain.
Definition: matrix.cpp:145
double ** displacement
Calculated value - global displacement field.
Definition: matrix.h:153
void printYourself(const char *notice=NULL)
Function prints the MatrixRecord.
Definition: matrix.cpp:279
matrix data structure - matrix (infinite medium) record
Definition: matrix.h:46
bool remote_strain_is_unit(void) const
Check the remote strain is unit.
Definition: matrix.cpp:180
void giveReducedStiffMatrix(double *answer) const
Definition: matrix.cpp:206
3D inclusion record.
Definition: inclusion.h:278
Collection of the functions of basic manipulations, some of them can be used instead of their counter...
const Problem * P
Definition: matrix.h:52
Single Point data structure - contribution from Single inclusion.
Definition: matrix.h:133
double ** strain
Calculated value - global strain fields.
Definition: matrix.h:154
double ym
Young&#39;s modulus of the matrix.
Definition: matrix.h:54
double pr
Poissons ratio of the matrix.
Definition: matrix.h:55
const double ** remote_strains(void) const
Definition: matrix.h:108
const double * give_globHomog_Displc(int lc, const double *coords)
Definition: matrix.cpp:226
MatrixRecord(const Problem *p)
Constructor.
Definition: matrix.cpp:42
double ** stress
Calculated value - global stress fields.
Definition: matrix.h:155
double la
Lambda parameter of a point (this is not the Lame lambda !!!).
Definition: matrix.h:140
double ** globHomog_stress
Global homogeneous stress fields.
Definition: matrix.h:63
double E(void) const
Definition: matrix.h:106
void set_E_nu_rs(double e, double n, const double *r1)
Definition: matrix.h:82
double * origin
coordinates of the origin of infinite medium (origin of global coordinate system) ...
Definition: matrix.h:56
void set_Remote_strain_for_lc(int lc, const double r1[])
r1 se zadava v theoretical row notation prislusne delky, 4 nebo 9
Definition: matrix.cpp:102
virtual ~MatrixRecord()
Destructor.
Definition: matrix.cpp:56
double ** Remote_strain
Remote strain fields == homogeneous strain tensor, stored in TVRN_THEORETICAL_FEEP notation...
Definition: matrix.h:58
bool scan_Remote_strains(FILE *stream)
Definition: matrix.cpp:112
double nu(void) const
Definition: matrix.h:107
void set_nlc(int n)
Definition: matrix.cpp:68
void set_E_nu(double e, double n)
Definition: matrix.cpp:76
void allocate_nlc_fields(void)
Allocate fields depending to number of load cases.
Definition: matrix.cpp:219
int nRS
Number of remote strains.
Definition: matrix.h:57
double ** globHomog_displc
Global homogeneous displacement fields.
Definition: matrix.h:61
void giveFullStiffMatrix(double *answer) const
Definition: matrix.cpp:211
void set_origin(double x, double y)
Definition: matrix.cpp:91
void e(int i)