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.
initial_stress_3D_utilities.hpp
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Ignasi de Pouplana
11 //
12 
13 #if !defined(KRATOS_INITIAL_STRESS_3D_UTILITIES )
14 #define KRATOS_INITIAL_STRESS_3D_UTILITIES
15 
16 // System includes
17 #include <fstream>
18 #include <iostream>
19 #include <cmath>
20 
21 // Project includes
22 #include "geometries/geometry.h"
23 #include "includes/define.h"
24 #include "includes/model_part.h"
26 #include "utilities/openmp_utils.h"
28 #include "utilities/math_utils.h"
29 
30 // Application includes
32 
33 namespace Kratos
34 {
35 
37 {
38 
39 protected:
40 
42 
44  {
48  };
49 
50 public:
51 
53 
56 
58 
61 
63 
64  void TransferInitialStresses (ModelPart& rInitialModelPart, ModelPart& rCurrentModelPart)
65  {
66  // Define necessary variables
67  UtilityVariables AuxVariables;
68 
69  this->ComputeCellMatrixDimensions(AuxVariables,rCurrentModelPart);
70 
71  this->NodalVariablesMapping(AuxVariables,rInitialModelPart,rCurrentModelPart);
72  }
73 
75 
76  void SaveInitialStresses (Parameters& rParameters, ModelPart& rCurrentModelPart)
77  {
78  std::fstream initial_stresses_mdpa;
79  std::string initial_stress_mdpa_path = rParameters["initial_input_filename"].GetString() + ".mdpa";
80 
81  initial_stresses_mdpa.open(initial_stress_mdpa_path.c_str(), std::fstream::out | std::fstream::trunc);
82  initial_stresses_mdpa.precision(15);
83 
84  initial_stresses_mdpa << "Begin Properties 0" << std::endl;
85  initial_stresses_mdpa << "End Properties" << std::endl << std::endl;
86 
87  const int NNodes = static_cast<int>(rCurrentModelPart.Nodes().size());
88  ModelPart::NodesContainerType::iterator node_begin = rCurrentModelPart.NodesBegin();
89  initial_stresses_mdpa << "Begin Nodes" << std::endl;
90  // #pragma omp parallel for
91  for(int i = 0; i < NNodes; i++) {
92  ModelPart::NodesContainerType::iterator it_node = node_begin + i;
93  initial_stresses_mdpa << it_node->Id() << " " <<
94  it_node->X0() << " " <<
95  it_node->Y0() << " " <<
96  it_node->Z0() << std::endl;
97  }
98  initial_stresses_mdpa << "End Nodes" << std::endl << std::endl;
99 
100  this->WriteLinearElements(initial_stresses_mdpa,rCurrentModelPart);
101 
102  this->CalculateNodalStresses(rCurrentModelPart);
103  Matrix InitialStressTensor(3,3);
104  initial_stresses_mdpa << "Begin NodalData INITIAL_STRESS_TENSOR" << std::endl;
105  // #pragma omp parallel for
106  for(int i = 0; i < NNodes; i++) {
107  ModelPart::NodesContainerType::iterator it_node = node_begin + i;
108  noalias(InitialStressTensor) = it_node->FastGetSolutionStepValue(NODAL_EFFECTIVE_STRESS_TENSOR);
109  initial_stresses_mdpa << it_node->Id() << " 0 [3,3] ((" <<
110  InitialStressTensor(0,0) << "," << InitialStressTensor(0,1) << "," << InitialStressTensor(0,2) << "),(" <<
111  InitialStressTensor(1,0) << "," << InitialStressTensor(1,1) << "," << InitialStressTensor(1,2) << "),(" <<
112  InitialStressTensor(2,0) << "," << InitialStressTensor(2,1) << "," << InitialStressTensor(2,2) << "))" << std::endl;
113  }
114  initial_stresses_mdpa << "End NodalData" << std::endl;
115 
116  initial_stresses_mdpa.close();
117  }
118 
119 protected:
120 
122 
124 
126  const UtilityVariables& AuxVariables,
127  ModelPart& rInitialModelPart,
128  ModelPart& rCurrentModelPart)
129  {
130  // Define ElementOld Cell matrix
131  std::vector< std::vector< std::vector< std::vector<Element::Pointer> > > > ElementOldCellMatrix;
132  ElementOldCellMatrix.resize(AuxVariables.NRows);
133  for(int i = 0; i < AuxVariables.NRows; i++)
134  ElementOldCellMatrix[i].resize(AuxVariables.NColumns);
135  for(int i = 0; i < AuxVariables.NRows; i++)
136  {
137  for(int j = 0; j < AuxVariables.NColumns; j++)
138  {
139  ElementOldCellMatrix[i][j].resize(AuxVariables.NSections);
140  }
141  }
142 
143  // Locate Old Elments in cells
144  double X_me;
145  double Y_me;
146  double Z_me;
147  int PointsNumber;
148 
149  int NElems = static_cast<int>(rInitialModelPart.Elements().size());
150  ModelPart::ElementsContainerType::iterator el_begin = rInitialModelPart.ElementsBegin();
151 
152  #pragma omp parallel for private(X_me,Y_me,Z_me,PointsNumber)
153  for(int i = 0; i < NElems; i++)
154  {
155  ModelPart::ElementsContainerType::iterator itElemOld = el_begin + i;
156 
157  double X_left = itElemOld->GetGeometry().GetPoint(0).X0();
158  double X_right = X_left;
159  double Y_top = itElemOld->GetGeometry().GetPoint(0).Y0();
160  double Y_bot = Y_top;
161  double Z_back = itElemOld->GetGeometry().GetPoint(0).Z0();
162  double Z_front = Z_back;
163  PointsNumber = itElemOld->GetGeometry().PointsNumber();
164 
165  for(int j = 1; j < PointsNumber; j++)
166  {
167  X_me = itElemOld->GetGeometry().GetPoint(j).X0();
168  Y_me = itElemOld->GetGeometry().GetPoint(j).Y0();
169  Z_me = itElemOld->GetGeometry().GetPoint(j).Z0();
170 
171  if(X_me > X_right) X_right = X_me;
172  else if(X_me < X_left) X_left = X_me;
173  if(Y_me > Y_top) Y_top = Y_me;
174  else if(Y_me < Y_bot) Y_bot = Y_me;
175  if(Z_me > Z_front) Z_front = Z_me;
176  else if(Z_me < Z_back) Z_back = Z_me;
177  }
178 
179  int Column_left = int((X_left-AuxVariables.X_min)/AuxVariables.ColumnSize);
180  int Column_right = int((X_right-AuxVariables.X_min)/AuxVariables.ColumnSize);
181  int Row_top = int((AuxVariables.Y_max-Y_top)/AuxVariables.RowSize);
182  int Row_bot = int((AuxVariables.Y_max-Y_bot)/AuxVariables.RowSize);
183  int Section_back = int((Z_back-AuxVariables.Z_min)/AuxVariables.SectionSize);
184  int Section_front = int((Z_front-AuxVariables.Z_min)/AuxVariables.SectionSize);
185 
186  if(Column_left < 0) Column_left = 0;
187  else if(Column_left >= AuxVariables.NColumns) Column_left = AuxVariables.NColumns-1;
188  if(Column_right >= AuxVariables.NColumns) Column_right = AuxVariables.NColumns-1;
189  else if(Column_right < 0) Column_right = 0;
190  if(Row_top < 0) Row_top = 0;
191  else if(Row_top >= AuxVariables.NRows) Row_top = AuxVariables.NRows-1;
192  if(Row_bot >= AuxVariables.NRows) Row_bot = AuxVariables.NRows-1;
193  else if(Row_bot < 0) Row_bot = 0;
194  if(Section_back < 0) Section_back = 0;
195  else if(Section_back >= AuxVariables.NSections) Section_back = AuxVariables.NSections-1;
196  if(Section_front >= AuxVariables.NSections) Section_front = AuxVariables.NSections-1;
197  else if(Section_front < 0) Section_front = 0;
198 
199  for(int s = Section_back; s <= Section_front; s++)
200  {
201  for(int k = Row_top; k <= Row_bot; k++)
202  {
203  for(int l = Column_left; l <= Column_right; l++)
204  {
205  #pragma omp critical
206  {
207  ElementOldCellMatrix[k][l][s].push_back((*(itElemOld.base())));
208  }
209  }
210  }
211  }
212  }
213 
214  // Locate current nodes inside initial elements and interpolate nodal variables
215  const int NNodes = static_cast<int>(rCurrentModelPart.Nodes().size());
216  ModelPart::NodesContainerType::iterator node_begin = rCurrentModelPart.NodesBegin();
217 
218  array_1d<double,3> GlobalCoordinates;
219  array_1d<double,3> LocalCoordinates;
220 
221  #pragma omp parallel for private(X_me,Y_me,Z_me,PointsNumber,GlobalCoordinates,LocalCoordinates)
222  for(int i = 0; i < NNodes; i++)
223  {
224  ModelPart::NodesContainerType::iterator itNodeNew = node_begin + i;
225 
226  X_me = itNodeNew->X0();
227  Y_me = itNodeNew->Y0();
228  Z_me = itNodeNew->Z0();
229 
230  int Column = int((X_me-AuxVariables.X_min)/AuxVariables.ColumnSize);
231  int Row = int((AuxVariables.Y_max-Y_me)/AuxVariables.RowSize);
232  int Section = int((Z_me-AuxVariables.Z_min)/AuxVariables.SectionSize);
233 
234  if(Column >= AuxVariables.NColumns) Column = AuxVariables.NColumns-1;
235  else if(Column < 0) Column = 0;
236  if(Row >= AuxVariables.NRows) Row = AuxVariables.NRows-1;
237  else if(Row < 0) Row = 0;
238  if(Section >= AuxVariables.NSections) Section = AuxVariables.NSections-1;
239  else if(Section < 0) Section = 0;
240 
241  noalias(GlobalCoordinates) = itNodeNew->Coordinates(); //Coordinates of new nodes are still in the original position
242  bool IsInside = false;
243  Element::Pointer pElementOld;
244 
245  for(unsigned int m = 0; m < (ElementOldCellMatrix[Row][Column][Section]).size(); m++)
246  {
247  pElementOld = ElementOldCellMatrix[Row][Column][Section][m];
248  IsInside = pElementOld->GetGeometry().IsInside(GlobalCoordinates,LocalCoordinates); //Checks whether the global coordinates fall inside the original old element
249  if(IsInside) break;
250  }
251  // if(IsInside==false)
252  // {
253  // for(unsigned int m = 0; m < (ElementOldCellMatrix[Row][Column][Section]).size(); m++)
254  // {
255  // pElementOld = ElementOldCellMatrix[Row][Column][Section][m];
256  // IsInside = pElementOld->GetGeometry().IsInside(GlobalCoordinates,LocalCoordinates,1.0e-5);
257  // if(IsInside) break;
258  // }
259  // }
260  if(IsInside==false)
261  {
262  for(int j = 0; j < 12; j++)
263  {
264  for(int k = 1; k<10; k++)
265  {
266  for(unsigned int m = 0; m < (ElementOldCellMatrix[Row][Column][Section]).size(); m++)
267  {
268  pElementOld = ElementOldCellMatrix[Row][Column][Section][m];
269  double tol = k * pow(10.0, (j-12));
270  IsInside = pElementOld->GetGeometry().IsInside(GlobalCoordinates,LocalCoordinates,tol);
271  if(IsInside) break;
272  }
273  if(IsInside) break;
274  }
275  if(IsInside) break;
276  }
277  }
278 
279  if(IsInside == false)
280  std::cout << "ERROR!!, NONE OF THE OLD ELEMENTS CONTAINS NODE: " << itNodeNew->Id() << std::endl;
281 
282  PointsNumber = pElementOld->GetGeometry().PointsNumber();
283 
284  Vector ShapeFunctionsValuesVector(PointsNumber);
285  pElementOld->GetGeometry().ShapeFunctionsValues(ShapeFunctionsValuesVector,LocalCoordinates);
286 
287  // Interpolation of nodal variables
288  std::vector<Vector> ComponentsNodalVariableVector(6); // voigt_size
289  for(int j = 0; j < 6; j++) { // voigt_size
290  ComponentsNodalVariableVector[j].resize(PointsNumber);
291  }
292  Vector nodal_initial_stress_vector(6); // voigt_size
293  Matrix nodal_initial_stress_tensor(3,3); // dimension
294  for(int j = 0; j < PointsNumber; j++) {
295  noalias(nodal_initial_stress_tensor) = pElementOld->GetGeometry().GetPoint(j).FastGetSolutionStepValue(INITIAL_STRESS_TENSOR);
296  noalias(nodal_initial_stress_vector) = MathUtils<double>::StressTensorToVector(nodal_initial_stress_tensor);
297  for (int k= 0; k < 6; k++) { // voigt_size
298  ComponentsNodalVariableVector[k][j] = nodal_initial_stress_vector[k];
299  }
300  }
301  for (int k= 0; k < 6; k++) { // voigt_size
302  nodal_initial_stress_vector[k] = inner_prod(ShapeFunctionsValuesVector,ComponentsNodalVariableVector[k]);
303  }
304  noalias(nodal_initial_stress_tensor) = MathUtils<double>::StressVectorToTensor(nodal_initial_stress_vector);
305  Matrix& rNodalStress = itNodeNew->FastGetSolutionStepValue(INITIAL_STRESS_TENSOR);
306  if(rNodalStress.size1() != 3) // Dimension
307  rNodalStress.resize(3,3,false);
308  noalias(rNodalStress) = nodal_initial_stress_tensor;
309  }
310  }
311 
313 
314 private:
315 
317 
318  void ComputeCellMatrixDimensions(
319  UtilityVariables& rAuxVariables,
320  ModelPart& rModelPart)
321  {
322  // Compute X, Y and Z limits of the current geometry
323  unsigned int NumThreads = ParallelUtilities::GetNumThreads();
324  std::vector<double> X_max_partition(NumThreads);
325  std::vector<double> X_min_partition(NumThreads);
326  std::vector<double> Y_max_partition(NumThreads);
327  std::vector<double> Y_min_partition(NumThreads);
328  std::vector<double> Z_max_partition(NumThreads);
329  std::vector<double> Z_min_partition(NumThreads);
330 
331  const int NNodes = static_cast<int>(rModelPart.Nodes().size());
332  ModelPart::NodesContainerType::iterator node_begin = rModelPart.NodesBegin();
333 
334  #pragma omp parallel
335  {
336  int k = OpenMPUtils::ThisThread();
337 
338  X_max_partition[k] = node_begin->X();
339  X_min_partition[k] = X_max_partition[k];
340  Y_max_partition[k] = node_begin->Y();
341  Y_min_partition[k] = Y_max_partition[k];
342  Z_max_partition[k] = node_begin->Z();
343  Z_min_partition[k] = Z_max_partition[k];
344 
345  double X_me, Y_me, Z_me;
346 
347  #pragma omp for
348  for(int i = 0; i < NNodes; i++)
349  {
350  ModelPart::NodesContainerType::iterator itNode = node_begin + i;
351 
352  X_me = itNode->X();
353  Y_me = itNode->Y();
354  Z_me = itNode->Z();
355 
356  if( X_me > X_max_partition[k] ) X_max_partition[k] = X_me;
357  else if( X_me < X_min_partition[k] ) X_min_partition[k] = X_me;
358 
359  if( Y_me > Y_max_partition[k] ) Y_max_partition[k] = Y_me;
360  else if( Y_me < Y_min_partition[k] ) Y_min_partition[k] = Y_me;
361 
362  if( Z_me > Z_max_partition[k] ) Z_max_partition[k] = Z_me;
363  else if( Z_me < Z_min_partition[k] ) Z_min_partition[k] = Z_me;
364  }
365  }
366 
367  rAuxVariables.X_max = X_max_partition[0];
368  rAuxVariables.X_min = X_min_partition[0];
369  rAuxVariables.Y_max = Y_max_partition[0];
370  rAuxVariables.Y_min = Y_min_partition[0];
371  rAuxVariables.Z_max = Z_max_partition[0];
372  rAuxVariables.Z_min = Z_min_partition[0];
373 
374  for(unsigned int i=1; i < NumThreads; i++)
375  {
376  if(X_max_partition[i] > rAuxVariables.X_max) rAuxVariables.X_max = X_max_partition[i];
377  if(X_min_partition[i] < rAuxVariables.X_min) rAuxVariables.X_min = X_min_partition[i];
378  if(Y_max_partition[i] > rAuxVariables.Y_max) rAuxVariables.Y_max = Y_max_partition[i];
379  if(Y_min_partition[i] < rAuxVariables.Y_min) rAuxVariables.Y_min = Y_min_partition[i];
380  if(Z_max_partition[i] > rAuxVariables.Z_max) rAuxVariables.Z_max = Z_max_partition[i];
381  if(Z_min_partition[i] < rAuxVariables.Z_min) rAuxVariables.Z_min = Z_min_partition[i];
382  }
383 
384  // Calculate Average Element Length
385  double AverageElementLength = 0.0;
386 
387  int NElems = static_cast<int>(rModelPart.Elements().size());
388  ModelPart::ElementsContainerType::iterator el_begin = rModelPart.ElementsBegin();
389 
390  #pragma omp parallel for reduction(+:AverageElementLength)
391  for(int i = 0; i < NElems; i++)
392  {
393  ModelPart::ElementsContainerType::iterator itElem = el_begin + i;
394 
395  AverageElementLength += itElem->GetGeometry().Length();
396  }
397 
398  AverageElementLength = AverageElementLength/NElems;
399 
400  // Compute FracturePoints CellMatrix dimensions
401  rAuxVariables.NRows = int((rAuxVariables.Y_max-rAuxVariables.Y_min)/AverageElementLength);
402  rAuxVariables.NColumns = int((rAuxVariables.X_max-rAuxVariables.X_min)/AverageElementLength);
403  rAuxVariables.NSections = int((rAuxVariables.Z_max-rAuxVariables.Z_min)/AverageElementLength);
404  if(rAuxVariables.NRows <= 0) rAuxVariables.NRows = 1;
405  if(rAuxVariables.NColumns <= 0) rAuxVariables.NColumns = 1;
406  if(rAuxVariables.NSections <= 0) rAuxVariables.NSections = 1;
407  rAuxVariables.RowSize = (rAuxVariables.Y_max-rAuxVariables.Y_min)/rAuxVariables.NRows;
408  rAuxVariables.ColumnSize = (rAuxVariables.X_max-rAuxVariables.X_min)/rAuxVariables.NColumns;
409  rAuxVariables.SectionSize = (rAuxVariables.Z_max-rAuxVariables.Z_min)/rAuxVariables.NSections;
410  }
411 
413 
414  void CalculateNodalStresses(ModelPart& rCurrentModelPart) {
415 
416  // Clear nodal Stresses
417  const int NNodes = static_cast<int>(rCurrentModelPart.Nodes().size());
418  ModelPart::NodesContainerType::iterator node_begin = rCurrentModelPart.NodesBegin();
419 
420  #pragma omp parallel for
421  for(int i = 0; i < NNodes; i++)
422  {
423  ModelPart::NodesContainerType::iterator it_node = node_begin + i;
424  it_node->FastGetSolutionStepValue(NODAL_AREA) = 0.0;
425  Matrix& rNodalStress = it_node->FastGetSolutionStepValue(NODAL_EFFECTIVE_STRESS_TENSOR);
426  if(rNodalStress.size1() != 3) // Dimension
427  rNodalStress.resize(3,3,false);
428  noalias(rNodalStress) = ZeroMatrix(3,3);
429  }
430 
431  // Calculate and Extrapolate Stresses
432  const ProcessInfo& r_current_process_info = rCurrentModelPart.GetProcessInfo();
433  const auto it_elem_begin = rCurrentModelPart.ElementsBegin();
434  #pragma omp parallel for
435  for(int i=0; i<static_cast<int>(rCurrentModelPart.Elements().size()); ++i) {
436  auto it_elem = it_elem_begin + i;
437  it_elem->FinalizeSolutionStep(r_current_process_info);
438  }
439 
440  // Compute smoothed Stresses
441  #pragma omp parallel for
442  for(int n = 0; n < NNodes; n++)
443  {
444  ModelPart::NodesContainerType::iterator it_node = node_begin + n;
445  const double& NodalArea = it_node->FastGetSolutionStepValue(NODAL_AREA);
446  if (NodalArea>1.0e-20)
447  {
448  const double InvNodalArea = 1.0/NodalArea;
449  Matrix& rNodalStress = it_node->FastGetSolutionStepValue(NODAL_EFFECTIVE_STRESS_TENSOR);
450  for(unsigned int i = 0; i<3; i++) // Dimension
451  {
452  for(unsigned int j = 0; j<3; j++)
453  {
454  rNodalStress(i,j) *= InvNodalArea;
455  }
456  }
457  }
458  }
459  }
460 
462 
463  void WriteLinearElements(std::fstream& rInitialStressesMdpa, ModelPart& rCurrentModelPart) {
464 
465  int NElems = static_cast<int>(rCurrentModelPart.Elements().size());
466  ModelPart::ElementsContainerType::iterator el_begin = rCurrentModelPart.ElementsBegin();
467  // NOTE: we are assuming that only one type of element is used (not quadratic elements)
468  int PointsNumber = el_begin->GetGeometry().PointsNumber();
469  if(PointsNumber == 4){
470  rInitialStressesMdpa << "Begin Elements Element3D4N" << std::endl;
471  // #pragma omp parallel for
472  for(int i = 0; i < NElems; i++)
473  {
474  ModelPart::ElementsContainerType::iterator it_elem = el_begin + i;
475  rInitialStressesMdpa << it_elem->Id() << " 0 " <<
476  it_elem->GetGeometry().GetPoint(0).Id() << " " <<
477  it_elem->GetGeometry().GetPoint(1).Id() << " " <<
478  it_elem->GetGeometry().GetPoint(2).Id() << " " <<
479  it_elem->GetGeometry().GetPoint(3).Id() << std::endl;
480  }
481  } else {
482  rInitialStressesMdpa << "Begin Elements Element3D8N" << std::endl;
483  // #pragma omp parallel for
484  for(int i = 0; i < NElems; i++)
485  {
486  ModelPart::ElementsContainerType::iterator it_elem = el_begin + i;
487  rInitialStressesMdpa << it_elem->Id() << " 0 " <<
488  it_elem->GetGeometry().GetPoint(0).Id() << " " <<
489  it_elem->GetGeometry().GetPoint(1).Id() << " " <<
490  it_elem->GetGeometry().GetPoint(2).Id() << " " <<
491  it_elem->GetGeometry().GetPoint(3).Id() << " " <<
492  it_elem->GetGeometry().GetPoint(4).Id() << " " <<
493  it_elem->GetGeometry().GetPoint(5).Id() << " " <<
494  it_elem->GetGeometry().GetPoint(6).Id() << " " <<
495  it_elem->GetGeometry().GetPoint(7).Id() << std::endl;
496  }
497  }
498  rInitialStressesMdpa << "End Elements" << std::endl << std::endl;
499  }
500 
501 }; // Class InitialStress3DUtilities
502 
503 } // namespace Kratos.
504 
505 #endif /* KRATOS_INITIAL_STRESS_3D_UTILITIES defined */
Definition: initial_stress_3D_utilities.hpp:37
void NodalVariablesMapping(const UtilityVariables &AuxVariables, ModelPart &rInitialModelPart, ModelPart &rCurrentModelPart)
Member Variables.
Definition: initial_stress_3D_utilities.hpp:125
void SaveInitialStresses(Parameters &rParameters, ModelPart &rCurrentModelPart)
Definition: initial_stress_3D_utilities.hpp:76
void TransferInitialStresses(ModelPart &rInitialModelPart, ModelPart &rCurrentModelPart)
Definition: initial_stress_3D_utilities.hpp:64
InitialStress3DUtilities()
Constructor.
Definition: initial_stress_3D_utilities.hpp:55
KRATOS_CLASS_POINTER_DEFINITION(InitialStress3DUtilities)
virtual ~InitialStress3DUtilities()
Destructor.
Definition: initial_stress_3D_utilities.hpp:60
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
static TMatrixType StressVectorToTensor(const TVector &rStressVector)
Transforms a stess vector into a matrix. Stresses are assumed to be stored in the following way: for...
Definition: math_utils.h:1174
static TVector StressTensorToVector(const TMatrixType &rStressTensor, SizeType rSize=0)
Transforms a given symmetric Stress Tensor to Voigt Notation:
Definition: math_utils.h:1399
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
static int ThisThread()
Wrapper for omp_get_thread_num().
Definition: openmp_utils.h:108
static int GetNumThreads()
Returns the current number of threads.
Definition: parallel_utilities.cpp:34
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
std::string GetString() const
This method returns the string contained in the current Parameter.
Definition: kratos_parameters.cpp:684
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
Internals::Matrix< double, AMatrix::dynamic, AMatrix::dynamic > Matrix
Definition: amatrix_interface.h:470
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
REACTION_CHECK_STIFFNESS_FACTOR int
Definition: contact_structural_mechanics_application_variables.h:75
ProcessInfo
Definition: edgebased_PureConvection.py:116
int tol
Definition: hinsberg_optimization.py:138
out
Definition: isotropic_damage_automatic_differentiation.py:200
int n
manufactured solution and derivatives (u=0 at z=0 dudz=0 at z=domain_height)
Definition: ode_solve.py:402
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
int m
Definition: run_marine_rain_substepping.py:8
integer i
Definition: TensorModule.f:17
integer l
Definition: TensorModule.f:17
Basic Structs for the utility -----------------------------------------------------------------------...
Definition: initial_stress_3D_utilities.hpp:44
double X_min
Definition: initial_stress_3D_utilities.hpp:45
double X_max
Definition: initial_stress_3D_utilities.hpp:45
double Z_max
Definition: initial_stress_3D_utilities.hpp:45
int NSections
Definition: initial_stress_3D_utilities.hpp:46
int NColumns
Definition: initial_stress_3D_utilities.hpp:46
double Y_max
Definition: initial_stress_3D_utilities.hpp:45
double ColumnSize
Definition: initial_stress_3D_utilities.hpp:47
double Z_min
Definition: initial_stress_3D_utilities.hpp:45
double SectionSize
Definition: initial_stress_3D_utilities.hpp:47
double Y_min
Definition: initial_stress_3D_utilities.hpp:45
int NRows
Definition: initial_stress_3D_utilities.hpp:46
double RowSize
Definition: initial_stress_3D_utilities.hpp:47