OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
structuralmaterial.C
Go to the documentation of this file.
1 /*
2  *
3  * ##### ##### ###### ###### ### ###
4  * ## ## ## ## ## ## ## ### ##
5  * ## ## ## ## #### #### ## # ##
6  * ## ## ## ## ## ## ## ##
7  * ## ## ## ## ## ## ## ##
8  * ##### ##### ## ###### ## ##
9  *
10  *
11  * OOFEM : Object Oriented Finite Element Code
12  *
13  * Copyright (C) 1993 - 2013 Borek Patzak
14  *
15  *
16  *
17  * Czech Technical University, Faculty of Civil Engineering,
18  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2.1 of the License, or (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  * Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public
31  * License along with this library; if not, write to the Free Software
32  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33  */
34 
35 #include "../sm/Materials/structuralmaterial.h"
36 #include "domain.h"
37 #include "verbose.h"
38 #include "../sm/Materials/structuralms.h"
39 #include "../sm/Elements/structuralelement.h"
40 #include "../sm/Elements/nlstructuralelement.h"
41 #include "gausspoint.h"
42 #include "floatmatrix.h"
43 #include "floatarray.h"
44 #include "mathfem.h"
45 #include "engngm.h"
46 #include "fieldmanager.h"
47 #include "dynamicinputrecord.h"
48 
49 namespace oofem {
50 
51 std::vector< std::vector<int> > StructuralMaterial :: vIindex = {
52  { 1, 6, 5 },
53  { 9, 2, 4 },
54  { 8, 7, 3 }
55 };
56 
57 std::vector< std::vector<int> > StructuralMaterial :: svIndex = {
58  { 1, 6, 5 },
59  { 6, 2, 4 },
60  { 5, 4, 3 }
61 };
62 
63 
65 
66 
67 int
69 //
70 // returns whether receiver supports given mode
71 //
72 {
73  return mode == _3dMat || mode == _PlaneStress || mode == _PlaneStrain || mode == _1dMat ||
74  mode == _PlateLayer || mode == _2dBeamLayer || mode == _Fiber;
75 }
76 
77 
78 void
80 {
82  MaterialMode mode = gp->giveMaterialMode();
83  if ( mode == _3dMat ) {
84  this->giveRealStressVector_3d(answer, gp, reducedStrain, tStep);
85  } else if ( mode == _3dDegeneratedShell ) {
86  this->giveRealStressVector_3d(answer, gp, reducedStrain, tStep);
87  } else if ( mode == _PlaneStrain ) {
88  this->giveRealStressVector_PlaneStrain(answer, gp, reducedStrain, tStep);
89  } else if ( mode == _PlaneStress ) {
90  this->giveRealStressVector_PlaneStress(answer, gp, reducedStrain, tStep);
91  } else if ( mode == _1dMat ) {
92  this->giveRealStressVector_1d(answer, gp, reducedStrain, tStep);
93  } else if ( mode == _2dBeamLayer ) {
94  this->giveRealStressVector_2dBeamLayer(answer, gp, reducedStrain, tStep);
95  } else if ( mode == _PlateLayer ) {
96  this->giveRealStressVector_PlateLayer(answer, gp, reducedStrain, tStep);
97  } else if ( mode == _Fiber ) {
98  this->giveRealStressVector_Fiber(answer, gp, reducedStrain, tStep);
99  } else if ( mode == _2dLattice ) {
100  this->giveRealStressVector_Lattice2d(answer, gp, reducedStrain, tStep);
101  } else if ( mode == _3dLattice ) {
102  this->giveRealStressVector_Lattice3d(answer, gp, reducedStrain, tStep);
103  } else if ( mode == _2dPlateSubSoil ) {
104  this->giveRealStressVector_2dPlateSubSoil(answer, gp, reducedStrain, tStep);
105  } else if ( mode == _3dBeamSubSoil ) {
106  this->giveRealStressVector_3dBeamSubSoil(answer, gp, reducedStrain, tStep);
107  }
108 }
109 
110 
111 void
113 {
114  OOFEM_ERROR("3d mode not supported");
115 }
116 
117 
118 void
120 {
121  OOFEM_ERROR("Warping mode not supported");
122 }
123 
124 
125 void
127 {
128  FloatArray vE, vS;
129  StructuralMaterial :: giveFullSymVectorForm(vE, reducedStrain, _PlaneStrain);
130  this->giveRealStressVector_3d(vS, gp, vE, tStep);
131  StructuralMaterial :: giveReducedSymVectorForm(answer, vS, _PlaneStrain);
132 }
133 
134 
135 void
136 StructuralMaterial :: giveRealStressVector_StressControl(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, const IntArray &strainControl, TimeStep *tStep)
137 {
138  StructuralMaterialStatus *status = static_cast< StructuralMaterialStatus * >( this->giveStatus(gp) );
139 
140  IntArray stressControl;
141  FloatArray vE, increment_vE, vS, reducedvS;
142  FloatMatrix tangent, reducedTangent;
143  // Iterate to find full vE.
144  // Compute the negated the array of control since we need stressControl as well;
145 
146  stressControl.resize( 6 - strainControl.giveSize() );
147  for ( int i = 1, j = 1; i <= 6; i++ ) {
148  if ( !strainControl.contains(i) ) {
149  stressControl.at(j++) = i;
150  }
151  }
152 
153  // Initial guess;
154  vE = status->giveStrainVector();
155  for ( int i = 1; i <= strainControl.giveSize(); ++i ) {
156  vE.at( strainControl.at(i) ) = reducedStrain.at(i);
157  }
158 
159  // Iterate to find full vE.
160  for ( int k = 0; k < 10; k++ ) { // Allow for a generous 100 iterations.
161  this->giveRealStressVector_3d(vS, gp, vE, tStep);
162  // For debugging the iterations:
163  //vE.printYourself("vE");
164  //vS.printYourself("vS");
165  reducedvS.beSubArrayOf(vS, stressControl);
166  // Pick out the (response) stresses for the controlled strains
167  answer.beSubArrayOf(vS, strainControl);
168  if ( reducedvS.computeNorm() <= 1e0 && k >= 5 ) { // Absolute tolerance right now (with at least one iteration)
172  //if ( reducedvS.computeNorm() <= 1e-6 * answer.computeNorm() ) {
173  return;
174  }
175 
176  this->give3dMaterialStiffnessMatrix(tangent, TangentStiffness, gp, tStep);
177  reducedTangent.beSubMatrixOf(tangent, stressControl, stressControl);
178  reducedTangent.solveForRhs(reducedvS, increment_vE);
179  increment_vE.negated();
180  vE.assemble(increment_vE, stressControl);
181  }
182 
183  OOFEM_WARNING("Iteration did not converge");
184  answer.clear();
185 }
186 
187 
188 void
190 // calculates stress vector (6 components) with assumption of sigma_z = 0
191 // used by MITC4Shell
192 {
193  StructuralMaterialStatus *status = static_cast< StructuralMaterialStatus * >( this->giveStatus(gp) );
194 
195  IntArray stressControl;
196  FloatArray vE, increment_vE, vS, reducedvS;
197  FloatMatrix tangent, reducedTangent;
198  // Iterate to find full vE.
199  // Compute the negated the array of control since we need stressControl as well;
200 
201  stressControl.resize( 6 - strainControl.giveSize() );
202  for ( int i = 1, j = 1; i <= 6; i++ ) {
203  if ( !strainControl.contains(i) ) {
204  stressControl.at(j++) = i;
205  }
206  }
207 
208  // Initial guess;
209  vE = status->giveStrainVector();
210  vE = strain;
211  // step 0: vE = {., ., 0, ., ., .}
212  // step n: vE = {., ., sum(ve(n)), ., ., .}
213 
214  // Iterate to find full vE.
215  for ( int k = 0; k < 100; k++ ) { // Allow for a generous 100 iterations.
216  this->giveRealStressVector_3d(answer, gp, vE, tStep);
217  // step 0: answer = full stress vector
218  // step n: answer = {., ., ->0, ., ., .}
219  reducedvS.beSubArrayOf(answer, stressControl);
220  if ( reducedvS.computeNorm() < 1e-6 ) {
221  return;
222  }
223 
224  this->give3dMaterialStiffnessMatrix(tangent, TangentStiffness, gp, tStep);
225  reducedTangent.beSubMatrixOf(tangent, stressControl, stressControl);
226  reducedTangent.solveForRhs(reducedvS, increment_vE);
227  increment_vE.negated();
228  vE.assemble(increment_vE, stressControl);
229  }
230 
231  OOFEM_WARNING("Iteration did not converge");
232  answer.clear();
233 }
234 
235 
236 
237 
238 void
240 {
241  IntArray strainControl;
242  StructuralMaterial :: giveVoigtSymVectorMask(strainControl, _PlaneStress);
243  this->giveRealStressVector_StressControl(answer, gp, reducedStrain, strainControl, tStep);
244 }
245 
246 
247 void
249 {
250  IntArray strainControl;
251  StructuralMaterial :: giveVoigtSymVectorMask(strainControl, _1dMat);
252  this->giveRealStressVector_StressControl(answer, gp, reducedStrain, strainControl, tStep);
253 }
254 
255 
256 void
258 {
259  IntArray strainControl;
260  StructuralMaterial :: giveVoigtSymVectorMask(strainControl, _2dBeamLayer);
261  this->giveRealStressVector_StressControl(answer, gp, reducedStrain, strainControl, tStep);
262 }
263 
264 
265 void
267 {
268  IntArray strainControl;
269  StructuralMaterial :: giveVoigtSymVectorMask(strainControl, _PlateLayer);
270  this->giveRealStressVector_StressControl(answer, gp, reducedStrain, strainControl, tStep);
271 }
272 
273 
274 void
276 {
277  IntArray strainControl;
278  StructuralMaterial :: giveVoigtSymVectorMask(strainControl, _Fiber);
279  this->giveRealStressVector_StressControl(answer, gp, reducedStrain, strainControl, tStep);
280 }
281 
282 
283 void
285 {
286  OOFEM_ERROR("2dLattice mode not supported");
287 }
288 
289 void
291 {
292  OOFEM_ERROR("3dLattice mode not supported");
293 }
294 
295 
296 void
298 {
299  OOFEM_ERROR("2dPlateSubSoil mode not supported");
300 }
301 
302 void
304 {
305  OOFEM_ERROR("3dBeamSubSoil mode not supported");
306 }
307 
308 
309 void
311 {
312  // Default implementation used if this method is not overloaded by the particular material model.
313  // 1) Compute Green-Lagrange strain and call standard method for small strains.
314  // 2) Treat stress as second Piola-Kirchhoff stress and convert to first Piola-Kirchhoff stress.
315  // 3) Set state variables F, P
316 
317  FloatArray vE, vS;
318  FloatMatrix F, E;
319  F.beMatrixForm(vF);
320  E.beTProductOf(F, F);
321  E.at(1, 1) -= 1.0;
322  E.at(2, 2) -= 1.0;
323  E.at(3, 3) -= 1.0;
324  E.times(0.5);
325  vE.beSymVectorFormOfStrain(E); // 6
326 
328  this->giveRealStressVector_3d(vS, gp, vE, tStep);
329  StructuralMaterialStatus *status = static_cast< StructuralMaterialStatus * >( this->giveStatus(gp) );
330 
331  // Compute first PK stress from second PK stress
332  FloatMatrix P, S;
333  S.beMatrixForm(vS);
334  P.beProductOf(F, S);
335  answer.beVectorForm(P);
336 
337  status->letTempPVectorBe(answer);
338  status->letTempFVectorBe(vF);
339 }
340 
341 
342 void
344 {
345  FloatArray vF, vP;
346  StructuralMaterial :: giveFullVectorFormF(vF, reducedvF, _PlaneStrain);
347  this->giveFirstPKStressVector_3d(vP, gp, vF, tStep);
348  StructuralMaterial :: giveReducedVectorForm(answer, vP, _PlaneStrain);
349 }
350 
351 
352 void
354 {
355  StructuralMaterialStatus *status = static_cast< StructuralMaterialStatus * >( this->giveStatus(gp) );
356 
357  IntArray F_control, P_control; // Determines which components are controlled by F and P resp.
358  FloatArray vF, increment_vF, vP, vP_control;
359  FloatMatrix tangent, tangent_Pcontrol;
360  // Iterate to find full vF.
361  StructuralMaterial :: giveVoigtVectorMask(F_control, _PlaneStress);
362  // Compute the negated the array of control since we need P_control as well;
363  P_control.resize( 9 - F_control.giveSize() );
364  for ( int i = 1, j = 1; i <= 9; i++ ) {
365  if ( !F_control.contains(i) ) {
366  P_control.at(j++) = i;
367  }
368  }
369 
370  // Initial guess;
371  vF = status->giveFVector();
372  for ( int i = 1; i <= F_control.giveSize(); ++i ) {
373  vF.at( F_control.at(i) ) = reducedvF.at(i);
374  }
375 
376  // Iterate to find full vF.
377  for ( int k = 0; k < 100; k++ ) { // Allow for a generous 100 iterations.
378  this->giveFirstPKStressVector_3d(vP, gp, vF, tStep);
379  vP_control.beSubArrayOf(vP, P_control);
380  if ( vP_control.computeNorm() < 1e-6 ) {
382  return;
383  }
384 
385  this->give3dMaterialStiffnessMatrix_dPdF(tangent, TangentStiffness, gp, tStep);
386  tangent_Pcontrol.beSubMatrixOf(tangent, P_control, P_control);
387  tangent_Pcontrol.solveForRhs(vP_control, increment_vF);
388  vF.assemble(increment_vF, P_control);
389  }
390 
391  OOFEM_WARNING("Iteration did not converge");
392  answer.clear();
393 }
394 
395 
396 void
398 {
399  StructuralMaterialStatus *status = static_cast< StructuralMaterialStatus * >( this->giveStatus(gp) );
400 
401  IntArray P_control; // Determines which components are controlled by P resp.
402  FloatArray vF, increment_vF, vP, vP_control;
403  FloatMatrix tangent, tangent_Pcontrol;
404  // Compute the negated the array of control since we need P_control as well;
405  P_control.resize(8);
406  for ( int i = 1; i <= 8; i++ ) {
407  P_control.at(i) = i + 1;
408  }
409 
410  // Initial guess;
411  vF = status->giveFVector();
412  vF.at(1) = reducedvF.at(1);
413  // Iterate to find full vF.
414  for ( int k = 0; k < 100; k++ ) { // Allow for a generous 100 iterations.
415  this->giveFirstPKStressVector_3d(vP, gp, vF, tStep);
416  vP_control.beSubArrayOf(vP, P_control);
417  if ( vP_control.computeNorm() < 1e-6 ) {
419  return;
420  }
421 
422  this->give3dMaterialStiffnessMatrix_dPdF(tangent, TangentStiffness, gp, tStep);
423  tangent_Pcontrol.beSubMatrixOf(tangent, P_control, P_control);
424  tangent_Pcontrol.solveForRhs(vP_control, increment_vF);
425  vF.assemble(increment_vF, P_control);
426  }
427 
428  OOFEM_WARNING("Iteration did not converge");
429  answer.clear();
430 }
431 
432 
433 void
435 {
436  // Converts the reduced dSdE-stiffness to reduced dPdF-sitiffness for different MaterialModes
437  // Performs the following operation dPdF = I_ik * S_jl + F_im F_kn C_mjnl,
438  // See for example: G.A. Holzapfel, Nonlinear Solid Mechanics: A Continuum Approach for
439  // Engineering, 2000, ISBN-10: 0471823198.
440 
441  if ( matMode == _3dMat ) {
442  //Save terms associated with H = [du/dx, dv/dy, dw/dz, dv/dz, du/dz, du/dy, dw/dy, dw/dx, dv/dx]
443 
444 #if 1
445 
446  answer.resize(9, 9);
447  answer(0, 0) = F(0) * C(0, 0) * F(0) + F(0) * C(0, 5) * F(5) + F(0) * C(0, 4) * F(4) + F(5) * C(5, 0) * F(0) + F(5) * C(5, 5) * F(5) + F(5) * C(5, 4) * F(4) + F(4) * C(4, 0) * F(0) + F(4) * C(4, 5) * F(5) + F(4) * C(4, 4) * F(4) + S(0);
448  answer(0, 1) = F(0) * C(0, 5) * F(8) + F(0) * C(0, 1) * F(1) + F(0) * C(0, 3) * F(3) + F(5) * C(5, 5) * F(8) + F(5) * C(5, 1) * F(1) + F(5) * C(5, 3) * F(3) + F(4) * C(4, 5) * F(8) + F(4) * C(4, 1) * F(1) + F(4) * C(4, 3) * F(3) + 0.0;
449  answer(0, 2) = F(0) * C(0, 4) * F(7) + F(0) * C(0, 3) * F(6) + F(0) * C(0, 2) * F(2) + F(5) * C(5, 4) * F(7) + F(5) * C(5, 3) * F(6) + F(5) * C(5, 2) * F(2) + F(4) * C(4, 4) * F(7) + F(4) * C(4, 3) * F(6) + F(4) * C(4, 2) * F(2) + 0.0;
450  answer(0, 3) = F(0) * C(0, 4) * F(8) + F(0) * C(0, 3) * F(1) + F(0) * C(0, 2) * F(3) + F(5) * C(5, 4) * F(8) + F(5) * C(5, 3) * F(1) + F(5) * C(5, 2) * F(3) + F(4) * C(4, 4) * F(8) + F(4) * C(4, 3) * F(1) + F(4) * C(4, 2) * F(3) + 0.0;
451  answer(0, 4) = F(0) * C(0, 4) * F(0) + F(0) * C(0, 3) * F(5) + F(0) * C(0, 2) * F(4) + F(5) * C(5, 4) * F(0) + F(5) * C(5, 3) * F(5) + F(5) * C(5, 2) * F(4) + F(4) * C(4, 4) * F(0) + F(4) * C(4, 3) * F(5) + F(4) * C(4, 2) * F(4) + S(4);
452  answer(0, 5) = F(0) * C(0, 5) * F(0) + F(0) * C(0, 1) * F(5) + F(0) * C(0, 3) * F(4) + F(5) * C(5, 5) * F(0) + F(5) * C(5, 1) * F(5) + F(5) * C(5, 3) * F(4) + F(4) * C(4, 5) * F(0) + F(4) * C(4, 1) * F(5) + F(4) * C(4, 3) * F(4) + S(5);
453  answer(0, 6) = F(0) * C(0, 5) * F(7) + F(0) * C(0, 1) * F(6) + F(0) * C(0, 3) * F(2) + F(5) * C(5, 5) * F(7) + F(5) * C(5, 1) * F(6) + F(5) * C(5, 3) * F(2) + F(4) * C(4, 5) * F(7) + F(4) * C(4, 1) * F(6) + F(4) * C(4, 3) * F(2) + 0.0;
454  answer(0, 7) = F(0) * C(0, 0) * F(7) + F(0) * C(0, 5) * F(6) + F(0) * C(0, 4) * F(2) + F(5) * C(5, 0) * F(7) + F(5) * C(5, 5) * F(6) + F(5) * C(5, 4) * F(2) + F(4) * C(4, 0) * F(7) + F(4) * C(4, 5) * F(6) + F(4) * C(4, 4) * F(2) + 0.0;
455  answer(0, 8) = F(0) * C(0, 0) * F(8) + F(0) * C(0, 5) * F(1) + F(0) * C(0, 4) * F(3) + F(5) * C(5, 0) * F(8) + F(5) * C(5, 5) * F(1) + F(5) * C(5, 4) * F(3) + F(4) * C(4, 0) * F(8) + F(4) * C(4, 5) * F(1) + F(4) * C(4, 4) * F(3) + 0.0;
456  answer(1, 0) = F(8) * C(5, 0) * F(0) + F(8) * C(5, 5) * F(5) + F(8) * C(5, 4) * F(4) + F(1) * C(1, 0) * F(0) + F(1) * C(1, 5) * F(5) + F(1) * C(1, 4) * F(4) + F(3) * C(3, 0) * F(0) + F(3) * C(3, 5) * F(5) + F(3) * C(3, 4) * F(4) + 0.0;
457  answer(1, 1) = F(8) * C(5, 5) * F(8) + F(8) * C(5, 1) * F(1) + F(8) * C(5, 3) * F(3) + F(1) * C(1, 5) * F(8) + F(1) * C(1, 1) * F(1) + F(1) * C(1, 3) * F(3) + F(3) * C(3, 5) * F(8) + F(3) * C(3, 1) * F(1) + F(3) * C(3, 3) * F(3) + S(1);
458  answer(1, 2) = F(8) * C(5, 4) * F(7) + F(8) * C(5, 3) * F(6) + F(8) * C(5, 2) * F(2) + F(1) * C(1, 4) * F(7) + F(1) * C(1, 3) * F(6) + F(1) * C(1, 2) * F(2) + F(3) * C(3, 4) * F(7) + F(3) * C(3, 3) * F(6) + F(3) * C(3, 2) * F(2) + 0.0;
459  answer(1, 3) = F(8) * C(5, 4) * F(8) + F(8) * C(5, 3) * F(1) + F(8) * C(5, 2) * F(3) + F(1) * C(1, 4) * F(8) + F(1) * C(1, 3) * F(1) + F(1) * C(1, 2) * F(3) + F(3) * C(3, 4) * F(8) + F(3) * C(3, 3) * F(1) + F(3) * C(3, 2) * F(3) + S(3);
460  answer(1, 4) = F(8) * C(5, 4) * F(0) + F(8) * C(5, 3) * F(5) + F(8) * C(5, 2) * F(4) + F(1) * C(1, 4) * F(0) + F(1) * C(1, 3) * F(5) + F(1) * C(1, 2) * F(4) + F(3) * C(3, 4) * F(0) + F(3) * C(3, 3) * F(5) + F(3) * C(3, 2) * F(4) + 0.0;
461  answer(1, 5) = F(8) * C(5, 5) * F(0) + F(8) * C(5, 1) * F(5) + F(8) * C(5, 3) * F(4) + F(1) * C(1, 5) * F(0) + F(1) * C(1, 1) * F(5) + F(1) * C(1, 3) * F(4) + F(3) * C(3, 5) * F(0) + F(3) * C(3, 1) * F(5) + F(3) * C(3, 3) * F(4) + 0.0;
462  answer(1, 6) = F(8) * C(5, 5) * F(7) + F(8) * C(5, 1) * F(6) + F(8) * C(5, 3) * F(2) + F(1) * C(1, 5) * F(7) + F(1) * C(1, 1) * F(6) + F(1) * C(1, 3) * F(2) + F(3) * C(3, 5) * F(7) + F(3) * C(3, 1) * F(6) + F(3) * C(3, 3) * F(2) + 0.0;
463  answer(1, 7) = F(8) * C(5, 0) * F(7) + F(8) * C(5, 5) * F(6) + F(8) * C(5, 4) * F(2) + F(1) * C(1, 0) * F(7) + F(1) * C(1, 5) * F(6) + F(1) * C(1, 4) * F(2) + F(3) * C(3, 0) * F(7) + F(3) * C(3, 5) * F(6) + F(3) * C(3, 4) * F(2) + 0.0;
464  answer(1, 8) = F(8) * C(5, 0) * F(8) + F(8) * C(5, 5) * F(1) + F(8) * C(5, 4) * F(3) + F(1) * C(1, 0) * F(8) + F(1) * C(1, 5) * F(1) + F(1) * C(1, 4) * F(3) + F(3) * C(3, 0) * F(8) + F(3) * C(3, 5) * F(1) + F(3) * C(3, 4) * F(3) + S(5);
465  answer(2, 0) = F(7) * C(4, 0) * F(0) + F(7) * C(4, 5) * F(5) + F(7) * C(4, 4) * F(4) + F(6) * C(3, 0) * F(0) + F(6) * C(3, 5) * F(5) + F(6) * C(3, 4) * F(4) + F(2) * C(2, 0) * F(0) + F(2) * C(2, 5) * F(5) + F(2) * C(2, 4) * F(4) + 0.0;
466  answer(2, 1) = F(7) * C(4, 5) * F(8) + F(7) * C(4, 1) * F(1) + F(7) * C(4, 3) * F(3) + F(6) * C(3, 5) * F(8) + F(6) * C(3, 1) * F(1) + F(6) * C(3, 3) * F(3) + F(2) * C(2, 5) * F(8) + F(2) * C(2, 1) * F(1) + F(2) * C(2, 3) * F(3) + 0.0;
467  answer(2, 2) = F(7) * C(4, 4) * F(7) + F(7) * C(4, 3) * F(6) + F(7) * C(4, 2) * F(2) + F(6) * C(3, 4) * F(7) + F(6) * C(3, 3) * F(6) + F(6) * C(3, 2) * F(2) + F(2) * C(2, 4) * F(7) + F(2) * C(2, 3) * F(6) + F(2) * C(2, 2) * F(2) + S(2);
468  answer(2, 3) = F(7) * C(4, 4) * F(8) + F(7) * C(4, 3) * F(1) + F(7) * C(4, 2) * F(3) + F(6) * C(3, 4) * F(8) + F(6) * C(3, 3) * F(1) + F(6) * C(3, 2) * F(3) + F(2) * C(2, 4) * F(8) + F(2) * C(2, 3) * F(1) + F(2) * C(2, 2) * F(3) + 0.0;
469  answer(2, 4) = F(7) * C(4, 4) * F(0) + F(7) * C(4, 3) * F(5) + F(7) * C(4, 2) * F(4) + F(6) * C(3, 4) * F(0) + F(6) * C(3, 3) * F(5) + F(6) * C(3, 2) * F(4) + F(2) * C(2, 4) * F(0) + F(2) * C(2, 3) * F(5) + F(2) * C(2, 2) * F(4) + 0.0;
470  answer(2, 5) = F(7) * C(4, 5) * F(0) + F(7) * C(4, 1) * F(5) + F(7) * C(4, 3) * F(4) + F(6) * C(3, 5) * F(0) + F(6) * C(3, 1) * F(5) + F(6) * C(3, 3) * F(4) + F(2) * C(2, 5) * F(0) + F(2) * C(2, 1) * F(5) + F(2) * C(2, 3) * F(4) + 0.0;
471  answer(2, 6) = F(7) * C(4, 5) * F(7) + F(7) * C(4, 1) * F(6) + F(7) * C(4, 3) * F(2) + F(6) * C(3, 5) * F(7) + F(6) * C(3, 1) * F(6) + F(6) * C(3, 3) * F(2) + F(2) * C(2, 5) * F(7) + F(2) * C(2, 1) * F(6) + F(2) * C(2, 3) * F(2) + S(3);
472  answer(2, 7) = F(7) * C(4, 0) * F(7) + F(7) * C(4, 5) * F(6) + F(7) * C(4, 4) * F(2) + F(6) * C(3, 0) * F(7) + F(6) * C(3, 5) * F(6) + F(6) * C(3, 4) * F(2) + F(2) * C(2, 0) * F(7) + F(2) * C(2, 5) * F(6) + F(2) * C(2, 4) * F(2) + S(4);
473  answer(2, 8) = F(7) * C(4, 0) * F(8) + F(7) * C(4, 5) * F(1) + F(7) * C(4, 4) * F(3) + F(6) * C(3, 0) * F(8) + F(6) * C(3, 5) * F(1) + F(6) * C(3, 4) * F(3) + F(2) * C(2, 0) * F(8) + F(2) * C(2, 5) * F(1) + F(2) * C(2, 4) * F(3) + 0.0;
474  answer(3, 0) = F(8) * C(4, 0) * F(0) + F(8) * C(4, 5) * F(5) + F(8) * C(4, 4) * F(4) + F(1) * C(3, 0) * F(0) + F(1) * C(3, 5) * F(5) + F(1) * C(3, 4) * F(4) + F(3) * C(2, 0) * F(0) + F(3) * C(2, 5) * F(5) + F(3) * C(2, 4) * F(4) + 0.0;
475  answer(3, 1) = F(8) * C(4, 5) * F(8) + F(8) * C(4, 1) * F(1) + F(8) * C(4, 3) * F(3) + F(1) * C(3, 5) * F(8) + F(1) * C(3, 1) * F(1) + F(1) * C(3, 3) * F(3) + F(3) * C(2, 5) * F(8) + F(3) * C(2, 1) * F(1) + F(3) * C(2, 3) * F(3) + S(3);
476  answer(3, 2) = F(8) * C(4, 4) * F(7) + F(8) * C(4, 3) * F(6) + F(8) * C(4, 2) * F(2) + F(1) * C(3, 4) * F(7) + F(1) * C(3, 3) * F(6) + F(1) * C(3, 2) * F(2) + F(3) * C(2, 4) * F(7) + F(3) * C(2, 3) * F(6) + F(3) * C(2, 2) * F(2) + 0.0;
477  answer(3, 3) = F(8) * C(4, 4) * F(8) + F(8) * C(4, 3) * F(1) + F(8) * C(4, 2) * F(3) + F(1) * C(3, 4) * F(8) + F(1) * C(3, 3) * F(1) + F(1) * C(3, 2) * F(3) + F(3) * C(2, 4) * F(8) + F(3) * C(2, 3) * F(1) + F(3) * C(2, 2) * F(3) + S(2);
478  answer(3, 4) = F(8) * C(4, 4) * F(0) + F(8) * C(4, 3) * F(5) + F(8) * C(4, 2) * F(4) + F(1) * C(3, 4) * F(0) + F(1) * C(3, 3) * F(5) + F(1) * C(3, 2) * F(4) + F(3) * C(2, 4) * F(0) + F(3) * C(2, 3) * F(5) + F(3) * C(2, 2) * F(4) + 0.0;
479  answer(3, 5) = F(8) * C(4, 5) * F(0) + F(8) * C(4, 1) * F(5) + F(8) * C(4, 3) * F(4) + F(1) * C(3, 5) * F(0) + F(1) * C(3, 1) * F(5) + F(1) * C(3, 3) * F(4) + F(3) * C(2, 5) * F(0) + F(3) * C(2, 1) * F(5) + F(3) * C(2, 3) * F(4) + 0.0;
480  answer(3, 6) = F(8) * C(4, 5) * F(7) + F(8) * C(4, 1) * F(6) + F(8) * C(4, 3) * F(2) + F(1) * C(3, 5) * F(7) + F(1) * C(3, 1) * F(6) + F(1) * C(3, 3) * F(2) + F(3) * C(2, 5) * F(7) + F(3) * C(2, 1) * F(6) + F(3) * C(2, 3) * F(2) + 0.0;
481  answer(3, 7) = F(8) * C(4, 0) * F(7) + F(8) * C(4, 5) * F(6) + F(8) * C(4, 4) * F(2) + F(1) * C(3, 0) * F(7) + F(1) * C(3, 5) * F(6) + F(1) * C(3, 4) * F(2) + F(3) * C(2, 0) * F(7) + F(3) * C(2, 5) * F(6) + F(3) * C(2, 4) * F(2) + 0.0;
482  answer(3, 8) = F(8) * C(4, 0) * F(8) + F(8) * C(4, 5) * F(1) + F(8) * C(4, 4) * F(3) + F(1) * C(3, 0) * F(8) + F(1) * C(3, 5) * F(1) + F(1) * C(3, 4) * F(3) + F(3) * C(2, 0) * F(8) + F(3) * C(2, 5) * F(1) + F(3) * C(2, 4) * F(3) + S(4);
483  answer(4, 0) = F(0) * C(4, 0) * F(0) + F(0) * C(4, 5) * F(5) + F(0) * C(4, 4) * F(4) + F(5) * C(3, 0) * F(0) + F(5) * C(3, 5) * F(5) + F(5) * C(3, 4) * F(4) + F(4) * C(2, 0) * F(0) + F(4) * C(2, 5) * F(5) + F(4) * C(2, 4) * F(4) + S(4);
484  answer(4, 1) = F(0) * C(4, 5) * F(8) + F(0) * C(4, 1) * F(1) + F(0) * C(4, 3) * F(3) + F(5) * C(3, 5) * F(8) + F(5) * C(3, 1) * F(1) + F(5) * C(3, 3) * F(3) + F(4) * C(2, 5) * F(8) + F(4) * C(2, 1) * F(1) + F(4) * C(2, 3) * F(3) + 0.0;
485  answer(4, 2) = F(0) * C(4, 4) * F(7) + F(0) * C(4, 3) * F(6) + F(0) * C(4, 2) * F(2) + F(5) * C(3, 4) * F(7) + F(5) * C(3, 3) * F(6) + F(5) * C(3, 2) * F(2) + F(4) * C(2, 4) * F(7) + F(4) * C(2, 3) * F(6) + F(4) * C(2, 2) * F(2) + 0.0;
486  answer(4, 3) = F(0) * C(4, 4) * F(8) + F(0) * C(4, 3) * F(1) + F(0) * C(4, 2) * F(3) + F(5) * C(3, 4) * F(8) + F(5) * C(3, 3) * F(1) + F(5) * C(3, 2) * F(3) + F(4) * C(2, 4) * F(8) + F(4) * C(2, 3) * F(1) + F(4) * C(2, 2) * F(3) + 0.0;
487  answer(4, 4) = F(0) * C(4, 4) * F(0) + F(0) * C(4, 3) * F(5) + F(0) * C(4, 2) * F(4) + F(5) * C(3, 4) * F(0) + F(5) * C(3, 3) * F(5) + F(5) * C(3, 2) * F(4) + F(4) * C(2, 4) * F(0) + F(4) * C(2, 3) * F(5) + F(4) * C(2, 2) * F(4) + S(2);
488  answer(4, 5) = F(0) * C(4, 5) * F(0) + F(0) * C(4, 1) * F(5) + F(0) * C(4, 3) * F(4) + F(5) * C(3, 5) * F(0) + F(5) * C(3, 1) * F(5) + F(5) * C(3, 3) * F(4) + F(4) * C(2, 5) * F(0) + F(4) * C(2, 1) * F(5) + F(4) * C(2, 3) * F(4) + S(3);
489  answer(4, 6) = F(0) * C(4, 5) * F(7) + F(0) * C(4, 1) * F(6) + F(0) * C(4, 3) * F(2) + F(5) * C(3, 5) * F(7) + F(5) * C(3, 1) * F(6) + F(5) * C(3, 3) * F(2) + F(4) * C(2, 5) * F(7) + F(4) * C(2, 1) * F(6) + F(4) * C(2, 3) * F(2) + 0.0;
490  answer(4, 7) = F(0) * C(4, 0) * F(7) + F(0) * C(4, 5) * F(6) + F(0) * C(4, 4) * F(2) + F(5) * C(3, 0) * F(7) + F(5) * C(3, 5) * F(6) + F(5) * C(3, 4) * F(2) + F(4) * C(2, 0) * F(7) + F(4) * C(2, 5) * F(6) + F(4) * C(2, 4) * F(2) + 0.0;
491  answer(4, 8) = F(0) * C(4, 0) * F(8) + F(0) * C(4, 5) * F(1) + F(0) * C(4, 4) * F(3) + F(5) * C(3, 0) * F(8) + F(5) * C(3, 5) * F(1) + F(5) * C(3, 4) * F(3) + F(4) * C(2, 0) * F(8) + F(4) * C(2, 5) * F(1) + F(4) * C(2, 4) * F(3) + 0.0;
492  answer(5, 0) = F(0) * C(5, 0) * F(0) + F(0) * C(5, 5) * F(5) + F(0) * C(5, 4) * F(4) + F(5) * C(1, 0) * F(0) + F(5) * C(1, 5) * F(5) + F(5) * C(1, 4) * F(4) + F(4) * C(3, 0) * F(0) + F(4) * C(3, 5) * F(5) + F(4) * C(3, 4) * F(4) + S(5);
493  answer(5, 1) = F(0) * C(5, 5) * F(8) + F(0) * C(5, 1) * F(1) + F(0) * C(5, 3) * F(3) + F(5) * C(1, 5) * F(8) + F(5) * C(1, 1) * F(1) + F(5) * C(1, 3) * F(3) + F(4) * C(3, 5) * F(8) + F(4) * C(3, 1) * F(1) + F(4) * C(3, 3) * F(3) + 0.0;
494  answer(5, 2) = F(0) * C(5, 4) * F(7) + F(0) * C(5, 3) * F(6) + F(0) * C(5, 2) * F(2) + F(5) * C(1, 4) * F(7) + F(5) * C(1, 3) * F(6) + F(5) * C(1, 2) * F(2) + F(4) * C(3, 4) * F(7) + F(4) * C(3, 3) * F(6) + F(4) * C(3, 2) * F(2) + 0.0;
495  answer(5, 3) = F(0) * C(5, 4) * F(8) + F(0) * C(5, 3) * F(1) + F(0) * C(5, 2) * F(3) + F(5) * C(1, 4) * F(8) + F(5) * C(1, 3) * F(1) + F(5) * C(1, 2) * F(3) + F(4) * C(3, 4) * F(8) + F(4) * C(3, 3) * F(1) + F(4) * C(3, 2) * F(3) + 0.0;
496  answer(5, 4) = F(0) * C(5, 4) * F(0) + F(0) * C(5, 3) * F(5) + F(0) * C(5, 2) * F(4) + F(5) * C(1, 4) * F(0) + F(5) * C(1, 3) * F(5) + F(5) * C(1, 2) * F(4) + F(4) * C(3, 4) * F(0) + F(4) * C(3, 3) * F(5) + F(4) * C(3, 2) * F(4) + S(3);
497  answer(5, 5) = F(0) * C(5, 5) * F(0) + F(0) * C(5, 1) * F(5) + F(0) * C(5, 3) * F(4) + F(5) * C(1, 5) * F(0) + F(5) * C(1, 1) * F(5) + F(5) * C(1, 3) * F(4) + F(4) * C(3, 5) * F(0) + F(4) * C(3, 1) * F(5) + F(4) * C(3, 3) * F(4) + S(1);
498  answer(5, 6) = F(0) * C(5, 5) * F(7) + F(0) * C(5, 1) * F(6) + F(0) * C(5, 3) * F(2) + F(5) * C(1, 5) * F(7) + F(5) * C(1, 1) * F(6) + F(5) * C(1, 3) * F(2) + F(4) * C(3, 5) * F(7) + F(4) * C(3, 1) * F(6) + F(4) * C(3, 3) * F(2) + 0.0;
499  answer(5, 7) = F(0) * C(5, 0) * F(7) + F(0) * C(5, 5) * F(6) + F(0) * C(5, 4) * F(2) + F(5) * C(1, 0) * F(7) + F(5) * C(1, 5) * F(6) + F(5) * C(1, 4) * F(2) + F(4) * C(3, 0) * F(7) + F(4) * C(3, 5) * F(6) + F(4) * C(3, 4) * F(2) + 0.0;
500  answer(5, 8) = F(0) * C(5, 0) * F(8) + F(0) * C(5, 5) * F(1) + F(0) * C(5, 4) * F(3) + F(5) * C(1, 0) * F(8) + F(5) * C(1, 5) * F(1) + F(5) * C(1, 4) * F(3) + F(4) * C(3, 0) * F(8) + F(4) * C(3, 5) * F(1) + F(4) * C(3, 4) * F(3) + 0.0;
501  answer(6, 0) = F(7) * C(5, 0) * F(0) + F(7) * C(5, 5) * F(5) + F(7) * C(5, 4) * F(4) + F(6) * C(1, 0) * F(0) + F(6) * C(1, 5) * F(5) + F(6) * C(1, 4) * F(4) + F(2) * C(3, 0) * F(0) + F(2) * C(3, 5) * F(5) + F(2) * C(3, 4) * F(4) + 0.0;
502  answer(6, 1) = F(7) * C(5, 5) * F(8) + F(7) * C(5, 1) * F(1) + F(7) * C(5, 3) * F(3) + F(6) * C(1, 5) * F(8) + F(6) * C(1, 1) * F(1) + F(6) * C(1, 3) * F(3) + F(2) * C(3, 5) * F(8) + F(2) * C(3, 1) * F(1) + F(2) * C(3, 3) * F(3) + 0.0;
503  answer(6, 2) = F(7) * C(5, 4) * F(7) + F(7) * C(5, 3) * F(6) + F(7) * C(5, 2) * F(2) + F(6) * C(1, 4) * F(7) + F(6) * C(1, 3) * F(6) + F(6) * C(1, 2) * F(2) + F(2) * C(3, 4) * F(7) + F(2) * C(3, 3) * F(6) + F(2) * C(3, 2) * F(2) + S(3);
504  answer(6, 3) = F(7) * C(5, 4) * F(8) + F(7) * C(5, 3) * F(1) + F(7) * C(5, 2) * F(3) + F(6) * C(1, 4) * F(8) + F(6) * C(1, 3) * F(1) + F(6) * C(1, 2) * F(3) + F(2) * C(3, 4) * F(8) + F(2) * C(3, 3) * F(1) + F(2) * C(3, 2) * F(3) + 0.0;
505  answer(6, 4) = F(7) * C(5, 4) * F(0) + F(7) * C(5, 3) * F(5) + F(7) * C(5, 2) * F(4) + F(6) * C(1, 4) * F(0) + F(6) * C(1, 3) * F(5) + F(6) * C(1, 2) * F(4) + F(2) * C(3, 4) * F(0) + F(2) * C(3, 3) * F(5) + F(2) * C(3, 2) * F(4) + 0.0;
506  answer(6, 5) = F(7) * C(5, 5) * F(0) + F(7) * C(5, 1) * F(5) + F(7) * C(5, 3) * F(4) + F(6) * C(1, 5) * F(0) + F(6) * C(1, 1) * F(5) + F(6) * C(1, 3) * F(4) + F(2) * C(3, 5) * F(0) + F(2) * C(3, 1) * F(5) + F(2) * C(3, 3) * F(4) + 0.0;
507  answer(6, 6) = F(7) * C(5, 5) * F(7) + F(7) * C(5, 1) * F(6) + F(7) * C(5, 3) * F(2) + F(6) * C(1, 5) * F(7) + F(6) * C(1, 1) * F(6) + F(6) * C(1, 3) * F(2) + F(2) * C(3, 5) * F(7) + F(2) * C(3, 1) * F(6) + F(2) * C(3, 3) * F(2) + S(1);
508  answer(6, 7) = F(7) * C(5, 0) * F(7) + F(7) * C(5, 5) * F(6) + F(7) * C(5, 4) * F(2) + F(6) * C(1, 0) * F(7) + F(6) * C(1, 5) * F(6) + F(6) * C(1, 4) * F(2) + F(2) * C(3, 0) * F(7) + F(2) * C(3, 5) * F(6) + F(2) * C(3, 4) * F(2) + S(5);
509  answer(6, 8) = F(7) * C(5, 0) * F(8) + F(7) * C(5, 5) * F(1) + F(7) * C(5, 4) * F(3) + F(6) * C(1, 0) * F(8) + F(6) * C(1, 5) * F(1) + F(6) * C(1, 4) * F(3) + F(2) * C(3, 0) * F(8) + F(2) * C(3, 5) * F(1) + F(2) * C(3, 4) * F(3) + 0.0;
510  answer(7, 0) = F(7) * C(0, 0) * F(0) + F(7) * C(0, 5) * F(5) + F(7) * C(0, 4) * F(4) + F(6) * C(5, 0) * F(0) + F(6) * C(5, 5) * F(5) + F(6) * C(5, 4) * F(4) + F(2) * C(4, 0) * F(0) + F(2) * C(4, 5) * F(5) + F(2) * C(4, 4) * F(4) + 0.0;
511  answer(7, 1) = F(7) * C(0, 5) * F(8) + F(7) * C(0, 1) * F(1) + F(7) * C(0, 3) * F(3) + F(6) * C(5, 5) * F(8) + F(6) * C(5, 1) * F(1) + F(6) * C(5, 3) * F(3) + F(2) * C(4, 5) * F(8) + F(2) * C(4, 1) * F(1) + F(2) * C(4, 3) * F(3) + 0.0;
512  answer(7, 2) = F(7) * C(0, 4) * F(7) + F(7) * C(0, 3) * F(6) + F(7) * C(0, 2) * F(2) + F(6) * C(5, 4) * F(7) + F(6) * C(5, 3) * F(6) + F(6) * C(5, 2) * F(2) + F(2) * C(4, 4) * F(7) + F(2) * C(4, 3) * F(6) + F(2) * C(4, 2) * F(2) + S(4);
513  answer(7, 3) = F(7) * C(0, 4) * F(8) + F(7) * C(0, 3) * F(1) + F(7) * C(0, 2) * F(3) + F(6) * C(5, 4) * F(8) + F(6) * C(5, 3) * F(1) + F(6) * C(5, 2) * F(3) + F(2) * C(4, 4) * F(8) + F(2) * C(4, 3) * F(1) + F(2) * C(4, 2) * F(3) + 0.0;
514  answer(7, 4) = F(7) * C(0, 4) * F(0) + F(7) * C(0, 3) * F(5) + F(7) * C(0, 2) * F(4) + F(6) * C(5, 4) * F(0) + F(6) * C(5, 3) * F(5) + F(6) * C(5, 2) * F(4) + F(2) * C(4, 4) * F(0) + F(2) * C(4, 3) * F(5) + F(2) * C(4, 2) * F(4) + 0.0;
515  answer(7, 5) = F(7) * C(0, 5) * F(0) + F(7) * C(0, 1) * F(5) + F(7) * C(0, 3) * F(4) + F(6) * C(5, 5) * F(0) + F(6) * C(5, 1) * F(5) + F(6) * C(5, 3) * F(4) + F(2) * C(4, 5) * F(0) + F(2) * C(4, 1) * F(5) + F(2) * C(4, 3) * F(4) + 0.0;
516  answer(7, 6) = F(7) * C(0, 5) * F(7) + F(7) * C(0, 1) * F(6) + F(7) * C(0, 3) * F(2) + F(6) * C(5, 5) * F(7) + F(6) * C(5, 1) * F(6) + F(6) * C(5, 3) * F(2) + F(2) * C(4, 5) * F(7) + F(2) * C(4, 1) * F(6) + F(2) * C(4, 3) * F(2) + S(5);
517  answer(7, 7) = F(7) * C(0, 0) * F(7) + F(7) * C(0, 5) * F(6) + F(7) * C(0, 4) * F(2) + F(6) * C(5, 0) * F(7) + F(6) * C(5, 5) * F(6) + F(6) * C(5, 4) * F(2) + F(2) * C(4, 0) * F(7) + F(2) * C(4, 5) * F(6) + F(2) * C(4, 4) * F(2) + S(0);
518  answer(7, 8) = F(7) * C(0, 0) * F(8) + F(7) * C(0, 5) * F(1) + F(7) * C(0, 4) * F(3) + F(6) * C(5, 0) * F(8) + F(6) * C(5, 5) * F(1) + F(6) * C(5, 4) * F(3) + F(2) * C(4, 0) * F(8) + F(2) * C(4, 5) * F(1) + F(2) * C(4, 4) * F(3) + 0.0;
519  answer(8, 0) = F(8) * C(0, 0) * F(0) + F(8) * C(0, 5) * F(5) + F(8) * C(0, 4) * F(4) + F(1) * C(5, 0) * F(0) + F(1) * C(5, 5) * F(5) + F(1) * C(5, 4) * F(4) + F(3) * C(4, 0) * F(0) + F(3) * C(4, 5) * F(5) + F(3) * C(4, 4) * F(4) + 0.0;
520  answer(8, 1) = F(8) * C(0, 5) * F(8) + F(8) * C(0, 1) * F(1) + F(8) * C(0, 3) * F(3) + F(1) * C(5, 5) * F(8) + F(1) * C(5, 1) * F(1) + F(1) * C(5, 3) * F(3) + F(3) * C(4, 5) * F(8) + F(3) * C(4, 1) * F(1) + F(3) * C(4, 3) * F(3) + S(5);
521  answer(8, 2) = F(8) * C(0, 4) * F(7) + F(8) * C(0, 3) * F(6) + F(8) * C(0, 2) * F(2) + F(1) * C(5, 4) * F(7) + F(1) * C(5, 3) * F(6) + F(1) * C(5, 2) * F(2) + F(3) * C(4, 4) * F(7) + F(3) * C(4, 3) * F(6) + F(3) * C(4, 2) * F(2) + 0.0;
522  answer(8, 3) = F(8) * C(0, 4) * F(8) + F(8) * C(0, 3) * F(1) + F(8) * C(0, 2) * F(3) + F(1) * C(5, 4) * F(8) + F(1) * C(5, 3) * F(1) + F(1) * C(5, 2) * F(3) + F(3) * C(4, 4) * F(8) + F(3) * C(4, 3) * F(1) + F(3) * C(4, 2) * F(3) + S(4);
523  answer(8, 4) = F(8) * C(0, 4) * F(0) + F(8) * C(0, 3) * F(5) + F(8) * C(0, 2) * F(4) + F(1) * C(5, 4) * F(0) + F(1) * C(5, 3) * F(5) + F(1) * C(5, 2) * F(4) + F(3) * C(4, 4) * F(0) + F(3) * C(4, 3) * F(5) + F(3) * C(4, 2) * F(4) + 0.0;
524  answer(8, 5) = F(8) * C(0, 5) * F(0) + F(8) * C(0, 1) * F(5) + F(8) * C(0, 3) * F(4) + F(1) * C(5, 5) * F(0) + F(1) * C(5, 1) * F(5) + F(1) * C(5, 3) * F(4) + F(3) * C(4, 5) * F(0) + F(3) * C(4, 1) * F(5) + F(3) * C(4, 3) * F(4) + 0.0;
525  answer(8, 6) = F(8) * C(0, 5) * F(7) + F(8) * C(0, 1) * F(6) + F(8) * C(0, 3) * F(2) + F(1) * C(5, 5) * F(7) + F(1) * C(5, 1) * F(6) + F(1) * C(5, 3) * F(2) + F(3) * C(4, 5) * F(7) + F(3) * C(4, 1) * F(6) + F(3) * C(4, 3) * F(2) + 0.0;
526  answer(8, 7) = F(8) * C(0, 0) * F(7) + F(8) * C(0, 5) * F(6) + F(8) * C(0, 4) * F(2) + F(1) * C(5, 0) * F(7) + F(1) * C(5, 5) * F(6) + F(1) * C(5, 4) * F(2) + F(3) * C(4, 0) * F(7) + F(3) * C(4, 5) * F(6) + F(3) * C(4, 4) * F(2) + 0.0;
527  answer(8, 8) = F(8) * C(0, 0) * F(8) + F(8) * C(0, 5) * F(1) + F(8) * C(0, 4) * F(3) + F(1) * C(5, 0) * F(8) + F(1) * C(5, 5) * F(1) + F(1) * C(5, 4) * F(3) + F(3) * C(4, 0) * F(8) + F(3) * C(4, 5) * F(1) + F(3) * C(4, 4) * F(3) + S(0);
528 
529 #else
530  // Conversion expressed in index form. Seems a tiny bit slower than that above but easier to debug.
532  FloatMatrix I(3, 3);
533  I.beUnitMatrix();
534 
535  //I_ik * S_jl + F_im F_kn C_mjnl
536  answer.resize(9, 9);
537  for ( int i = 1; i <= 3; i++ ) {
538  for ( int j = 1; j <= 3; j++ ) {
539  for ( int k = 1; k <= 3; k++ ) {
540  for ( int l = 1; l <= 3; l++ ) {
541  for ( int m = 1; m <= 3; m++ ) {
542  for ( int n = 1; n <= 3; n++ ) {
543  answer.at( giveVI(i, j), giveVI(k, l) ) += I.at(i, k) * S.at( giveSymVI(j, l) ) + F.at( giveVI(i, m) ) * F.at( giveVI(k, n) ) * C.at( giveSymVI(m, j), giveSymVI(n, l) );
544  }
545  }
546  }
547  }
548  }
549  }
550 
551 #endif
552  } else if ( matMode == _PlaneStress ) {
553  // Save terms associated with H = [du/dx dv/dy du/dy dv/dx]
554 
555  answer.resize(4, 4);
556  answer(0, 0) = F(0) * C(0, 0) * F(0) + F(0) * C(0, 2) * F(2) + F(2) * C(2, 0) * F(0) + F(2) * C(2, 2) * F(2) + S(0);
557  answer(0, 1) = F(0) * C(0, 2) * F(3) + F(0) * C(0, 1) * F(1) + F(2) * C(2, 2) * F(3) + F(2) * C(2, 1) * F(1) + 0.0;
558  answer(0, 2) = F(0) * C(0, 2) * F(0) + F(0) * C(0, 1) * F(2) + F(2) * C(2, 2) * F(0) + F(2) * C(2, 1) * F(2) + S(2);
559  answer(0, 3) = F(0) * C(0, 0) * F(3) + F(0) * C(0, 2) * F(1) + F(2) * C(2, 0) * F(3) + F(2) * C(2, 2) * F(1) + 0.0;
560  answer(1, 0) = F(3) * C(2, 0) * F(0) + F(3) * C(2, 2) * F(2) + F(1) * C(1, 0) * F(0) + F(1) * C(1, 2) * F(2) + 0.0;
561  answer(1, 1) = F(3) * C(2, 2) * F(3) + F(3) * C(2, 1) * F(1) + F(1) * C(1, 2) * F(3) + F(1) * C(1, 1) * F(1) + S(1);
562  answer(1, 2) = F(3) * C(2, 2) * F(0) + F(3) * C(2, 1) * F(2) + F(1) * C(1, 2) * F(0) + F(1) * C(1, 1) * F(2) + 0.0;
563  answer(1, 3) = F(3) * C(2, 0) * F(3) + F(3) * C(2, 2) * F(1) + F(1) * C(1, 0) * F(3) + F(1) * C(1, 2) * F(1) + S(2);
564  answer(2, 0) = F(0) * C(2, 0) * F(0) + F(0) * C(2, 2) * F(2) + F(2) * C(1, 0) * F(0) + F(2) * C(1, 2) * F(2) + S(2);
565  answer(2, 1) = F(0) * C(2, 2) * F(3) + F(0) * C(2, 1) * F(1) + F(2) * C(1, 2) * F(3) + F(2) * C(1, 1) * F(1) + 0.0;
566  answer(2, 2) = F(0) * C(2, 2) * F(0) + F(0) * C(2, 1) * F(2) + F(2) * C(1, 2) * F(0) + F(2) * C(1, 1) * F(2) + S(1);
567  answer(2, 3) = F(0) * C(2, 0) * F(3) + F(0) * C(2, 2) * F(1) + F(2) * C(1, 0) * F(3) + F(2) * C(1, 2) * F(1) + 0.0;
568  answer(3, 0) = F(3) * C(0, 0) * F(0) + F(3) * C(0, 2) * F(2) + F(1) * C(2, 0) * F(0) + F(1) * C(2, 2) * F(2) + 0.0;
569  answer(3, 1) = F(3) * C(0, 2) * F(3) + F(3) * C(0, 1) * F(1) + F(1) * C(2, 2) * F(3) + F(1) * C(2, 1) * F(1) + S(2);
570  answer(3, 2) = F(3) * C(0, 2) * F(0) + F(3) * C(0, 1) * F(2) + F(1) * C(2, 2) * F(0) + F(1) * C(2, 1) * F(2) + 0.0;
571  answer(3, 3) = F(3) * C(0, 0) * F(3) + F(3) * C(0, 2) * F(1) + F(1) * C(2, 0) * F(3) + F(1) * C(2, 2) * F(1) + S(0);
572  } else if ( matMode == _PlaneStrain ) {
573  //Save terms associated with H = [du/dx, dv/dy, dw/dz, du/dy, dv/dx] //@todo not fully checked
574 
575  answer.resize(5, 5);
576  answer(0, 0) = F(0) * C(0, 0) * F(0) + F(0) * C(0, 3) * F(3) + F(3) * C(3, 0) * F(0) + F(3) * C(3, 3) * F(3) + S(0);
577  answer(0, 1) = F(0) * C(0, 3) * F(4) + F(0) * C(0, 1) * F(1) + F(3) * C(3, 3) * F(4) + F(3) * C(3, 1) * F(1) + 0.0;
578  answer(0, 2) = F(0) * C(0, 2) * F(2) + F(3) * C(3, 2) * F(2) + 0.0;
579  answer(0, 3) = F(0) * C(0, 3) * F(0) + F(0) * C(0, 1) * F(3) + F(3) * C(3, 3) * F(0) + F(3) * C(3, 1) * F(3) + S(3);
580  answer(0, 4) = F(0) * C(0, 0) * F(4) + F(0) * C(0, 3) * F(1) + F(3) * C(3, 0) * F(4) + F(3) * C(3, 3) * F(1) + 0.0;
581  answer(1, 0) = F(4) * C(3, 0) * F(0) + F(4) * C(3, 3) * F(3) + F(1) * C(1, 0) * F(0) + F(1) * C(1, 3) * F(3) + 0.0;
582  answer(1, 1) = F(4) * C(3, 3) * F(4) + F(4) * C(3, 1) * F(1) + F(1) * C(1, 3) * F(4) + F(1) * C(1, 1) * F(1) + S(1);
583  answer(1, 2) = F(4) * C(3, 2) * F(2) + F(1) * C(1, 2) * F(2) + 0.0;
584  answer(1, 3) = F(4) * C(3, 3) * F(0) + F(4) * C(3, 1) * F(3) + F(1) * C(1, 3) * F(0) + F(1) * C(1, 1) * F(3) + 0.0;
585  answer(1, 4) = F(4) * C(3, 0) * F(4) + F(4) * C(3, 3) * F(1) + F(1) * C(1, 0) * F(4) + F(1) * C(1, 3) * F(1) + S(3);
586  answer(2, 0) = F(2) * C(2, 0) * F(0) + F(2) * C(2, 3) * F(3) + 0.0;
587  answer(2, 1) = F(2) * C(2, 3) * F(4) + F(2) * C(2, 1) * F(1) + 0.0;
588  answer(2, 2) = F(2) * C(2, 2) * F(2) + S(2);
589  answer(2, 3) = F(2) * C(2, 3) * F(0) + F(2) * C(2, 1) * F(3) + 0.0;
590  answer(2, 4) = F(2) * C(2, 0) * F(4) + F(2) * C(2, 3) * F(1) + 0.0;
591  answer(3, 0) = F(0) * C(3, 0) * F(0) + F(0) * C(3, 3) * F(3) + F(3) * C(1, 0) * F(0) + F(3) * C(1, 3) * F(3) + S(3);
592  answer(3, 1) = F(0) * C(3, 3) * F(4) + F(0) * C(3, 1) * F(1) + F(3) * C(1, 3) * F(4) + F(3) * C(1, 1) * F(1) + 0.0;
593  answer(3, 2) = F(0) * C(3, 2) * F(2) + F(3) * C(1, 2) * F(2) + 0.0;
594  answer(3, 3) = F(0) * C(3, 3) * F(0) + F(0) * C(3, 1) * F(3) + F(3) * C(1, 3) * F(0) + F(3) * C(1, 1) * F(3) + S(1);
595  answer(3, 4) = F(0) * C(3, 0) * F(4) + F(0) * C(3, 3) * F(1) + F(3) * C(1, 0) * F(4) + F(3) * C(1, 3) * F(1) + 0.0;
596  answer(4, 0) = F(4) * C(0, 0) * F(0) + F(4) * C(0, 3) * F(3) + F(1) * C(3, 0) * F(0) + F(1) * C(3, 3) * F(3) + 0.0;
597  answer(4, 1) = F(4) * C(0, 3) * F(4) + F(4) * C(0, 1) * F(1) + F(1) * C(3, 3) * F(4) + F(1) * C(3, 1) * F(1) + S(3);
598  answer(4, 2) = F(4) * C(0, 2) * F(2) + F(1) * C(3, 2) * F(2) + 0.0;
599  answer(4, 3) = F(4) * C(0, 3) * F(0) + F(4) * C(0, 1) * F(3) + F(1) * C(3, 3) * F(0) + F(1) * C(3, 1) * F(3) + 0.0;
600  answer(4, 4) = F(4) * C(0, 0) * F(4) + F(4) * C(0, 3) * F(1) + F(1) * C(3, 0) * F(4) + F(1) * C(3, 3) * F(1) + S(0);
601  } else if ( matMode == _1dMat ) {
602  //Save terms associated with H = [du/dx]
604 
605  answer.resize(1, 1);
606  answer(0, 0) = F(0) * C(0, 0) * F(0) + S(0);
607  }
608 }
609 
610 void
612 {
613  OOFEM_ERROR("not implemented ")
614 }
615 
616 void
618 {
619  // Default implementation for converting dSdE to dPdF. This includes updating the
620  // state variables of P and F.
621  StructuralMaterialStatus *status = static_cast< StructuralMaterialStatus * >( this->giveStatus(gp) );
622  FloatArray reducedvF, reducedvP, reducedvS;
623  const FloatArray &vF = status->giveTempFVector();
624  const FloatArray &vP = status->giveTempPVector();
625  const FloatArray &vS = status->giveTempStressVector();
626 
627  MaterialMode matMode = gp->giveMaterialMode();
629  StructuralMaterial :: giveReducedVectorForm(reducedvF, vF, matMode);
630  StructuralMaterial :: giveReducedVectorForm(reducedvP, vP, matMode);
631  StructuralMaterial :: giveReducedSymVectorForm(reducedvS, vS, matMode);
632  //this->convert_P_2_S(reducedvS, reducedvP, reducedvF, matMode);
633  this->convert_dSdE_2_dPdF(answer, dSdE, reducedvS, reducedvF, matMode);
634 }
635 
636 
637 void
639  MatResponseMode rMode,
640  GaussPoint *gp, TimeStep *tStep)
641 //
642 // Returns characteristic material stiffness matrix of the receiver
643 //
644 {
645  MaterialMode mMode = gp->giveMaterialMode();
646  switch ( mMode ) {
647  case _3dMat:
648  this->give3dMaterialStiffnessMatrix(answer, rMode, gp, tStep);
649  break;
650  case _PlaneStress:
651  this->givePlaneStressStiffMtrx(answer, rMode, gp, tStep);
652  break;
653  case _PlaneStrain:
654  this->givePlaneStrainStiffMtrx(answer, rMode, gp, tStep);
655  break;
656  case _1dMat:
657  this->give1dStressStiffMtrx(answer, rMode, gp, tStep);
658  break;
659 
660  case _PlateLayer:
661  this->givePlateLayerStiffMtrx(answer, rMode, gp, tStep);
662  break;
663  case _2dBeamLayer:
664  this->give2dBeamLayerStiffMtrx(answer, rMode, gp, tStep);
665  break;
666  case _Fiber:
667  this->giveFiberStiffMtrx(answer, rMode, gp, tStep);
668  break;
669  case _Warping:
670  answer.resize(2, 2);
671  answer.beUnitMatrix();
672  break;
673  case _2dLattice:
674  this->give2dLatticeStiffMtrx(answer, rMode, gp, tStep);
675  break;
676  case _3dLattice:
677  this->give3dLatticeStiffMtrx(answer, rMode, gp, tStep);
678  break;
679 
680  default:
681  OOFEM_ERROR( "unknown mode (%s)", __MaterialModeToString(mMode) );
682  }
683 }
684 
685 
686 void
688  MatResponseMode mode,
689  GaussPoint *gp, TimeStep *tStep)
690 {
691  FloatMatrix dSdE;
692  this->give3dMaterialStiffnessMatrix(dSdE, mode, gp, tStep);
693  this->give_dPdF_from(dSdE, answer, gp);
694 }
695 
696 
697 void
699  MatResponseMode mode,
700  GaussPoint *gp, TimeStep *tStep)
701 {
702  FloatMatrix dSdE;
703  this->givePlaneStressStiffMtrx(dSdE, mode, gp, tStep);
704  this->give_dPdF_from(dSdE, answer, gp);
705 }
706 
707 
708 void
710  MatResponseMode mode,
711  GaussPoint *gp, TimeStep *tStep)
712 {
713  FloatMatrix dSdE;
714  this->givePlaneStrainStiffMtrx(dSdE, mode, gp, tStep);
715  this->give_dPdF_from(dSdE, answer, gp);
716 }
717 
718 
719 void
721  MatResponseMode mode,
722  GaussPoint *gp, TimeStep *tStep)
723 {
724  FloatMatrix dSdE;
725  this->give1dStressStiffMtrx(dSdE, mode, gp, tStep);
726  this->give_dPdF_from(dSdE, answer, gp);
727 }
728 
729 
730 void
732  MatResponseMode mode,
733  GaussPoint *gp, TimeStep *tStep)
734 {
736  OOFEM_ERROR("There is no default implementation");
737 }
738 
739 
740 void
742  MatResponseMode mode,
743  GaussPoint *gp, TimeStep *tStep)
744 {
745  OOFEM_ERROR("There is no default implementation");
746 }
747 
748 
749 void
751  MatResponseMode mode,
752  GaussPoint *gp, TimeStep *tStep)
753 {
754  OOFEM_ERROR("There is no default implementation");
755 }
756 
757 
758 void
760  MatResponseMode mode,
761  GaussPoint *gp, TimeStep *tStep)
762 {
763  OOFEM_ERROR("There is no default implementation");
764 }
765 
766 
767 void
769  const FloatArray &reducedStrainVector,
770  TimeStep *tStep, ValueModeType mode)
771 {
772  /*
773  * This functions subtract from reducedStrainVector its stress independent part
774  * caused by temperature, shrinkage and possibly by other phenomena.
775  */
776  FloatArray epsilonTemperature;
777 
778  answer = reducedStrainVector;
779  this->computeStressIndependentStrainVector(epsilonTemperature, gp, tStep, mode);
780  if ( epsilonTemperature.giveSize() ) {
781  answer.subtract(epsilonTemperature);
782  }
783 }
784 
785 void
787  const FloatArray &reducedStrainVector,
788  TimeStep *tStep, ValueModeType mode)
789 {
790  FloatArray epsilonTemperature;
791 
792  answer = reducedStrainVector;
793  this->computeStressIndependentStrainVector_3d(epsilonTemperature, gp, tStep, mode);
794  if ( epsilonTemperature.giveSize() ) {
795  answer.subtract(epsilonTemperature);
796  }
797 }
798 
799 
800 int
802 {
803  IntArray indx;
805  return indx.giveSize();
806 }
807 
808 
809 int
811 {
812  IntArray indx;
814  return indx.giveSize();
815 }
816 
817 
818 void
820 {
821  IntArray mask;
823  answer.zero();
824  for ( int i = 1; i <= mask.giveSize(); i++ ) {
825  answer.at( mask.at(i) ) = i;
826  }
827 }
828 
829 
830 int
832 {
833  // The same as giveVoigtVectorMask but returns a mask corresponding to a symmetric
834  // second order tensor.
835  //
836  // Returns a mask of the vector indices corresponding to components in a symmetric
837  // second order tensor of some stress/strain/deformation measure that performs work.
838  // Thus, components corresponding to imposed zero stress (e.g. plane stress etc.) are
839  // not included. On the other hand, if zero strain components are imposed( e.g. plane
840  // strain etc.) this condition must be taken into account in geometrical relations.
841  // Therefore, these corresponding components are included in the reduced vector.
842  // Which components to include are given by the particular MaterialMode.
843 
844  switch ( mmode ) {
845  case _3dMat:
846  case _3dMicroplane:
847  answer.enumerate(6);
848  return 6;
849 
850  case _3dDegeneratedShell:
851  answer = {
852  1, 2, 3, 4, 5, 6
853  };
854  return 6;
855 
856 
857  case _PlaneStress:
858  answer = {
859  1, 2, 6
860  };
861  return 6;
862 
863  case _PlaneStrain:
864  answer = {
865  1, 2, 3, 6
866  };
867  return 6;
868 
869  case _1dMat:
870  answer = {
871  1
872  };
873  return 6;
874 
875  case _Warping:
876  answer = {
877  4, 5
878  };
879  return 6;
880 
881  case _PlateLayer:
882  answer = {
883  1, 2, 4, 5, 6
884  };
885  return 6;
886 
887  case _2dBeamLayer:
888  answer = {
889  1, 5
890  };
891  return 6;
892 
893  case _Fiber:
894  answer = {
895  1, 5, 6
896  };
897  return 6;
898 
899  case _2dPlate:
900  answer = {
901  4, 5, 6, 7, 8
902  };
903  return 8;
904 
905  case _2dBeam:
906  answer = {
907  1, 4, 7
908  };
909  return 8;
910 
911  case _3dBeam:
912 #if 1
913  answer.enumerate(6);
914  return 6;
915 
916 #else
917  answer = {
918  1, 5, 6, 7, 8, 9
919  };
920  return 12;
921 
922 #endif
923  case _3dShell:
924  answer.enumerate(8);
925  return 8;
926 
927  case _PlaneStressRot:
928  answer = {
929  1, 2, 6, 7
930  };
931  return 7;
932 
933  case _1dInterface:
934  answer = {
935  1
936  };
937  return 1;
938 
939  case _2dInterface:
940  answer = {
941  1, 2
942  };
943  return 2;
944 
945  case _3dInterface:
946  answer = {
947  1, 2, 3
948  };
949  return 3;
950 
951  case _2dLattice:
952  answer = {
953  1, 2, 3
954  };
955  return 3;
956 
957  case _3dLattice:
958  answer = {
959  1, 2, 3, 4, 5, 6
960  };
961  return 6;
962 
963  case _2dPlateSubSoil:
964  answer = {
965  3, 5, 4
966  };
967  return 6;
968 
969  case _3dBeamSubSoil:
970 #if 1
971  answer.enumerate(6);
972  return 6;
973 
974 #else
975  answer = {
976  1, 5, 6, 7, 8, 9
977  };
978  return 12;
979 #endif
980 
981  case _Unknown:
982  answer.clear();
983  return 0;
984 
985  default:
986  return 0;
987  }
988 }
989 
990 
991 int
993 {
994  // Returns a mask of the vector indices corresponding to components in a general
995  // (non-symmetric) second order tensor of some stress/strain/deformation measure that
996  // performs work. Thus, components corresponding to imposed zero stress (e.g. plane
997  // stress etc.) are not included. On the other hand, if zero strain components are
998  // imposed( e.g. plane strain etc.) this condition must be taken into account in
999  // geometrical relations. Therefore, these corresponding components are included in
1000  // the reduced vector. Which components to include are given by the particular MaterialMode.
1001  //
1003 
1004  switch ( mmode ) {
1005  case _3dMat:
1006  answer.resize(9);
1007  for ( int i = 1; i <= 9; i++ ) {
1008  answer.at(i) = i;
1009  }
1010 
1011  return 9;
1012 
1013  case _PlaneStress:
1014  answer.resize(4);
1015  answer.at(1) = 1;
1016  answer.at(2) = 2;
1017  answer.at(3) = 6;
1018  answer.at(4) = 9;
1019  return 9;
1020 
1021  case _PlaneStrain:
1022  answer.resize(5);
1023  answer.at(1) = 1;
1024  answer.at(2) = 2;
1025  answer.at(3) = 3;
1026  answer.at(4) = 6;
1027  answer.at(5) = 9;
1028  return 9;
1029 
1030  case _1dMat:
1031  answer.resize(1);
1032  answer.at(1) = 1;
1033  return 9;
1034 
1035  default:
1036  return 0;
1037  }
1038 }
1039 
1040 
1041 void
1043  MatResponseMode mode,
1044  GaussPoint *gp,
1045  TimeStep *tStep)
1046 //
1047 // returns Mat stiffness for PlaneStress
1048 //
1049 {
1050  FloatMatrix m3d, invMat3d, invAnswer;
1051 
1052  this->give3dMaterialStiffnessMatrix(m3d, mode, gp, tStep);
1053 
1054  invMat3d.beInverseOf(m3d);
1055 
1056  invAnswer.resize(3, 3);
1057  //invAnswer.beSubMatrixOf(invMat3d, indx, indx);
1058 
1059  invAnswer.at(1, 1) = invMat3d.at(1, 1);
1060  invAnswer.at(1, 2) = invMat3d.at(1, 2);
1061  invAnswer.at(1, 3) = invMat3d.at(1, 6);
1062 
1063  invAnswer.at(2, 1) = invMat3d.at(2, 1);
1064  invAnswer.at(2, 2) = invMat3d.at(2, 2);
1065  invAnswer.at(2, 3) = invMat3d.at(2, 6);
1066 
1067  invAnswer.at(3, 1) = invMat3d.at(6, 1);
1068  invAnswer.at(3, 2) = invMat3d.at(6, 2);
1069  invAnswer.at(3, 3) = invMat3d.at(6, 6);
1070 
1071  answer.beInverseOf(invAnswer);
1072 }
1073 
1074 void
1076  MatResponseMode mode,
1077  GaussPoint *gp,
1078  TimeStep *tStep)
1079 //
1080 // return material stiffness matrix for PlaneStrain mode
1081 //
1082 {
1083  FloatMatrix m3d;
1084 
1085  this->give3dMaterialStiffnessMatrix(m3d, mode, gp, tStep);
1086 
1087  answer.resize(4, 4);
1088  answer.zero();
1089  //answer.beSubMatrixOf(m3d, indx, indx);
1090 
1091  answer.at(1, 1) = m3d.at(1, 1);
1092  answer.at(1, 2) = m3d.at(1, 2);
1093  answer.at(1, 4) = m3d.at(1, 6);
1094 
1095  answer.at(2, 1) = m3d.at(2, 1);
1096  answer.at(2, 2) = m3d.at(2, 2);
1097  answer.at(2, 4) = m3d.at(2, 6);
1098 
1099  answer.at(3, 1) = m3d.at(3, 1);
1100  answer.at(3, 2) = m3d.at(3, 2);
1101  answer.at(3, 4) = m3d.at(3, 6);
1102 
1103  answer.at(4, 1) = m3d.at(6, 1);
1104  answer.at(4, 2) = m3d.at(6, 2);
1105  answer.at(4, 4) = m3d.at(6, 6);
1106 }
1107 
1108 void
1110  MatResponseMode mode,
1111  GaussPoint *gp,
1112  TimeStep *tStep)
1113 //
1114 // return material stiffness matrix for 1d stress strain mode
1115 //
1116 {
1117  FloatMatrix m3d, invMat3d;
1118  double val11;
1119 
1120  this->give3dMaterialStiffnessMatrix(m3d, mode, gp, tStep);
1121 
1122  invMat3d.beInverseOf(m3d);
1123  val11 = invMat3d.at(1, 1);
1124  answer.resize(1, 1);
1125  answer.at(1, 1) = 1. / val11;
1126 }
1127 
1128 
1129 void
1131  MatResponseMode mode,
1132  GaussPoint *gp,
1133  TimeStep *tStep)
1134 //
1135 // return material stiffness matrix for2dBeamLayer mode
1136 //
1137 {
1138  FloatMatrix m3d, invMat3d, invMatLayer(2, 2);
1139 
1140  this->give3dMaterialStiffnessMatrix(m3d, mode, gp, tStep);
1141 
1142  invMat3d.beInverseOf(m3d);
1143 
1144  invMatLayer.at(1, 1) = invMat3d.at(1, 1);
1145  invMatLayer.at(1, 2) = invMat3d.at(1, 5);
1146  invMatLayer.at(2, 1) = invMat3d.at(5, 1);
1147  invMatLayer.at(2, 2) = invMat3d.at(5, 5);
1148 
1149  answer.beInverseOf(invMatLayer);
1150 }
1151 
1152 
1153 void
1155  MatResponseMode mode,
1156  GaussPoint *gp,
1157  TimeStep *tStep)
1158 //
1159 // return material stiffness matrix for 2dPlateLayer
1160 //
1161 {
1162  FloatMatrix m3d, invMat3d, invMatLayer(5, 5);
1163 
1164  this->give3dMaterialStiffnessMatrix(m3d, mode, gp, tStep);
1165 
1166  invMat3d.beInverseOf(m3d);
1167  //invMatLayer.beSubMatrixOf(invMat3d, indx, indx);
1168 
1169  for ( int i = 1; i <= 2; i++ ) {
1170  for ( int j = 1; j <= 2; j++ ) {
1171  invMatLayer.at(i, j) = invMat3d.at(i, j);
1172  }
1173  }
1174 
1175  for ( int i = 4; i <= 6; i++ ) {
1176  for ( int j = 4; j <= 6; j++ ) {
1177  invMatLayer.at(i - 1, j - 1) = invMat3d.at(i, j);
1178  }
1179  }
1180 
1181  for ( int i = 1; i <= 2; i++ ) {
1182  for ( int j = 4; j <= 6; j++ ) {
1183  invMatLayer.at(i, j - 1) = invMat3d.at(i, j);
1184  invMatLayer.at(j - 1, i) = invMat3d.at(j, i);
1185  }
1186  }
1187 
1188  answer.beInverseOf(invMatLayer);
1189 }
1190 
1191 void
1193  MatResponseMode mode,
1194  GaussPoint *gp,
1195  TimeStep *tStep)
1196 //
1197 // return material stiffness matrix for 2dPlateLayer
1198 //
1199 {
1200  FloatMatrix m3d, invMat3d, invMatLayer(3, 3);
1201 
1202  this->give3dMaterialStiffnessMatrix(m3d, mode, gp, tStep);
1203 
1204  invMat3d.beInverseOf(m3d);
1205 
1206  invMatLayer.at(1, 1) = invMat3d.at(1, 1);
1207  invMatLayer.at(1, 2) = invMat3d.at(1, 5);
1208  invMatLayer.at(1, 3) = invMat3d.at(1, 6);
1209  invMatLayer.at(2, 1) = invMat3d.at(5, 1);
1210  invMatLayer.at(2, 2) = invMat3d.at(5, 5);
1211  invMatLayer.at(2, 3) = invMat3d.at(5, 6);
1212  invMatLayer.at(3, 1) = invMat3d.at(6, 1);
1213  invMatLayer.at(3, 2) = invMat3d.at(6, 5);
1214  invMatLayer.at(3, 3) = invMat3d.at(6, 6);
1215 
1216  answer.beInverseOf(invMatLayer);
1217 }
1218 
1219 void
1221  MatResponseMode mode,
1222  GaussPoint *gp,
1223  TimeStep *tStep)
1224 //
1225 // return material stiffness matrix for 2dlattice
1226 //
1227 {
1228  OOFEM_ERROR("No general implementation provided");
1229 }
1230 
1231 void
1233  MatResponseMode mode,
1234  GaussPoint *gp,
1235  TimeStep *tStep)
1236 //
1237 // return material stiffness matrix for 2dlattice
1238 //
1239 {
1240  OOFEM_ERROR("No general implementation provided");
1241 }
1242 
1243 
1244 void
1246  MatResponseMode mmode, GaussPoint *gp,
1247  TimeStep *tStep)
1248 {
1249  OOFEM_ERROR("No general implementation provided");
1250 }
1251 
1252 void
1254  MatResponseMode mmode, GaussPoint *gp,
1255  TimeStep *tStep)
1256 {
1257  OOFEM_ERROR("No general implementation provided");
1258 }
1259 
1260 
1261 
1262 
1263 void
1265 //
1266 // This function computes the principal values of strains or stresses.
1267 // Strains/stresses are stored in vector form in array s.
1268 // Engineering notation is used.
1269 //
1270 // Problem size (3D/2D) is recognized automatically according to the
1271 // vector size.
1272 // If size = 6 -> 3D problem, then array s contains:
1273 // {Sxx,Syy,Szz,Syz,Szx,Sxy} if mode = principal_stress
1274 // {Exx,Eyy,Ezz,GMyz,GMzx,GMxy} if mode = principal_strain
1275 // if size = 3 -> 2D problem, then array s contains:
1276 // {Sxx,Syy,Sxy} if mode = principal_stress
1277 // {Exx,Eyy,GMxy} if mode = principal_strain
1278 //
1279 // if size = 4 -> 2D problem (with normal out-of-plane component), then array s contains:
1280 // {Sxx,Syy,Szz,Sxy} if mode = principal_stress
1281 // {Exx,Eyy,Ezz,GMxy} if mode = principal_strain
1282 //
1283 // Return Values:
1284 //
1285 // array answer -> principal strains or stresses
1286 //
1287 {
1288  int size = s.giveSize();
1289  if ( !( size == 1 || size == 3 || size == 4 || size == 6 ) ) {
1290  OOFEM_SERROR("Vector size mismatch");
1291  }
1292 
1293  double swap;
1294  int nonzeroFlag = 0;
1295  bool solve = true;
1296  if ( size == 1 ) {
1297  answer.resize(1);
1298  answer.at(1) = s.at(1);
1299  return;
1300  } else if ( size == 3 || size == 4 ) {
1301  // 2D problem
1302  double ast, dst, D = 0.0;
1303  answer.resize(size - 1);
1304 
1305  for ( int i = 1; i <= size; i++ ) {
1306  if ( fabs( s.at(i) ) > 1.e-20 ) {
1307  nonzeroFlag = 1;
1308  }
1309  }
1310 
1311  if ( nonzeroFlag == 0 ) {
1312  answer.zero();
1313  return;
1314  }
1315 
1316  ast = s.at(1) + s.at(2);
1317  dst = s.at(1) - s.at(2);
1318  if ( mode == principal_strain ) {
1319  D = dst * dst + s.at(size) * s.at(size);
1320  } else if ( mode == principal_stress ) {
1321  D = dst * dst + 4.0 * s.at(size) * s.at(size);
1322  } else {
1323  OOFEM_SERROR("not supported");
1324  }
1325 
1326  if ( D < 0. ) {
1327  OOFEM_SERROR("Imaginary roots ");
1328  }
1329 
1330  D = sqrt(D);
1331  answer.at(1) = 0.5 * ( ast - D );
1332  answer.at(2) = 0.5 * ( ast + D );
1333  if ( size == 4 ) {
1334  answer.at(3) = s.at(3);
1335  }
1336  } else {
1337  // 3D problem
1338  double I1 = 0.0, I2 = 0.0, I3 = 0.0, help, s1, s2, s3;
1339 
1340  for ( int i = 1; i <= size; i++ ) {
1341  if ( fabs( s.at(i) ) > 1.e-20 ) {
1342  nonzeroFlag = 1;
1343  }
1344  }
1345 
1346  answer.resize(3);
1347  answer.zero();
1348  if ( nonzeroFlag == 0 ) {
1349  return;
1350  }
1351 
1352  if ( mode == principal_stress ) {
1353  I1 = s.at(1) + s.at(2) + s.at(3);
1354  I2 = s.at(1) * s.at(2) + s.at(2) * s.at(3) + s.at(3) * s.at(1) -
1355  ( s.at(4) * s.at(4) + s.at(5) * s.at(5) + s.at(6) * s.at(6) );
1356  I3 = s.at(1) * s.at(2) * s.at(3) + 2. * s.at(4) * s.at(5) * s.at(6) -
1357  ( s.at(1) * s.at(4) * s.at(4) + s.at(2) * s.at(5) * s.at(5) +
1358  s.at(3) * s.at(6) * s.at(6) );
1359  } else if ( mode == principal_deviatoricstress ) {
1360  help = ( s.at(1) + s.at(2) + s.at(3) ) / 3.0;
1361  I1 = 0.;
1362  I2 = -( 1. / 6. ) * ( ( s.at(1) - s.at(2) ) * ( s.at(1) - s.at(2) ) + ( s.at(2) - s.at(3) ) * ( s.at(2) - s.at(3) ) +
1363  ( s.at(3) - s.at(1) ) * ( s.at(3) - s.at(1) ) ) - s.at(4) * s.at(4) - s.at(5) * s.at(5) -
1364  s.at(6) * s.at(6);
1365  I3 = ( s.at(1) - help ) * ( s.at(2) - help ) * ( s.at(3) - help ) + 2. * s.at(4) * s.at(5) * s.at(6) -
1366  s.at(5) * s.at(5) * ( s.at(2) - help ) - s.at(4) * s.at(4) * ( s.at(1) - help ) -
1367  s.at(6) * s.at(6) * ( s.at(3) - help );
1368  } else if ( mode == principal_strain ) {
1369  I1 = s.at(1) + s.at(2) + s.at(3);
1370  I2 = s.at(1) * s.at(2) + s.at(2) * s.at(3) + s.at(3) * s.at(1) -
1371  0.25 * ( s.at(4) * s.at(4) + s.at(5) * s.at(5) + s.at(6) * s.at(6) );
1372  I3 = s.at(1) * s.at(2) * s.at(3) +
1373  0.25 * ( s.at(4) * s.at(5) * s.at(6) - s.at(1) * s.at(4) * s.at(4) -
1374  s.at(2) * s.at(5) * s.at(5) - s.at(3) * s.at(6) * s.at(6) );
1375  } else {
1376  OOFEM_SERROR("not supported");
1377  }
1378 
1379  /*
1380  * Call cubic3r to ensure that all three real eigenvalues will be found, because we have symmetric tensor.
1381  * This allows to overcome various rounding errors when solving general cubic equation.
1382  */
1383  int n;
1384  if ( solve ){
1385  cubic3r( ( double ) -1., I1, -I2, I3, & s1, & s2, & s3, & n );
1386  if ( n > 0 ) {
1387  answer.at(1) = s1;
1388  }
1389 
1390  if ( n > 1 ) {
1391  answer.at(2) = s2;
1392  }
1393 
1394  if ( n > 2 ) {
1395  answer.at(3) = s3;
1396  }
1397 
1398 #if 0
1399  //Check NaN
1400  if (answer.at(1) != answer.at(1)) {
1401  s.pY();
1402  printf("%.10e %.10e %.10e\n", I1, I2, I3);
1403  exit(0);
1404  }
1405 #endif
1406  }
1407 
1408  }
1409 
1410  //sort the results
1411  for ( int i = 1; i < answer.giveSize(); i++ ) {
1412  for ( int j = 1; j < answer.giveSize(); j++ ) {
1413  if ( answer.at(j + 1) > answer.at(j) ) {
1414  swap = answer.at(j + 1);
1415  answer.at(j + 1) = answer.at(j);
1416  answer.at(j) = swap;
1417  }
1418  }
1419  }
1420 }
1421 
1422 void
1424 //
1425 // This function computes the principal values & directions corresponding to principal values
1426 // of strains or streses.
1427 // strains/streses are stored in vector form in array s.
1428 // Engineering notation is used.
1429 //
1430 // Problem size (3D/2D) is recognized automatically according to
1431 // vector size.
1432 // If size = 6 -> 3D problem, then array s contains:
1433 // {Sxx,Syy,Szz,Syz,Szx,Sxy} if mode = principal_stress
1434 // {Exx,Eyy,Ezz,GMyz,GMzx,GMxy} if mode = principal_strain
1435 // if size = 3 -> 2D problem, then array s contains:
1436 // {Sxx,Syy,Sxy} if mode = principal_stress
1437 // {Exx,Eyy,GMxy} if mode = principal_strain
1438 //
1439 // mode - principal strains
1440 // - principal stress
1441 //
1442 // Input Values:
1443 // mode
1444 // s
1445 //
1446 // Return Values:
1447 //
1448 // matrix dir -> principal directions of strains or stresses
1449 // array answer -> principal strains or stresses
1450 //
1451 {
1452  FloatMatrix ss;
1453  FloatArray sp;
1454  double swap;
1455  int nval, size = s.giveSize();
1456  int nonzeroFlag = 0;
1457 
1458  // printf ("size is %d\n",size);
1459  if ( !( size == 1 || size == 3 || size == 4 || size == 6 ) ) {
1460  OOFEM_SERROR("Vector size mismatch");
1461  }
1462 
1463  if ( size == 1 ) {
1464  answer.resize(1);
1465  answer.at(1) = s.at(1);
1466  dir.resize(1, 1);
1467  dir.at(1, 1) = 1.0;
1468  return;
1469  } else if ( size == 3 || size == 4 ) {
1470  // 2D problem
1471  ss.resize(2, 2);
1472  answer.resize(2);
1473  dir.resize(2, 2);
1474 
1475  for ( int i = 1; i <= size; i++ ) {
1476  if ( fabs( s.at(i) ) > 1.e-20 ) {
1477  nonzeroFlag = 1;
1478  }
1479  }
1480 
1481  if ( nonzeroFlag == 0 ) {
1482  answer.zero();
1483  dir.zero();
1484  ss.zero();
1485  return;
1486  }
1487 
1488  ss.at(1, 1) = s.at(1);
1489  ss.at(2, 2) = s.at(2);
1490 
1491  if ( mode == principal_strain ) {
1492  ss.at(1, 2) = ss.at(2, 1) = 0.5 * s.at(size);
1493  } else if ( mode == principal_stress ) {
1494  ss.at(1, 2) = ss.at(2, 1) = s.at(size);
1495  } else {
1496  OOFEM_SERROR("not supported");
1497  }
1498  } else {
1499  // 3D problem
1500  double help;
1501  ss.resize(3, 3);
1502  answer.resize(3);
1503  dir.resize(3, 3);
1504 
1505  for ( int i = 1; i <= size; i++ ) {
1506  if ( fabs( s.at(i) ) > 1.e-20 ) {
1507  nonzeroFlag = 1;
1508  }
1509  }
1510 
1511  if ( nonzeroFlag == 0 ) {
1512  answer.zero();
1513  dir.zero();
1514  ss.zero();
1515  return;
1516  }
1517 
1518  if ( mode == principal_stress ) {
1519  ss.at(1, 1) = s.at(1);
1520  ss.at(2, 2) = s.at(2);
1521  ss.at(3, 3) = s.at(3);
1522  ss.at(1, 2) = ss.at(2, 1) = s.at(6);
1523  ss.at(1, 3) = ss.at(3, 1) = s.at(5);
1524  ss.at(2, 3) = ss.at(3, 2) = s.at(4);
1525  } else if ( mode == principal_deviatoricstress ) {
1526  help = ( s.at(1) + s.at(2) + s.at(3) ) / 3.0;
1527  ss.at(1, 1) = s.at(1) - help;
1528  ss.at(2, 2) = s.at(2) - help;
1529  ss.at(3, 3) = s.at(3) - help;
1530  ss.at(1, 2) = ss.at(2, 1) = s.at(6);
1531  ss.at(1, 3) = ss.at(3, 1) = s.at(5);
1532  ss.at(2, 3) = ss.at(3, 2) = s.at(4);
1533  } else if ( mode == principal_strain ) {
1534  ss.at(1, 1) = s.at(1);
1535  ss.at(2, 2) = s.at(2);
1536  ss.at(3, 3) = s.at(3);
1537  ss.at(1, 2) = ss.at(2, 1) = 0.5 * s.at(6);
1538  ss.at(1, 3) = ss.at(3, 1) = 0.5 * s.at(5);
1539  ss.at(2, 3) = ss.at(3, 2) = 0.5 * s.at(4);
1540  } else {
1541  OOFEM_SERROR("not supported");
1542  }
1543  }
1544 
1545 #if 0
1546  ss.Jacobi(& answer, & dir, & i);
1547 #else
1548  ss.jaco_(answer, dir, 10);
1549 #endif
1550  // sort results
1551  nval = 2;
1552  if ( size == 6 ) {
1553  nval = 3;
1554  }
1555 
1556  for ( int ii = 1; ii < nval; ii++ ) {
1557  for ( int jj = 1; jj < nval; jj++ ) {
1558  if ( answer.at(jj + 1) > answer.at(jj) ) {
1559  // swap eigen values and eigen vectors
1560  swap = answer.at(jj + 1);
1561  answer.at(jj + 1) = answer.at(jj);
1562  answer.at(jj) = swap;
1563  for ( int kk = 1; kk <= nval; kk++ ) {
1564  swap = dir.at(kk, jj + 1);
1565  dir.at(kk, jj + 1) = dir.at(kk, jj);
1566  dir.at(kk, jj) = swap;
1567  }
1568  }
1569  }
1570  }
1571 }
1572 
1573 
1574 double
1576 {
1577  double vol = s[0] + s[1] + s[2];
1578  double mean = vol / 3.0;
1579  dev = s;
1580  dev.at(1) -= mean;
1581  dev.at(2) -= mean;
1582  dev.at(3) -= mean;
1583  return mean;
1584 }
1585 
1586 
1587 void
1589 {
1590  s = dev;
1591  s[0] += mean;
1592  s[1] += mean;
1593  s[2] += mean;
1594 }
1595 
1596 void
1597 StructuralMaterial :: applyDeviatoricElasticCompliance(FloatArray &strain, const FloatArray &stress, double EModulus, double nu)
1598 {
1599  applyDeviatoricElasticCompliance( strain, stress, EModulus / 2. / ( 1. + nu ) );
1600 }
1601 
1602 void
1604 {
1605  strain.resize(6);
1606  strain[0] = 1. / ( 2. * GModulus ) * stress [ 0 ];
1607  strain[1] = 1. / ( 2. * GModulus ) * stress [ 1 ];
1608  strain[2] = 1. / ( 2. * GModulus ) * stress [ 2 ];
1609  strain[3] = 1. / GModulus * stress [ 3 ];
1610  strain[4] = 1. / GModulus * stress [ 4 ];
1611  strain[5] = 1. / GModulus * stress [ 5 ];
1612 }
1613 
1614 
1615 void
1616 StructuralMaterial :: applyDeviatoricElasticStiffness(FloatArray &stress, const FloatArray &strain, double EModulus, double nu)
1617 {
1618  applyDeviatoricElasticStiffness( stress, strain, EModulus / ( 2. * ( 1. + nu ) ) );
1619 }
1620 
1621 void
1623 {
1624  stress.resize(6);
1625  stress[0] = 2. * GModulus * strain [ 0 ];
1626  stress[1] = 2. * GModulus * strain [ 1 ];
1627  stress[2] = 2. * GModulus * strain [ 2 ];
1628  stress[3] = GModulus * strain [ 3 ];
1629  stress[4] = GModulus * strain [ 4 ];
1630  stress[5] = GModulus * strain [ 5 ];
1631 }
1632 
1633 void
1634 StructuralMaterial :: applyElasticStiffness(FloatArray &stress, const FloatArray &strain, double EModulus, double nu)
1635 {
1636  double factor = EModulus / ( ( 1. + nu ) * ( 1. - 2. * nu ) );
1637 
1638  stress.resize(6);
1639  stress[0] = factor * ( ( 1. - nu ) * strain [ 0 ] + nu * strain [ 1 ] + nu * strain [ 2 ] );
1640  stress[1] = factor * ( nu * strain [ 0 ] + ( 1. - nu ) * strain [ 1 ] + nu * strain [ 2 ] );
1641  stress[2] = factor * ( nu * strain [ 0 ] + nu * strain [ 1 ] + ( 1. - nu ) * strain [ 2 ] );
1642  stress[3] = factor * ( ( ( 1. - 2. * nu ) / 2. ) * strain [ 3 ] );
1643  stress[4] = factor * ( ( ( 1. - 2. * nu ) / 2. ) * strain [ 4 ] );
1644  stress[5] = factor * ( ( ( 1. - 2. * nu ) / 2. ) * strain [ 5 ] );
1645 }
1646 
1647 void
1648 StructuralMaterial :: applyElasticCompliance(FloatArray &strain, const FloatArray &stress, double EModulus, double nu)
1649 {
1650  strain.resize(6);
1651  strain[0] = ( stress [ 0 ] - nu * stress [ 1 ] - nu * stress [ 2 ] ) / EModulus;
1652  strain[1] = ( -nu * stress [ 0 ] + stress [ 1 ] - nu * stress [ 2 ] ) / EModulus;
1653  strain[2] = ( -nu * stress [ 0 ] - nu * stress [ 1 ] + stress [ 2 ] ) / EModulus;
1654  strain[3] = ( 2. * ( 1. + nu ) * stress [ 3 ] ) / EModulus;
1655  strain[4] = ( 2. * ( 1. + nu ) * stress [ 4 ] ) / EModulus;
1656  strain[5] = ( 2. * ( 1. + nu ) * stress [ 5 ] ) / EModulus;
1657 }
1658 
1659 double
1661 {
1662  if ( s.giveSize() == 1 ) {
1663  return fabs(s [ 0 ]);
1664  }
1665 
1666  return sqrt(s [ 0 ] * s [ 0 ] + s [ 1 ] * s [ 1 ] + s [ 2 ] * s [ 2 ] +
1667  2. * s [ 3 ] * s [ 3 ] + 2. * s [ 4 ] * s [ 4 ] + 2. * s [ 5 ] * s [ 5 ]);
1668 }
1669 
1670 double
1672 {
1673  if ( s.giveSize() == 1 ) {
1674  return s [ 0 ];
1675  }
1676 
1677  return s [ 0 ] + s [ 1 ] + s [ 2 ];
1678 }
1679 
1680 double
1682 {
1683  return .5 * ( s [ 0 ] * s [ 0 ] + s [ 1 ] * s [ 1 ] + s [ 2 ] * s [ 2 ] ) +
1684  s [ 3 ] * s [ 3 ] + s [ 4 ] * s [ 4 ] + s [ 5 ] * s [ 5 ];
1685 }
1686 
1687 double
1689 {
1690  return ( 1. / 3. ) * ( s [ 0 ] * s [ 0 ] * s [ 0 ] + 3. * s [ 0 ] * s [ 5 ] * s [ 5 ] +
1691  3. * s [ 0 ] * s [ 4 ] * s [ 4 ] + 6. * s [ 3 ] * s [ 5 ] * s [ 4 ] +
1692  3. * s [ 1 ] * s [ 5 ] * s [ 5 ] + 3 * s [ 2 ] * s [ 4 ] * s [ 4 ] +
1693  s [ 1 ] * s [ 1 ] * s [ 1 ] + 3. * s [ 1 ] * s [ 3 ] * s [ 3 ] +
1694  3. * s [ 2 ] * s [ 3 ] * s [ 3 ] + s [ 2 ] * s [ 2 ] * s [ 2 ] );
1695 }
1696 
1697 
1698 double
1700 {
1701  // This function computes the first Haigh-Westergaard coordinate
1702  return computeFirstInvariant(s) / sqrt(3.);
1703 }
1704 
1705 double
1707 {
1708  // This function computes the second Haigh-Westergaard coordinate
1709  // from the deviatoric stress state
1710  return sqrt( 2. * computeSecondStressInvariant(s) );
1711 }
1712 
1713 double
1715 {
1716  // This function computes the third Haigh-Westergaard coordinate
1717  // from the deviatoric stress state
1718  double c1 = 0.0;
1719  if ( computeSecondStressInvariant(s) == 0. ) {
1720  c1 = 0.0;
1721  } else {
1722  c1 = ( 3. * sqrt(3.) / 2. ) * computeThirdStressInvariant(s) / ( pow( computeSecondStressInvariant(s), ( 3. / 2. ) ) );
1723  }
1724 
1725  if ( c1 > 1.0 ) {
1726  c1 = 1.0;
1727  }
1728 
1729  if ( c1 < -1.0 ) {
1730  c1 = -1.0;
1731  }
1732 
1733  return 1. / 3. * acos(c1);
1734 }
1735 
1736 double
1738 {
1739  double J2;
1740  double v1, v2, v3;
1741 
1742  if ( currentStress == NULL ) {
1743  return 0.0;
1744  }
1745 
1746  if ( currentStress->giveSize() == 3 ) {
1747  // Plane stress
1748 
1749  return sqrt( currentStress->at(1) * currentStress->at(1) + currentStress->at(2) * currentStress->at(2)
1750  - currentStress->at(1) * currentStress->at(2) + 3 * currentStress->at(3) * currentStress->at(3) );
1751  } else if ( currentStress->giveSize() == 4 ) {
1752  // Plane strain
1753  v1 = ( ( currentStress->at(1) - currentStress->at(2) ) * ( currentStress->at(1) - currentStress->at(2) ) );
1754  v2 = ( ( currentStress->at(2) - currentStress->at(3) ) * ( currentStress->at(2) - currentStress->at(3) ) );
1755  v3 = ( ( currentStress->at(3) - currentStress->at(1) ) * ( currentStress->at(3) - currentStress->at(1) ) );
1756 
1757  J2 = ( 1. / 6. ) * ( v1 + v2 + v3 ) + currentStress->at(4) * currentStress->at(4);
1758 
1759  return sqrt(3 * J2);
1760  } else if ( currentStress->giveSize() == 6 ) {
1761  // 3D
1762  v1 = ( ( currentStress->at(1) - currentStress->at(2) ) * ( currentStress->at(1) - currentStress->at(2) ) );
1763  v2 = ( ( currentStress->at(2) - currentStress->at(3) ) * ( currentStress->at(2) - currentStress->at(3) ) );
1764  v3 = ( ( currentStress->at(3) - currentStress->at(1) ) * ( currentStress->at(3) - currentStress->at(1) ) );
1765 
1766  J2 = ( 1. / 6. ) * ( v1 + v2 + v3 ) + currentStress->at(4) * currentStress->at(4) +
1767  currentStress->at(5) * currentStress->at(5) + currentStress->at(6) * currentStress->at(6);
1768 
1769  return sqrt(3 * J2);
1770  } else {
1771  return 0.0;
1772  }
1773 }
1774 
1775 
1776 void
1778  const FloatMatrix &base,
1779  bool transpose)
1780 //
1781 // returns transformation matrix for 3d - strains to another system of axes,
1782 // given by base.
1783 // In base (FloatMatrix[3,3]) there are on each column stored vectors of
1784 // coordinate system to which we do transformation.
1785 //
1786 // If transpose == 1 we transpose base matrix before transforming
1787 //
1788 {
1789  FloatMatrix t;
1790  answer.resize(6, 6);
1791  answer.zero();
1792 
1793  if ( transpose ) {
1794  t.beTranspositionOf(base);
1795  } else {
1796  t = base;
1797  }
1798 
1799  answer.at(1, 1) = t.at(1, 1) * t.at(1, 1);
1800  answer.at(1, 2) = t.at(2, 1) * t.at(2, 1);
1801  answer.at(1, 3) = t.at(3, 1) * t.at(3, 1);
1802  answer.at(1, 4) = t.at(2, 1) * t.at(3, 1);
1803  answer.at(1, 5) = t.at(1, 1) * t.at(3, 1);
1804  answer.at(1, 6) = t.at(1, 1) * t.at(2, 1);
1805 
1806  answer.at(2, 1) = t.at(1, 2) * t.at(1, 2);
1807  answer.at(2, 2) = t.at(2, 2) * t.at(2, 2);
1808  answer.at(2, 3) = t.at(3, 2) * t.at(3, 2);
1809  answer.at(2, 4) = t.at(2, 2) * t.at(3, 2);
1810  answer.at(2, 5) = t.at(1, 2) * t.at(3, 2);
1811  answer.at(2, 6) = t.at(1, 2) * t.at(2, 2);
1812 
1813  answer.at(3, 1) = t.at(1, 3) * t.at(1, 3);
1814  answer.at(3, 2) = t.at(2, 3) * t.at(2, 3);
1815  answer.at(3, 3) = t.at(3, 3) * t.at(3, 3);
1816  answer.at(3, 4) = t.at(2, 3) * t.at(3, 3);
1817  answer.at(3, 5) = t.at(1, 3) * t.at(3, 3);
1818  answer.at(3, 6) = t.at(1, 3) * t.at(2, 3);
1819 
1820  answer.at(4, 1) = 2.0 * t.at(1, 2) * t.at(1, 3);
1821  answer.at(4, 2) = 2.0 * t.at(2, 2) * t.at(2, 3);
1822  answer.at(4, 3) = 2.0 * t.at(3, 2) * t.at(3, 3);
1823  answer.at(4, 4) = ( t.at(2, 2) * t.at(3, 3) + t.at(3, 2) * t.at(2, 3) );
1824  answer.at(4, 5) = ( t.at(1, 2) * t.at(3, 3) + t.at(3, 2) * t.at(1, 3) );
1825  answer.at(4, 6) = ( t.at(1, 2) * t.at(2, 3) + t.at(2, 2) * t.at(1, 3) );
1826 
1827  answer.at(5, 1) = 2.0 * t.at(1, 1) * t.at(1, 3);
1828  answer.at(5, 2) = 2.0 * t.at(2, 1) * t.at(2, 3);
1829  answer.at(5, 3) = 2.0 * t.at(3, 1) * t.at(3, 3);
1830  answer.at(5, 4) = ( t.at(2, 1) * t.at(3, 3) + t.at(3, 1) * t.at(2, 3) );
1831  answer.at(5, 5) = ( t.at(1, 1) * t.at(3, 3) + t.at(3, 1) * t.at(1, 3) );
1832  answer.at(5, 6) = ( t.at(1, 1) * t.at(2, 3) + t.at(2, 1) * t.at(1, 3) );
1833 
1834  answer.at(6, 1) = 2.0 * t.at(1, 1) * t.at(1, 2);
1835  answer.at(6, 2) = 2.0 * t.at(2, 1) * t.at(2, 2);
1836  answer.at(6, 3) = 2.0 * t.at(3, 1) * t.at(3, 2);
1837  answer.at(6, 4) = ( t.at(2, 1) * t.at(3, 2) + t.at(3, 1) * t.at(2, 2) );
1838  answer.at(6, 5) = ( t.at(1, 1) * t.at(3, 2) + t.at(3, 1) * t.at(1, 2) );
1839  answer.at(6, 6) = ( t.at(1, 1) * t.at(2, 2) + t.at(2, 1) * t.at(1, 2) );
1840 }
1841 
1842 
1843 void
1845  const FloatMatrix &base,
1846  bool transpose)
1847 //
1848 // returns transformation matrix for 2d - strains to another system of axes,
1849 // given by base.
1850 // In base (FloatMatrix[2,2]) there are on each column stored vectors of
1851 // coordinate system to which we do transformation.
1852 //
1853 // If transpose == 1 we transpose base matrix before transforming
1854 //
1855 {
1856  FloatMatrix t;
1857  answer.resize(3, 3);
1858  answer.zero();
1859 
1860  if ( transpose ) {
1861  t.beTranspositionOf(base);
1862  } else {
1863  t = base;
1864  }
1865 
1866  answer.at(1, 1) = t.at(1, 1) * t.at(1, 1);
1867  answer.at(1, 2) = t.at(2, 1) * t.at(2, 1);
1868  answer.at(1, 3) = t.at(1, 1) * t.at(2, 1);
1869 
1870  answer.at(2, 1) = t.at(1, 2) * t.at(1, 2);
1871  answer.at(2, 2) = t.at(2, 2) * t.at(2, 2);
1872  answer.at(2, 3) = t.at(1, 2) * t.at(2, 2);
1873 
1874  answer.at(3, 1) = 2.0 * t.at(1, 1) * t.at(1, 2);
1875  answer.at(3, 2) = 2.0 * t.at(2, 1) * t.at(2, 2);
1876  answer.at(3, 3) = ( t.at(1, 1) * t.at(2, 2) + t.at(2, 1) * t.at(1, 2) );
1877 }
1878 
1879 
1880 void
1882  const FloatMatrix &base,
1883  bool transpose)
1884 //
1885 // returns transformation matrix for 3d - stress to another system of axes,
1886 // given by base.
1887 // In base (FloatMatrix[3,3]) there are on each column stored vectors of
1888 // coordinate system to which we do transformation.
1889 //
1890 // If transpose == 1 we transpose base matrix before transforming
1891 //
1892 {
1893  FloatMatrix t;
1894  answer.resize(6, 6);
1895  answer.zero();
1896 
1897  if ( transpose ) {
1898  t.beTranspositionOf(base);
1899  } else {
1900  t = base;
1901  }
1902 
1903  answer.at(1, 1) = t.at(1, 1) * t.at(1, 1);
1904  answer.at(1, 2) = t.at(2, 1) * t.at(2, 1);
1905  answer.at(1, 3) = t.at(3, 1) * t.at(3, 1);
1906  answer.at(1, 4) = 2.0 * t.at(2, 1) * t.at(3, 1);
1907  answer.at(1, 5) = 2.0 * t.at(1, 1) * t.at(3, 1);
1908  answer.at(1, 6) = 2.0 * t.at(1, 1) * t.at(2, 1);
1909 
1910  answer.at(2, 1) = t.at(1, 2) * t.at(1, 2);
1911  answer.at(2, 2) = t.at(2, 2) * t.at(2, 2);
1912  answer.at(2, 3) = t.at(3, 2) * t.at(3, 2);
1913  answer.at(2, 4) = 2.0 * t.at(2, 2) * t.at(3, 2);
1914  answer.at(2, 5) = 2.0 * t.at(1, 2) * t.at(3, 2);
1915  answer.at(2, 6) = 2.0 * t.at(1, 2) * t.at(2, 2);
1916 
1917  answer.at(3, 1) = t.at(1, 3) * t.at(1, 3);
1918  answer.at(3, 2) = t.at(2, 3) * t.at(2, 3);
1919  answer.at(3, 3) = t.at(3, 3) * t.at(3, 3);
1920  answer.at(3, 4) = 2.0 * t.at(2, 3) * t.at(3, 3);
1921  answer.at(3, 5) = 2.0 * t.at(1, 3) * t.at(3, 3);
1922  answer.at(3, 6) = 2.0 * t.at(1, 3) * t.at(2, 3);
1923 
1924  answer.at(4, 1) = t.at(1, 2) * t.at(1, 3);
1925  answer.at(4, 2) = t.at(2, 2) * t.at(2, 3);
1926  answer.at(4, 3) = t.at(3, 2) * t.at(3, 3);
1927  answer.at(4, 4) = ( t.at(2, 2) * t.at(3, 3) + t.at(3, 2) * t.at(2, 3) );
1928  answer.at(4, 5) = ( t.at(1, 2) * t.at(3, 3) + t.at(3, 2) * t.at(1, 3) );
1929  answer.at(4, 6) = ( t.at(1, 2) * t.at(2, 3) + t.at(2, 2) * t.at(1, 3) );
1930 
1931  answer.at(5, 1) = t.at(1, 1) * t.at(1, 3);
1932  answer.at(5, 2) = t.at(2, 1) * t.at(2, 3);
1933  answer.at(5, 3) = t.at(3, 1) * t.at(3, 3);
1934  answer.at(5, 4) = ( t.at(2, 1) * t.at(3, 3) + t.at(3, 1) * t.at(2, 3) );
1935  answer.at(5, 5) = ( t.at(1, 1) * t.at(3, 3) + t.at(3, 1) * t.at(1, 3) );
1936  answer.at(5, 6) = ( t.at(1, 1) * t.at(2, 3) + t.at(2, 1) * t.at(1, 3) );
1937 
1938  answer.at(6, 1) = t.at(1, 1) * t.at(1, 2);
1939  answer.at(6, 2) = t.at(2, 1) * t.at(2, 2);
1940  answer.at(6, 3) = t.at(3, 1) * t.at(3, 2);
1941  answer.at(6, 4) = ( t.at(2, 1) * t.at(3, 2) + t.at(3, 1) * t.at(2, 2) );
1942  answer.at(6, 5) = ( t.at(1, 1) * t.at(3, 2) + t.at(3, 1) * t.at(1, 2) );
1943  answer.at(6, 6) = ( t.at(1, 1) * t.at(2, 2) + t.at(2, 1) * t.at(1, 2) );
1944 }
1945 
1946 
1947 void
1949  const FloatMatrix &base,
1950  bool transpose)
1951 //
1952 // returns transformation matrix for 2d - stress to another system of axes,
1953 // given by base.
1954 // In base (FloatMatrix[2,2]) there are on each column stored vectors of
1955 // coordinate system to which we do transformation.
1956 //
1957 // If transpose == 1 we transpose base matrix before transforming
1958 //
1959 {
1960  FloatMatrix t;
1961  answer.resize(3, 3);
1962  answer.zero();
1963 
1964  if ( transpose ) {
1965  t.beTranspositionOf(base);
1966  } else {
1967  t = base;
1968  }
1969 
1970  answer.at(1, 1) = t.at(1, 1) * t.at(1, 1);
1971  answer.at(1, 2) = t.at(2, 1) * t.at(2, 1);
1972  answer.at(1, 3) = 2.0 * t.at(1, 1) * t.at(2, 1);
1973 
1974  answer.at(2, 1) = t.at(1, 2) * t.at(1, 2);
1975  answer.at(2, 2) = t.at(2, 2) * t.at(2, 2);
1976  answer.at(2, 3) = 2.0 * t.at(1, 2) * t.at(2, 2);
1977 
1978  answer.at(3, 1) = t.at(1, 1) * t.at(1, 2);
1979  answer.at(3, 2) = t.at(2, 1) * t.at(2, 2);
1980  answer.at(3, 3) = t.at(1, 1) * t.at(2, 2) + t.at(2, 1) * t.at(1, 2);
1981 }
1982 
1983 
1984 void
1986  const FloatArray &strainVector, bool transpose)
1987 //
1988 // performs transformation of 3d-strain vector to another system of axes,
1989 // given by base.
1990 // In base (FloatMatrix[3,3]) there are on each column stored vectors of
1991 // coordinate system to which we do transformation. These vectors must
1992 // be expressed in the same coordinate system as strainVector
1993 //
1994 // If transpose == 1 we transpose base matrix before transforming
1995 {
1996  FloatMatrix tt;
1997 
1999  answer.beProductOf(tt, strainVector);
2000 }
2001 
2002 
2003 void
2005  const FloatArray &stressVector, bool transpose)
2006 //
2007 //
2008 // performs transformation of 3d-stress vector to another system of axes,
2009 // given by base.
2010 // In base (FloatMatrix[3,3]) there are on each column stored vectors of
2011 // coordinate system to which we do transformation. These vectors must
2012 // be expressed in the same coordinate system as strainVector
2013 // If transpose == 1 we transpose base matrix before transforming
2014 //
2015 
2016 {
2017  FloatMatrix tt;
2018 
2020  answer.beProductOf(tt, stressVector);
2021 }
2022 
2023 
2024 void
2026  FloatMatrix *toPDir)
2027 //
2028 // this method sorts newly computed principal values (pVal) and
2029 // corresponding principal directions (pDir) to be closed to
2030 // some (often previous) principal directions (toPDir).
2031 //
2032 // remark : pDir and toPDir should have eigen vectors stored in columns
2033 // and normalized.
2034 //
2035 {
2036  int maxJ = 0, size;
2037  double cosine, maxCosine, swap;
2038 
2039 #ifdef DEBUG
2040  if ( ( !pDir->isSquare() ) || ( !toPDir->isSquare() ) ) {
2041  OOFEM_SERROR("Not square matrix");
2042  }
2043 
2044  if ( pDir->giveNumberOfRows() != toPDir->giveNumberOfRows() ) {
2045  OOFEM_SERROR("Incompatible matrices");
2046  }
2047 
2048  if ( pDir->giveNumberOfRows() != pVal->giveSize() ) {
2049  OOFEM_SERROR("Incompatible pVal Array size");
2050  }
2051 
2052 #endif
2053 
2054  //
2055  // compute cosine matrix, where member i,j is cosine of angle
2056  // between toPDir i th eigen vector and j th pDir eigen vector
2057  //
2058  // sort pVal and pDir
2059  size = pDir->giveNumberOfRows();
2060  for ( int i = 1; i <= size - 1; i++ ) {
2061  // find closest pDir vector to toPDir i-th vector
2062  maxCosine = 0.0;
2063  for ( int j = i; j <= size; j++ ) {
2064  cosine = 0.;
2065  for ( int k = 1; k <= size; k++ ) {
2066  cosine += toPDir->at(k, i) * pDir->at(k, j);
2067  }
2068 
2069  cosine = fabs(cosine);
2070  if ( cosine > maxCosine ) {
2071  maxJ = j;
2072  maxCosine = cosine;
2073  }
2074  }
2075 
2076  // swap entries
2077  if ( maxJ != i ) {
2078  // swap eigenVectors and values
2079  swap = pVal->at(maxJ);
2080  pVal->at(maxJ) = pVal->at(i);
2081  pVal->at(i) = swap;
2082  for ( int k = 1; k <= size; k++ ) {
2083  swap = pDir->at(k, maxJ);
2084  pDir->at(k, maxJ) = pDir->at(k, i);
2085  pDir->at(k, i) = swap;
2086  }
2087  }
2088  }
2089 }
2090 
2091 
2092 int
2094 {
2095  StructuralMaterialStatus *status = static_cast< StructuralMaterialStatus * >( this->giveStatus(gp) );
2096  if ( type == IST_StressTensor ) {
2097  status->letStressVectorBe(value);
2098  return 1;
2099  } else if ( type == IST_StrainTensor ) {
2100  status->letStrainVectorBe(value);
2101  return 1;
2102  } else if ( type == IST_StressTensorTemp ) {
2103  status->letTempStressVectorBe(value);
2104  return 1;
2105  } else if ( type == IST_StrainTensorTemp ) {
2106  status->letTempStrainVectorBe(value);
2107  return 1;
2108  } else {
2109  return 0;
2110  }
2111 }
2112 
2113 
2114 int
2116 {
2117  StructuralMaterialStatus *status = static_cast< StructuralMaterialStatus * >( this->giveStatus(gp) );
2118  if ( type == IST_StressTensor ) {
2120  return 1;
2121  } else if ( type == IST_StressTensor_Reduced ) {
2122  answer = status->giveStressVector();
2123  return 1;
2124  } else if ( type == IST_vonMisesStress ) {
2126  answer.resize(1);
2127  answer.at(1) = this->computeVonMisesStress( & status->giveStressVector() );
2128  return 1;
2129  } else if ( type == IST_StrainTensor ) {
2132  /* commented out by Milan - this evaluation of the out-of-plane strain would be correct for elastic material only
2133  * and for other materials can lead to misleading values
2134  * if ( gp->giveMaterialMode() == _PlaneStress) {
2135  * double Nxy = this->give(NYxy, gp);
2136  * double Nxz = this->give(NYxz, gp);
2137  * double Nyz = this->give(NYyz, gp);
2138  * double Nyx = Nxy * this->give(Ey, gp) / this->give(Ex, gp);
2139  * answer.at(3) = ( -( Nxz + Nxy * Nyz ) * answer.at(1) - ( Nyz + Nxz * Nyx ) * answer.at(2) ) / ( 1. - Nxy * Nyx );
2140  * }
2141  */
2142  return 1;
2143  } else if ( type == IST_StrainTensor_Reduced ) {
2145  answer = status->giveStrainVector();
2146  return 1;
2147  } else if ( type == IST_StressTensorTemp ) {
2150  return 1;
2151  } else if ( type == IST_StrainTensorTemp ) {
2154  return 1;
2155  } else if ( type == IST_PrincipalStressTensor || type == IST_PrincipalStressTempTensor ) {
2156  FloatArray s;
2157 
2158  if ( type == IST_PrincipalStressTensor ) {
2161  } else {
2164  }
2165 
2166  this->computePrincipalValues(answer, s, principal_stress);
2167  return 1;
2168  } else if ( type == IST_PrincipalStrainTensor || type == IST_PrincipalStrainTempTensor ) {
2169  FloatArray s;
2170 
2171  if ( type == IST_PrincipalStrainTensor ) {
2174  } else {
2177  }
2178 
2179  this->computePrincipalValues(answer, s, principal_strain);
2180  return 1;
2181  } else if ( type == IST_PrincStressVector1 || type == IST_PrincStressVector2 || type == IST_PrincStressVector3 ) {
2182  FloatArray arrAnswer;
2183  FloatMatrix dir;
2184  this->computePrincipalValDir(arrAnswer, dir, status->giveStressVector(), principal_stress);
2185  if ( type == IST_PrincStressVector1 ){
2186  answer.beColumnOf(dir,1);
2187  } else if ( type == IST_PrincStressVector2 ){
2188  if (dir.giveNumberOfColumns()>=2) answer.beColumnOf(dir,2); else {answer.beColumnOf(dir,1); answer.zero();}
2189  } else {
2190  if (dir.giveNumberOfColumns()>=3) answer.beColumnOf(dir,3); else {answer.beColumnOf(dir,1); answer.zero();}
2191  }
2192  return 1;
2193  } else if ( type == IST_Temperature ) {
2194  /* add external source, if provided, such as staggered analysis */
2196  FieldPtr tf;
2197  int err;
2198  if ( ( tf = fm->giveField(FT_Temperature) ) ) {
2199  // temperature field registered
2200  FloatArray gcoords, et2;
2201  static_cast< StructuralElement * >( gp->giveElement() )->computeGlobalCoordinates( gcoords, gp->giveNaturalCoordinates() );
2202  if ( ( err = tf->evaluateAt(answer, gcoords, VM_Total, tStep) ) ) {
2203  OOFEM_ERROR("tf->evaluateAt failed, element %d, error code %d", gp->giveElement()->giveNumber(), err);
2204  }
2205  } else {
2206  answer.resize(1);
2207  answer.zero();
2208  }
2209 
2210  return 1;
2211  } else if ( type == IST_CylindricalStressTensor || type == IST_CylindricalStrainTensor ) {
2212  FloatArray gc, val = status->giveStressVector();
2213  FloatMatrix base(3, 3);
2214  static_cast< StructuralElement * >( gp->giveElement() )->computeGlobalCoordinates( gc, gp->giveNaturalCoordinates() );
2215  double l = sqrt( gc.at(1) * gc.at(1) + gc.at(2) * gc.at(2) );
2216  if ( l > 1.e-4 ) {
2217  base.at(1, 1) = gc.at(1) / l;
2218  base.at(2, 1) = gc.at(2) / l;
2219  base.at(3, 1) = 0.0;
2220 
2221  base.at(1, 2) = -1.0 * base.at(2, 1);
2222  base.at(2, 2) = base.at(1, 1);
2223  base.at(3, 2) = 0.0;
2224 
2225  base.at(1, 3) = 0.0;
2226  base.at(2, 3) = 0.0;
2227  base.at(3, 3) = 1.0;
2228 
2229  if ( type == IST_CylindricalStressTensor ) {
2230  this->transformStressVectorTo(answer, base, val, false);
2231  } else {
2232  this->transformStrainVectorTo(answer, base, val, false);
2233  }
2234  } else {
2235  answer = val;
2236  }
2237 
2238  return 1;
2239  } else if (type == IST_PlasticStrainTensor ) {
2241  answer.zero();
2242  return 1;
2243  } else if (type == IST_MaxEquivalentStrainLevel ) {
2244  answer.resize(1);
2245  answer.at(1)=0.;
2246  return 1;
2247  } else if ( type == IST_DeformationGradientTensor ) {
2248  answer = status->giveFVector();
2249  return 1;
2250  } else if ( type == IST_FirstPKStressTensor ) {
2251  answer = status->givePVector();
2252  return 1;
2253  } else if ( type == IST_EigenStrainTensor ) {
2254  FloatArray eigenstrain;
2255  StructuralElement *selem = dynamic_cast< StructuralElement * >( gp->giveElement() );
2256  selem->computeResultingIPEigenstrainAt(eigenstrain, tStep, gp, VM_Total );
2257  StructuralMaterial :: giveFullSymVectorForm( answer, eigenstrain, gp->giveMaterialMode() );
2258  return 1;
2259  } else if ( type == IST_ShellForceTensor ) {
2260  answer.resize(6);
2261  answer.zero();
2262  return 1;
2263  } else {
2264  return Material :: giveIPValue(answer, gp, type, tStep);
2265  }
2266 }
2267 
2268 void
2270  GaussPoint *gp, TimeStep *tStep, ValueModeType mode)
2271 {
2272  FloatArray et, eigenstrain;
2273  if ( gp->giveIntegrationRule() == NULL ) {
2275  answer.clear();
2276  return;
2277  }
2278  Element *elem = gp->giveElement();
2279  StructuralElement *selem = dynamic_cast< StructuralElement * >( gp->giveElement() );
2280 
2281  answer.clear();
2282 
2283  if ( tStep->giveIntrinsicTime() < this->castingTime ) {
2284  answer.zero();
2285  return;
2286  }
2287 
2288  //sum up all prescribed temperatures over an element
2289  //elem->computeResultingIPTemperatureAt(et, tStep, gp, mode);
2290  if ( selem ) {
2291  selem->computeResultingIPTemperatureAt(et, tStep, gp, mode);
2292  }
2293 
2294  //sum up all prescribed eigenstrain over an element
2295  if ( selem ) {
2296  selem->computeResultingIPEigenstrainAt(eigenstrain, tStep, gp, mode);
2297  }
2298 
2299  if ( eigenstrain.giveSize() != 0 && eigenstrain.giveSize() != giveSizeOfVoigtSymVector(gp->giveMaterialMode()) ) {
2300  OOFEM_ERROR( "Number of given eigenstrain components %d is different than required %d by element %d", eigenstrain.giveSize(), giveSizeOfVoigtSymVector(gp->giveMaterialMode()), elem->giveNumber() );
2301  }
2302 
2303  /* add external source, if provided */
2305  FieldPtr tf;
2306 
2307  if ( ( tf = fm->giveField(FT_Temperature) ) ) {
2308  // temperature field registered
2309  FloatArray gcoords, et2;
2310  int err;
2311  elem->computeGlobalCoordinates( gcoords, gp->giveNaturalCoordinates() );
2312  if ( ( err = tf->evaluateAt(et2, gcoords, mode, tStep) ) ) {
2313  OOFEM_ERROR("tf->evaluateAt failed, element %d, error code %d", elem->giveNumber(), err);
2314  }
2315 
2316  if ( et2.isNotEmpty() ) {
2317  if ( et.isEmpty() ) {
2318  et = et2;
2319  } else {
2320  et.at(1) += et2.at(1);
2321  }
2322  }
2323  }
2324 
2325 
2326  if ( et.giveSize() ) { //found temperature boundary conditions or prescribed field
2327  FloatArray fullAnswer, e0;
2328 
2329  this->giveThermalDilatationVector(e0, gp, tStep);
2330 
2331  if ( e0.giveSize() ) {
2332  fullAnswer = e0;
2333  if ( mode == VM_Total ) {
2334  fullAnswer.times(et.at(1) - this->referenceTemperature);
2335  } else {
2336  fullAnswer.times( et.at(1) );
2337  }
2338 
2340  //answer = fullAnswer;
2341  }
2342  }
2343 
2344  //join temperature and eigenstrain vectors, compare vector sizes
2345  if ( answer.giveSize() ) {
2346  if ( eigenstrain.giveSize() ) {
2347  if ( answer.giveSize() != eigenstrain.giveSize() ) {
2348  OOFEM_ERROR( "Vector of temperature strains has the size %d which is different with the size of eigenstrain vector %d, element %d", answer.giveSize(), eigenstrain.giveSize(), elem->giveNumber() );
2349  }
2350 
2351  answer.add(eigenstrain);
2352  }
2353  } else {
2354  if ( eigenstrain.giveSize() ) {
2355  answer = eigenstrain;
2356  }
2357  }
2358 }
2359 
2360 
2361 void
2363  GaussPoint *gp, TimeStep *tStep, ValueModeType mode)
2364 {
2365  FloatArray et, eigenstrain;
2366  if ( gp->giveIntegrationRule() == NULL ) {
2368  answer.clear();
2369  return;
2370  }
2371  Element *elem = gp->giveElement();
2372  StructuralElement *selem = dynamic_cast< StructuralElement * >( gp->giveElement() );
2373 
2374  answer.clear();
2375 
2376  if ( tStep->giveIntrinsicTime() < this->castingTime ) {
2377  return;
2378  }
2379 
2380  //sum up all prescribed temperatures over an element
2381  //elem->computeResultingIPTemperatureAt(et, tStep, gp, mode);
2382  if ( selem ) {
2383  selem->computeResultingIPTemperatureAt(et, tStep, gp, mode);
2384  }
2385 
2386  //sum up all prescribed eigenstrain over an element
2387  if ( selem ) {
2388  selem->computeResultingIPEigenstrainAt(eigenstrain, tStep, gp, mode);
2389  }
2390 
2391  /* add external source, if provided */
2393  FieldPtr tf = fm->giveField(FT_Temperature);
2394 
2395  if ( tf ) {
2396  // temperature field registered
2397  FloatArray gcoords, et2;
2398  int err;
2399  elem->computeGlobalCoordinates( gcoords, gp->giveNaturalCoordinates() );
2400  if ( ( err = tf->evaluateAt(et2, gcoords, mode, tStep) ) ) {
2401  OOFEM_ERROR("tf->evaluateAt failed, element %d, error code %d", elem->giveNumber(), err);
2402  }
2403 
2404  if ( et2.isNotEmpty() ) {
2405  if ( et.isEmpty() ) {
2406  et = et2;
2407  } else {
2408  et.at(1) += et2.at(1);
2409  }
2410  }
2411  }
2412 
2413 
2414  if ( et.giveSize() ) { //found temperature boundary conditions or prescribed field
2415  FloatArray fullAnswer, e0;
2416 
2417  this->giveThermalDilatationVector(e0, gp, tStep);
2418 
2419  if ( e0.giveSize() ) {
2420  fullAnswer = e0;
2421  if ( mode == VM_Total ) {
2422  fullAnswer.times(et.at(1) - this->referenceTemperature);
2423  } else {
2424  fullAnswer.times( et.at(1) );
2425  }
2426 
2427  answer = fullAnswer;
2428  }
2429  }
2430 
2431  //join temperature and eigenstrain vectors, compare vector sizes
2432  if ( answer.giveSize() ) {
2433  if ( eigenstrain.giveSize() ) {
2434  if ( answer.giveSize() != eigenstrain.giveSize() ) {
2435  OOFEM_ERROR( "Vector of temperature strains has the size %d which is different with the size of eigenstrain vector %d, element %d", answer.giveSize(), eigenstrain.giveSize(), elem->giveNumber() );
2436  }
2437 
2438  answer.add(eigenstrain);
2439  }
2440  } else {
2441  if ( eigenstrain.giveSize() ) {
2442  answer = eigenstrain;
2443  }
2444  }
2445 }
2446 
2447 
2448 void
2450 {
2451  if ( vec.giveSize() == 6 ) {
2452  // If we use default 3D implementation to treat e.g. plane strain.
2453  answer = vec;
2454  } else {
2455  IntArray indx;
2456  answer.resize( StructuralMaterial :: giveVoigtSymVectorMask(indx, matMode) );
2457  answer.zero();
2458  answer.assemble(vec, indx);
2459  }
2460 }
2461 
2462 
2463 void
2465 {
2466  IntArray indx;
2467  answer.resize( StructuralMaterial :: giveVoigtVectorMask(indx, matMode) );
2468  answer.zero();
2469  answer.assemble(vec, indx);
2470 }
2471 
2472 
2473 void
2475 {
2476  IntArray indx;
2477  answer.resize(9);
2478  answer.at(1) = answer.at(2) = answer.at(3) = 1.0; // set diagonal terms
2479 
2481  for ( int i = 1; i <= indx.giveSize(); i++ ) {
2482  answer.at( indx.at(i) ) = vec.at(i);
2483  }
2484 }
2485 
2486 
2487 void
2489 {
2490  IntArray indx;
2492  answer.beSubArrayOf(vec, indx);
2493 }
2494 
2495 
2496 void
2498 {
2499  IntArray indx;
2501 
2502  if ( indx.giveSize() == vec.giveSize() ) {
2503  answer = vec;
2504  } else {
2505  answer.beSubArrayOf(vec, indx);
2506  }
2507 }
2508 
2509 
2510 void
2512 {
2513  IntArray indx;
2514  int size = StructuralMaterial :: giveVoigtSymVectorMask(indx, matMode);
2515  answer.resize(size, size);
2516  answer.zero();
2517  answer.assemble(red, indx, indx);
2518 }
2519 
2520 
2521 void
2523 {
2524  IntArray indx;
2526  answer.beSubMatrixOf(full, indx, indx);
2527 }
2528 
2529 
2530 void
2532 {
2533  IntArray indx;
2535  answer.beSubMatrixOf(full, indx, indx);
2536 }
2537 
2538 void
2540 {
2541  double alpha = this->give(tAlpha, gp);
2542  if (alpha > 0.0) {
2543  answer.resize(6);
2544  answer.zero();
2545  answer.at(1) = alpha;
2546  answer.at(2) = alpha;
2547  answer.at(3) = alpha;
2548  } else {
2549  answer.clear();
2550  }
2551 }
2552 
2555 {
2556  IRResultType result; // Required by IR_GIVE_FIELD macro
2557 
2558  referenceTemperature = 0.0;
2560 
2561  double alpha = 0.0;
2563  if (alpha > 0.0 && !propertyDictionary.includes(tAlpha)) {
2564  // put isotropic thermal expansion coeff into dictionary, if provided
2565  // and not previosly defined
2566  propertyDictionary.add(tAlpha, alpha);
2567 
2568  }
2569 
2570  return Material :: initializeFrom(ir);
2571 }
2572 
2573 
2574 void
2576 {
2579 }
2580 } // end namespace oofem
static int giveSizeOfVoigtSymVector(MaterialMode mmode)
Returns the size of symmetric part of a reduced stress/strain vector according to given mode...
bool contains(int value) const
Definition: intarray.h:283
virtual void giveFirstPKStressVector_1d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedF, TimeStep *tStep)
Default implementation relies on giveFirstPKStressVector_3d.
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
For computing principal stresses from deviatoric stress.
void setField(int item, InputFieldType id)
virtual void giveEshelbyStressVector_PlaneStrain(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedF, TimeStep *tStep)
Prototype for computation of Eshelby stress.
static void computePrincipalValues(FloatArray &answer, const FloatArray &s, stressStrainPrincMode mode)
Common functions for convenience.
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
int giveNumberOfColumns() const
Returns number of columns of receiver.
Definition: floatmatrix.h:158
void enumerate(int maxVal)
Resizes receiver and enumerates from 1 to the maximum value given.
Definition: intarray.C:136
void subtract(const FloatArray &src)
Subtracts array src to receiver.
Definition: floatarray.C:258
static int giveVoigtSymVectorMask(IntArray &answer, MaterialMode mmode)
The same as giveVoigtVectorMask but returns a mask corresponding to a symmetric second order tensor...
virtual void computeResultingIPTemperatureAt(FloatArray &answer, TimeStep *tStep, GaussPoint *gp, ValueModeType mode)
Computes at given time (tStep) the the resulting temperature component array.
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
Definition: structuralms.h:137
static void givePlaneStressVectorTranformationMtrx(FloatMatrix &answer, const FloatMatrix &base, bool transpose=false)
Computes 2d stress vector transformation matrix from standard vector transformation matrix...
virtual void give1dStressStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 1d stiffness matrix of receiver.
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
std::shared_ptr< Field > FieldPtr
Definition: field.h:72
Class and object Domain.
Definition: domain.h:115
static void applyDeviatoricElasticCompliance(FloatArray &strain, const FloatArray &stress, double EModulus, double nu)
void letTempFVectorBe(const FloatArray &v)
Assigns tempFVector to given vector v.
Definition: structuralms.h:143
For computing principal stresses.
virtual void giveFirstPKStressVector_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedF, TimeStep *tStep)
Default implementation relies on giveRealStressVector for second Piola-Kirchoff stress.
virtual void giveRealStressVector_PlaneStrain(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
Default implementation relies on giveRealStressVector_3d.
For computing principal strains from engineering strains.
void letStrainVectorBe(const FloatArray &v)
Assigns strain vector to given vector v.
Definition: structuralms.h:125
virtual void give1dStressStiffMtrx_dPdF(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition: femcmpnn.h:82
virtual void giveFirstPKStressVector_PlaneStrain(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedF, TimeStep *tStep)
Default implementation relies on giveFirstPKStressVector_3d.
bool solveForRhs(const FloatArray &b, FloatArray &answer, bool transpose=false)
Solves the system of linear equations .
Definition: floatmatrix.C:1112
static int giveVI(int ind1, int ind2)
virtual void giveFiberStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 1d fiber stiffness matrix of receiver.
#define tAlpha
Definition: matconst.h:67
static double computeSecondCoordinate(const FloatArray &s)
static void computeDeviatoricVolumetricSum(FloatArray &s, const FloatArray &dev, double mean)
const FloatArray & givePVector() const
Returns the const pointer to receiver&#39;s first Piola-Kirchhoff stress vector.
Definition: structuralms.h:109
#define OOFEM_SERROR(...)
Definition: error.h:63
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
void zero()
Sets all component to zero.
Definition: intarray.C:52
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
virtual void givePlaneStrainStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing plane strain stiffness matrix of receiver.
void beSubMatrixOf(const FloatMatrix &src, int topRow, int bottomRow, int topCol, int bottomCol)
Assigns to the receiver the sub-matrix of another matrix.
Definition: floatmatrix.C:962
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
virtual void computeStressIndependentStrainVector_3d(FloatArray &answer, GaussPoint *gp, TimeStep *tStep, ValueModeType mode)
This class implements a structural material status information.
Definition: structuralms.h:65
static double computeFirstInvariant(const FloatArray &s)
virtual void giveRealStressVector_Lattice2d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
static double computeVonMisesStress(const FloatArray *currentStress)
Computes equivalent of von Mises stress.
void clear()
Clears receiver (zero size).
Definition: floatarray.h:206
bool includes(int aKey)
Checks if dictionary includes given key.
Definition: dictionary.C:126
static void giveFullSymMatrixForm(FloatMatrix &answer, const FloatMatrix &red, MaterialMode matMode)
Converts the full unsymmetric Voigt matrix (4th order tensor) to reduced form.
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
virtual void give3dMaterialStiffnessMatrix_dCde(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
static int giveSizeOfVoigtVector(MaterialMode mmode)
Returns the size of reduced stress/strain vector according to given mode.
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Definition: domain.C:433
static void applyElasticCompliance(FloatArray &strain, const FloatArray &stress, double EModulus, double nu)
virtual void givePlateLayerStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 2d plate layer stiffness matrix of receiver.
void beVectorForm(const FloatMatrix &aMatrix)
Reciever will be a vector with 9 components formed from a 3x3 matrix.
Definition: floatarray.C:992
static void sortPrincDirAndValCloseTo(FloatArray *pVal, FloatMatrix *pDir, FloatMatrix *toPDir)
Method for sorting newly computed principal values (pVal) and corresponding principal directions (pDi...
Dictionary propertyDictionary
Property dictionary.
Definition: material.h:105
Abstract base class for all finite elements.
Definition: element.h:145
bool isSquare() const
Returns nonzero if receiver is square matrix.
Definition: floatmatrix.h:160
Element * giveElement()
Returns corresponding element to receiver.
Definition: gausspoint.h:188
static std::vector< std::vector< int > > svIndex
Symmetric Voigt index map.
static void giveStrainVectorTranformationMtrx(FloatMatrix &answer, const FloatMatrix &base, bool transpose=false)
Computes 3d strain vector transformation matrix from standard vector transformation matrix...
#define S(p)
Definition: mdm.C:481
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Definition: material.C:110
void give_dPdF_from(const FloatMatrix &dSdE, FloatMatrix &answer, GaussPoint *gp)
void giveStressDependentPartOfStrainVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrainVector, TimeStep *tStep, ValueModeType mode)
Method for subtracting from reduced space strain vector its stress-independent parts (caused by tempe...
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
FieldManager * giveFieldManager()
Definition: engngm.h:131
virtual void giveRealStressVector_3dBeamSubSoil(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
static void computePrincipalValDir(FloatArray &answer, FloatMatrix &dir, const FloatArray &s, stressStrainPrincMode mode)
Computes principal values and directions of stress or strain vector.
Class implementing an array of integers.
Definition: intarray.h:61
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
MatResponseMode
Describes the character of characteristic material matrix.
virtual void giveRealStressVector(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)
Computes the real stress vector for given total strain and integration point.
static void giveFullSymVectorForm(FloatArray &answer, const FloatArray &vec, MaterialMode matMode)
Converts the reduced unsymmetric Voigt vector (2nd order tensor) to full form.
void beColumnOf(const FloatMatrix &mat, int col)
Reciever will be set to a given column in a matrix.
Definition: floatarray.C:1114
virtual void givePlaneStressStiffMtrx_dPdF(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
void beMatrixForm(const FloatArray &aArray)
Definition: floatmatrix.C:1657
virtual void give3dLatticeStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 3d lattice stiffness matrix of receiver.
bool jaco_(FloatArray &eval, FloatMatrix &v, int nf)
Computes eigenvalues and eigenvectors of receiver (must be symmetric) The receiver is preserved...
Definition: floatmatrix.C:1912
virtual void givePlaneStrainStiffMtrx_dCde(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
const char * __MaterialModeToString(MaterialMode _value)
Definition: cltypes.C:314
virtual void giveRealStressVector_2dPlateSubSoil(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
Default implementation is not provided.
virtual double give(int aProperty, GaussPoint *gp)
Returns the value of material property &#39;aProperty&#39;.
Definition: material.C:52
Abstract base class for all "structural" finite elements.
virtual void giveRealStressVector_2dBeamLayer(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
Default implementation relies on giveRealStressVector_StressControl.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual void giveStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes the stiffness matrix for giveRealStressVector of receiver in given integration point...
static void giveFullVectorForm(FloatArray &answer, const FloatArray &strainVector, MaterialMode matMode)
Converts the reduced symmetric Voigt vector (2nd order tensor) to full form.
static void giveReducedSymVectorForm(FloatArray &answer, const FloatArray &vec, MaterialMode matMode)
Converts the full unsymmetric Voigt vector (2nd order tensor) to reduced form.
#define E(p)
Definition: mdm.C:368
void cubic3r(double a, double b, double c, double d, double *r1, double *r2, double *r3, int *num)
Solves cubic equation for real roots, assuming that if cubic polynomial given then the only possibili...
Definition: mathfem.C:155
static void giveReducedVectorForm(FloatArray &answer, const FloatArray &vec, MaterialMode matMode)
Converts the full symmetric Voigt vector (2nd order tensor) to reduced form.
virtual void giveRealStressVector_Lattice3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
static std::vector< std::vector< int > > vIindex
Voigt index map.
const FloatArray & giveTempPVector() const
Returns the const pointer to receiver&#39;s temporary first Piola-Kirchhoff stress vector.
Definition: structuralms.h:119
#define OOFEM_ERROR(...)
Definition: error.h:61
virtual void givePlaneStressStiffMtrx_dCde(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
static void applyElasticStiffness(FloatArray &stress, const FloatArray &strain, double EModulus, double nu)
EngngModelContext * giveContext()
Context requesting service.
Definition: engngm.h:1078
void clear()
Clears the array (zero size).
Definition: intarray.h:177
virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes full 3d material stiffness matrix at given integration point, time, respecting load history ...
void times(double f)
Multiplies receiver by factor f.
Definition: floatmatrix.C:1594
virtual int setIPValue(const FloatArray &value, GaussPoint *gp, InternalStateType type)
Sets the value of a certain variable at a given integration point to the given value.
static double computeFirstCoordinate(const FloatArray &s)
void giveStressDependentPartOfStrainVector_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrainVector, TimeStep *tStep, ValueModeType mode)
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Definition: floatarray.C:676
static double computeStressNorm(const FloatArray &stress)
const FloatArray & giveTempStrainVector() const
Returns the const pointer to receiver&#39;s temporary strain vector.
Definition: structuralms.h:115
static int giveVoigtVectorMask(IntArray &answer, MaterialMode mmode)
Returns a mask of the vector indicies corresponding to components in a general (non-symmetric) second...
bool isEmpty() const
Returns true if receiver is empty.
Definition: floatarray.h:222
Abstract base class for all material models.
Definition: material.h:95
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
void resize(int n)
Checks size of receiver towards requested bounds.
Definition: intarray.C:124
virtual void giveRealStressVector_ShellStressControl(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, const IntArray &strainControl, TimeStep *tStep)
double giveIntrinsicTime()
Returns intrinsic time, e.g. time in which constitutive model is evaluated.
Definition: timestep.h:148
virtual void givePlaneStrainStiffMtrx_dPdF(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
virtual void giveRealStressVector_StressControl(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, const IntArray &strainControl, TimeStep *tStep)
Iteratively calls giveRealStressVector_3d to find the stress controlled equal to zero· ...
FieldPtr giveField(FieldType key)
Returns the previously registered field under given key; NULL otherwise.
Definition: fieldmanager.C:63
IntegrationRule * giveIntegrationRule()
Returns corresponding integration rule to receiver.
Definition: gausspoint.h:186
virtual void giveRealStressVector_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
Default implementation relies on giveRealStressVector for second Piola-Kirchoff stress.
Pair * add(int aKey, double value)
Adds a new Pair with given keyword and value into receiver.
Definition: dictionary.C:81
static double computeThirdCoordinate(const FloatArray &s)
virtual void giveFirstPKStressVector_PlaneStress(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedF, TimeStep *tStep)
Default implementation relies on giveFirstPKStressVector_3d.
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
Class representing vector of real numbers.
Definition: floatarray.h:82
virtual void giveRealStressVector_Warping(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
Default implementation relies on giveRealStressVector_StressControl.
void convert_dSdE_2_dPdF(FloatMatrix &answer, const FloatMatrix &dSdE, const FloatArray &S, const FloatArray &F, MaterialMode matMode)
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
stressStrainPrincMode
We have only one algorithm for computing eigenvalues and vectors in order to be able to distinguish b...
static void giveStressVectorTranformationMtrx(FloatMatrix &answer, const FloatMatrix &base, bool transpose=false)
Computes 3d stress vector transformation matrix from standard vector transformation matrix...
virtual void give2dLatticeStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 2d lattice stiffness matrix of receiver.
static void transformStrainVectorTo(FloatArray &answer, const FloatMatrix &base, const FloatArray &strainVector, bool transpose=false)
Transforms 3d strain vector into another coordinate system.
void letTempStressVectorBe(const FloatArray &v)
Assigns tempStressVector to given vector v.
Definition: structuralms.h:135
const FloatArray & giveStressVector() const
Returns the const pointer to receiver&#39;s stress vector.
Definition: structuralms.h:107
void beSubArrayOf(const FloatArray &src, const IntArray &indx)
Extract sub vector form src array and stores the result into receiver.
Definition: floatarray.C:379
double referenceTemperature
Reference temperature (temperature, when material has been built into structure). ...
virtual void giveRealStressVector_Fiber(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
Default implementation relies on giveRealStressVector_StressControl.
void assemble(const FloatArray &fe, const IntArray &loc)
Assembles the array fe (typically, the load vector of a finite element) into the receiver, using loc as location array.
Definition: floatarray.C:551
const FloatArray & giveFVector() const
Returns the const pointer to receiver&#39;s deformation gradient vector.
Definition: structuralms.h:113
virtual int hasMaterialModeCapability(MaterialMode mode)
Tests if material supports material mode.
static void applyDeviatoricElasticStiffness(FloatArray &stress, const FloatArray &strain, double EModulus, double nu)
virtual void pY() const
Print receiver on stdout with high accuracy.
Definition: floatarray.C:787
double computeNorm() const
Computes the norm (or length) of the vector.
Definition: floatarray.C:840
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
Definition: floatmatrix.C:1358
static double computeSecondStressInvariant(const FloatArray &s)
virtual void giveThermalDilatationVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
Returns a vector of coefficients of thermal dilatation in direction of each material principal (local...
Class representing the general Input Record.
Definition: inputrecord.h:101
static void giveReducedMatrixForm(FloatMatrix &answer, const FloatMatrix &full, MaterialMode matMode)
Converts the full symmetric Voigt matrix (4th order tensor) to reduced form.
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
virtual void give3dBeamSubSoilStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing stiffness matrix of beam3d subsoil model.
void beTProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
Definition: floatmatrix.C:367
const FloatArray & giveTempFVector() const
Returns the const pointer to receiver&#39;s temporary deformation gradient vector.
Definition: structuralms.h:123
void letStressVectorBe(const FloatArray &v)
Assigns stressVector to given vector v.
Definition: structuralms.h:127
Class representing the a dynamic Input Record.
void times(double s)
Multiplies receiver with scalar.
Definition: floatarray.C:818
void beTranspositionOf(const FloatMatrix &src)
Assigns to the receiver the transposition of parameter.
Definition: floatmatrix.C:323
#define _IFT_StructuralMaterial_talpha
static double computeDeviatoricVolumetricSplit(FloatArray &dev, const FloatArray &s)
Computes split of receiver into deviatoric and volumetric part.
virtual void give2dPlateSubSoilStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing stiffness matrix of plate subsoil model.
virtual void giveRealStressVector_1d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
Default implementation relies on giveRealStressVector_StressControl.
static void giveInvertedVoigtVectorMask(IntArray &answer, MaterialMode mmode)
Gives the inverted version of giveVoigtVectorMask.
#define _IFT_StructuralMaterial_referencetemperature
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
virtual void giveRealStressVector_PlaneStress(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
Default implementation relies on giveRealStressVector_StressControl.
virtual void give2dBeamLayerStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing 2d beam layer stiffness matrix of receiver.
static void give2DStrainVectorTranformationMtrx(FloatMatrix &answer, const FloatMatrix &base, bool transpose=false)
Computes 2d strain vector transformation matrix from standard vector transformation matrix...
void beUnitMatrix()
Sets receiver to unity matrix.
Definition: floatmatrix.C:1332
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
static int giveSymVI(int ind1, int ind2)
double castingTime
Casting time.
Definition: material.h:113
void beSymVectorFormOfStrain(const FloatMatrix &aMatrix)
Definition: floatarray.C:1014
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
Definition: floatmatrix.C:337
int giveSize() const
Definition: intarray.h:203
virtual void give3dMaterialStiffnessMatrix_dPdF(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
const FloatArray & giveTempStressVector() const
Returns the const pointer to receiver&#39;s temporary stress vector.
Definition: structuralms.h:117
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
the oofem namespace is to define a context or scope in which all oofem names are defined.
bool isNotEmpty() const
Returns true if receiver is not empty.
Definition: floatarray.h:220
void assemble(const FloatMatrix &src, const IntArray &loc)
Assembles the contribution using localization array into receiver.
Definition: floatmatrix.C:251
virtual void giveRealStressVector_PlateLayer(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
Default implementation relies on giveRealStressVector_StressControl.
static void giveFullVectorFormF(FloatArray &answer, const FloatArray &strainVector, MaterialMode matMode)
Converts the reduced deformation gradient Voigt vector (2nd order tensor).
int giveNumber() const
Definition: femcmpnn.h:107
void beInverseOf(const FloatMatrix &src)
Modifies receiver to become inverse of given parameter.
Definition: floatmatrix.C:835
virtual void givePlaneStressStiffMtrx(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
Method for computing plane stress stiffness matrix of receiver.
void negated()
Switches the sign of every coefficient of receiver.
Definition: floatarray.C:739
const FloatArray & giveStrainVector() const
Returns the const pointer to receiver&#39;s strain vector.
Definition: structuralms.h:105
virtual void computeResultingIPEigenstrainAt(FloatArray &answer, TimeStep *tStep, GaussPoint *gp, ValueModeType mode)
Computes at given time the resulting eigenstrain component array.
int giveNumberOfRows() const
Returns number of rows of receiver.
Definition: floatmatrix.h:156
static void transformStressVectorTo(FloatArray &answer, const FloatMatrix &base, const FloatArray &stressVector, bool transpose=false)
Transforms 3d stress vector into another coordinate system.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: material.C:89
Class representing integration point in finite element program.
Definition: gausspoint.h:93
#define OOFEM_WARNING(...)
Definition: error.h:62
Class representing solution step.
Definition: timestep.h:80
static double computeThirdStressInvariant(const FloatArray &s)
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
Definition: material.C:142
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
Computes the global coordinates from given element&#39;s local coordinates.
Definition: element.C:1207
void add(const FloatArray &src)
Adds array src to receiver.
Definition: floatarray.C:156
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
Definition: gausspoint.h:138
virtual void computeStressIndependentStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep, ValueModeType mode)
Computes reduced strain vector in given integration point, generated by internal processes in materia...
void letTempPVectorBe(const FloatArray &v)
Assigns tempPVector to given vector v.
Definition: structuralms.h:139
virtual void give1dStressStiffMtrx_dCde(FloatMatrix &answer, MatResponseMode mmode, GaussPoint *gp, TimeStep *tStep)
static void giveReducedSymMatrixForm(FloatMatrix &answer, const FloatMatrix &full, MaterialMode matMode)
Converts the full unsymmetric Voigt matrix (4th order tensor) to reduced form.
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631
StructuralMaterial(int n, Domain *d)
Constructor.

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:31 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011