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.
two_fluid_vms.h
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: Riccardo Rossi
11 // Jordi Cotela
12 //
13 
14 #if !defined(KRATOS_TWO_FLUID_VMS_H_INCLUDED )
15 #define KRATOS_TWO_FLUID_VMS_H_INCLUDED
16 // System includes
17 #include <string>
18 #include <iostream>
19 // External includes
20 // Project includes
21 #include "containers/array_1d.h"
22 #include "includes/define.h"
23 #include "custom_elements/vms.h"
24 #include "includes/serializer.h"
25 #include "utilities/geometry_utilities.h"
26 #include "utilities/math_utils.h"
28 // #include "utilities/enrichment_utilities.h"
30 // Application includes
32 #include "vms.h"
33 
34 namespace Kratos
35 {
36 
77 template< unsigned int TDim,
78  unsigned int TNumNodes = TDim + 1 >
79 class TwoFluidVMS : public VMS<TDim, TNumNodes>
80 {
81 public:
91  typedef Node NodeType;
103  typedef std::size_t IndexType;
104  typedef std::size_t SizeType;
105  typedef std::vector<std::size_t> EquationIdVectorType;
106  typedef std::vector< Dof<double>::Pointer > DofsVectorType;
111  //Constructors.
113 
116  TwoFluidVMS(IndexType NewId = 0) :
117  ElementBaseType(NewId)
118  {
119  }
121 
125  TwoFluidVMS(IndexType NewId, const NodesArrayType& ThisNodes) :
126  ElementBaseType(NewId, ThisNodes)
127  {
128  }
130 
134  TwoFluidVMS(IndexType NewId, GeometryType::Pointer pGeometry) :
135  ElementBaseType(NewId, pGeometry)
136  {
137  }
139 
144  TwoFluidVMS(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties) :
145  ElementBaseType(NewId, pGeometry, pProperties)
146  {
147  }
149  ~TwoFluidVMS() override
150  {
151  }
159 
166  Element::Pointer Create(IndexType NewId, NodesArrayType const& ThisNodes,
167  PropertiesType::Pointer pProperties) const override
168  {
169  return Kratos::make_intrusive< TwoFluidVMS >(NewId, (this->GetGeometry()).Create(ThisNodes), pProperties);
170  }
171  Element::Pointer Create(IndexType NewId,
172  GeometryType::Pointer pGeom,
173  PropertiesType::Pointer pProperties) const override
174  {
175  return Kratos::make_intrusive< TwoFluidVMS >(NewId, pGeom, pProperties);
176  }
177 
179 
187  void CalculateRightHandSide(VectorType& rRightHandSideVector,
188  const ProcessInfo& rCurrentProcessInfo) override
189  {
190  const unsigned int local_size = (TDim+1)*(TDim+1);
192  CalculateLocalSystem(tmp,rRightHandSideVector,rCurrentProcessInfo);
193  }
194 
196 
203  void CalculateMassMatrix(MatrixType& rMassMatrix, const ProcessInfo& rCurrentProcessInfo) override
204  {
205  KRATOS_THROW_ERROR(std::logic_error,"MassMatrix function shall not be called when using this type of element","");
206  }
207 
208 
213  void CalculateLocalSystem(MatrixType& rLeftHandSideMatrix,
214  VectorType& rRightHandSideVector,
215  const ProcessInfo& rCurrentProcessInfo) override
216  {
217  const unsigned int LocalSize = (TDim + 1) * TNumNodes;
218 
219  const ProcessInfo& rConstProcessInfo = rCurrentProcessInfo; // Taking const reference for thread safety
220 
221  //****************************************************
222  // Resize and set to zero the RHS
223  if(rRightHandSideVector.size() != LocalSize)
224  rRightHandSideVector.resize(LocalSize,false);
225  noalias(rRightHandSideVector) = ZeroVector(LocalSize);
226 
227  // Resize and set to zero the LHS
228  if (rLeftHandSideMatrix.size1() != LocalSize)
229  rLeftHandSideMatrix.resize(LocalSize, LocalSize, false);
230  noalias(rLeftHandSideMatrix) = ZeroMatrix(LocalSize, LocalSize);
231 
232  Matrix MassMatrix = ZeroMatrix(LocalSize, LocalSize);
233 
234  //****************************************************
235  //Get Vector of BDF coefficients
236  const Vector& BDFVector = rConstProcessInfo[BDF_COEFFICIENTS];
237 
238  //****************************************************
239  // Get this element's geometric properties
240  double Area;
243  GeometryUtils::CalculateGeometryData(this->GetGeometry(), DN_DX, N, Area);
244 
245 
246  //estimate a minimal h
247  /*double h=0.0;
248  if constexpr (TDim == 3) h = pow(6.0*Area, 1.0/3.0);
249  else h = sqrt(2.0*Area);*/
250 
251 
252 
253  //input data for enrichment function
254  Vector distances(TNumNodes);
255  Matrix coords(TNumNodes, TDim);
256 
257  //output data for enrichment function
258  Matrix Nenriched;
259  Vector volumes;
260  Matrix Ngauss;
261  Vector signs(6);
262  std::vector< Matrix > gauss_gradients;
263 
264 
265  //fill coordinates
266  for (unsigned int i = 0; i < TNumNodes; i++)
267  {
268  const array_1d<double, 3 > & xyz = this->GetGeometry()[i].Coordinates();
269 // volumes[i] = 0.0;
270  distances[i] = this->GetGeometry()[i].FastGetSolutionStepValue(DISTANCE);
271  for (unsigned int j = 0; j < TDim; j++)
272  coords(i, j) = xyz[j];
273  }
274 
275 /* for (unsigned int i = 0; i < 6; i++)
276  gauss_gradients[i].resize(1, TDim, false);
277 */
278 // unsigned int ndivisions = EnrichmentUtilities::CalculateTetrahedraEnrichedShapeFuncions(coords, DN_DX, distances, volumes, Ngauss, signs, gauss_gradients, Nenriched);
279  unsigned int ndivisions = EnrichmentUtilitiesDuplicateDofs::CalculateTetrahedraEnrichedShapeFuncions(coords, DN_DX, distances, volumes, Ngauss, signs, gauss_gradients, Nenriched);
280  const unsigned int nenrichments = Nenriched.size2();
281 
282  Matrix enrichment_terms_vertical = ZeroMatrix(LocalSize,nenrichments);
283  Matrix enrichment_terms_horizontal = ZeroMatrix(nenrichments,LocalSize);
284 
285  Matrix enrichment_diagonal = ScalarMatrix(nenrichments,nenrichments,0.0);
286  Vector enriched_rhs(nenrichments,0.0);
288 
289  double positive_volume = 0.0;
290  double negative_volume = 0.0;
291 
292  if(ndivisions == 1) //compute gauss points for exact integration of a tetra element
293  {
295 
297 
298  volumes.resize(IntegrationPoints.size(),false);
299 
300  for (unsigned int g = 0; g < this->GetGeometry().IntegrationPointsNumber(GeometryData::IntegrationMethod::GI_GAUSS_2); g++)
301  {
302  volumes[g] = 6.0*Area * IntegrationPoints[g].Weight();
303  signs[g] = signs[0];
304  }
305 
306  }
307 // else
308 // {
309 // Matrix aux = Ngauss;
310 // Ngauss.resize(ndivisions,Ngauss.size2(),false);
311 // for(unsigned int i=0; i<ndivisions; i++)
312 // for(unsigned int k=0; k<Ngauss.size2(); k++)
313 // Ngauss(i,k) = aux(i,k);
314 // }
315 /* KRATOS_WATCH(this->Id());
316 KRATOS_WATCH(volumes);
317 KRATOS_WATCH(Ngauss); */
318 
319  for (unsigned int igauss = 0; igauss < Ngauss.size1(); igauss++)
320  {
321  double wGauss = volumes[igauss];
322 
323 
324  if(signs[igauss] > 0) //check positive and negative volume
325  positive_volume += wGauss;
326  else
327  negative_volume += wGauss;
328  }
329 
330 
331  const double min_area_ratio = 1e-6;
332 // if(positive_volume/Area < min_area_ratio)
333 // {
334 // for (unsigned int igauss = 0; igauss < Ngauss.size1(); igauss++)
335 // {
336 // if(signs[igauss] > 0) //check positive and negative volume
337 // volumes[igauss] =0.0;
338 // }
339 // }
340 //
341 // if(negative_volume/Area < min_area_ratio)
342 // {
343 // for (unsigned int igauss = 0; igauss < Ngauss.size1(); igauss++)
344 // {
345 // if(signs[igauss] < 0) //check positive and negative volume
346 // volumes[igauss] =0.0;
347 // }
348 // }
349 
350  // Porous media losses
351  const Properties& r_properties = this->GetProperties();
352  const double c1 = r_properties[LIN_DARCY_COEF];
353  const double c2 = r_properties[NONLIN_DARCY_COEF];
354 
355 
356  //****************************************************
357  //compute LHS and RHS + first part of mass computation
358  for (unsigned int igauss = 0; igauss < Ngauss.size1(); igauss++)
359  {
360  //assigning the gauss data
361  for (unsigned int k = 0; k < TNumNodes; k++)
362  N[k] = Ngauss(igauss, k);
363  double wGauss = volumes[igauss];
364 
365 
366 // if(signs[igauss] > 0) //check positive and negative volume
367 // positive_volume += wGauss;
368 // else
369 // negative_volume += wGauss;
370 
371  //****************************************************
372  // Calculate this element's fluid properties
373  double Density;
374  this->EvaluateInPoint(Density, DENSITY, N);
375 
376  double ElemSize = this->ElementSize(Area);
377  double Viscosity = this->EffectiveViscosity(Density,N,DN_DX,ElemSize,rCurrentProcessInfo);
378 
379  //compute RHS contributions
380  this->AddMomentumRHS(rRightHandSideVector, Density, N, wGauss);
381 
382  // Get Advective velocity
383  array_1d<double, 3 > AdvVel;
384  this->GetAdvectiveVel(AdvVel, N);
385  const double VelNorm = MathUtils<double>::Norm3(AdvVel);
386 
387  const double DarcyTerm = this->CalculateDarcyTerm(Density, Viscosity, c1, c2, N);
388  // Calculate stabilization parameters
389  double TauOne, TauTwo;
390 
391  //compute stabilization parameters
392  this->CalculateStabilizationTau(TauOne, TauTwo, VelNorm, ElemSize, Density, Viscosity, DarcyTerm, rCurrentProcessInfo);
393 
394  this->AddIntegrationPointVelocityContribution(rLeftHandSideMatrix, rRightHandSideVector, Density, Viscosity, AdvVel, DarcyTerm, TauOne, TauTwo, N, DN_DX, wGauss);
395 
396  //compute mass matrix - terms related to real mass
397  this->AddConsistentMassMatrixContribution(MassMatrix, N, Density, wGauss);
398 
399 
400  //****************************************************
401  //enrichment variables
402  if (ndivisions > 1)
403  {
404 // KRATOS_WATCH(Nenriched);
405  this->EvaluateInPoint(bf, BODY_FORCE, N);
406 
407  //note that here we compute only a part of the acceleration term
408  //this is done like this since the velocity*BDFVector[0] is treated implicitly
409  array_1d<double,3> OldAcceleration = ZeroVector(3);
410  for(unsigned int step=1; step<BDFVector.size(); step++)
411  {
412  for(unsigned int jjj=0; jjj<(this->GetGeometry()).size(); jjj++)
413  OldAcceleration += N[jjj] * BDFVector[step] * (this->GetGeometry())[jjj].FastGetSolutionStepValue(VELOCITY,step);
414  }
415 
416  for(unsigned int enriched_id = 0; enriched_id < nenrichments; enriched_id++)
417  {
418  const Matrix& enriched_grad = gauss_gradients[igauss];
419 // KRATOS_WATCH(enriched_grad);
420 
421 
422  //compute enrichment terms contribution
423  for (unsigned int inode = 0; inode < TNumNodes; inode++)
424  {
425  int base_index = (TDim + 1) * inode;
426  array_1d<double,TNumNodes> AGradN = ZeroVector(TNumNodes);
427  this->GetConvectionOperator(AGradN,AdvVel,DN_DX);
428  //momentum term
429  for (unsigned int k = 0; k < TDim; k++)
430  {
431  double convection_stab = wGauss * TauOne * enriched_grad(enriched_id,k)* Density * AGradN[inode];
432  double darcy_stab = wGauss * TauOne * enriched_grad(enriched_id,k) * DarcyTerm * N[inode];
433 
434  // enrichment_terms_vertical[base_index + k] += velocity_stab + wGauss*N[inode]*enriched_grad(0, k);
435  enrichment_terms_vertical(base_index + k,enriched_id) += convection_stab - darcy_stab - wGauss * DN_DX(inode, k) * Nenriched(igauss, enriched_id);
436  enrichment_terms_horizontal(enriched_id,base_index + k) += convection_stab + darcy_stab + wGauss * DN_DX(inode, k) * Nenriched(igauss, enriched_id);
437  // enrichment_terms_vertical[base_index + k] +=wGauss*N[inode]*enriched_grad(0, k); //-= wGauss * DN_DX(inode, k) * Nenriched(igauss, 0);
438  // enrichment_terms_horizontal[base_index + k] -=Density*wGauss*N[inode]*enriched_grad(0, k); // += Density*wGauss * DN_DX(inode, k) * Nenriched(igauss, 0);
439  }
440  //pressure term
441  for (unsigned int k = 0; k < TDim; k++)
442  {
443  double temp = wGauss * TauOne* DN_DX(inode, k) * enriched_grad(enriched_id, k);
444  enrichment_terms_vertical(base_index + TDim,enriched_id) += temp;
445  enrichment_terms_horizontal(enriched_id,base_index + TDim) += temp;
446  }
447  //add acceleration enrichment term
448  for (unsigned int k = 0; k < TDim; k++)
449  {
450  double coeff = wGauss * TauOne *Density * enriched_grad(enriched_id,k)*N[inode] * BDFVector[0];
451  enrichment_terms_horizontal(enriched_id,base_index + k) += coeff;
452  //i believe this shall not be here!! enriched_rhs += coeff * (old_vnode[k]);
453  // enrichment_terms_vertical[base_index + k] +=wGauss*N[inode]*gauss_gradients[igauss](0, k); //-= wGauss * DN_DX(inode, k) * Nenriched(igauss, 0);
454  // enrichment_terms_horizontal[base_index + k] -=Density*wGauss*N[inode]*gauss_gradients[igauss](0, k); // += Density*wGauss * DN_DX(inode, k) * Nenriched(igauss, 0);
455  }
456  }
457  //compute diagonal enrichment terms
458 
459  for (unsigned int k = 0; k < TDim; k++)
460  {
461  for(unsigned int lll=0; lll<nenrichments; lll++)
462  {
463  enrichment_diagonal(enriched_id,lll) += wGauss * TauOne * enriched_grad(enriched_id, k) * enriched_grad(lll,k);
464  }
465 
466 
467  enriched_rhs[enriched_id] += wGauss * TauOne *Density * enriched_grad(enriched_id,k)*(bf[k]-OldAcceleration[k]); //changed the sign of the acc term
468  }
469  }
470  }
471  }
472 
473 
474 // if (ndivisions > 1)
475 // {
476 // KRATOS_WATCH(this->Id());
477 // KRATOS_WATCH(ndivisions);
478 // KRATOS_WATCH( (positive_volume+negative_volume )/Area);
479 // }
480 // KRATOS_WATCH("line 438");
481  //lump mass matrix
482  this->LumpMassMatrix(MassMatrix);
483 
484  //add mass matrix stabilization contributions
485  for (unsigned int igauss = 0; igauss < Ngauss.size1(); igauss++)
486  {
487  //assigning the gauss data
488  for (unsigned int k = 0; k < TNumNodes; k++)
489  N[k] = Ngauss(igauss, k);
490  double wGauss = volumes[igauss];
491  // Calculate this element's fluid properties
492  double Density;
493  this->EvaluateInPoint(Density, DENSITY, N);
494 
495  double ElemSize = this->ElementSize(Area);
496  double Viscosity = this->EffectiveViscosity(Density,N,DN_DX,ElemSize,rCurrentProcessInfo);
497 
498  // Get Advective velocity
499  array_1d<double, 3 > AdvVel;
500  this->GetAdvectiveVel(AdvVel, N);
501  const double VelNorm = MathUtils<double>::Norm3(AdvVel);
502 
503  const double DarcyTerm = this->CalculateDarcyTerm(Density, Viscosity, c1, c2, N);
504 
505  double TauOne,TauTwo;
506  this->CalculateStabilizationTau(TauOne, TauTwo, VelNorm, ElemSize, Density, Viscosity, DarcyTerm, rCurrentProcessInfo);
507 
508  // Add dynamic stabilization terms ( all terms involving a delta(u) )
509  this->AddMassStabTerms(MassMatrix, Density, AdvVel, DarcyTerm, TauOne, N, DN_DX, wGauss);
510 
511  }
512 
513  //****************************************************
514  //consider contributions of mass to LHS and RHS
515  //add Mass Matrix to the LHS with the correct coefficient
516  noalias(rLeftHandSideMatrix) += BDFVector[0]*MassMatrix;
517 
518  //do RHS -= MassMatrix*(BDFVector[1]*un + BDFVector[2]*u_(n-1))
519  //note that the term related to BDFVector[0] is included in the LHS
520  array_1d<double,LocalSize> aaa = ZeroVector(LocalSize);
521  for(unsigned int k = 0; k<TNumNodes; k++)
522  {
523  unsigned int base=k*(TDim+1);
524  for(unsigned int step=1; step<BDFVector.size(); step++)
525  {
526  const array_1d<double,3>& u = this->GetGeometry()[k].FastGetSolutionStepValue(VELOCITY,step);
527  const double& bdf_coeff = BDFVector[step];
528  aaa[base] += bdf_coeff*u[0];
529  aaa[base+1] += bdf_coeff*u[1];
530  aaa[base+2] += bdf_coeff*u[2];
531  }
532  }
533  noalias(rRightHandSideVector) -= prod(MassMatrix,aaa);
534 
535  //****************************************************
536  //finalize computation of the residual
537  // Now calculate an additional contribution to the residual: r -= rLeftHandSideMatrix * (u,p)
538  VectorType U = ZeroVector(LocalSize);
539  int LocalIndex = 0;
540  for (unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
541  {
542  array_1d< double, 3 > & rVel = this->GetGeometry()[iNode].FastGetSolutionStepValue(VELOCITY);
543  for (unsigned int d = 0; d < TDim; ++d) // Velocity Dofs
544  {
545  U[LocalIndex] = rVel[d];
546  ++LocalIndex;
547  }
548  U[LocalIndex] = this->GetGeometry()[iNode].FastGetSolutionStepValue(PRESSURE); // Pressure Dof
549  ++LocalIndex;
550  }
551  noalias(rRightHandSideVector) -= prod(rLeftHandSideMatrix, U);
552 // KRATOS_WATCH("line 517");
553 
554  //****************************************************
555  //finalize computation of enrichment terms
556  //(do static condensation) of enrichment terms
557  //note that it each step we assume that the enrichment starts from 0
558  if (ndivisions > 1)
559  {
560  //We only apply enrichment if we do not have an almost empty/full element
561  if (positive_volume / Area > min_area_ratio && negative_volume / Area > min_area_ratio) {
562  //finalize the computation of the rhs
563  noalias(enriched_rhs) -= prod(enrichment_terms_horizontal,U);
564 
565  double max_diag = 0.0;
566  for(unsigned int k=0; k<TDim+1; k++)
567  if(fabs(enrichment_diagonal(k,k) ) > max_diag) max_diag = fabs(enrichment_diagonal(k,k) );
568  if(max_diag == 0) max_diag = 1.0;
569 
570  for (unsigned int i = 0; i < TDim; i++)
571  {
572  const double di = fabs(distances[i]);
573 
574  for (unsigned int j = i + 1; j < TDim + 1; j++)
575  {
576  const double dj = fabs(distances[j]);
577 
578  if (distances[i] * distances[j] < 0.0) //cut edge
579  {
580  double sum_d = di + dj;
581  double Ni = dj / sum_d;
582  double Nj = di / sum_d;
583 
584  double penalty_coeff = max_diag * 0.001; // h/BDFVector[0];
585  enrichment_diagonal(i, i) += penalty_coeff * Ni*Ni;
586  enrichment_diagonal(i, j) -= penalty_coeff * Ni*Nj;
587  enrichment_diagonal(j, i) -= penalty_coeff * Nj*Ni;
588  enrichment_diagonal(j, j) += penalty_coeff * Nj*Nj;
589 
590  }
591  }
592  }
593 
594  Matrix inverse_diag(nenrichments, nenrichments);
595  double det;
596  MathUtils<double>::InvertMatrix(enrichment_diagonal, inverse_diag, det);
597 
598  Matrix tmp = prod(inverse_diag, enrichment_terms_horizontal);
599  noalias(rLeftHandSideMatrix) -= prod(enrichment_terms_vertical, tmp);
600 
601  Vector tmp2 = prod(inverse_diag, enriched_rhs);
602  noalias(rRightHandSideVector) -= prod(enrichment_terms_vertical, tmp2);
603  }
604 
605 /* for (unsigned int i = 0; i < LocalSize; i++)
606  for (unsigned int j = 0; j < LocalSize; j++)
607  rLeftHandSideMatrix(i, j) -= inverse_diag_term * enrichment_terms_vertical[i] * enrichment_terms_horizontal[j];
608  noalias(rRightHandSideVector) -= (inverse_diag_term*enriched_rhs )*enrichment_terms_vertical;
609  */ }
610 
611 // KRATOS_WATCH("finished elem")
612  }
613 
619  void Calculate(const Variable<array_1d<double, 3 > >& rVariable,
620  array_1d<double, 3 > & rOutput,
621  const ProcessInfo& rCurrentProcessInfo) override
622  {
623 
624  }
626 
634  int Check(const ProcessInfo& rCurrentProcessInfo) const override
635  {
636  KRATOS_TRY
637  // Perform basic element checks
638  int ErrorCode = Kratos::Element::Check(rCurrentProcessInfo);
639  if (ErrorCode != 0) return ErrorCode;
640 
641  // Checks on nodes
642  // Check that the element's nodes contain all required SolutionStepData and Degrees of freedom
643  for (unsigned int i = 0; i<this->GetGeometry().size(); ++i)
644  {
645  if (this->GetGeometry()[i].SolutionStepsDataHas(DISTANCE) == false)
646  KRATOS_THROW_ERROR(std::invalid_argument, "missing DISTANCE variable on solution step data for node ", this->GetGeometry()[i].Id());
647  if (this->GetGeometry()[i].SolutionStepsDataHas(VELOCITY) == false)
648  KRATOS_THROW_ERROR(std::invalid_argument, "missing VELOCITY variable on solution step data for node ", this->GetGeometry()[i].Id());
649  if (this->GetGeometry()[i].SolutionStepsDataHas(PRESSURE) == false)
650  KRATOS_THROW_ERROR(std::invalid_argument, "missing PRESSURE variable on solution step data for node ", this->GetGeometry()[i].Id());
651  if (this->GetGeometry()[i].SolutionStepsDataHas(MESH_VELOCITY) == false)
652  KRATOS_THROW_ERROR(std::invalid_argument, "missing MESH_VELOCITY variable on solution step data for node ", this->GetGeometry()[i].Id());
653  if (this->GetGeometry()[i].HasDofFor(VELOCITY_X) == false ||
654  this->GetGeometry()[i].HasDofFor(VELOCITY_Y) == false ||
655  this->GetGeometry()[i].HasDofFor(VELOCITY_Z) == false)
656  KRATOS_THROW_ERROR(std::invalid_argument, "missing VELOCITY component degree of freedom on node ", this->GetGeometry()[i].Id());
657  if (this->GetGeometry()[i].HasDofFor(PRESSURE) == false)
658  KRATOS_THROW_ERROR(std::invalid_argument, "missing PRESSURE component degree of freedom on node ", this->GetGeometry()[i].Id());
659  }
660 
661  // If this is a 2D problem, check that nodes are in XY plane
662  if (this->GetGeometry().WorkingSpaceDimension() == 2)
663  {
664  for (unsigned int i = 0; i<this->GetGeometry().size(); ++i)
665  {
666  if (this->GetGeometry()[i].Z() != 0.0)
667  KRATOS_THROW_ERROR(std::invalid_argument, "Node with non-zero Z coordinate found. Id: ", this->GetGeometry()[i].Id());
668  }
669  }
670  return 0;
671  KRATOS_CATCH("");
672  }
686  std::string Info() const override
687  {
688  std::stringstream buffer;
689  buffer << "TwoFluidVMS #" << this->Id();
690  return buffer.str();
691  }
693  void PrintInfo(std::ostream& rOStream) const override
694  {
695  rOStream << "TwoFluidVMS" << TDim << "D";
696  }
697  // /// Print object's data.
698  // virtual void PrintData(std::ostream& rOStream) const;
703 protected:
715 
717  void LumpMassMatrix(MatrixType& rMassMatrix)
718  {
719  for (unsigned int i = 0; i < rMassMatrix.size1(); ++i)
720  {
721  double diag_factor = 0.0;
722  for (unsigned int j = 0; j < rMassMatrix.size2(); ++j)
723  {
724  diag_factor += rMassMatrix(i, j);
725  rMassMatrix(i, j) = 0.0;
726  }
727  rMassMatrix(i, i) = diag_factor;
728  }
729  }
731 
742  virtual void AddPointContribution(double& rResult,
743  const Variable< double >& rVariable,
744  const array_1d< double, TNumNodes >& rShapeFunc,
745  const double Weight = 1.0)
746  {
747  double temp = 0.0;
748  this->EvaluateInPoint(temp, rVariable, rShapeFunc);
749  rResult += Weight*temp;
750  }
752 
761  void EvaluateInPoint(double& rResult,
762  const Variable< double >& rVariable,
763  const array_1d< double, TNumNodes >& rShapeFunc) override
764  {
765  //compute sign of distance on gauss point
766  double dist = 0.0;
767  for (unsigned int i = 0; i < TNumNodes; i++)
768  dist += rShapeFunc[i] * this->GetGeometry()[i].FastGetSolutionStepValue(DISTANCE);
769 
770  double navg = 0.0;
771  double value = 0.0;
772  for (unsigned int i = 0; i < TNumNodes; i++)
773  {
774  if ( (dist * this->GetGeometry()[i].FastGetSolutionStepValue(DISTANCE)) > 0.0)
775  {
776  navg += 1.0;
777  value += this->GetGeometry()[i].FastGetSolutionStepValue(rVariable);
778  }
779  }
780  if(navg != 0)
781  value /= navg;
782  else
783  ElementBaseType::EvaluateInPoint(value,rVariable,rShapeFunc);
784  rResult = value;
785  }
787 
798  const Variable< array_1d< double, 3 > >& rVariable,
799  const array_1d< double, TNumNodes>& rShapeFunc,
800  const double Weight = 1.0)
801  {
803  this->EvaluateInPoint(temp, rVariable, rShapeFunc);
804  rResult += Weight*temp;
805  }
806 
808 
817  const Variable< array_1d< double, 3 > >& rVariable,
818  const array_1d< double, TNumNodes >& rShapeFunc) override
819  {
820  //compute sign of distance on gauss point
821  double dist = 0.0;
822  for (unsigned int i = 0; i < TNumNodes; i++)
823  dist += rShapeFunc[i] * this->GetGeometry()[i].FastGetSolutionStepValue(DISTANCE);
824  double navg = 0.0;
826  for (unsigned int i = 0; i < TNumNodes; i++)
827  {
828  if (dist * this->GetGeometry()[i].FastGetSolutionStepValue(DISTANCE) > 0.0)
829  {
830  navg += 1.0;
831  value += this->GetGeometry()[i].FastGetSolutionStepValue(rVariable);
832  }
833  }
834  if(navg != 0)
835  value /= navg;
836  else
837  ElementBaseType::EvaluateInPoint(value,rVariable,rShapeFunc);
838  rResult = value;
839  }
840 
841 
844  VectorType& rDampRHS,
845  const double Density,
846  const double Viscosity,
847  const array_1d< double, 3 > & rAdvVel,
848  const double ReactionTerm,
849  const double TauOne,
850  const double TauTwo,
851  const array_1d< double, TNumNodes >& rShapeFunc,
852  const BoundedMatrix<double, TNumNodes, TDim >& rShapeDeriv,
853  const double Weight)
854  {
855  const unsigned int BlockSize = TDim + 1;
856 
857  // If we want to use more than one Gauss point to integrate the convective term, this has to be evaluated once per integration point
859  this->GetConvectionOperator(AGradN, rAdvVel, rShapeDeriv); // Get a * grad(Ni)
860 
861  // Build the local matrix and RHS
862  unsigned int FirstRow(0), FirstCol(0); // position of the first term of the local matrix that corresponds to each node combination
863  double K, PDivV, L, qF; // Temporary results
864 
865  array_1d<double,3> BodyForce = ZeroVector(3);
866  this->EvaluateInPoint(BodyForce,BODY_FORCE,rShapeFunc);
867  BodyForce *= Density;
868 
869  array_1d<double, TNumNodes> StabilizationOperator = Density*AGradN;
870  noalias(StabilizationOperator) -= ReactionTerm * rShapeFunc;
871  StabilizationOperator *= TauOne;
872 
873  for (unsigned int i = 0; i < TNumNodes; ++i) // iterate over rows
874  {
875  for (unsigned int j = 0; j < TNumNodes; ++j) // iterate over columns
876  {
877  // Convection + Reaction: v *( a*Grad(u) + sigma*u )
878  // For Darcy: sigma = A + B|u|
879  K = rShapeFunc[i] * ( Density*AGradN[j] + ReactionTerm*rShapeFunc[j] );
880  // Stabilization: (a * Grad(v) - sigma * N) * TauOne *( a*Grad(u) + sigma*u )
881  K += StabilizationOperator[i] * ( Density*AGradN[j] + ReactionTerm*rShapeFunc[j] );
882  K *= Weight;
883 
884  // q-p stabilization block (reset result)
885  L = 0;
886 
887  const array_1d<double,3>& OldVel = this->GetGeometry()[j].FastGetSolutionStepValue(VELOCITY,1);
888 
889  for (unsigned int m = 0; m < TDim; ++m) // iterate over v components (vx,vy[,vz])
890  {
891  // v-p block (pressure gradient)
892  double div_v_p = rShapeDeriv(i, m) * rShapeFunc[j];
893  double stab_grad_p = StabilizationOperator[i] * rShapeDeriv(j,m);
894  rDampingMatrix(FirstRow + m, FirstCol + TDim) += Weight * (stab_grad_p - div_v_p);
895 
896  // q-u block (velocity divergence)
897  double q_div_u = rShapeFunc[i] * rShapeDeriv(j,m);
898  double stab_div_u = TauOne*rShapeDeriv(i,m)* ( Density*AGradN[j] + ReactionTerm * rShapeFunc[j] );
899  rDampingMatrix(FirstRow + TDim, FirstCol + m) += Weight * ( q_div_u + stab_div_u );
900 
901  PDivV = rShapeDeriv(i, m) * rShapeFunc[j]; // Div(v) * p
902  rDampRHS[FirstCol + TDim] -= Weight * PDivV*OldVel[m];
903 
904  // q-p stabilization block
905  L += rShapeDeriv(i, m) * rShapeDeriv(j, m); // Stabilization: Grad(q) * TauOne * Grad(p)
906 
907  for (unsigned int n = 0; n < TDim; ++n) // iterate over u components (ux,uy[,uz])
908  {
909  // Velocity block
910  rDampingMatrix(FirstRow + m, FirstCol + n) += Weight * TauTwo * rShapeDeriv(i, m) * rShapeDeriv(j, n); // Stabilization: Div(v) * TauTwo * Div(u)
911  }
912  }
913 
914  // Write remaining terms to velocity block
915  for (unsigned int d = 0; d < TDim; ++d)
916  rDampingMatrix(FirstRow + d, FirstCol + d) += K;
917 
918  // Write q-p stabilization block
919  rDampingMatrix(FirstRow + TDim, FirstCol + TDim) += Weight * TauOne * L;
920 
921  // Update reference column index for next iteration
922  FirstCol += BlockSize;
923  }
924 
925  // Operate on RHS
926  qF = 0.0;
927  for (unsigned int d = 0; d < TDim; ++d)
928  {
929  rDampRHS[FirstRow + d] += Weight * StabilizationOperator[i] * BodyForce[d]; // (a * Grad(v) - sigma * N) * TauOne * (Density * BodyForce)
930  qF += rShapeDeriv(i, d) * BodyForce[d];
931  }
932  rDampRHS[FirstRow + TDim] += Weight * TauOne * qF; // Grad(q) * TauOne * (Density * BodyForce)
933 
934  // Update reference indices
935  FirstRow += BlockSize;
936  FirstCol = 0;
937  }
938 
939  this->AddViscousTerm(rDampingMatrix,rShapeDeriv,Viscosity*Weight);
940  }
941 
942  void AddMassStabTerms(MatrixType& rLHSMatrix,
943  const double Density,
944  const array_1d<double, 3 > & rAdvVel,
945  const double ReactionTerm,
946  const double TauOne,
947  const array_1d<double, TNumNodes>& rShapeFunc,
948  const BoundedMatrix<double, TNumNodes, TDim>& rShapeDeriv,
949  const double Weight)
950  {
951  const unsigned int BlockSize = TDim + 1;
952 
953  unsigned int FirstRow(0), FirstCol(0);
954  double K; // Temporary results
955 
956  // If we want to use more than one Gauss point to integrate the convective term, this has to be evaluated once per integration point
958  this->GetConvectionOperator(AGradN, rAdvVel, rShapeDeriv); // Get a * grad(Ni)
959 
960  array_1d<double, TNumNodes> StabilizationOperator = Density*AGradN;
961  noalias(StabilizationOperator) -= ReactionTerm * rShapeFunc;
962  StabilizationOperator *= TauOne;
963 
964  // Note: Dof order is (vx,vy,[vz,]p) for each node
965  for (unsigned int i = 0; i < TNumNodes; ++i)
966  {
967  // Loop over columns
968  for (unsigned int j = 0; j < TNumNodes; ++j)
969  {
970  // Delta(u) * TauOne * [ AdvVel * Grad(v) - sigma * N ] in velocity block
971  K = Weight * StabilizationOperator[i] * Density * rShapeFunc[j];
972 
973  for (unsigned int d = 0; d < TDim; ++d) // iterate over dimensions for velocity Dofs in this node combination
974  {
975  rLHSMatrix(FirstRow + d, FirstCol + d) += K;
976  // Delta(u) * TauOne * Grad(q) in q * Div(u) block
977  rLHSMatrix(FirstRow + TDim, FirstCol + d) += Weight * TauOne * rShapeDeriv(i, d) * Density * rShapeFunc[j];
978  }
979  // Update column index
980  FirstCol += BlockSize;
981  }
982  // Update matrix indices
983  FirstRow += BlockSize;
984  FirstCol = 0;
985  }
986  }
987 
989  double& TauOne,
990  double& TauTwo,
991  const double VelNorm,
992  const double ElemSize,
993  const double Density,
994  const double DynamicViscosity,
995  const double ReactionTerm,
996  const ProcessInfo& rCurrentProcessInfo)
997  {
998  const double DynamicTerm = rCurrentProcessInfo[DYNAMIC_TAU] / rCurrentProcessInfo[DELTA_TIME];
999  double InvTau = Density * ( DynamicTerm + 2.0*VelNorm / ElemSize ) + 4.0*DynamicViscosity/ (ElemSize * ElemSize) + ReactionTerm;
1000  TauOne = 1.0 / InvTau;
1001 
1002  TauTwo = DynamicViscosity + 0.5 * Density * ElemSize * VelNorm;
1003  }
1004 
1005  virtual double CalculateDarcyTerm(
1006  const double Density,
1007  const double DynamicViscosity,
1008  const double LinearCoefficient,
1009  const double NonlinearCoefficient,
1010  const array_1d<double, TNumNodes>& rShapefunctions) {
1011 
1013  this->GetAdvectiveVel(velocity, rShapefunctions);
1014  const double velocity_norm = MathUtils<double>::Norm3(velocity);
1015 
1016  return DynamicViscosity * LinearCoefficient + Density * NonlinearCoefficient*velocity_norm;
1017  }
1018 
1029 private:
1038  friend class Serializer;
1039  void save(Serializer& rSerializer) const override
1040  {
1042  }
1043  void load(Serializer& rSerializer) override
1044  {
1046  }
1063  TwoFluidVMS & operator=(TwoFluidVMS const& rOther);
1065  TwoFluidVMS(TwoFluidVMS const& rOther);
1067 }; // Class TwoFluidVMS
1075 template< unsigned int TDim,
1076  unsigned int TNumNodes >
1077 inline std::istream & operator >>(std::istream& rIStream,
1079 {
1080  return rIStream;
1081 }
1083 template< unsigned int TDim,
1084  unsigned int TNumNodes >
1085 inline std::ostream & operator <<(std::ostream& rOStream,
1086  const TwoFluidVMS<TDim, TNumNodes>& rThis)
1087 {
1088  rThis.PrintInfo(rOStream);
1089  rOStream << std::endl;
1090  rThis.PrintData(rOStream);
1091  return rOStream;
1092 }
1095 } // namespace Kratos.
1096 #endif // KRATOS_TWO_FLUID_VMS_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
PropertiesType & GetProperties()
Definition: element.h:1024
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: element.h:1135
virtual int Check(const ProcessInfo &rCurrentProcessInfo) const
Definition: element.h:904
virtual void MassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo)
Definition: element.h:926
static int CalculateTetrahedraEnrichedShapeFuncions(TMatrixType const &rPoints, TGradientType const &DN_DX, TVectorType &rDistances, TVectorType &rVolumes, TMatrixType &rShapeFunctionValues, TVectorType &rPartitionsSign, std::vector< TMatrixType > &rGradientsValue, TMatrixType &NEnriched)
Definition: enrichment_utilities_duplicate_dofs.h:89
std::size_t IndexType
Definition: flags.h:74
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
Geometry base class.
Definition: geometry.h:71
SizeType size() const
Definition: geometry.h:518
std::vector< IntegrationPointType > IntegrationPointsArrayType
Definition: geometry.h:161
const Matrix & ShapeFunctionsValues() const
Definition: geometry.h:3393
IndexType const & Id() const
Id of this Geometry.
Definition: geometry.h:964
const IntegrationPointsArrayType & IntegrationPoints() const
Definition: geometry.h:2284
SizeType WorkingSpaceDimension() const
Definition: geometry.h:1287
SizeType IntegrationPointsNumber() const
Definition: geometry.h:2257
static void CalculateGeometryData(const GeometryType &rGeometry, BoundedMatrix< double, 4, 3 > &rDN_DX, array_1d< double, 4 > &rN, double &rVolume)
This function is designed to compute the shape function derivatives, shape functions and volume in 3D...
Definition: geometry_utilities.h:176
This object defines an indexed object.
Definition: indexed_object.h:54
IndexType Id() const
Definition: indexed_object.h:107
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
static double Norm3(const TVectorType &a)
Calculates the norm of vector "a" which is assumed to be of size 3.
Definition: math_utils.h:691
static BoundedMatrix< double, TDim, TDim > InvertMatrix(const BoundedMatrix< double, TDim, TDim > &rInputMatrix, double &rInputMatrixDet, const double Tolerance=ZeroTolerance)
Calculates the inverse of a 2x2, 3x3 and 4x4 matrices (using bounded matrix for performance)
Definition: math_utils.h:197
This class defines the node.
Definition: node.h:65
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
Definition: two_fluid_vms.h:80
TwoFluidVMS(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using a geometry object.
Definition: two_fluid_vms.h:134
VMS< TDim, TNumNodes > ElementBaseType
Element from which it is derived.
Definition: two_fluid_vms.h:89
void CalculateStabilizationTau(double &TauOne, double &TauTwo, const double VelNorm, const double ElemSize, const double Density, const double DynamicViscosity, const double ReactionTerm, const ProcessInfo &rCurrentProcessInfo)
Definition: two_fluid_vms.h:988
void AddIntegrationPointVelocityContribution(MatrixType &rDampingMatrix, VectorType &rDampRHS, const double Density, const double Viscosity, const array_1d< double, 3 > &rAdvVel, const double ReactionTerm, const double TauOne, const double TauTwo, const array_1d< double, TNumNodes > &rShapeFunc, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv, const double Weight)
Add a the contribution from a single integration point to the velocity contribution.
Definition: two_fluid_vms.h:843
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Definition: two_fluid_vms.h:213
PointerVectorSet< Dof< double >, IndexedObject > DofsArrayType
Definition: two_fluid_vms.h:107
TwoFluidVMS(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constuctor using geometry and properties.
Definition: two_fluid_vms.h:144
std::vector< Dof< double >::Pointer > DofsVectorType
Definition: two_fluid_vms.h:106
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Provides local contributions from body forces to the RHS.
Definition: two_fluid_vms.h:187
virtual double CalculateDarcyTerm(const double Density, const double DynamicViscosity, const double LinearCoefficient, const double NonlinearCoefficient, const array_1d< double, TNumNodes > &rShapefunctions)
Definition: two_fluid_vms.h:1005
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: two_fluid_vms.h:100
Vector VectorType
Definition: two_fluid_vms.h:101
std::string Info() const override
Turn back information as a string.
Definition: two_fluid_vms.h:686
void EvaluateInPoint(double &rResult, const Variable< double > &rVariable, const array_1d< double, TNumNodes > &rShapeFunc) override
Write the value of a variable at a point inside the element to a double.
Definition: two_fluid_vms.h:761
ElementBaseType::MatrixType MatrixType
Definition: two_fluid_vms.h:102
void AddMassStabTerms(MatrixType &rLHSMatrix, const double Density, const array_1d< double, 3 > &rAdvVel, const double ReactionTerm, const double TauOne, const array_1d< double, TNumNodes > &rShapeFunc, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv, const double Weight)
Definition: two_fluid_vms.h:942
Properties PropertiesType
Definition: two_fluid_vms.h:96
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Definition: two_fluid_vms.h:166
virtual void AddPointContribution(array_1d< double, 3 > &rResult, const Variable< array_1d< double, 3 > > &rVariable, const array_1d< double, TNumNodes > &rShapeFunc, const double Weight=1.0)
Add the weighted value of a variable at a point inside the element to a vector.
Definition: two_fluid_vms.h:797
std::size_t IndexType
Definition: two_fluid_vms.h:103
void LumpMassMatrix(MatrixType &rMassMatrix)
Add lumped mass matrix.
Definition: two_fluid_vms.h:717
void Calculate(const Variable< array_1d< double, 3 > > &rVariable, array_1d< double, 3 > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Definition: two_fluid_vms.h:619
void EvaluateInPoint(array_1d< double, 3 > &rResult, const Variable< array_1d< double, 3 > > &rVariable, const array_1d< double, TNumNodes > &rShapeFunc) override
Write the value of a variable at a point inside the element to a double.
Definition: two_fluid_vms.h:816
virtual void AddPointContribution(double &rResult, const Variable< double > &rVariable, const array_1d< double, TNumNodes > &rShapeFunc, const double Weight=1.0)
Add the weighted value of a variable at a point inside the element to a double.
Definition: two_fluid_vms.h:742
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: two_fluid_vms.h:693
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Checks the input and that all required Kratos variables have been registered.
Definition: two_fluid_vms.h:634
TwoFluidVMS(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: two_fluid_vms.h:125
Node NodeType
definition of node type (default is: Node)
Definition: two_fluid_vms.h:91
std::size_t SizeType
Definition: two_fluid_vms.h:104
Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override
It creates a new element pointer.
Definition: two_fluid_vms.h:171
TwoFluidVMS(IndexType NewId=0)
Default constuctor.
Definition: two_fluid_vms.h:116
IndexedObject BaseType
base type: an IndexedObject that automatically has a unique number
Definition: two_fluid_vms.h:87
Geometry< NodeType > GeometryType
definition of the geometry type with given NodeType
Definition: two_fluid_vms.h:98
void CalculateMassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo) override
Computes local contributions to the mass matrix.
Definition: two_fluid_vms.h:203
~TwoFluidVMS() override
Destructor.
Definition: two_fluid_vms.h:149
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(TwoFluidVMS)
std::vector< std::size_t > EquationIdVectorType
Definition: two_fluid_vms.h:105
A stabilized element for the incompressible Navier-Stokes equations.
Definition: vms.h:104
virtual void GetAdvectiveVel(array_1d< double, 3 > &rAdvVel, const array_1d< double, TNumNodes > &rShapeFunc)
Write the advective velocity evaluated at this point to an array.
Definition: vms.h:1434
double ElementSize(const double)
Return an estimate for the element size h, used to calculate the stabilization parameters.
virtual void EvaluateInPoint(double &rResult, const Variable< double > &rVariable, const array_1d< double, TNumNodes > &rShapeFunc)
Write the value of a variable at a point inside the element to a double.
Definition: vms.h:1495
virtual void AddMomentumRHS(VectorType &F, const double Density, const array_1d< double, TNumNodes > &rShapeFunc, const double Weight)
Add the momentum equation contribution to the RHS (body forces)
Definition: vms.h:994
void AddConsistentMassMatrixContribution(MatrixType &rLHSMatrix, const array_1d< double, TNumNodes > &rShapeFunc, const double Density, const double Weight)
Definition: vms.h:1076
virtual double EffectiveViscosity(double Density, const array_1d< double, TNumNodes > &rN, const BoundedMatrix< double, TNumNodes, TDim > &rDN_DX, double ElemSize, const ProcessInfo &rProcessInfo)
EffectiveViscosity Calculate the viscosity at given integration point, using Smagorinsky if enabled.
Definition: vms.h:1392
virtual void AddViscousTerm(MatrixType &rDampingMatrix, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv, const double Weight)
Adds the contribution of the viscous term to the momentum equation.
void GetConvectionOperator(array_1d< double, TNumNodes > &rResult, const array_1d< double, 3 > &rVelocity, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv)
Write the convective operator evaluated at this point (for each nodal funciton) to an array.
Definition: vms.h:1471
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
scalar_matrix< double > ScalarMatrix
Definition: amatrix_interface.h:728
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
float velocity
Definition: PecletTest.py:54
list coeff
Definition: bombardelli_test.py:41
float dist
Definition: edgebased_PureConvection.py:89
int step
Definition: face_heat.py:88
int local_size
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:17
tuple tmp
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:98
u
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:30
def load(f)
Definition: ode_solve.py:307
int L
Definition: ode_solve.py:390
int d
Definition: ode_solve.py:397
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
float temp
Definition: rotating_cone.py:85
int m
Definition: run_marine_rain_substepping.py:8
N
Definition: sensitivityMatrix.py:29
K
Definition: sensitivityMatrix.py:73
integer i
Definition: TensorModule.f:17
e
Definition: run_cpp_mpi_tests.py:31