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.
ibqn_mvqn_randomized_svd_convergence_accelerator.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 author: Ruben Zorrilla
11 //
12 
13 #if !defined(KRATOS_IBQN_MVQN_RANDOMIZED_SVD_CONVERGENCE_ACCELERATOR)
14 #define KRATOS_IBQN_MVQN_RANDOMIZED_SVD_CONVERGENCE_ACCELERATOR
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
23 
24 // Application includes
26 
27 namespace Kratos
28 {
31 
35 
39 
43 
47 
50 template<class TSparseSpace, class TDenseSpace>
51 class MVQNRandomizedSVDConvergenceAccelerator;
52 
58 template<class TSparseSpace, class TDenseSpace>
60 {
61 public:
62 
66 
68  typedef typename BaseType::Pointer BaseTypePointer;
69 
72 
75 
78 
81 
85 
94  DenseQRPointerType pDenseQR,
95  DenseSVDPointerType pDenseSVD,
96  Parameters ConvAcceleratorParameters)
97  : BaseType()
98  , mpSmallMatrixDenseSVD(pDenseSVD)
99  {
100  ConvAcceleratorParameters.ValidateAndAssignDefaults(GetDefaultParameters());
101  BaseType::SetInitialRelaxationOmega(ConvAcceleratorParameters["w_0"].GetDouble());
102 
103  // Set the subdomains MVQN randomized SVD convergence accelerator pointers
104  MVQNPointerType p_convergence_accelerator_left = CreateMVQNPointer(pDenseQR, pDenseSVD, ConvAcceleratorParameters);
105  MVQNPointerType p_convergence_accelerator_right = CreateMVQNPointer(pDenseQR, pDenseSVD, ConvAcceleratorParameters);
106 
107  // Assign the convergence accelerator pointers
108  BaseType::SetLeftConvergenceAcceleratorPointer(p_convergence_accelerator_left);
109  BaseType::SetRightConvergenceAcceleratorPointer(p_convergence_accelerator_right);
110  }
111 
116 
121 
125 
126 
130 
132  {
133  Parameters ibqn_mvqn_default_parameters(R"({
134  "solver_type" : "IBQN_MVQN_randomized_SVD",
135  "automatic_jacobian_modes" : true,
136  "jacobian_modes" : 0,
137  "w_0" : 0.825,
138  "cut_off_tol" : 1e-8,
139  "limit_modes_to_iterations" : true,
140  "min_rand_svd_extra_modes" : 10
141  })");
142 
143  return ibqn_mvqn_default_parameters;
144  }
145 
147  const VectorType& rDisplacementInputVector,
148  const VectorType& rForceOutputVector,
149  const VectorType& rIterationGuess,
150  VectorType& rLeftCorrection) override
151  {
152  // Get the subdomains convergence accelerators
153  auto p_conv_acc_left = BaseType::pGetConvergenceAcceleratorLeft();
154  auto p_conv_acc_right = BaseType::pGetConvergenceAcceleratorRight();
155 
156  // Get both left and inverse Jacobian
157  auto p_inv_jac_QU_left = p_conv_acc_left->pGetJacobianDecompositionMatrixQU();
158  auto p_inv_jac_SigmaV_left = p_conv_acc_left->pGetJacobianDecompositionMatrixSigmaV();
159  auto p_inv_jac_QU_right = p_conv_acc_right->pGetJacobianDecompositionMatrixQU();
160  auto p_inv_jac_SigmaV_right = p_conv_acc_right->pGetJacobianDecompositionMatrixSigmaV();
161  auto p_uncorrected_displacement_vector = BaseType::pGetUncorrectedDisplacementVector();
162 
163  // If the decomposition have not been done yet (1st nonlinear iteration) use the previous step one
164  if (p_inv_jac_QU_left == nullptr && p_inv_jac_SigmaV_left == nullptr) {
165  p_inv_jac_QU_left = p_conv_acc_left->pGetOldJacobianDecompositionMatrixQU();
166  p_inv_jac_SigmaV_left = p_conv_acc_left->pGetOldJacobianDecompositionMatrixSigmaV();
167  }
168 
169  if (p_inv_jac_QU_right == nullptr && p_inv_jac_SigmaV_right == nullptr) {
170  p_inv_jac_QU_right = p_conv_acc_right->pGetOldJacobianDecompositionMatrixQU();
171  p_inv_jac_SigmaV_right = p_conv_acc_right->pGetOldJacobianDecompositionMatrixSigmaV();
172  }
173 
174  // Set the residual of the update problem to be solved
175  if (p_inv_jac_QU_left != nullptr && p_inv_jac_SigmaV_left != nullptr) {
176  const std::size_t n_dofs = TDenseSpace::Size(*p_uncorrected_displacement_vector);
177  const std::size_t n_modes_left = TDenseSpace::Size1(*p_inv_jac_SigmaV_left);
178  VectorType aux_vect(n_modes_left);
179  VectorType aux_left_onto_right(n_dofs);
180  VectorType displacement_iteration_update = *p_uncorrected_displacement_vector - rDisplacementInputVector;
181  TSparseSpace::Mult(*p_inv_jac_SigmaV_left, displacement_iteration_update, aux_vect);
182  TSparseSpace::Mult(*p_inv_jac_QU_left, aux_vect, aux_left_onto_right);
183  VectorType aux_RHS = rForceOutputVector - rIterationGuess;
184  TSparseSpace::UnaliasedAdd(aux_RHS, 1.0, aux_left_onto_right);
185 
186  if (p_inv_jac_QU_right != nullptr && p_inv_jac_SigmaV_right != nullptr) {
187 
188  MatrixType aux_C;
189  const bool is_extended = CalculateAuxiliaryMatrixC(*p_inv_jac_SigmaV_left, *p_inv_jac_QU_right, aux_C);
190  if (is_extended) {
191  const std::size_t n_modes_right = TDenseSpace::Size1(*p_inv_jac_SigmaV_right);
192 
193  if (n_modes_left > n_modes_right) {
194  // Extend the decomposition matrix from the right side as this is smaller since no force obseration is done yet
195  const auto& r_inv_jac_SigmaV_right = *p_inv_jac_SigmaV_right;
196  MatrixType extended_inv_jac_SigmaV_right = ZeroMatrix(n_modes_left, n_dofs);
198  [&extended_inv_jac_SigmaV_right, &r_inv_jac_SigmaV_right, &n_modes_right](std::size_t Col){
199  for (std::size_t row = 0; row < n_modes_right; ++row) {
200  extended_inv_jac_SigmaV_right(row, Col) = r_inv_jac_SigmaV_right(row, Col);
201  }
202  }
203  );
204 
205  // Calculate the correction with the Woodbury matrix identity
206  ApplyWoodburyMatrixIdentity(*p_inv_jac_QU_left, extended_inv_jac_SigmaV_right, aux_C, aux_RHS, rLeftCorrection);
207 
208  } else {
209  // Extend the decomposition matrix from the left side as this is smaller (i.e. data cut off has been applied)
210  const auto& r_inv_jac_QU_left = *p_inv_jac_QU_left;
211  MatrixType extended_inv_jac_QU_left = ZeroMatrix(n_dofs, n_modes_right);
213  [&extended_inv_jac_QU_left, &r_inv_jac_QU_left, &n_modes_left](std::size_t Row){
214  for (std::size_t col = 0; col < n_modes_left; ++col) {
215  extended_inv_jac_QU_left(Row, col) = r_inv_jac_QU_left(Row, col);
216  }
217  }
218  );
219 
220  // Calculate the correction with the Woodbury matrix identity
221  ApplyWoodburyMatrixIdentity(extended_inv_jac_QU_left, *p_inv_jac_SigmaV_right, aux_C, aux_RHS, rLeftCorrection);
222 
223  }
224  } else {
225  // Calculate the correction with the Woodbury matrix identity
226  ApplyWoodburyMatrixIdentity(*p_inv_jac_QU_left, *p_inv_jac_SigmaV_right, aux_C, aux_RHS, rLeftCorrection);
227  }
228  } else {
229  rLeftCorrection = aux_RHS;
230  }
231  } else {
232  KRATOS_ERROR << "Calling \'SolveInterfaceBlockQuasiNewtonLeftUpdate\' with no Jacobian decomposition available. No update should be performed." << std::endl;
233  }
234  }
235 
237  const VectorType& rForceInputVector,
238  const VectorType& rDisplacementOutputVector,
239  const VectorType& rIterationGuess,
240  VectorType& rRightCorrection) override
241  {
242  // Get the subdomains convergence accelerators
243  auto p_conv_acc_left = BaseType::pGetConvergenceAcceleratorLeft();
244  auto p_conv_acc_right = BaseType::pGetConvergenceAcceleratorRight();
245 
246  // Get both left and inverse Jacobian
247  auto p_inv_jac_QU_left = p_conv_acc_left->pGetJacobianDecompositionMatrixQU();
248  auto p_inv_jac_SigmaV_left = p_conv_acc_left->pGetJacobianDecompositionMatrixSigmaV();
249  auto p_inv_jac_QU_right = p_conv_acc_right->pGetJacobianDecompositionMatrixQU();
250  auto p_inv_jac_SigmaV_right = p_conv_acc_right->pGetJacobianDecompositionMatrixSigmaV();
251  auto p_uncorrected_force_vector = BaseType::pGetUncorrectedForceVector();
252 
253  // If the decomposition have not been done yet (1st nonlinear iteration) use the previous step ones
254  if (p_inv_jac_QU_right == nullptr && p_inv_jac_SigmaV_right == nullptr) {
255  p_inv_jac_QU_right = p_conv_acc_right->pGetOldJacobianDecompositionMatrixQU();
256  p_inv_jac_SigmaV_right = p_conv_acc_right->pGetOldJacobianDecompositionMatrixSigmaV();
257  }
258 
259  // Note that it might happen (2nd nonlinear iteration) that the displacement Jacobian is updated but not the traction one
260  // In consequence, it is required to check separately that the two Jacobian decompositions exist
261  if (p_inv_jac_QU_left == nullptr && p_inv_jac_SigmaV_left == nullptr) {
262  p_inv_jac_QU_left = p_conv_acc_left->pGetOldJacobianDecompositionMatrixQU();
263  p_inv_jac_SigmaV_left = p_conv_acc_left->pGetOldJacobianDecompositionMatrixSigmaV();
264  }
265 
266  // Set the residual of the update problem to be solved
267  if (p_inv_jac_QU_right != nullptr && p_inv_jac_SigmaV_right != nullptr) {
268  const std::size_t n_dofs = TDenseSpace::Size(*p_uncorrected_force_vector);
269  const std::size_t n_modes_right = TDenseSpace::Size1(*p_inv_jac_SigmaV_right);
270  VectorType aux_vect(n_modes_right);
271  VectorType aux_right_onto_left(n_dofs);
272  VectorType force_iteration_update = *p_uncorrected_force_vector - rForceInputVector;
273  TSparseSpace::Mult(*p_inv_jac_SigmaV_right, force_iteration_update, aux_vect);
274  TSparseSpace::Mult(*p_inv_jac_QU_right, aux_vect, aux_right_onto_left);
275  VectorType aux_RHS = rDisplacementOutputVector - rIterationGuess;
276  TSparseSpace::UnaliasedAdd(aux_RHS, 1.0, aux_right_onto_left);
277 
278  // Calculate auxiliary intermediate small matrices
279  if (p_inv_jac_QU_left != nullptr && p_inv_jac_SigmaV_left != nullptr) {
280  MatrixType aux_C;
281  const bool is_extended = CalculateAuxiliaryMatrixC(*p_inv_jac_SigmaV_right, *p_inv_jac_QU_left, aux_C);
282 
283  if (is_extended) {
284  const std::size_t n_modes_left = TDenseSpace::Size1(*p_inv_jac_SigmaV_left);
285  if (n_modes_right > n_modes_left) {
286  // Extend the decomposition matrix from the left side as this is smaller since no force obseration is done yet
287  const auto& r_inv_jac_SigmaV_left = *p_inv_jac_SigmaV_left;
288  MatrixType extended_inv_jac_SigmaV_left = ZeroMatrix(n_modes_left + 1, n_dofs);
290  [&extended_inv_jac_SigmaV_left, &r_inv_jac_SigmaV_left, &n_modes_left](std::size_t Col){
291  for (std::size_t row = 0; row < n_modes_left; ++row) {
292  extended_inv_jac_SigmaV_left(row, Col) = r_inv_jac_SigmaV_left(row, Col);
293  }
294  }
295  );
296 
297  // Calculate the correction with the Woodbury matrix identity
298  ApplyWoodburyMatrixIdentity(*p_inv_jac_QU_right, extended_inv_jac_SigmaV_left, aux_C, aux_RHS, rRightCorrection);
299 
300  } else {
301  // Extend the decomposition matrix from the right side as this is smaller since no force obseration is done yet
302  const auto &r_inv_jac_QU_right = *p_inv_jac_QU_right;
303  MatrixType extended_inv_jac_QU_right = ZeroMatrix(n_dofs, n_modes_left);
305  [&extended_inv_jac_QU_right, &r_inv_jac_QU_right, n_modes_right](std::size_t Row) {
306  for (std::size_t col = 0; col < n_modes_right; ++col) {
307  extended_inv_jac_QU_right(Row, col) = r_inv_jac_QU_right(Row, col);
308  }
309  });
310 
311  // Calculate the correction with the Woodbury matrix identity
312  ApplyWoodburyMatrixIdentity(extended_inv_jac_QU_right, *p_inv_jac_SigmaV_left, aux_C, aux_RHS, rRightCorrection);
313 
314  }
315  } else {
316  // Calculate the correction with the Woodbury matrix identity
317  // Note that in here no matrix padding is done. This happens when the previous step SVD is used (first iteration)
318  ApplyWoodburyMatrixIdentity(*p_inv_jac_QU_right, *p_inv_jac_SigmaV_left, aux_C, aux_RHS, rRightCorrection);
319  }
320  } else {
321  rRightCorrection = aux_RHS;
322  }
323  } else {
324  KRATOS_ERROR << "Calling \'SolveInterfaceBlockQuasiNewtonRightUpdate\' with no Jacobian decomposition available. Update should be performed with a fixed point iteration." << std::endl;
325  }
326  }
327 
331 
332 
336 
337 
341 
342 
346 
347 
349 private:
352 
353 
357 
358  DenseSVDPointerType mpSmallMatrixDenseSVD = nullptr;
359 
363 
364 
368 
369  static MVQNPointerType CreateMVQNPointer(
370  DenseQRPointerType pDenseQR,
371  DenseSVDPointerType pDenseSVD,
372  const Parameters ConvAcceleratorParameters)
373  {
374  // Set the subdomains MVQN randomized SVD convergence accelerator pointers
375  // Note that we call the simplified constructor with default zero relaxation omega and IBQN switch
376  const double cut_off_tol = ConvAcceleratorParameters["cut_off_tol"].GetDouble();
377  const bool automatic_jacobian_modes = ConvAcceleratorParameters["automatic_jacobian_modes"].GetBool();
378  const unsigned int jacobian_modes = ConvAcceleratorParameters["jacobian_modes"].GetInt();
379  const bool limit_modes_to_iterations = ConvAcceleratorParameters["limit_modes_to_iterations"].GetBool();
380  const unsigned int min_rand_svd_extra_modes = ConvAcceleratorParameters["min_rand_svd_extra_modes"].GetInt();
381 
382  // Auxiliary struct to enable the std::make_unique access to access the protected constructor of the randomized SVD
383  // Hence, the pointer is created through the prublic constructor of the auxiliary class, which derives from the class of interest
384  // At the same time, the auxiliary public constructor calls the protected constructor of interest
385  // Note that we call the simplified constructor with default zero relaxation omega and IBQN switch
386  struct make_unique_enabler : public MVQNType {
387  make_unique_enabler(
388  DenseQRPointerType pDenseQR,
389  DenseSVDPointerType pDenseSVD,
390  const bool AutomaticJacobianModes,
391  const unsigned int JacobianModes,
392  const double CutOffTolerance,
393  const bool LimitModesToIterations,
394  const unsigned int MinRandSVDExtraModes)
395  : MVQNType(
396  pDenseQR,
397  pDenseSVD,
398  AutomaticJacobianModes,
399  JacobianModes,
400  CutOffTolerance,
401  LimitModesToIterations,
402  MinRandSVDExtraModes)
403  {}
404  };
405 
406  // Create and return the convergence accelerator pointer
407  MVQNPointerType p_convergence_accelerator = Kratos::make_unique<make_unique_enabler>(
408  pDenseQR,
409  pDenseSVD,
410  automatic_jacobian_modes,
411  jacobian_modes,
412  cut_off_tol,
413  limit_modes_to_iterations,
414  min_rand_svd_extra_modes);
415 
416  return p_convergence_accelerator;
417  }
418 
429  bool CalculateAuxiliaryMatrixC(
430  MatrixType& rA,
431  MatrixType& rB,
432  MatrixType& rC)
433  {
434  const std::size_t n_dofs = TDenseSpace::Size2(rA);
435  const std::size_t n_row_A = TDenseSpace::Size1(rA);
436  const std::size_t n_col_B = TDenseSpace::Size2(rB);
437 
438  auto matrix_A_B_product = [&rC, &rA, &rB, &n_row_A](std::size_t Col, VectorType& rAuxColumnTLS){
439  TDenseSpace::GetColumn(Col, rB, rAuxColumnTLS);
440  for (std::size_t row = 0; row < n_row_A; ++row) {
441  rC(row,Col) = TDenseSpace::RowDot(row, rA, rAuxColumnTLS);
442  }
443  };
444 
445  bool is_extended = false;
446  if (n_row_A != n_col_B) {
447  if (n_row_A > n_col_B) {
448  // This case always happens when updating displacements as no force observation has been done yet
449  is_extended = true;
450  rC = ZeroMatrix(n_row_A, n_row_A);
451  IndexPartition<std::size_t>(n_col_B).for_each(VectorType(n_dofs), matrix_A_B_product);
452  for (std::size_t i_extra = n_col_B; i_extra < n_row_A; ++i_extra) {
453  rC(i_extra, i_extra) = 1.0;
454  }
455  } else {
456  // This case might happen when dropping information or in the second iteration correction (old force Jacobian is used)
457  is_extended = true;
458  rC = ZeroMatrix(n_col_B, n_col_B);
459  IndexPartition<std::size_t>(n_col_B).for_each(VectorType(n_dofs), matrix_A_B_product);
460  for (std::size_t i_extra = n_row_A; i_extra < n_col_B; ++i_extra) {
461  rC(i_extra, i_extra) = 1.0;
462  }
463  }
464  } else {
465  rC = ZeroMatrix(n_row_A, n_col_B);
466  IndexPartition<std::size_t>(n_col_B).for_each(VectorType(n_dofs), matrix_A_B_product);
467  }
468 
469  return is_extended;
470  }
471 
476  void ApplyWoodburyMatrixIdentity(
477  MatrixType& rA,
478  MatrixType& rB,
479  const MatrixType& rC,
480  VectorType& rY,
481  VectorType& rX)
482  {
483  std::size_t n_row_C = TDenseSpace::Size1(rC);
484  std::size_t n_col_C = TDenseSpace::Size2(rC);
485  KRATOS_ERROR_IF(n_row_C != n_col_C) << "C matrix is not square. Woodbury matrix identity cannot be applied." << std::endl;
486 
487  TDenseSpace::Assign(rX, 1.0, rY);
488 
489  MatrixType aux_C_inv;
490  CalculateMoorePenroseInverse(rC, aux_C_inv);
491 
492  const std::size_t n_dofs = TDenseSpace::Size(rY);
493  const std::size_t n_col_A = TDenseSpace::Size2(rA);
494  const std::size_t n_row_B = TDenseSpace::Size1(rB);
495 
496  MatrixType aux_D = ZeroMatrix(n_row_B, n_col_A);
497  IndexPartition<std::size_t>(n_col_A).for_each(
499  [&aux_D, &rA, &rB, &aux_C_inv, &n_row_B](std::size_t Col, VectorType& rAuxColumnTLS)
500  {
501  TDenseSpace::GetColumn(Col, rA, rAuxColumnTLS);
502  for (std::size_t row = 0; row < n_row_B; ++row) {
503  aux_D(row,Col) = aux_C_inv(row,Col) - TDenseSpace::RowDot(row, rB, rAuxColumnTLS);
504  }
505  });
506 
507  MatrixType aux_D_inv;
508  CalculateMoorePenroseInverse(aux_D, aux_D_inv);
509 
510  VectorType aux_vect(n_row_B);
511  VectorType aux_vect_2(n_col_A);
512  VectorType aux_vect_3(n_dofs);
513  TDenseSpace::Mult(rB, rY, aux_vect);
514  TDenseSpace::Mult(aux_D_inv, aux_vect, aux_vect_2);
515  TDenseSpace::Mult(rA, aux_vect_2, aux_vect_3);
516 
517  TDenseSpace::UnaliasedAdd(rX, 1.0, aux_vect_3);
518  }
519 
527  void CalculateMoorePenroseInverse(
528  const MatrixType& rInputMatrix,
529  MatrixType& rMoorePenroseInverse)
530  {
531  IndexType aux_size_1 = TDenseSpace::Size1(rInputMatrix);
532  IndexType aux_size_2 = TDenseSpace::Size2(rInputMatrix);
533  KRATOS_ERROR_IF_NOT(aux_size_1 == aux_size_2) << "Input matrix is not squared." << std::endl;
534 
535  VectorType s_svd; // Singular values vector
536  MatrixType u_svd; // Left orthogonal matrix
537  MatrixType v_svd; // Right orthogonal matrix
538  Parameters svd_settings(R"({
539  "compute_thin_u" : true,
540  "compute_thin_v" : true
541  })");
542  mpSmallMatrixDenseSVD->Compute(const_cast<MatrixType&>(rInputMatrix), s_svd, u_svd, v_svd, svd_settings);
543  const std::size_t n_sing_val = s_svd.size();
544  //TODO: We could use a vector in here
545  MatrixType s_inv = ZeroMatrix(n_sing_val, n_sing_val);
546  for (std::size_t i = 0; i < n_sing_val; ++i) {
547  s_inv(i,i) = 1.0 / s_svd(i);
548  }
549 
550  // Calculate and save the input matrix pseudo-inverse
551  rMoorePenroseInverse = ZeroMatrix(aux_size_2, aux_size_1);
552 
553  // Note that we take advantage of the fact that the input matrix is always square
554  for (std::size_t i = 0; i < aux_size_2; ++i) {
555  for (std::size_t j = 0; j < aux_size_1; ++j) {
556  double& r_value = rMoorePenroseInverse(i,j);
557  for (std::size_t k = 0; k < n_sing_val; ++k) {
558  const double v_ik = v_svd(i,k);
559  for (std::size_t m = 0; m < n_sing_val; ++m) {
560  const double ut_mj = u_svd(j,m);
561  const double s_inv_km = s_inv(k,m);
562  r_value += v_ik * s_inv_km * ut_mj;
563  }
564  }
565  }
566  }
567  }
568 
572 
573 
577 
578 
582 
583 
587 
588 
590 }; /* Class IBQNMVQNRandomizedSVDConvergenceAccelerator */
591 
595 
596 
600 
601 
603 } /* namespace Kratos.*/
604 
605 #endif /* KRATOS_IBQN_MVQN_RANDOMIZED_SVD_CONVERGENCE_ACCELERATOR defined */
Base class for convergence accelerators This class is intended to be the base of any convergence acce...
Definition: convergence_accelerator.h:43
Definition: dense_qr_decomposition.h:44
Definition: dense_svd_decomposition.h:45
Interface Block Newton convergence accelerator Interface Block Newton equations convergence accelerat...
Definition: ibqn_mvqn_convergence_accelerator.h:61
void SetLeftConvergenceAcceleratorPointer(MVQNPointerType pConvergenceAcceleratorLeft)
Definition: ibqn_mvqn_convergence_accelerator.h:432
VectorPointerType pGetUncorrectedForceVector()
Definition: ibqn_mvqn_convergence_accelerator.h:442
VectorPointerType pGetUncorrectedDisplacementVector()
Definition: ibqn_mvqn_convergence_accelerator.h:447
MVQNType::Pointer MVQNPointerType
Definition: ibqn_mvqn_convergence_accelerator.h:78
void SetInitialRelaxationOmega(const double Omega)
Definition: ibqn_mvqn_convergence_accelerator.h:427
void SetRightConvergenceAcceleratorPointer(MVQNPointerType pConvergenceAcceleratorRight)
Definition: ibqn_mvqn_convergence_accelerator.h:437
MVQNPointerType pGetConvergenceAcceleratorRight()
Definition: ibqn_mvqn_convergence_accelerator.h:457
MVQNPointerType pGetConvergenceAcceleratorLeft()
Definition: ibqn_mvqn_convergence_accelerator.h:452
Interface Block Newton MVQN with randomized Jacobian convergence accelerator Interface Block Newton e...
Definition: ibqn_mvqn_randomized_svd_convergence_accelerator.h:60
BaseType::DenseVectorType VectorType
Definition: ibqn_mvqn_randomized_svd_convergence_accelerator.h:70
Parameters GetDefaultParameters() const override
Definition: ibqn_mvqn_randomized_svd_convergence_accelerator.h:131
void SolveInterfaceBlockQuasiNewtonLeftUpdate(const VectorType &rDisplacementInputVector, const VectorType &rForceOutputVector, const VectorType &rIterationGuess, VectorType &rLeftCorrection) override
Definition: ibqn_mvqn_randomized_svd_convergence_accelerator.h:146
IBQNMVQNRandomizedSVDConvergenceAccelerator(DenseQRPointerType pDenseQR, DenseSVDPointerType pDenseSVD, Parameters ConvAcceleratorParameters)
Construct a new IBQNMVQNRandomizedSVDConvergenceAccelerator object IBQN-MVQN with randomized SVD Jaco...
Definition: ibqn_mvqn_randomized_svd_convergence_accelerator.h:93
IBQNMVQNConvergenceAccelerator< TSparseSpace, TDenseSpace > BaseType
Definition: ibqn_mvqn_randomized_svd_convergence_accelerator.h:67
DenseSingularValueDecomposition< TDenseSpace >::Pointer DenseSVDPointerType
Definition: ibqn_mvqn_randomized_svd_convergence_accelerator.h:80
void SolveInterfaceBlockQuasiNewtonRightUpdate(const VectorType &rForceInputVector, const VectorType &rDisplacementOutputVector, const VectorType &rIterationGuess, VectorType &rRightCorrection) override
Definition: ibqn_mvqn_randomized_svd_convergence_accelerator.h:236
virtual ~IBQNMVQNRandomizedSVDConvergenceAccelerator()
Definition: ibqn_mvqn_randomized_svd_convergence_accelerator.h:120
BaseType::Pointer BaseTypePointer
Definition: ibqn_mvqn_randomized_svd_convergence_accelerator.h:68
BaseType::MVQNPointerType MVQNPointerType
Definition: ibqn_mvqn_randomized_svd_convergence_accelerator.h:77
BaseType::DenseMatrixPointerType MatrixPointerType
Definition: ibqn_mvqn_randomized_svd_convergence_accelerator.h:74
BaseType::DenseVectorPointerType VectorPointerType
Definition: ibqn_mvqn_randomized_svd_convergence_accelerator.h:71
IBQNMVQNRandomizedSVDConvergenceAccelerator(const IBQNMVQNRandomizedSVDConvergenceAccelerator &rOther)=delete
DenseQRDecomposition< TDenseSpace >::Pointer DenseQRPointerType
Definition: ibqn_mvqn_randomized_svd_convergence_accelerator.h:79
BaseType::DenseMatrixType MatrixType
Definition: ibqn_mvqn_randomized_svd_convergence_accelerator.h:73
KRATOS_CLASS_POINTER_DEFINITION(IBQNMVQNRandomizedSVDConvergenceAccelerator)
MVQNRandomizedSVDConvergenceAccelerator< TSparseSpace, TDenseSpace > MVQNType
Definition: ibqn_mvqn_randomized_svd_convergence_accelerator.h:76
This class is useful for index iteration over containers.
Definition: parallel_utilities.h:451
void for_each(TUnaryFunction &&f)
Definition: parallel_utilities.h:514
MVQN-RZ acceleration scheme RandomiZed Multi-Vector Quasi-Newton (MVQN-RZ) method convergence acceler...
Definition: mvqn_randomized_svd_convergence_accelerator.h:73
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
double GetDouble() const
This method returns the double contained in the current Parameter.
Definition: kratos_parameters.cpp:657
int GetInt() const
This method returns the integer contained in the current Parameter.
Definition: kratos_parameters.cpp:666
void ValidateAndAssignDefaults(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing match the form prescribed by th...
Definition: kratos_parameters.cpp:1306
bool GetBool() const
This method returns the boolean contained in the current Parameter.
Definition: kratos_parameters.cpp:675
TDenseSpace::VectorType DenseVectorType
Definition: convergence_accelerator.h:56
TSparseSpace::VectorType VectorType
Definition: convergence_accelerator.h:50
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF_NOT(conditional)
Definition: exception.h:163
TDenseSpace::MatrixPointerType DenseMatrixPointerType
Definition: convergence_accelerator.h:59
TDenseSpace::MatrixType DenseMatrixType
Definition: convergence_accelerator.h:57
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
TDenseSpace::VectorPointerType DenseVectorPointerType
Definition: convergence_accelerator.h:60
TSparseSpace::MatrixType MatrixType
Definition: convergence_accelerator.h:51
TSpaceType::IndexType Size1(TSpaceType &dummy, typename TSpaceType::MatrixType const &rM)
Definition: add_strategies_to_python.cpp:117
TSpaceType::IndexType Size2(TSpaceType &dummy, typename TSpaceType::MatrixType const &rM)
Definition: add_strategies_to_python.cpp:123
TSpaceType::IndexType Size(TSpaceType &dummy, typename TSpaceType::VectorType const &rV)
Definition: add_strategies_to_python.cpp:111
void Mult(TSpaceType &dummy, typename TSpaceType::MatrixType &rA, typename TSpaceType::VectorType &rX, typename TSpaceType::VectorType &rY)
Definition: add_strategies_to_python.cpp:98
void UnaliasedAdd(TSpaceType &dummy, typename TSpaceType::VectorType &x, const double A, const typename TSpaceType::VectorType &rY)
Definition: add_strategies_to_python.cpp:170
void Assign(const Expression &rExpression, const IndexType EntityIndex, const IndexType EntityDataBeginIndex, TDataType &rValue, std::index_sequence< TIndex... >)
Definition: variable_expression_data_io.cpp:41
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
AMatrix::MatrixRow< const TExpressionType > row(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression, std::size_t RowIndex)
Definition: amatrix_interface.h:649
n_dofs
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:151
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
int m
Definition: run_marine_rain_substepping.py:8
integer i
Definition: TensorModule.f:17