4#ifndef COMPUTESTRESS_MECHANICS_H
5#define COMPUTESTRESS_MECHANICS_H
7#include <deal.II/base/table.h>
8#include <deal.II/base/vectorization.h>
52computeStress(
const dealii::Table<2, double> &CIJ,
53 const dealii::VectorizedArray<double> strain[][dim],
54 dealii::VectorizedArray<double> R[][dim])
58 dealii::VectorizedArray<double> S[6], E[6];
63 E[3] = strain[1][2] + strain[2][1];
64 E[4] = strain[0][2] + strain[2][0];
65 E[5] = strain[0][1] + strain[1][0];
66 for (
unsigned int i = 0; i < 6; i++)
69 for (
unsigned int j = 0; j < 6; j++)
71 S[i] += CIJ(i, j) * E[j];
108 dealii::VectorizedArray<double> S[3], E[3];
112 E[2] = strain[0][1] + strain[1][0];
113 for (
unsigned int i = 0; i < 3; i++)
116 for (
unsigned int j = 0; j < 3; j++)
118 S[i] += CIJ(i, j) * E[j];
128 dealii::VectorizedArray<double> S[1], E[1];
130 S[0] = CIJ(0, 0) * E[0];
140 const dealii::VectorizedArray<double> CIJ[2 * dim - 1 + dim / 3][2 * dim - 1 + dim / 3],
141 const dealii::VectorizedArray<double> strain[][dim],
142 dealii::VectorizedArray<double> R[][dim])
146 dealii::VectorizedArray<double> S[6], E[6];
151 E[3] = strain[1][2] + strain[2][1];
152 E[4] = strain[0][2] + strain[2][0];
153 E[5] = strain[0][1] + strain[1][0];
154 for (
unsigned int i = 0; i < 6; i++)
157 for (
unsigned int j = 0; j < 6; j++)
159 S[i] += CIJ[i][j] * E[j];
174 dealii::VectorizedArray<double> S[3], E[3];
178 E[2] = strain[0][1] + strain[1][0];
179 for (
unsigned int i = 0; i < 3; i++)
182 for (
unsigned int j = 0; j < 3; j++)
184 S[i] += CIJ[i][j] * E[j];
194 dealii::VectorizedArray<double> S[1], E[1];
196 S[0] = CIJ[0][0] * E[0];
206 const dealii::Tensor<2, 2 * dim - 1 + dim / 3, dealii::VectorizedArray<double>> &CIJ,
207 const dealii::VectorizedArray<double> strain[][dim],
208 dealii::VectorizedArray<double> R[][dim])
212 dealii::VectorizedArray<double> S[6], E[6];
217 E[3] = strain[1][2] + strain[2][1];
218 E[4] = strain[0][2] + strain[2][0];
219 E[5] = strain[0][1] + strain[1][0];
220 for (
unsigned int i = 0; i < 6; i++)
223 for (
unsigned int j = 0; j < 6; j++)
225 S[i] += CIJ[i][j] * E[j];
240 dealii::VectorizedArray<double> S[3], E[3];
244 E[2] = strain[0][1] + strain[1][0];
245 for (
unsigned int i = 0; i < 3; i++)
248 for (
unsigned int j = 0; j < 3; j++)
250 S[i] += CIJ[i][j] * E[j];
260 dealii::VectorizedArray<double> S[1], E[1];
262 S[0] = CIJ[0][0] * E[0];
272 const dealii::Tensor<2, 2 * dim - 1 + dim / 3, dealii::VectorizedArray<double>> &CIJ,
273 const dealii::Tensor<2, dim, dealii::VectorizedArray<double>> strain,
274 dealii::Tensor<2, dim, dealii::VectorizedArray<double>> &R)
276 dealii::Tensor<1, 2 * dim - 1 + dim / 3, dealii::VectorizedArray<double>> S, E;
284 E[3] = strain[1][2] + strain[2][1];
285 E[4] = strain[0][2] + strain[2][0];
286 E[5] = strain[0][1] + strain[1][0];
307 E[2] = strain[0][1] + strain[1][0];
320 R[0][0] = CIJ[0][0] * strain[0][0];
328computeStress(
const dealii::Table<2, double> &CIJ,
329 const dealii::Tensor<2, dim, dealii::VectorizedArray<double>> &strain,
330 dealii::Tensor<2, dim, dealii::VectorizedArray<double>> &R)
334 dealii::VectorizedArray<double> S[6], E[6];
339 E[3] = strain[1][2] + strain[2][1];
340 E[4] = strain[0][2] + strain[2][0];
341 E[5] = strain[0][1] + strain[1][0];
342 for (
unsigned int i = 0; i < 6; i++)
345 for (
unsigned int j = 0; j < 6; j++)
347 S[i] += CIJ(i, j) * E[j];
362 dealii::VectorizedArray<double> S[3], E[3];
366 E[2] = strain[0][1] + strain[1][0];
367 for (
unsigned int i = 0; i < 3; i++)
370 for (
unsigned int j = 0; j < 3; j++)
372 S[i] += CIJ[i][j] * E[j];
382 dealii::VectorizedArray<double> S[1], E[1];
384 S[0] = CIJ[0][0] * E[0];