v0.14.0
SpringElement.hpp
Go to the documentation of this file.
1 /** \file SpringElements.hpp
2  \brief Header file for spring element implementation
3 */
4 
5 
6 
7 #ifndef __SPRINGELEMENT_HPP__
8 #define __SPRINGELEMENT_HPP__
9 
13 using FaceDataOperator =
15 /** \brief Set of functions declaring elements and setting operators
16  * to apply spring boundary condition
17  */
18 
19 struct MetaSpringBC {
21  int iD;
22 
25 
27 
30  };
31 
33  : public boost::enable_shared_from_this<DataAtIntegrationPtsSprings> {
34 
35  boost::shared_ptr<MatrixDouble> gradDispPtr =
36  boost::make_shared<MatrixDouble>();
37  boost::shared_ptr<MatrixDouble> xAtPts = boost::make_shared<MatrixDouble>();
38  boost::shared_ptr<MatrixDouble> xInitAtPts =
39  boost::make_shared<MatrixDouble>();
40 
41  boost::shared_ptr<MatrixDouble> hMat = boost::make_shared<MatrixDouble>();
42  boost::shared_ptr<MatrixDouble> FMat = boost::make_shared<MatrixDouble>();
43  boost::shared_ptr<MatrixDouble> HMat = boost::make_shared<MatrixDouble>();
44  boost::shared_ptr<MatrixDouble> invHMat =
45  boost::make_shared<MatrixDouble>();
46  boost::shared_ptr<VectorDouble> detHVec =
47  boost::make_shared<VectorDouble>();
48 
52 
56 
58 
60 
61  std::map<int, BlockOptionDataSprings> mapSpring;
62  // ~DataAtIntegrationPtsSprings() {}
63  DataAtIntegrationPtsSprings(MoFEM::Interface &m_field, double scale_stiffness = 1.)
64  : mField(m_field), faceRowData(nullptr), scaleStiffness(scale_stiffness) {
65 
66  ierr = setBlocks();
67  CHKERRABORT(PETSC_COMM_WORLD, ierr);
68  }
69 
71  MoFEMFunctionBegin; // They will be overwritten by BlockData
72  CHKERR PetscOptionsBegin(PETSC_COMM_WORLD, "", "Problem", "none");
73 
74  ierr = PetscOptionsEnd();
75  CHKERRQ(ierr);
77  }
78 
81 
84 
86  }
87 
90 
92  if (bit->getName().compare(0, 9, "SPRING_BC") == 0) {
93 
94  const int id = bit->getMeshsetId();
95  mapSpring[id].tRis.clear();
96  CHKERR mField.get_moab().get_entities_by_dimension(
97  bit->getMeshset(), 2, mapSpring[id].tRis, true);
98 
99  std::vector<double> attributes;
100  bit->getAttributes(attributes);
101  if (attributes.size() < 2) {
102  SETERRQ1(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID,
103  "Springs should have 2 attributes but there is %d",
104  attributes.size());
105  }
106  mapSpring[id].iD = id;
107  mapSpring[id].springStiffnessNormal = attributes[0];
108  mapSpring[id].springStiffnessTangent = attributes[1];
109 
110  // Print spring blocks after being read
111  MOFEM_LOG_C("WORLD", Sev::verbose, "\nSpring block %d\n", id);
112  MOFEM_LOG_C("WORLD", Sev::verbose, "\tNormal stiffness %3.4g\n",
113  attributes[0]);
114  MOFEM_LOG_C("WORLD", Sev::verbose, "\tTangent stiffness %3.4g\n",
115  attributes[1]);
116  }
117  }
118 
120  }
121 
122  private:
124  };
125 
126  /**
127  * @brief RHS-operator for the spring boundary condition element
128  *
129  * Integrates virtual
130  * work of springs on displacement or spatial positions and assembles
131  * components to RHS global vector.
132  *
133  */
135 
136  // vector used to store force vector for each degree of freedom
138 
139  boost::shared_ptr<MetaSpringBC::DataAtIntegrationPtsSprings> commonDataPtr;
141  bool is_spatial_position = true;
142 
143  /** * @brief Integrates and assembles to global RHS vector virtual work of
144  * springs
145  *
146  * Computes virtual work of springs on spatial positions or displacements
147  * for configurational changes:
148  *
149  * \f[
150  * f_s({\mathbf x}, {\mathbf X},
151  * \delta \mathbf{x}) = \int\limits_{\partial \Omega }^{} {{\delta
152  * \mathbf{x}^T} \cdot \left[ k_{\rm n} \left( {\mathbf N} \otimes {\mathbf
153  * N} \right) + k_{\rm t} \left( {\mathbf I} - {\mathbf N} \otimes {\mathbf
154  * N} \right) \right] \left( {\mathbf x} - {\mathbf X} \right) \partial
155  * \Omega }
156  * \f]
157  *
158  * where \f$ \delta \mathbf{x} \f$ is either virtual displacement or
159  * variation of spatial positions, \f$ k_{\rm n} \f$ is the stiffness of
160  * the springs normal to the surface, \f$ k_{\rm t} \f$ is the stiffness of
161  * the springs tangential to the surface, \f$ {\mathbf N} \f$ is the normal
162  * to the surface vector based on material positions, \f$
163  * {\mathbf x} \f$ is the vector of spatial positions or displacements of
164  * the surface with springs and \f$ {\mathbf X} \f$ is the vector of
165  * material positions that is zero when displacements are considered
166  *
167  */
168 
169  MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
170 
171  /**
172  *
173  * @param common_data_ptr Pointer to the common data for
174  * spring element
175  * @param data Variable containing data for normal and
176  * tangential stiffnesses of springs attached to the current element
177  * @param field_name String of field name for
178  * spatial positions or displacements for rows
179  */
180  OpSpringFs(boost::shared_ptr<MetaSpringBC::DataAtIntegrationPtsSprings>
181  &common_data_ptr,
183  const std::string field_name)
185  field_name.c_str(), OPROW),
186  commonDataPtr(common_data_ptr), dAta(data) {
187  if (field_name.compare(0, 16, "SPATIAL_POSITION") != 0)
188  is_spatial_position = false;
189  }
190  };
191 
192  /**
193  * @brief LHS-operator for the springs element
194  *
195  * Integrates Springs virtual work on spatial positions or displacements
196  * \f$ f_s \f$ derivative with respect to spatial postions or displacements
197  * on surface with springs side and assembles components of the LHS vector.
198  *
199  */
201 
202  boost::shared_ptr<MetaSpringBC::DataAtIntegrationPtsSprings> commonDataPtr;
204 
207 
208  /** * @brief Integrates and assembles to global RHS vector virtual work of
209  * springs
210  *
211  * Computes virtual work of springs on spatial positions or displacements
212  * for configurational changes:
213  *
214  * \f[
215  * \textrm{D} f_s({\mathbf x}, {\mathbf X},
216  * \delta \mathbf{x})[\Delta \mathbf x] = \int\limits_{\partial \Omega }^{}
217  * {{\delta \mathbf{x}^T} \cdot \left[ k_{\rm n} \left( {\mathbf N} \otimes
218  * {\mathbf N} \right) + k_{\rm t} \left( {\mathbf I} - {\mathbf N} \otimes
219  * {\mathbf N} \right) \right] \Delta {\mathbf x} \partial \Omega } \f]
220  *
221  * where \f$ \delta \mathbf{x} \f$ is either virtual displacement or the
222  * variation of spatial positions, \f$ k_{\rm n} \f$ is the stiffness of the
223  * springs normal to the surface, \f$ k_{\rm t} \f$ is the stiffness of the
224  * springs tangential to the surface, \f$ {\mathbf N} \f$ is the normal to
225  * the surface vector based on material positions, \f$
226  * {\mathbf x} \f$ is the vector of spatial positions or displacements of
227  * the surface with springs and \f$ {\mathbf X} \f$ is the vector of
228  * material positions that is zero when displacements are considered
229  *
230  */
231  MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
232  EntityType col_type, EntData &row_data,
233  EntData &col_data);
234  /**
235  *
236  * @param common_data_ptr Pointer to the common data for
237  * spring element
238  * @param data Variable containing data for normal and
239  * tangential stiffnesses of springs attached to the current element
240  * @param field_name String of field name for
241  * spatial positions or displacements for rows
242  */
243  OpSpringKs(boost::shared_ptr<MetaSpringBC::DataAtIntegrationPtsSprings>
244  &common_data_ptr,
246  const std::string field_name)
248  field_name.c_str(), field_name.c_str(), OPROWCOL),
249  commonDataPtr(common_data_ptr), dAta(data) {
250  // sYmm = false;
251  }
252  };
253 
256 
257  boost::shared_ptr<MetaSpringBC::DataAtIntegrationPtsSprings> commonDataPtr;
259 
262  /**
263  * @brief Compute part of the left-hand side
264  *
265  * Computes the linearisation of the material component
266  * with respect to a variation of material coordinates
267  * \f$(\Delta\mathbf{X})\f$:
268  *
269  * \f[
270  * \textrm{D} f^{\textrm{(face)}}_s(\mathbf{x}, \mathbf{X},
271  * \delta\mathbf{x})
272  * [\Delta\mathbf{X}] = -\int\limits_{\mathcal{T}_{\xi}} \,
273  * 0.5 (k_{\rm n} - k_{\rm s}) \cdot \left\{ \left[
274  * \frac{\partial\mathbf{X}}
275  * {\partial\xi} \cdot \left(\frac{\partial\Delta
276  * \mathbf{X}}{\partial\eta}\times\delta\mathbf{x}\right)
277  * -\frac{\partial\mathbf{X}}
278  * {\partial\eta} \cdot \left(\frac{\partial\Delta
279  * \mathbf{X}}{\partial\xi}\times \delta\mathbf{x}\right)\right] \otimes
280  * \dfrac{\mathbf{N}}{\|\mathbf{N}\|} + \dfrac{\mathbf{N}}{\|\mathbf{N}\|}
281  * \otimes \left[ \frac{\partial\mathbf{X}}
282  * {\partial\xi} \cdot \left(\frac{\partial\Delta
283  * \mathbf{X}}{\partial\eta}\times\delta\mathbf{x}\right)
284  * -\frac{\partial\mathbf{X}}
285  * {\partial\eta} \cdot \left(\frac{\partial\Delta
286  * \mathbf{X}}{\partial\xi}\times \delta\mathbf{x}\right)\right]
287  * - \dfrac{\mathbf{N} \otimes \mathbf{N}}{{\| \mathbf{N} \|}^3} \left[
288  * \frac{\partial\mathbf{X}}
289  * {\partial\xi} \cdot \left(\frac{\partial\Delta
290  * \mathbf{X}}{\partial\eta}\times\delta\mathbf{x}\right)
291  * -\frac{\partial\mathbf{X}}
292  * {\partial\eta} \cdot \left(\frac{\partial\Delta
293  * \mathbf{X}}{\partial\xi}\times \delta\mathbf{x}\right)\right] \mathbf{N}
294  * \right \}
295  * \textrm{d}\xi\textrm{d}\eta
296  * \\
297  * +\int\limits_{\mathcal{T}_{\xi}}
298  * 0.5 k_{\rm s} \left[
299  * \frac{\partial\mathbf{X}}
300  * {\partial\xi} \cdot \left(\frac{\partial\Delta
301  * \mathbf{X}}{\partial\eta}\times\delta\mathbf{x}\right)
302  * -\frac{\partial\mathbf{X}}
303  * {\partial\eta} \cdot \left(\frac{\partial\Delta
304  * \mathbf{X}}{\partial\xi}\times \delta\mathbf{x}\right)\right]
305  * {\mathbf N}^{\intercal} \cdot {\mathbf I} ( {\mathbf x} - {\mathbf X} )
306  * \textrm{d}\xi\textrm{d}\eta
307  * -\int\limits_{\mathcal{T}_{\xi}}
308  * {{\delta
309  * \mathbf{x}^T} \cdot \left[ k_{\rm n} \left( {\mathbf N} \otimes {\mathbf
310  * N} \right) + k_{\rm t} \left( {\mathbf I} - {\mathbf N} \otimes {\mathbf
311  * N} \right) \right] \Delta {\mathbf X} }
312  * \textrm{d}\xi\textrm{d}\eta
313  *
314  * \f]
315  *
316  */
317  MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
318  EntityType col_type, EntData &row_data,
319  EntData &col_data);
320  OpSpringKs_dX(boost::shared_ptr<MetaSpringBC::DataAtIntegrationPtsSprings>
321  &common_data_ptr,
323  const std::string field_name_1,
324  const std::string field_name_2)
326  field_name_1.c_str(), field_name_2.c_str(), OPROWCOL),
327  commonDataPtr(common_data_ptr), dAta(data) {
328  sYmm = false;
329  }
330  };
331 
332  /**
333  * @brief Base class for LHS-operators (material) on side volumes
334  *
335  */
337 
339 
340  boost::shared_ptr<DataAtIntegrationPtsSprings> dataAtSpringPts;
341 
344 
348 
351 
353 
354  MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
355  EntityType col_type, EntData &row_data,
356  EntData &col_data);
357  virtual MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data) {
360  }
361  MoFEMErrorCode aSsemble(EntData &row_data, EntData &col_data);
362 
363  /**
364  * @param field_name_1 String of material positions field name
365  * @param field_name_2 String of either master or material
366  * positions field name, depending of the implementation of the child class
367  * @param data_at_spring_pts Pointer to the common data for
368  * spring element
369  *
370  */
372  const string field_name_1, const string field_name_2,
373  boost::shared_ptr<DataAtIntegrationPtsSprings> data_at_spring_pts)
374  : VolOnSideUserDataOperator(field_name_1, field_name_2,
376  dataAtSpringPts(data_at_spring_pts) {
377  sYmm = false; // This will make sure to loop over all entities
378  }
379  };
380 
381  /**
382  * @brief LHS-operator (material configuration) on the side volume for spring
383  * element
384  *
385  * Computes the linearisation of the material component
386  * with respect to a variation of spatial coordinates on the side volume.
387  */
390 
391  /**
392  * @brief Integrates over a face contribution from a side volume
393  *
394  * Computes linearisation of the material component
395  * with respect to a variation of spatial coordinates:
396  *
397  * \f[
398  * \textrm{D} f_s(\mathbf{x}, \mathbf{X}, \delta\mathbf{X})
399  * [\Delta\mathbf{x}] = \int\limits_{\partial \Omega }^{}
400  * \mathbf{F}^{\intercal}\cdot \left( -{{\delta \mathbf{x}^T} \cdot \left[ k_{\rm n} \left( {\mathbf N} \otimes
401  * {\mathbf N} \right) + k_{\rm t} \left( {\mathbf I} - {\mathbf N} \otimes
402  * {\mathbf N} \right) \right]\right ) \Delta {\mathbf x} \partial \Omega }
403  * -\int\limits_{\mathcal{T}_{\xi}}
404  * \left\{\left[
405  * \frac{\partial\Delta\mathbf{x}}{\partial\boldsymbol{\chi}}\,\mathbf{H}^{-1}
406  * \right]^{\intercal}\cdot \left[ k_{\rm n} \left( {\mathbf N} \otimes
407  * {\mathbf N} \right) + k_{\rm t} \left( {\mathbf I} - {\mathbf N} \otimes
408  * {\mathbf N} \right) \right] \left( {\mathbf x} - {\mathbf X}
409  * \right)\right\} \cdot \delta\mathbf{X}\, \textrm{d}\xi\textrm{d}\eta \f]
410  *
411  *
412  * where \f$ \delta \mathbf{X} \f$ is variation of
413  * material positions, \f$ k_{\rm n} \f$ is the stiffness of the springs
414  * normal to the surface, \f$ k_{\rm t} \f$ is the stiffness of the springs
415  * tangential to the surface, \f$ {\mathbf N} \f$ is the normal to the
416  * surface vector based on material positions, \f$ {\mathbf x} \f$ is the
417  * vector of spatial positions or displacements of the surface with springs,
418  * \f$ {\mathbf X} \f$ is the vector of material positions,
419  * \f$\boldsymbol{\chi}\f$ are reference coordinated,
420  * \f$\mathbf{H}\f$ is the gradient of the material map.
421  *
422  *
423  */
424  MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
425 
427  const string field_name_1, const string field_name_2,
428  boost::shared_ptr<DataAtIntegrationPtsSprings> data_at_spring_pts)
429  : SpringALEMaterialVolOnSideLhs(field_name_1, field_name_2,
430  data_at_spring_pts) {
431  sYmm = false; // This will make sure to loop over all entities
432  };
433  };
434 
435  /**
436  * @brief Base class for LHS-operators for pressure element (material
437  * configuration)
438  *
439  * Linearisation of the material component with respect to
440  * spatial and material coordinates consists of three parts, computed
441  * by operators working on the face and on the side volume:
442  *
443  * \f[
444  * \textrm{D} \delta W^\text{material}_p(\mathbf{x}, \mathbf{X},
445  * \delta\mathbf{x})
446  * [\Delta\mathbf{x}, \Delta\mathbf{X}] = \textrm{D} \delta
447  * W^\text{(face)}_p(\mathbf{x}, \mathbf{X}, \delta\mathbf{x})
448  * [\Delta\mathbf{X}] + \textrm{D} \delta
449  * W^\text{(side volume)}_p(\mathbf{x}, \mathbf{X}, \delta\mathbf{x})
450  * [\Delta\mathbf{x}] + \textrm{D} \delta W^\text{(side volume)}_p
451  * (\mathbf{x}, \mathbf{X}, \delta\mathbf{x}) [\Delta\mathbf{X}]
452  * \f]
453  *
454  */
455 
456  /**
457  * @brief LHS-operator (material configuration) on for spring element on faces
458  *
459  * This is base struct for integrating and assembling
460  * derivatives of virtual work of springs on material positions contributing
461  * to configurational changes
462  */
464 
465  boost::shared_ptr<DataAtIntegrationPtsSprings> dataAtSpringPts;
466  boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> sideFe;
467  std::string sideFeName;
468 
472 
476 
479 
481 
482  virtual MoFEMErrorCode doWork(int row_side, int col_side,
483  EntityType row_type, EntityType col_type,
484  EntData &row_data, EntData &col_data) {
487  }
488 
489  virtual MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data) {
492  }
493 
494  MoFEMErrorCode aSsemble(EntData &row_data, EntData &col_data);
495 
497  const string field_name_1, const string field_name_2,
498  boost::shared_ptr<DataAtIntegrationPtsSprings> data_at_spring_pts,
499  boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> side_fe,
500  std::string &side_fe_name)
501  : FaceDataOperator(field_name_1, field_name_2,
503  dataAtSpringPts(data_at_spring_pts), sideFe(side_fe),
504  sideFeName(side_fe_name) {
505  sYmm = false; // This will make sure to loop over all entities
506  }
507  };
508 
509  /**
510  * @brief LHS-operator for the pressure element (material configuration)
511  *
512  * Triggers loop over operators from the side volume
513  *
514  */
516 
517  /*
518  * Triggers loop over operators from the side volume
519  *
520  */
521  MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
522  EntityType col_type, EntData &row_data,
523  EntData &col_data);
524 
526  const string field_name_1, const string field_name_2,
527  boost::shared_ptr<DataAtIntegrationPtsSprings> data_at_pts,
528  boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> side_fe,
529  std::string &side_fe_name)
530  : OpSpringALEMaterialLhs(field_name_1, field_name_2, data_at_pts,
531  side_fe, side_fe_name) {
532  sYmm = false; // This will make sure to loop over all entities
533  };
534  };
535 
536  /**
537  * @brief LHS-operator for the pressure element (material configuration)
538  *
539  * Computes linearisation of the material component with respect to
540  * material coordinates (also triggers a loop over operators
541  * from the side volume).
542  *
543  */
545 
546  /**
547  * Integrates a contribution to the left-hand side and triggers a loop
548  * over side volume operators.
549  *
550  */
551  MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
552  EntityType col_type, EntData &row_data,
553  EntData &col_data);
554 
555  /**
556  * @brief Compute part of the left-hand side
557  *
558  * Computes the linearisation of the material component
559  * with respect to a variation of material coordinates
560  * \f$(\Delta\mathbf{X})\f$:
561  *
562  * \f[
563  * \textrm{D} f^{\textrm{(face)}}_s(\mathbf{x}, \mathbf{X},
564  * \delta\mathbf{X})
565  * [\Delta\mathbf{X}] = -\int\limits_{\mathcal{T}_{\xi}} \,
566  * 0.5 (k_{\rm n} - k_{\rm s}) \mathbf{F}^{\intercal}\cdot \left\{ \left[
567  * \frac{\partial\mathbf{X}}
568  * {\partial\xi} \cdot \left(\frac{\partial\Delta
569  * \mathbf{X}}{\partial\eta}\times\delta\mathbf{X}\right)
570  * -\frac{\partial\mathbf{X}}
571  * {\partial\eta} \cdot \left(\frac{\partial\Delta
572  * \mathbf{X}}{\partial\xi}\times \delta\mathbf{X}\right)\right] \otimes
573  * \dfrac{\mathbf{N}}{\|\mathbf{N}\|} + \dfrac{\mathbf{N}}{\|\mathbf{N}\|}
574  * \otimes \left[ \frac{\partial\mathbf{X}}
575  * {\partial\xi} \cdot \left(\frac{\partial\Delta
576  * \mathbf{X}}{\partial\eta}\times\delta\mathbf{X}\right)
577  * -\frac{\partial\mathbf{X}}
578  * {\partial\eta} \cdot \left(\frac{\partial\Delta
579  * \mathbf{X}}{\partial\xi}\times \delta\mathbf{X}\right)\right]
580  * - \dfrac{\mathbf{N} \otimes \mathbf{N}}{{\| \mathbf{N} \|}^3} \left[
581  * \frac{\partial\mathbf{X}}
582  * {\partial\xi} \cdot \left(\frac{\partial\Delta
583  * \mathbf{X}}{\partial\eta}\times\delta\mathbf{X}\right)
584  * -\frac{\partial\mathbf{X}}
585  * {\partial\eta} \cdot \left(\frac{\partial\Delta
586  * \mathbf{X}}{\partial\xi}\times \delta\mathbf{X}\right)\right] \mathbf{N}
587  * \right \}
588  * \textrm{d}\xi\textrm{d}\eta
589  * \\
590  * +\int\limits_{\mathcal{T}_{\xi}}
591  * 0.5 k_{\rm s} {\mathbf{F}^{\intercal}} \left[
592  * \frac{\partial\mathbf{X}}
593  * {\partial\xi} \cdot \left(\frac{\partial\Delta
594  * \mathbf{X}}{\partial\eta}\times\delta\mathbf{X}\right)
595  * -\frac{\partial\mathbf{X}}
596  * {\partial\eta} \cdot \left(\frac{\partial\Delta
597  * \mathbf{X}}{\partial\xi}\times \delta\mathbf{X}\right)\right]
598  * {\mathbf N}^{\intercal} \cdot {\mathbf I} ( {\mathbf x} - {\mathbf X} )
599  * \textrm{d}\xi\textrm{d}\eta
600  * -\int\limits_{\mathcal{T}_{\xi}}
601  * {{\delta
602  * \mathbf{X}^T} \cdot {\mathbf{F}^{\intercal}} \left[ k_{\rm n} \left(
603  * {\mathbf N} \otimes {\mathbf N} \right) + k_{\rm t} \left( {\mathbf I} -
604  * {\mathbf N} \otimes {\mathbf N} \right) \right] \Delta {\mathbf X} }
605  * \textrm{d}\xi\textrm{d}\eta
606  *
607  * \f]
608  *
609  */
610  MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
611 
613  const string field_name_1, const string field_name_2,
614  boost::shared_ptr<DataAtIntegrationPtsSprings> data_at_spring_pts,
615  boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> side_fe,
616  std::string &side_fe_name)
617  : OpSpringALEMaterialLhs(field_name_1, field_name_2, data_at_spring_pts,
618  side_fe, side_fe_name) {
619  sYmm = false; // This will make sure to loop over all entities
620  };
621  };
622 
623  /**
624  * @brief LHS-operator (material configuration) on the side volume
625  *
626  * Computes the linearisation of the material component
627  * with respect to a variation of material coordinates on the side volume.
628  *
629  */
632 
633  /**
634  * @brief Integrates over a face contribution from a side volume
635  *
636  * Computes linearisation of the material component
637  * with respect to a variation of material coordinates:
638  *
639  * \f[
640  * \textrm{D} f^\text{(side volume)}_s(\mathbf{x}, \mathbf{X},
641  * \delta\mathbf{X})
642  * [\Delta\mathbf{X}] = \int\limits_{\mathcal{T}_{\xi}}
643  * \left\{\left[
644  * \mathbf{h}\,\mathbf{H}^{-1}\,\frac{\partial\Delta\mathbf{X}}
645  * {\partial\boldsymbol{\chi}}\,\mathbf{H}^{-1}
646  * \right]^{\intercal}\cdot \left[ k_{\rm n} \left( {\mathbf N} \otimes
647  * {\mathbf N} \right) + k_{\rm t} \left( {\mathbf I} - {\mathbf N} \otimes
648  * {\mathbf N} \right) \right] \left( {\mathbf x} - {\mathbf X} \right)
649  * \right\} \cdot \delta\mathbf{X}\, \textrm{d}\xi\textrm{d}\eta \f]
650  *
651  * where \f$ \delta \mathbf{X} \f$ is variation of
652  * material position, \f$ k_{\rm n} \f$ is the stiffness of the springs
653  * normal to the surface, \f$ k_{\rm t} \f$ is the stiffness of the springs
654  * tangential to the surface, \f$ {\mathbf N} \f$ is the normal to the
655  * surface vector based on material positions, \f$ {\mathbf x} \f$ is the
656  * vector of spatial positions or displacements of the surface with springs,
657  * \f$ {\mathbf X} \f$ is the vector of material positions,
658  * \f$\mathbf{h}\f$ and \f$\mathbf{H}\f$ are the gradients of the
659  * spatial and material maps, respectively, and \f$\boldsymbol{\chi}\f$ are
660  * the reference coordinates.
661  *
662  *
663  */
664  MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
665 
667  const string field_name_1, const string field_name_2,
668  boost::shared_ptr<DataAtIntegrationPtsSprings> data_at_spring_pts)
669  : SpringALEMaterialVolOnSideLhs(field_name_1, field_name_2,
670  data_at_spring_pts) {
671  sYmm = false; // This will make sure to loop over all entities
672  };
673  };
674 
675  /**
676  * @brief Operator for computing deformation gradients in side volumes
677  *
678  */
680  : public VolumeElementForcesAndSourcesCoreOnContactPrismSide::
682 
683  boost::shared_ptr<MetaSpringBC::DataAtIntegrationPtsSprings> commonDataPtr;
684 
686 
687  MoFEMErrorCode doWork(int side, EntityType type, EntData &row_data);
688 
690  const string field_name,
691  boost::shared_ptr<MetaSpringBC::DataAtIntegrationPtsSprings>
692  common_data_ptr,
693  bool ho_geometry = false)
694  : VolumeElementForcesAndSourcesCoreOnContactPrismSide::UserDataOperator(
695  field_name, UserDataOperator::OPROW),
696  commonDataPtr(common_data_ptr), hoGeometry(ho_geometry) {
697  doEdges = false;
698  doQuads = false;
699  doTris = false;
700  doTets = false;
701  doPrisms = false;
702  sYmm = false;
703  };
704  };
705 
706  /**
707  * @brief RHS-operator for the spring boundary condition element for ALE
708  * formulation
709  *
710  * Integrates virtual
711  * work of springs on material positions involved in configurational changes
712  * and assembles components to RHS global vector.
713  *
714  */
717 
718  boost::shared_ptr<MetaSpringBC::DataAtIntegrationPtsSprings> dataAtPts;
719  boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> sideFe;
720  std::string sideFeName;
724 
726 
728 
729  int nbRows; ///< number of dofs on rows
730  int nbIntegrationPts; ///< number of integration points
731 
732  MoFEMErrorCode doWork(int side, EntityType type, EntData &row_data);
733 
734  /**
735  * @brief Integrates and assembles to global RHS vector virtual work of
736  * springs on material positions for configurational changes for ALE
737  * formulation
738  *
739  * Computes virtual work of springs on material positions for
740  * configurational changes:
741  *
742  * \f[
743  * f_s ({\mathbf x}, {\mathbf X},
744  * \delta \mathbf{X}) = -\int\limits_{\partial \Omega }^{} {{\delta
745  * \mathbf{X}^T} \cdot {\mathbf{F}^{\intercal}} \left[ k_{\rm n} \left(
746  * {\mathbf N} \otimes {\mathbf N} \right) + k_{\rm t} \left( {\mathbf I} -
747  * {\mathbf N} \otimes {\mathbf N} \right) \right] \left( {\mathbf x} -
748  * {\mathbf X} \right) \partial \Omega } \f]
749  *
750  * where \f$ \delta \mathbf{X} \f$ is
751  * material position variation, \f$ k_{\rm n} \f$ is the stiffness of the
752  * springs normal to the surface, \f$ k_{\rm t} \f$ is the stiffness of the
753  * springs tangential to the surface, \f$ {\mathbf N} \f$ is the normal to
754  * the surface vector based on material positions, \f$ {\mathbf x} \f$ is
755  * the vector of spatial positions or displacements of the surface with
756  * springs, \f$ {\mathbf X} \f$ is the vector of material positions and
757  * finally \f$\mathbf{F}\f$ is the deformation gradient
758  *
759  *
760  * \f[
761  * \mathbf{F} = \mathbf{h}(\mathbf{x})\,\mathbf{H}(\mathbf{X})^{-1} =
762  * \frac{\partial\mathbf{x}}{\partial\boldsymbol{\chi}}
763  * \frac{\partial\boldsymbol{\chi}}{\partial\mathbf{X}}
764  * \f]
765  *
766  * where \f$\mathbf{h}\f$ and \f$\mathbf{H}\f$ are the gradients of the
767  * spatial and material maps, respectively, and \f$\boldsymbol{\chi}\f$ are
768  * the reference coordinates.
769  *
770  */
771  MoFEMErrorCode iNtegrate(EntData &row_data);
772  MoFEMErrorCode aSsemble(EntData &row_data);
773 
774  /**
775  *
776  * @param material_field String of field name for
777  * material positions for rows
778  * @param data_at_pts Pointer to the common data for
779  * spring element
780  * @param side_fe Pointer to the volume finite elements
781  * adjacent to the spring face element
782  * @param side_fe_name String of 3D element adjacent to
783  * the present springs elements
784  * @param data Variable containing data for normal and
785  * tangential stiffnesses of springs attached to the current element
786  *
787  */
789  const string material_field,
790  boost::shared_ptr<MetaSpringBC::DataAtIntegrationPtsSprings>
791  data_at_pts,
792  boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> side_fe,
793  std::string &side_fe_name, MetaSpringBC::BlockOptionDataSprings &data)
794  : UserDataOperator(material_field, UserDataOperator::OPROW),
795  dataAtPts(data_at_pts), sideFe(side_fe), sideFeName(side_fe_name),
796  dAta(data){};
797  };
798 
799  /// \brief Computes, for material configuration, tangent vectors to face that
800  /// lie on a surface with springs
803 
804  boost::shared_ptr<MetaSpringBC::DataAtIntegrationPtsSprings>
806  int ngp;
807  /**
808  *
809  * @param field_name String of field name for
810  * material positions for rows
811  * @param data_at_integration_pts Pointer to the common data for
812  * spring element
813  *
814  */
816  const string field_name,
817  boost::shared_ptr<MetaSpringBC::DataAtIntegrationPtsSprings>
821 
822  /**
823  * @brief Evaluates the two tangent vector to the triangle on surface with
824  * springs based on material base coordinates
825  *
826  * Computes the two tangent vectors,\f$ {\mathbf T}^{(1)} \f$ and \f$
827  * {\mathbf T}^{(2)}\f$, based on material base coordinates based on mesh
828  * (moab vertices) coordinates:
829  *
830  * \f[
831  * {\mathbf T}^{(1)}({\mathbf X}(\xi, \eta)) =
832  * \frac{\partial\mathbf{X}(\xi,
833  * \eta)}{\partial\xi} \;\;\;\; {\mathbf T}^{(2)}({\mathbf X}(\xi, \eta)) =
834  * \frac{\partial \mathbf{X}(\xi, \eta)}
835  * {\partial\eta}
836  * \f]
837  *
838  * where \f${\mathbf X}(\xi, \eta)\f$ is the vector of material
839  * coordinates at the gauss point of surface with springs having parent
840  * coordinates \f$\xi\f$ and \f$\eta\f$ evaluated according to
841  *
842  * \f[
843  * {\mathbf X}(\xi, \eta) =
844  * \sum\limits^{3}_{i = 1}
845  * N_i(\xi, \eta){\overline{\mathbf X}}_i
846  * \f]
847  *
848  * where \f$ N_i \f$ is the shape function corresponding to the \f$
849  * i-{\rm{th}}\f$ degree of freedom in the material configuration
850  * \f${\overline{\mathbf X}}_i\f$ corresponding to the 3 nodes of the
851  * triangular face.
852  *
853  */
854 
855  MoFEMErrorCode doWork(int side, EntityType type, EntData &row_data);
856  };
857 
858  /// \brief Computes, for material configuration, normal to face that lies
859  /// on a surface with springs
862 
863  boost::shared_ptr<MetaSpringBC::DataAtIntegrationPtsSprings>
865  int ngp;
866 
867  /**
868  *
869  * @param field_name String of field name for
870  * material positions for rows
871  * @param data_at_integration_pts Pointer to the common data for
872  * spring element
873  *
874  */
876  const string field_name,
877  boost::shared_ptr<MetaSpringBC::DataAtIntegrationPtsSprings>
878  data_at_integration_pts)
880  dataAtIntegrationPts(data_at_integration_pts) {}
881 
882  /**
883  * @brief Evaluates normal vector to the triangle on surface with springs
884  * based on material base coordinates
885  *
886  * Computes normal vector based on material base coordinates based on mesh
887  * (moab vertices) coordinates:
888  *
889  * \f[
890  * {\mathbf N}({\mathbf X}(\xi, \eta)) =
891  * \frac{\partial\mathbf{X}(\xi,
892  * \eta)}{\partial\xi}\times\frac{\partial \mathbf{X}(\xi, \eta)}
893  * {\partial\eta}
894  * \f]
895  *
896  * where \f${\mathbf X}(\xi, \eta)\f$ is the vector of material
897  * coordinates at the gauss point of surface with springs having parent
898  * coordinates \f$\xi\f$ and \f$\eta\f$ evaluated according to
899  *
900  * \f[
901  * {\mathbf X}(\xi, \eta) =
902  * \sum\limits^{3}_{i = 1}
903  * N_i(\xi, \eta){\overline{\mathbf X}}_i
904  * \f]
905  *
906  * where \f$ N_i \f$ is the shape function corresponding to the \f$
907  * i-{\rm{th}}\f$ degree of freedom in the material configuration
908  * \f${\overline{\mathbf X}}_i\f$ corresponding to the 3 nodes of the
909  * triangular face.
910  *
911  */
912 
913  MoFEMErrorCode doWork(int side, EntityType type, EntData &row_data);
914  };
915 
916  /**
917  * \brief Declare spring element
918  *
919  * Search cubit sidesets and blocksets with spring bc and declare surface
920  * element
921 
922  * Blockset has to have name “SPRING_BC”. The first two attributes of the
923  * blockset are spring stiffness value.
924 
925  *
926  * @param m_field Interface instance
927  * @param field_name Field name (e.g. SPATIAL_POSITION)
928  * @param mesh_nodals_positions Name of field on which ho-geometry is defined
929  * @return Error code
930  */
932  MoFEM::Interface &m_field, const std::string field_name,
933  const std::string mesh_nodals_positions = "MESH_NODE_POSITIONS");
934 
935  /**
936  * \brief Declare spring element in ALE
937  *
938  * Search cubit sidesets and blocksets with spring bc and declare surface
939  * element
940 
941  * Blockset has to have name “SPRING_BC”. The first two attributes of the
942  * blockset are spring stiffness value.
943 
944  *
945  * @param m_field Interface instance
946  * @param field_name Field name (e.g. SPATIAL_POSITION)
947  * @param mesh_nodals_positions Name of field on which ho-geometry is defined
948  * @return Error code
949  */
950  static MoFEMErrorCode
951  addSpringElementsALE(MoFEM::Interface &m_field, const std::string field_name,
952  const std::string mesh_nodals_positions,
953  Range &spring_triangles);
954 
955  /**
956  * \brief Implementation of spring element. Set operators to calculate LHS and
957  * RHS
958  *
959  * @param m_field Interface instance
960  * @param fe_spring_lhs_ptr Pointer to the FE instance for LHS
961  * @param fe_spring_rhs_ptr Pointer to the FE instance for RHS
962  * @param field_name Field name (e.g. SPATIAL_POSITION)
963  * @param mesh_nodals_positions Name of field on which ho-geometry is defined
964  * @return Error code
965  */
967  MoFEM::Interface &m_field,
968  boost::shared_ptr<FaceElementForcesAndSourcesCore> fe_spring_lhs_ptr,
969  boost::shared_ptr<FaceElementForcesAndSourcesCore> fe_spring_rhs_ptr,
970  const std::string field_name,
971  const std::string mesh_nodals_positions = "MESH_NODE_POSITIONS",
972  double stiffness_scale = 1.);
973 
974  /**
975  * \brief Implementation of spring element. Set operators to calculate LHS and
976  * RHS
977  *
978  * @param m_field Interface instance
979  * @param fe_spring_lhs_ptr Pointer to the FE instance for LHS
980  * @param fe_spring_rhs_ptr Pointer to the FE instance for RHS
981  * @param field_name Field name (e.g. SPATIAL_POSITION)
982  * @param mesh_nodals_positions Name of field on which ho-geometry is defined
983  * @return Error code
984  */
986  MoFEM::Interface &m_field,
987  boost::shared_ptr<FaceElementForcesAndSourcesCore> fe_spring_lhs_ptr_dx,
988  boost::shared_ptr<FaceElementForcesAndSourcesCore> fe_spring_lhs_ptr_dX,
989  boost::shared_ptr<FaceElementForcesAndSourcesCore> fe_spring_rhs_ptr,
990  boost::shared_ptr<DataAtIntegrationPtsSprings> data_at_integration_pts,
991  const std::string field_name, const std::string mesh_nodals_positions,
992  std::string side_fe_name);
993 };
994 
995 #endif //__SPRINGELEMENT_HPP__
MoFEM::VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator
default operator for TET element
Definition: VolumeElementForcesAndSourcesCoreOnSide.hpp:97
MetaSpringBC::OpSpringFsMaterial::hoGeometry
bool hoGeometry
Definition: SpringElement.hpp:723
MetaSpringBC::DataAtIntegrationPtsSprings::springStiffnessTangent
double springStiffnessTangent
Definition: SpringElement.hpp:54
MetaSpringBC::OpCalculateDeformation::commonDataPtr
boost::shared_ptr< MetaSpringBC::DataAtIntegrationPtsSprings > commonDataPtr
Definition: SpringElement.hpp:683
MoFEM::EntitiesFieldData::EntData
Data on single entity (This is passed as argument to DataOperator::doWork)
Definition: EntitiesFieldData.hpp:127
MetaSpringBC::DataAtIntegrationPtsSprings::forcesOnlyOnEntitiesRow
Range forcesOnlyOnEntitiesRow
Definition: SpringElement.hpp:57
MetaSpringBC::OpSpringFs
RHS-operator for the spring boundary condition element.
Definition: SpringElement.hpp:134
MetaSpringBC::BlockOptionDataSprings::tRis
Range tRis
Definition: SpringElement.hpp:26
MetaSpringBC::DataAtIntegrationPtsSprings::getBlockData
MoFEMErrorCode getBlockData(BlockOptionDataSprings &data)
Definition: SpringElement.hpp:79
MetaSpringBC::OpSpringFsMaterial::rowIndices
VectorInt rowIndices
Definition: SpringElement.hpp:727
MetaSpringBC::OpSpringALEMaterialLhs::dataAtSpringPts
boost::shared_ptr< DataAtIntegrationPtsSprings > dataAtSpringPts
Definition: SpringElement.hpp:465
MetaSpringBC::DataAtIntegrationPtsSprings::tangent2
MatrixDouble tangent2
Definition: SpringElement.hpp:50
MetaSpringBC::SpringALEMaterialVolOnSideLhs::dataAtSpringPts
boost::shared_ptr< DataAtIntegrationPtsSprings > dataAtSpringPts
Definition: SpringElement.hpp:340
MetaSpringBC::SpringALEMaterialVolOnSideLhs_dX_dx::SpringALEMaterialVolOnSideLhs_dX_dx
SpringALEMaterialVolOnSideLhs_dX_dx(const string field_name_1, const string field_name_2, boost::shared_ptr< DataAtIntegrationPtsSprings > data_at_spring_pts)
Definition: SpringElement.hpp:426
MetaSpringBC::OpSpringALEMaterialLhs_dX_dX::iNtegrate
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
Compute part of the left-hand side.
Definition: SpringElement.cpp:613
MetaSpringBC::OpSpringFs::commonDataPtr
boost::shared_ptr< MetaSpringBC::DataAtIntegrationPtsSprings > commonDataPtr
Definition: SpringElement.hpp:139
MetaSpringBC::OpSpringKs_dX
Definition: SpringElement.hpp:254
MetaSpringBC::SpringALEMaterialVolOnSideLhs_dX_dX::iNtegrate
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
Integrates over a face contribution from a side volume.
Definition: SpringElement.cpp:749
MetaSpringBC::SpringALEMaterialVolOnSideLhs::nb_base_fun_col
int nb_base_fun_col
Definition: SpringElement.hpp:350
MetaSpringBC::OpGetTangentSpEle::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntData &row_data)
Evaluates the two tangent vector to the triangle on surface with springs based on material base coord...
Definition: SpringElement.cpp:1036
MetaSpringBC::DataAtIntegrationPtsSprings
Definition: SpringElement.hpp:32
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MetaSpringBC::DataAtIntegrationPtsSprings::FMat
boost::shared_ptr< MatrixDouble > FMat
Definition: SpringElement.hpp:42
MetaSpringBC::OpSpringFs::OpSpringFs
OpSpringFs(boost::shared_ptr< MetaSpringBC::DataAtIntegrationPtsSprings > &common_data_ptr, MetaSpringBC::BlockOptionDataSprings &data, const std::string field_name)
Definition: SpringElement.hpp:180
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
MetaSpringBC::OpSpringKs_dX::transLocKs
MatrixDouble transLocKs
Definition: SpringElement.hpp:261
MetaSpringBC::OpSpringALEMaterialLhs::OpSpringALEMaterialLhs
OpSpringALEMaterialLhs(const string field_name_1, const string field_name_2, boost::shared_ptr< DataAtIntegrationPtsSprings > data_at_spring_pts, boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > side_fe, std::string &side_fe_name)
Definition: SpringElement.hpp:496
MetaSpringBC::OpSpringFsMaterial
RHS-operator for the spring boundary condition element for ALE formulation.
Definition: SpringElement.hpp:715
MetaSpringBC::DataAtIntegrationPtsSprings::tangent1
MatrixDouble tangent1
Definition: SpringElement.hpp:49
MetaSpringBC::SpringALEMaterialVolOnSideLhs::colIndices
VectorInt colIndices
Definition: SpringElement.hpp:343
MetaSpringBC::OpSpringALEMaterialLhs_dX_dX::doWork
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
Definition: SpringElement.cpp:576
MetaSpringBC::OpSpringFsMaterial::nF
VectorDouble nF
Definition: SpringElement.hpp:725
MetaSpringBC::OpSpringKs_dX::locKs
MatrixDouble locKs
Definition: SpringElement.hpp:260
MetaSpringBC::OpSpringKs::commonDataPtr
boost::shared_ptr< MetaSpringBC::DataAtIntegrationPtsSprings > commonDataPtr
Definition: SpringElement.hpp:202
MetaSpringBC::OpSpringFs::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Integrates and assembles to global RHS vector virtual work of springs.
Definition: SpringElement.cpp:13
MetaSpringBC::OpSpringFs::nF
VectorDouble nF
Definition: SpringElement.hpp:137
MetaSpringBC::OpSpringALEMaterialLhs
Base class for LHS-operators for pressure element (material configuration)
Definition: SpringElement.hpp:463
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPROWCOL
@ OPROWCOL
operator doWork is executed on FE rows &columns
Definition: ForcesAndSourcesCore.hpp:569
MetaSpringBC::SpringALEMaterialVolOnSideLhs::diagonal_block
bool diagonal_block
Definition: SpringElement.hpp:352
MetaSpringBC::OpSpringALEMaterialLhs::aSsemble
MoFEMErrorCode aSsemble(EntData &row_data, EntData &col_data)
Definition: SpringElement.cpp:543
MetaSpringBC::OpSpringALEMaterialLhs::nb_gauss_pts
int nb_gauss_pts
Definition: SpringElement.hpp:475
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MetaSpringBC::OpSpringALEMaterialLhs::diagonal_block
bool diagonal_block
Definition: SpringElement.hpp:480
MetaSpringBC::OpSpringALEMaterialLhs::col_nb_dofs
int col_nb_dofs
Definition: SpringElement.hpp:474
MetaSpringBC::DataAtIntegrationPtsSprings::faceRowData
EntitiesFieldData::EntData * faceRowData
Definition: SpringElement.hpp:59
MetaSpringBC::SpringALEMaterialVolOnSideLhs::NN
MatrixDouble NN
Definition: SpringElement.hpp:338
MetaSpringBC::OpSpringFsMaterial::dataAtPts
boost::shared_ptr< MetaSpringBC::DataAtIntegrationPtsSprings > dataAtPts
Definition: SpringElement.hpp:718
MetaSpringBC::OpSpringKs::locKs
MatrixDouble locKs
Definition: SpringElement.hpp:205
MetaSpringBC::DataAtIntegrationPtsSprings::getParameters
MoFEMErrorCode getParameters()
Definition: SpringElement.hpp:70
MetaSpringBC::DataAtIntegrationPtsSprings::xInitAtPts
boost::shared_ptr< MatrixDouble > xInitAtPts
Definition: SpringElement.hpp:38
MetaSpringBC::OpGetTangentSpEle::dataAtIntegrationPts
boost::shared_ptr< MetaSpringBC::DataAtIntegrationPtsSprings > dataAtIntegrationPts
Definition: SpringElement.hpp:805
MetaSpringBC::OpSpringFsMaterial::OpSpringFsMaterial
OpSpringFsMaterial(const string material_field, boost::shared_ptr< MetaSpringBC::DataAtIntegrationPtsSprings > data_at_pts, boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > side_fe, std::string &side_fe_name, MetaSpringBC::BlockOptionDataSprings &data)
Definition: SpringElement.hpp:788
MetaSpringBC::OpSpringALEMaterialLhs_dX_dx::OpSpringALEMaterialLhs_dX_dx
OpSpringALEMaterialLhs_dX_dx(const string field_name_1, const string field_name_2, boost::shared_ptr< DataAtIntegrationPtsSprings > data_at_pts, boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > side_fe, std::string &side_fe_name)
Definition: SpringElement.hpp:525
MetaSpringBC::OpSpringALEMaterialLhs::colIndices
VectorInt colIndices
Definition: SpringElement.hpp:471
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
MetaSpringBC::SpringALEMaterialVolOnSideLhs_dX_dX
LHS-operator (material configuration) on the side volume.
Definition: SpringElement.hpp:630
MetaSpringBC::SpringALEMaterialVolOnSideLhs_dX_dx::iNtegrate
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
Integrates over a face contribution from a side volume.
Definition: SpringElement.cpp:450
MoFEM::FaceElementForcesAndSourcesCore::UserDataOperator
friend class UserDataOperator
Definition: FaceElementForcesAndSourcesCore.hpp:86
MetaSpringBC::OpSpringFsMaterial::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntData &row_data)
Operator for linear form, usually to calculate values on right hand side.
Definition: SpringElement.cpp:887
MetaSpringBC::OpCalculateDeformation::OpCalculateDeformation
OpCalculateDeformation(const string field_name, boost::shared_ptr< MetaSpringBC::DataAtIntegrationPtsSprings > common_data_ptr, bool ho_geometry=false)
Definition: SpringElement.hpp:689
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
MetaSpringBC::OpSpringFsMaterial::iNtegrate
MoFEMErrorCode iNtegrate(EntData &row_data)
Integrates and assembles to global RHS vector virtual work of springs on material positions for confi...
Definition: SpringElement.cpp:919
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
MetaSpringBC::OpSpringFs::dAta
MetaSpringBC::BlockOptionDataSprings & dAta
Definition: SpringElement.hpp:140
MetaSpringBC::OpGetNormalSpEle
Computes, for material configuration, normal to face that lies on a surface with springs.
Definition: SpringElement.hpp:860
MetaSpringBC::OpSpringFsMaterial::nbIntegrationPts
int nbIntegrationPts
number of integration points
Definition: SpringElement.hpp:730
MoFEM::ForcesAndSourcesCore::UserDataOperator
Definition: ForcesAndSourcesCore.hpp:549
MetaSpringBC::OpSpringALEMaterialLhs::NN
MatrixDouble NN
Definition: SpringElement.hpp:469
MoFEM::FaceElementForcesAndSourcesCore::UserDataOperator
default operator for TRI element
Definition: FaceElementForcesAndSourcesCore.hpp:94
MOFEM_LOG_C
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:311
MetaSpringBC::SpringALEMaterialVolOnSideLhs::SpringALEMaterialVolOnSideLhs
SpringALEMaterialVolOnSideLhs(const string field_name_1, const string field_name_2, boost::shared_ptr< DataAtIntegrationPtsSprings > data_at_spring_pts)
Definition: SpringElement.hpp:371
MetaSpringBC::SpringALEMaterialVolOnSideLhs_dX_dX::SpringALEMaterialVolOnSideLhs_dX_dX
SpringALEMaterialVolOnSideLhs_dX_dX(const string field_name_1, const string field_name_2, boost::shared_ptr< DataAtIntegrationPtsSprings > data_at_spring_pts)
Definition: SpringElement.hpp:666
MetaSpringBC::OpSpringFsMaterial::nbRows
int nbRows
number of dofs on rows
Definition: SpringElement.hpp:729
MetaSpringBC::SpringALEMaterialVolOnSideLhs::nb_gauss_pts
int nb_gauss_pts
Definition: SpringElement.hpp:347
bit
auto bit
set bit
Definition: hanging_node_approx.cpp:75
convert.type
type
Definition: convert.py:64
MetaSpringBC::SpringALEMaterialVolOnSideLhs_dX_dx
LHS-operator (material configuration) on the side volume for spring element.
Definition: SpringElement.hpp:388
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPCOL
@ OPCOL
operator doWork function is executed on FE columns
Definition: ForcesAndSourcesCore.hpp:568
MetaSpringBC::SpringALEMaterialVolOnSideLhs::aSsemble
MoFEMErrorCode aSsemble(EntData &row_data, EntData &col_data)
Definition: SpringElement.cpp:417
MetaSpringBC::DataAtIntegrationPtsSprings::detHVec
boost::shared_ptr< VectorDouble > detHVec
Definition: SpringElement.hpp:46
MetaSpringBC::OpSpringALEMaterialLhs::nb_base_fun_col
int nb_base_fun_col
Definition: SpringElement.hpp:478
MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator
friend class UserDataOperator
Definition: VolumeElementForcesAndSourcesCore.hpp:105
MetaSpringBC::OpSpringKs_dX::dAta
MetaSpringBC::BlockOptionDataSprings & dAta
Definition: SpringElement.hpp:258
MetaSpringBC::DataAtIntegrationPtsSprings::scaleStiffness
double scaleStiffness
Definition: SpringElement.hpp:55
MetaSpringBC::DataAtIntegrationPtsSprings::DataAtIntegrationPtsSprings
DataAtIntegrationPtsSprings(MoFEM::Interface &m_field, double scale_stiffness=1.)
Definition: SpringElement.hpp:63
MetaSpringBC::SpringALEMaterialVolOnSideLhs::nb_base_fun_row
int nb_base_fun_row
Definition: SpringElement.hpp:349
MetaSpringBC::OpSpringFsMaterial::aSsemble
MoFEMErrorCode aSsemble(EntData &row_data)
Definition: SpringElement.cpp:1009
MetaSpringBC::DataAtIntegrationPtsSprings::normalVector
MatrixDouble normalVector
Definition: SpringElement.hpp:51
MetaSpringBC::OpSpringFs::is_spatial_position
bool is_spatial_position
Definition: SpringElement.hpp:141
MetaSpringBC::OpSpringALEMaterialLhs::iNtegrate
virtual MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
Definition: SpringElement.hpp:489
MetaSpringBC::OpSpringFsMaterial::sideFeName
std::string sideFeName
Definition: SpringElement.hpp:720
MetaSpringBC::OpSpringALEMaterialLhs::doWork
virtual MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
Operator for bi-linear form, usually to calculate values on left hand side.
Definition: SpringElement.hpp:482
MetaSpringBC::SpringALEMaterialVolOnSideLhs::row_nb_dofs
int row_nb_dofs
Definition: SpringElement.hpp:345
MetaSpringBC::OpSpringALEMaterialLhs_dX_dX::OpSpringALEMaterialLhs_dX_dX
OpSpringALEMaterialLhs_dX_dX(const string field_name_1, const string field_name_2, boost::shared_ptr< DataAtIntegrationPtsSprings > data_at_spring_pts, boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > side_fe, std::string &side_fe_name)
Definition: SpringElement.hpp:612
FaceElementForcesAndSourcesCore
MetaSpringBC::SpringALEMaterialVolOnSideLhs::iNtegrate
virtual MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
Definition: SpringElement.hpp:357
MetaSpringBC::SpringALEMaterialVolOnSideLhs
Base class for LHS-operators (material) on side volumes.
Definition: SpringElement.hpp:336
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
MetaSpringBC::OpCalculateDeformation::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntData &row_data)
Definition: SpringElement.cpp:846
MetaSpringBC::SpringALEMaterialVolOnSideLhs::rowIndices
VectorInt rowIndices
Definition: SpringElement.hpp:342
MetaSpringBC::OpSpringALEMaterialLhs::row_nb_dofs
int row_nb_dofs
Definition: SpringElement.hpp:473
MetaSpringBC::BlockOptionDataSprings::BlockOptionDataSprings
BlockOptionDataSprings()
Definition: SpringElement.hpp:28
MetaSpringBC::OpCalculateDeformation
Operator for computing deformation gradients in side volumes.
Definition: SpringElement.hpp:679
MetaSpringBC::setSpringOperatorsMaterial
static MoFEMErrorCode setSpringOperatorsMaterial(MoFEM::Interface &m_field, boost::shared_ptr< FaceElementForcesAndSourcesCore > fe_spring_lhs_ptr_dx, boost::shared_ptr< FaceElementForcesAndSourcesCore > fe_spring_lhs_ptr_dX, boost::shared_ptr< FaceElementForcesAndSourcesCore > fe_spring_rhs_ptr, boost::shared_ptr< DataAtIntegrationPtsSprings > data_at_integration_pts, const std::string field_name, const std::string mesh_nodals_positions, std::string side_fe_name)
Implementation of spring element. Set operators to calculate LHS and RHS.
Definition: SpringElement.cpp:1223
Range
MetaSpringBC::setSpringOperators
static MoFEMErrorCode setSpringOperators(MoFEM::Interface &m_field, boost::shared_ptr< FaceElementForcesAndSourcesCore > fe_spring_lhs_ptr, boost::shared_ptr< FaceElementForcesAndSourcesCore > fe_spring_rhs_ptr, const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS", double stiffness_scale=1.)
Implementation of spring element. Set operators to calculate LHS and RHS.
Definition: SpringElement.cpp:1178
MetaSpringBC::DataAtIntegrationPtsSprings::setBlocks
MoFEMErrorCode setBlocks()
Definition: SpringElement.hpp:88
EntData
EntitiesFieldData::EntData EntData
Definition: SpringElement.hpp:12
MetaSpringBC::DataAtIntegrationPtsSprings::springStiffnessNormal
double springStiffnessNormal
Definition: SpringElement.hpp:53
MetaSpringBC::OpSpringALEMaterialLhs::nb_base_fun_row
int nb_base_fun_row
Definition: SpringElement.hpp:477
_IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
Definition: MeshsetsManager.hpp:71
MetaSpringBC::BlockOptionDataSprings
Definition: SpringElement.hpp:20
MetaSpringBC::DataAtIntegrationPtsSprings::gradDispPtr
boost::shared_ptr< MatrixDouble > gradDispPtr
Definition: SpringElement.hpp:35
MetaSpringBC::BlockOptionDataSprings::springStiffnessTangent
double springStiffnessTangent
Definition: SpringElement.hpp:24
MetaSpringBC::OpSpringKs_dX::doWork
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
Compute part of the left-hand side.
Definition: SpringElement.cpp:228
MetaSpringBC::DataAtIntegrationPtsSprings::mapSpring
std::map< int, BlockOptionDataSprings > mapSpring
Definition: SpringElement.hpp:61
MetaSpringBC::OpSpringKs_dX::OpSpringKs_dX
OpSpringKs_dX(boost::shared_ptr< MetaSpringBC::DataAtIntegrationPtsSprings > &common_data_ptr, MetaSpringBC::BlockOptionDataSprings &data, const std::string field_name_1, const std::string field_name_2)
Definition: SpringElement.hpp:320
MetaSpringBC::OpGetTangentSpEle
Computes, for material configuration, tangent vectors to face that lie on a surface with springs.
Definition: SpringElement.hpp:801
MoFEM::Types::VectorInt
UBlasVector< int > VectorInt
Definition: Types.hpp:67
BLOCKSET
@ BLOCKSET
Definition: definitions.h:148
MetaSpringBC::OpSpringALEMaterialLhs::rowIndices
VectorInt rowIndices
Definition: SpringElement.hpp:470
MetaSpringBC::OpSpringALEMaterialLhs_dX_dx::doWork
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
Operator for bi-linear form, usually to calculate values on left hand side.
Definition: SpringElement.cpp:1111
MetaSpringBC
Set of functions declaring elements and setting operators to apply spring boundary condition.
Definition: SpringElement.hpp:19
MetaSpringBC::OpGetNormalSpEle::dataAtIntegrationPts
boost::shared_ptr< MetaSpringBC::DataAtIntegrationPtsSprings > dataAtIntegrationPts
Definition: SpringElement.hpp:864
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
MetaSpringBC::BlockOptionDataSprings::iD
int iD
Definition: SpringElement.hpp:21
EigenMatrix::Vec
const FTensor::Tensor2< T, Dim, Dim > Vec
Definition: MatrixFunction.hpp:66
MetaSpringBC::SpringALEMaterialVolOnSideLhs::doWork
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
Operator for bi-linear form, usually to calculate values on left hand side.
Definition: SpringElement.cpp:380
MetaSpringBC::OpSpringKs::OpSpringKs
OpSpringKs(boost::shared_ptr< MetaSpringBC::DataAtIntegrationPtsSprings > &common_data_ptr, MetaSpringBC::BlockOptionDataSprings &data, const std::string field_name)
Definition: SpringElement.hpp:243
MetaSpringBC::DataAtIntegrationPtsSprings::HMat
boost::shared_ptr< MatrixDouble > HMat
Definition: SpringElement.hpp:43
MetaSpringBC::OpSpringALEMaterialLhs::sideFe
boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > sideFe
Definition: SpringElement.hpp:466
MetaSpringBC::OpCalculateDeformation::hoGeometry
bool hoGeometry
Definition: SpringElement.hpp:685
MetaSpringBC::DataAtIntegrationPtsSprings::invHMat
boost::shared_ptr< MatrixDouble > invHMat
Definition: SpringElement.hpp:44
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
MetaSpringBC::OpGetTangentSpEle::OpGetTangentSpEle
OpGetTangentSpEle(const string field_name, boost::shared_ptr< MetaSpringBC::DataAtIntegrationPtsSprings > dataAtIntegrationPts)
Definition: SpringElement.hpp:815
MetaSpringBC::OpGetNormalSpEle::ngp
int ngp
Definition: SpringElement.hpp:865
MetaSpringBC::OpSpringKs::dAta
MetaSpringBC::BlockOptionDataSprings & dAta
Definition: SpringElement.hpp:203
MOFEM_ATOM_TEST_INVALID
@ MOFEM_ATOM_TEST_INVALID
Definition: definitions.h:40
MetaSpringBC::SpringALEMaterialVolOnSideLhs::col_nb_dofs
int col_nb_dofs
Definition: SpringElement.hpp:346
MetaSpringBC::OpSpringFsMaterial::F
Vec F
Definition: SpringElement.hpp:721
MetaSpringBC::OpSpringKs::transLocKs
MatrixDouble transLocKs
Definition: SpringElement.hpp:206
MetaSpringBC::DataAtIntegrationPtsSprings::mField
MoFEM::Interface & mField
Definition: SpringElement.hpp:123
MetaSpringBC::OpSpringALEMaterialLhs::sideFeName
std::string sideFeName
Definition: SpringElement.hpp:467
MetaSpringBC::BlockOptionDataSprings::springStiffnessNormal
double springStiffnessNormal
Definition: SpringElement.hpp:23
MetaSpringBC::OpSpringALEMaterialLhs_dX_dx
LHS-operator for the pressure element (material configuration)
Definition: SpringElement.hpp:515
MetaSpringBC::DataAtIntegrationPtsSprings::hMat
boost::shared_ptr< MatrixDouble > hMat
Definition: SpringElement.hpp:41
MetaSpringBC::OpSpringFsMaterial::dAta
MetaSpringBC::BlockOptionDataSprings & dAta
Definition: SpringElement.hpp:722
MetaSpringBC::OpSpringKs::doWork
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
Integrates and assembles to global RHS vector virtual work of springs.
Definition: SpringElement.cpp:116
MoFEM::DataOperator::sYmm
bool sYmm
If true assume that matrix is symmetric structure.
Definition: DataOperators.hpp:82
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
MetaSpringBC::OpSpringKs_dX::commonDataPtr
boost::shared_ptr< MetaSpringBC::DataAtIntegrationPtsSprings > commonDataPtr
Definition: SpringElement.hpp:257
MetaSpringBC::OpGetNormalSpEle::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntData &row_data)
Evaluates normal vector to the triangle on surface with springs based on material base coordinates.
Definition: SpringElement.cpp:1076
MetaSpringBC::DataAtIntegrationPtsSprings::xAtPts
boost::shared_ptr< MatrixDouble > xAtPts
Definition: SpringElement.hpp:37
MetaSpringBC::OpSpringFsMaterial::sideFe
boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > sideFe
Definition: SpringElement.hpp:719
MetaSpringBC::OpGetNormalSpEle::OpGetNormalSpEle
OpGetNormalSpEle(const string field_name, boost::shared_ptr< MetaSpringBC::DataAtIntegrationPtsSprings > data_at_integration_pts)
Definition: SpringElement.hpp:875
MetaSpringBC::addSpringElements
static MoFEMErrorCode addSpringElements(MoFEM::Interface &m_field, const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
Declare spring element.
Definition: SpringElement.cpp:1127
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
MetaSpringBC::OpSpringKs
LHS-operator for the springs element.
Definition: SpringElement.hpp:200
MetaSpringBC::addSpringElementsALE
static MoFEMErrorCode addSpringElementsALE(MoFEM::Interface &m_field, const std::string field_name, const std::string mesh_nodals_positions, Range &spring_triangles)
Declare spring element in ALE.
Definition: SpringElement.cpp:1154
MetaSpringBC::OpGetTangentSpEle::ngp
int ngp
Definition: SpringElement.hpp:806
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPROW
@ OPROW
operator doWork function is executed on FE rows
Definition: ForcesAndSourcesCore.hpp:567
MetaSpringBC::OpSpringALEMaterialLhs_dX_dX
LHS-operator for the pressure element (material configuration)
Definition: SpringElement.hpp:544