Skip to content

Commit a51bae8

Browse files
committed
mark functions for depreciation, improve principle stretch computation
1 parent 6ba4ca8 commit a51bae8

File tree

5 files changed

+69
-2
lines changed

5 files changed

+69
-2
lines changed

src/gsMaterialMatrixBase.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class gsMaterialMatrixBase
196196
* @param[in] u The in-plane shell coordinates to be eveluated on
197197
* @param result The result
198198
*/
199+
GISMO_DEPRECATED
199200
virtual void pstretch_into(const index_t /*patch*/, const gsMatrix<T>& /*u*/, gsMatrix<T>& /*result*/) const
200201
{ GISMO_NO_IMPLEMENTATION; }
201202
/**
@@ -205,6 +206,7 @@ class gsMaterialMatrixBase
205206
* @param[in] u The in-plane shell coordinates to be eveluated on
206207
* @param result The result
207208
*/
209+
GISMO_DEPRECATED
208210
virtual void pstretchDir_into(const index_t /*patch*/, const gsMatrix<T>& /*u*/, gsMatrix<T>& /*result*/) const
209211
{ GISMO_NO_IMPLEMENTATION; }
210212
/**
@@ -214,6 +216,7 @@ class gsMaterialMatrixBase
214216
* @param[in] u The in-plane shell coordinates to be eveluated on
215217
* @param result The result
216218
*/
219+
GISMO_DEPRECATED
217220
virtual void pstress_into(const index_t /*patch*/, const gsMatrix<T>& /*u*/, gsMatrix<T>& /*result*/) const
218221
{ GISMO_NO_IMPLEMENTATION; }
219222
/**
@@ -223,6 +226,7 @@ class gsMaterialMatrixBase
223226
* @param[in] u The in-plane shell coordinates to be eveluated on
224227
* @param result The result
225228
*/
229+
GISMO_DEPRECATED
226230
virtual void pstressDir_into(const index_t /*patch*/, const gsMatrix<T>& /*u*/, gsMatrix<T>& /*result*/) const
227231
{ GISMO_NO_IMPLEMENTATION; }
228232
/**
@@ -242,6 +246,7 @@ class gsMaterialMatrixBase
242246
* @param[in] u The in-plane shell coordinates to be eveluated on
243247
* @param result The result
244248
*/
249+
GISMO_DEPRECATED
245250
virtual void parameters_into(const index_t /*patch*/, const gsMatrix<T>& /*u*/, gsMatrix<T>& /*result*/) const
246251
{ GISMO_NO_IMPLEMENTATION; }
247252

@@ -252,6 +257,7 @@ class gsMaterialMatrixBase
252257
* @param[in] u The in-plane shell coordinates to be eveluated on
253258
* @param result The result
254259
*/
260+
GISMO_DEPRECATED
255261
virtual void transform_into(const index_t /*patch*/, const gsMatrix<T>& /*u*/, gsMatrix<T>& /*result*/) const
256262
{ GISMO_NO_IMPLEMENTATION; }
257263

