KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
shell_rigid.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3 KratosIncompressibleFluidApplication
4 A library based on:
5 Kratos
6 A General Purpose Software for Multi-Physics Finite Element Analysis
7 Version 1.0 (Released on march 05, 2007).
8 
9 Copyright 2007
10 Pooyan Dadvand, Riccardo Rossi
11 pooyan@cimne.upc.edu
12 rrossi@cimne.upc.edu
13 - CIMNE (International Center for Numerical Methods in Engineering),
14 Gran Capita' s/n, 08034 Barcelona, Spain
15 
16 
17 Permission is hereby granted, free of charge, to any person obtaining
18 a copy of this software and associated documentation files (the
19 "Software"), to deal in the Software without restriction, including
20 without limitation the rights to use, copy, modify, merge, publish,
21 distribute, sublicense and/or sell copies of the Software, and to
22 permit persons to whom the Software is furnished to do so, subject to
23 the following condition:
24 
25 Distribution of this code for any commercial purpose is permissible
26 ONLY BY DIRECT ARRANGEMENT WITH THE COPYRIGHT OWNERS.
27 
28 The above copyright notice and this permission notice shall be
29 included in all copies or substantial portions of the Software.
30 
31 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
34 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
35 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
36 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
37 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38 
39 ==============================================================================
40 */
41 
42 //
43 // Project Name: Kratos
44 // Last Modified by: $Author: rrossi $
45 // Date: $Date: 2008-02-21 09:36:17 $
46 // Revision: $Revision: 1.7 $
47 //
48 //
49 
50 
51 #if !defined(KRATOS_SHELL_RIGID_H_INCLUDED)
52 #define KRATOS_SHELL_RIGID_H_INCLUDED
53 
54 
55 
56 // System includes
57 
58 
59 // External includes
60 
61 // Project includes
62 #include "includes/define.h"
63 #include "includes/serializer.h"
64 #include "includes/element.h"
66 
67 namespace Kratos
68 {
69 
72 
76 
80 
84 
88 
90 
92 class KRATOS_API(SWIMMING_DEM_APPLICATION) ShellRigid
93  : public Element
94 {
95 public:
98 
101 
105 
107  ShellRigid(IndexType NewId, GeometryType::Pointer pGeometry);
108  ShellRigid(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties);
109 
111  virtual ~ShellRigid();
112 
113 
117 
118 
122 
123  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes, PropertiesType::Pointer pProperties) const override;
124 
125  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo) override;
126 
127  void CalculateRightHandSide(VectorType& rRightHandSideVector, const ProcessInfo& rCurrentProcessInfo) override;
128 
129  void EquationIdVector(EquationIdVectorType& rResult, const ProcessInfo& rCurrentProcessInfo) const override;
130 
131  void GetDofList(DofsVectorType& ElementalDofList, const ProcessInfo& CurrentProcessInfo) const override;
132 
133 // void InitializeSolutionStep(const ProcessInfo& CurrentProcessInfo);
134 
135  void GetValuesVector(Vector& values, int Step) const override;
136  void GetFirstDerivativesVector(Vector& values, int Step = 0) const override;
137  void GetSecondDerivativesVector(Vector& values, int Step = 0) const override;
138 
139  void CalculateOnIntegrationPoints(const Variable<Matrix >& rVariable, std::vector< Matrix >& Output, const ProcessInfo& rCurrentProcessInfo) override;
140 
141  void CalculateOnIntegrationPoints(const Variable<double >& rVariable, std::vector<double>& Output, const ProcessInfo& rCurrentProcessInfo) override;
142 
143  void Calculate(const Variable<Matrix >& rVariable, Matrix& Output, const ProcessInfo& rCurrentProcessInfo) override;
144 
145  void Initialize(const ProcessInfo& rCurrentProcessInfo) override;
146 
147  void FinalizeNonLinearIteration(const ProcessInfo& CurrentProcessInfo) override;
148 
149  void CalculateMassMatrix(MatrixType& rMassMatrix, const ProcessInfo& rCurrentProcessInfo) override;
150 
151  int Check(const ProcessInfo& rCurrentProcessInfo) const override;
152 
156 
157 
161 
162 
166 
168  // virtual String Info() const;
169 
171  // virtual void PrintInfo(std::ostream& rOStream) const;
172 
174  // virtual void PrintData(std::ostream& rOStream) const;
175 
176 
180 
181 
183 
184 protected:
187 
188 
192 
193 
197 
198 
202 
203 
207 
208 
212 
213 
217 
218 
220 
221 private:
224 
230 
231  array_1d< array_1d<double,3>, 3> rot_oldit;
232 
236  void CalculateLocalGlobalTransformation(
237  double& x12,
238  double& x23,
239  double& x31,
240  double& y12,
241  double& y23,
242  double& y31,
243  array_1d<double,3>& v1,
244  array_1d<double,3>& v2,
245  array_1d<double,3>& v3,
246  double& area
247  );
248 
249  void CalculateMembraneB(
251  const double& beta0,
252  const double& loc1,
253  const double& loc2,
254  const double& loc3,
255  const double& x12,
256  const double& x23,
257  const double& x31,
258  const double& y12,
259  const double& y23,
260  const double& y31
261  );
262 
263 
264  void CalculateBendingB(
266  const double& loc2,
267  const double& loc3,
268  const double& x12,
269  const double& x23,
270  const double& x31,
271  const double& y12,
272  const double& y23,
273  const double& y31
274  );
275 
276  void CalculateMembraneContribution(
277  const BoundedMatrix<double,9,3>& Bm,
278  const BoundedMatrix<double,3,3>& Em,
280  );
281 
282 
283  void AssembleMembraneContribution(
284  const BoundedMatrix<double,9,9>& Km,
285  const double& coeff,
286  BoundedMatrix<double,18,18>& Kloc_system
287  );
288 
289  void CalculateBendingContribution(
290  const BoundedMatrix<double,9,3>& Bb,
291  const BoundedMatrix<double,3,3>& Eb,
293  );
294 
295  void AssembleBendingContribution(
296  const BoundedMatrix<double,9,9>& Kb,
297  const double& coeff,
298  BoundedMatrix<double,18,18>& Kloc_system
299  );
300 
301  void CalculateGaussPointContribution(
302  BoundedMatrix<double,18,18>& Kloc_system ,
303  const BoundedMatrix<double,3,3>& Em,
304  const BoundedMatrix<double,3,3>& Eb,
305  const double& weight,
306  const double& h, /*thickness*/
307  const double& loc1, /*local coords*/
308  const double& loc2,
309  const double& loc3,
310  const double& x12,
311  const double& x23,
312  const double& x31,
313  const double& y12,
314  const double& y23,
315  const double& y31
316  );
317 
318  double CalculateBeta(
319  const BoundedMatrix<double,3,3>& Em
320  );
321 
322  void CalculateMembraneElasticityTensor(
324  const double& h
325  );
326 
327  void CalculateBendingElasticityTensor(
329  const double& h );
330 
331  void CalculateAllMatrices(
332  MatrixType& rLeftHandSideMatrix,
333  VectorType& rRightHandSideVector,
334  const ProcessInfo& rCurrentProcessInfo
335  );
336 
337  void AddBodyForce(
338  const double& h,
339  const double& Area,
340  VectorType& rRightHandSideVector
341  );
342 
343  void RotateToGlobal(
344  const array_1d<double,3>& v1,
345  const array_1d<double,3>& v2,
346  const array_1d<double,3>& v3,
347  const BoundedMatrix<double,18,18>& Kloc_system,
348  Matrix& rLeftHandSideMatrix
349  );
350 
351  void RotateToGlobal(
352  const array_1d<double,3>& v1,
353  const array_1d<double,3>& v2,
354  const array_1d<double,3>& v3,
355  const BoundedMatrix<double,18,18>& Kloc_system,
356  Matrix& rLeftHandSideMatrix,
357  VectorType& rRightHandSideVector
358  );
359 
360 
361 
362  void NicePrint(const Matrix& A);
363 
364  void AddVoigtTensorComponents(
365  const double local_component,
367  const array_1d<double,3>& a,
368  const array_1d<double,3>& b
369  );
370 
371  void CalculateAndAddKg(
372  MatrixType& LHS,
373  BoundedMatrix<double,18,18>& rWorkMatrix,
374  const double& x12,
375  const double& x23,
376  const double& x31,
377  const double& y12,
378  const double& y23,
379  const double& y31,
380  const array_1d<double,3>& v1,
381  const array_1d<double,3>& v2,
382  const array_1d<double,3>& v3,
383  const double& A
384  );
385 
386  void CalculateKg_GaussPointContribution(
387  BoundedMatrix<double,18,18>& Kloc_system ,
388  const BoundedMatrix<double,3,3>& Em,
389  const double& weight,
390  const double& h, /*thickness*/
391  const double& loc1, /*local coords*/
392  const double& loc2,
393  const double& loc3,
394  const double& x12,
395  const double& x23,
396  const double& x31,
397  const double& y12,
398  const double& y23,
399  const double& y31,
400  const array_1d<double,9>& membrane_disp
401  );
402 
403  void CalculateLocalShapeDerivatives(
404  double alpha,
405  BoundedMatrix<double,2,9>& DNu_loc ,
406  BoundedMatrix<double,2,9>& DNv_loc ,
407  BoundedMatrix<double,2,9>& DNw_loc ,
408  const double& a, /*local coords*/ //loc1
409  const double& b, //loc2
410  const double& c, //loc3
411  const double& x12,
412  const double& x23,
413  const double& x31,
414  const double& y12,
415  const double& y23,
416  const double& y31
417  );
418 
419  void CalculateProjectionOperator(
420  BoundedMatrix<double,18,18>& rProjOperator,
421  const double& x12,
422  const double& x23,
423  const double& x31,
424  const double& y12,
425  const double& y23,
426  const double& y31
427  );
428 
429  void ApplyProjection(
430  BoundedMatrix<double,18,18>& rLeftHandSideMatrix,
431  VectorType& rRightHandSideVector,
432  BoundedMatrix<double,18,18>& rWorkMatrix,
433  array_1d<double,18>& rWorkArray,
434  const BoundedMatrix<double,18,18>& rProjOperator
435  );
436 
437  void UpdateNodalReferenceSystem(
438  const double& x12,
439  const double& x23,
440  const double& x31,
441  const double& y12,
442  const double& y23,
443  const double& y31
444  );
445 
446  void SaveOriginalReference(
447  const array_1d<double,3>& v1,
448  const array_1d<double,3>& v2,
449  const array_1d<double,3>& v3
450  );
451 
452  void CalculatePureDisplacement(
453  Vector& values,
454  const array_1d<double,3>& v1,
455  const array_1d<double,3>& v2,
456  const array_1d<double,3>& v3
457  );
458 
459  void CalculatePureMembraneDisplacement(
461  const array_1d<double,3>& v1,
462  const array_1d<double,3>& v2,
463  const array_1d<double,3>& v3
464  );
465 
466  void CalculatePureBendingDisplacement(
468  const array_1d<double,3>& v1,
469  const array_1d<double,3>& v2,
470  const array_1d<double,3>& v3
471  );
472 
473  void InvertMatrix(
474  const BoundedMatrix<double,3,3>& InputMatrix,
475  BoundedMatrix<double,3,3>& InvertedMatrix,
476  double& InputMatrixDet
477  );
478 
482 
483 
487 
488 
492  friend class Serializer;
493 
494  // A private default constructor necessary for serialization
495  ShellRigid(){}
496 
497  virtual void save(Serializer& rSerializer) const override
498  {
500  }
501 
502  virtual void load(Serializer& rSerializer) override
503  {
504  KRATOS_SERIALIZE_LOAD_BASE_CLASS(rSerializer, Element );
505  }
506 
510 
511 
515 
517  //ShellRigid& operator=(const ShellRigid& rOther);
518 
520  //ShellRigid(const ShellRigid& rOther);
521 
522 
524 
525 }; // Class ShellRigid
526 
528 /* inline std::istream& operator >> (std::istream& rIStream,
529  ShellRigid& rThis);
530 */
532 /* inline std::ostream& operator << (std::ostream& rOStream,
533  const ShellRigid& rThis)
534 {
535 rThis.PrintInfo(rOStream);
536 rOStream << std::endl;
537 rThis.PrintData(rOStream);
538 
539 return rOStream;
540 }*/
542 
543 } // namespace Kratos.
544 #endif // KRATOS_SHELL_RIGID_H_INCLUDED defined
545 
546 
Base class for all Elements.
Definition: element.h:60
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
std::size_t IndexType
Definition: flags.h:74
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Short class definition.
Definition: shell_rigid.h:94
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(ShellRigid)
Counted pointer of ShellRigid.
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
Short class definition.
Definition: array_1d.h:61
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
pybind11::list CalculateOnIntegrationPoints(TObject &dummy, const Variable< TDataType > &rVariable, const ProcessInfo &rProcessInfo)
Definition: add_mesh_to_python.cpp:142
TDataType Calculate(GeometryType &dummy, const Variable< TDataType > &rVariable)
Definition: add_geometries_to_python.cpp:103
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
list coeff
Definition: bombardelli_test.py:41
list values
Definition: bombardelli_test.py:42
v
Definition: generate_convection_diffusion_explicit_element.py:114
alpha
Definition: generate_convection_diffusion_explicit_element.py:113
h
Definition: generate_droplet_dynamics.py:91
a
Definition: generate_stokes_twofluid_element.py:77
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
c
Definition: generate_weakly_compressible_navier_stokes_element.py:108
def load(f)
Definition: ode_solve.py:307
A
Definition: sensitivityMatrix.py:70
B
Definition: sensitivityMatrix.py:76