13 #if !defined(KRATOS_TWO_FLUID_DPGVMS_H_INCLUDED )
14 #define KRATOS_TWO_FLUID_DPGVMS_H_INCLUDED
24 #include "utilities/geometry_utilities.h"
48 template<
unsigned int TDim,
49 unsigned int TNumNodes = TDim + 1 >
115 DPGVMS(
IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties) :
138 PropertiesType::Pointer pProperties)
const override
140 return Kratos::make_intrusive<DPGVMS>(NewId, (this->
GetGeometry()).
Create(ThisNodes), pProperties);
151 GeometryType::Pointer pGeom,
152 PropertiesType::Pointer pProperties)
const override
154 return Kratos::make_intrusive< DPGVMS >(NewId,pGeom,pProperties);
179 Vector distances(TNumNodes);
182 Matrix coords(TNumNodes, TDim);
183 Matrix Ngauss(6, TNumNodes);
185 std::vector< Matrix > gauss_gradients(6);
187 for (
unsigned int i = 0;
i < TNumNodes;
i++)
191 distances[
i] = this->
GetGeometry()[
i].FastGetSolutionStepValue(DISTANCE);
192 for (
unsigned int j = 0;
j < TDim;
j++)
193 coords(
i,
j) = xyz[
j];
196 for (
unsigned int i = 0;
i < 6;
i++)
197 gauss_gradients[
i].resize(1, TDim,
false);
226 unsigned int LocalSize = (TDim + 1) * TNumNodes;
228 if( this->is_cutted == 1)
232 if (rLeftHandSideMatrix.size1() != LocalSize)
233 rLeftHandSideMatrix.
resize(LocalSize, LocalSize,
false);
241 if (rLeftHandSideMatrix.size1() != LocalSize)
242 rLeftHandSideMatrix.
resize(LocalSize, LocalSize,
false);
265 if( this->is_cutted == 1)
267 unsigned int LocalSize = (TDim + 1) * TNumNodes + 1;
271 if (rRightHandSideVector.size() != LocalSize)
272 rRightHandSideVector.
resize(LocalSize,
false);
280 Vector distances(TNumNodes);
283 Matrix coords(TNumNodes, TDim);
284 Matrix Ngauss(6, TNumNodes);
286 std::vector< Matrix > gauss_gradients(6);
288 for (
unsigned int i = 0;
i < TNumNodes;
i++)
292 distances[
i] = this->
GetGeometry()[
i].FastGetSolutionStepValue(DISTANCE);
293 for (
unsigned int j = 0;
j < TDim;
j++)
294 coords(
i,
j) = xyz[
j];
296 for (
unsigned int i = 0;
i < 6;
i++)
297 gauss_gradients[
i].resize(1, TDim,
false);
302 for (
unsigned int igauss = 0; igauss < ndivisions; igauss++)
305 for (
unsigned int k = 0;
k < TNumNodes;
k++)
306 N[
k] = Ngauss(igauss,
k);
307 double wGauss = volumes[igauss];
351 if( this->is_cutted == 0)
355 const unsigned int LocalSize = (TDim + 1) * TNumNodes + 1;
357 if (rMassMatrix.size1() != LocalSize)
358 rMassMatrix.
resize(LocalSize, LocalSize,
false);
359 rMassMatrix =
ZeroMatrix(LocalSize, LocalSize);
366 Vector distances(TNumNodes);
369 Matrix coords(TNumNodes, TDim);
370 Matrix Ngauss(6, TNumNodes);
372 std::vector< Matrix > gauss_gradients(6);
374 for (
unsigned int i = 0;
i < TNumNodes;
i++)
378 distances[
i] = this->
GetGeometry()[
i].FastGetSolutionStepValue(DISTANCE);
379 for (
unsigned int j = 0;
j < TDim;
j++)
380 coords(
i,
j) = xyz[
j];
382 for (
unsigned int i = 0;
i < 6;
i++)
388 for (
unsigned int igauss = 0; igauss < ndivisions; igauss++)
391 for (
unsigned int k = 0;
k < TNumNodes;
k++)
392 N[
k] = Ngauss(igauss,
k);
393 double wGauss = volumes[igauss];
403 for (
unsigned int igauss = 0; igauss < ndivisions; igauss++)
406 for (
unsigned int k = 0;
k < TNumNodes;
k++)
407 N[
k] = Ngauss(igauss,
k);
408 double wGauss = volumes[igauss];
416 if (rCurrentProcessInfo[OSS_SWITCH] != 1)
419 double Viscosity = this->
EffectiveViscosity(Density,
N,DN_DX,ElemSize, rCurrentProcessInfo);
426 double TauOne, TauTwo;
427 this->
CalculateTau(TauOne, TauTwo, AdvVel, ElemSize, Density, Viscosity, rCurrentProcessInfo);
430 this->
AddMassStabTerms(rMassMatrix, Density, AdvVel, TauOne,
N, DN_DX, wGauss,gauss_gradients[igauss]);
449 if( this->is_cutted == 0){
453 int boundary_nodes = 0;
455 for (
unsigned int i = 0;
i < TNumNodes;
i++)
457 double nd_flag = this->
GetGeometry()[
i].FastGetSolutionStepValue(FLAG_VARIABLE);
538 const unsigned int LocalSize = (TDim + 1) * TNumNodes + 1;
541 if (rDampingMatrix.size1() != LocalSize)
542 rDampingMatrix.
resize(LocalSize, LocalSize,
false);
551 Vector distances(TNumNodes);
554 Matrix coords(TNumNodes, TDim);
555 Matrix Ngauss(6, TNumNodes);
557 std::vector< Matrix > gauss_gradients(6);
559 for (
unsigned int i = 0;
i < TNumNodes;
i++)
563 distances[
i] = this->
GetGeometry()[
i].FastGetSolutionStepValue(DISTANCE);
564 for (
unsigned int j = 0;
j < TDim;
j++)
565 coords(
i,
j) = xyz[
j];
567 for (
unsigned int i = 0;
i < 6;
i++)
581 for (
unsigned int igauss = 0; igauss < ndivisions; igauss++)
584 for (
unsigned int k = 0;
k < TNumNodes;
k++)
585 N[
k] = Ngauss(igauss,
k);
586 const double wGauss = volumes[igauss];
596 double Viscosity = this->
EffectiveViscosity(Density,
N,DN_DX,ElemSize, rCurrentProcessInfo);
603 double TauOne, TauTwo;
604 this->
CalculateTau(TauOne, TauTwo, AdvVel, ElemSize, Density, Viscosity, rCurrentProcessInfo);
606 this->
AddIntegrationPointVelocityContribution(rDampingMatrix, rRightHandSideVector, Density, Viscosity, AdvVel, TauOne, TauTwo,
N, DN_DX, wGauss,Nenriched(igauss, 0),gauss_gradients[igauss]);
674 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
677 for (
unsigned int d = 0;
d < TDim; ++
d)
679 U[LocalIndex] = rVel[
d];
682 U[LocalIndex] = this->
GetGeometry()[iNode].FastGetSolutionStepValue(PRESSURE);
685 const double enriched_pr = this->
GetValue(PRESSUREAUX);
686 U[LocalIndex] = enriched_pr;
687 noalias(rRightHandSideVector) -=
prod(rDampingMatrix, U);
696 if( this->is_cutted == 0)
701 const unsigned int LocalSize = (TDim + 1) * TNumNodes;
704 for (
unsigned int iNode = 0; iNode < TNumNodes; ++iNode)
708 for (
unsigned int d = 0;
d < TDim; ++
d)
710 DU[LocalIndex] = rVel[
d]-old_rVel[
d];
713 DU[LocalIndex] = this->
GetGeometry()[iNode].FastGetSolutionStepValue(PRESSURE) - this->
GetGeometry()[iNode].FastGetSolutionStepValue(PRESSURE,1);
720 residual_enr_vector = this->
GetValue(GAPS);
724 for (
unsigned int ii = 0; ii < LocalSize; ++ii)
725 C_Dup += residual_enr_vector[ii]*DU[ii];
728 double enr_p = this->
GetValue(AUX_INDEX);
729 if( residual_enr_vector[LocalSize] == 0.0 )
730 KRATOS_THROW_ERROR(std::invalid_argument,
"Diagonla member of enriched RES is zero !!!!!",
"")
732 enr_p += (residual_enr_vector[LocalSize + 1] - C_Dup)/residual_enr_vector[LocalSize] ;
749 if( this->is_cutted == 0)
753 unsigned int MatSize = (TDim + 1) * TNumNodes + 1;
754 if (
values.size() != MatSize)
values.resize(MatSize,
false);
755 for (
unsigned int i = 0;
i < TNumNodes;
i++)
757 unsigned int index =
i * (TDim + 1);
765 int last_index = (TDim + 1) * TNumNodes;
778 if( this->is_cutted == 0)
782 unsigned int MatSize = (TDim + 1) * TNumNodes + 1;
783 if (
values.size() != MatSize)
values.resize(MatSize,
false);
784 for (
unsigned int i = 0;
i < TNumNodes;
i++)
786 unsigned int index =
i * (TDim + 1);
788 values[index + 1] = this->
GetGeometry()[
i].GetSolutionStepValue(ACCELERATION_Y, Step);
789 values[index + 2] = this->
GetGeometry()[
i].GetSolutionStepValue(ACCELERATION_Z, Step);
793 int last_index = (TDim + 1) * TNumNodes;
815 if (rVariable == ADVPROJ)
823 double ElementalMassRes(0);
825 Vector distances(TNumNodes);
828 Matrix coords(TNumNodes, TDim);
829 Matrix Ngauss(6, TNumNodes);
831 std::vector< Matrix > gauss_gradients(6);
833 for (
unsigned int i = 0;
i < TNumNodes;
i++)
837 distances[
i] = this->
GetGeometry()[
i].FastGetSolutionStepValue(DISTANCE);
838 for (
unsigned int j = 0;
j < TDim;
j++)
839 coords(
i,
j) = xyz[
j];
841 for (
unsigned int i = 0;
i < 6;
i++)
842 gauss_gradients[
i].resize(1, TDim,
false);
847 for (
unsigned int igauss = 0; igauss < ndivisions; igauss++)
850 for (
unsigned int k = 0;
k < TNumNodes;
k++)
851 N[
k] = Ngauss(igauss,
k);
852 double wGauss = volumes[igauss];
862 ElementalMassRes = 0.0;
864 if (rCurrentProcessInfo[OSS_SWITCH] == 1)
867 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
871 for (
unsigned int d = 0;
d < TDim; ++
d)
872 rAdvProj[
d] +=
N[
i] * ElementalMomRes[
d];
873 this->
GetGeometry()[
i].FastGetSolutionStepValue(DIVPROJ) +=
N[
i] * ElementalMassRes;
874 this->
GetGeometry()[
i].FastGetSolutionStepValue(NODAL_AREA) += wGauss *
N[
i];
880 rOutput = ElementalMomRes;
882 else if (rVariable == SUBSCALE_VELOCITY)
890 double ElementalMassRes(0);
892 Vector distances(TNumNodes);
895 Matrix coords(TNumNodes, TDim);
896 Matrix Ngauss(6, TNumNodes);
898 std::vector< Matrix > gauss_gradients(6);
900 for (
unsigned int i = 0;
i < TNumNodes;
i++)
904 distances[
i] = this->
GetGeometry()[
i].FastGetSolutionStepValue(DISTANCE);
905 for (
unsigned int j = 0;
j < TDim;
j++)
906 coords(
i,
j) = xyz[
j];
908 for (
unsigned int i = 0;
i < 6;
i++)
909 gauss_gradients[
i].resize(1, TDim,
false);
914 for (
unsigned int igauss = 0; igauss < ndivisions; igauss++)
917 for (
unsigned int k = 0;
k < TNumNodes;
k++)
918 N[
k] = Ngauss(igauss,
k);
919 double wGauss = volumes[igauss];
930 ElementalMassRes = 0.0;
932 if (rCurrentProcessInfo[OSS_SWITCH] == 1)
939 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
945 for (
unsigned int d = 0;
d < TDim; ++
d)
946 rMomRHS[
d] +=
N[
i] * ElementalMomRes[
d];
947 rMassRHS +=
N[
i] * ElementalMassRes;
949 this->
GetGeometry()[
i].FastGetSolutionStepValue(NODAL_AREA) += wGauss *
N[
i];
951 for (
unsigned int j = 0;
j < TNumNodes; ++
j)
953 for (
unsigned int d = 0;
d < TDim; ++
d)
954 rMomRHS[
d] -= Weight * this->
GetGeometry()[
j].FastGetSolutionStepValue(ADVPROJ)[
d];
955 rMassRHS -= Weight * this->
GetGeometry()[
j].FastGetSolutionStepValue(DIVPROJ);
957 for (
unsigned int d = 0;
d < TDim; ++
d)
958 rMomRHS[
d] -= Weight * this->
GetGeometry()[
i].FastGetSolutionStepValue(ADVPROJ)[
d];
959 rMassRHS -= Weight * this->
GetGeometry()[
i].FastGetSolutionStepValue(DIVPROJ);
965 rOutput = ElementalMomRes;
975 std::vector<double>& rValues,
979 if (rVariable == PRESSUREAUX)
981 for (
unsigned int PointNumber = 0;
982 PointNumber < 1; PointNumber++)
986 rValues[PointNumber] = this->
GetValue(PRESSUREAUX);;
989 else if(rVariable == AUX_INDEX)
1003 rValues.resize(1,
false);
1023 if (ErrorCode != 0)
return ErrorCode;
1029 if (this->
GetGeometry()[
i].SolutionStepsDataHas(DISTANCE) ==
false)
1031 if (this->
GetGeometry()[
i].SolutionStepsDataHas(VELOCITY) ==
false)
1033 if (this->
GetGeometry()[
i].SolutionStepsDataHas(PRESSURE) ==
false)
1035 if (this->
GetGeometry()[
i].SolutionStepsDataHas(MESH_VELOCITY) ==
false)
1037 if (this->
GetGeometry()[
i].SolutionStepsDataHas(ACCELERATION) ==
false)
1039 if (this->
GetGeometry()[
i].HasDofFor(VELOCITY_X) ==
false ||
1040 this->
GetGeometry()[
i].HasDofFor(VELOCITY_Y) ==
false ||
1043 if (this->
GetGeometry()[
i].HasDofFor(PRESSURE) ==
false)
1074 std::stringstream buffer;
1075 buffer <<
"DPGVMS #" << this->
Id();
1076 return buffer.str();
1081 rOStream <<
"DPGVMS" << TDim <<
"D";
1104 for (
unsigned int i = 0;
i < rMassMatrix.size1(); ++
i)
1106 double diag_factor = 0.0;
1107 for (
unsigned int j = 0;
j < rMassMatrix.size2(); ++
j)
1109 diag_factor += rMassMatrix(
i,
j);
1110 rMassMatrix(
i,
j) = 0.0;
1112 rMassMatrix(
i,
i) = diag_factor;
1130 const double Weight = 1.0)
1134 rResult += Weight*
temp;
1152 for (
unsigned int i = 0;
i < TNumNodes;
i++)
1153 dist += rShapeFunc[
i] * this->
GetGeometry()[
i].FastGetSolutionStepValue(DISTANCE);
1157 for (
unsigned int i = 0;
i < TNumNodes;
i++)
1159 if ( (
dist * this->
GetGeometry()[
i].FastGetSolutionStepValue(DISTANCE)) > 0.0)
1162 value += this->
GetGeometry()[
i].FastGetSolutionStepValue(rVariable);
1168 KRATOS_THROW_ERROR(std::invalid_argument,
"IT IS A CUTTED ELEMENT navg MUST BE NON ZERO !!!!",
"");
1187 const double Weight = 1.0)
1191 rResult += Weight*
temp;
1208 for (
unsigned int i = 0;
i < TNumNodes;
i++)
1209 dist += rShapeFunc[
i] * this->
GetGeometry()[
i].FastGetSolutionStepValue(DISTANCE);
1212 for (
unsigned int i = 0;
i < TNumNodes;
i++)
1214 if (
dist * this->
GetGeometry()[
i].FastGetSolutionStepValue(DISTANCE) > 0.0)
1217 value += this->
GetGeometry()[
i].FastGetSolutionStepValue(rVariable);
1252 const double Density,
1254 const double TauOne,
1257 const double Weight,
1258 const Matrix& gauss_enriched_gradients)
1260 const unsigned int BlockSize = TDim + 1;
1262 double Coef = Weight * TauOne;
1263 unsigned int FirstRow(0), FirstCol(0);
1271 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
1274 for (
unsigned int j = 0;
j < TNumNodes; ++
j)
1277 K = Coef * Density * AGradN[
i] * rShapeFunc[
j];
1279 for (
unsigned int d = 0;
d < TDim; ++
d)
1281 rLHSMatrix(FirstRow +
d, FirstCol +
d) +=
K;
1283 rLHSMatrix(FirstRow + TDim, FirstCol +
d) += Coef * Density * rShapeDeriv(
i,
d) * rShapeFunc[
j];
1286 FirstCol += BlockSize;
1289 FirstRow += BlockSize;
1295 for (
unsigned int j = 0;
j < TNumNodes; ++
j)
1297 for (
unsigned int d = 0;
d < TDim; ++
d)
1299 rLHSMatrix(FirstRow , FirstCol +
d) += Coef * Density * gauss_enriched_gradients(0,
d) * rShapeFunc[
j];
1301 FirstCol += BlockSize;
1307 const double Density,
1308 const double Viscosity,
1310 const double TauOne,
1311 const double TauTwo,
1314 const double Weight,
1315 const double gauss_N_en,
1316 Matrix& gauss_enriched_gradients)
1318 const unsigned int BlockSize = TDim + 1;
1325 unsigned int FirstRow(0), FirstCol(0);
1326 double K, G, PDivV,
L, qF;
1329 for (
unsigned int j = 0;
j < TNumNodes; ++
j)
1334 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
1339 K = Density * rShapeFunc[
i] * AGradN[
j];
1340 K += TauOne * Density * AGradN[
i] * Density * AGradN[
j];
1346 for (
unsigned int m = 0;
m < TDim; ++
m)
1352 G = TauOne * Density * AGradN[
i] * rShapeDeriv(
j,
m);
1353 PDivV = rShapeDeriv(
i,
m) * rShapeFunc[
j];
1356 rDampingMatrix(FirstRow +
m, FirstCol + TDim) += Weight * (G - PDivV);
1358 rDampingMatrix(FirstCol + TDim, FirstRow +
m) += Weight * (G + PDivV);
1362 L += rShapeDeriv(
i,
m) * rShapeDeriv(
j,
m);
1364 for (
unsigned int n = 0;
n < TDim; ++
n)
1367 rDampingMatrix(FirstRow +
m, FirstCol +
n) += Weight * TauTwo * rShapeDeriv(
i,
m) * rShapeDeriv(
j,
n);
1373 for (
unsigned int d = 0;
d < TDim; ++
d)
1374 rDampingMatrix(FirstRow +
d, FirstCol +
d) +=
K;
1377 rDampingMatrix(FirstRow + TDim, FirstCol + TDim) += Weight * TauOne *
L;
1381 for (
unsigned int d = 0;
d < TDim; ++
d)
1383 rDampRHS[FirstRow +
d] += Weight * TauOne * Density * AGradN[
i] * rShapeFunc[
j] * Density * rBodyForce[
d];
1384 qF += rShapeDeriv(
i,
d) * rShapeFunc[
j] * rBodyForce[
d];
1386 rDampRHS[FirstRow + TDim] += Weight * Density * TauOne * qF;
1389 FirstRow += BlockSize;
1394 FirstCol += BlockSize;
1398 this->
AddViscousTerm(rDampingMatrix,rShapeDeriv,Viscosity*Weight);
1402 for (
unsigned int j = 0;
j < TNumNodes; ++
j)
1408 for (
unsigned int m = 0;
m < TDim; ++
m)
1411 G = TauOne * Density * AGradN[
j] * gauss_enriched_gradients(0,
m);
1412 PDivV = rShapeDeriv(
j,
m) * gauss_N_en;
1413 double VGradP = -gauss_enriched_gradients(0,
m)*rShapeFunc[
j];
1416 rDampingMatrix(FirstRow +
m, FirstCol) += Weight * (G - VGradP);
1418 rDampingMatrix(FirstCol , FirstRow +
m) += Weight * (G + PDivV);
1421 L += rShapeDeriv(
j,
m) * gauss_enriched_gradients(0,
m);
1424 qF += gauss_enriched_gradients(0,
m) * rShapeFunc[
j] * rBodyForce[
m];
1428 rDampingMatrix(FirstRow + TDim, FirstCol ) += Weight * TauOne *
L;
1429 rDampingMatrix(FirstCol, FirstRow + TDim ) += Weight * TauOne *
L;
1432 rDampRHS[FirstCol] += Weight * Density * TauOne * qF;
1435 FirstRow += BlockSize;
1438 for (
unsigned int m = 0;
m < TDim; ++
m)
1439 rDampingMatrix(FirstCol, FirstCol ) += Weight * TauOne * gauss_enriched_gradients(0,
m) * gauss_enriched_gradients(0,
m);
1456 unsigned int is_cutted;
1464 void save(
Serializer& rSerializer)
const override
1478 void AddBoundaryTerm(BoundedMatrix<double, 16, 16 >& rDampingMatrix,
1479 const BoundedMatrix<double,4,3>& rShapeDeriv,
1480 const array_1d<double, 4>& N_shape,
1481 const array_1d<double,3>& nn,
1482 const double& Weight,
1483 const double ElementVolume,
1487 const double OneThird = 1.0 / 3.0;
1489 double Density,Viscosity;
1494 double viscos_weight = Weight * OneThird * Viscosity * Density;
1496 unsigned int FirstRow(0),FirstCol(0);
1497 for (
unsigned int j = 0;
j < TNumNodes; ++
j)
1499 double jj_nd_flag = this->
GetGeometry()[
j].FastGetSolutionStepValue(FLAG_VARIABLE);
1500 if(jj_nd_flag == 5.0){
1502 array_1d<double,3> node_normal = this->
GetGeometry()[
j].FastGetSolutionStepValue(NORMAL);
1503 node_normal /=
norm_2(node_normal);
1510 for (
unsigned int i = 0;
i < TNumNodes; ++
i)
1512 double ii_nd_flag = this->
GetGeometry()[
i].FastGetSolutionStepValue(FLAG_VARIABLE);
1513 if(ii_nd_flag == 5.0){
1515 const double Diag = nn[0]*rShapeDeriv(
i,0) + nn[1]*rShapeDeriv(
i,1) + nn[2]*rShapeDeriv(
i,2);
1518 rDampingMatrix(FirstRow,FirstCol) = -(viscos_weight * ( nn[0]*rShapeDeriv(
i,0) + Diag ) );
1519 rDampingMatrix(FirstRow,FirstCol+1) = -(viscos_weight * nn[1]*rShapeDeriv(
i,0) );
1520 rDampingMatrix(FirstRow,FirstCol+2) = -(viscos_weight * nn[2]*rShapeDeriv(
i,0) );
1524 rDampingMatrix(FirstRow+1,FirstCol) = -(viscos_weight * nn[0]*rShapeDeriv(
i,1) );
1525 rDampingMatrix(FirstRow+1,FirstCol+1) = -(viscos_weight * ( nn[1]*rShapeDeriv(
i,1) + Diag ) );
1526 rDampingMatrix(FirstRow+1,FirstCol+2) = -(viscos_weight * nn[2]*rShapeDeriv(
i,1) );
1530 rDampingMatrix(FirstRow+2,FirstCol) = -(viscos_weight * nn[0]*rShapeDeriv(
i,2) );
1531 rDampingMatrix(FirstRow+2,FirstCol+1) = -(viscos_weight * nn[1]*rShapeDeriv(
i,2) );
1532 rDampingMatrix(FirstRow+2,FirstCol+2) = -(viscos_weight * ( nn[2]*rShapeDeriv(
i,2) + Diag ) );
1568 template<
unsigned int TDim,
1569 unsigned int TNumNodes >
1576 template<
unsigned int TDim,
1577 unsigned int TNumNodes >
1582 rOStream << std::endl;
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Node NodeType
definition of node type (default is: Node)
Definition: dpg_vms.h:62
int Check(const ProcessInfo &rCurrentProcessInfo) const override
Checks the input and that all required Kratos variables have been registered.
Definition: dpg_vms.h:1018
std::vector< std::size_t > EquationIdVectorType
Definition: dpg_vms.h:76
std::size_t IndexType
Definition: dpg_vms.h:74
VMS< TDim, TNumNodes > ElementBaseType
Element from which it is derived.
Definition: dpg_vms.h:60
DPGVMS(IndexType NewId, GeometryType::Pointer pGeometry, PropertiesType::Pointer pProperties)
Constuctor using geometry and properties.
Definition: dpg_vms.h:115
void CalculateOnIntegrationPoints(const Variable< double > &rVariable, std::vector< double > &rValues, const ProcessInfo &rCurrentProcessInfo) override
Definition: dpg_vms.h:973
void AddIntegrationPointVelocityContribution(MatrixType &rDampingMatrix, VectorType &rDampRHS, const double Density, const double Viscosity, const array_1d< double, 3 > &rAdvVel, const double TauOne, const double TauTwo, const array_1d< double, TNumNodes > &rShapeFunc, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv, const double Weight, const double gauss_N_en, Matrix &gauss_enriched_gradients)
Add a the contribution from a single integration point to the velocity contribution.
Definition: dpg_vms.h:1305
std::vector< Dof< double >::Pointer > DofsVectorType
Definition: dpg_vms.h:77
Geometry< NodeType >::PointsArrayType NodesArrayType
definition of nodes container type, redefined from GeometryType
Definition: dpg_vms.h:71
~DPGVMS() override
Destructor.
Definition: dpg_vms.h:120
void CalculateLocalSystem(MatrixType &rLeftHandSideMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Provides local contributions from body forces and OSS projection terms.
Definition: dpg_vms.h:221
void AddMassStabTerms(MatrixType &rLHSMatrix, const double Density, const array_1d< double, 3 > &rAdvVel, const double TauOne, const array_1d< double, TNumNodes > &rShapeFunc, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv, const double Weight, const Matrix &gauss_enriched_gradients)
Add mass-like stabilization terms to LHS.
Definition: dpg_vms.h:1251
std::size_t SizeType
Definition: dpg_vms.h:75
void FinalizeNonLinearIteration(const ProcessInfo &rCurrentProcessInfo) override
Implementation of FinalizeNonLinearIteration to compute enriched pressure.
Definition: dpg_vms.h:693
PointerVectorSet< Dof< double >, IndexedObject > DofsArrayType
Definition: dpg_vms.h:78
void LumpMassMatrix(MatrixType &rMassMatrix)
Definition: dpg_vms.h:1102
ElementBaseType::MatrixType MatrixType
Definition: dpg_vms.h:73
void CalculateLocalVelocityContribution(MatrixType &rDampingMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Computes the local contribution associated to 'new' velocity and pressure values.
Definition: dpg_vms.h:444
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: dpg_vms.h:1079
DPGVMS(IndexType NewId=0)
Default constuctor.
Definition: dpg_vms.h:87
Geometry< NodeType > GeometryType
definition of the geometry type with given NodeType
Definition: dpg_vms.h:69
void Calculate(const Variable< array_1d< double, 3 > > &rVariable, array_1d< double, 3 > &rOutput, const ProcessInfo &rCurrentProcessInfo) override
Implementation of Calculate to compute the local OSS projections.
Definition: dpg_vms.h:811
Element::Pointer Create(IndexType NewId, NodesArrayType const &ThisNodes, PropertiesType::Pointer pProperties) const override
Definition: dpg_vms.h:137
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Provides local contributions from body forces and projections to the RHS.
Definition: dpg_vms.h:262
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: dpg_vms.h:1184
DPGVMS(IndexType NewId, GeometryType::Pointer pGeometry)
Constructor using a geometry object.
Definition: dpg_vms.h:105
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: dpg_vms.h:1127
void InitializeSolutionStep(const ProcessInfo &rCurrentProcessInfo) override
Call at teh begining of each step, ita decides if element is cutted or no!
Definition: dpg_vms.h:160
DPGVMS(IndexType NewId, const NodesArrayType &ThisNodes)
Constructor using an array of nodes.
Definition: dpg_vms.h:96
void InitializeNonLinearIteration(const ProcessInfo &rCurrentProcessInfo) override
Call at teh begining of each iteration, ita decides if element is cutted or no!
Definition: dpg_vms.h:171
void GetFirstDerivativesVector(Vector &values, int Step) const override
Returns VELOCITY_X, VELOCITY_Y, (VELOCITY_Z,) PRESSURE for each node.
Definition: dpg_vms.h:746
Element::Pointer Create(IndexType NewId, GeometryType::Pointer pGeom, PropertiesType::Pointer pProperties) const override
Create a new element of this type.
Definition: dpg_vms.h:149
KRATOS_CLASS_INTRUSIVE_POINTER_DEFINITION(DPGVMS)
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: dpg_vms.h:1146
void GetSecondDerivativesVector(Vector &values, int Step) const override
Returns ACCELERATION_X, ACCELERATION_Y, (ACCELERATION_Z,) 0 for each node.
Definition: dpg_vms.h:775
Properties PropertiesType
Definition: dpg_vms.h:67
IndexedObject BaseType
base type: an IndexedObject that automatically has a unique number
Definition: dpg_vms.h:58
Vector VectorType
Definition: dpg_vms.h:72
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: dpg_vms.h:1202
void CalculateMassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo) override
Computes local contributions to the mass matrix.
Definition: dpg_vms.h:348
std::string Info() const override
Turn back information as a string.
Definition: dpg_vms.h:1072
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
static int CalculateTetrahedraEnrichedShapeFuncions(TMatrixType const &rPoints, TGradientType const &DN_DX, TVectorType rDistances, TVectorType &rVolumes, TMatrixType &rShapeFunctionValues, TVectorType &rPartitionsSign, std::vector< TMatrixType > &rGradientsValue, TMatrixType &NEnriched, array_1d< double, 6 > &edge_areas)
Definition: enrichment_utilities.h:69
std::size_t IndexType
Definition: flags.h:74
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: geometrical_object.h:248
GeometryType & GetGeometry()
Returns the reference of the geometry.
Definition: geometrical_object.h:158
void SetValue(const TVariableType &rThisVariable, typename TVariableType::Type const &rValue)
Definition: geometrical_object.h:238
Geometry base class.
Definition: geometry.h:71
SizeType size() const
Definition: geometry.h:518
IndexType const & Id() const
Id of this Geometry.
Definition: geometry.h:964
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: geometry.h:627
SizeType WorkingSpaceDimension() const
Definition: geometry.h:1287
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
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
A stabilized element for the incompressible Navier-Stokes equations.
Definition: vms.h:104
void CalculateMassMatrix(MatrixType &rMassMatrix, const ProcessInfo &rCurrentProcessInfo) override
Computes local contributions to the mass matrix.
Definition: vms.h:326
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.
void GetFirstDerivativesVector(Vector &Values, int Step=0) const override
Returns VELOCITY_X, VELOCITY_Y, (VELOCITY_Z,) PRESSURE for each node.
void FinalizeNonLinearIteration(const ProcessInfo &rCurrentProcessInfo) override
Definition: vms.h:437
void CalculateLocalVelocityContribution(MatrixType &rDampingMatrix, VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Computes the local contribution associated to 'new' velocity and pressure values.
Definition: vms.h:382
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
virtual void CalculateTau(double &TauOne, double &TauTwo, const array_1d< double, 3 > &rAdvVel, const double ElemSize, const double Density, const double Viscosity, const ProcessInfo &rCurrentProcessInfo)
Calculate Stabilization parameters.
Definition: vms.h:945
void CalculateRightHandSide(VectorType &rRightHandSideVector, const ProcessInfo &rCurrentProcessInfo) override
Provides local contributions from body forces and projections to the RHS.
Definition: vms.h:276
void AddConsistentMassMatrixContribution(MatrixType &rLHSMatrix, const array_1d< double, TNumNodes > &rShapeFunc, const double Density, const double Weight)
Definition: vms.h:1076
double ConsistentMassCoef(const double Area)
void AddProjectionResidualContribution(const array_1d< double, 3 > &rAdvVel, const double Density, array_1d< double, 3 > &rElementalMomRes, double &rElementalMassRes, const array_1d< double, TNumNodes > &rShapeFunc, const BoundedMatrix< double, TNumNodes, TDim > &rShapeDeriv, const double Weight)
Assemble the contribution from an integration point to the element's residual.
Definition: vms.h:1267
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
void GetSecondDerivativesVector(Vector &Values, int Step=0) const override
Returns ACCELERATION_X, ACCELERATION_Y, (ACCELERATION_Z,) 0 for each node.
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
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
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
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
list values
Definition: bombardelli_test.py:42
ProcessInfo
Definition: edgebased_PureConvection.py:116
float dist
Definition: edgebased_PureConvection.py:89
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