b2api
B2000++ API Reference Manual, VERSION 4.6
 
Loading...
Searching...
No Matches
b2material_stress_2d_mixed.H
1//------------------------------------------------------------------------
2// b2material_stress_2d_mixed --
3//
4// Base class for materials used by 2D displacement/pressure
5// elements.
6//
7// written by Thomas Ludwig
8// Neda Ebrahimi Pour <neda.ebrahimipour@dlr.de>
9//
10// (c) 2009-2012,2016 SMR Engineering & Development SA
11// 2502 Bienne, Switzerland
12//
13// (c) 2023 Deutsches Zentrum für Luft- und Raumfahrt (DLR) e.V.
14// Linder Höhe, 51147 Köln
15//
16// All Rights Reserved. Proprietary source code. The contents of
17// this file may not be disclosed to third parties, copied or
18// duplicated in any form, in whole or in part, without the prior
19// written permission of SMR.
20//------------------------------------------------------------------------
21
22#ifndef B2MATERIAL_STRESS_2D_MIXED_H_
23#define B2MATERIAL_STRESS_2D_MIXED_H_
24
25#include "elements/properties/b2solid_mechanics.H"
27
28namespace b2000 {
29
30class MaterialStress2DMixed : virtual public SolidMechanics {
31public:
32 // Return the number of layers.
33 virtual int number_of_layer() const { return 1; }
34
35 // Return the laminate geometric position relative to the
36 // mid-surface of the element.
37 virtual void laminate(
38 const b2linalg::Vector<double, b2linalg::Vdense_constref> nodes_interpolation,
39 double& laminate_begin, double& laminate_end) const {
40 laminate_begin = -1;
41 laminate_end = 1;
42 }
43
44 // Return the layer geometric position relative to the
45 // mid-surface of the element.
46 virtual void layer(
47 const b2linalg::Vector<double, b2linalg::Vdense_constref> nodes_interpolation,
48 const int layer_id, double& layer_begin, double& layer_end) const {
49 layer_begin = -1;
50 layer_end = 1;
51 }
52
53 virtual double get_density(const int layer_id) const {
55 return 0.0;
56 }
57
58 virtual void get_stress(
59 Model* model, const bool linear, const EquilibriumSolution equilibrium_solution,
60 const double time, const double delta_time, GradientContainer* gradient_container,
61 SolverHints* solver_hints, const Element* element, const double el_coordinates[3],
62 const int layer_id,
63 const b2linalg::Vector<double, b2linalg::Vdense_constref> nodes_interpolation,
64 const double bg_coordinates[3], const double covariant_base[2][2], const double volume,
65 const double deformation_gradient[2][2], const double velocity[2],
66 const double acceleration[2], const double interpolated_pressure, double stress[3],
67 double& pressure, double CUU[6], double CUP[3], double& CPP, double inertia_force[2],
68 double& density) = 0;
69
70protected:
71 inline void eval_linear_strain(const double F[2][2], double E[3]) const {
72 const double f00 = F[0][0];
73 const double f01 = F[1][0];
74 const double f10 = F[0][1];
75 const double f11 = F[1][1];
76
77 E[0] = f00 - 1.0;
78 E[1] = f11 - 1.0;
79 E[2] = f01 + f10;
80 }
81
82 inline void eval_green_lagrange_strain(const double F[2][2], double E[3]) const {
83 const double f00 = F[0][0];
84 const double f01 = F[1][0];
85 const double f10 = F[0][1];
86 const double f11 = F[1][1];
87
88 E[0] = 0.5 * (f00 * f00 + f10 * f10 - 1.0);
89 E[1] = 0.5 * (f01 * f01 + f11 * f11 - 1.0);
90 E[2] = f00 * f01 + f10 * f11;
91 }
92
93 inline double delta(const int a, const int b) { return (a == b ? 1.0 : 0.0); }
94
95 inline void s_eq_c_mul_e(double s[3], const double c[6], const double e[3]) {
96 const int ind[3][3] = {{0, 1, 2}, {1, 3, 4}, {2, 4, 5}};
97 for (int i = 0; i < 3; ++i) {
98 double value = 0.0;
99
100 const int* iind = ind[i];
101 for (int j = 0; j < 3; ++j) { value += c[iind[j]] * e[j]; }
102 s[i] = value;
103 }
104 }
105
106 // Transform the 2nd Piola-Kirchhoff stress to the Cauchy
107 // stress. The stresses are in the Voight notation [sxx, syy,
108 // sxy].
109 static inline void piola_2_stress_to_cauchy_stress(
110 const double F[2][2], // Deformation gradient, column-major.
111 const double S[3], // 2nd Piola-Kirchhoff stress (Voight not.).
112 double T[3] // Cauchy stress (Voight notation).
113 ) {
114 const double f00 = F[0][0];
115 const double f01 = F[1][0];
116 const double f10 = F[0][1];
117 const double f11 = F[1][1];
118
119 // Get the determinant of the deformation gradient tensor..
120 const double det = determinant_2_2(F);
121 const double det_inv = 1.0 / det;
122
123 T[0] = f00 * f00 * S[0] + f01 * f01 * S[1] + 2 * f00 * f01 * S[2];
124
125 T[1] = f10 * f10 * S[0] + f11 * f11 * S[1] + 2 * f10 * f11 * S[2];
126
127 T[2] = f00 * f10 * S[0] + f01 * f11 * S[1] + (f00 * f11 + f01 * f10) * S[2];
128
129 for (int i = 0; i < 3; ++i) { T[i] *= det_inv; }
130 }
131
132 static inline void expand_strain_or_stress_2d_to_3d(const double t2d[3], double t3d[6]) {
133 t3d[0] = t2d[0];
134 t3d[1] = t2d[1];
135 t3d[2] = 0.0;
136 t3d[3] = t2d[2];
137 t3d[4] = 0.0;
138 t3d[5] = 0.0;
139 }
140};
141
142} // namespace b2000
143
144#endif // B2_MATERIAL_STRESS_2D_MIXED_H_
#define THROW
Definition b2exception.H:198
Contains the base classes for implementing Finite Elements.
Definition b2boundary_condition.H:32
T determinant_2_2(const T a[2][2])
Definition b2tensor_calculus.H:683
GenericException< UnimplementedError_name > UnimplementedError
Definition b2exception.H:314