24 template <
short_t dim,
class T>
25 class gsMaterialMatrixBaseDimData;
34 template <
short_t dim,
class T>
44 typedef typename Base::function_ptr function_ptr;
50 Base(
nullptr,
nullptr,
nullptr,
nullptr)
58 Base(mp,
nullptr,
nullptr,
nullptr)
60 GISMO_ASSERT(mp->
targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
68 Base(mp,mp_def,
nullptr,
nullptr)
70 GISMO_ASSERT(mp->
targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
71 GISMO_ASSERT(mp_def->
targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
80 Base(mp,
nullptr,thickness,Density)
82 GISMO_ASSERT(mp->
targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
92 Base(mp,mp_def,thickness,Density)
94 GISMO_ASSERT(mp->
targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
95 GISMO_ASSERT(mp_def->
targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
146 virtual bool initialized()
const override
148 return ((m_thickness !=
nullptr));
153 void _computePoints(
const index_t patch,
const gsMatrix<T> & u)
const;
236 std::pair<gsVector<T>,gsMatrix<T>>
_evalStretch(
const gsMatrix<T> & C,
const gsMatrix<T> & gcon_ori )
const;
239 std::pair<gsVector<T>,gsMatrix<T>>
_evalPStrain(
const gsMatrix<T> & C )
const;
242 std::pair<gsVector<T>,gsMatrix<T>>
_evalPStress(
const gsMatrix<T> & S )
const;
245 void _computeStretch(
const gsMatrix<T> & C,
const gsMatrix<T> & gcon_ori )
const;
255 gsMatrix<T>
_transformation(
const gsMatrix<T> & basis1,
const gsMatrix<T> & basis2 )
const;
257 virtual void setUndeformed(
const gsFunctionSet<T> * undeformed)
override
259 GISMO_ASSERT(undeformed->targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
261 Base::setUndeformed(f_ptr);
264 virtual void setDeformed(
const gsFunctionSet<T> * deformed)
override
266 GISMO_ASSERT(deformed->targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
268 Base::setDeformed(f_ptr);
271 virtual void setUndeformed(
const function_ptr undeformed)
override
273 GISMO_ASSERT(undeformed->targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
274 Base::setUndeformed(undeformed);
277 virtual void setDeformed(
const function_ptr deformed)
override
279 GISMO_ASSERT(deformed->targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
280 Base::setDeformed(deformed);
285 template <
short_t _type>
286 typename std::enable_if<_type==0, index_t>::type _tensionField(
const gsVector<T> &,
const gsVector<T> & Ep)
const;
288 template <
short_t _type>
289 typename std::enable_if<_type==1, index_t>::type _tensionField(
const gsVector<T> &,
const gsVector<T> & Ep)
const;
291 template <
short_t _type>
292 typename std::enable_if<_type==2, index_t>::type _tensionField(
const gsVector<T> &,
const gsVector<T> & Ep)
const;
294 template <
short_t _type>
295 typename std::enable_if<_type!=0 &&
297 _type!=2,
index_t>::type _tensionField(
const gsVector<T> &,
const gsVector<T> & Ep)
const
301 template<
short_t _dim>
305 template<
short_t _dim>
309 template<
short_t _dim>
313 template<
short_t _dim>
317 template<
short_t _dim>
320 template<
short_t _dim>
324 template<
short_t _dim>
328 template<
short_t _dim>
332 template<
short_t _dim>
336 template<
short_t _dim>
344 template<
short_t _dim>
348 template<
short_t _dim>
352 template<
short_t _dim>
356 template<
short_t _dim>
360 template<
short_t _dim>
364 template<
short_t _dim>
368 template<
short_t _dim>
372 template<
short_t _dim>
376 template<
short_t _dim>
380 template<
short_t _dim>
384 template<
short_t _dim>
388 template<
short_t _dim>
392 template<
short_t _dim>
396 template<
short_t _dim>
400 template<
short_t _dim>
404 template<
short_t _dim>
408 template<
short_t _dim>
412 template<
short_t _dim>
416 template<
short_t _dim>
420 template<
short_t _dim>
426 void membersSetZero()
428 m_data.mine().membersSetZero();
431 using Base::m_patches;
432 using Base::m_defpatches;
434 using Base::m_options;
437 using Base::m_thickness;
438 using Base::m_density;
441 mutable util::gsThreaded< gsMaterialMatrixBaseDimData<dim,T> > m_data;
444 # define Eigen gsEigen
445 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
449 template<
short_t dim,
class T>
450 class gsMaterialMatrixBaseDimData
454 void membersSetZero()
456 m_Acov_ori.setZero(); m_Acon_ori.setZero(); m_Acov_def.setZero(); m_Acon_def.setZero(); m_Bcov_ori.setZero(); m_Bcon_ori.setZero(); m_Bcov_def.setZero(); m_Bcon_def.setZero();
457 m_acov_ori.setZero(); m_acon_ori.setZero(); m_acov_def.setZero(); m_acon_def.setZero();
458 m_ncov_ori.setZero(); m_ncov_def.setZero();
459 m_Gcov_ori.setZero(); m_Gcon_ori.setZero(); m_Gcov_def.setZero(); m_Gcon_def.setZero(); m_Gcov_ori_L.setZero(); m_Gcov_def_L.setZero();
460 m_gcov_ori.setZero(); m_gcov_def.setZero();m_gcon_ori.setZero(); m_gcon_def.setZero();
461 m_Acov_ori_mat.setZero(); m_Acon_ori_mat.setZero(); m_Acov_def_mat.setZero(); m_Acon_def_mat.setZero(); m_Bcov_ori_mat.setZero(); m_Bcov_def_mat.setZero();
462 m_acov_ori_mat.setZero(); m_acon_ori_mat.setZero(); m_acov_def_mat.setZero(); m_acon_def_mat.setZero(); m_ncov_ori_mat.setZero(); m_ncov_def_mat.setZero(); m_normal_ori_mat.setZero(); m_normal_def_mat.setZero();
466 mutable gsMatrix<T> m_parmat;
467 mutable gsVector<T> m_parvals;
468 mutable gsMatrix<T> m_Tmat,m_rhomat;
470 mutable gsMatrix<T> m_Acov_ori, m_Acon_ori, m_Acov_def, m_Acon_def, m_Bcov_ori, m_Bcon_ori, m_Bcov_def, m_Bcon_def;
471 mutable gsMatrix<T> m_acov_ori, m_acon_ori, m_acov_def, m_acon_def;
472 mutable gsMatrix<T> m_ncov_ori, m_ncov_def;
473 mutable gsMatrix<T> m_Gcov_ori, m_Gcon_ori, m_Gcov_def, m_Gcon_def, m_Gcov_ori_L, m_Gcov_def_L;
474 mutable gsMatrix<T> m_gcov_ori, m_gcov_def,m_gcon_ori, m_gcon_def;
475 mutable gsMatrix<T> m_Acov_ori_mat, m_Acon_ori_mat, m_Acov_def_mat, m_Acon_def_mat, m_Bcov_ori_mat, m_Bcov_def_mat;
476 mutable gsMatrix<T> m_acov_ori_mat, m_acon_ori_mat, m_acov_def_mat, m_acon_def_mat, m_ncov_ori_mat, m_ncov_def_mat, m_normal_ori_mat, m_normal_def_mat;
478 mutable gsMatrix<T> m_stretches, m_stretchvec, m_pstress, m_pstressvec, m_pstrain, m_pstrainvec;
480 mutable T m_J0_sq, m_J_sq;
482 mutable gsVector<T> m_thetas, m_gammas;
484 # define Eigen gsEigen
485 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
486 # undef Eigen //must be present whenever the class contains fixed size matrices
489 #ifdef GISMO_WITH_PYBIND11
494 void pybind11_init_gsMaterialMatrixBaseDim2(pybind11::module &m);
495 void pybind11_init_gsMaterialMatrixBaseDim3(pybind11::module &m);
497 #endif // GISMO_WITH_PYBIND11
501 #ifndef GISMO_BUILD_LIB
502 #include GISMO_HPP_HEADER(gsMaterialMatrixBaseDim.hpp)
gsMatrix< T > _getAcon_def(index_t k, T z) const
Returns the contravariant a tensor on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:658
MaterialOutput
This class describes the output type.
Definition: gsMaterialMatrixUtils.h:98
std::enable_if< _dim==2, gsMatrix< T > >::type _getgcov_ori_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:969
gsMatrix< T > _getBcov_ori(index_t k, T z) const
Returns the covariant b tensor on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:739
virtual gsMatrix< T > eval3D_pstretchDir(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:222
shared_ptr< T > make_shared_not_owned(const T *x)
Creates a shared pointer which does not eventually delete the underlying raw pointer. Usefull to refer to objects which should not be destroyed.
Definition: gsMemory.h:189
virtual void defaultOptions() override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:38
void _computeMetricDeformed(const index_t patch, const gsMatrix< T > &u) const
Computes metric quantities on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:417
#define GISMO_NO_IMPLEMENTATION
Definition: gsDebug.h:129
std::pair< gsVector< T >, gsMatrix< T > > _evalStretch(const gsMatrix< T > &C, const gsMatrix< T > &gcon_ori) const
Computes the stretch given deformation tensor C, into a pair.
Definition: gsMaterialMatrixBaseDim.hpp:1331
gsMatrix< T > _getgcon_def(index_t k, T z) const
Returns the contravariant basis vector g on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:710
std::enable_if< _dim==2, gsMatrix< T > >::type _getGcov_def_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:837
gsMatrix< T > _getBcov_def(index_t k, T z) const
Returns the covariant b tensor on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:665
virtual gsMatrix< T > eval3D_pstretch(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:200
gsMatrix< T > _getAcon_ori(index_t k, T z) const
Returns the contravariant a tensor on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:732
virtual gsMatrix< T > eval3D_pstrain(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:244
virtual gsMatrix< T > eval3D_strain(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:271
gsMatrix< T > _getacon_def(index_t k, T z) const
Returns the contravariant basis vector a on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:697
gsMatrix< T > _getncov_def(index_t k, T z) const
Returns the covariant n tensor on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:671
virtual gsMatrix< T > eval3D_con2cart(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:137
gsMatrix< T > _getGcon_def(index_t k, T z) const
Returns the contravariant metric tensor on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:683
std::enable_if< _dim==2, gsMatrix< T > >::type _getGcon_ori_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
virtual gsMatrix< T > eval3D_spec2cov(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:72
gsMatrix< T > _getacon_ori(index_t k, T z) const
Returns the contravariant basis vector a on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:771
std::pair< gsVector< T >, gsMatrix< T > > _evalPStress(const gsMatrix< T > &S) const
Computes the principal stress given stress tensor S, into a pair.
Definition: gsMaterialMatrixBaseDim.hpp:1384
gsMatrix< T > _getGcov_ori(index_t k, T z) const
Returns the covariant metric tensor on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:751
std::enable_if< _dim==2, gsMatrix< T > >::type _getBcov_def_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:803
virtual void density_into(const index_t patch, const gsMatrix< T > &u, gsMatrix< T > &result) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:44
virtual gsMatrix< T > eval3D_cov2cart(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:116
#define index_t
Definition: gsConfig.h:32
std::enable_if< _dim==2, void >::type _computeMetricUndeformed_impl(const index_t patch, const gsMatrix< T > &u) const
Implementation of _getMetric for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:606
virtual void parameters_into(const index_t patch, const gsMatrix< T > &u, gsMatrix< T > &result) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:157
void _computePStrain(const gsMatrix< T > &C) const
Computes the stretch given deformation tensor C, into class members m_stretches and m_stretchDirs...
Definition: gsMaterialMatrixBaseDim.hpp:1492
gsMatrix< T > _getacov_def(index_t k, T z) const
Returns the covariant basis vector a on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:690
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
std::enable_if< _dim==2, gsMatrix< T > >::type _getGcon_def_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
This class defines the base class for material matrices.
Definition: gsMaterialMatrixBase.h:32
gsMatrix< T > _getgcov_def(index_t k, T z) const
Returns the covariant basis vector g on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:704
virtual short_t targetDim() const
Dimension of the target space.
Definition: gsFunctionSet.h:560
std::pair< gsVector< T >, gsMatrix< T > > _evalPStrain(const gsMatrix< T > &C) const
Computes the principal strain given deformation tensor C, into a pair.
Definition: gsMaterialMatrixBaseDim.hpp:1428
virtual void thickness_into(const index_t patch, const gsMatrix< T > &u, gsMatrix< T > &result) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:61
void _getMetricDeformed(const index_t k, const T z) const
Gets metric quantities on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:1073
std::enable_if< _dim==2, void >::type _computeMetricDeformed_impl(const index_t patch, const gsMatrix< T > &u) const
Implementation of _computeMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:488
virtual gsMatrix< T > eval3D_tensionfield(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:296
gsMatrix< T > _getGcon_ori(index_t k, T z) const
Returns the contravariant metric tensor on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:757
void _getMetricUndeformed(const index_t k, const T z) const
Gets metric quantities on the undeformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:1202
void _computeMetricUndeformed(const index_t patch, const gsMatrix< T > &u) const
Computes metric quantities on the undeformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:535
std::enable_if< _dim==2, void >::type _getMetricDeformed_impl(const index_t k, const T z) const
Implementation of _getMetricDeformed for surface geometries.
Definition: gsMaterialMatrixBaseDim.hpp:1141
Wrapper for thread-local data members.
std::enable_if< _dim==2, gsMatrix< T > >::type _getBcov_ori_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:901
std::enable_if< _dim==2, gsMatrix< T > >::type _getncov_def_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:820
std::enable_if< _dim==2, gsMatrix< T > >::type _getgcov_def_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:871
gsMatrix< T > _getAcov_ori(index_t k, T z) const
Returns the covariant a tensor on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:725
void _computePStress(const gsMatrix< T > &C) const
Computes the principal stresses of a given stress tensor S, into class members m_pstress and m_pstres...
Definition: gsMaterialMatrixBaseDim.hpp:1484
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23
This class defines the base class for material matrices.
Definition: gsMaterialMatrixBaseDim.h:35
gsMatrix< T > _transformation(const gsMatrix< T > &basis1, const gsMatrix< T > &basis2) const
Computes the stretch given deformation tensor C, into class members m_stretches and m_stretchDirs...
Definition: gsMaterialMatrixBaseDim.hpp:1502
void _computeStretch(const gsMatrix< T > &C, const gsMatrix< T > &gcon_ori) const
Computes the stretch given deformation tensor C, into class members m_stretches and m_stretchDirs...
Definition: gsMaterialMatrixBaseDim.hpp:1476
gsMatrix< T > _getgcov_ori(index_t k, T z) const
Returns the covariant basis vector g on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:778
gsMatrix< T > _getGcov_def(index_t k, T z) const
Returns the covariant metric tensor on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:677
virtual gsMatrix< T > eval3D_spec2con(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:94
std::enable_if< _dim==2, gsMatrix< T > >::type _getncov_ori_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:918
gsMatrix< T > _getacov_ori(index_t k, T z) const
Returns the covariant basis vector a on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:764
std::enable_if< _dim==2, void >::type _getMetricUndeformed_impl(const index_t k, const T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:1272
gsMatrix< T > _getAcov_def(index_t k, T z) const
Returns the covariant a tensor on the deformed geometry.
Definition: gsMaterialMatrixBaseDim.hpp:651
This object is a cache for computed values from an evaluator.
virtual ~gsMaterialMatrixBaseDim()
Destructor.
Definition: gsMaterialMatrixBaseDim.h:101
std::enable_if< _dim==2, gsMatrix< T > >::type _getGcov_ori_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
Definition: gsMaterialMatrixBaseDim.hpp:935
virtual gsMatrix< T > eval3D_deformation(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixBaseDim.hpp:176
std::enable_if< _dim==2, void >::type _getMetric_impl(const index_t k, const T z) const
Implementation of _getMetricDeformed for planar geometries.
gsMatrix< T > _getgcon_ori(index_t k, T z) const
Returns the contravariant basis vector g on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:784
gsMatrix< T > _getncov_ori(index_t k, T z) const
Returns the covariant n tensor on the original geometry.
Definition: gsMaterialMatrixBaseDim.hpp:745
void _getMetric(const index_t k, const T z) const
Gets metric quantities on the deformed and undeformed geometries.
Definition: gsMaterialMatrixBaseDim.hpp:1021