25template <
short_t dim,
class T>
26class gsMaterialMatrixBaseDimData;
35template <
short_t dim,
class T>
45 typedef typename Base::function_ptr function_ptr;
51 Base(
nullptr,
nullptr,
nullptr,
nullptr)
59 Base(mp,
nullptr,
nullptr,
nullptr)
61 GISMO_ASSERT(mp->targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
69 Base(mp,mp_def,
nullptr,
nullptr)
71 GISMO_ASSERT(mp->targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
72 GISMO_ASSERT(mp_def->
targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
81 Base(mp,
nullptr,thickness,Density)
83 GISMO_ASSERT(mp->targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
93 Base(mp,mp_def,thickness,Density)
95 GISMO_ASSERT(mp->targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
96 GISMO_ASSERT(mp_def->
targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
149 virtual bool initialized()
const override
151 return ((m_thickness !=
nullptr));
156 void _computePoints(
const index_t patch,
const gsMatrix<T> & u)
const;
239 std::pair<gsVector<T>,gsMatrix<T>>
_evalStretch(
const gsMatrix<T> & C,
const gsMatrix<T> & gcon_ori )
const;
242 std::pair<gsVector<T>,gsMatrix<T>>
_evalPStrain(
const gsMatrix<T> & C )
const;
245 std::pair<gsVector<T>,gsMatrix<T>>
_evalPStress(
const gsMatrix<T> & S )
const;
248 void _computeStretch(
const gsMatrix<T> & C,
const gsMatrix<T> & gcon_ori )
const;
258 gsMatrix<T>
_transformation(
const gsMatrix<T> & basis1,
const gsMatrix<T> & basis2 )
const;
260 virtual void setUndeformed(
const gsFunctionSet<T> * undeformed)
override
262 GISMO_ASSERT(undeformed->targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
264 Base::setUndeformed(f_ptr);
267 virtual void setDeformed(
const gsFunctionSet<T> * deformed)
override
269 GISMO_ASSERT(deformed->targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
271 Base::setDeformed(f_ptr);
274 virtual void setUndeformed(
const function_ptr undeformed)
override
276 GISMO_ASSERT(undeformed->targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
277 Base::setUndeformed(undeformed);
280 virtual void setDeformed(
const function_ptr deformed)
override
282 GISMO_ASSERT(deformed->targetDim()==dim,
"Geometric dimension and the template dimension are not the same!");
283 Base::setDeformed(deformed);
288 template <
short_t _type>
289 typename std::enable_if<_type==0, index_t>::type _tensionField(
const gsVector<T> &,
const gsVector<T> & Ep)
const;
291 template <
short_t _type>
292 typename std::enable_if<_type==1, index_t>::type _tensionField(
const gsVector<T> &,
const gsVector<T> & Ep)
const;
294 template <
short_t _type>
295 typename std::enable_if<_type==2, index_t>::type _tensionField(
const gsVector<T> &,
const gsVector<T> & Ep)
const;
297 template <
short_t _type>
298 typename std::enable_if<_type!=0 &&
300 _type!=2,
index_t>::type _tensionField(
const gsVector<T> &,
const gsVector<T> & Ep)
const
304 template<
short_t _dim>
308 template<
short_t _dim>
312 template<
short_t _dim>
316 template<
short_t _dim>
320 template<
short_t _dim>
323 template<
short_t _dim>
327 template<
short_t _dim>
331 template<
short_t _dim>
335 template<
short_t _dim>
339 template<
short_t _dim>
347 template<
short_t _dim>
351 template<
short_t _dim>
355 template<
short_t _dim>
359 template<
short_t _dim>
363 template<
short_t _dim>
367 template<
short_t _dim>
371 template<
short_t _dim>
375 template<
short_t _dim>
379 template<
short_t _dim>
383 template<
short_t _dim>
387 template<
short_t _dim>
391 template<
short_t _dim>
395 template<
short_t _dim>
399 template<
short_t _dim>
403 template<
short_t _dim>
407 template<
short_t _dim>
411 template<
short_t _dim>
415 template<
short_t _dim>
419 template<
short_t _dim>
423 template<
short_t _dim>
429 void membersSetZero()
431 m_data.mine().membersSetZero();
434 using Base::m_patches;
435 using Base::m_defpatches;
437 using Base::m_options;
440 using Base::m_thickness;
441 using Base::m_density;
444 mutable util::gsThreaded< gsMaterialMatrixBaseDimData<dim,T> > m_data;
447# define Eigen gsEigen
448 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
452template<
short_t dim,
class T>
453class gsMaterialMatrixBaseDimData
457 void membersSetZero()
459 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();
460 m_acov_ori.setZero(); m_acon_ori.setZero(); m_acov_def.setZero(); m_acon_def.setZero();
461 m_ncov_ori.setZero(); m_ncov_def.setZero();
462 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();
463 m_gcov_ori.setZero(); m_gcov_def.setZero();m_gcon_ori.setZero(); m_gcon_def.setZero();
464 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();
465 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();
469 mutable gsMatrix<T> m_parmat;
470 mutable gsVector<T> m_parvals;
471 mutable gsMatrix<T> m_Tmat,m_rhomat;
473 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;
474 mutable gsMatrix<T> m_acov_ori, m_acon_ori, m_acov_def, m_acon_def;
475 mutable gsMatrix<T> m_ncov_ori, m_ncov_def;
476 mutable gsMatrix<T> m_Gcov_ori, m_Gcon_ori, m_Gcov_def, m_Gcon_def, m_Gcov_ori_L, m_Gcov_def_L;
477 mutable gsMatrix<T> m_gcov_ori, m_gcov_def,m_gcon_ori, m_gcon_def;
478 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;
479 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;
481 mutable gsMatrix<T> m_stretches, m_stretchvec, m_pstress, m_pstressvec, m_pstrain, m_pstrainvec;
483 mutable T m_J0_sq, m_J_sq;
485 mutable gsVector<T> m_thetas, m_gammas;
487# define Eigen gsEigen
488 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
492#ifdef GISMO_WITH_PYBIND11
497 void pybind11_init_gsMaterialMatrixBaseDim2(pybind11::module &m);
498 void pybind11_init_gsMaterialMatrixBaseDim3(pybind11::module &m);
504#ifndef GISMO_BUILD_LIB
505#include GISMO_HPP_HEADER(gsMaterialMatrixBaseDim.hpp)
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition gsFunctionSet.h:219
virtual short_t targetDim() const
Dimension of the target space.
Definition gsFunctionSet.h:595
This class defines the base class for material matrices.
Definition gsMaterialMatrixBaseDim.h:37
void _computeMetricUndeformed(const index_t patch, const gsMatrix< T > &u) const
Computes metric quantities on the undeformed geometry.
Definition gsMaterialMatrixBaseDim.hpp:535
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 > _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 _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 > _getncov_def(index_t k, T z) const
Returns the covariant n tensor on the deformed geometry.
Definition gsMaterialMatrixBaseDim.hpp:671
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:543
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==3, void >::type _computeMetricDeformed_impl(const index_t patch, const gsMatrix< T > &u) const
Implementation of _computeMetricUndeformed for surface geometries.
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 > _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:90
gsMatrix< T > _getBcov_def(index_t k, T z) const
Returns the covariant b tensor on the deformed geometry.
Definition gsMaterialMatrixBaseDim.hpp:665
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:425
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
virtual void density_into(const index_t patch, const gsMatrix< T > &u, gsMatrix< T > &result) const override
See gsMaterialMatrixBase for details.
Definition gsMaterialMatrixBaseDim.hpp:40
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
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
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, void >::type _getMetricDeformed_impl(const index_t k, const T z) const
Implementation of _getMetricDeformed for surface geometries.
Definition gsMaterialMatrixBaseDim.hpp:1081
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
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_con2cart(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition gsMaterialMatrixBaseDim.hpp:135
gsMatrix< T > _getgcon_def(index_t k, T z) const
Returns the contravariant basis vector g on the deformed geometry.
Definition gsMaterialMatrixBaseDim.hpp:710
gsMatrix< T > _getacov_def(index_t k, T z) const
Returns the covariant basis vector a on the deformed geometry.
Definition gsMaterialMatrixBaseDim.hpp:690
gsMatrix< T > _getgcon_ori(index_t k, T z) const
Returns the contravariant basis vector g on the original geometry.
Definition gsMaterialMatrixBaseDim.hpp:784
void _computeMetricDeformed(const index_t patch, const gsMatrix< T > &u) const
Computes metric quantities on the deformed geometry.
Definition gsMaterialMatrixBaseDim.hpp:417
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
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 > _getBcov_ori(index_t k, T z) const
Returns the covariant b tensor on the original geometry.
Definition gsMaterialMatrixBaseDim.hpp:739
gsMatrix< T > _getacon_ori(index_t k, T z) const
Returns the contravariant basis vector a on the original geometry.
Definition gsMaterialMatrixBaseDim.hpp:771
virtual void defaultOptions() override
See gsMaterialMatrixBase for details.
Definition gsMaterialMatrixBaseDim.hpp:34
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 > _getacov_ori(index_t k, T z) const
Returns the covariant basis vector a on the original geometry.
Definition gsMaterialMatrixBaseDim.hpp:764
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
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
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
gsMatrix< T > _getAcov_def(index_t k, T z) const
Returns the covariant a tensor on the deformed geometry.
Definition gsMaterialMatrixBaseDim.hpp:651
gsMatrix< T > _getgcov_ori(index_t k, T z) const
Returns the covariant basis vector g on the original geometry.
Definition gsMaterialMatrixBaseDim.hpp:778
virtual ~gsMaterialMatrixBaseDim()
Destructor.
Definition gsMaterialMatrixBaseDim.h:102
gsMatrix< T > _getgcov_def(index_t k, T z) const
Returns the covariant basis vector g on the deformed geometry.
Definition gsMaterialMatrixBaseDim.hpp:704
gsMatrix< T > _getGcon_ori(index_t k, T z) const
Returns the contravariant metric tensor on the original geometry.
Definition gsMaterialMatrixBaseDim.hpp:757
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
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 void thickness_into(const index_t patch, const gsMatrix< T > &u, gsMatrix< T > &result) const override
See gsMaterialMatrixBase for details.
Definition gsMaterialMatrixBaseDim.hpp:57
std::enable_if< _dim==2, gsMatrix< T > >::type _getGcon_def_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
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
gsMatrix< T > _getAcov_ori(index_t k, T z) const
Returns the covariant a tensor on the original geometry.
Definition gsMaterialMatrixBaseDim.hpp:725
std::enable_if< _dim==3, void >::type _getMetricUndeformed_impl(const index_t k, const T z) const
Implementation of _getMetricUndeformed for surface geometries.
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:112
std::enable_if< _dim==2, gsMatrix< T > >::type _getGcon_ori_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for planar geometries.
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
std::enable_if< _dim==3, gsMatrix< T > >::type _getGcon_def_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for surface geometries.
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:1210
gsMatrix< T > _getncov_ori(index_t k, T z) const
Returns the covariant n tensor on the original geometry.
Definition gsMaterialMatrixBaseDim.hpp:745
std::enable_if< _dim==3, void >::type _computeMetricUndeformed_impl(const index_t patch, const gsMatrix< T > &u) const
Implementation of _getMetric for surface geometries.
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
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:68
void _getMetricUndeformed(const index_t k, const T z) const
Gets metric quantities on the undeformed geometry.
Definition gsMaterialMatrixBaseDim.hpp:1202
std::enable_if< _dim==3, void >::type _getMetricDeformed_impl(const index_t k, const T z) const
Implementation of _getMetricDeformed for surface geometries.
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
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
gsMatrix< T > _getAcon_def(index_t k, T z) const
Returns the contravariant a tensor on the deformed geometry.
Definition gsMaterialMatrixBaseDim.hpp:658
void _getMetric(const index_t k, const T z) const
Gets metric quantities on the deformed and undeformed geometries.
Definition gsMaterialMatrixBaseDim.hpp:1021
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
std::enable_if< _dim==3, gsMatrix< T > >::type _getGcon_ori_impl(index_t k, T z) const
Implementation of _getMetricUndeformed for surface geometries.
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
gsMatrix< T > _getacon_def(index_t k, T z) const
Returns the contravariant basis vector a on the deformed geometry.
Definition gsMaterialMatrixBaseDim.hpp:697
This class defines the base class for material matrices.
Definition gsMaterialMatrixBase.h:33
virtual gsMatrix< T > eval3D_strain(const index_t, const gsMatrix< T > &, const gsMatrix< T > &) const
{ function_description }
Definition gsMaterialMatrixBase.h:530
virtual gsMatrix< T > eval3D_tensionfield(const index_t, const gsMatrix< T > &, const gsMatrix< T > &, enum MaterialOutput) const
to do
Definition gsMaterialMatrixBase.h:601
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
MaterialOutput
This class describes the output type.
Definition gsMaterialMatrixUtils.h:99
#define index_t
Definition gsConfig.h:32
#define GISMO_NO_IMPLEMENTATION
Definition gsDebug.h:129
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
This object is a cache for computed values from an evaluator.
Provides a base class for material matrices.
Wrapper for thread-local data members.
shared_ptr< T > make_shared_not_owned(const T *x)
Creates a shared pointer which does not eventually delete the underlying raw pointer....
Definition gsMemory.h:189
The G+Smo namespace, containing all definitions for the library.