MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
membraneeas.cc
Go to the documentation of this file.
1 /*
2  * MBDyn (C) is a multibody analysis code.
3  * http://www.mbdyn.org
4  *
5  * Copyright (C) 2011-2017
6  *
7  * Marco Morandini <morandini@aero.polimi.it>
8  * Riccardo Vescovini <vescovini@aero.polimi.it>
9  * Tommaso Solcia <solcia@aero.polimi.it>
10  *
11  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
12  * via La Masa, 34 - 20156 Milano, Italy
13  * http://www.aero.polimi.it
14  *
15  * Changing this copyright notice is forbidden.
16  *
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation (version 2 of the License).
20  *
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */
31 
32 /*
33  * Inspired by
34  * Wojciech Witkowski
35  * "4-Node combined shell element with semi-EAS-ANS strain interpolations
36  * in 6-parameter shell theories with drilling degrees of freedom"
37  * Comput Mech (2009) 43:307­319 DOI 10.1007/s00466-008-0307-x
38  */
39 
40 #include "mbconfig.h" /* This goes first in every *.c,*.cc file */
41 
42 #include "constltp_impl.h"
43 #include "tpldrive_impl.h"
44 #include "membraneeas.h"
45 #include "mynewmem.h"
46 
47 #include "shell.hc"
48 
49 
50 /***************************************
51 *
52 *
53 ****************************************/
54 
56  {-1. / std::sqrt(3.), -1. / std::sqrt(3.)},
57  { 1. / std::sqrt(3.), -1. / std::sqrt(3.)},
58  { 1. / std::sqrt(3.), 1. / std::sqrt(3.)},
59  {-1. / std::sqrt(3.), 1. / std::sqrt(3.)}
60 };
61 
63  1.,
64  1.,
65  1.,
66  1.
67 };
68 
70  { 1., 1.},
71  {-1., 1.},
72  {-1., -1.},
73  { 1., -1.}
74 };
75 
76 doublereal Membrane4EAS::xi_0[2] = {0., 0.};
77 
78 void
80 {
81  for (integer i = 0; i < NUMNODES; i++) {
82  xa[i] = pNode[i]->GetXCurr();
83  }
84 }
85 
86 void
88 {
90  for (integer i = 0; i < NUMIP; i++) {
91  Vec3 t1 = InterpDeriv_xi1(xa, xi_i[i]);
92  t1 = t1 / t1.Norm();
93  Vec3 t2 = InterpDeriv_xi2(xa, xi_i[i]);
94  t2 = t2 / t2.Norm();
95  Vec3 t3 = t1.Cross(t2);
96  t3 = t3 / t3.Norm();
97  t2 = t3.Cross(t1);
98  T_i[i] = Mat3x3(t1, t2, t3);
99  }
100  Vec3 t1 = InterpDeriv_xi1(xa, xi_0);
101  t1 = t1 / t1.Norm();
102  Vec3 t2 = InterpDeriv_xi2(xa, xi_0);
103  t2 = t2 / t2.Norm();
104  Vec3 t3 = t1.Cross(t2);
105  t3 = t3 / t3.Norm();
106  t2 = t3.Cross(t1);
107  T_0 = Mat3x3(t1, t2, t3);
108 }
109 
111  const DofOwner* pDO,
112  const StructDispNode* pN1, const StructDispNode* pN2,
113  const StructDispNode* pN3, const StructDispNode* pN4,
114 #if 0 // TODO: offset
115  const Vec3& f1, const Vec3& f2,
116  const Vec3& f3, const Vec3& f4,
117 #endif
118 #ifdef USE_CL_IN_MEMBRANE
119  const ConstitutiveLaw<vh, fmh>** pDTmp,
120 #else // ! USE_CL_IN_MEMBRANE
121  const fmh& pDTmp,
122  const vh& PreStress,
123 #endif // ! USE_CL_IN_MEMBRANE
124  flag fOut)
125 :
126 Elem(uL, fOut),
127 Membrane(uL, pDO, fOut),
128 
129 S_alpha_beta_0(2, 2), // 2x2
130 
131 L_alpha_beta_i(NUMIP, fmh(4, 2) ), // 4x2
132 
133 B_overline_i(NUMIP, fmh(3, 12) ), // 12x24
134 
135 P_i(NUMIP, fmh(3, iGetNumDof()) ), // 12x(iGetNumDof)
136 
137 beta(iGetNumDof()), // 1x(iGetNumDof)
138 epsilon_hat(3), // 1x12
139 epsilon(3), // 1x12
140 
141 #ifndef USE_CL_IN_MEMBRANE
142 bPreStress(PreStress.Norm() > 0.),
143 PreStress(PreStress),
144 #endif // ! USE_CL_IN_MEMBRANE
145 
146 DRef(NUMIP, fmh(3, 3)), // 12x12
147 stress_i(NUMIP, vh(3)) // 1x12
148 {
149 #ifdef USE_CL_IN_MEMBRANE
150  for (integer i = 0; i < NUMIP; i++) {
151  pD[i] = 0;
154  ConstitutiveLawOwnerType(pDTmp[i]));
155  }
156 #else // ! USE_CL_IN_MEMBRANE
157  for (unsigned i = 0; i < NUMIP; i++) {
158  DRef[i] = pDTmp;
159  }
160 #endif // ! USE_CL_IN_MEMBRANE
161 
162  pNode[NODE1] = pN1;
163  pNode[NODE2] = pN2;
164  pNode[NODE3] = pN3;
165  pNode[NODE4] = pN4;
166 // f[NODE1] = f1;
167 // f[NODE2] = f2;
168 // f[NODE3] = f3;
169 // f[NODE4] = f4;
171 // UpdateNodalAndAveragePos();
172  // copy ref values
173 // T0_overline = T_overline;
174  T_0_0 = T_0;
175  for (integer i = 0; i < NUMNODES; i++) {
176  xa_0[i] = xa[i];
177  }
178  for (integer i = 0; i < NUMIP; i++) {
179  T_0_i[i] = T_i[i];
180  }
181 
182 
183  fmh M_0(3, 3);
184  fmh M_0_Inv(3, 3);
185  // doublereal pd_M_0[9], *ppd_M_0[3]; fmh M_0(pd_M_0, ppd_M_0, 9, 3, 3);
186  // doublereal pd_M_0_Inv[9], *ppd_M_0_Inv[3]; fmh M_0_Inv(pd_M_0_Inv, ppd_M_0_Inv, 9, 3, 3);
187  {
188  Vec3 x_1 = InterpDeriv_xi1(xa, xi_0);
189  Vec3 x_2 = InterpDeriv_xi2(xa, xi_0);
190  S_alpha_beta_0(1, 1) = T_0_0.GetCol(1) * x_1;
191  S_alpha_beta_0(2, 1) = T_0_0.GetCol(2) * x_1;
192  S_alpha_beta_0(1, 2) = T_0_0.GetCol(1) * x_2;
193  S_alpha_beta_0(2, 2) = T_0_0.GetCol(2) * x_2;
194  alpha_0 = S_alpha_beta_0(1, 1) * S_alpha_beta_0(2, 2) -
195  S_alpha_beta_0(1, 2) * S_alpha_beta_0(2, 1);
196 
197  M_0(1, 1) = S_alpha_beta_0(1, 1) * S_alpha_beta_0(1, 1);
198  M_0(1, 2) = S_alpha_beta_0(1, 2) * S_alpha_beta_0(1, 2);
199  M_0(1, 3) = S_alpha_beta_0(1, 2) * S_alpha_beta_0(1, 1);
200 
201  M_0(2, 1) = S_alpha_beta_0(2, 1) * S_alpha_beta_0(2, 1);
202  M_0(2, 2) = S_alpha_beta_0(2, 2) * S_alpha_beta_0(2, 2);
203  M_0(2, 3) = S_alpha_beta_0(2, 2) * S_alpha_beta_0(2, 1);
204 
205  M_0(3, 1) = S_alpha_beta_0(1, 1) * S_alpha_beta_0(2, 1);
206  M_0(3, 2) = S_alpha_beta_0(1, 2) * S_alpha_beta_0(2, 2);
207  M_0(3, 3) = S_alpha_beta_0(1, 1) * S_alpha_beta_0(2, 2) +
208  S_alpha_beta_0(1, 2) * S_alpha_beta_0(2, 1);
209 
210  // M_0(4, 1) = S_alpha_beta_0(1, 1) * S_alpha_beta_0(2, 1);
211  // M_0(4, 2) = S_alpha_beta_0(1, 2) * S_alpha_beta_0(2, 2);
212  // M_0(4, 3) = S_alpha_beta_0(1, 2) * S_alpha_beta_0(2, 1);
213  // M_0(4, 4) = S_alpha_beta_0(1, 1) * S_alpha_beta_0(2, 2);
214 
215  // M_0(5, 5) = S_alpha_beta_0(1, 1);
216  // M_0(5, 6) = S_alpha_beta_0(1, 2);
217  // M_0(6, 5) = S_alpha_beta_0(2, 1);
218  // M_0(6, 6) = S_alpha_beta_0(2, 2);
219 
220  Inv3x3(M_0, M_0_Inv);
221  }
222 
223  for (integer i = 0; i < NUMIP; i++) {
224  fmh L_alpha_B_i(4, 2);
225  fmh S_alpha_beta_i(2, 2);
226  // doublereal pd_L_alpha_B_i[8], *ppd_L_alpha_B_i[2]; fmh L_alpha_B_i(pd_L_alpha_B_i, ppd_L_alpha_B_i, 8, 4, 2);
227  // doublereal pd_S_alpha_beta_i[4], *ppd_S_alpha_beta_i[2]; fmh S_alpha_beta_i(pd_S_alpha_beta_i, ppd_S_alpha_beta_i, 4, 2, 2);
228  Vec3 x_1 = InterpDeriv_xi1(xa, xi_i[i]);
229  Vec3 x_2 = InterpDeriv_xi2(xa, xi_i[i]);
230  S_alpha_beta_i(1, 1) = T_0_i[i].GetCol(1) * x_1;
231  S_alpha_beta_i(2, 1) = T_0_i[i].GetCol(2) * x_1;
232  S_alpha_beta_i(1, 2) = T_0_i[i].GetCol(1) * x_2;
233  S_alpha_beta_i(2, 2) = T_0_i[i].GetCol(2) * x_2;
234  // alpha_i = det(S_alpha_beta_i)
235  alpha_i[i] = S_alpha_beta_i(1, 1) * S_alpha_beta_i(2, 2) -
236  S_alpha_beta_i(1, 2) * S_alpha_beta_i(2, 1);
237 
238  // xi_i_i = S_alpha_beta_i^{-1}
239  FullMatrixHandler xi_i_i(2, 2);
240  Inv2x2(S_alpha_beta_i, xi_i_i);
241 
242  for (integer n = 0; n < NUMNODES; n++) {
243  for (integer ii = 0; ii < 2; ii++) {
244  L_alpha_B_i(n + 1, ii + 1) = LI_J[n][ii](xi_i[i]);
245  }
246  }
247 
248  L_alpha_B_i.MatMatMul(L_alpha_beta_i[i], xi_i_i);
249 
250  fmh H(3, iGetNumDof());
251  // integer i_H = iGetNumDof(); doublereal pd_H[3*i_H], *ppd_H[i_H]; fmh H(pd_H, ppd_H, 3*i_H, 3, i_H);
252  doublereal t = xi_i[i][0] * xi_i[i][1];
253  H(1, 1) = xi_i[i][0];
254  H(1, 2) = t;
255 
256  H(2, 3) = xi_i[i][1];
257  H(2, 4) = t;
258 
259  H(3, 5) = xi_i[i][0];
260  H(3, 6) = t;
261 
262  H(3, 7) = xi_i[i][1];
263 // H(4, 6) = t;
264 
265  fmh Perm(3, 3), tmpP(3, iGetNumDof()); // Perm (12x6), tmpP(6xiGetNumDof)
266  // doublereal pd_Perm[9], *ppd_Perm[3]; fmh Perm(pd_Perm, ppd_Perm, 9, 3, 3);
267  // integer i_tmpP = iGetNumDof(); doublereal pd_tmpP[3*i_tmpP], *ppd_tmpP[i_tmpP]; fmh tmpP(pd_tmpP, ppd_tmpP, 3*i_tmpP, 3, i_tmpP);
268 // FIXME: CHECK ORDER !!!! apparently no need for permutation
269  Perm(1, 1) = 1.;
270  Perm(2, 2) = 1.;
271  Perm(3, 3) = 1.;
272 
273  M_0_Inv.MatTMatMul(tmpP, H);
274  Perm.MatMatMul(P_i[i], tmpP);
275  P_i[i].ScalarMul(alpha_0 / alpha_i[i]);
276  }
277  // save initial axial values
278  for (integer i = 0; i < NUMIP; i++) {
279  InterpDeriv(xa, L_alpha_beta_i[i], y_i_1[i], y_i_2[i]);
280  fmh F(3, 2);
281  // doublereal pd_F[6], *ppd_F[2]; fmh(pd_F, ppd_F, 6, 3, 2);
282  F.Put(1, 1, y_i_1[i]);
283  F.Put(1, 2, y_i_2[i]);
284  fmh FTF(2, 2);
285  // doublereal pd_FTF[4], *ppd_FTF[2]; fmh FTF(pd_FTF, ppd_FTF, 4, 2, 2);
286  F.MatTMatMul(FTF, F);
287  eps_tilde_0_i[i](1) = 0.5*( FTF(1, 1) - 1 );
288  eps_tilde_0_i[i](2) = 0.5*( FTF(2, 2) - 1 );
289  eps_tilde_0_i[i](3) = FTF(1, 2);
290 /*
291  eps_tilde_1_0_i[i] = T_i[i].MulTV(y_i_1[i]);
292  eps_tilde_2_0_i[i] = T_i[i].MulTV(y_i_2[i]);
293 */
294  }
295 }
296 
298 {
299 #ifdef USE_CL_IN_MEMBRANE
300  for (integer i = 0; i < NUMIP; i++) {
301  ASSERT(pD[i] != 0);
302  if (pD[i] != 0) {
303  SAFEDELETE(pD[i]);
304  }
305  }
306 #endif // USE_CL_IN_MEMBRANE
307 }
308 
310  doublereal dCoef,
311  const VectorHandler& XCurr,
312  const VectorHandler& XPrimeCurr)
313 {
314 
315  /* Dimensiona e resetta la matrice di lavoro */
316  integer iNumRows = 0;
317  integer iNumCols = 0;
318  WorkSpaceDim(&iNumRows, &iNumCols);
319  WorkVec.ResizeReset(iNumRows);
320 
321  /* Recupera e setta gli indici */
322  for (integer i = 0; i < 4; i++) {
323  integer iNodeFirstMomIndex = pNode[i]->iGetFirstMomentumIndex();
324  for (int iCnt = 1; iCnt <= 3; iCnt++) {
325  WorkVec.PutRowIndex(iCnt + 3 * i, iNodeFirstMomIndex + iCnt);
326  }
327  }
328 
329  integer iFirstReactionIndex = iGetFirstIndex();
330  for (unsigned int iCnt = 1; iCnt <= iGetNumDof(); iCnt++) {
331  WorkVec.PutRowIndex(12 + iCnt, iFirstReactionIndex + iCnt);
332  }
333 
335  for (unsigned int i = 1; i <= iGetNumDof(); i++) {
336  beta(i) = XCurr(iFirstReactionIndex + i);
337  }
338 
339 
340  for (integer i = 0; i < NUMIP; i++) {
341  InterpDeriv(xa, L_alpha_beta_i[i], y_i_1[i], y_i_2[i]);
342  fmh F(3, 2);
343  F.Put(1, 1, y_i_1[i]);
344  F.Put(1, 2, y_i_2[i]);
345  fmh FTF(2, 2);
346  F.MatTMatMul(FTF, F);
347  eps_tilde_i[i](1) = 0.5*( FTF(1, 1) - 1 );
348  eps_tilde_i[i](2) = 0.5*( FTF(2, 2) - 1 );
349  eps_tilde_i[i](3) = FTF(1, 2);
350  eps_tilde_i[i] -= eps_tilde_0_i[i];
351 /*
352  eps_tilde_1_i[i] = T_i[i].MulTV(y_i_1[i]) - eps_tilde_1_0_i[i];
353  eps_tilde_2_i[i] = T_i[i].MulTV(y_i_2[i]) - eps_tilde_2_0_i[i];
354 */
355 
356  // parte variabile di B_overline_i
357  for (integer n = 0; n < NUMNODES; n++) {
358 
359  fmh TMP_1(3, 3), TMP_2(3, 3);
360  // TMP_1.PutT(1, 1, T_i[i] * L_alpha_beta_i[i](n + 1, 1));
361  // TMP_2.PutT(1, 1, T_i[i] * L_alpha_beta_i[i](n + 1, 2));
362 
363  B_overline_i[i].PutCoef(1, 1 + 3 * n, F(1, 1) * L_alpha_beta_i[i](n + 1, 1) );
364  B_overline_i[i].PutCoef(1, 2 + 3 * n, F(2, 1) * L_alpha_beta_i[i](n + 1, 1) );
365  B_overline_i[i].PutCoef(1, 3 + 3 * n, F(3, 1) * L_alpha_beta_i[i](n + 1, 1) );
366  B_overline_i[i].PutCoef(2, 1 + 3 * n, F(1, 2) * L_alpha_beta_i[i](n + 1, 2) );
367  B_overline_i[i].PutCoef(2, 2 + 3 * n, F(2, 2) * L_alpha_beta_i[i](n + 1, 2) );
368  B_overline_i[i].PutCoef(2, 3 + 3 * n, F(3, 2) * L_alpha_beta_i[i](n + 1, 2) );
369  B_overline_i[i].PutCoef(3, 1 + 3 * n, F(1, 1) * L_alpha_beta_i[i](n + 1, 2) + F(1, 2) * L_alpha_beta_i[i](n + 1, 1) );
370  B_overline_i[i].PutCoef(3, 2 + 3 * n, F(2, 1) * L_alpha_beta_i[i](n + 1, 2) + F(2, 2) * L_alpha_beta_i[i](n + 1, 1) );
371  B_overline_i[i].PutCoef(3, 3 + 3 * n, F(3, 1) * L_alpha_beta_i[i](n + 1, 2) + F(3, 2) * L_alpha_beta_i[i](n + 1, 1) );
372 
373 /*
374  // delta epsilon_tilde_1_i
375  B_overline_i[i].PutT(1, 1 + 3 * n, T_i[i] * L_alpha_beta_i[i](n + 1, 1));
376  // delta epsilon_tilde_2_i
377  // B_overline_i[i].PutT(4, 1 + 3 * n, T_i[i] * L_alpha_beta_i[i](n + 1, 2));
378 */
379 
380  }
381 
382  }
383 
384 
385  /* Calcola le azioni interne */
386  for (integer i = 0; i < NUMIP; i++) {
387  epsilon.Put(1, eps_tilde_i[i]);
388  // TODO: recupera epsilon_hat con l'ordine giusto per qua
389  P_i[i].MatVecMul(epsilon_hat, beta);
390 
391 
392 
393 
394 
395 // FIXME: add epsilon_hat to enhance strains
396  epsilon += epsilon_hat;
397 
398 
399 
400 #ifdef USE_CL_IN_MEMBRANE
401  pD[i]->Update(epsilon);
402  stress_i[i] = pD[i]->GetF();
403 #else // ! USE_CL_IN_MEMBRANE
404  DRef[i].MatVecMul(stress_i[i], epsilon);
405  if (bPreStress) {
406  stress_i[i] += PreStress;
407  }
408 #endif // ! USE_CL_IN_MEMBRANE
409  }
410 
411 
412  //Residuo
413  //forze di volume
414  MyVectorHandler rd(12);
415  MyVectorHandler rbeta(iGetNumDof());
416  for (integer i = 0; i < NUMIP; i++) {
417  B_overline_i[i].MatTVecMul(rd, stress_i[i]);
418  P_i[i].MatTVecMul(rbeta, stress_i[i]);
419 
420  AssembleVector(WorkVec, 1, rd, -alpha_i[i] * w_i[i]);
421  AssembleVector(WorkVec, 13, rbeta, -alpha_i[i] * w_i[i]);
422  }
423 
424  return WorkVec;
425 }
426 
427 // Jacobian matrix assembly
430  doublereal dCoef,
431  const VectorHandler& XCurr,
432  const VectorHandler& XPrimeCurr)
433 {
434  FullSubMatrixHandler& WM = WorkMat.SetFull();
435 
436  /* Dimensiona e resetta la matrice di lavoro */
437  integer iNumRows = 0;
438  integer iNumCols = 0;
439  WorkSpaceDim(&iNumRows, &iNumCols);
440  WM.ResizeReset(iNumRows, iNumCols);
441 
442  /* Recupera e setta gli indici */
443  integer iFirstReactionIndex = iGetFirstIndex();
444  for (integer i = 0; i < 4; i++) {
445  integer iNodeFirstPosIndex = pNode[i]->iGetFirstPositionIndex();
446  integer iNodeFirstMomIndex = pNode[i]->iGetFirstMomentumIndex();
447  for (int iCnt = 1; iCnt <= 3; iCnt++) {
448  WM.PutRowIndex(iCnt + 3 * i, iNodeFirstMomIndex + iCnt);
449  WM.PutColIndex(iCnt + 3 * i, iNodeFirstPosIndex + iCnt);
450  }
451  }
452  for (unsigned int iCnt = 1; iCnt <= iGetNumDof(); iCnt++) {
453  WM.PutRowIndex(12 + iCnt, iFirstReactionIndex + iCnt);
454  WM.PutColIndex(12 + iCnt, iFirstReactionIndex + iCnt);
455  }
456 
457  // tangente
458  FullMatrixHandler Km(12, 12);
459  FullMatrixHandler K_beta_q(iGetNumDof(), 12);
460  FullMatrixHandler K_beta_beta(iGetNumDof(), iGetNumDof());
461 
462  FullMatrixHandler Ktm(12, 3);
463 
464  FullMatrixHandler Ktbetaq(iGetNumDof(), 3);
465 
466  FullMatrixHandler C(3, 3);
467  for (integer i = 0; i < NUMIP; i++) {
468 
469 #ifdef USE_CL_IN_SHELL
470  C = pD[i]->GetFDE();
471 #else // ! USE_CL_IN_SHELL
472  C = DRef[i];
473 #endif // ! USE_CL_IN_SHELL
474 
475  B_overline_i[i].MatTMatMul(Ktm, C);
476 
477  Ktm.MatMatMul(Km, B_overline_i[i]);
478 
479  P_i[i].MatTMatMul(Ktbetaq, C);
480  Ktbetaq.MatMatMul(K_beta_q, B_overline_i[i]);
481 
482  Ktbetaq.MatMatMul(K_beta_beta, P_i[i]);
483 
484  {
485  Vec3 n1;
486  ExtractVec3(n1, stress_i[i], 1);
487 
488  Vec3 Tn1 = T_i[i] * n1;
489  Vec3 Tn2 = T_i[i] * n1;
490  Vec3 Tm1 = T_i[i] * n1;
491  Vec3 Tm2 = T_i[i] * n1;
492  for (int n = 0; n < NUMNODES; n++) {
493  for (int m = 0; m < NUMNODES; m++) {
494  }
495  }
496  }
497 
498  WM.Add(1, 1, Km, alpha_i[i] * w_i[i] * dCoef);
499 
500  WM.AddT(1, 13, K_beta_q, alpha_i[i] * w_i[i]);
501  WM.Add(13, 1, K_beta_q, alpha_i[i] * w_i[i] * dCoef);
502  WM.Add(13, 13, K_beta_beta, alpha_i[i] * w_i[i]);
503 
504  for (integer l = 0; l < 3; l++) {
505  doublereal Fl_1[4], Fl_2[4];
506  for (integer n = 0; n < 4; n++) {
507  Fl_1[n] = L_alpha_beta_i[i](n + 1, 1);
508  Fl_2[n] = L_alpha_beta_i[i](n + 1, 2);
509  }
510  for (integer n = 0; n < 4; n++) {
511  for (integer m = 0; m < 4; m++) {
512  WM.IncCoef(3 * n + l + 1, 3 * m + l + 1, Fl_1[n] * stress_i[i](1) * Fl_1[m] * alpha_i[i] * w_i[i] * dCoef);
513  WM.IncCoef(3 * n + l + 1, 3 * m + l + 1, Fl_2[n] * stress_i[i](2) * Fl_2[m] * alpha_i[i] * w_i[i] * dCoef);
514  WM.IncCoef(3 * n + l + 1, 3 * m + l + 1, (Fl_1[n] * stress_i[i](3) * Fl_2[m] + Fl_2[n] * stress_i[i](3) * Fl_1[m])* alpha_i[i] * w_i[i] * dCoef);
515  }
516  }
517  }
518 
519  }
520 
521  return WorkMat;
522 
523 }
524 
525 // Contribution to restart file
526 std::ostream&
527 Membrane4EAS::Restart(std::ostream& out) const
528 {
529  return out << "# not implemented yet" << std::endl;
530 }
531 
532 // Initial settings
533 void
535  VectorHandler& /* X */ , VectorHandler& /* XP */ ,
537 {
538  NO_OP;
539 }
540 
543  const VectorHandler& XCurr)
544 {
545  WorkMat.SetNullMatrix();
546  return WorkMat;
547 }
548 
551 {
552  WorkVec.Resize(0);
553  return WorkVec;
554 }
555 
556 // Access to nodes
557 const StructDispNode*
558 Membrane4EAS::pGetNode(unsigned int i) const
559 {
560  ASSERT(i >= 1 && i <= 4);
561  switch (i) {
562  case 1:
563  case 2:
564  case 3:
565  case 4:
566  return pNode[i - 1];
567  default:
569  }
570 }
571 
572 void
574 {
575  if (bToBeOutput()) {
576  if (OH.UseText(OutputHandler::PLATES)) {
577  std::ostream& out = OH.Plates();
578  out << std::setw(8) << GetLabel();
579  // TODO: complete
580  for (integer i = 0; i < NUMIP; i++) {
581  for (integer r = 1; r <= 3; r++) {
582  out << " " << stress_i[i](r);
583  }
584  }
585  out << std::endl;
586  }
587  }
588 }
589 
590 
592 
593 Elem*
595  MBDynParser& HP,
596  const DofOwner* pDO,
597  unsigned int uLabel)
598 {
599 
600  const StructDispNode* pN[4];
601  for (unsigned i = 0; i < 4; i++) {
602  pN[i] = pDM->ReadNode<const StructDispNode, Node::STRUCTURAL>(HP);
603  }
604 
605  /* Prestress and prestrain */
606  Membrane::vh PreStress(3);
607  PreStress.Reset();
608 
609 #ifdef USE_CL_IN_MEMBRANE
611 
613 
614  Membrane::fmh S(3, 3);
615  for (unsigned ir = 1; ir <= 3; ir++) {
616  for (unsigned ic = 1; ic <= 3; ic++) {
617  S(ir, ic) = HP.GetReal();
618  }
619  }
620 
621  pD[0] = 0;
622  SAFENEWWITHCONSTRUCTOR(pD[0], LEGCLMembrane, LEGCLMembrane(pTplDC, PreStress, S));
623 
624  for (unsigned i = 1; i < 4; i++) {
625  pD[i] = pD[0]->Copy();
626  }
627 #else // ! USE_CL_IN_MEMBRANE
628  Membrane::fmh pD(3, 3);
629 
630  if (ReadMembraneConstLaw(HP, pD, PreStress)) {
631  silent_cerr("Membrane(" << uLabel << "): unable to read constitutive law" << std::endl);
633  }
634 #endif // ! USE_CL_IN_MEMBRANE
635 
636  flag fOut = pDM->fReadOutput(HP, Elem::PLATE);
637 
638  Elem *pEl = 0;
640  Membrane4EAS(uLabel, pDO,
641  pN[0], pN[1], pN[2], pN[3],
642 #ifdef USE_CL_IN_MEMBRANE
643 #else // ! USE_CL_IN_MEMBRANE
644  pD, PreStress,
645 #endif // ! USE_CL_IN_MEMBRANE
646  fOut));
647 
648  std::ostream& out = pDM->GetLogFile();
649  out << "membrane4: " << uLabel
650  << " " << pN[0]->GetLabel()
651  << " " << pN[1]->GetLabel()
652  << " " << pN[2]->GetLabel()
653  << " " << pN[3]->GetLabel()
654  << std::endl;
655 
656  return pEl;
657 }
658 
flag fReadOutput(MBDynParser &HP, const T &t) const
Definition: dataman.h:1064
Mat3x3 T_i[NUMIP]
Definition: membraneeas.h:125
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: membraneeas.cc:429
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
virtual void Output(OutputHandler &OH) const
Definition: membraneeas.cc:573
Membrane4EAS(unsigned int uL, const DofOwner *pDO, const StructDispNode *pN1, const StructDispNode *pN2, const StructDispNode *pN3, const StructDispNode *pN4, const fmh &pDTmp, const vh &PreStress, flag fOut)
Definition: membraneeas.cc:110
long int flag
Definition: mbdyn.h:43
virtual bool bToBeOutput(void) const
Definition: output.cc:890
Vec3 xa_0[NUMNODES]
Definition: membraneeas.h:116
vfmh L_alpha_beta_i
Definition: membraneeas.h:148
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
doublereal Norm(void) const
Definition: matvec3.h:263
doublereal alpha_i[NUMIP]
Definition: membraneeas.h:147
ConstitutiveLawOwner< vh, fmh > ConstitutiveLawOwnerType
Definition: membrane.h:85
Vec3 eps_tilde_i[NUMIP]
Definition: membraneeas.h:131
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
Vec3 GetCol(unsigned short int i) const
Definition: matvec3.h:903
vfmh B_overline_i
Definition: membraneeas.h:150
Vec3 y_i_2[NUMIP]
Definition: membraneeas.h:155
virtual void Put(integer iRow, const Vec3 &v)
Definition: vh.cc:699
#define NO_OP
Definition: myassert.h:74
std::vector< Hint * > Hints
Definition: simentity.h:89
void UpdateNodalAndAveragePos()
Definition: membraneeas.cc:79
void IncCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:683
void AddT(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:227
virtual std::ostream & Restart(std::ostream &out) const
Definition: membraneeas.cc:527
void SetValue(DataManager *pDM, VectorHandler &, VectorHandler &, SimulationEntity::Hints *ph=0)
Definition: membraneeas.cc:534
int ReadMembraneConstLaw(MBDynParser &HP, Membrane::fmh &pD, Membrane::vh &PreStress)
Definition: membrane.cc:74
static doublereal xi_n[NUMNODES][2]
Definition: membraneeas.h:101
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
Vec3 xa[NUMNODES]
Definition: membraneeas.h:117
FullMatrixHandler fmh
Definition: membrane.h:83
void SetNullMatrix(void)
Definition: submat.h:1159
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual ~Membrane4EAS(void)
Definition: membraneeas.cc:297
#define ASSERT(expression)
Definition: colamd.c:977
void ComputeInitialIptOrientation()
Definition: membraneeas.cc:87
Mat3x3 T_0_i[NUMIP]
Definition: membraneeas.h:122
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
virtual void Reset(void)
Definition: vh.cc:459
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
Definition: mynewmem.h:698
Elem * ReadMembrane4EAS(DataManager *pDM, MBDynParser &HP, const DofOwner *pDO, unsigned int uLabel)
Definition: membraneeas.cc:594
virtual const StructDispNode * pGetNode(unsigned int i) const
Definition: membraneeas.cc:558
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
VectorExpression< VectorExpr, N_rows >::ScalarType Norm(const VectorExpression< VectorExpr, N_rows > &u)
Definition: matvec.h:3163
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: membraneeas.cc:309
static doublereal xi_0[2]
Definition: membraneeas.h:103
const StructDispNode * pNode[NUMNODES]
Definition: membraneeas.h:113
Definition: elem.h:75
doublereal alpha_0
Definition: membraneeas.h:146
fmh S_alpha_beta_0
Definition: membraneeas.h:145
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
std::ostream & GetLogFile(void) const
Definition: dataman.h:326
Mat3x3 T_0_0
Definition: membraneeas.h:121
static doublereal xi_i[NUMIP][2]
Definition: membraneeas.h:89
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: membraneeas.h:241
Vec3 y_i_1[NUMIP]
Definition: membraneeas.h:154
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: membraneeas.cc:542
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
std::ostream & Plates(void) const
Definition: output.h:580
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
static doublereal w_i[NUMIP]
Definition: membraneeas.h:90
virtual MatrixHandler & MatMatMul(MatrixHandler &out, const MatrixHandler &in) const
Definition: mh.cc:232
unsigned int GetLabel(void) const
Definition: withlab.cc:62
Node * ReadNode(MBDynParser &HP, Node::Type type) const
Definition: dataman3.cc:2309
virtual unsigned int iGetNumDof(void) const
Definition: membraneeas.h:210
LinearElasticGenericConstitutiveLaw< Membrane::vh, Membrane::fmh > LEGCLMembrane
Definition: membraneeas.cc:591
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: membraneeas.cc:550
virtual void Resize(integer iNewSize)=0
Vec3 eps_tilde_0_i[NUMIP]
Definition: membraneeas.h:129
bool UseText(int out) const
Definition: output.cc:446
#define SAFEDELETE(pnt)
Definition: mynewmem.h:710
virtual doublereal GetReal(const doublereal &dDefval=0.0)
Definition: parser.cc:1056