33 template <
class T, enum MaterialOutput out>
40 m_materialMat(materialMatrix)
42 m_materialMat->setDeformed(deformed);
47 template <
class T, enum MaterialOutput out>
55 m_materialMat(materialMatrix)
57 m_materialMat->setUndeformed(undeformed);
58 m_materialMat->setDeformed(deformed);
62 template <
class T, enum MaterialOutput out>
67 this->eval_into_impl<out>(u,result);
70 template <
class T, enum MaterialOutput out>
71 template <enum MaterialOutput _out>
72 typename std::enable_if<_out==MaterialOutput::Density, void>::type
75 m_materialMat->density_into(m_pIndex,u,result);
78 template <
class T, enum MaterialOutput out>
79 template <enum MaterialOutput _out>
80 typename std::enable_if<_out==MaterialOutput::VectorN ||
81 _out==MaterialOutput::CauchyVectorN,
void>::type
84 if (m_materialMat->isVecIntegrated() == MatIntegration::NotIntegrated)
85 this->integrateZ_into(u,getMoment(),result);
86 else if (m_materialMat->isVecIntegrated() == MatIntegration::Integrated)
87 result = this->_eval(u);
88 else if (m_materialMat->isVecIntegrated() == MatIntegration::Constant)
89 this->multiplyZ_into(u,0,result);
90 else if (m_materialMat->isVecIntegrated() == MatIntegration::Linear)
91 this->multiplyLinZ_into(u,getMoment(),result);
96 template <
class T, enum MaterialOutput out>
97 template <enum MaterialOutput _out>
98 typename std::enable_if<_out==MaterialOutput::VectorM ||
99 _out==MaterialOutput::CauchyVectorM,
void>::type
102 if (m_materialMat->isVecIntegrated() == MatIntegration::NotIntegrated)
103 this->integrateZ_into(u,getMoment(),result);
104 else if (m_materialMat->isVecIntegrated() == MatIntegration::Integrated)
105 result = this->_eval(u);
106 else if (m_materialMat->isVecIntegrated() == MatIntegration::Constant)
107 this->multiplyZ_into(u,2,result);
108 else if (m_materialMat->isVecIntegrated() == MatIntegration::Linear)
109 this->multiplyLinZ_into(u,getMoment(),result);
114 template <
class T, enum MaterialOutput out>
115 template <enum MaterialOutput _out>
116 typename std::enable_if< _out==MaterialOutput::MatrixA || _out==MaterialOutput::MatrixB
117 || _out==MaterialOutput::MatrixC || _out==MaterialOutput::MatrixD,
void>::type
120 if (m_materialMat->isMatIntegrated() == MatIntegration::NotIntegrated)
121 this->integrateZ_into(u,getMoment(),result);
122 else if (m_materialMat->isMatIntegrated() == MatIntegration::Integrated)
123 result = this->_eval(u);
124 else if (m_materialMat->isMatIntegrated() == MatIntegration::Constant)
125 this->multiplyZ_into(u,getMoment(),result);
126 else if (m_materialMat->isMatIntegrated() == MatIntegration::Linear)
127 this->multiplyLinZ_into(u,getMoment(),result);
132 template <
class T, enum MaterialOutput out>
133 template <enum MaterialOutput _out>
134 typename std::enable_if<_out==MaterialOutput::PStressN || _out==MaterialOutput::PStressM, void>::type
137 if (m_materialMat->isMatIntegrated() == MatIntegration::NotIntegrated)
138 this->integrateZ_into(u,getMoment(),result);
139 else if (m_materialMat->isMatIntegrated() == MatIntegration::Integrated)
140 result = this->_eval(u);
141 else if (m_materialMat->isMatIntegrated() == MatIntegration::Constant)
142 this->multiplyZ_into(u,getMoment(),result);
143 else if (m_materialMat->isMatIntegrated() == MatIntegration::Linear)
144 this->multiplyLinZ_into(u,getMoment(),result);
149 template <
class T, enum MaterialOutput out>
150 template <enum MaterialOutput _out>
151 typename std::enable_if<_out==MaterialOutput::PStrainN || _out==MaterialOutput::PStrainM, void>::type
154 if (m_materialMat->isMatIntegrated() == MatIntegration::NotIntegrated)
155 this->integrateZ_into(u,getMoment(),result);
156 else if (m_materialMat->isMatIntegrated() == MatIntegration::Integrated)
157 result = this->_eval(u);
158 else if (m_materialMat->isMatIntegrated() == MatIntegration::Constant)
159 this->multiplyZ_into(u,getMoment(),result);
160 else if (m_materialMat->isMatIntegrated() == MatIntegration::Linear)
161 this->multiplyLinZ_into(u,getMoment(),result);
166 template <
class T, enum MaterialOutput out>
167 template <enum MaterialOutput _out>
168 typename std::enable_if<_out==MaterialOutput::Stretch, void>::type
171 m_materialMat->stretch_into(m_pIndex,u,result);
174 template <
class T, enum MaterialOutput out>
175 template <enum MaterialOutput _out>
176 typename std::enable_if<_out==MaterialOutput::StretchDir, void>::type
179 m_materialMat->stretchDir_into(m_pIndex,u,result);
182 template <
class T, enum MaterialOutput out>
189 index_t numGauss = m_materialMat->options().askInt(
"NumGauss",4);
191 result.resize(this->targetDim(),u.cols());
201 m_materialMat->thickness_into(m_pIndex,u,Tmat);
204 for (
index_t k = 0; k != u.cols(); ++k)
211 gauss.
mapTo(-Thalf,Thalf,quNodes,quWeights);
213 z.col(k)=quNodes.transpose();
215 vals = this->_eval3D(u,z);
217 for (
index_t k = 0; k != u.cols(); ++k)
219 for (
index_t i=0; i!=this->targetDim(); ++i)
222 for (
index_t j = 0; j != numGauss; ++j)
223 res += w(j, k) * math::pow(z(j, k) * Tmat(0, k), moment) * vals(i, j * u.cols() + k) * Tmat(0, k);
235 template <
class T, enum MaterialOutput out>
240 result.resize(this->targetDim(),u.cols());
244 m_materialMat->thickness_into(m_pIndex,u,Tmat);
248 for (
index_t k = 0; k != u.cols(); ++k)
252 z.col(k)<<Thalf,-Thalf;
255 T fac = (moment % 2 == 0) ? 0. : 1.;
258 for (
index_t k = 0; k != u.cols(); ++k)
262 result.col(k) = 1.0/(moment+fac+1) *
263 ( math::pow( z(0,k) * Tmat(0, k), moment + 1) * vals.col(0*u.cols() + k)
264 - math::pow( z(1,k) * Tmat(0, k), moment + 1) * vals.col(1*u.cols() + k) );
269 template <
class T, enum MaterialOutput out>
274 result.resize(this->targetDim(),u.cols());
282 m_materialMat->thickness_into(m_pIndex,u,Tmat);
285 for (
index_t k = 0; k != u.cols(); ++k)
287 Thalf = Tmat(0, k) / 2.0;
288 fac = 2.0/(moment+1) * math::pow( Thalf , moment + 1);
289 result.col(k) = vals.col(k) * fac;
295 template <
class T, enum MaterialOutput out>
300 return this->_eval3D(u,Z);
303 template <
class T, enum MaterialOutput out>
306 return this->eval3D_impl<out>(u,Z);
309 template <
class T, enum MaterialOutput out>
310 template <enum MaterialOutput _out>
311 typename std::enable_if< _out==MaterialOutput::MatrixA || _out==MaterialOutput::MatrixB
312 || _out==MaterialOutput::MatrixC || _out==MaterialOutput::MatrixD,
gsMatrix<T>>::type
315 return m_materialMat->eval3D_matrix(m_pIndex,u,Z,_out);
318 template <
class T, enum MaterialOutput out>
319 template <enum MaterialOutput _out>
320 typename std::enable_if<_out==MaterialOutput::VectorN ||
324 return m_materialMat->eval3D_vector(m_pIndex,u,Z,_out);
327 template <
class T, enum MaterialOutput out>
328 template <enum MaterialOutput _out>
329 typename std::enable_if<_out==MaterialOutput::CauchyVectorN ||
330 _out==MaterialOutput::CauchyVectorM,
gsMatrix<T>>::type
333 return m_materialMat->eval3D_CauchyVector(m_pIndex,u,Z,_out);
337 template <
class T, enum MaterialOutput out>
338 template <enum MaterialOutput _out>
339 typename std::enable_if<_out==MaterialOutput::PStress ||
340 _out==MaterialOutput::PStressN ||
344 return m_materialMat->eval3D_pstress(m_pIndex,u,Z,_out);
Provides an evaluator for material matrices for thin shells.
void multiplyZ_into(const gsMatrix< T > &u, index_t moment, gsMatrix< T > &result) const
Multiplies the evaluation at z=0 with 2.0/(moment+1) * Thalf^(moment + 1)
Definition: gsMaterialMatrixIntegrate.hpp:270
void integrateZ_into(const gsMatrix< T > &u, const index_t moment, gsMatrix< T > &result) const
Integrates through-thickness using Gauss integration.
Definition: gsMaterialMatrixIntegrate.hpp:183
Provides the Gauss-Legendre quadrature rule.
gsMatrix< T > _eval(const gsMatrix< T > &u) const
Integrateuates the base class in 3D, but on Z=0.
Definition: gsMaterialMatrixIntegrate.hpp:296
#define index_t
Definition: gsConfig.h:32
This class defines the base class for material matrices.
Definition: gsMaterialMatrixBase.h:32
void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Implementation of eval_into, see gsFunction.
Definition: gsMaterialMatrixIntegrate.hpp:63
std::enable_if< _out==MaterialOutput::VectorN||_out==MaterialOutput::VectorM, gsMatrix< T > >::type eval3D_impl(const gsMatrix< T > &u, const gsMatrix< T > &Z) const
Specialisation of eval3D for vectors.
Definition: gsMaterialMatrixIntegrate.hpp:322
void multiplyLinZ_into(const gsMatrix< T > &u, const index_t moment, gsMatrix< T > &result) const
Uses the top and bottom parts of the thickness to compute the integral exactly.
Definition: gsMaterialMatrixIntegrate.hpp:236
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23
virtual void mapTo(const gsVector< T > &lower, const gsVector< T > &upper, gsMatrix< T > &nodes, gsVector< T > &weights) const
Maps quadrature rule (i.e., points and weights) from the reference domain to an element.
Definition: gsQuadRule.h:177
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: gsMaterialMatrixIntegrate.hpp:73
This class serves as the integrator of material matrices, based on gsMaterialMatrixBase.
Definition: gsMaterialMatrixIntegrate.h:24
#define GISMO_ERROR(message)
Definition: gsDebug.h:118
gsMatrix< T > _eval3D(const gsMatrix< T > &u, const gsMatrix< T > &Z) const
Integrateuates the base class in 3D.
Definition: gsMaterialMatrixIntegrate.hpp:304
Class that represents the (tensor) Gauss-Legendre quadrature rule.
Definition: gsGaussRule.h:27