24template <
class T, enum MaterialOutput out>
25gsMaterialMatrixEval<T,out>::gsMaterialMatrixEval(
const gsMaterialMatrixContainer<T> & materialMatrices,
26 const gsFunctionSet<T> * deformed,
29m_materialMatrices(materialMatrices),
33 for (
index_t p = 0; p!=deformed->nPieces(); ++p)
34 GISMO_ASSERT(materialMatrices.piece(p)->initialized(),
"Material matrix "<<p<<
" is incomplete!");
39template <
class T, enum MaterialOutput out>
40gsMaterialMatrixEval<T,out>::gsMaterialMatrixEval( gsMaterialMatrixBase<T> * materialMatrix,
41 const gsFunctionSet<T> * deformed,
44m_materialMatrices(deformed->nPieces()),
48 GISMO_ASSERT(materialMatrix->initialized(),
"Material matrix is incomplete!");
49 for (
index_t p = 0; p!=deformed->nPieces(); ++p)
50 m_materialMatrices.set(p,materialMatrix);
54template <
class T, enum MaterialOutput out>
55gsMaterialMatrixEval<T,out>::gsMaterialMatrixEval(
typename gsMaterialMatrixBase<T>::uPtr & materialMatrix,
56 const gsFunctionSet<T> * deformed,
60gsMaterialMatrixEval(materialMatrix.get(),deformed,z)
63template <
class T, enum MaterialOutput out>
64gsMaterialMatrixEval<T,out>::gsMaterialMatrixEval(
const gsMaterialMatrixContainer<T> & materialMatrices,
65 const gsFunctionSet<T> * undeformed,
66 const gsFunctionSet<T> * deformed,
69m_materialMatrices(materialMatrices),
73 for (
index_t p = 0; p!=deformed->nPieces(); ++p)
74 GISMO_ASSERT(materialMatrices.piece(p)->initialized(),
"Material matrix "<<p<<
" is incomplete!");
76 this->_makePieces(undeformed);
79template <
class T, enum MaterialOutput out>
80gsMaterialMatrixEval<T,out>::gsMaterialMatrixEval( gsMaterialMatrixBase<T> * materialMatrix,
81 const gsFunctionSet<T> * undeformed,
82 const gsFunctionSet<T> * deformed,
85m_materialMatrices(deformed->nPieces()),
89 GISMO_ASSERT(materialMatrix->initialized(),
"Material matrix is incomplete!");
90 for (
index_t p = 0; p!=deformed->nPieces(); ++p)
91 m_materialMatrices.set(p,materialMatrix);
92 this->_makePieces(undeformed);
95template <
class T, enum MaterialOutput out>
96gsMaterialMatrixEval<T,out>::gsMaterialMatrixEval(
typename gsMaterialMatrixBase<T>::uPtr & materialMatrix,
97 const gsFunctionSet<T> * undeformed,
98 const gsFunctionSet<T> * deformed,
101gsMaterialMatrixEval(materialMatrix.get(),undeformed,deformed,z)
104template <
class T, enum MaterialOutput out>
105gsMaterialMatrixEval<T,out>::~gsMaterialMatrixEval()
110template <
class T, enum MaterialOutput out>
111void gsMaterialMatrixEval<T, out>::_makePieces()
113 m_pieces.resize(m_deformed->nPieces());
114 for (
size_t p = 0; p != m_pieces.size(); ++p)
115 m_pieces.at(p) =
new gsMaterialMatrixEvalSingle<T, out>(p, m_materialMatrices.piece(p), m_deformed, m_z);
118template <
class T, enum MaterialOutput out>
119void gsMaterialMatrixEval<T, out>::_makePieces(
const gsFunctionSet<T> * undeformed)
121 m_pieces.resize(m_deformed->nPieces());
122 for (
size_t p = 0; p != m_pieces.size(); ++p)
123 m_pieces.at(p) =
new gsMaterialMatrixEvalSingle<T, out>(p, m_materialMatrices.piece(p), undeformed, m_deformed, m_z);
126template <
class T, enum MaterialOutput out>
134m_materialMat(materialMatrix),
137 m_materialMat->setDeformed(deformed);
139 if (m_z.cols()==0 || m_z.rows()==0)
144 GISMO_ASSERT(z.cols()==1,
"Z coordinates should be provided row-wise in one column");
149template <
class T, enum MaterialOutput out>
158m_materialMat(materialMatrix),
161 m_materialMat->setUndeformed(deformed);
162 m_materialMat->setDeformed(deformed);
164 if (m_z.cols()==0 || m_z.rows()==0)
169 GISMO_ASSERT(z.cols()==1,
"Z coordinates should be provided row-wise in one column");
174template <
class T, enum MaterialOutput out>
179 this->eval_into_impl<out>(u,result);
182template <
class T, enum MaterialOutput out>
183template <enum MaterialOutput _out>
184typename std::enable_if<_out==MaterialOutput::Density, void>::type
187 m_materialMat->density_into(m_pIndex,u,result);
190template <
class T, enum MaterialOutput out>
191template <enum MaterialOutput _out>
192typename std::enable_if<_out==MaterialOutput::VectorN ||
193 _out==MaterialOutput::VectorM ||
194 _out==MaterialOutput::Generic,
void>::type
197 result = m_materialMat->eval3D_vector(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
200template <
class T, enum MaterialOutput out>
201template <enum MaterialOutput _out>
202typename std::enable_if<_out==MaterialOutput::CauchyVectorN ||
203 _out==MaterialOutput::CauchyVectorM,
void>::type
206 result = m_materialMat->eval3D_CauchyVector(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
210template <
class T, enum MaterialOutput out>
211template <enum MaterialOutput _out>
212typename std::enable_if< _out==MaterialOutput::MatrixA || _out==MaterialOutput::MatrixB
213 || _out==MaterialOutput::MatrixC || _out==MaterialOutput::MatrixD,
void>::type
216 result = m_materialMat->eval3D_matrix(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
219template <
class T, enum MaterialOutput out>
220template <enum MaterialOutput _out>
221typename std::enable_if<_out==MaterialOutput::Stretch, void>::type
224 result = m_materialMat->eval3D_pstretch(m_pIndex,u,m_z.replicate(1,u.cols()));
227template <
class T, enum MaterialOutput out>
228template <enum MaterialOutput _out>
229typename std::enable_if<_out==MaterialOutput::PStress ||
230 _out==MaterialOutput::PStressN ||
231 _out==MaterialOutput::PStressM ,
void>::type
234 result = m_materialMat->eval3D_pstress(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
237template <
class T, enum MaterialOutput out>
238template <enum MaterialOutput _out>
239typename std::enable_if<_out==MaterialOutput::PCauchyStressN ||
240 _out==MaterialOutput::PCauchyStressM,
void>::type
243 result = m_materialMat->eval3D_CauchyPStress(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
246template <
class T, enum MaterialOutput out>
247template <enum MaterialOutput _out>
248typename std::enable_if<_out==MaterialOutput::PStrainN || _out==MaterialOutput::PStrainM, void>::type
251 result = m_materialMat->eval3D_pstrain(m_pIndex,u,m_z.replicate(1,u.cols()));
254template <
class T, enum MaterialOutput out>
255template <enum MaterialOutput _out>
256typename std::enable_if<_out==MaterialOutput::StretchDir, void>::type
259 result = m_materialMat->eval3D_pstretchDir(m_pIndex,u,m_z.replicate(1,u.cols()));
262template <
class T, enum MaterialOutput out>
263template <enum MaterialOutput _out>
264typename std::enable_if<_out==MaterialOutput::PStressDir, void>::type
267 result = m_materialMat->eval3D_pstressDir(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
270template <
class T, enum MaterialOutput out>
271template <enum MaterialOutput _out>
272typename std::enable_if<_out==MaterialOutput::StretchTransform, void>::type
275 result = m_materialMat->eval3D_pstretchTransform(m_pIndex,u,m_z.replicate(1,u.cols()));
278template <
class T, enum MaterialOutput out>
279template <enum MaterialOutput _out>
280typename std::enable_if<_out==MaterialOutput::PStressTransform, void>::type
283 result = m_materialMat->eval3D_pstressTransform(m_pIndex,u,m_z.replicate(1,u.cols()));
286template <
class T, enum MaterialOutput out>
287template <enum MaterialOutput _out>
288typename std::enable_if<_out==MaterialOutput::Spec2CovTransform, void>::type
291 result = m_materialMat->eval3D_spec2cov(m_pIndex,u,m_z.replicate(1,u.cols()));
294template <
class T, enum MaterialOutput out>
295template <enum MaterialOutput _out>
296typename std::enable_if<_out==MaterialOutput::Spec2ConTransform, void>::type
299 result = m_materialMat->eval3D_spec2con(m_pIndex,u,m_z.replicate(1,u.cols()));
302template <
class T, enum MaterialOutput out>
303template <enum MaterialOutput _out>
304typename std::enable_if<_out==MaterialOutput::Cov2CartTransform, void>::type
307 result = m_materialMat->eval3D_cov2cart(m_pIndex,u,m_z.replicate(1,u.cols()));
310template <
class T, enum MaterialOutput out>
311template <enum MaterialOutput _out>
312typename std::enable_if<_out==MaterialOutput::Con2CartTransform, void>::type
315 result = m_materialMat->eval3D_con2cart(m_pIndex,u,m_z.replicate(1,u.cols()));
318template <
class T, enum MaterialOutput out>
319template <enum MaterialOutput _out>
320typename std::enable_if<_out==MaterialOutput::TensionField, void>::type
323 result = m_materialMat->eval3D_tensionfield(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
326template <
class T, enum MaterialOutput out>
327template <enum MaterialOutput _out>
328typename std::enable_if<_out==MaterialOutput::Theta, void>::type
331 result = m_materialMat->eval3D_theta(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
334template <
class T, enum MaterialOutput out>
335template <enum MaterialOutput _out>
336typename std::enable_if<_out==MaterialOutput::Gamma, void>::type
339 result = m_materialMat->eval3D_gamma(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
342template <
class T, enum MaterialOutput out>
343template<enum MaterialOutput _out>
344typename std::enable_if<_out==MaterialOutput::Strain ||
345 _out==MaterialOutput::StrainN ||
346 _out==MaterialOutput::StrainM ,
void>::type
349 result = m_materialMat->eval3D_strain(m_pIndex,u,m_z.replicate(1,u.cols()));
352template <
class T, enum MaterialOutput out>
353template<enum MaterialOutput _out>
354typename std::enable_if<_out==MaterialOutput::Stress ||
355 _out==MaterialOutput::StressN ||
356 _out==MaterialOutput::StressM ,
void>::type
359 result = m_materialMat->eval3D_stress(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
362template <
class T, enum MaterialOutput out>
363template<enum MaterialOutput _out>
364typename std::enable_if<_out==MaterialOutput::CauchyStress ||
365 _out==MaterialOutput::CauchyStressN ||
366 _out==MaterialOutput::CauchyStressM ,
void>::type
369 result = m_materialMat->eval3D_CauchyStress(m_pIndex,u,m_z.replicate(1,u.cols()),_out);
373template <
class T, enum MaterialOutput out>
374template <enum MaterialOutput _out>
375typename std::enable_if<_out==MaterialOutput::Thickness, void>::type
378 m_materialMat->thickness_into(m_pIndex,u,result);
381template <
class T, enum MaterialOutput out>
382template <enum MaterialOutput _out>
383typename std::enable_if<_out==MaterialOutput::Parameters, void>::type
386 m_materialMat->parameters_into(m_pIndex,u,result);
389template <
class T, enum MaterialOutput out>
390template <enum MaterialOutput _out>
391typename std::enable_if<_out==MaterialOutput::Deformation, void>::type
394 result = m_materialMat->eval3D_deformation(m_pIndex,u,m_z.replicate(1,u.cols()));
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition gsFunctionSet.h:219
This class defines the base class for material matrices.
Definition gsMaterialMatrixBase.h:33
This class serves as the evaluator of material matrices, based on gsMaterialMatrixBase.
Definition gsMaterialMatrixEval.h:107
void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Implementation of eval_into, see gsFunction.
Definition gsMaterialMatrixEval.hpp:175
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:185
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
#define index_t
Definition gsConfig.h:32
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
Provides the Gauss-Legendre quadrature rule.
Provides an evaluator for material matrices for thin shells.
The G+Smo namespace, containing all definitions for the library.
void freeAll(It begin, It end)
Frees all pointers in the range [begin end)
Definition gsMemory.h:312