G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsMaterialMatrixEval.hpp
Go to the documentation of this file.
1 
16 #pragma once
17 
20 
21 namespace gismo
22 {
23 template <class T, enum MaterialOutput out>
25  gsMaterialMatrixBase<T> * materialMatrix,
26  const gsFunctionSet<T> * deformed,
27  const gsMatrix<T> z
28  )
29 :
30 m_pIndex(patch),
31 m_materialMat(materialMatrix),
32 m_z(z)
33 {
34  m_materialMat->setDeformed(deformed);
35 
36  if (m_z.cols()==0 || m_z.rows()==0)
37  {
38  m_z.resize(1,1);
39  m_z.setZero();
40  }
41  GISMO_ASSERT(z.cols()==1,"Z coordinates should be provided row-wise in one column");
42 
43  // m_materialMat = new gsMaterialMatrix(materialMatrix);
44 }
45 
46 template <class T, enum MaterialOutput out>
48  gsMaterialMatrixBase<T> * materialMatrix,
49  const gsFunctionSet<T> * undeformed,
50  const gsFunctionSet<T> * deformed,
51  const gsMatrix<T> z
52  )
53 :
54 m_pIndex(patch),
55 m_materialMat(materialMatrix),
56 m_z(z)
57 {
58  m_materialMat->setUndeformed(deformed);
59  m_materialMat->setDeformed(deformed);
60 
61  if (m_z.cols()==0 || m_z.rows()==0)
62  {
63  m_z.resize(1,1);
64  m_z.setZero();
65  }
66  GISMO_ASSERT(z.cols()==1,"Z coordinates should be provided row-wise in one column");
67 
68  // m_materialMat = new gsMaterialMatrix(materialMatrix);
69 }
70 
71 template <class T, enum MaterialOutput out>
73 {
75 // #pragma omp critical (gsMaterialMatrixEvalSingle_eval_into)
76  this->eval_into_impl<out>(u,result);
77 }
78 
79 template <class T, enum MaterialOutput out>
80 template <enum MaterialOutput _out>
81 typename std::enable_if<_out==MaterialOutput::Density, void>::type
83 {
84  m_materialMat->density_into(m_pIndex,u,result);
85 }
86 
87 template <class T, enum MaterialOutput out>
88 template <enum MaterialOutput _out>
89 typename std::enable_if<_out==MaterialOutput::VectorN ||
90  _out==MaterialOutput::VectorM ||
91  _out==MaterialOutput::Generic, void>::type
93 {
94  result = m_materialMat->eval3D_vector(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
95 }
96 
97 template <class T, enum MaterialOutput out>
98 template <enum MaterialOutput _out>
99 typename std::enable_if<_out==MaterialOutput::CauchyVectorN ||
100  _out==MaterialOutput::CauchyVectorM, void>::type
102 {
103  result = m_materialMat->eval3D_CauchyVector(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
104 }
105 
106 
107 template <class T, enum MaterialOutput out>
108 template <enum MaterialOutput _out>
109 typename std::enable_if< _out==MaterialOutput::MatrixA || _out==MaterialOutput::MatrixB
110  || _out==MaterialOutput::MatrixC || _out==MaterialOutput::MatrixD, void>::type
112 {
113  result = m_materialMat->eval3D_matrix(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
114 }
115 
116 template <class T, enum MaterialOutput out>
117 template <enum MaterialOutput _out>
118 typename std::enable_if<_out==MaterialOutput::Stretch, void>::type
120 {
121  result = m_materialMat->eval3D_pstretch(m_pIndex,u,m_z.replicate(1,u.cols()));
122 }
123 
124 template <class T, enum MaterialOutput out>
125 template <enum MaterialOutput _out>
126 typename std::enable_if<_out==MaterialOutput::PStress ||
127  _out==MaterialOutput::PStressN ||
128  _out==MaterialOutput::PStressM , void>::type
130 {
131  result = m_materialMat->eval3D_pstress(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
132 }
133 
134 template <class T, enum MaterialOutput out>
135 template <enum MaterialOutput _out>
136 typename std::enable_if<_out==MaterialOutput::PCauchyStressN ||
137  _out==MaterialOutput::PCauchyStressM, void>::type
139 {
140  result = m_materialMat->eval3D_CauchyPStress(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
141 }
142 
143 template <class T, enum MaterialOutput out>
144 template <enum MaterialOutput _out>
145 typename std::enable_if<_out==MaterialOutput::PStrainN || _out==MaterialOutput::PStrainM, void>::type
147 {
148  result = m_materialMat->eval3D_pstrain(m_pIndex,u,m_z.replicate(1,u.cols()));
149 }
150 
151 template <class T, enum MaterialOutput out>
152 template <enum MaterialOutput _out>
153 typename std::enable_if<_out==MaterialOutput::StretchDir, void>::type
155 {
156  result = m_materialMat->eval3D_pstretchDir(m_pIndex,u,m_z.replicate(1,u.cols()));
157 }
158 
159 template <class T, enum MaterialOutput out>
160 template <enum MaterialOutput _out>
161 typename std::enable_if<_out==MaterialOutput::PStressDir, void>::type
163 {
164  result = m_materialMat->eval3D_pstressDir(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
165 }
166 
167 template <class T, enum MaterialOutput out>
168 template <enum MaterialOutput _out>
169 typename std::enable_if<_out==MaterialOutput::StretchTransform, void>::type
171 {
172  result = m_materialMat->eval3D_pstretchTransform(m_pIndex,u,m_z.replicate(1,u.cols()));
173 }
174 
175 template <class T, enum MaterialOutput out>
176 template <enum MaterialOutput _out>
177 typename std::enable_if<_out==MaterialOutput::PStressTransform, void>::type
179 {
180  result = m_materialMat->eval3D_pstressTransform(m_pIndex,u,m_z.replicate(1,u.cols()));
181 }
182 
183 template <class T, enum MaterialOutput out>
184 template <enum MaterialOutput _out>
185 typename std::enable_if<_out==MaterialOutput::Spec2CovTransform, void>::type
187 {
188  result = m_materialMat->eval3D_spec2cov(m_pIndex,u,m_z.replicate(1,u.cols()));
189 }
190 
191 template <class T, enum MaterialOutput out>
192 template <enum MaterialOutput _out>
193 typename std::enable_if<_out==MaterialOutput::Spec2ConTransform, void>::type
195 {
196  result = m_materialMat->eval3D_spec2con(m_pIndex,u,m_z.replicate(1,u.cols()));
197 }
198 
199 template <class T, enum MaterialOutput out>
200 template <enum MaterialOutput _out>
201 typename std::enable_if<_out==MaterialOutput::Cov2CartTransform, void>::type
203 {
204  result = m_materialMat->eval3D_cov2cart(m_pIndex,u,m_z.replicate(1,u.cols()));
205 }
206 
207 template <class T, enum MaterialOutput out>
208 template <enum MaterialOutput _out>
209 typename std::enable_if<_out==MaterialOutput::Con2CartTransform, void>::type
211 {
212  result = m_materialMat->eval3D_con2cart(m_pIndex,u,m_z.replicate(1,u.cols()));
213 }
214 
215 template <class T, enum MaterialOutput out>
216 template <enum MaterialOutput _out>
217 typename std::enable_if<_out==MaterialOutput::TensionField, void>::type
219 {
220  result = m_materialMat->eval3D_tensionfield(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
221 }
222 
223 template <class T, enum MaterialOutput out>
224 template <enum MaterialOutput _out>
225 typename std::enable_if<_out==MaterialOutput::Theta, void>::type
227 {
228  result = m_materialMat->eval3D_theta(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
229 }
230 
231 template <class T, enum MaterialOutput out>
232 template <enum MaterialOutput _out>
233 typename std::enable_if<_out==MaterialOutput::Gamma, void>::type
235 {
236  result = m_materialMat->eval3D_gamma(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
237 }
238 
239 template <class T, enum MaterialOutput out>
240 template<enum MaterialOutput _out>
241 typename std::enable_if<_out==MaterialOutput::Strain ||
242  _out==MaterialOutput::StrainN ||
243  _out==MaterialOutput::StrainM , void>::type
245 {
246  result = m_materialMat->eval3D_strain(m_pIndex,u,m_z.replicate(1,u.cols()));
247 }
248 
249 template <class T, enum MaterialOutput out>
250 template<enum MaterialOutput _out>
251 typename std::enable_if<_out==MaterialOutput::Stress ||
252  _out==MaterialOutput::StressN ||
253  _out==MaterialOutput::StressM , void>::type
255 {
256  result = m_materialMat->eval3D_stress(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
257 }
258 
259 template <class T, enum MaterialOutput out>
260 template<enum MaterialOutput _out>
261 typename std::enable_if<_out==MaterialOutput::CauchyStress ||
262  _out==MaterialOutput::CauchyStressN ||
263  _out==MaterialOutput::CauchyStressM , void>::type
265 {
266  result = m_materialMat->eval3D_CauchyStress(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
267 }
268 
269 
270 template <class T, enum MaterialOutput out>
271 template <enum MaterialOutput _out>
272 typename std::enable_if<_out==MaterialOutput::Thickness, void>::type
274 {
275  m_materialMat->thickness_into(m_pIndex,u,result);
276 }
277 
278 template <class T, enum MaterialOutput out>
279 template <enum MaterialOutput _out>
280 typename std::enable_if<_out==MaterialOutput::Parameters, void>::type
282 {
283  m_materialMat->parameters_into(m_pIndex,u,result);
284 }
285 
286 template <class T, enum MaterialOutput out>
287 template <enum MaterialOutput _out>
288 typename std::enable_if<_out==MaterialOutput::Deformation, void>::type
290 {
291  result = m_materialMat->eval3D_deformation(m_pIndex,u,m_z.replicate(1,u.cols()));
292 }
293 
294 
295 } // end namespace
Provides the Gauss-Legendre quadrature rule.
This class serves as the evaluator of material matrices, based on gsMaterialMatrixBase.
Definition: gsMaterialMatrixEval.h:24
#define index_t
Definition: gsConfig.h:32
void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Implementation of eval_into, see gsFunction.
Definition: gsMaterialMatrixEval.hpp:72
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
This class defines the base class for material matrices.
Definition: gsMaterialMatrixBase.h:32
std::enable_if< _out==MaterialOutput::Density, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for densities.
Definition: gsMaterialMatrixEval.hpp:82
Provides an evaluator for material matrices for thin shells.
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23