14 #if !defined(KRATOS_NODAL_RESIDUAL_BASED_ELIMINATION_BUILDER_AND_SOLVER_CONTINUITY)
15 #define KRATOS_NODAL_RESIDUAL_BASED_ELIMINATION_BUILDER_AND_SOLVER_CONTINUITY
25 #ifdef USE_GOOGLE_HASH
26 #include "sparsehash/dense_hash_set"
28 #include <unordered_set>
74 template <
class TSparseSpace,
122 typename TLinearSolver::Pointer pNewLinearSystemSolver)
123 :
BuilderAndSolver<TSparseSpace, TDenseSpace, TLinearSolver>(pNewLinearSystemSolver)
143 typename TSchemeType::Pointer pScheme,
160 const double timeInterval = CurrentProcessInfo[DELTA_TIME];
161 const double deviatoric_threshold = 0.1;
163 double deltaPressure = 0;
164 double meanMeshSize = 0;
165 double characteristicLength = 0;
167 double nodalVelocityNorm = 0;
175 unsigned int firstRow = 0;
176 unsigned int firstCol = 0;
188 const unsigned int neighSize = neighb_nodes.
size() + 1;
193 const double nodalVolume = itNode->FastGetSolutionStepValue(NODAL_VOLUME);
197 if (EquationId.size() != neighSize)
198 EquationId.resize(neighSize,
false);
200 double deviatoricCoeff = 0;
203 if (deviatoricCoeff > deviatoric_threshold)
205 deviatoricCoeff = deviatoric_threshold;
208 double volumetricCoeff = timeInterval * itNode->FastGetSolutionStepValue(BULK_MODULUS);
210 deltaPressure = itNode->FastGetSolutionStepValue(PRESSURE, 0) - itNode->FastGetSolutionStepValue(PRESSURE, 1);
212 LHS_Contribution(0, 0) += nodalVolume / volumetricCoeff;
213 RHS_Contribution[0] += -deltaPressure * nodalVolume / volumetricCoeff;
215 RHS_Contribution[0] += itNode->GetSolutionStepValue(NODAL_VOLUMETRIC_DEF_RATE) * nodalVolume;
217 const unsigned int xDofPos = itNode->GetDofPosition(PRESSURE);
218 EquationId[0] = itNode->GetDof(PRESSURE, xDofPos).EquationId();
220 for (
unsigned int i = 0;
i < neighb_nodes.
size();
i++)
222 EquationId[
i + 1] = neighb_nodes[
i].GetDof(PRESSURE, xDofPos).EquationId();
227 meanMeshSize = itNode->FastGetSolutionStepValue(NODAL_MEAN_MESH_SIZE);
228 characteristicLength = 1.0 * meanMeshSize;
229 density = itNode->FastGetSolutionStepValue(DENSITY);
235 nodalVelocityNorm = sqrt(itNode->FastGetSolutionStepValue(VELOCITY_X) * itNode->FastGetSolutionStepValue(VELOCITY_X) +
236 itNode->FastGetSolutionStepValue(VELOCITY_Y) * itNode->FastGetSolutionStepValue(VELOCITY_Y));
240 nodalVelocityNorm = sqrt(itNode->FastGetSolutionStepValue(VELOCITY_X) * itNode->FastGetSolutionStepValue(VELOCITY_X) +
241 itNode->FastGetSolutionStepValue(VELOCITY_Y) * itNode->FastGetSolutionStepValue(VELOCITY_Y) +
242 itNode->FastGetSolutionStepValue(VELOCITY_Z) * itNode->FastGetSolutionStepValue(VELOCITY_Z));
245 tauStab = 1.0 * (characteristicLength * characteristicLength * timeInterval) / (
density * nodalVelocityNorm * timeInterval * characteristicLength +
density * characteristicLength * characteristicLength + 8.0 * deviatoricCoeff * timeInterval);
246 itNode->FastGetSolutionStepValue(NODAL_TAU) = tauStab;
248 LHS_Contribution(0, 0) += +nodalVolume * tauStab *
density / (volumetricCoeff * timeInterval);
249 RHS_Contribution[0] += -nodalVolume * tauStab *
density / (volumetricCoeff * timeInterval) * (deltaPressure - itNode->FastGetSolutionStepValue(PRESSURE_VELOCITY, 0) * timeInterval);
251 if (itNode->Is(FREE_SURFACE))
256 LHS_Contribution(0, 0) += +4.0 * tauStab * nodalVolume / (meanMeshSize * meanMeshSize);
257 RHS_Contribution[0] += -4.0 * tauStab * nodalVolume / (meanMeshSize * meanMeshSize) * itNode->FastGetSolutionStepValue(PRESSURE, 0);
260 Vector &SpatialDefRate = itNode->FastGetSolutionStepValue(NODAL_SPATIAL_DEF_RATE);
261 array_1d<double, 3> nodalAcceleration = 0.5 * (itNode->FastGetSolutionStepValue(VELOCITY, 0) - itNode->FastGetSolutionStepValue(VELOCITY, 1)) / timeInterval - itNode->FastGetSolutionStepValue(ACCELERATION, 1);
264 double nodalNormalAcceleration = 0;
265 double nodalNormalProjDefRate = 0;
268 nodalNormalProjDefRate = Normal[0] * SpatialDefRate[0] * Normal[0] + Normal[1] * SpatialDefRate[1] * Normal[1] + 2 * Normal[0] * SpatialDefRate[2] * Normal[1];
272 nodalNormalAcceleration = Normal[0] * nodalAcceleration[0] + Normal[1] * nodalAcceleration[1];
276 nodalNormalProjDefRate = Normal[0] * SpatialDefRate[0] * Normal[0] + Normal[1] * SpatialDefRate[1] * Normal[1] + Normal[2] * SpatialDefRate[2] * Normal[2] +
277 2 * Normal[0] * SpatialDefRate[3] * Normal[1] + 2 * Normal[0] * SpatialDefRate[4] * Normal[2] + 2 * Normal[1] * SpatialDefRate[5] * Normal[2];
283 double accelerationContribution = 2.0 *
density * nodalNormalAcceleration / meanMeshSize;
284 double deviatoricContribution = 8.0 * deviatoricCoeff * nodalNormalProjDefRate / (meanMeshSize * meanMeshSize);
286 RHS_Contribution[0] += 1.0 * tauStab * (accelerationContribution - deviatoricContribution) * nodalVolume;
289 array_1d<double, 3> &VolumeAcceleration = itNode->FastGetSolutionStepValue(VOLUME_ACCELERATION);
313 for (
unsigned int i = 0;
i < neighSize;
i++)
316 dNdXi = itNode->FastGetSolutionStepValue(NODAL_SFD_NEIGHBOURS)[firstCol];
317 dNdYi = itNode->FastGetSolutionStepValue(NODAL_SFD_NEIGHBOURS)[firstCol + 1];
322 EquationId[
i] = neighb_nodes[
i - 1].GetDof(PRESSURE, xDofPos).EquationId();
324 density = neighb_nodes[
i - 1].FastGetSolutionStepValue(DENSITY);
353 RHS_Contribution[
i] += -tauStab *
density * (dNdXi * VolumeAcceleration[0] + dNdYi * VolumeAcceleration[1]) * nodalVolume;
357 dNdZi = itNode->FastGetSolutionStepValue(NODAL_SFD_NEIGHBOURS)[firstCol + 2];
358 RHS_Contribution[
i] += -tauStab *
density * (dNdXi * VolumeAcceleration[0] + dNdYi * VolumeAcceleration[1] + dNdZi * VolumeAcceleration[2]) * nodalVolume;
363 for (
unsigned int j = 0;
j < neighSize;
j++)
365 dNdXj = itNode->FastGetSolutionStepValue(NODAL_SFD_NEIGHBOURS)[firstRow];
366 dNdYj = itNode->FastGetSolutionStepValue(NODAL_SFD_NEIGHBOURS)[firstRow + 1];
371 pressure = neighb_nodes[
j - 1].FastGetSolutionStepValue(PRESSURE, 0);
388 pressure = itNode->FastGetSolutionStepValue(PRESSURE, 0);
407 LHS_Contribution(
i,
j) += +tauStab * (dNdXi * dNdXj + dNdYi * dNdYj) * nodalVolume;
409 RHS_Contribution[
i] += -tauStab * (dNdXi * dNdXj + dNdYi * dNdYj) * nodalVolume *
pressure;
419 dNdZj = itNode->FastGetSolutionStepValue(NODAL_SFD_NEIGHBOURS)[firstRow + 2];
421 LHS_Contribution(
i,
j) += +tauStab * (dNdXi * dNdXj + dNdYi * dNdYj + dNdZi * dNdZj) * nodalVolume;
423 RHS_Contribution[
i] += -tauStab * (dNdXi * dNdXj + dNdYi * dNdYj + dNdZi * dNdZj) * nodalVolume *
pressure;
432 Assemble(
A,
b, LHS_Contribution, RHS_Contribution, EquationId, mlock_array);
434 Assemble(
A,
b, LHS_Contribution, RHS_Contribution, EquationId);
445 const double tolerance = 1
e-12;
449 const double static_friction = itNode->FastGetSolutionStepValue(STATIC_FRICTION);
450 const double dynamic_friction = itNode->FastGetSolutionStepValue(DYNAMIC_FRICTION);
451 const double delta_friction = dynamic_friction - static_friction;
452 const double inertial_number_zero = itNode->FastGetSolutionStepValue(INERTIAL_NUMBER_ZERO);
453 const double grain_diameter = itNode->FastGetSolutionStepValue(GRAIN_DIAMETER);
454 const double grain_density = itNode->FastGetSolutionStepValue(GRAIN_DENSITY);
455 const double regularization_coeff = itNode->FastGetSolutionStepValue(REGULARIZATION_COEFFICIENT);
457 const double theta = 0.5;
458 double mean_pressure = itNode->FastGetSolutionStepValue(PRESSURE, 0) * theta + itNode->FastGetSolutionStepValue(PRESSURE, 1) * (1 - theta);
460 double pressure_tolerance = -1.0e-07;
461 if (mean_pressure > pressure_tolerance)
463 mean_pressure = pressure_tolerance;
466 const double equivalent_strain_rate = itNode->FastGetSolutionStepValue(NODAL_EQUIVALENT_STRAIN_RATE);
467 const double exponent = -equivalent_strain_rate / regularization_coeff;
468 const double second_viscous_term = delta_friction * grain_diameter / (inertial_number_zero * std::sqrt(std::fabs(mean_pressure) / grain_density) + equivalent_strain_rate * grain_diameter);
470 if (std::fabs(equivalent_strain_rate) > tolerance)
472 const double first_viscous_term = static_friction * (1 - std::exp(exponent)) / equivalent_strain_rate;
473 deviatoricCoefficient = (first_viscous_term + second_viscous_term) * std::fabs(mean_pressure);
477 deviatoricCoefficient = 1.0;
482 const double dynamic_viscosity = itNode->FastGetSolutionStepValue(DYNAMIC_VISCOSITY);
483 const double friction_angle = itNode->FastGetSolutionStepValue(INTERNAL_FRICTION_ANGLE);
484 const double cohesion = itNode->FastGetSolutionStepValue(COHESION);
485 const double adaptive_exponent = itNode->FastGetSolutionStepValue(ADAPTIVE_EXPONENT);
487 const double theta = 0.5;
488 double mean_pressure = itNode->FastGetSolutionStepValue(PRESSURE, 0) * theta + itNode->FastGetSolutionStepValue(PRESSURE, 1) * (1 - theta);
490 double pressure_tolerance = -1.0e-07;
491 if (mean_pressure > pressure_tolerance)
493 mean_pressure = pressure_tolerance;
496 const double equivalent_strain_rate = itNode->FastGetSolutionStepValue(NODAL_EQUIVALENT_STRAIN_RATE);
499 if (std::fabs(equivalent_strain_rate) > tolerance)
501 const double friction_angle_rad = friction_angle *
Globals::Pi / 180.0;
502 const double tanFi = std::tan(friction_angle_rad);
503 double regularization = 1.0 - std::exp(-adaptive_exponent * equivalent_strain_rate);
504 deviatoricCoefficient = dynamic_viscosity + regularization * ((cohesion + tanFi * fabs(mean_pressure)) / equivalent_strain_rate);
508 deviatoricCoefficient = dynamic_viscosity;
513 const double yieldShear = itNode->FastGetSolutionStepValue(YIELD_SHEAR);
514 const double equivalentStrainRate = itNode->FastGetSolutionStepValue(NODAL_EQUIVALENT_STRAIN_RATE);
515 const double adaptiveExponent = itNode->FastGetSolutionStepValue(ADAPTIVE_EXPONENT);
516 const double exponent = -adaptiveExponent * equivalentStrainRate;
517 deviatoricCoefficient = itNode->FastGetSolutionStepValue(DYNAMIC_VISCOSITY);
518 if (std::abs(equivalentStrainRate) > tolerance)
520 deviatoricCoefficient += (yieldShear / equivalentStrainRate) * (1 - exp(exponent));
525 deviatoricCoefficient = itNode->FastGetSolutionStepValue(DYNAMIC_VISCOSITY);
527 itNode->FastGetSolutionStepValue(DEVIATORIC_COEFFICIENT) = deviatoricCoefficient;
531 typename TSchemeType::Pointer pScheme,
548 const double timeInterval = CurrentProcessInfo[DELTA_TIME];
549 const double deviatoric_threshold = 0.1;
550 double deltaPressure = 0;
551 double meanMeshSize = 0;
552 double characteristicLength = 0;
554 double nodalVelocityNorm = 0;
559 unsigned int firstCol = 0;
571 const unsigned int neighSize = neighb_nodes.
size() + 1;
576 const double nodalVolume = itNode->FastGetSolutionStepValue(NODAL_VOLUME);
581 if (EquationId.size() != neighSize)
582 EquationId.resize(neighSize,
false);
584 double deviatoricCoeff = 0;
587 if (deviatoricCoeff > deviatoric_threshold)
589 deviatoricCoeff = deviatoric_threshold;
592 double volumetricCoeff = timeInterval * itNode->FastGetSolutionStepValue(BULK_MODULUS);
594 deltaPressure = itNode->FastGetSolutionStepValue(PRESSURE, 0) - itNode->FastGetSolutionStepValue(PRESSURE, 1);
596 LHS_Contribution(0, 0) += nodalVolume / volumetricCoeff;
598 RHS_Contribution[0] += -deltaPressure * nodalVolume / volumetricCoeff;
600 RHS_Contribution[0] += itNode->GetSolutionStepValue(NODAL_VOLUMETRIC_DEF_RATE) * nodalVolume;
602 const unsigned int xDofPos = itNode->GetDofPosition(PRESSURE);
604 EquationId[0] = itNode->GetDof(PRESSURE, xDofPos).EquationId();
606 for (
unsigned int i = 0;
i < neighb_nodes.
size();
i++)
608 EquationId[
i + 1] = neighb_nodes[
i].GetDof(PRESSURE, xDofPos).EquationId();
612 meanMeshSize = itNode->FastGetSolutionStepValue(NODAL_MEAN_MESH_SIZE);
613 characteristicLength = 1.0 * meanMeshSize;
614 density = itNode->FastGetSolutionStepValue(DENSITY);
620 nodalVelocityNorm = sqrt(itNode->FastGetSolutionStepValue(VELOCITY_X) * itNode->FastGetSolutionStepValue(VELOCITY_X) +
621 itNode->FastGetSolutionStepValue(VELOCITY_Y) * itNode->FastGetSolutionStepValue(VELOCITY_Y));
625 nodalVelocityNorm = sqrt(itNode->FastGetSolutionStepValue(VELOCITY_X) * itNode->FastGetSolutionStepValue(VELOCITY_X) +
626 itNode->FastGetSolutionStepValue(VELOCITY_Y) * itNode->FastGetSolutionStepValue(VELOCITY_Y) +
627 itNode->FastGetSolutionStepValue(VELOCITY_Z) * itNode->FastGetSolutionStepValue(VELOCITY_Z));
630 tauStab = 1.0 * (characteristicLength * characteristicLength * timeInterval) /
631 (
density * nodalVelocityNorm * timeInterval * characteristicLength +
density * characteristicLength * characteristicLength + 8.0 * deviatoricCoeff * timeInterval);
633 itNode->FastGetSolutionStepValue(NODAL_TAU) = tauStab;
635 LHS_Contribution(0, 0) += +nodalVolume * tauStab *
density / (volumetricCoeff * timeInterval);
636 RHS_Contribution[0] += -nodalVolume * tauStab *
density / (volumetricCoeff * timeInterval) * (deltaPressure - itNode->FastGetSolutionStepValue(PRESSURE_VELOCITY, 0) * timeInterval);
638 if (itNode->Is(FREE_SURFACE))
643 LHS_Contribution(0, 0) += +4.0 * tauStab * nodalVolume / (meanMeshSize * meanMeshSize);
644 RHS_Contribution[0] += -4.0 * tauStab * nodalVolume / (meanMeshSize * meanMeshSize) * itNode->FastGetSolutionStepValue(PRESSURE, 0);
647 Vector &SpatialDefRate = itNode->FastGetSolutionStepValue(NODAL_SPATIAL_DEF_RATE);
648 array_1d<double, 3> nodalAcceleration = 0.5 * (itNode->FastGetSolutionStepValue(VELOCITY, 0) - itNode->FastGetSolutionStepValue(VELOCITY, 1)) / timeInterval - itNode->FastGetSolutionStepValue(ACCELERATION, 1);
651 double nodalNormalAcceleration = 0;
652 double nodalNormalProjDefRate = 0;
655 nodalNormalProjDefRate = Normal[0] * SpatialDefRate[0] * Normal[0] + Normal[1] * SpatialDefRate[1] * Normal[1] + 2 * Normal[0] * SpatialDefRate[2] * Normal[1];
659 nodalNormalAcceleration = Normal[0] * nodalAcceleration[0] + Normal[1] * nodalAcceleration[1];
663 nodalNormalProjDefRate = Normal[0] * SpatialDefRate[0] * Normal[0] + Normal[1] * SpatialDefRate[1] * Normal[1] + Normal[2] * SpatialDefRate[2] * Normal[2] +
664 2 * Normal[0] * SpatialDefRate[3] * Normal[1] + 2 * Normal[0] * SpatialDefRate[4] * Normal[2] + 2 * Normal[1] * SpatialDefRate[5] * Normal[2];
670 double accelerationContribution = 2.0 *
density * nodalNormalAcceleration / meanMeshSize;
671 double deviatoricContribution = 8.0 * deviatoricCoeff * nodalNormalProjDefRate / (meanMeshSize * meanMeshSize);
673 RHS_Contribution[0] += 1.0 * tauStab * (accelerationContribution - deviatoricContribution) * nodalVolume;
676 array_1d<double, 3> &VolumeAcceleration = itNode->FastGetSolutionStepValue(VOLUME_ACCELERATION);
700 for (
unsigned int i = 0;
i < neighSize;
i++)
703 dNdXi = itNode->FastGetSolutionStepValue(NODAL_SFD_NEIGHBOURS)[firstCol];
704 dNdYi = itNode->FastGetSolutionStepValue(NODAL_SFD_NEIGHBOURS)[firstCol + 1];
709 EquationId[
i] = neighb_nodes[
i - 1].GetDof(PRESSURE, xDofPos).EquationId();
711 density = neighb_nodes[
i - 1].FastGetSolutionStepValue(DENSITY);
741 RHS_Contribution[
i] += -tauStab *
density * (dNdXi * VolumeAcceleration[0] + dNdYi * VolumeAcceleration[1]) * nodalVolume;
745 dNdZi = itNode->FastGetSolutionStepValue(NODAL_SFD_NEIGHBOURS)[firstCol + 2];
746 RHS_Contribution[
i] += -tauStab *
density * (dNdXi * VolumeAcceleration[0] + dNdYi * VolumeAcceleration[1] + dNdZi * VolumeAcceleration[2]) * nodalVolume;
753 Assemble(
A,
b, LHS_Contribution, RHS_Contribution, EquationId, mlock_array);
755 Assemble(
A,
b, LHS_Contribution, RHS_Contribution, EquationId);
765 typename TSchemeType::Pointer pScheme,
782 const double timeInterval = CurrentProcessInfo[DELTA_TIME];
783 const double deviatoric_threshold = 0.1;
784 double deltaPressure = 0;
785 double meanMeshSize = 0;
786 double characteristicLength = 0;
788 double nodalVelocityNorm = 0;
801 const unsigned int neighSize = neighb_nodes.
size() + 1;
806 const double nodalVolume = itNode->FastGetSolutionStepValue(NODAL_VOLUME);
811 if (EquationId.size() != neighSize)
812 EquationId.resize(neighSize,
false);
814 double deviatoricCoeff = 0;
817 if (deviatoricCoeff > deviatoric_threshold)
819 deviatoricCoeff = deviatoric_threshold;
822 double volumetricCoeff = timeInterval * itNode->FastGetSolutionStepValue(BULK_MODULUS);
824 deltaPressure = itNode->FastGetSolutionStepValue(PRESSURE, 0) - itNode->FastGetSolutionStepValue(PRESSURE, 1);
826 LHS_Contribution(0, 0) += nodalVolume / volumetricCoeff;
828 RHS_Contribution[0] += -deltaPressure * nodalVolume / volumetricCoeff;
830 RHS_Contribution[0] += itNode->GetSolutionStepValue(NODAL_VOLUMETRIC_DEF_RATE) * nodalVolume;
832 const unsigned int xDofPos = itNode->GetDofPosition(PRESSURE);
834 EquationId[0] = itNode->GetDof(PRESSURE, xDofPos).EquationId();
836 for (
unsigned int i = 0;
i < neighb_nodes.
size();
i++)
838 EquationId[
i + 1] = neighb_nodes[
i].GetDof(PRESSURE, xDofPos).EquationId();
841 meanMeshSize = itNode->FastGetSolutionStepValue(NODAL_MEAN_MESH_SIZE);
842 characteristicLength = 1.0 * meanMeshSize;
843 density = itNode->FastGetSolutionStepValue(DENSITY);
849 nodalVelocityNorm = sqrt(itNode->FastGetSolutionStepValue(VELOCITY_X) * itNode->FastGetSolutionStepValue(VELOCITY_X) +
850 itNode->FastGetSolutionStepValue(VELOCITY_Y) * itNode->FastGetSolutionStepValue(VELOCITY_Y));
854 nodalVelocityNorm = sqrt(itNode->FastGetSolutionStepValue(VELOCITY_X) * itNode->FastGetSolutionStepValue(VELOCITY_X) +
855 itNode->FastGetSolutionStepValue(VELOCITY_Y) * itNode->FastGetSolutionStepValue(VELOCITY_Y) +
856 itNode->FastGetSolutionStepValue(VELOCITY_Z) * itNode->FastGetSolutionStepValue(VELOCITY_Z));
859 tauStab = 1.0 * (characteristicLength * characteristicLength * timeInterval) /
860 (
density * nodalVelocityNorm * timeInterval * characteristicLength +
density * characteristicLength * characteristicLength + 8.0 * deviatoricCoeff * timeInterval);
862 itNode->FastGetSolutionStepValue(NODAL_TAU) = tauStab;
864 LHS_Contribution(0, 0) += +nodalVolume * tauStab *
density / (volumetricCoeff * timeInterval);
865 RHS_Contribution[0] += -nodalVolume * tauStab *
density / (volumetricCoeff * timeInterval) * (deltaPressure - itNode->FastGetSolutionStepValue(PRESSURE_VELOCITY, 0) * timeInterval);
867 if (itNode->Is(FREE_SURFACE))
873 LHS_Contribution(0, 0) += +4.0 * tauStab * nodalVolume / (meanMeshSize * meanMeshSize);
874 RHS_Contribution[0] += -4.0 * tauStab * nodalVolume / (meanMeshSize * meanMeshSize) * itNode->FastGetSolutionStepValue(PRESSURE, 0);
877 Vector &SpatialDefRate = itNode->FastGetSolutionStepValue(NODAL_SPATIAL_DEF_RATE);
878 array_1d<double, 3> nodalAcceleration = 0.5 * (itNode->FastGetSolutionStepValue(VELOCITY, 0) - itNode->FastGetSolutionStepValue(VELOCITY, 1)) / timeInterval - itNode->FastGetSolutionStepValue(ACCELERATION, 1);
881 double nodalNormalAcceleration = 0;
882 double nodalNormalProjDefRate = 0;
885 nodalNormalProjDefRate = Normal[0] * SpatialDefRate[0] * Normal[0] + Normal[1] * SpatialDefRate[1] * Normal[1] + 2 * Normal[0] * SpatialDefRate[2] * Normal[1];
889 nodalNormalAcceleration = Normal[0] * nodalAcceleration[0] + Normal[1] * nodalAcceleration[1];
893 nodalNormalProjDefRate = Normal[0] * SpatialDefRate[0] * Normal[0] + Normal[1] * SpatialDefRate[1] * Normal[1] + Normal[2] * SpatialDefRate[2] * Normal[2] +
894 2 * Normal[0] * SpatialDefRate[3] * Normal[1] + 2 * Normal[0] * SpatialDefRate[4] * Normal[2] + 2 * Normal[1] * SpatialDefRate[5] * Normal[2];
900 double accelerationContribution = 2.0 *
density * nodalNormalAcceleration / meanMeshSize;
901 double deviatoricContribution = 8.0 * deviatoricCoeff * nodalNormalProjDefRate / (meanMeshSize * meanMeshSize);
903 RHS_Contribution[0] += 1.0 * tauStab * (accelerationContribution - deviatoricContribution) * nodalVolume;
907 Assemble(
A,
b, LHS_Contribution, RHS_Contribution, EquationId, mlock_array);
909 Assemble(
A,
b, LHS_Contribution, RHS_Contribution, EquationId);
919 typename TSchemeType::Pointer pScheme,
935 const double timeInterval = CurrentProcessInfo[DELTA_TIME];
936 const double deviatoric_threshold = 0.1;
937 double deltaPressure = 0;
949 const unsigned int neighSize = neighb_nodes.
size() + 1;
954 const double nodalVolume = itNode->FastGetSolutionStepValue(NODAL_VOLUME);
959 if (EquationId.size() != neighSize)
960 EquationId.resize(neighSize,
false);
962 double deviatoricCoeff = 0;
965 if (deviatoricCoeff > deviatoric_threshold)
967 deviatoricCoeff = deviatoric_threshold;
970 double volumetricCoeff = timeInterval * itNode->FastGetSolutionStepValue(BULK_MODULUS);
972 deltaPressure = itNode->FastGetSolutionStepValue(PRESSURE, 0) - itNode->FastGetSolutionStepValue(PRESSURE, 1);
974 LHS_Contribution(0, 0) += nodalVolume / volumetricCoeff;
976 RHS_Contribution[0] += -deltaPressure * nodalVolume / volumetricCoeff;
978 RHS_Contribution[0] += itNode->GetSolutionStepValue(NODAL_VOLUMETRIC_DEF_RATE) * nodalVolume;
980 const unsigned int xDofPos = itNode->GetDofPosition(PRESSURE);
982 EquationId[0] = itNode->GetDof(PRESSURE, xDofPos).EquationId();
984 for (
unsigned int i = 0;
i < neighb_nodes.
size();
i++)
986 EquationId[
i + 1] = neighb_nodes[
i].GetDof(PRESSURE, xDofPos).EquationId();
990 Assemble(
A,
b, LHS_Contribution, RHS_Contribution, EquationId, mlock_array);
992 Assemble(
A,
b, LHS_Contribution, RHS_Contribution, EquationId);
1002 typename TSchemeType::Pointer pScheme,
1019 const double timeInterval = CurrentProcessInfo[DELTA_TIME];
1020 const double deviatoric_threshold = 0.1;
1021 double deltaPressure = 0;
1033 const unsigned int neighSize = neighb_nodes.
size() + 1;
1038 if (LHS_Contribution.size1() != 1)
1039 LHS_Contribution.resize(1, 1,
false);
1041 if (RHS_Contribution.size() != 1)
1042 RHS_Contribution.resize(1,
false);
1047 if (EquationId.size() != 1)
1048 EquationId.resize(1,
false);
1050 double nodalVolume = itNode->FastGetSolutionStepValue(NODAL_VOLUME);
1052 if (nodalVolume > 0)
1055 double deviatoricCoeff = 0;
1058 if (deviatoricCoeff > deviatoric_threshold)
1060 deviatoricCoeff = deviatoric_threshold;
1063 double volumetricCoeff = timeInterval * itNode->FastGetSolutionStepValue(BULK_MODULUS);
1065 deltaPressure = itNode->FastGetSolutionStepValue(PRESSURE, 0) - itNode->FastGetSolutionStepValue(PRESSURE, 1);
1067 LHS_Contribution(0, 0) += nodalVolume / volumetricCoeff;
1069 RHS_Contribution[0] += -deltaPressure * nodalVolume / volumetricCoeff;
1071 RHS_Contribution[0] += itNode->GetSolutionStepValue(NODAL_VOLUMETRIC_DEF_RATE) * nodalVolume;
1074 const unsigned int xDofPos = itNode->GetDofPosition(PRESSURE);
1076 EquationId[0] = itNode->GetDof(PRESSURE, xDofPos).EquationId();
1079 Assemble(
A,
b, LHS_Contribution, RHS_Contribution, EquationId, mlock_array);
1081 Assemble(
A,
b, LHS_Contribution, RHS_Contribution, EquationId);
1093 int A_size =
A.size1();
1096 std::vector<omp_lock_t> lock_array(
A.size1());
1098 for (
int i = 0;
i < A_size;
i++)
1099 omp_init_lock(&lock_array[
i]);
1103 CreatePartition(number_of_threads, pElements.size(), element_partition);
1110 #pragma omp parallel for firstprivate(number_of_threads) schedule(static, 1)
1111 for (
int k = 0;
k < number_of_threads;
k++)
1121 typename ElementsArrayType::ptr_iterator it_begin = pElements.ptr_begin() + element_partition[
k];
1122 typename ElementsArrayType::ptr_iterator it_end = pElements.ptr_begin() + element_partition[
k + 1];
1124 unsigned int pos = (rModelPart.
Nodes().begin())->GetDofPosition(PRESSURE);
1127 for (
typename ElementsArrayType::ptr_iterator it = it_begin; it != it_end; ++it)
1130 (*it)->CalculateLocalSystem(elementalLHS_Contribution, elementalRHS_Contribution, CurrentProcessInfo);
1133 if (elementalEquationId.size() != geom.
size())
1134 elementalEquationId.resize(geom.
size(),
false);
1136 for (
unsigned int i = 0;
i < geom.
size();
i++)
1137 elementalEquationId[
i] = geom[
i].GetDof(PRESSURE, pos).EquationId();
1141 this->
Assemble(A,
b, elementalLHS_Contribution, elementalRHS_Contribution, elementalEquationId, lock_array);
1143 this->
Assemble(A,
b, elementalLHS_Contribution, elementalRHS_Contribution, elementalEquationId);
1149 for (
int i = 0;
i < A_size;
i++)
1150 omp_destroy_lock(&lock_array[
i]);
1180 TSparseSpace::SetToZero(Dx);
1220 TSparseSpace::SetToZero(Dx);
1241 typename TSchemeType::Pointer pScheme,
1286 <<
"\nSystem Matrix = " << A <<
"\nUnknowns vector = " << Dx <<
"\nRHS vector = " <<
b << std::endl;
1299 <<
"\nSystem Matrix = " << A <<
"\nUnknowns vector = " << Dx <<
"\nRHS vector = " <<
b << std::endl;
1305 typename TSchemeType::Pointer pScheme,
1327 int A_size =
A.size1();
1330 std::vector<omp_lock_t> lock_array(
A.size1());
1332 for (
int i = 0;
i < A_size;
i++)
1333 omp_init_lock(&lock_array[
i]);
1337 CreatePartition(number_of_threads, pElements.size(), element_partition);
1346 #pragma omp parallel for firstprivate(number_of_threads) schedule(static, 1)
1347 for (
int k = 0;
k < number_of_threads;
k++)
1357 typename ElementsArrayType::ptr_iterator it_begin = pElements.ptr_begin() + element_partition[
k];
1358 typename ElementsArrayType::ptr_iterator it_end = pElements.ptr_begin() + element_partition[
k + 1];
1360 unsigned int pos = (r_model_part.
Nodes().begin())->GetDofPosition(PRESSURE);
1363 for (
typename ElementsArrayType::ptr_iterator it = it_begin; it != it_end; ++it)
1367 (*it)->CalculateLocalSystem(LHS_Contribution, RHS_Contribution, CurrentProcessInfo);
1370 if (EquationId.size() != geom.
size())
1371 EquationId.resize(geom.
size(),
false);
1373 for (
unsigned int i = 0;
i < geom.
size();
i++)
1374 EquationId[
i] = geom[
i].GetDof(PRESSURE, pos).EquationId();
1378 this->
Assemble(A,
b, LHS_Contribution, RHS_Contribution, EquationId, lock_array);
1380 this->
Assemble(A,
b, LHS_Contribution, RHS_Contribution, EquationId);
1392 for (
int i = 0;
i < A_size;
i++)
1393 omp_destroy_lock(&lock_array[
i]);
1408 typename TSchemeType::Pointer pScheme,
1417 const int nelements =
static_cast<int>(pElements.size());
1431 #ifdef USE_GOOGLE_HASH
1432 typedef google::dense_hash_set<NodeType::DofType::Pointer, DofPointerHasher> set_type;
1434 typedef std::unordered_set<NodeType::DofType::Pointer, DofPointerHasher> set_type;
1438 std::vector<set_type> dofs_aux_list(nthreads);
1441 for (
int i = 0; i < static_cast<int>(nthreads);
i++)
1443 #ifdef USE_GOOGLE_HASH
1447 dofs_aux_list[
i].reserve(nelements);
1452 for (
int i = 0; i < static_cast<int>(nelements); ++
i)
1454 auto it_elem = pElements.begin() +
i;
1458 pScheme->GetDofList(*it_elem, ElementalDofList, CurrentProcessInfo);
1460 dofs_aux_list[this_thread_id].insert(ElementalDofList.begin(), ElementalDofList.end());
1464 unsigned int old_max = nthreads;
1465 unsigned int new_max = ceil(0.5 *
static_cast<double>(old_max));
1466 while (new_max >= 1 && new_max != old_max)
1469 #pragma omp parallel for
1470 for (
int i = 0; i < static_cast<int>(new_max);
i++)
1472 if (
i + new_max < old_max)
1474 dofs_aux_list[
i].insert(dofs_aux_list[
i + new_max].begin(), dofs_aux_list[
i + new_max].end());
1475 dofs_aux_list[
i + new_max].clear();
1480 new_max = ceil(0.5 *
static_cast<double>(old_max));
1486 Doftemp.
reserve(dofs_aux_list[0].size());
1487 for (
auto it = dofs_aux_list[0].begin(); it != dofs_aux_list[0].end(); it++)
1503 if (mlock_array.size() != 0)
1505 for (
int i = 0; i < static_cast<int>(mlock_array.size());
i++)
1506 omp_destroy_lock(&mlock_array[
i]);
1511 for (
int i = 0; i < static_cast<int>(mlock_array.size());
i++)
1512 omp_init_lock(&mlock_array[
i]);
1522 KRATOS_ERROR_IF_NOT(dof_iterator->HasReaction()) <<
"Reaction variable not set for the following : " << std::endl
1523 <<
"Node : " << dof_iterator->Id() << std::endl
1524 <<
"Dof : " << (*dof_iterator) << std::endl
1525 <<
"Not possible to calculate reactions." << std::endl;
1551 if (dof_iterator->IsFixed())
1552 dof_iterator->SetEquationId(--fix_id);
1554 dof_iterator->SetEquationId(free_id++);
1563 typename TSchemeType::Pointer pScheme,
1608 KRATOS_WATCH(
"it should not come here!!!!!!!! ... this is SLOW");
1609 KRATOS_ERROR <<
"The equation system size has changed during the simulation. This is not permited." << std::endl;
1646 typename TSchemeType::Pointer pScheme,
1667 KRATOS_INFO_IF(
"NodalResidualBasedEliminationBuilderAndSolverContinuity", this->
GetEchoLevel() > 1) <<
"Clear Function called" << std::endl;
1723 std::vector<omp_lock_t> &lock_array
1727 unsigned int local_size = LHS_Contribution.size1();
1729 for (
unsigned int i_local = 0; i_local <
local_size; i_local++)
1731 unsigned int i_global = EquationId[i_local];
1736 omp_set_lock(&lock_array[i_global]);
1738 b[i_global] += RHS_Contribution(i_local);
1739 for (
unsigned int j_local = 0; j_local <
local_size; j_local++)
1741 unsigned int j_global = EquationId[j_local];
1744 A(i_global, j_global) += LHS_Contribution(i_local, j_local);
1748 omp_unset_lock(&lock_array[i_global]);
1758 typename TSchemeType::Pointer pScheme,
1767 std::vector<std::unordered_set<std::size_t>> indices(equation_size);
1769 #pragma omp parallel for firstprivate(equation_size)
1770 for (
int iii = 0; iii < static_cast<int>(equation_size); iii++)
1772 indices[iii].reserve(40);
1777 #pragma omp parallel firstprivate(ids)
1783 std::vector<std::unordered_set<std::size_t>> temp_indexes(equation_size);
1786 for (
int index = 0; index < static_cast<int>(equation_size); ++index)
1787 temp_indexes[index].reserve(30);
1790 const int number_of_elements =
static_cast<int>(rModelPart.
Elements().
size());
1796 #pragma omp for schedule(guided, 512) nowait
1797 for (
int i_elem = 0; i_elem < number_of_elements; ++i_elem)
1799 auto it_elem = el_begin + i_elem;
1800 pScheme->EquationId(*it_elem, ids, r_current_process_info);
1802 for (
auto &id_i : ids)
1806 auto &row_indices = temp_indexes[id_i];
1807 for (
auto &id_j : ids)
1809 row_indices.insert(id_j);
1815 const int number_of_conditions =
static_cast<int>(rModelPart.
Conditions().size());
1821 #pragma omp for schedule(guided, 512) nowait
1822 for (
int i_cond = 0; i_cond < number_of_conditions; ++i_cond)
1824 auto it_cond = cond_begin + i_cond;
1825 pScheme->EquationId(*it_cond, ids, r_current_process_info);
1826 for (
auto &id_i : ids)
1830 auto &row_indices = temp_indexes[id_i];
1831 for (
auto &id_j : ids)
1833 row_indices.insert(id_j);
1839 #pragma omp critical
1841 for (
int i = 0; i < static_cast<int>(temp_indexes.size()); ++
i)
1843 indices[
i].insert(temp_indexes[
i].begin(), temp_indexes[
i].end());
1849 unsigned int nnz = 0;
1850 for (
unsigned int i = 0;
i < indices.size();
i++)
1851 nnz += indices[
i].size();
1853 A = boost::numeric::ublas::compressed_matrix<double>(indices.size(), indices.size(), nnz);
1855 double *Avalues =
A.value_data().begin();
1856 std::size_t *Arow_indices =
A.index1_data().begin();
1857 std::size_t *Acol_indices =
A.index2_data().begin();
1860 Arow_indices[0] = 0;
1861 for (
int i = 0; i < static_cast<int>(
A.size1());
i++)
1862 Arow_indices[
i + 1] = Arow_indices[
i] + indices[
i].size();
1864 #pragma omp parallel for
1865 for (
int i = 0; i < static_cast<int>(
A.size1());
i++)
1867 const unsigned int row_begin = Arow_indices[
i];
1868 const unsigned int row_end = Arow_indices[
i + 1];
1869 unsigned int k = row_begin;
1870 for (
auto it = indices[
i].begin(); it != indices[
i].end(); it++)
1872 Acol_indices[
k] = *it;
1877 std::sort(&Acol_indices[row_begin], &Acol_indices[row_end]);
1880 A.set_filled(indices.size() + 1, nnz);
1890 unsigned int local_size = LHS_Contribution.size1();
1892 for (
unsigned int i_local = 0; i_local <
local_size; i_local++)
1894 unsigned int i_global = EquationId[i_local];
1897 for (
unsigned int j_local = 0; j_local <
local_size; j_local++)
1899 unsigned int j_global = EquationId[j_local];
1901 A(i_global, j_global) += LHS_Contribution(i_local, j_local);
1929 std::vector<omp_lock_t> mlock_array;
1939 inline void AddUnique(std::vector<std::size_t> &
v,
const std::size_t &candidate)
1941 std::vector<std::size_t>::iterator
i =
v.begin();
1942 std::vector<std::size_t>::iterator endit =
v.end();
1943 while (
i != endit && (*
i) != candidate)
1949 v.push_back(candidate);
1952 inline void CreatePartition(
unsigned int number_of_threads,
const int number_of_rows, DenseVector<unsigned int> &partitions)
1954 partitions.resize(number_of_threads + 1);
1955 int partition_size = number_of_rows / number_of_threads;
1957 partitions[number_of_threads] = number_of_rows;
1958 for (
unsigned int i = 1;
i < number_of_threads;
i++)
1959 partitions[
i] = partitions[
i - 1] + partition_size;
1967 unsigned int local_size = RHS_Contribution.size();
1971 for (
unsigned int i_local = 0; i_local <
local_size; i_local++)
1973 const unsigned int i_global = EquationId[i_local];
1978 double &b_value =
b[i_global];
1979 const double &rhs_value = RHS_Contribution[i_local];
1982 b_value += rhs_value;
1989 for (
unsigned int i_local = 0; i_local <
local_size; i_local++)
1991 const unsigned int i_global = EquationId[i_local];
1996 double &b_value =
b[i_global];
1997 const double &rhs_value = RHS_Contribution[i_local];
2000 b_value += rhs_value;
2005 const double &rhs_value = RHS_Contribution[i_local];
2008 b_value += rhs_value;
2016 void AssembleLHS_CompleteOnFreeRows(
2021 unsigned int local_size = LHS_Contribution.size1();
2022 for (
unsigned int i_local = 0; i_local <
local_size; i_local++)
2024 unsigned int i_global = EquationId[i_local];
2027 for (
unsigned int j_local = 0; j_local <
local_size; j_local++)
2029 int j_global = EquationId[j_local];
2030 A(i_global, j_global) += LHS_Contribution(i_local, j_local);
Current class provides an implementation for the base builder and solving operations.
Definition: builder_and_solver.h:64
std::size_t IndexType
Definition of the index type.
Definition: builder_and_solver.h:76
bool mDofSetIsInitialized
If the matrix is reshaped each step.
Definition: builder_and_solver.h:743
TSparseSpace::VectorType TSystemVectorType
Definition of the vector size.
Definition: builder_and_solver.h:85
ModelPart::NodesContainerType NodesArrayType
The containers of the entities.
Definition: builder_and_solver.h:109
bool GetCalculateReactionsFlag() const
This method returns the flag mCalculateReactionsFlag.
Definition: builder_and_solver.h:184
TSparseSpace::MatrixType TSystemMatrixType
Definition of the sparse matrix.
Definition: builder_and_solver.h:82
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: builder_and_solver.h:111
TSystemVectorPointerType mpReactionsVector
Definition: builder_and_solver.h:751
bool GetReshapeMatrixFlag() const
This method returns the flag mReshapeMatrixFlag.
Definition: builder_and_solver.h:220
TDenseSpace::MatrixType LocalSystemMatrixType
The local matrix definition.
Definition: builder_and_solver.h:94
TSparseSpace::VectorPointerType TSystemVectorPointerType
Definition of the pointer to the vector.
Definition: builder_and_solver.h:91
TSparseSpace::DataType TDataType
Definition of the data type.
Definition: builder_and_solver.h:79
TLinearSolver::Pointer mpLinearSystemSolver
Definition: builder_and_solver.h:737
DofsArrayType mDofSet
Pointer to the linear solver.
Definition: builder_and_solver.h:739
TDenseSpace::VectorType LocalSystemVectorType
The local vector definition.
Definition: builder_and_solver.h:97
TSparseSpace::MatrixPointerType TSystemMatrixPointerType
Definition of the pointer to the sparse matrix.
Definition: builder_and_solver.h:88
bool mCalculateReactionsFlag
Flag taking care if the dof set was initialized ot not.
Definition: builder_and_solver.h:745
int GetEchoLevel() const
It returns the echo level.
Definition: builder_and_solver.h:674
unsigned int mEquationSystemSize
Flag taking in account if it is needed or not to calculate the reactions.
Definition: builder_and_solver.h:747
ModelPart::ElementsContainerType ElementsArrayType
Definition: builder_and_solver.h:110
virtual int MyPID() const
Definition: communicator.cpp:91
Dof * Pointer
Pointer definition of Dof.
Definition: dof.h:93
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
Geometry base class.
Definition: geometry.h:71
SizeType size() const
Definition: geometry.h:518
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
size_type size() const
Definition: global_pointers_vector.h:307
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
ConditionIterator ConditionsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1361
Communicator & GetCommunicator()
Definition: model_part.h:1821
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
MeshType::NodeIterator NodeIterator
Definition: model_part.h:134
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
VariablesList & GetNodalSolutionStepVariablesList()
Definition: model_part.h:549
Current class provides an implementation for standard builder and solving operations.
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:80
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:100
BaseType::ElementsArrayType ElementsArrayType
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:108
void SetUpSystem(ModelPart &rModelPart) override
Organises the dofset in order to speed up the building phase.
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:1537
Node NodeType
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:105
void SystemSolveWithPhysics(TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b, ModelPart &rModelPart)
This is a call to the linear system solver (taking into account some physical particularities of the ...
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:1195
void AssembleLHS(TSystemMatrixType &A, LocalSystemMatrixType &LHS_Contribution, Element::EquationIdVectorType &EquationId)
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:1885
BaseType::TSystemMatrixPointerType TSystemMatrixPointerType
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:102
NodalResidualBasedEliminationBuilderAndSolverContinuity(typename TLinearSolver::Pointer pNewLinearSystemSolver)
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:121
BaseType::TSystemMatrixType TSystemMatrixType
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:94
void BuildNodallyUnlessLaplacian(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &b)
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:530
BaseType::TSystemVectorType TSystemVectorType
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:96
Vector VectorType
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:113
void GetDeviatoricCoefficientForFluid(ModelPart &rModelPart, ModelPart::NodeIterator itNode, double &deviatoricCoefficient)
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:443
void BuildNodallyNotStabilized(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &b)
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:918
void BuildAndSolve(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Function to perform the building and solving phase at the same time.
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:1240
void SetUpDofSet(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart) override
Builds the list of the DofSets involved in the problem by "asking" to each element and condition its ...
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:1407
virtual void ConstructMatrixStructure(typename TSchemeType::Pointer pScheme, TSystemMatrixType &A, ModelPart &rModelPart)
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:1757
BaseType::ConditionsArrayType ConditionsArrayType
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:109
int Check(ModelPart &rModelPart) override
This function is designed to be called once to perform all the checks needed on the input provided....
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:1677
void Clear() override
This function is intended to be called at the end of the solution step to clean up memory storage not...
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:1657
void BuildNodally(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &b)
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:142
BaseType::TDataType TDataType
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:90
void BuildAll(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &b)
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:1001
void BuildNodallyNoVolumetricStabilizedTerms(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &b)
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:764
KRATOS_CLASS_POINTER_DEFINITION(NodalResidualBasedEliminationBuilderAndSolverContinuity)
~NodalResidualBasedEliminationBuilderAndSolverContinuity() override
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:130
BaseType::TSystemVectorPointerType TSystemVectorPointerType
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:103
BaseType::NodesArrayType NodesArrayType
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:107
void Assemble(TSystemMatrixType &A, TSystemVectorType &b, const LocalSystemMatrixType &LHS_Contribution, const LocalSystemVectorType &RHS_Contribution, const Element::EquationIdVectorType &EquationId)
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:1715
BaseType::TSchemeType TSchemeType
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:88
void ApplyDirichletConditions(typename TSchemeType::Pointer pScheme, ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Applies the dirichlet conditions. This operation may be very heavy or completely unexpensive dependin...
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:1645
BaseType::ElementsContainerType ElementsContainerType
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:111
void Build(typename TSchemeType::Pointer pScheme, ModelPart &r_model_part, TSystemMatrixType &A, TSystemVectorType &b) override
equivalent (but generally faster) then performing BuildLHS and BuildRHS
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:1304
BuilderAndSolver< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:86
BaseType::DofsArrayType DofsArrayType
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:92
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:98
void ResizeAndInitializeVectors(typename TSchemeType::Pointer pScheme, TSystemMatrixPointerType &pA, TSystemVectorPointerType &pDx, TSystemVectorPointerType &pb, ModelPart &rModelPart) override
This method initializes and resizes the system of equations.
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:1562
void SystemSolve(TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
This is a call to the linear system solver.
Definition: nodal_residualbased_elimination_builder_and_solver_continuity.h:1161
This class defines the node.
Definition: node.h:65
static int ThisThread()
Wrapper for omp_get_thread_num().
Definition: openmp_utils.h:108
static void PartitionedIterators(TVector &rVector, typename TVector::iterator &rBegin, typename TVector::iterator &rEnd)
Generate a partition for an std::vector-like array, providing iterators to the begin and end position...
Definition: openmp_utils.h:179
static int GetNumThreads()
Returns the current number of threads.
Definition: parallel_utilities.cpp:34
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
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: pointer_vector_set.h:95
size_type size() const
Returns the number of elements in the container.
Definition: pointer_vector_set.h:502
void Sort()
Sort the elements in the set.
Definition: pointer_vector_set.h:753
void push_back(TPointerType x)
Adds a pointer to the end of the set.
Definition: pointer_vector_set.h:544
void reserve(int reservedsize)
Reserves memory for a specified number of elements.
Definition: pointer_vector_set.h:733
iterator end()
Returns an iterator pointing to the end of the container.
Definition: pointer_vector_set.h:314
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
This class provides the implementation of the basic tasks that are needed by the solution strategy.
Definition: scheme.h:56
static void Start(std::string const &rIntervalName)
This method starts the timer meassures.
Definition: timer.cpp:109
static void Stop(std::string const &rIntervalName)
This method stops the timer meassures.
Definition: timer.cpp:125
bool Has(const VariableData &rThisVariable) const
Definition: variables_list.h:372
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_WATCH(variable)
Definition: define.h:806
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF_NOT(conditional)
Definition: exception.h:163
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
#define KRATOS_INFO_IF(label, conditional)
Definition: logger.h:251
#define KRATOS_WARNING_IF(label, conditional)
Definition: logger.h:266
constexpr double Pi
Definition: global_variables.h:25
double TwoNorm(SparseSpaceType &dummy, SparseSpaceType::VectorType &x)
Definition: add_strategies_to_python.cpp:164
TSpaceType::IndexType Size(TSpaceType &dummy, typename TSpaceType::VectorType const &rV)
Definition: add_strategies_to_python.cpp:111
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
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
float density
Definition: face_heat.py:56
v
Definition: generate_convection_diffusion_explicit_element.py:114
int local_size
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:17
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
A
Definition: sensitivityMatrix.py:70
integer i
Definition: TensorModule.f:17
float pressure
Definition: test_pureconvectionsolver_benchmarking.py:101
e
Definition: run_cpp_mpi_tests.py:31