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.
eigensolver_nitsche_stabilization_strategy.hpp
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 #if !defined(KRATOS_EIGENSOLVER_NITSCHE_STABILIZATION_STRATEGY )
11 #define KRATOS_EIGENSOLVER_NITSCHE_STABILIZATION_STRATEGY
12 
13 // System includes
14 
15 // External includes
16 
17 // Project includes
20 #include "spaces/ublas_space.h"
21 
22 #include "containers/model.h"
23 
24 // Application includes
26 
27 namespace Kratos
28 {
29 
32 
36 
40 
44 
48 
50 template<class TSparseSpace,
51  class TDenseSpace,
52  class TLinearSolver
53  >
55  : public ImplicitSolvingStrategy<TSparseSpace, TDenseSpace, TLinearSolver>
56 {
57 public:
60 
62 
64 
65  typedef typename BaseType::TSchemeType::Pointer SchemePointerType;
66 
67  typedef typename BaseType::TBuilderAndSolverType::Pointer BuilderAndSolverPointerType;
68 
70 
72 
73  typedef TSparseSpace SparseSpaceType;
74 
75  typedef typename TSparseSpace::VectorPointerType SparseVectorPointerType;
76 
77  typedef typename TSparseSpace::MatrixPointerType SparseMatrixPointerType;
78 
80 
82 
86 
89  ModelPart& rModelPart,
90  SchemePointerType pScheme,
91  BuilderAndSolverPointerType pBuilderAndSolver
92  )
93  : BaseType(rModelPart),
94  mpScheme(pScheme), mpBuilderAndSolver(pBuilderAndSolver)
95  {
97 
98  // ensure initialization of system matrices in InitializeSolutionStep()
99  mpBuilderAndSolver->SetDofSetIsInitializedFlag(false);
100 
101  // default echo level (mute)
102  this->SetEchoLevel(0);
103 
104  // default rebuild level (build at each solution step)
105  this->SetRebuildLevel(1);
106 
107  SparseMatrixType* AuxStiffnessMatrix = new SparseMatrixType;
108  mpStiffnessMatrix = Kratos::shared_ptr<SparseMatrixType>(AuxStiffnessMatrix);
109  SparseMatrixType* AuxStabilizationMatrix = new SparseMatrixType;
110  mpStabilizationMatrix = Kratos::shared_ptr<SparseMatrixType>(AuxStabilizationMatrix);
111 
112  KRATOS_CATCH("")
113  }
114 
117 
120  {
121  // Clear() controls order of deallocation to avoid invalid memory access
122  // in some special cases.
123  // warning: BaseType::GetModelPart() may be invalid here.
124  this->Clear();
125  }
126 
130 
134 
135  void SetIsInitialized(bool val)
136  {
137  mInitializeWasPerformed = val;
138  }
139 
140  bool GetIsInitialized() const
141  {
142  return mInitializeWasPerformed;
143  }
144 
146  {
147  mpScheme = pScheme;
148  };
149 
151  {
152  return mpScheme;
153  };
154 
156  {
157  mpBuilderAndSolver = pNewBuilderAndSolver;
158  };
159 
161  {
162  return mpBuilderAndSolver;
163  };
164 
166  {
167  return *mpStiffnessMatrix;
168  }
169 
171  {
172  return *mpStabilizationMatrix;
173  }
174 
176  {
177  return mpStiffnessMatrix;
178  }
179 
181  {
182  return mpStabilizationMatrix;
183  }
184 
186  {
187  this->pGetBuilderAndSolver()->SetReshapeMatrixFlag(flag);
188  }
189 
191  {
192  return this->pGetBuilderAndSolver()->GetReshapeMatrixFlag();
193  }
194 
196 
202  void SetEchoLevel(int Level) override
203  {
204  BaseType::SetEchoLevel(Level);
205  this->pGetBuilderAndSolver()->SetEchoLevel(Level);
206  }
207 
211  void Initialize() override
212  {
213  KRATOS_TRY
214 
215  ModelPart& rModelPart = BaseType::GetModelPart();
216  const int rank = rModelPart.GetCommunicator().MyPID();
217 
218  KRATOS_INFO_IF("EigensolverNitscheStabilizationStrategy", BaseType::GetEchoLevel() > 2 && rank == 0)
219  << "Entering Initialize" << std::endl;
220 
221  if (mInitializeWasPerformed == false)
222  {
223  SchemePointerType& pScheme = this->pGetScheme();
224 
225  if (pScheme->SchemeIsInitialized() == false)
226  pScheme->Initialize(rModelPart);
227 
228  if (pScheme->ElementsAreInitialized() == false)
229  pScheme->InitializeElements(rModelPart);
230 
231  if (pScheme->ConditionsAreInitialized() == false)
232  pScheme->InitializeConditions(rModelPart);
233  }
234 
235  KRATOS_INFO_IF("EigensolverNitscheStabilizationStrategy", BaseType::GetEchoLevel() > 2 && rank == 0)
236  << "Exiting Initialize" << std::endl;
237 
238  KRATOS_CATCH("")
239  }
240 
244  void Clear() override
245  {
246  KRATOS_TRY
247 
248  // if the preconditioner is saved between solves, it should be cleared here
249  BuilderAndSolverPointerType& pBuilderAndSolver = this->pGetBuilderAndSolver();
250  pBuilderAndSolver->GetLinearSystemSolver()->Clear();
251 
252  if (this->pGetStiffnessMatrix() != nullptr)
253  this->pGetStiffnessMatrix() = nullptr;
254 
255  if (this->pGetStabilizationMatrix() != nullptr)
256  this->pGetStabilizationMatrix() = nullptr;
257 
258  // Re-setting internal flag to ensure that the dof sets are recalculated
259  pBuilderAndSolver->SetDofSetIsInitializedFlag(false);
260 
261  pBuilderAndSolver->Clear();
262 
263  this->pGetScheme()->Clear();
264 
265  mInitializeWasPerformed = false;
266 
267  KRATOS_CATCH("")
268  }
269 
275  void InitializeSolutionStep() override
276  {
277  KRATOS_TRY
278 
279  ModelPart& rModelPart = BaseType::GetModelPart();
280  const int rank = rModelPart.GetCommunicator().MyPID();
281 
282  KRATOS_INFO_IF("EigensolverNitscheStabilizationStrategy", BaseType::GetEchoLevel() > 2 && rank == 0)
283  << "Entering InitializeSolutionStep" << std::endl;
284 
285  BuilderAndSolverPointerType& pBuilderAndSolver = this->pGetBuilderAndSolver();
286  SchemePointerType& pScheme = this->pGetScheme();
287  SparseMatrixPointerType& pStabilizationMatrix = this->pGetStabilizationMatrix();
288  SparseMatrixType& rStabilizationMatrix = this->GetStabilizationMatrix();
289 
290  // Initialize dummy vectors
291  SparseVectorPointerType pDx = SparseSpaceType::CreateEmptyVectorPointer();
293  auto& rDx = *pDx;
294  auto& rb = *pb;
295 
296  // Reset solution dofs
297  BuiltinTimer system_construction_time;
298  if (pBuilderAndSolver->GetDofSetIsInitializedFlag() == false ||
299  pBuilderAndSolver->GetReshapeMatrixFlag() == true)
300  {
301  // Set up list of dofs
302  BuiltinTimer setup_dofs_time;
303  pBuilderAndSolver->SetUpDofSet(pScheme, rModelPart);
304 
305  KRATOS_INFO_IF("Setup Dofs Time", BaseType::GetEchoLevel() > 0 && rank == 0)
306  << setup_dofs_time.ElapsedSeconds() << std::endl;
307 
308  // Set global equation ids
309  BuiltinTimer setup_system_time;
310  pBuilderAndSolver->SetUpSystem(rModelPart);
311 
312  KRATOS_INFO_IF("Setup System Time", BaseType::GetEchoLevel() > 0 && rank == 0)
313  << setup_system_time.ElapsedSeconds() << std::endl;
314 
315  // Resize and initialize system matrices
316  BuiltinTimer system_matrix_resize_time;
317  SparseMatrixPointerType& pStiffnessMatrix = this->pGetStiffnessMatrix();
318 
319  // Stiffness matrix
320  pBuilderAndSolver->ResizeAndInitializeVectors(
321  pScheme, pStiffnessMatrix, pDx, pb, rModelPart);
322 
323  // Stabilization matrix
324  pBuilderAndSolver->ResizeAndInitializeVectors(
325  pScheme, pStabilizationMatrix, pDx, pb, rModelPart);
326 
327  KRATOS_INFO_IF("System Matrix Resize Time", BaseType::GetEchoLevel() > 0 && rank == 0)
328  << system_matrix_resize_time.ElapsedSeconds() << std::endl;
329  }
330  else
331  {
332  SparseSpaceType::Resize(rb, SparseSpaceType::Size1(rStabilizationMatrix));
333  SparseSpaceType::Set(rb, 0.0);
334  SparseSpaceType::Resize(rDx, SparseSpaceType::Size1(rStabilizationMatrix));
335  SparseSpaceType::Set(rDx, 0.0);
336  }
337 
338  KRATOS_INFO_IF("System Construction Time", BaseType::GetEchoLevel() > 0 && rank == 0)
339  << system_construction_time.ElapsedSeconds() << std::endl;
340 
341  // Initial operations ... things that are constant over the solution
342  // step
343  pBuilderAndSolver->InitializeSolutionStep(BaseType::GetModelPart(),
344  rStabilizationMatrix, rDx, rb);
345 
346  // Initial operations ... things that are constant over the solution
347  // step
348  pScheme->InitializeSolutionStep(BaseType::GetModelPart(), rStabilizationMatrix, rDx, rb);
349 
350  KRATOS_INFO_IF("EigensolverNitscheStabilizationStrategy", BaseType::GetEchoLevel() > 2 && rank == 0)
351  << "Exiting InitializeSolutionStep" << std::endl;
352 
353  KRATOS_CATCH("")
354  }
355 
360  bool SolveSolutionStep() override
361  {
362  ModelPart& rModelPart = BaseType::GetModelPart();
363 
364  SchemePointerType& pScheme = this->pGetScheme();
365  SparseMatrixType& rStiffnessMatrix = this->GetStiffnessMatrix();
366  SparseMatrixType& rStabilizationMatrix = this->GetStabilizationMatrix();
367 
368  // Initialize dummy rhs vector
369  SparseVectorType b;
371  SparseSpaceType::Set(b,0.0);
372 
373  // Get the global stiffness matrix of the respective model part, linked with the Nitsche stabilization scheme.
374  rModelPart.GetProcessInfo()[BUILD_LEVEL] = 1;
375  TSparseSpace::SetToZero(rStiffnessMatrix);
376  this->pGetBuilderAndSolver()->Build(pScheme,rModelPart,rStiffnessMatrix,b);
377 
378  if (BaseType::GetEchoLevel() == 4) {
379  TSparseSpace::WriteMatrixMarketMatrix("StiffnessMatrix.mm", rStiffnessMatrix, false);
380  }
381 
382  // Get the global stabilization matrix of the respective model part, linked with the Nitsche stabilization scheme.
383  rModelPart.GetProcessInfo()[BUILD_LEVEL] = 2;
384  TSparseSpace::SetToZero(rStabilizationMatrix);
385  this->pGetBuilderAndSolver()->Build(pScheme,rModelPart,rStabilizationMatrix,b);
386 
387  if (BaseType::GetEchoLevel() == 4) {
388  TSparseSpace::WriteMatrixMarketMatrix("StabilizationMatrix.mm", rStabilizationMatrix, false);
389  }
390 
391  // Obtain the stifness and stabilization matrices on the current interface boundary:
392  SparseMatrixType reduced_stabilization_matrix;
393  SparseMatrixType reduced_stiffness_matrix;
394 
395  if(rModelPart.ConditionsBegin()->GetGeometry().NumberOfGeometryParts() != 0) // Coupling Nitsche condition
396  {
397  // 1. find the DOFs on the current interface boundary
398  Model reduced_model_master;
399  ModelPart& reduced_model_part_master = reduced_model_master.CreateModelPart("new_model");
400 
401  for (auto& r_cond : rModelPart.Conditions()) {
402  auto& r_geom_master = r_cond.GetGeometry().GetGeometryPart(0);
403  auto& r_N_master = r_geom_master.ShapeFunctionsValues();
404 
405  for (IndexType i = 0; i<r_N_master.size2();++i)
406  {
407  if(r_N_master(0,i) > 1e-6)
408  {
409  reduced_model_part_master.AddNode(r_geom_master.pGetPoint(i));
410  }
411  }
412  }
413  const std::size_t number_of_nodes_master = reduced_model_part_master.NumberOfNodes();
414 
415  Model reduced_model_slave;
416  ModelPart& reduced_model_part_slave = reduced_model_slave.CreateModelPart("new_model");
417 
418  for (auto& r_cond : rModelPart.Conditions()) {
419  auto& r_geom_slave = r_cond.GetGeometry().GetGeometryPart(1);
420  auto& r_N_slave = r_geom_slave.ShapeFunctionsValues();
421 
422  for (IndexType i = 0; i<r_N_slave.size2();++i)
423  {
424  if(r_N_slave(0,i) > 1e-6)
425  {
426  reduced_model_part_slave.AddNode(r_geom_slave.pGetPoint(i));
427  }
428  }
429  }
430  const std::size_t number_of_nodes_slave = reduced_model_part_slave.NumberOfNodes();
431 
432  // 2. create the result vector
433  Vector rResult;
434  rResult.resize((number_of_nodes_master+number_of_nodes_slave)*3);
435 
436  IndexType i_master = 0;
437  for (auto& r_node : reduced_model_part_master.Nodes()) {
438  const IndexType index = i_master * 3;
439 
440  rResult[index] = r_node.GetDof(DISPLACEMENT_X).EquationId();
441  rResult[index + 1] = r_node.GetDof(DISPLACEMENT_Y).EquationId();
442  rResult[index + 2] = r_node.GetDof(DISPLACEMENT_Z).EquationId();
443 
444  i_master++;
445  }
446 
447  IndexType i_slave = 0;
448  for (auto& r_node : reduced_model_part_slave.Nodes()) {
449  const IndexType index = i_slave * 3 + 3 * number_of_nodes_master;
450 
451  rResult[index] = r_node.GetDof(DISPLACEMENT_X).EquationId();
452  rResult[index + 1] = r_node.GetDof(DISPLACEMENT_Y).EquationId();
453  rResult[index + 2] = r_node.GetDof(DISPLACEMENT_Z).EquationId();
454 
455  i_slave++;
456  }
457 
458  // 3. assigned the value of the reduced stifness and stabilization matrices based on result vector
459  reduced_stabilization_matrix = ZeroMatrix((number_of_nodes_master+number_of_nodes_slave)*3,(number_of_nodes_master+number_of_nodes_slave)*3);
460 
461  for (IndexType i = 0; i < (number_of_nodes_master+number_of_nodes_slave)*3; i++)
462  {
463  for (IndexType j = 0; j <= i; j++)
464  {
465  reduced_stabilization_matrix(i,j) = rStabilizationMatrix(rResult(i),rResult(j));
466  if (i != j)
467  {
468  reduced_stabilization_matrix(j,i) = rStabilizationMatrix(rResult(i),rResult(j));
469  }
470  }
471  }
472 
473  reduced_stiffness_matrix = ZeroMatrix((number_of_nodes_master+number_of_nodes_slave)*3,(number_of_nodes_master+number_of_nodes_slave)*3);
474 
475  for (IndexType i = 0; i < (number_of_nodes_master+number_of_nodes_slave)*3; i++)
476  {
477  for (IndexType j = 0; j <= i; j++)
478  {
479  reduced_stiffness_matrix(i,j) = rStiffnessMatrix(rResult(i),rResult(j));
480  if (i != j)
481  {
482  reduced_stiffness_matrix(j,i) = rStiffnessMatrix(rResult(i),rResult(j));
483  }
484  }
485  }
486  }
487  else // Support Nitsche condition
488  {
489  // 1. find the DOFs on the current interface boundary
490  Model reduced_model;
491  ModelPart& reduced_model_part = reduced_model.CreateModelPart("new_model");
492 
493  for (auto& r_cond : rModelPart.Conditions()) {
494  auto& r_geom = r_cond.GetGeometry();
495  auto& r_N = r_geom.ShapeFunctionsValues();
496 
497  for (IndexType i = 0; i<r_N.size2();++i)
498  {
499  if(r_N(0,i) > 1e-6)
500  {
501  reduced_model_part.AddNode(r_geom.pGetPoint(i));
502  }
503  }
504  }
505  const std::size_t number_of_nodes = reduced_model_part.NumberOfNodes();
506 
507  // 2. create the result vector
508  Vector rResult;
509  rResult.resize((number_of_nodes)*3);
510 
511  IndexType i = 0;
512  for (auto& r_node : reduced_model_part.Nodes()) {
513  const IndexType index = i * 3;
514 
515  rResult[index] = r_node.GetDof(DISPLACEMENT_X).EquationId();
516  rResult[index + 1] = r_node.GetDof(DISPLACEMENT_Y).EquationId();
517  rResult[index + 2] = r_node.GetDof(DISPLACEMENT_Z).EquationId();
518 
519  i++;
520  }
521 
522  // 3. assigned the value of the reduced stifness and stabilization matrices based on result vector
523  reduced_stabilization_matrix = ZeroMatrix((number_of_nodes)*3,(number_of_nodes)*3);
524 
525  for (IndexType i = 0; i < (number_of_nodes)*3; i++)
526  {
527  for (IndexType j = 0; j <= i; j++)
528  {
529  reduced_stabilization_matrix(i,j) = rStabilizationMatrix(rResult(i),rResult(j));
530  if (i != j)
531  reduced_stabilization_matrix(j,i) = rStabilizationMatrix(rResult(i),rResult(j));
532  }
533  }
534 
535  reduced_stiffness_matrix = ZeroMatrix((number_of_nodes)*3,(number_of_nodes)*3);
536 
537  for (IndexType i = 0; i < (number_of_nodes)*3; i++)
538  {
539  for (IndexType j = 0; j <= i; j++)
540  {
541  reduced_stiffness_matrix(i,j) = rStiffnessMatrix(rResult(i),rResult(j));
542  if (i != j)
543  reduced_stiffness_matrix(j,i) = rStiffnessMatrix(rResult(i),rResult(j));
544  }
545  }
546  }
547 
548  // Eigenvector matrix and eigenvalue vector are initialized by the solver
549  DenseVectorType Eigenvalues;
550  DenseMatrixType Eigenvectors;
551 
552  // Solve for eigenvalues and eigenvectors
553  BuiltinTimer system_solve_time;
554  this->pGetBuilderAndSolver()->GetLinearSystemSolver()->Solve(
555  reduced_stabilization_matrix,
556  reduced_stiffness_matrix,
557  Eigenvalues,
558  Eigenvectors);
559 
560  KRATOS_INFO_IF("System Solve Time", BaseType::GetEchoLevel() > 0)
561  << system_solve_time.ElapsedSeconds() << std::endl;
562 
563  rModelPart.GetProcessInfo()[EIGENVALUE_NITSCHE_STABILIZATION_VECTOR] = Eigenvalues;
564 
565  return true;
566  }
567 
568  void FinalizeSolutionStep() override
569  {
570  KRATOS_TRY;
571 
572  const int rank = BaseType::GetModelPart().GetCommunicator().MyPID();
573  KRATOS_INFO_IF("EigensolverNitscheStabilizationStrategy", BaseType::GetEchoLevel() > 2 && rank == 0)
574  << "Entering FinalizeSolutionStep" << std::endl;
575 
576  SparseMatrixType& rStabilizationMatrix = this->GetStabilizationMatrix();
577  SparseVectorPointerType pDx = SparseSpaceType::CreateEmptyVectorPointer();
579  pGetBuilderAndSolver()->FinalizeSolutionStep(
580  BaseType::GetModelPart(), rStabilizationMatrix, *pDx, *pb);
581  pGetScheme()->FinalizeSolutionStep(BaseType::GetModelPart(),
582  rStabilizationMatrix, *pDx, *pb);
583  KRATOS_INFO_IF("EigensolverNitscheStabilizationStrategy", BaseType::GetEchoLevel() > 2 && rank == 0)
584  << "Exiting FinalizeSolutionStep" << std::endl;
585 
586  KRATOS_CATCH("");
587  }
588 
593  int Check() override
594  {
595  KRATOS_TRY
596 
597  ModelPart& rModelPart = BaseType::GetModelPart();
598  const int rank = rModelPart.GetCommunicator().MyPID();
599 
600  KRATOS_INFO_IF("EigensolverNitscheStabilizationStrategy", BaseType::GetEchoLevel() > 2 && rank == 0)
601  << "Entering Check" << std::endl;
602 
603  // check the model part
604  BaseType::Check();
605 
606  // check the scheme
607  this->pGetScheme()->Check(rModelPart);
608 
609  // check the builder and solver
610  this->pGetBuilderAndSolver()->Check(rModelPart);
611 
612  KRATOS_INFO_IF("EigensolverNitscheStabilizationStrategy", BaseType::GetEchoLevel() > 2 && rank == 0)
613  << "Exiting Check" << std::endl;
614 
615  return 0;
616 
617  KRATOS_CATCH("")
618  }
619 
621 
622 private:
625 
629 
630  SchemePointerType mpScheme;
631 
632  BuilderAndSolverPointerType mpBuilderAndSolver;
633 
634  SparseMatrixPointerType mpStiffnessMatrix;
635 
636  SparseMatrixPointerType mpStabilizationMatrix;
637 
638  bool mInitializeWasPerformed = false;
639 
643 
647 
651 
655 
657 
658 }; /* Class EigensolverNitscheStabilizationStrategy */
659 
661 
664 
665 
667 
668 } /* namespace Kratos */
669 
670 #endif /* KRATOS_EIGENSOLVER_NITSCHE_STABILIZATION_STRATEGY defined */
671 
Definition: builtin_timer.h:26
double ElapsedSeconds() const
Definition: builtin_timer.h:40
virtual int MyPID() const
Definition: communicator.cpp:91
Strategy for solving generalized eigenvalue problems to obtain Nitsche stabilization factor.
Definition: eigensolver_nitsche_stabilization_strategy.hpp:56
SparseMatrixType & GetStiffnessMatrix()
Definition: eigensolver_nitsche_stabilization_strategy.hpp:165
bool GetIsInitialized() const
Definition: eigensolver_nitsche_stabilization_strategy.hpp:140
bool GetReformDofSetAtEachStepFlag() const
Definition: eigensolver_nitsche_stabilization_strategy.hpp:190
void SetBuilderAndSolver(BuilderAndSolverPointerType pNewBuilderAndSolver)
Definition: eigensolver_nitsche_stabilization_strategy.hpp:155
EigensolverNitscheStabilizationStrategy(const EigensolverNitscheStabilizationStrategy &Other)=delete
Deleted copy constructor.
void FinalizeSolutionStep() override
Performs all the required operations that should be done (for each step) after solving the solution s...
Definition: eigensolver_nitsche_stabilization_strategy.hpp:568
SchemePointerType & pGetScheme()
Definition: eigensolver_nitsche_stabilization_strategy.hpp:150
TSparseSpace::VectorType SparseVectorType
Definition: eigensolver_nitsche_stabilization_strategy.hpp:81
SparseMatrixPointerType & pGetStabilizationMatrix()
Definition: eigensolver_nitsche_stabilization_strategy.hpp:180
SparseMatrixPointerType & pGetStiffnessMatrix()
Definition: eigensolver_nitsche_stabilization_strategy.hpp:175
BaseType::TBuilderAndSolverType::Pointer BuilderAndSolverPointerType
Definition: eigensolver_nitsche_stabilization_strategy.hpp:67
TSparseSpace SparseSpaceType
Definition: eigensolver_nitsche_stabilization_strategy.hpp:73
void SetReformDofSetAtEachStepFlag(bool flag)
Definition: eigensolver_nitsche_stabilization_strategy.hpp:185
int Check() override
Definition: eigensolver_nitsche_stabilization_strategy.hpp:593
void Initialize() override
Definition: eigensolver_nitsche_stabilization_strategy.hpp:211
~EigensolverNitscheStabilizationStrategy() override
Destructor.
Definition: eigensolver_nitsche_stabilization_strategy.hpp:119
SparseMatrixType & GetStabilizationMatrix()
Definition: eigensolver_nitsche_stabilization_strategy.hpp:170
BaseType::TSchemeType::Pointer SchemePointerType
Definition: eigensolver_nitsche_stabilization_strategy.hpp:65
void InitializeSolutionStep() override
Definition: eigensolver_nitsche_stabilization_strategy.hpp:275
TDenseSpace::VectorType DenseVectorType
Definition: eigensolver_nitsche_stabilization_strategy.hpp:69
void SetIsInitialized(bool val)
Definition: eigensolver_nitsche_stabilization_strategy.hpp:135
TSparseSpace::MatrixType SparseMatrixType
Definition: eigensolver_nitsche_stabilization_strategy.hpp:79
void SetScheme(SchemePointerType pScheme)
Definition: eigensolver_nitsche_stabilization_strategy.hpp:145
ImplicitSolvingStrategy< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Definition: eigensolver_nitsche_stabilization_strategy.hpp:63
EigensolverNitscheStabilizationStrategy(ModelPart &rModelPart, SchemePointerType pScheme, BuilderAndSolverPointerType pBuilderAndSolver)
Constructor.
Definition: eigensolver_nitsche_stabilization_strategy.hpp:88
KRATOS_CLASS_POINTER_DEFINITION(EigensolverNitscheStabilizationStrategy)
TSparseSpace::MatrixPointerType SparseMatrixPointerType
Definition: eigensolver_nitsche_stabilization_strategy.hpp:77
TDenseSpace::MatrixType DenseMatrixType
Definition: eigensolver_nitsche_stabilization_strategy.hpp:71
BuilderAndSolverPointerType & pGetBuilderAndSolver()
Definition: eigensolver_nitsche_stabilization_strategy.hpp:160
TSparseSpace::VectorPointerType SparseVectorPointerType
Definition: eigensolver_nitsche_stabilization_strategy.hpp:75
bool SolveSolutionStep() override
Definition: eigensolver_nitsche_stabilization_strategy.hpp:360
void SetEchoLevel(int Level) override
Set verbosity level of the solving strategy.
Definition: eigensolver_nitsche_stabilization_strategy.hpp:202
void Clear() override
Definition: eigensolver_nitsche_stabilization_strategy.hpp:244
const Matrix & ShapeFunctionsValues() const
Definition: geometry.h:3393
virtual GeometryType & GetGeometryPart(const IndexType Index)
Used for composite geometries. It returns the the geometry part, corresponding to the Index.
Definition: geometry.h:1060
Implicit solving strategy base class This is the base class from which we will derive all the implici...
Definition: implicit_solving_strategy.h:61
void SetRebuildLevel(int Level) override
This sets the build level.
Definition: implicit_solving_strategy.h:207
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
This class aims to manage different model parts across multi-physics simulations.
Definition: model.h:60
ModelPart & CreateModelPart(const std::string &ModelPartName, IndexType NewBufferSize=1)
This method creates a new model part contained in the current Model with a given name and buffer size...
Definition: model.cpp:37
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ConditionIterator ConditionsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1361
void AddNode(NodeType::Pointer pNewNode, IndexType ThisIndex=0)
Definition: model_part.cpp:211
Communicator & GetCommunicator()
Definition: model_part.h:1821
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
GeometryType & GetGeometry(IndexType GeometryId)
Returns a reference geometry corresponding to the id.
Definition: model_part.h:1584
SizeType NumberOfNodes(IndexType ThisIndex=0) const
Definition: model_part.h:341
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
Solving strategy base class This is the base class from which we will derive all the strategies (impl...
Definition: solving_strategy.h:64
virtual void SetEchoLevel(const int Level)
This sets the level of echo for the solving strategy.
Definition: solving_strategy.h:255
ModelPart & GetModelPart()
Operations to get the pointer to the model.
Definition: solving_strategy.h:350
int GetEchoLevel()
This returns the level of echo for the solving strategy.
Definition: solving_strategy.h:271
virtual int Check()
Function to perform expensive checks.
Definition: solving_strategy.h:377
static void Set(VectorType &rX, TDataType A)
rX = A
Definition: ublas_space.h:553
static void Resize(MatrixType &rA, SizeType m, SizeType n)
Definition: ublas_space.h:558
static IndexType Size1(MatrixType const &rM)
return number of rows of rM
Definition: ublas_space.h:197
static VectorPointerType CreateEmptyVectorPointer()
Definition: ublas_space.h:183
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
#define KRATOS_INFO_IF(label, conditional)
Definition: logger.h:251
Vector VectorType
Definition: geometrical_transformation_utilities.h:56
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
std::shared_ptr< T > shared_ptr
Definition: smart_pointers.h:27
bool WriteMatrixMarketMatrix(const char *FileName, CompressedMatrixType &M, bool Symmetric)
Definition: matrix_market_interface.h:308
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
int j
Definition: quadrature.py:648
integer i
Definition: TensorModule.f:17
e
Definition: run_cpp_mpi_tests.py:31