src/gsMaterialMatrixBaseDim.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ gsMatrix<T> gsMaterialMatrixBaseDim<dim,T>::eval3D_deformation(const index_t pat
178178
this->_computePoints(patch,u);
179179

180180
gsMatrix<T> result(9, u.cols() * z.rows());
181-
std::pair<gsVector<T>,gsMatrix<T>> res;
182181
index_t colIdx;
183182
for (index_t k=0; k!=u.cols(); k++)
184183
{

src/gsMaterialMatrixNonlinear.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ class gsMaterialMatrixNonlinear : public gsMaterialMatrixBaseDim<dim,T>
159159
/// See \ref gsMaterialMatrixBase for details
160160
gsMatrix<T> eval3D_CauchyVector(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z, enum MaterialOutput out = MaterialOutput::Generic) const override;
161161

162+
/// See \ref gsMaterialMatrixBase for details
163+
gsMatrix<T> eval3D_pstretch(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z) const override;
164+
162165
/// See \ref gsMaterialMatrixBase for details
163166
gsMatrix<T> eval3D_pstress(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z, enum MaterialOutput out = MaterialOutput::Generic) const override;
164167

@@ -569,6 +572,14 @@ class gsMaterialMatrixNonlinear : public gsMaterialMatrixBaseDim<dim,T>
569572
template<enum Material _mat, bool _com>
570573
typename std::enable_if<!_com && !(_mat==Material::SvK), gsMatrix<T>>::type _eval3D_pstress_impl(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z) const;
571574

575+
// Stretch overrides
576+
template<bool _com>
577+
typename std::enable_if<_com, gsMatrix<T>>::type
578+
eval3D_pstretch_impl(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z) const;
579+
template<bool _com>
580+
typename std::enable_if<!_com, gsMatrix<T>>::type
581+
eval3D_pstretch_impl(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z) const;
582+
572583
template<enum Material _mat>
573584
typename std::enable_if<_mat==Material::MR, void>::type _setRatio_impl(const gsFunctionSet<T> & Ratio);
574585
template<enum Material _mat>

src/gsMaterialMatrixNonlinear.hpp

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ template <bool _comp>
217217
typename std::enable_if<!_comp, void>::type
218218
gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::_pstretch_into_impl(const index_t patch, const gsMatrix<T>& u, gsMatrix<T>& result) const
219219
{
220+
gsDebugVar("AAAAA)");
220221
Base::pstretch_into(patch,u,result);
221222
}
222223

@@ -563,6 +564,56 @@ gsMatrix<T> gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::eval3D_CauchyVe
563564
return this->eval3D_CauchyStress(patch,u,z,out);
564565
}
565566

567+
template <short_t dim, class T, index_t matId, bool comp, enum Material mat, enum Implementation imp >
568+
gsMatrix<T> gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::eval3D_pstretch(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T> & z) const
569+
{
570+
return eval3D_pstretch_impl<comp>(patch,u,z);
571+
}
572+
573+
template <short_t dim, class T, index_t matId, bool comp, enum Material mat, enum Implementation imp >
574+
template <bool _comp>
575+
typename std::enable_if< _comp, gsMatrix<T>>::type
576+
gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::eval3D_pstretch_impl(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T> & z) const
577+
{
578+
this->_computePoints(patch,u);
579+
580+
gsMatrix<T> result(3, u.cols() * z.rows());
581+
std::pair<gsVector<T>,gsMatrix<T>> res;
582+
index_t colIdx;
583+
584+
gsMatrix<T> C33s = _eval3D_Compressible_C33(patch,u,z);
585+
T C33;
586+
587+
gsMatrix<T,3,3> c;
588+
for (index_t k=0; k!= u.cols(); k++)
589+
{
590+
for( index_t j=0; j < z.rows(); ++j ) // through-thickness points
591+
{
592+
colIdx = j*u.cols()+k;
593+
this->_getMetric(k, z(j, k) * m_data.mine().m_Tmat(0, k)); // on point i, on height z(0,j)
594+
595+
C33 = C33s(0,k);
596+
597+
// Compute c
598+
c.setZero();
599+
c.block(0,0,2,2) = m_data.mine().m_Gcov_def.block(0,0,2,2);
600+
c(2,2) = C33; // c33
601+
602+
res = this->_evalStretch(c,m_data.mine().m_gcon_ori);
603+
result.col(colIdx) = res.first;
604+
}
605+
}
606+
return result;
607+
}
608+
609+
template <short_t dim, class T, index_t matId, bool comp, enum Material mat, enum Implementation imp >
610+
template <bool _comp>
611+
typename std::enable_if<!_comp, gsMatrix<T>>::type
612+
gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::eval3D_pstretch_impl(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T> & z) const
613+
{
614+
return Base::eval3D_pstretch(patch,u,z);
615+
}
616+
566617
template <short_t dim, class T, index_t matId, bool comp, enum Material mat, enum Implementation imp >
567618
gsMatrix<T> gsMaterialMatrixNonlinear<dim,T,matId,comp,mat,imp>::eval3D_pstress(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T> & z, enum MaterialOutput out) const
568619
{

src/gsThinShellUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <gsUtils/gsPointGrid.h>
2727

2828
#include <gsAssembler/gsAssemblerOptions.h>
29-
#include <gsAssembler/gsExpressions.h>
29+
#include <gsExpressions/gsExpressions.h>
3030

3131

3232
# define MatExprType auto

0 commit comments

Comments
 (0)