24template <
class T, enum MaterialOutput out>
class gsMaterialMatrixEvalSingle;
26template <
class T, enum MaterialOutput out>
27class gsMaterialMatrixEval :
public gsFunction<T>
31 gsMaterialMatrixEval(
const gsMaterialMatrixContainer<T> & materialMatrices,
32 const gsFunctionSet<T> * deformed,
36 gsMaterialMatrixEval( gsMaterialMatrixBase<T> * materialMatrix,
37 const gsFunctionSet<T> * deformed,
42 const gsFunctionSet<T> * deformed,
46 gsMaterialMatrixEval(
const gsMaterialMatrixContainer<T> & materialMatrices,
47 const gsFunctionSet<T> * undeformed,
48 const gsFunctionSet<T> * deformed,
52 gsMaterialMatrixEval( gsMaterialMatrixBase<T> * materialMatrix,
53 const gsFunctionSet<T> * undeformed,
54 const gsFunctionSet<T> * deformed,
59 const gsFunctionSet<T> * undeformed,
60 const gsFunctionSet<T> * deformed,
64 ~gsMaterialMatrixEval();
67 short_t domainDim()
const {
return 2;}
76 short_t targetDim()
const {
return this->piece(0).targetDim(); }
79 const gsFunction<T> & piece(
const index_t p)
const {
return *m_pieces[p]; }
82 void eval_into(
const gsMatrix<T>& , gsMatrix<T>& )
const
88 void _makePieces(
const gsFunctionSet<T> * undeformed);
91 gsMaterialMatrixContainer<T> m_materialMatrices;
92 const gsFunctionSet<T> * m_deformed;
94 mutable std::vector<gsMaterialMatrixEvalSingle<T,out> *> m_pieces;
105template <
class T, enum MaterialOutput out>
140 template<enum MaterialOutput _out>
141 typename std::enable_if<_out==MaterialOutput::Density , short_t>::type
targetDim_impl()
const {
return 1; };
144 template<enum MaterialOutput _out>
145 typename std::enable_if<_out==MaterialOutput::VectorN ||
146 _out==MaterialOutput::CauchyVectorN ||
147 _out==MaterialOutput::VectorM ||
148 _out==MaterialOutput::CauchyVectorM ||
152 template<enum MaterialOutput _out>
153 typename std::enable_if<_out==MaterialOutput::MatrixA ||
154 _out==MaterialOutput::MatrixB ||
155 _out==MaterialOutput::MatrixC ||
159 template<enum MaterialOutput _out>
160 typename std::enable_if<_out==MaterialOutput::Stretch , short_t>::type
targetDim_impl()
const {
return 3; };
163 template<enum MaterialOutput _out>
164 typename std::enable_if<_out==MaterialOutput::PStress ||
165 _out==MaterialOutput::PStressN ||
166 _out==MaterialOutput::PCauchyStressN ||
167 _out==MaterialOutput::PStressM ||
168 _out==MaterialOutput::PCauchyStressM ||
169 _out==MaterialOutput::PStrainN ||
173 template<enum MaterialOutput _out>
174 typename std::enable_if<_out==MaterialOutput::StretchDir, short_t>::type
targetDim_impl()
const {
return 9; };
177 template<enum MaterialOutput _out>
178 typename std::enable_if<_out==MaterialOutput::PStressDir, short_t>::type
targetDim_impl()
const {
return 9; };
181 template<enum MaterialOutput _out>
182 typename std::enable_if<_out==MaterialOutput::Spec2CovTransform ||
183 _out==MaterialOutput::Spec2ConTransform ||
184 _out==MaterialOutput::Cov2CartTransform ||
188 template<enum MaterialOutput _out>
189 typename std::enable_if<_out==MaterialOutput::TensionField, short_t>::type
targetDim_impl()
const {
return 1; };
192 template<enum MaterialOutput _out>
193 typename std::enable_if<_out==MaterialOutput::StretchTransform ||
197 template<enum MaterialOutput _out>
198 typename std::enable_if<_out==MaterialOutput::Theta ||
202 template<enum MaterialOutput _out>
203 typename std::enable_if<_out==MaterialOutput::Strain ||
204 _out==MaterialOutput::StrainN ||
208 template<enum MaterialOutput _out>
209 typename std::enable_if<_out==MaterialOutput::Stress ||
210 _out==MaterialOutput::StressN ||
211 _out==MaterialOutput::StressM ||
212 _out==MaterialOutput::CauchyStressN ||
216 template<enum MaterialOutput _out>
217 typename std::enable_if<_out==MaterialOutput::Thickness, short_t>::type
targetDim_impl()
const {
return 1; };
220 template<enum MaterialOutput _out>
221 typename std::enable_if<_out==MaterialOutput::Parameters, short_t>::type
targetDim_impl()
const {
return m_materialMat->numParameters(); };
224 template<enum MaterialOutput _out>
225 typename std::enable_if<_out==MaterialOutput::Deformation, short_t>::type
targetDim_impl()
const {
return 9; };
238 template<enum MaterialOutput _out>
242 template<enum MaterialOutput _out>
243 typename std::enable_if<_out==MaterialOutput::VectorN ||
244 _out==MaterialOutput::VectorM ||
248 template<enum MaterialOutput _out>
249 typename std::enable_if<_out==MaterialOutput::CauchyVectorN ||
254 template<enum MaterialOutput _out>
255 typename std::enable_if<_out==MaterialOutput::MatrixA ||
256 _out==MaterialOutput::MatrixB ||
257 _out==MaterialOutput::MatrixC ||
261 template<enum MaterialOutput _out>
262 typename std::enable_if<_out==MaterialOutput::PStress ||
263 _out==MaterialOutput::PStressN ||
267 template<enum MaterialOutput _out>
268 typename std::enable_if<_out==MaterialOutput::PCauchyStressN ||
272 template<enum MaterialOutput _out>
273 typename std::enable_if<_out==MaterialOutput::PStrainN ||
277 template<enum MaterialOutput _out>
281 template<enum MaterialOutput _out>
285 template<enum MaterialOutput _out>
289 template<enum MaterialOutput _out>
293 template<enum MaterialOutput _out>
297 template<enum MaterialOutput _out>
301 template<enum MaterialOutput _out>
305 template<enum MaterialOutput _out>
309 template<enum MaterialOutput _out>
313 template<enum MaterialOutput _out>
317 template<enum MaterialOutput _out>
321 template<enum MaterialOutput _out>
325 template<enum MaterialOutput _out>
326 typename std::enable_if<_out==MaterialOutput::Strain ||
327 _out==MaterialOutput::StrainN ||
331 template<enum MaterialOutput _out>
332 typename std::enable_if<_out==MaterialOutput::Stress ||
333 _out==MaterialOutput::StressN ||
337 template<enum MaterialOutput _out>
338 typename std::enable_if<_out==MaterialOutput::CauchyStress ||
339 _out==MaterialOutput::CauchyStressN ||
344 template<enum MaterialOutput _out>
348 template<enum MaterialOutput _out>
352 template<enum MaterialOutput _out>
364#ifndef GISMO_BUILD_LIB
365#include GISMO_HPP_HEADER(gsMaterialMatrixEval.hpp)
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition gsFunctionSet.h:219
A function from a n-dimensional domain to an m-dimensional image.
Definition gsFunction.h:60
This class defines the base class for material matrices.
Definition gsMaterialMatrixBase.h:33
memory::unique_ptr< gsMaterialMatrixBase > uPtr
Unique pointer for gsGeometry.
Definition gsMaterialMatrixBase.h:44
This class serves as the evaluator of material matrices, based on gsMaterialMatrixBase.
Definition gsMaterialMatrixEval.h:107
std::enable_if< _out==MaterialOutput::Stress||_out==MaterialOutput::StressN||_out==MaterialOutput::StressM, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for stress.
std::enable_if< _out==MaterialOutput::PCauchyStressN||_out==MaterialOutput::PCauchyStressM, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the membrane and flexural principle stresses.
std::enable_if< _out==MaterialOutput::PStress||_out==MaterialOutput::PStressN||_out==MaterialOutput::PStressM, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the membrane and flexural principle stresses.
std::enable_if< _out==MaterialOutput::CauchyStress||_out==MaterialOutput::CauchyStressN||_out==MaterialOutput::CauchyStressM, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for cauchy stress.
std::enable_if< _out==MaterialOutput::StretchDir, short_t >::type targetDim_impl() const
Implementation of targetDim for principal stretch directions.
Definition gsMaterialMatrixEval.h:174
std::enable_if< _out==MaterialOutput::Strain||_out==MaterialOutput::StrainN||_out==MaterialOutput::StrainM, short_t >::type targetDim_impl() const
Specialisation of targetDim for strain.
Definition gsMaterialMatrixEval.h:205
std::enable_if< _out==MaterialOutput::VectorN||_out==MaterialOutput::VectorM||_out==MaterialOutput::Generic, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the membrane stress tensor N, M and generic stress.
std::enable_if< _out==MaterialOutput::StretchDir, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the stretch directions.
std::enable_if< _out==MaterialOutput::PStressDir, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the stretch directions.
std::enable_if< _out==MaterialOutput::TensionField, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for tension field indicator.
std::enable_if< _out==MaterialOutput::Stretch, short_t >::type targetDim_impl() const
Implementation of targetDim for principal stretch fields.
Definition gsMaterialMatrixEval.h:160
std::enable_if< _out==MaterialOutput::Con2CartTransform, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the contravariant basis transformation.
std::enable_if< _out==MaterialOutput::Stress||_out==MaterialOutput::StressN||_out==MaterialOutput::StressM||_out==MaterialOutput::CauchyStressN||_out==MaterialOutput::CauchyStressM, short_t >::type targetDim_impl() const
Specialisation of targetDim for strain.
Definition gsMaterialMatrixEval.h:213
std::enable_if< _out==MaterialOutput::TensionField, short_t >::type targetDim_impl() const
Implementation of targetDim for the tension field indicator.
Definition gsMaterialMatrixEval.h:189
std::enable_if< _out==MaterialOutput::Cov2CartTransform, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the covariant basis transformation.
std::enable_if< _out==MaterialOutput::MatrixA||_out==MaterialOutput::MatrixB||_out==MaterialOutput::MatrixC||_out==MaterialOutput::MatrixD, short_t >::type targetDim_impl() const
Implementation of targetDim for material tensors.
Definition gsMaterialMatrixEval.h:156
std::enable_if< _out==MaterialOutput::MatrixA||_out==MaterialOutput::MatrixB||_out==MaterialOutput::MatrixC||_out==MaterialOutput::MatrixD, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the moments of the material matrices.
void setPatch(index_t p)
Sets the patch index.
Definition gsMaterialMatrixEval.h:229
std::enable_if< _out==MaterialOutput::Stretch, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the stretches.
short_t targetDim() const
Target dimension.
Definition gsMaterialMatrixEval.h:135
std::enable_if< _out==MaterialOutput::Spec2CovTransform||_out==MaterialOutput::Spec2ConTransform||_out==MaterialOutput::Cov2CartTransform||_out==MaterialOutput::Con2CartTransform, short_t >::type targetDim_impl() const
Implementation of targetDim for transformations.
Definition gsMaterialMatrixEval.h:185
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::PStress||_out==MaterialOutput::PStressN||_out==MaterialOutput::PCauchyStressN||_out==MaterialOutput::PStressM||_out==MaterialOutput::PCauchyStressM||_out==MaterialOutput::PStrainN||_out==MaterialOutput::PStrainM, short_t >::type targetDim_impl() const
Implementation of targetDim for principal stress fields.
Definition gsMaterialMatrixEval.h:170
std::enable_if< _out==MaterialOutput::Parameters, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the parameters.
std::enable_if< _out==MaterialOutput::Gamma, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for theta.
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
std::enable_if< _out==MaterialOutput::Spec2CovTransform, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the covariant basis transformation.
std::enable_if< _out==MaterialOutput::Thickness, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the thickness.
short_t domainDim() const
Domain dimension, always 2 for shells.
Definition gsMaterialMatrixEval.h:126
std::enable_if< _out==MaterialOutput::Theta||_out==MaterialOutput::Gamma, short_t >::type targetDim_impl() const
Implementation of targetDim for TFT variables.
Definition gsMaterialMatrixEval.h:199
std::enable_if< _out==MaterialOutput::Theta, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for theta.
std::enable_if< _out==MaterialOutput::Deformation, short_t >::type targetDim_impl() const
Implementation of targetDim for principal stress directions.
Definition gsMaterialMatrixEval.h:225
std::enable_if< _out==MaterialOutput::Spec2ConTransform, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the contravariant basis transformation.
std::enable_if< _out==MaterialOutput::Parameters, short_t >::type targetDim_impl() const
Implementation of targetDim for the parameters.
Definition gsMaterialMatrixEval.h:221
std::enable_if< _out==MaterialOutput::StretchTransform||_out==MaterialOutput::PStressTransform, short_t >::type targetDim_impl() const
Implementation of targetDim for principal stress directions.
Definition gsMaterialMatrixEval.h:194
std::enable_if< _out==MaterialOutput::StretchTransform, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the covariant basis transformation.
std::enable_if< _out==MaterialOutput::Strain||_out==MaterialOutput::StrainN||_out==MaterialOutput::StrainM, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for strain.
std::enable_if< _out==MaterialOutput::CauchyVectorN||_out==MaterialOutput::CauchyVectorM, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the membrane cauchy stress tensor N, M and generic cauchy stress.
std::enable_if< _out==MaterialOutput::Density, short_t >::type targetDim_impl() const
Implementation of targetDim for densities.
Definition gsMaterialMatrixEval.h:141
std::enable_if< _out==MaterialOutput::VectorN||_out==MaterialOutput::CauchyVectorN||_out==MaterialOutput::VectorM||_out==MaterialOutput::CauchyVectorM||_out==MaterialOutput::Generic, short_t >::type targetDim_impl() const
Implementation of targetDim for stress tensors.
Definition gsMaterialMatrixEval.h:149
std::enable_if< _out==MaterialOutput::PStrainN||_out==MaterialOutput::PStrainM, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the membrane and flexural principle stresses.
std::enable_if< _out==MaterialOutput::Thickness, short_t >::type targetDim_impl() const
Implementation of targetDim for the thickness.
Definition gsMaterialMatrixEval.h:217
std::enable_if< _out==MaterialOutput::PStressTransform, void >::type eval_into_impl(const gsMatrix< T > &u, gsMatrix< T > &result) const
Specialisation of eval_into for the contravariant basis transformation.
std::enable_if< _out==MaterialOutput::PStressDir, short_t >::type targetDim_impl() const
Implementation of targetDim for principal stress directions.
Definition gsMaterialMatrixEval.h:178
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
#define short_t
Definition gsConfig.h:35
#define index_t
Definition gsConfig.h:32
#define GISMO_NO_IMPLEMENTATION
Definition gsDebug.h:129
Provides declaration of Function abstract interface.
Provides a container for material matrices for thin shells.
The G+Smo namespace, containing all definitions for the library.