MAST
orthotropic_material_property_card.cpp
Go to the documentation of this file.
1 /*
2  * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3  * Copyright (C) 2013-2019 Manav Bhatia
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 
21 // MAST includes
24 
25 
26 namespace MAST {
27  namespace OrthotropicMaterialProperty {
28 
29 
30  class StiffnessMatrix1D: public MAST::FieldFunction<RealMatrixX> {
31  public:
32 
34  const MAST::FieldFunction<Real>& nu);
35 
36  virtual ~StiffnessMatrix1D() { }
37 
38  virtual void operator() (const libMesh::Point& p,
39  const Real t,
40  RealMatrixX& m) const;
41 
42  virtual void derivative( const MAST::FunctionBase& f,
43  const libMesh::Point& p,
44  const Real t,
45  RealMatrixX& m) const;
46 
47  protected:
48 
51  };
52 
53 
54 
56  public:
58  const MAST::FieldFunction<Real>& nu,
59  const MAST::FieldFunction<Real>& kappa);
60 
61 
63 
64  virtual void operator() (const libMesh::Point& p,
65  const Real t,
66  RealMatrixX& m) const;
67 
68  virtual void derivative( const MAST::FunctionBase& f,
69  const libMesh::Point& p,
70  const Real t,
71  RealMatrixX& m) const;
72 
73  protected:
74 
78  };
79 
80 
81  class StiffnessMatrix2D: public MAST::FieldFunction<RealMatrixX> {
82  public:
84  const MAST::FieldFunction<Real>& E22,
85  const MAST::FieldFunction<Real>& nu12,
86  const MAST::FieldFunction<Real>& G12,
87  bool plane_stress);
88 
89  virtual ~StiffnessMatrix2D() { }
90 
91 
92  virtual void operator() (const libMesh::Point& p,
93  const Real t,
94  RealMatrixX& m) const;
95 
96  virtual void derivative( const MAST::FunctionBase& f,
97  const libMesh::Point& p,
98  const Real t,
99  RealMatrixX& m) const;
100 
101  protected:
102 
108  };
109 
110 
111 
112  class StiffnessMatrix3D: public MAST::FieldFunction<RealMatrixX> {
113  public:
115  const MAST::FieldFunction<Real>& E22,
116  const MAST::FieldFunction<Real>& E33,
117  const MAST::FieldFunction<Real>& nu12,
118  const MAST::FieldFunction<Real>& nu13,
119  const MAST::FieldFunction<Real>& nu23,
120  const MAST::FieldFunction<Real>& G12,
121  const MAST::FieldFunction<Real>& G13,
122  const MAST::FieldFunction<Real>& G23);
123 
124 
125  virtual ~StiffnessMatrix3D() { }
126 
127  virtual void operator() (const libMesh::Point& p,
128  const Real t,
129  RealMatrixX& m) const;
130 
131  virtual void derivative( const MAST::FunctionBase& f,
132  const libMesh::Point& p,
133  const Real t,
134  RealMatrixX& m) const;
135 
136  protected:
137 
138  const MAST::FieldFunction<Real> &_E11, &_E22, &_E33;
139  const MAST::FieldFunction<Real> &_nu12, &_nu13, &_nu23;
140  const MAST::FieldFunction<Real> &_G12, &_G13, &_G23;
141 
142  };
143 
144 
145 
146  class InertiaMatrix3D: public MAST::FieldFunction<RealMatrixX> {
147  public:
149 
150  virtual ~InertiaMatrix3D() { }
151 
152  virtual void operator() (const libMesh::Point& p,
153  const Real t,
154  RealMatrixX& m) const;
155 
156  virtual void derivative( const MAST::FunctionBase& f,
157  const libMesh::Point& p,
158  const Real t,
159  RealMatrixX& m) const;
160 
161  protected:
162 
164 
165  };
166 
167 
168 
169  class ThermalExpansionMatrix: public MAST::FieldFunction<RealMatrixX> {
170  public:
171 
173  MAST::FieldFunction<RealMatrixX>("ThermalExpansionMatrix"),
174  _dim(1),
175  _alpha(_dim) {
176 
177  _alpha[0] = &alpha11;
178  _functions.insert(_alpha[0]);
179  }
180 
181 
183  const MAST::FieldFunction<Real>& alpha22):
184  MAST::FieldFunction<RealMatrixX>("ThermalExpansionMatrix"),
185  _dim(2),
186  _alpha(_dim) {
187 
188  _alpha[0] = &alpha11;
189  _alpha[1] = &alpha22;
190  for (unsigned int i=0; i<_dim; i++)
191  _functions.insert(_alpha[i]);
192  }
193 
194 
196  const MAST::FieldFunction<Real>& alpha22,
197  const MAST::FieldFunction<Real>& alpha33):
198  MAST::FieldFunction<RealMatrixX>("ThermalExpansionMatrix"),
199  _dim(3),
200  _alpha(_dim) {
201 
202  _alpha[0] = &alpha11;
203  _alpha[1] = &alpha22;
204  _alpha[2] = &alpha33;
205 
206  for (unsigned int i=0; i<_dim; i++)
207  _functions.insert(_alpha[i]);
208  }
209 
210 
212 
213  virtual void operator() (const libMesh::Point& p,
214  const Real t,
215  RealMatrixX& m) const;
216 
217  virtual void derivative( const MAST::FunctionBase& f,
218  const libMesh::Point& p,
219  const Real t,
220  RealMatrixX& m) const;
221 
222  protected:
223 
224  const unsigned int _dim;
225 
226  std::vector<const MAST::FieldFunction<Real>*> _alpha;
227  };
228 
229 
230 
231 
233  public MAST::FieldFunction<RealMatrixX> {
234  public:
235 
237  MAST::FieldFunction<RealMatrixX>("ThermalConductanceMatrix"),
238  _dim(1),
239  _k(_dim) {
240 
241  _k[0] = &k11;
242 
243  _functions.insert(_k[0]);
244  }
245 
247  const MAST::FieldFunction<Real>& k22):
248  MAST::FieldFunction<RealMatrixX>("ThermalConductanceMatrix"),
249  _dim(2),
250  _k(_dim) {
251 
252  _k[0] = &k11;
253  _k[1] = &k22;
254 
255  for (unsigned int i=0; i<_dim; i++)
256  _functions.insert(_k[i]);
257  }
258 
260  const MAST::FieldFunction<Real>& k22,
261  const MAST::FieldFunction<Real>& k33):
262  MAST::FieldFunction<RealMatrixX>("ThermalConductanceMatrix"),
263  _dim(3),
264  _k(_dim) {
265 
266  _k[0] = &k11;
267  _k[1] = &k22;
268  _k[2] = &k33;
269 
270  for (unsigned int i=0; i<_dim; i++)
271  _functions.insert(_k[i]);
272  }
273 
274 
276 
277  virtual void operator() (const libMesh::Point& p,
278  const Real t,
279  RealMatrixX& m) const;
280 
281  virtual void derivative( const MAST::FunctionBase& f,
282  const libMesh::Point& p,
283  const Real t,
284  RealMatrixX& m) const;
285 
286  protected:
287 
288  const unsigned int _dim;
289 
290  std::vector<const MAST::FieldFunction<Real>*> _k;
291  };
292 
293 
294 
296  public MAST::FieldFunction<RealMatrixX> {
297  public:
298 
299  ThermalCapacitanceMatrix(unsigned int dim,
300  const MAST::FieldFunction<Real>& rho,
301  const MAST::FieldFunction<Real>& cp):
302  MAST::FieldFunction<RealMatrixX>("ThermalCapacitanceMatrix"),
303  _dim(dim),
304  _rho(rho),
305  _cp(cp) {
306 
307  _functions.insert(&_rho);
308  _functions.insert(&_cp);
309  }
310 
311 
313 
314  virtual void operator() (const libMesh::Point& p,
315  const Real t,
316  RealMatrixX& m) const;
317 
318  virtual void derivative( const MAST::FunctionBase& f,
319  const libMesh::Point& p,
320  const Real t,
321  RealMatrixX& m) const;
322 
323  protected:
324 
325  const unsigned int _dim;
326 
328 
330  };
331 
332 
333  }
334 }
335 
336 
337 
340  const MAST::FieldFunction<Real>& nu ):
341 MAST::FieldFunction<RealMatrixX>("StiffnessMatrix1D"),
342 _E(E),
343 _nu(nu)
344 {
345  _functions.insert(&E);
346  _functions.insert(&nu);
347 }
348 
349 
350 
351 
352 void
354 StiffnessMatrix1D::operator() (const libMesh::Point& p,
355  const Real t,
356  RealMatrixX& m) const {
357  m = RealMatrixX::Zero(2,2);
358  Real E, nu, G;
359  _E(p, t, E); _nu(p, t, nu);
360  G = E/2./(1.+nu);
361  m(0,0) = E;
362  m(1,1) = G;
363 }
364 
365 
366 void
369  const libMesh::Point &p,
370  const Real t,
371  RealMatrixX &m) const {
372 
373 
374  RealMatrixX dm;
375  m = RealMatrixX::Zero(2,2); dm = RealMatrixX::Zero(2,2);
376  Real E, nu, dEdf, dnudf;
377  _E(p, t, E); _E.derivative( f, p, t, dEdf);
378  _nu(p, t, nu); _nu.derivative( f, p, t, dnudf);
379 
380  // parM/parE * parE/parf
381  dm(0,0) = 1.;
382  dm(1,1) = 1./2./(1.+nu);
383  m += dEdf * dm;
384 
385 
386  // parM/parnu * parnu/parf
387  dm(0,0) = 0.;
388  dm(1,1) = -E/2./pow(1.+nu,2);
389  m+= dnudf*dm;
390 }
391 
392 
395  const MAST::FieldFunction<Real>& nu,
396  const MAST::FieldFunction<Real>& kappa):
397 MAST::FieldFunction<RealMatrixX>("TransverseShearStiffnessMatrix"),
398 _E(E),
399 _nu(nu),
400 _kappa(kappa)
401 {
402  _functions.insert(&E);
403  _functions.insert(&nu);
404  _functions.insert(&kappa);
405 }
406 
407 
408 
409 void
412  const Real t,
413  RealMatrixX& m) const {
414  m = RealMatrixX::Zero(2,2);
415  Real E, nu, kappa, G;
416  _E(p, t, E); _nu(p, t, nu); _kappa(p, t, kappa);
417  G = E/2./(1.+nu);
418  m(0,0) = G*kappa;
419  m(1,1) = m(0,0);
420 }
421 
422 
423 
424 void
427  const libMesh::Point& p,
428  const Real t,
429  RealMatrixX& m) const {
430  RealMatrixX dm;
431  m = RealMatrixX::Zero(2,2); dm = RealMatrixX::Zero(2, 2);
432  Real E, nu, kappa, dEdf, dnudf, dkappadf, G;
433  _E (p, t, E); _E.derivative( f, p, t, dEdf);
434  _nu (p, t, nu); _nu.derivative( f, p, t, dnudf);
435  _kappa(p, t, kappa); _kappa.derivative( f, p, t, dkappadf);
436  G = E/2./(1.+nu);
437 
438 
439  // parM/parE * parE/parf
440  dm(0,0) = 1./2./(1.+nu)*kappa;
441  dm(1,1) = dm(0,0);
442  m += dEdf * dm;
443 
444 
445  // parM/parnu * parnu/parf
446  dm(0,0) = -E/2./pow(1.+nu,2)*kappa;
447  dm(1,1) = dm(0,0);
448  m+= dnudf*dm;
449 
450  // parM/parnu * parkappa/parf
451 
452  dm(0,0) = G; dm(1,1) = G;
453  dm += dkappadf*dm;
454 }
455 
456 
457 
458 
461  const MAST::FieldFunction<Real>& E22,
462  const MAST::FieldFunction<Real>& nu12,
463  const MAST::FieldFunction<Real>& G12,
464  bool plane_stress ):
465 MAST::FieldFunction<RealMatrixX>("StiffnessMatrix2D"),
466 _E11(E11),
467 _E22(E22),
468 _nu12(nu12),
469 _G12(G12),
470 _plane_stress(plane_stress)
471 {
472  _functions.insert(&E11);
473  _functions.insert(&E22);
474  _functions.insert(&nu12);
475  _functions.insert(&G12);
476 }
477 
478 
479 
480 
481 void
483 StiffnessMatrix2D::operator() (const libMesh::Point& p,
484  const Real t,
485  RealMatrixX& m) const {
486  libmesh_assert(_plane_stress); // currently only implemented for plane stress
487  m = RealMatrixX::Zero(3,3);
488  Real E11, E22, nu12, nu21, G12, D;
489  _E11 (p, t, E11);
490  _E22 (p, t, E22);
491  _nu12 (p, t, nu12);
492  _G12 (p, t, G12);
493  nu21 = nu12 * E22/E11;
494  D = (1. - nu12*nu21);
495 
496  m(0,0) = E11;
497  m(0,1) = nu21*E11;
498 
499  m(1,0) = nu12*E22;
500  m(1,1) = E22;
501 
502  m.topLeftCorner(2, 2) /= D;
503 
504  m(2,2) = G12;
505 }
506 
507 
508 
509 
510 void
513  const libMesh::Point& p,
514  const Real t,
515  RealMatrixX& m) const {
516  libmesh_assert(_plane_stress); // currently only implemented for plane stress
517  RealMatrixX dm;
518  m = RealMatrixX::Zero(3,3); dm = RealMatrixX::Zero(3, 3);
519  Real E11, E22, nu12, nu21, dE11df, dE22df, dnu12df, dnu21df, D, dDdf, dG12df;
520  _E11 (p, t, E11); _E11.derivative( f, p, t, dE11df);
521  _E22 (p, t, E22); _E22.derivative( f, p, t, dE22df);
522  _nu12 (p, t, nu12); _nu12.derivative( f, p, t, dnu12df);
523  _G12.derivative( f, p, t, dG12df);
524 
525  nu21 = nu12 * E22/E11;
526  dnu21df = dnu12df * E22/E11 + nu12 * dE22df/E11 - nu12 * E22/E11/E11*dE11df;
527  D = (1. - nu12*nu21);
528  dDdf = (- dnu12df*nu21 - nu12*dnu21df);
529 
530  m(0,0) = E11;
531  m(0,1) = nu21*E11;
532 
533  m(1,0) = nu12*E22;
534  m(1,1) = E22;
535 
536  m.topLeftCorner(2, 2) *= -dDdf/D/D;
537  m(2,2) = dG12df;
538 
539  dm(0,0) = dE11df;
540  dm(0,1) = nu21*dE11df + dnu21df*E11;
541 
542  dm(1,0) = nu12*dE22df + dnu12df*E22;
543  dm(1,1) = dE22df;
544 
545  m.topLeftCorner(2, 2) += dm.topLeftCorner(3, 3)/D;
546 }
547 
548 
549 
552  const MAST::FieldFunction<Real>& E22,
553  const MAST::FieldFunction<Real>& E33,
554  const MAST::FieldFunction<Real>& nu12,
555  const MAST::FieldFunction<Real>& nu13,
556  const MAST::FieldFunction<Real>& nu23,
557  const MAST::FieldFunction<Real>& G12,
558  const MAST::FieldFunction<Real>& G13,
559  const MAST::FieldFunction<Real>& G23):
560 MAST::FieldFunction<RealMatrixX>("StiffnessMatrix3D"),
561 _E11(E11),
562 _E22(E22),
563 _E33(E33),
564 _nu12(nu12),
565 _nu13(nu13),
566 _nu23(nu23),
567 _G12(G12),
568 _G13(G13),
569 _G23(G23)
570 {
571  _functions.insert(&E11);
572  _functions.insert(&E22);
573  _functions.insert(&E33);
574  _functions.insert(&nu12);
575  _functions.insert(&nu13);
576  _functions.insert(&nu23);
577  _functions.insert(&G12);
578  _functions.insert(&G13);
579  _functions.insert(&G23);
580 }
581 
582 
583 
584 
585 
586 void
588 StiffnessMatrix3D::operator() (const libMesh::Point& p,
589  const Real t,
590  RealMatrixX& m) const {
591  m = RealMatrixX::Zero(6,6);
592  Real E11, E22, E33, G12, G13, G23, nu12, nu13, nu23, nu21, nu31, nu32, D;
593  _E11 (p, t, E11);
594  _E22 (p, t, E22);
595  _E33 (p, t, E33);
596  _nu12(p, t, nu12);
597  _nu13(p, t, nu13);
598  _nu23(p, t, nu23);
599  _G12 (p, t, G12);
600  _G13 (p, t, G13);
601  _G23 (p, t, G23);
602  nu21 = nu12 * E22/E11;
603  nu31 = nu13 * E33/E11;
604  nu32 = nu23 * E33/E22;
605  D = 1.- nu12*nu21 - nu13*nu31 - nu23*nu32 - nu12*nu23*nu31 - nu13*nu21*nu32;
606 
607 
608  m(0,0) = ( 1. - nu23*nu32)*E11;
609  m(0,1) = (nu21 + nu23*nu31)*E11;
610  m(0,2) = (nu31 + nu21*nu32)*E11;
611 
612  m(1,0) = (nu12 + nu13*nu32)*E22;
613  m(1,1) = ( 1. - nu13*nu31)*E22;
614  m(1,2) = (nu32 + nu12*nu31)*E22;
615 
616  m(2,0) = (nu13 + nu12*nu23)*E33;
617  m(2,1) = (nu23 + nu13*nu21)*E33;
618  m(2,2) = ( 1. - nu12*nu21)*E33;
619 
620  m.topLeftCorner(3, 3) /= D;
621  m(3,3) = G12;
622  m(4,4) = G23;
623  m(5,5) = G13;
624 }
625 
626 
627 
628 
629 void
632  const libMesh::Point& p,
633  const Real t,
634  RealMatrixX& m) const {
635  RealMatrixX dm;
636  m = RealMatrixX::Zero(6,6); dm = RealMatrixX::Zero(6,6);
637  Real
638  E11, dE11df,
639  E22, dE22df,
640  E33, dE33df,
641  dG12df,
642  dG13df,
643  dG23df,
644  nu12, dnu12df,
645  nu13, dnu13df,
646  nu23, dnu23df,
647  nu21, dnu21df,
648  nu31, dnu31df,
649  nu32, dnu32df,
650  D, dDdf;
651  _E11 (p, t, E11); _E11.derivative( f, p, t, dE11df);
652  _E22 (p, t, E22); _E22.derivative( f, p, t, dE22df);
653  _E33 (p, t, E33); _E33.derivative( f, p, t, dE33df);
654  _nu12 (p, t, nu12); _nu12.derivative( f, p, t, dnu12df);
655  _nu13 (p, t, nu13); _nu13.derivative( f, p, t, dnu13df);
656  _nu23 (p, t, nu23); _nu23.derivative( f, p, t, dnu23df);
657  _G12.derivative( f, p, t, dG12df);
658  _G13.derivative( f, p, t, dG13df);
659  _G23.derivative( f, p, t, dG23df);
660  nu21 = nu12 * E22/E11;
661  dnu21df = dnu12df * E22/E11 + nu12 * dE22df/E11 - nu12 * E22/E11/E11*dE11df;
662  nu31 = nu13 * E33/E11;
663  dnu31df = dnu13df * E33/E11 + nu13 * dE33df/E11 - nu13 * E33/E11/E11*dE11df;
664  nu32 = nu23 * E33/E22;
665  dnu32df = dnu23df * E33/E22 + nu23 * dE33df/E22 - nu23 * E33/E22/E22*dE22df;
666  D = 1.- nu12*nu21 - nu13*nu31 - nu23*nu32 - nu12*nu23*nu31 - nu13*nu21*nu32;
667  dDdf =
668  - dnu12df*nu21 - nu12*dnu21df
669  - dnu13df*nu31 - nu13*dnu31df
670  - dnu23df*nu32 - nu23*dnu32df
671  - dnu12df*nu23*nu31
672  - nu12*dnu23df*nu31
673  - nu12*nu23*dnu31df
674  - dnu13df*nu21*nu32
675  - nu13*dnu21df*nu32
676  - nu13*nu21*dnu32df;
677 
678  m(0,0) = ( 1. - nu23*nu32)*E11;
679  m(0,1) = (nu21 + nu23*nu31)*E11;
680  m(0,2) = (nu31 + nu21*nu32)*E11;
681 
682  m(1,0) = (nu12 + nu13*nu32)*E22;
683  m(1,1) = ( 1. - nu13*nu31)*E22;
684  m(1,2) = (nu32 + nu12*nu31)*E22;
685 
686  m(2,0) = (nu13 + nu12*nu23)*E33;
687  m(2,1) = (nu23 + nu13*nu21)*E33;
688  m(2,2) = ( 1. - nu12*nu21)*E33;
689  m *= -dDdf/D/D;
690 
691  m(3,3) = dG12df;
692  m(4,4) = dG23df;
693  m(5,5) = dG13df;
694 
695 
696  dm(0,0) = (- dnu23df*nu32 - nu23*dnu32df)*E11 + ( 1. - nu23*nu32)*dE11df;
697  dm(0,1) = (dnu21df + dnu23df*nu31 + nu23*dnu31df)*E11 + (nu21 + nu23*nu31)*dE11df;
698  dm(0,2) = (dnu31df + dnu21df*nu32 + nu21*dnu32df)*E11 + (nu31 + nu21*nu32)*dE11df;
699 
700  dm(1,0) = (dnu12df + dnu13df*nu32 + nu13*dnu32df)*E22 + (nu12 + nu13*nu32)*dE22df;
701  dm(1,1) = (- dnu13df*nu31 - nu13*dnu31df)*E22 + ( 1. - nu13*nu31)*dE22df;
702  dm(1,2) = (dnu32df + dnu12df*nu31 + nu12*dnu31df)*E22 + (nu32 + nu12*nu31)*dE22df;
703 
704  dm(2,0) = (dnu13df + dnu12df*nu23 + nu12*dnu23df)*E33 + (nu13 + nu12*nu23)*dE33df;
705  dm(2,1) = (dnu23df + dnu13df*nu21 + nu13*dnu21df)*E33 + (nu23 + nu13*nu21)*dE33df;
706  dm(2,2) = (- dnu12df*nu21 - nu12*dnu21df)*E33 + ( 1. - nu12*nu21)*dE33df;
707 
708  m += dm/D;
709 }
710 
711 
712 
715 MAST::FieldFunction<RealMatrixX>("InertiaMatrix3D"),
716 _rho(rho) {
717 
718  _functions.insert(&rho);
719 }
720 
721 
722 
723 void
725 InertiaMatrix3D::operator() (const libMesh::Point& p,
726  const Real t,
727  RealMatrixX& m) const {
728  m = RealMatrixX::Zero(3,3);
729  Real rho;
730  _rho(p, t, rho);
731  m(0,0) = rho;
732  m(1,1) = rho;
733  m(2,2) = rho;
734 }
735 
736 
737 void
740  const MAST::FunctionBase &f,
741  const libMesh::Point &p,
742  const Real t,
743  RealMatrixX &m) const {
744 
745 
746  m = RealMatrixX::Zero(3,3);
747  Real rho;
748  _rho.derivative( f, p, t, rho);
749  m(0,0) = rho;
750  m(1,1) = rho;
751  m(2,2) = rho;
752 }
753 
754 
755 void
757 operator() (const libMesh::Point& p,
758  const Real t,
759  RealMatrixX& m) const {
760 
761 
762  Real alpha;
763  switch (_dim) {
764  case 1:
765  m.setZero(2, 1);
766  break;
767 
768  case 2:
769  m.setZero(3, 1);
770  break;
771 
772  case 3:
773  m.setZero(6, 1);
774  break;
775  }
776 
777  for (unsigned int i=0; i<_dim; i++) {
778  (*_alpha[i]) (p, t, alpha);
779  m(i,0) = alpha;
780  }
781 }
782 
783 
784 
785 
786 
787 void
790  const libMesh::Point& p,
791  const Real t,
792  RealMatrixX& m) const {
793 
794 
795 
796  Real alpha;
797  switch (_dim) {
798  case 1:
799  m.setZero(2, 1);
800  break;
801 
802  case 2:
803  m.setZero(3, 1);
804  break;
805 
806  case 3:
807  m.setZero(6, 1);
808  break;
809  }
810 
811  for (unsigned int i=0; i<_dim; i++) {
812  _alpha[i]->derivative( f, p, t, alpha);
813  m(i,0) = alpha;
814  }
815 }
816 
817 
818 
819 
820 
821 void
823 operator() (const libMesh::Point& p,
824  const Real t,
825  RealMatrixX& m) const {
826 
827  Real cp, rho;
828  _cp (p, t, cp);
829  _rho (p, t, rho);
830 
831  m.setZero(1,1);
832 
833  m(0,0) = cp*rho;
834 }
835 
836 
837 
838 
839 
840 void
843  const libMesh::Point& p,
844  const Real t,
845  RealMatrixX& m) const {
846 
847 
848  Real cp, dcp, rho, drho;
849  _cp (p, t, cp); _cp.derivative( f, p, t, dcp);
850  _rho (p, t, rho); _rho.derivative( f, p, t, drho);
851 
852  m.setZero(1,1);
853 
854  m(0,0) = dcp*rho + cp*drho;
855 }
856 
857 
858 
859 
860 void
862 operator() (const libMesh::Point& p,
863  const Real t,
864  RealMatrixX& m) const {
865 
866  Real k;
867  m.setZero(_dim, _dim);
868  for (unsigned int i=0; i<_dim; i++) {
869  (*_k[i]) (p, t, k);
870  m(i,i) = k;
871  }
872 
873 }
874 
875 
876 
877 
878 
879 void
882  const libMesh::Point& p,
883  const Real t,
884  RealMatrixX& m) const {
885 
886  Real k;
887  m.setZero(_dim, _dim);
888  for (unsigned int i=0; i<_dim; i++) {
889  _k[i]->derivative( f, p, t, k);
890  m(i,i) = k;
891  }
892 }
893 
894 
895 
898 _stiff_mat_1d (nullptr),
899 _stiff_mat_2d (nullptr),
900 _stiff_mat_3d (nullptr),
901 _damp_mat (nullptr),
902 _inertia_mat_3d (nullptr),
903 _thermal_exp_mat_1d (nullptr),
904 _thermal_exp_mat_2d (nullptr),
905 _thermal_exp_mat_3d (nullptr),
906 _transverse_shear_mat (nullptr),
907 _thermal_capacitance_mat_1d (nullptr),
908 _thermal_capacitance_mat_2d (nullptr),
909 _thermal_capacitance_mat_3d (nullptr),
910 _thermal_conductance_mat_1d (nullptr),
911 _thermal_conductance_mat_2d (nullptr),
912 _thermal_conductance_mat_3d (nullptr)
913 { }
914 
915 
916 
918 
919  if (_stiff_mat_1d) delete _stiff_mat_1d;
920  if (_stiff_mat_2d) delete _stiff_mat_2d;
921  if (_stiff_mat_3d) delete _stiff_mat_3d;
922 
923  if (_damp_mat) delete _damp_mat;
924  if (_inertia_mat_3d) delete _inertia_mat_3d;
929 
933 
937 }
938 
939 
940 
943  const bool plane_stress) {
944 
945  switch (dim) {
946 
947  case 1: {
948 
949  if (!_stiff_mat_1d)
951  (this->get<MAST::FieldFunction<Real> >("E"),
952  this->get<MAST::FieldFunction<Real> >("nu"));
953 
954  return *_stiff_mat_1d;
955  }
956  break;
957 
958  case 2: {
959 
960  if (!_stiff_mat_2d)
962  (this->get<MAST::FieldFunction<Real> >("E11"),
963  this->get<MAST::FieldFunction<Real> >("E22"),
964  this->get<MAST::FieldFunction<Real> >("nu12"),
965  this->get<MAST::FieldFunction<Real> >("G12"),
966  plane_stress);
967 
968  return *_stiff_mat_2d;
969  }
970  break;
971 
972  case 3: {
973 
974  if (!_stiff_mat_3d)
976  (this->get<MAST::FieldFunction<Real> >("E11"),
977  this->get<MAST::FieldFunction<Real> >("E22"),
978  this->get<MAST::FieldFunction<Real> >("E33"),
979  this->get<MAST::FieldFunction<Real> >("nu12"),
980  this->get<MAST::FieldFunction<Real> >("nu13"),
981  this->get<MAST::FieldFunction<Real> >("nu23"),
982  this->get<MAST::FieldFunction<Real> >("G12"),
983  this->get<MAST::FieldFunction<Real> >("G13"),
984  this->get<MAST::FieldFunction<Real> >("G23"));
985 
986  return *_stiff_mat_3d;
987  }
988  break;
989 
990  default:
991  // should not get here
992  libmesh_error();
993  }
994 }
995 
996 
997 
998 
1001 
1002  // make sure that this is not null
1003  libmesh_assert(false);
1004 
1005  return *_damp_mat;
1006 }
1007 
1008 
1009 
1010 
1013 
1014  switch (dim) {
1015  case 3: {
1016 
1017  if (!_inertia_mat_3d)
1019  (this->get<MAST::FieldFunction<Real> >("rho"));
1020 
1021  return *_inertia_mat_3d;
1022  }
1023  break;
1024 
1025  case 1:
1026  case 2:
1027  default:
1028  // implemented only for 3D since the 2D and 1D elements
1029  // calculate it themselves
1030  libmesh_error();
1031 
1032  }
1033 }
1034 
1035 
1036 
1037 
1040 
1041  switch (dim) {
1042  case 1: {
1043 
1044  if (!_thermal_exp_mat_1d)
1047  (this->get<MAST::FieldFunction<Real> >("alpha11_expansion"));
1048 
1049  return *_thermal_exp_mat_1d;
1050  }
1051  break;
1052 
1053 
1054  case 2: {
1055 
1056  if (!_thermal_exp_mat_2d)
1059  (this->get<MAST::FieldFunction<Real> >("alpha11_expansion"),
1060  this->get<MAST::FieldFunction<Real> >("alpha22_expansion"));
1061 
1062  return *_thermal_exp_mat_2d;
1063  }
1064  break;
1065 
1066 
1067  case 3: {
1068 
1069  if (!_thermal_exp_mat_3d)
1072  (this->get<MAST::FieldFunction<Real> >("alpha11_expansion"),
1073  this->get<MAST::FieldFunction<Real> >("alpha22_expansion"),
1074  this->get<MAST::FieldFunction<Real> >("alpha33_expansion"));
1075 
1076  return *_thermal_exp_mat_3d;
1077  }
1078  break;
1079 
1080 
1081  default:
1082  libmesh_error();
1083  }
1084 }
1085 
1086 
1087 
1088 
1091 
1092  if (!_transverse_shear_mat)
1095  (this->get<MAST::FieldFunction<Real> >("E11"),
1096  this->get<MAST::FieldFunction<Real> >("nu12"),
1097  this->get<MAST::FieldFunction<Real> >("kappa"));
1098 
1099  return *_transverse_shear_mat;
1100 
1101 }
1102 
1103 
1104 
1107 
1108  switch (dim) {
1109 
1110  case 1: {
1111 
1115  (dim,
1116  this->get<MAST::FieldFunction<Real> >("rho"),
1117  this->get<MAST::FieldFunction<Real> >("cp"));
1118 
1120  }
1121  break;
1122 
1123 
1124  case 2: {
1125 
1129  (dim,
1130  this->get<MAST::FieldFunction<Real> >("rho"),
1131  this->get<MAST::FieldFunction<Real> >("cp"));
1132 
1134  }
1135  break;
1136 
1137 
1138  case 3: {
1139 
1143  (dim,
1144  this->get<MAST::FieldFunction<Real> >("rho"),
1145  this->get<MAST::FieldFunction<Real> >("cp"));
1146 
1148  }
1149  break;
1150 
1151 
1152  default:
1153  // should not get here
1154  libmesh_error();
1155  }
1156 }
1157 
1158 
1159 
1160 
1161 
1164 
1165  switch (dim) {
1166 
1167  case 1: {
1168 
1172  (this->get<MAST::FieldFunction<Real> >("k11_th"));
1173 
1175  }
1176  break;
1177 
1178 
1179  case 2: {
1180 
1184  (this->get<MAST::FieldFunction<Real> >("k11_th"),
1185  this->get<MAST::FieldFunction<Real> >("k22_th"));
1186 
1188  }
1189  break;
1190 
1191 
1192  case 3: {
1193 
1197  (this->get<MAST::FieldFunction<Real> >("k11_th"),
1198  this->get<MAST::FieldFunction<Real> >("k22_th"),
1199  this->get<MAST::FieldFunction<Real> >("k33_th"));
1200 
1202  }
1203  break;
1204 
1205 
1206  default:
1207  // should not get here
1208  libmesh_error();
1209  }
1210 }
1211 
1212 
1213 
1214 
MAST::FieldFunction< RealMatrixX > * _thermal_exp_mat_1d
virtual void operator()(const libMesh::Point &p, const Real t, RealMatrixX &m) const
calculates the value of the function at the specified point, p, and time, t, and returns it in v...
virtual void operator()(const libMesh::Point &p, const Real t, RealMatrixX &m) const
calculates the value of the function at the specified point, p, and time, t, and returns it in v...
virtual const MAST::FieldFunction< RealMatrixX > & conductance_matrix(const unsigned int dim)
MAST::FieldFunction< RealMatrixX > * _thermal_exp_mat_3d
MAST::FieldFunction< RealMatrixX > * _thermal_capacitance_mat_3d
virtual const MAST::FieldFunction< RealMatrixX > & damping_matrix(const unsigned int dim)
ThermalExpansionMatrix(const MAST::FieldFunction< Real > &alpha11, const MAST::FieldFunction< Real > &alpha22, const MAST::FieldFunction< Real > &alpha33)
StiffnessMatrix2D(const MAST::FieldFunction< Real > &E11, const MAST::FieldFunction< Real > &E22, const MAST::FieldFunction< Real > &nu12, const MAST::FieldFunction< Real > &G12, bool plane_stress)
virtual void derivative(const MAST::FunctionBase &f, const libMesh::Point &p, const Real t, RealMatrixX &m) const
calculates the value of the derivative of function with respect to the function f at the specified po...
virtual void operator()(const libMesh::Point &p, const Real t, RealMatrixX &m) const
calculates the value of the function at the specified point, p, and time, t, and returns it in v...
virtual void operator()(const libMesh::Point &p, const Real t, RealMatrixX &m) const
calculates the value of the function at the specified point, p, and time, t, and returns it in v...
ThermalExpansionMatrix(const MAST::FieldFunction< Real > &alpha11, const MAST::FieldFunction< Real > &alpha22)
virtual const MAST::FieldFunction< RealMatrixX > & thermal_expansion_matrix(const unsigned int dim)
ThermalCapacitanceMatrix(unsigned int dim, const MAST::FieldFunction< Real > &rho, const MAST::FieldFunction< Real > &cp)
std::set< const MAST::FunctionBase * > _functions
set of functions that this function depends on
virtual const MAST::FieldFunction< RealMatrixX > & inertia_matrix(const unsigned int dim)
MAST::FieldFunction< RealMatrixX > * _thermal_exp_mat_2d
ThermalConductanceMatrix(const MAST::FieldFunction< Real > &k11, const MAST::FieldFunction< Real > &k22)
libMesh::Real Real
virtual void operator()(const libMesh::Point &p, const Real t, RealMatrixX &m) const
calculates the value of the function at the specified point, p, and time, t, and returns it in v...
MAST::FieldFunction< RealMatrixX > * _thermal_capacitance_mat_1d
virtual const MAST::FieldFunction< RealMatrixX > & stiffness_matrix(const unsigned int dim, const bool plane_stress=true)
TransverseShearStiffnessMatrix(const MAST::FieldFunction< Real > &E, const MAST::FieldFunction< Real > &nu, const MAST::FieldFunction< Real > &kappa)
MAST::FieldFunction< RealMatrixX > * _thermal_conductance_mat_3d
StiffnessMatrix3D(const MAST::FieldFunction< Real > &E11, const MAST::FieldFunction< Real > &E22, const MAST::FieldFunction< Real > &E33, const MAST::FieldFunction< Real > &nu12, const MAST::FieldFunction< Real > &nu13, const MAST::FieldFunction< Real > &nu23, const MAST::FieldFunction< Real > &G12, const MAST::FieldFunction< Real > &G13, const MAST::FieldFunction< Real > &G23)
MAST::FieldFunction< RealMatrixX > * _thermal_capacitance_mat_2d
virtual void derivative(const MAST::FunctionBase &f, ValType &v) const
calculates the value of the function derivative and returns it in v.
MAST::FieldFunction< RealMatrixX > * _transverse_shear_mat
Matrix< Real, Dynamic, Dynamic > RealMatrixX
This creates the base class for functions that have a saptial and temporal dependence, and provide sensitivity operations with respect to the functions and parameters.
MAST::FieldFunction< RealMatrixX > * _thermal_conductance_mat_1d
virtual void derivative(const MAST::FunctionBase &f, const libMesh::Point &p, const Real t, RealMatrixX &m) const
calculates the value of the derivative of function with respect to the function f at the specified po...
virtual void operator()(const libMesh::Point &p, const Real t, RealMatrixX &m) const
calculates the value of the function at the specified point, p, and time, t, and returns it in v...
virtual void derivative(const MAST::FunctionBase &f, const libMesh::Point &p, const Real t, RealMatrixX &m) const
calculates the value of the derivative of function with respect to the function f at the specified po...
virtual const MAST::FieldFunction< RealMatrixX > & capacitance_matrix(const unsigned int dim)
ThermalConductanceMatrix(const MAST::FieldFunction< Real > &k11, const MAST::FieldFunction< Real > &k22, const MAST::FieldFunction< Real > &k33)
MAST::FieldFunction< RealMatrixX > * _inertia_mat_3d
MAST::FieldFunction< RealMatrixX > * _thermal_conductance_mat_2d
virtual void operator()(const libMesh::Point &p, const Real t, RealMatrixX &m) const
calculates the value of the function at the specified point, p, and time, t, and returns it in v...
StiffnessMatrix1D(const MAST::FieldFunction< Real > &E, const MAST::FieldFunction< Real > &nu)
virtual const MAST::FieldFunction< RealMatrixX > & transverse_shear_stiffness_matrix()
virtual void derivative(const MAST::FunctionBase &f, const libMesh::Point &p, const Real t, RealMatrixX &m) const
calculates the value of the derivative of function with respect to the function f at the specified po...
virtual void derivative(const MAST::FunctionBase &f, const libMesh::Point &p, const Real t, RealMatrixX &m) const
calculates the value of the derivative of function with respect to the function f at the specified po...
MAST::FieldFunction< RealMatrixX > * _stiff_mat_2d
MAST::FieldFunction< RealMatrixX > * _damp_mat
virtual void derivative(const MAST::FunctionBase &f, const libMesh::Point &p, const Real t, RealMatrixX &m) const
calculates the value of the derivative of function with respect to the function f at the specified po...
virtual void operator()(const libMesh::Point &p, const Real t, RealMatrixX &m) const
calculates the value of the function at the specified point, p, and time, t, and returns it in v...
MAST::FieldFunction< RealMatrixX > * _stiff_mat_1d
virtual void derivative(const MAST::FunctionBase &f, const libMesh::Point &p, const Real t, RealMatrixX &m) const
calculates the value of the derivative of function with respect to the function f at the specified po...
MAST::FieldFunction< RealMatrixX > * _stiff_mat_3d
virtual void derivative(const MAST::FunctionBase &f, const libMesh::Point &p, const Real t, RealMatrixX &m) const
calculates the value of the derivative of function with respect to the function f at the specified po...