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.
algebraic_flux_corrected_steady_scalar_scheme.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: Suneth Warnakulasuriya
11 //
12 
13 #if !defined(KRATOS_ALGEBRAIC_FLUX_CORRECTED_SCALAR_STEADY_SCHEME)
14 #define KRATOS_ALGEBRAIC_FLUX_CORRECTED_SCALAR_STEADY_SCHEME
15 
16 // Project includes
17 #include "includes/define.h"
18 #include "includes/model_part.h"
20 #include "utilities/openmp_utils.h"
22 
23 // Application includes
26 
27 namespace Kratos
28 {
31 
49 template <class TSparseSpace, class TDenseSpace>
50 class AlgebraicFluxCorrectedSteadyScalarScheme : public Scheme<TSparseSpace, TDenseSpace>
51 {
52 public:
55 
57 
59 
61 
63 
65 
67 
69 
73 
75  const double RelaxationFactor,
76  const Flags BoundaryFlags)
77  : BaseType(),
78  mRelaxationFactor(RelaxationFactor),
79  mBoundaryFlags(BoundaryFlags),
80  mrPeriodicIdVar(Variable<int>::StaticObject())
81  {
82  KRATOS_INFO("AlgebraicFluxCorrectedSteadyScalarScheme")
83  << " Using residual based algebraic flux corrected scheme with "
84  "relaxation "
85  "factor = "
86  << std::scientific << mRelaxationFactor << "\n";
87 
88  mpDofUpdater = Kratos::make_unique<DofUpdaterType>(mRelaxationFactor);
89  }
90 
92  const double RelaxationFactor,
93  const Flags BoundaryFlags,
94  const Variable<int>& rPeriodicIdVar)
95  : BaseType(),
96  mRelaxationFactor(RelaxationFactor),
97  mBoundaryFlags(BoundaryFlags),
98  mrPeriodicIdVar(rPeriodicIdVar)
99  {
100  KRATOS_INFO("AlgebraicFluxCorrectedSteadyScalarScheme")
101  << " Using periodic residual based algebraic flux corrected scheme "
102  "with relaxation "
103  "factor = "
104  << std::scientific << mRelaxationFactor << "\n";
105 
106  mpDofUpdater = Kratos::make_unique<DofUpdaterType>(mRelaxationFactor);
107  }
108 
110 
114 
115  void Initialize(ModelPart& rModelPart) override
116  {
117  KRATOS_TRY
118 
119  BaseType::Initialize(rModelPart);
120 
121  block_for_each(rModelPart.Nodes(), [&](ModelPart::NodeType& rNode) {
122  rNode.SetValue(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX, 0.0);
123  rNode.SetValue(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX, 0.0);
124  rNode.SetValue(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX_LIMIT, 0.0);
125  rNode.SetValue(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX_LIMIT, 0.0);
126  });
127 
128  if (mrPeriodicIdVar != Variable<int>::StaticObject()) {
129  block_for_each(rModelPart.Conditions(), [&](const ModelPart::ConditionType& rCondition) {
130  if (rCondition.Is(PERIODIC)) {
131  // this only supports 2 noded periodic conditions
132  KRATOS_ERROR_IF(rCondition.GetGeometry().PointsNumber() != 2)
133  << this->Info() << " only supports two noded periodic conditions. Found "
134  << rCondition.Info() << " with "
135  << rCondition.GetGeometry().PointsNumber() << " nodes.\n";
136 
137  const auto& r_node_0 = rCondition.GetGeometry()[0];
138  const std::size_t r_node_0_pair_id =
139  r_node_0.FastGetSolutionStepValue(mrPeriodicIdVar);
140 
141  const auto& r_node_1 = rCondition.GetGeometry()[1];
142  const std::size_t r_node_1_pair_id =
143  r_node_1.FastGetSolutionStepValue(mrPeriodicIdVar);
144 
145  KRATOS_ERROR_IF(r_node_0_pair_id != r_node_1.Id())
146  << "Periodic condition pair id mismatch in "
147  << mrPeriodicIdVar.Name() << ". [ " << r_node_0_pair_id
148  << " != " << r_node_1.Id() << " ].\n";
149 
150  KRATOS_ERROR_IF(r_node_1_pair_id != r_node_0.Id())
151  << "Periodic condition pair id mismatch in "
152  << mrPeriodicIdVar.Name() << ". [ " << r_node_1_pair_id
153  << " != " << r_node_0.Id() << " ].\n";
154  }
155  });
156  }
157 
158  // Allocate auxiliary memory.
159  const auto num_threads = OpenMPUtils::GetNumThreads();
160  mAntiDiffusiveFlux.resize(num_threads);
161  mAntiDiffusiveFluxCoefficients.resize(num_threads);
162  mValues.resize(num_threads);
163  mAuxMatrix.resize(num_threads);
164 
165  KRATOS_CATCH("");
166  }
167 
169  ModelPart& rModelPart,
171  TSystemVectorType& Dx,
172  TSystemVectorType& b) override
173  {
174  KRATOS_TRY
175 
176  auto& r_nodes = rModelPart.Nodes();
177 
178  block_for_each(r_nodes, [&](ModelPart::NodeType& rNode) {
179  rNode.GetValue(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX) = 0.0;
180  rNode.GetValue(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX) = 0.0;
181  rNode.GetValue(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX_LIMIT) = 0.0;
182  rNode.GetValue(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX_LIMIT) = 0.0;
183  });
184 
185  auto& r_elements = rModelPart.Elements();
186  const int number_of_elements = r_elements.size();
187 
188  const ProcessInfo& r_current_process_info = rModelPart.GetProcessInfo();
189 
190 #pragma omp parallel
191  {
192  Matrix left_hand_side, artificial_diffusion, aux_matrix;
193  Vector right_hand_side, values;
194  std::vector<IndexType> equation_ids;
195 #pragma omp for
196  for (int i = 0; i < number_of_elements; ++i) {
197  auto& r_element = *(r_elements.begin() + i);
198  this->CalculateSystemMatrix<Element>(r_element, left_hand_side,
199  right_hand_side, aux_matrix,
200  r_current_process_info);
201  this->CalculateArtificialDiffusionMatrix(artificial_diffusion, left_hand_side);
202  r_element.EquationIdVector(equation_ids, r_current_process_info);
203  r_element.GetValuesVector(values);
204 
205  const int size = artificial_diffusion.size1();
206 
207  Vector p_plus = ZeroVector(size);
208  Vector p_minus = ZeroVector(size);
209  Vector q_plus = ZeroVector(size);
210  Vector q_minus = ZeroVector(size);
211 
212  auto& r_geometry = r_element.GetGeometry();
213  for (int i = 0; i < size; ++i) {
214  for (int j = 0; j < size; j++) {
215  if (i != j) {
216  const double f_ij = artificial_diffusion(i, j) *
217  (values[j] - values[i]);
218 
219  if (left_hand_side(j, i) <= left_hand_side(i, j)) {
220  p_plus[i] += std::max(0.0, f_ij);
221  p_minus[i] -= std::max(0.0, -f_ij);
222  }
223 
224  if (equation_ids[i] < equation_ids[j]) {
225  q_plus[i] += std::max(0.0, -f_ij);
226  q_minus[i] -= std::max(0.0, f_ij);
227  q_plus[j] += std::max(0.0, f_ij);
228  q_minus[j] -= std::max(0.0, -f_ij);
229  }
230  }
231  }
232  }
233 
234  for (int i = 0; i < size; ++i) {
235  auto& r_node = r_geometry[i];
236  r_node.SetLock();
237  r_node.GetValue(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX) += p_plus[i];
238  r_node.GetValue(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX_LIMIT) += q_plus[i];
239  r_node.GetValue(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX) += p_minus[i];
240  r_node.GetValue(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX_LIMIT) += q_minus[i];
241  r_node.UnSetLock();
242  }
243  }
244  }
245 
246  if (mrPeriodicIdVar != Variable<int>::StaticObject()) {
247  block_for_each(rModelPart.Conditions(), [&](ModelPart::ConditionType& rCondition) {
248  if (rCondition.Is(PERIODIC)) {
249  auto& r_node_0 = rCondition.GetGeometry()[0];
250  auto& r_node_1 = rCondition.GetGeometry()[1];
251 
252  double p_plus = r_node_0.GetValue(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX);
253  double q_plus = r_node_0.GetValue(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX_LIMIT);
254  double p_minus = r_node_0.GetValue(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX);
255  double q_minus = r_node_0.GetValue(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX_LIMIT);
256 
257  p_plus += r_node_1.GetValue(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX);
258  q_plus += r_node_1.GetValue(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX_LIMIT);
259  p_minus += r_node_1.GetValue(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX);
260  q_minus += r_node_1.GetValue(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX_LIMIT);
261 
262  r_node_0.SetLock();
263  r_node_0.GetValue(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX) = p_plus;
264  r_node_0.GetValue(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX_LIMIT) = q_plus;
265  r_node_0.GetValue(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX) = p_minus;
266  r_node_0.GetValue(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX_LIMIT) = q_minus;
267  r_node_0.UnSetLock();
268 
269  r_node_1.SetLock();
270  r_node_1.GetValue(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX) = p_plus;
271  r_node_1.GetValue(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX_LIMIT) = q_plus;
272  r_node_1.GetValue(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX) = p_minus;
273  r_node_1.GetValue(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX_LIMIT) = q_minus;
274  r_node_1.UnSetLock();
275  }
276  });
277  }
278 
279  Communicator& r_communicator = rModelPart.GetCommunicator();
280  r_communicator.AssembleNonHistoricalData(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX);
281  r_communicator.AssembleNonHistoricalData(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX_LIMIT);
282  r_communicator.AssembleNonHistoricalData(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX);
283  r_communicator.AssembleNonHistoricalData(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX_LIMIT);
284 
285  KRATOS_CATCH("")
286  }
287 
288  void Update(
289  ModelPart& rModelPart,
290  DofsArrayType& rDofSet,
291  TSystemMatrixType& rA,
292  TSystemVectorType& rDx,
293  TSystemVectorType& rb) override
294  {
295  KRATOS_TRY;
296 
297  mpDofUpdater->UpdateDofs(rDofSet, rDx);
298 
299  KRATOS_CATCH("");
300  }
301 
302  void Clear() override
303  {
304  this->mpDofUpdater->Clear();
305  }
306 
308  Element& rElement,
309  LocalSystemMatrixType& rLHS_Contribution,
310  LocalSystemVectorType& rRHS_Contribution,
311  Element::EquationIdVectorType& rEquationIdVector,
312  const ProcessInfo& rCurrentProcessInfo) override
313  {
314  KRATOS_TRY;
315 
316  const auto k = OpenMPUtils::ThisThread();
317 
318  this->CalculateSystemMatrix<Element>(rElement, rLHS_Contribution, rRHS_Contribution,
319  mAuxMatrix[k], rCurrentProcessInfo);
320  rElement.EquationIdVector(rEquationIdVector, rCurrentProcessInfo);
321 
322  this->CalculateArtificialDiffusionMatrix(mAuxMatrix[k], rLHS_Contribution);
323 
324  AddAntiDiffusiveFluxes(rRHS_Contribution, rLHS_Contribution, rElement,
325  mAuxMatrix[k]);
326  noalias(rLHS_Contribution) += mAuxMatrix[k];
327 
328  rElement.GetValuesVector(mValues[k]);
329  noalias(rRHS_Contribution) -= prod(rLHS_Contribution, mValues[k]);
330 
331  KRATOS_CATCH("");
332  }
333 
335  Condition& rCondition,
336  LocalSystemMatrixType& rLHS_Contribution,
337  LocalSystemVectorType& rRHS_Contribution,
338  Element::EquationIdVectorType& rEquationIdVector,
339  const ProcessInfo& rCurrentProcessInfo) override
340  {
341  KRATOS_TRY;
342 
343  const auto k = OpenMPUtils::ThisThread();
344 
345  this->CalculateSystemMatrix<Condition>(rCondition, rLHS_Contribution, rRHS_Contribution,
346  mAuxMatrix[k], rCurrentProcessInfo);
347  rCondition.EquationIdVector(rEquationIdVector, rCurrentProcessInfo);
348 
349  KRATOS_CATCH("");
350  }
351 
353  Element& rElement,
354  LocalSystemVectorType& rRHS_Contribution,
355  Element::EquationIdVectorType& rEquationIdVector,
356  const ProcessInfo& rCurrentProcessInfo) override
357  {
358  KRATOS_TRY;
359 
360  const auto k = OpenMPUtils::ThisThread();
361  CalculateSystemContributions(rElement, mAuxMatrix[k], rRHS_Contribution,
362  rEquationIdVector, rCurrentProcessInfo);
363 
364  KRATOS_CATCH("");
365  }
366 
368  Condition& rCondition,
369  LocalSystemVectorType& rRHS_Contribution,
370  Condition::EquationIdVectorType& rEquationIdVector,
371  const ProcessInfo& rCurrentProcessInfo) override
372  {
373  KRATOS_TRY;
374 
375  const auto k = OpenMPUtils::ThisThread();
376  CalculateSystemContributions(rCondition, mAuxMatrix[k], rRHS_Contribution,
377  rEquationIdVector, rCurrentProcessInfo);
378 
379  KRATOS_CATCH("");
380  }
381 
383 
384 protected:
387 
389 
390 private:
393 
394  using DofUpdaterType = RelaxedDofUpdater<TSparseSpace>;
395  using DofUpdaterPointerType = typename DofUpdaterType::UniquePointer;
396 
397  DofUpdaterPointerType mpDofUpdater;
398 
399  double mRelaxationFactor;
400  const Flags mBoundaryFlags;
401  const Variable<int>& mrPeriodicIdVar;
402 
403  std::vector<LocalSystemMatrixType> mAuxMatrix;
404  std::vector<LocalSystemMatrixType> mAntiDiffusiveFluxCoefficients;
405  std::vector<LocalSystemMatrixType> mAntiDiffusiveFlux;
406  std::vector<LocalSystemVectorType> mValues;
407 
418  template <typename TItem>
419  void CalculateSystemMatrix(
420  TItem& rItem,
421  LocalSystemMatrixType& rLeftHandSide,
422  LocalSystemVectorType& rRightHandSide,
423  LocalSystemMatrixType& rAuxMatrix,
424  const ProcessInfo& rCurrentProcessInfo)
425  {
426  KRATOS_TRY
427 
428  rItem.CalculateLocalSystem(rLeftHandSide, rRightHandSide, rCurrentProcessInfo);
429  rItem.CalculateLocalVelocityContribution(rAuxMatrix, rRightHandSide, rCurrentProcessInfo);
430 
431  if (rAuxMatrix.size1() != 0) {
432  noalias(rLeftHandSide) += rAuxMatrix;
433  }
434 
435  KRATOS_CATCH("");
436  }
437 
444  void CalculateArtificialDiffusionMatrix(
445  Matrix& rOutput,
446  const Matrix& rInput)
447  {
448  const IndexType size = rInput.size1();
449 
450  if (rOutput.size1() != size || rOutput.size2() != size) {
451  rOutput.resize(size, size, false);
452  }
453 
454  rOutput = ZeroMatrix(size, size);
455 
456  for (IndexType i = 0; i < size; ++i) {
457  for (IndexType j = i + 1; j < size; ++j) {
458  rOutput(i, j) = -std::max(std::max(rInput(i, j), rInput(j, i)), 0.0);
459  rOutput(j, i) = rOutput(i, j);
460  }
461  }
462 
463  for (IndexType i = 0; i < size; ++i) {
464  double value = 0.0;
465  for (IndexType j = 0; j < size; ++j) {
466  value -= rOutput(i, j);
467  }
468  rOutput(i, i) = value;
469  }
470  }
471 
485  template <typename TItem>
486  void AddAntiDiffusiveFluxes(
487  Vector& rRHS,
488  const Matrix& rLHS,
489  TItem& rItem,
490  const Matrix& rArtificialDiffusion)
491  {
492  KRATOS_TRY
493 
494  const auto k = OpenMPUtils::ThisThread();
495  const auto size = rRHS.size();
496 
497  auto& r_anti_diffusive_flux_coefficients = mAntiDiffusiveFluxCoefficients[k];
498  auto& r_anti_diffusive_flux = mAntiDiffusiveFlux[k];
499  auto& r_values = mValues[k];
500 
501  rItem.GetValuesVector(r_values);
502  if (r_anti_diffusive_flux_coefficients.size1() != size ||
503  r_anti_diffusive_flux_coefficients.size2() != size) {
504  r_anti_diffusive_flux_coefficients.resize(size, size, false);
505  }
506 
507  if (r_anti_diffusive_flux.size1() != size || r_anti_diffusive_flux.size2() != size) {
508  r_anti_diffusive_flux.resize(size, size, false);
509  }
510 
511  noalias(r_anti_diffusive_flux_coefficients) = ZeroMatrix(size, size);
512  noalias(r_anti_diffusive_flux) = ZeroMatrix(size, size);
513 
514  for (IndexType i = 0; i < size; ++i) {
515  const auto& r_node_i = rItem.GetGeometry()[i];
516  double r_plus_i{0.0}, r_minus_i{0.0};
517  CalculateAntiDiffusiveFluxR(r_plus_i, r_minus_i, r_node_i);
518 
519  for (IndexType j = 0; j < size; ++j) {
520  if (i != j) {
521  r_anti_diffusive_flux(i, j) =
522  rArtificialDiffusion(i, j) * (r_values[j] - r_values[i]);
523 
524  if (rLHS(j, i) <= rLHS(i, j)) {
525  if (r_anti_diffusive_flux(i, j) > 0.0) {
526  r_anti_diffusive_flux_coefficients(i, j) = r_plus_i;
527  } else if (r_anti_diffusive_flux(i, j) < 0.0) {
528  r_anti_diffusive_flux_coefficients(i, j) = r_minus_i;
529  } else {
530  r_anti_diffusive_flux_coefficients(i, j) = 1.0;
531  }
532  r_anti_diffusive_flux_coefficients(j, i) =
533  r_anti_diffusive_flux_coefficients(i, j);
534  }
535  }
536  }
537  }
538 
539  for (IndexType i = 0; i < size; ++i) {
540  for (IndexType j = 0; j < size; ++j) {
541  rRHS[i] += r_anti_diffusive_flux_coefficients(i, j) *
542  r_anti_diffusive_flux(i, j);
543  }
544  }
545 
546  KRATOS_CATCH("");
547  }
548 
556  void CalculateAntiDiffusiveFluxR(
557  double& rRPlus,
558  double& rRMinus,
559  const ModelPart::NodeType& rNode) const
560  {
561  if (rNode.Is(mBoundaryFlags)) {
562  rRMinus = 1.0;
563  rRPlus = 1.0;
564  } else {
565  const double q_plus = rNode.GetValue(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX_LIMIT);
566  const double p_plus = rNode.GetValue(AFC_POSITIVE_ANTI_DIFFUSIVE_FLUX);
567  const double q_minus = rNode.GetValue(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX_LIMIT);
568  const double p_minus = rNode.GetValue(AFC_NEGATIVE_ANTI_DIFFUSIVE_FLUX);
569 
570  rRPlus = 1.0;
571  if (p_plus > 0.0) {
572  rRPlus = std::min(1.0, q_plus / p_plus);
573  }
574 
575  rRMinus = 1.0;
576  if (p_minus < 0.0) {
577  rRMinus = std::min(1.0, q_minus / p_minus);
578  }
579  }
580  }
581 
583 }; // namespace Kratos
584 
586 
587 } // namespace Kratos
588 
589 #endif /* KRATOS_ALGEBRAIC_FLUX_CORRECTED_SCALAR_STEADY_SCHEME defined */
Algebraic flux corrected scalar steady transport scheme.
Definition: algebraic_flux_corrected_steady_scalar_scheme.h:51
void InitializeNonLinIteration(ModelPart &rModelPart, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
unction to be called when it is needed to initialize an iteration. It is designed to be called at the...
Definition: algebraic_flux_corrected_steady_scalar_scheme.h:168
void Initialize(ModelPart &rModelPart) override
This is the place to initialize the Scheme.
Definition: algebraic_flux_corrected_steady_scalar_scheme.h:115
void CalculateRHSContribution(Condition &rCondition, LocalSystemVectorType &rRHS_Contribution, Condition::EquationIdVectorType &rEquationIdVector, const ProcessInfo &rCurrentProcessInfo) override
Functions totally analogous to the precedent but applied to the "condition" objects.
Definition: algebraic_flux_corrected_steady_scalar_scheme.h:367
void Clear() override
Liberate internal storage.
Definition: algebraic_flux_corrected_steady_scalar_scheme.h:302
void CalculateSystemContributions(Condition &rCondition, LocalSystemMatrixType &rLHS_Contribution, LocalSystemVectorType &rRHS_Contribution, Element::EquationIdVectorType &rEquationIdVector, const ProcessInfo &rCurrentProcessInfo) override
Functions totally analogous to the precedent but applied to the "condition" objects.
Definition: algebraic_flux_corrected_steady_scalar_scheme.h:334
void Update(ModelPart &rModelPart, DofsArrayType &rDofSet, TSystemMatrixType &rA, TSystemVectorType &rDx, TSystemVectorType &rb) override
Performing the update of the solution.
Definition: algebraic_flux_corrected_steady_scalar_scheme.h:288
AlgebraicFluxCorrectedSteadyScalarScheme(const double RelaxationFactor, const Flags BoundaryFlags, const Variable< int > &rPeriodicIdVar)
Definition: algebraic_flux_corrected_steady_scalar_scheme.h:91
void CalculateRHSContribution(Element &rElement, LocalSystemVectorType &rRHS_Contribution, Element::EquationIdVectorType &rEquationIdVector, const ProcessInfo &rCurrentProcessInfo) override
This function is designed to calculate just the RHS contribution.
Definition: algebraic_flux_corrected_steady_scalar_scheme.h:352
KRATOS_CLASS_POINTER_DEFINITION(AlgebraicFluxCorrectedSteadyScalarScheme)
void CalculateSystemContributions(Element &rElement, LocalSystemMatrixType &rLHS_Contribution, LocalSystemVectorType &rRHS_Contribution, Element::EquationIdVectorType &rEquationIdVector, const ProcessInfo &rCurrentProcessInfo) override
This function is designed to be called in the builder and solver to introduce the selected time integ...
Definition: algebraic_flux_corrected_steady_scalar_scheme.h:307
AlgebraicFluxCorrectedSteadyScalarScheme(const double RelaxationFactor, const Flags BoundaryFlags)
Definition: algebraic_flux_corrected_steady_scalar_scheme.h:74
The Commmunicator class manages communication for distributed ModelPart instances.
Definition: communicator.h:67
virtual bool AssembleNonHistoricalData(Variable< int > const &ThisVariable)
Definition: communicator.cpp:527
Base class for all Conditions.
Definition: condition.h:59
std::vector< std::size_t > EquationIdVectorType
Definition: condition.h:98
virtual void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const
Definition: condition.h:260
Base class for all Elements.
Definition: element.h:60
virtual void EquationIdVector(EquationIdVectorType &rResult, const ProcessInfo &rCurrentProcessInfo) const
Definition: element.h:258
virtual void GetValuesVector(Vector &values, int Step=0) const
Definition: element.h:300
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
Definition: flags.h:58
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
ElementsContainerType & Elements(IndexType ThisIndex=0)
Definition: model_part.h:1189
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: node.h:466
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
Utility class to update the values of degree of freedom (Dof) variables after solving the system.
Definition: relaxed_dof_updater.h:46
This class provides the implementation of the basic tasks that are needed by the solution strategy.
Definition: scheme.h:56
typename TSparseSpace::MatrixType TSystemMatrixType
Matrix type definition.
Definition: scheme.h:71
typename TSparseSpace::VectorType TSystemVectorType
Vector type definition.
Definition: scheme.h:74
typename TDenseSpace::VectorType LocalSystemVectorType
Local system vector type definition.
Definition: scheme.h:80
virtual void Initialize(ModelPart &rModelPart)
This is the place to initialize the Scheme.
Definition: scheme.h:168
ModelPart::DofsArrayType DofsArrayType
DoF array type definition.
Definition: scheme.h:86
typename TDenseSpace::MatrixType LocalSystemMatrixType
Local system matrix type definition.
Definition: scheme.h:77
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_INFO(label)
Definition: logger.h:250
std::size_t IndexType
Definition: binary_expression.cpp:25
static double max(double a, double b)
Definition: GeometryFunctions.h:79
static double min(double a, double b)
Definition: GeometryFunctions.h:71
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
Internals::Matrix< double, AMatrix::dynamic, 1 > Vector
Definition: amatrix_interface.h:472
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
void block_for_each(TIterator itBegin, TIterator itEnd, TFunction &&rFunction)
Execute a functor on all items of a range in parallel.
Definition: parallel_utilities.h:299
Node NodeType
The definition of the node.
Definition: tetrahedral_mesh_orientation_check.h:34
Internals::Matrix< double, AMatrix::dynamic, AMatrix::dynamic > Matrix
Definition: amatrix_interface.h:470
AMatrix::MatrixProductExpression< TExpression1Type, TExpression2Type > prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:568
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
REACTION_CHECK_STIFFNESS_FACTOR int
Definition: contact_structural_mechanics_application_variables.h:75
list values
Definition: bombardelli_test.py:42
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
def num_threads
Definition: script.py:75
A
Definition: sensitivityMatrix.py:70
integer i
Definition: TensorModule.f:17