G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsMaterialMatrixTFT.h
Go to the documentation of this file.
1 
16 #pragma once
17 
21 
22 namespace gismo
23 {
24 
25 
35 template < short_t dim,
36  class T,
37  bool linear=false
38  >
40 {
41 public:
43  typedef memory::shared_ptr< gsMaterialMatrixTFT > Ptr;
44 
46  typedef memory::unique_ptr< gsMaterialMatrixTFT > uPtr;
47 
50 
53 
56 
57  // Define clone functions
58  GISMO_OVERRIDE_CLONE_FUNCTION(gsMaterialMatrixTFT)
59 
60 public:
61 
68  :
69  gsMaterialMatrixTFT(memory::make_shared_not_owned(materialMatrix))
70  {}
71 
78  :
79  gsMaterialMatrixTFT(memory::make_shared(materialMatrix.clone().release()))
80  {}
81 
87  gsMaterialMatrixTFT(const material_ptr & materialMatrix)
88  :
89  m_materialMat(give(materialMatrix))
90  {
91  if (materialMatrix.get()->hasUndeformed())
92  this->setUndeformed(materialMatrix.get()->getUndeformed());
93  if (materialMatrix.get()->hasDeformed())
94  this->setDeformed(materialMatrix.get()->getDeformed());
95 
96  this->setThickness(materialMatrix.get()->getThickness());
97 
98  m_options.addReal("SlackMultiplier","Multiplies the original value of the matrix for the slack state",0);
99  m_options.addSwitch("Explicit","Explicit iterations; use tension field from a fixed deformed geometry that does not change when calling setDeformed",false);
100  }
101 
104  inline enum MatIntegration isMatIntegrated() const override
105  // {return m_materialMat->isMatIntegrated(); gsWarn<<"Change this to a constant one, like for linear. So that no things out of the mid-plane are needed"; }
106  {return MatIntegration::Linear;} // Multiplies with z t or its moment
107 
110  inline enum MatIntegration isVecIntegrated() const override
111  // {return m_materialMat->isVecIntegrated(); gsWarn<<"Change this to a constant one, like for linear. So that no things out of the mid-plane are needed"; }
112  {return MatIntegration::Linear;} // Multiplies with z t or its moment
113 
114  // bool isLinear() { return isLinear_impl(); }
115  // typename util::enable_if<U::Linear,bool>::type
116  // eval_impl(const U & u, const index_t k)
117  // { return m_materialMat; }
118 
120  void density_into(const index_t patch, const gsMatrix<T>& u, gsMatrix<T>& result) const override
121  { m_materialMat->density_into( patch,u,result ); }
122 
124  void thickness_into(const index_t patch, const gsMatrix<T> & u, gsMatrix<T>& result) const override
125  { m_materialMat->thickness_into( patch,u,result ); }
126 
128  gsMatrix<T> eval3D_matrix(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z, enum MaterialOutput out = MaterialOutput::Generic) const override;
129 
131  gsMatrix<T> eval3D_vector(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z, enum MaterialOutput out = MaterialOutput::Generic) const override;
132 
142  gsMatrix<T> eval3D_pstress(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z, enum MaterialOutput out = MaterialOutput::Generic) const override;
143 
145  gsMatrix<T> eval3D_pstrain(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z) const override;
146 
148  gsMatrix<T> eval3D_strain(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T> & z) const override;
149 
151  gsMatrix<T> eval3D_stress(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T> & z, enum MaterialOutput out) const override;
152 
154  gsMatrix<T> eval3D_CauchyStress(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T> & z, enum MaterialOutput out) const override;
155 
157  gsMatrix<T> eval3D_CauchyPStress(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T> & z, enum MaterialOutput out) const override
158  {return m_materialMat->eval3D_CauchyPStress(patch,u,z,out);}
159 
161  gsMatrix<T> eval3D_tensionfield(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z, enum MaterialOutput out = MaterialOutput::Generic) const override;
162 
164  gsMatrix<T> eval3D_theta(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z, enum MaterialOutput out = MaterialOutput::Generic) const override;
165 
167  gsMatrix<T> eval3D_gamma(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z, enum MaterialOutput out = MaterialOutput::Generic) const override;
168 
170  gsMatrix<T> eval3D_pstretch(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z) const override
171  { return m_materialMat->eval3D_pstretch( patch,u,z ); }
172 
174  gsMatrix<T> eval3D_pstretchDir(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z) const override
175  { return m_materialMat->eval3D_pstretchDir( patch,u,z ); }
176 
178  void setParameters(const std::vector<gsFunctionSet<T>*> &pars) override
179  { m_materialMat->setParameters(pars); }
180 
182  void info() const override
183  { m_materialMat->info(); }
184 
186  void setUndeformed(function_ptr undeformed) override
187  {
188  Base::setUndeformed(undeformed);
189  m_materialMat->setUndeformed(m_patches);
190  }
191 
193  void setDeformed(function_ptr deformed) override
194  {
195  Base::setDeformed(deformed);
196  m_materialMat->setDeformed(m_defpatches);
197  }
198 
200  void setUndeformed(const gsFunctionSet<T> * undeformed) override
201  {
202  Base::setUndeformed(undeformed);
203  m_materialMat->setUndeformed(m_patches);
204  }
205 
207  void setDeformed(const gsFunctionSet<T> * deformed) override
208  {
209  Base::setDeformed(deformed);
210  m_materialMat->setDeformed(m_defpatches);
211  }
212 
214  void updateDeformed(const gsFunctionSet<T> * deformed)
215  {
216  function_ptr fun = memory::make_shared_not_owned(deformed);
217  m_defpatches0 = fun;
218  }
219 
221  void updateDeformed(const function_ptr & deformed)
222  {
223  m_defpatches0 = deformed;
224  }
225 
227  gsMatrix<T> eval_theta(const gsMatrix<T> & Cs, const gsMatrix<T> & Ns, const gsMatrix<T> & Es) const;
228 
230  std::ostream &print(std::ostream &os) const override;
231 
233  const gsMaterialMatrixBase<T> * material() const override { return m_materialMat.get(); }
234 
236  gsMaterialMatrixBase<T> * material() override { return m_materialMat.get(); }
237 
238 protected:
239  template <bool _linear>
240  typename std::enable_if< _linear, gsMatrix<T> >::type _eval3D_matrix_impl(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z, enum MaterialOutput out = MaterialOutput::Generic) const;
241 
242  template <bool _linear>
243  typename std::enable_if<!_linear, gsMatrix<T> >::type _eval3D_matrix_impl(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T>& z, enum MaterialOutput out = MaterialOutput::Generic) const;
244 
245  gsMatrix<T> _compute_TF(const index_t patch, const gsMatrix<T> & u, const gsMatrix<T> & z) const;
246  gsMatrix<T> _compute_TF(const index_t patch, const gsVector<T> & u, const T & z) const;
247 
248  gsMatrix<T> _compute_E(const T theta, const gsMatrix<T> & C, const gsMatrix<T> & S, const gsMatrix<T> & E) const;
249 
250  gsMatrix<T> _compute_S(const T theta, const gsMatrix<T> & C, const gsMatrix<T> & S) const;
251 
252  gsMatrix<T> _compute_C(const T theta, const gsMatrix<T> & C, const gsMatrix<T> & S) const;
253 
254  gsMatrix<T> _compute_C(const T theta, const gsMatrix<T> & C, const gsMatrix<T> & S, const gsMatrix<T> & dC) const;
255 
256 
257  T _compute_gamma(const T & theta, const gsMatrix<T> & C, const gsVector<T> & N, const gsVector<T> & E) const;
258  gsVector<T> _theta_interval(const gsMatrix<T> & C, const gsVector<T> & N, const gsVector<T> & E) const;
259  bool _check_theta_full(const T & theta, const gsMatrix<T> & C, const gsVector<T> & N, const gsVector<T> & E) const;
260  bool _check_theta_gamma(const T & theta, const gsMatrix<T> & C, const gsVector<T> & N, const gsVector<T> & E) const;
261 
262 protected:
263 
264  mutable material_ptr m_materialMat;
265  using Base::m_patches;
266  using Base::m_defpatches;
267  function_ptr m_defpatches0;
268  using Base::m_options;
269 
270  using Base::m_data;
271 
272 };
273 
274 } // namespace
275 
276 
277 #ifndef GISMO_BUILD_LIB
278 #include GISMO_HPP_HEADER(gsMaterialMatrixTFT.hpp)
279 #endif
MaterialOutput
This class describes the output type.
Definition: gsMaterialMatrixUtils.h:98
gsMatrix< T > eval3D_stress(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.hpp:162
enum MatIntegration isVecIntegrated() const override
Definition: gsMaterialMatrixTFT.h:110
void updateDeformed(const function_ptr &deformed)
Updates the reference to the deformed patches used for TFT (explicit only)
Definition: gsMaterialMatrixTFT.h:221
memory::unique_ptr< gsMaterialMatrixTFT > uPtr
Unique pointer for gsMaterialMatrixTFT.
Definition: gsMaterialMatrixTFT.h:46
const gsMaterialMatrixBase< T > * material() const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.h:233
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
std::vector< T * > release(std::vector< unique_ptr< T > > &cont)
Takes a vector of smart pointers, releases them and returns the corresponding raw pointers...
Definition: gsMemory.h:228
gsMaterialMatrixBase< T >::Ptr material_ptr
Shared pointer to a gsMaterialMatrixBase.
Definition: gsMaterialMatrixTFT.h:49
enum MatIntegration isMatIntegrated() const override
Definition: gsMaterialMatrixTFT.h:104
gsMatrix< T > eval3D_strain(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.hpp:124
#define short_t
Definition: gsConfig.h:35
gsMatrix< T > eval3D_CauchyStress(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.hpp:206
gsMatrix< T > eval3D_CauchyPStress(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.h:157
S give(S &x)
Definition: gsMemory.h:266
gsMatrix< T > eval3D_pstress(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
Definition: gsMaterialMatrixTFT.hpp:68
#define index_t
Definition: gsConfig.h:32
std::ostream & print(std::ostream &os) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.hpp:36
void density_into(const index_t patch, const gsMatrix< T > &u, gsMatrix< T > &result) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.h:120
void setUndeformed(function_ptr undeformed) override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.h:186
memory::shared_ptr< gsMaterialMatrixTFT > Ptr
Shared pointer for gsMaterialMatrixTFT.
Definition: gsMaterialMatrixTFT.h:43
This class defines the base class for material matrices.
Definition: gsMaterialMatrixBase.h:32
gsMatrix< T > eval3D_pstretchDir(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.h:174
Base class with dimension in template; used for metric computations.
memory::shared_ptr< gsFunctionSet > Ptr
Shared pointer for gsFunctionSet.
Definition: gsFunctionSet.h:223
void setUndeformed(const gsFunctionSet< T > *undeformed) override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.h:200
gsMatrix< T > eval_theta(const gsMatrix< T > &Cs, const gsMatrix< T > &Ns, const gsMatrix< T > &Es) const
Computes theta.
Definition: gsMaterialMatrixTFT.hpp:462
gsMatrix< T > eval3D_pstrain(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.hpp:96
gsMaterialMatrixTFT(const material_ptr &materialMatrix)
Constructs a TFT material matrix using a reference to another material matrix.
Definition: gsMaterialMatrixTFT.h:87
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23
gsMatrix< T > eval3D_theta(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.hpp:311
This class defines a linear material.
Definition: gsMaterialMatrixTFT.h:39
std::enable_if< _linear, gsMatrix< T > >::type _eval3D_matrix_impl(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const
Provides an implementation of eval3D_matrix for gsMaterialMatrixLinear.
Definition: gsMaterialMatrixTFT.hpp:378
Provides material matrix utilities.
gsMatrix< T > eval3D_gamma(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.hpp:343
void info() const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.h:182
This class defines the base class for material matrices.
Definition: gsMaterialMatrixBaseDim.h:35
gsMatrix< T > eval3D_matrix(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.hpp:49
gsMatrix< T > eval3D_tensionfield(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.hpp:305
void addReal(const std::string &label, const std::string &desc, const Real &value)
Adds a option named label, with description desc and value value.
Definition: gsOptionList.cpp:211
void thickness_into(const index_t patch, const gsMatrix< T > &u, gsMatrix< T > &result) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.h:124
gsMaterialMatrixTFT(gsMaterialMatrixBase< T > &materialMatrix)
Constructs a TFT material matrix using a reference to another material matrix.
Definition: gsMaterialMatrixTFT.h:77
Provides a base class for material matrices.
void setParameters(const std::vector< gsFunctionSet< T > * > &pars) override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.h:178
gsMatrix< T > eval3D_vector(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z, enum MaterialOutput out=MaterialOutput::Generic) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.hpp:62
memory::shared_ptr< gsMaterialMatrixBase > Ptr
Shared pointer for gsGeometry.
Definition: gsMaterialMatrixBase.h:41
void addSwitch(const std::string &label, const std::string &desc, const bool &value)
Adds a option named label, with description desc and value value.
Definition: gsOptionList.cpp:235
MatIntegration
This class describes if an object is integrated through-thickness or not.
Definition: gsMaterialMatrixUtils.h:35
void setDeformed(const gsFunctionSet< T > *deformed) override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.h:207
void updateDeformed(const gsFunctionSet< T > *deformed)
Updates the reference to the deformed patches used for TFT (explicit only)
Definition: gsMaterialMatrixTFT.h:214
gsMaterialMatrixBase< T > * material() override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.h:236
void setDeformed(function_ptr deformed) override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.h:193
gsMatrix< T > eval3D_pstretch(const index_t patch, const gsMatrix< T > &u, const gsMatrix< T > &z) const override
See gsMaterialMatrixBase for details.
Definition: gsMaterialMatrixTFT.h:170
virtual void setThickness(const function_ptr &thickness)
Sets the thickness.
Definition: gsMaterialMatrixBase.h:650
gsFunctionSet< T >::Ptr function_ptr
Shared pointer to a gsFunctionSet.
Definition: gsMaterialMatrixTFT.h:55
shared_ptr< T > make_shared(T *x)
Definition: gsMemory.h:181