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.
residualbased_elimination_builder_and_solver_componentwise.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: Riccardo Rossi
11 //
12 //
13 #if !defined(KRATOS_RESIDUAL_BASED_ELIMINATION_BUILDER_AND_SOLVERCOMPONENTWISE )
14 #define KRATOS_RESIDUAL_BASED_ELIMINATION_BUILDER_AND_SOLVERCOMPONENTWISE
15 
16 /* System includes */
17 #include <set>
18 
19 /* External includes */
20 #ifdef KRATOS_SMP_OPENMP
21 #include <omp.h>
22 #endif
23 
24 /* Project includes */
25 #include "includes/define.h"
29 
30 namespace Kratos
31 {
32 
88 template<class TSparseSpace,
89  class TDenseSpace ,
90  class TLinearSolver,
91  class TVariableType
92  >
94  : public ResidualBasedEliminationBuilderAndSolver< TSparseSpace,TDenseSpace,TLinearSolver >
95 {
96 public:
100 
101 
104 
106 
107  typedef typename BaseType::TDataType TDataType;
108 
110 
112 
114 
116 
118 
121 
122 
126 
128 
132 
137  typename TLinearSolver::Pointer pNewLinearSystemSolver,
138  Parameters ThisParameters
139  ) : ResidualBasedEliminationBuilderAndSolverType(pNewLinearSystemSolver)
140  {
141  // Validate default parameters
142  Parameters default_parameters = Parameters(R"(
143  {
144  "name" : "ResidualBasedEliminationBuilderAndSolverComponentwise",
145  "components_wise_variable" : "SCALAR_VARIABLE_OR_COMPONENT"
146  })" );
147 
148  ThisParameters.ValidateAndAssignDefaults(default_parameters);
149 
150  rVar = KratosComponents<TVariableType>::Get(ThisParameters["components_wise_variable"].GetString());
151  }
152 
157  typename TLinearSolver::Pointer pNewLinearSystemSolver,TVariableType const& Var)
158  : ResidualBasedEliminationBuilderAndSolverType(pNewLinearSystemSolver)
159  , rVar(Var)
160  {
161 
162  /* std::cout << "using the standard builder and solver " << std::endl; */
163 
164  }
165 
166 
170 
171 
179  //**************************************************************************
180  //**************************************************************************
181  void Build(
182  typename TSchemeType::Pointer pScheme,
183  ModelPart& r_model_part,
185  TSystemVectorType& b) override
186  {
187  KRATOS_TRY
188  if(!pScheme)
189  KRATOS_THROW_ERROR(std::runtime_error, "No scheme provided!", "");
190 
191  //getting the elements from the model
192  ElementsArrayType& pElements = r_model_part.Elements();
193 
194  //getting the array of the conditions
195  ConditionsArrayType& ConditionsArray = r_model_part.Conditions();
196 
197  //resetting to zero the vector of reactions
198  TSparseSpace::SetToZero( *(BaseType::mpReactionsVector) );
199 
200  //create a partition of the element array
201  int number_of_threads = ParallelUtilities::GetNumThreads();
202 
203 #ifdef _OPENMP
204  int A_size = A.size1();
205 
206  //creating an array of lock variables of the size of the system matrix
207  std::vector< omp_lock_t > lock_array(A.size1());
208 
209  for(int i = 0; i<A_size; i++)
210  omp_init_lock(&lock_array[i]);
211 #endif
212 
213  DenseVector<unsigned int> element_partition;
214  CreatePartition(number_of_threads, pElements.size(), element_partition);
215  if (this->GetEchoLevel()>0)
216  {
217  KRATOS_WATCH( number_of_threads );
218  KRATOS_WATCH( element_partition );
219  }
220 
221  const auto timer = BuiltinTimer();
222 
223  #pragma omp parallel for firstprivate(number_of_threads) schedule(static,1)
224  for(int k=0; k<number_of_threads; k++)
225  {
226  //contributions to the system
227  LocalSystemMatrixType LHS_Contribution = LocalSystemMatrixType(0,0);
228  LocalSystemVectorType RHS_Contribution = LocalSystemVectorType(0);
229 
230  //vector containing the localization in the system of the different
231  //terms
233  const ProcessInfo& CurrentProcessInfo = r_model_part.GetProcessInfo();
234  typename ElementsArrayType::ptr_iterator it_begin=pElements.ptr_begin()+element_partition[k];
235  typename ElementsArrayType::ptr_iterator it_end=pElements.ptr_begin()+element_partition[k+1];
236 
237  unsigned int pos = (r_model_part.Nodes().begin())->GetDofPosition(rVar);
238 
239 
240  // assemble all elements
241  for (typename ElementsArrayType::ptr_iterator it=it_begin; it!=it_end; ++it)
242  {
243 
244  //calculate elemental contribution
245  (*it)->CalculateLocalSystem(LHS_Contribution,RHS_Contribution,CurrentProcessInfo);
246 
247  Geometry< Node >& geom = (*it)->GetGeometry();
248  if(EquationId.size() != geom.size()) EquationId.resize(geom.size(),false);
249 
250  for(unsigned int i=0; i<geom.size(); i++)
251  EquationId[i] = geom[i].GetDof(rVar,pos).EquationId();
252 
253  //assemble the elemental contribution
254 #ifdef USE_LOCKS_IN_ASSEMBLY
255  this->Assemble(A,b,LHS_Contribution,RHS_Contribution,EquationId,lock_array);
256 #else
257  this->Assemble(A,b,LHS_Contribution,RHS_Contribution,EquationId);
258 #endif
259  }
260  }
261 
262  DenseVector<unsigned int> condition_partition;
263  CreatePartition(number_of_threads, ConditionsArray.size(), condition_partition);
264 
265  #pragma omp parallel for firstprivate(number_of_threads) schedule(static,1)
266  for(int k=0; k<number_of_threads; k++)
267  {
268  //contributions to the system
269  LocalSystemMatrixType LHS_Contribution = LocalSystemMatrixType(0,0);
270  LocalSystemVectorType RHS_Contribution = LocalSystemVectorType(0);
271 
273 
274  const ProcessInfo& CurrentProcessInfo = r_model_part.GetProcessInfo();
275 
276  typename ConditionsArrayType::ptr_iterator it_begin=ConditionsArray.ptr_begin()+condition_partition[k];
277  typename ConditionsArrayType::ptr_iterator it_end=ConditionsArray.ptr_begin()+condition_partition[k+1];
278 
279  unsigned int pos = (r_model_part.Nodes().begin())->GetDofPosition(rVar);
280 
281  // A all elements
282  for (typename ConditionsArrayType::ptr_iterator it=it_begin; it!=it_end; ++it)
283  {
284 
285  //calculate elemental contribution
286  (*it)->CalculateLocalSystem(LHS_Contribution,RHS_Contribution,CurrentProcessInfo);
287 
288  Geometry< Node >& geom = (*it)->GetGeometry();
289  if(EquationId.size() != geom.size()) EquationId.resize(geom.size(),false);
290 
291  for(unsigned int i=0; i<geom.size(); i++)
292  {
293  EquationId[i] = geom[i].GetDof(rVar,pos).EquationId();
294  }
295 
296 #ifdef USE_LOCKS_IN_ASSEMBLY
297  this->Assemble(A,b,LHS_Contribution,RHS_Contribution,EquationId,lock_array);
298 #else
299  this->Assemble(A,b,LHS_Contribution,RHS_Contribution,EquationId);
300 #endif
301  }
302  }
303  if (this->GetEchoLevel()>0) {
304  std::cout << "parallel building time: " << timer.ElapsedSeconds() << std::endl;
305  }
306 
307 #ifdef _OPENMP
308  for(int i = 0; i<A_size; i++)
309  omp_destroy_lock(&lock_array[i]);
310 #endif
311 
312  KRATOS_CATCH("")
313 
314  }
315 
316 
317 
318 
319  //**************************************************************************
320  //**************************************************************************
322  typename TSchemeType::Pointer pScheme,
323  ModelPart& r_model_part
324  ) override
325  {
326  KRATOS_TRY
327 
328 
329  //fills a list of "active" nodes defined as nodes which have neighbours
330  // AND no fixed pressure
331  mActiveNodes.clear();
332  mActiveNodes.reserve(r_model_part.Nodes().size() );
333  for (typename NodesArrayType::iterator it=r_model_part.NodesBegin(); it!=r_model_part.NodesEnd(); ++it)
334  {
335  if( (it->GetValue(NEIGHBOUR_NODES)).size() != 0 )
336  {
337  mActiveNodes.push_back(*(it.base() ));
338  }
339  }
340 
341  //fills the DofList and give a unique progressive tag to each node
343  BaseType::mDofSet.reserve(mActiveNodes.size() );
344 
345  for(GlobalPointersVector< Node >::iterator iii = mActiveNodes.begin(); iii!=mActiveNodes.end(); iii++)
346  {
347  BaseType::mDofSet.push_back( iii->pGetDof(rVar) );
348  }
349 
350  //throws an exception if there are no Degrees of freedom involved in the analysis
351  if (BaseType::mDofSet.size()==0)
352  KRATOS_THROW_ERROR(std::logic_error, "No degrees of freedom!", "");
353 
355 
356 
357  // If reactions are to be calculated, we check if all the dofs have reactions defined
358  // This is tobe done only in debug mode
359 
360  #ifdef KRATOS_DEBUG
361 
363  {
364  for(auto dof_iterator = BaseType::mDofSet.begin(); dof_iterator != BaseType::mDofSet.end(); ++dof_iterator)
365  {
366  KRATOS_ERROR_IF_NOT(dof_iterator->HasReaction()) << "Reaction variable not set for the following : " <<std::endl
367  << "Node : "<<dof_iterator->Id()<< std::endl
368  << "Dof : "<<(*dof_iterator)<<std::endl<<"Not possible to calculate reactions."<<std::endl;
369  }
370  }
371  #endif
372 
373 
374  KRATOS_CATCH("")
375  }
376 
377 
378  //**************************************************************************
379  //**************************************************************************
381  typename TSchemeType::Pointer pScheme,
385  ModelPart& rModelPart
386  ) override
387  {
388  KRATOS_TRY
389 
390  if(pA == NULL) //if the pointer is not initialized initialize it to an empty matrix
391  {
393  pA.swap(pNewA);
394  }
395  if(pDx == NULL) //if the pointer is not initialized initialize it to an empty matrix
396  {
398  pDx.swap(pNewDx);
399  }
400  if(pb == NULL) //if the pointer is not initialized initialize it to an empty matrix
401  {
403  pb.swap(pNewb);
404  }
405  if(BaseType::mpReactionsVector == NULL) //if the pointer is not initialized initialize it to an empty matrix
406  {
408  BaseType::mpReactionsVector.swap(pNewReactionsVector);
409  }
410 
411  TSystemMatrixType& A = *pA;
412  TSystemVectorType& Dx = *pDx;
413  TSystemVectorType& b = *pb;
414 
415  //resizing the system vectors and matrix
416  if (A.size1() == 0 || BaseType::GetReshapeMatrixFlag() == true) //if the matrix is not initialized
417  {
419 #ifdef _OPENMP
420  ParallelConstructGraph(A);
421 #else
422  ConstructGraph(A);
423 #endif
424  }
425  else
426  {
428  {
429  //KRATOS_WATCH("it should not come here!!!!!!!! ... this is SLOW");
430  KRATOS_ERROR <<"The equation system size has changed during the simulation. This is not permitted."<<std::endl;
432 #ifdef _OPENMP
433  ParallelConstructGraph(A);
434 #else
435  ConstructGraph(A);
436 #endif
437  }
438  }
439  if (Dx.size() != BaseType::mEquationSystemSize) {
440  Dx.resize(BaseType::mEquationSystemSize, false);
441  }
442  TSparseSpace::SetToZero(Dx);
443  if (b.size() != BaseType::mEquationSystemSize) {
444  b.resize(BaseType::mEquationSystemSize, false);
445  }
446  TSparseSpace::SetToZero(b);
447 
448  //if needed resize the vector for the calculation of reactions
450  {
451  unsigned int ReactionsVectorSize = BaseType::mDofSet.size();
452  if(BaseType::mpReactionsVector->size() != ReactionsVectorSize)
453  BaseType::mpReactionsVector->resize(ReactionsVectorSize,false);
454  }
455 
456  //swapping pointers
457 // pA.swap(pNewA);
458 // pDx.swap(pNewDx);
459 // pb.swap(pNewb);
460 #ifndef __SUNPRO_CC
461  KRATOS_CATCH("")
462 #endif
463 
464  }
465 
466  //**************************************************************************
467  //**************************************************************************
468  void Clear() override
469  {
470  this->mDofSet = DofsArrayType();
471 
472  if(this->mpReactionsVector != NULL)
473  {
474  TSparseSpace::Clear( (this->mpReactionsVector) );
475  }
476 // *(this->mpReactionsVector) = TSystemVectorType();
477 
478  if (this->GetEchoLevel()>1)
479  {
480  KRATOS_WATCH("ResidualBasedEliminationBuilderAndSolver Clear Function called");
481  }
482  }
500 
502  std::string Info() const override
503  {
504  return "ResidualBasedEliminationBuilderAndSolverComponentwise";
505  }
506 
508  void PrintInfo(std::ostream& rOStream) const override
509  {
510  rOStream << Info();
511  }
512 
514  void PrintData(std::ostream& rOStream) const override
515  {
516  rOStream << Info();
517  }
518 
526 protected:
539  //**************************************************************************
540  //**************************************************************************
541  //**************************************************************************
542  //**************************************************************************
544  {
545  KRATOS_TRY
546 
547  std::vector< std::vector<int> > index_list(BaseType::mEquationSystemSize);
548 
549  int total_size = 0;
550 
551  unsigned int pos = (mActiveNodes.begin())->GetDofPosition(rVar);
552  //constructing the system matrix row by row
553  int index_i;
554  for(GlobalPointersVector< Node >::iterator in = mActiveNodes.begin();
555  in!=mActiveNodes.end(); in++)
556  {
557  const Node::DofType& current_dof = in->GetDof(rVar,pos);
558  if( current_dof.IsFixed() == false)
559  {
560  index_i = (current_dof).EquationId();
561  GlobalPointersVector< Node >& neighb_nodes = in->GetValue(NEIGHBOUR_NODES);
562 
563  std::vector<int>& indices = index_list[index_i];
564  indices.reserve(neighb_nodes.size()+1);
565 
566  //filling the first neighbours list
567  indices.push_back(index_i);
568  for( GlobalPointersVector< Node >::iterator i = neighb_nodes.begin();
569  i != neighb_nodes.end(); i++)
570  {
571  const Node::DofType& neighb_dof = i->GetDof(rVar,pos);
572  if(neighb_dof.IsFixed() == false )
573  {
574  int index_j = (neighb_dof).EquationId();
575  indices.push_back(index_j);
576  }
577  }
578 
579  //sorting the indices and eliminating the duplicates
580  std::sort(indices.begin(),indices.end());
581  typename std::vector<int>::iterator new_end = std::unique(indices.begin(),indices.end());
582 
583  indices.erase(new_end,indices.end());
584 
585  total_size += indices.size();
586  }
587  }
588 
589  A.reserve(total_size,false);
590 
591  //setting to zero the matrix (and the diagonal matrix)
592  for(unsigned int i=0; i<BaseType::mEquationSystemSize; i++)
593  {
594  std::vector<int>& indices = index_list[i];
595  for(unsigned int j=0; j<indices.size(); j++)
596  {
597  A.push_back(i,indices[j] , 0.00);
598  }
599  }
600 
601  KRATOS_CATCH("")
602  }
603 
604  //**************************************************************************
605  //**************************************************************************
606  //**************************************************************************
607  //**************************************************************************
608 #ifdef _OPENMP
609  void ParallelConstructGraph(TSystemMatrixType& A)
610  {
611 #ifndef __SUNPRO_CC
612  KRATOS_TRY
613 #endif
614  std::vector< std::vector<int> > index_list(BaseType::mEquationSystemSize);
615 
616  int number_of_threads = omp_get_max_threads();
617 
618  unsigned int pos = (mActiveNodes.begin())->GetDofPosition(rVar);
619  //constructing the system matrix row by row
620 
621  DenseVector<unsigned int> partition;
622  DenseVector<unsigned int> local_sizes(number_of_threads);
623  for(int i=0; i<number_of_threads; i++)
624  local_sizes[i] = 0;
625 
626  CreatePartition(number_of_threads, mActiveNodes.size(), partition);
627 
628  #pragma omp parallel for firstprivate(number_of_threads,pos) schedule(static,1)
629  for(int k=0; k<number_of_threads; k++)
630  {
631  GlobalPointersVector< Node >::iterator it_begin = mActiveNodes.begin()+partition[k];
632  GlobalPointersVector< Node >::iterator it_end = mActiveNodes.begin()+partition[k+1];
633 
634  for(GlobalPointersVector< Node >::iterator in = it_begin;
635  in!=it_end; in++)
636  {
637  const Node::DofType& current_dof = in->GetDof(rVar,pos);
638  if( current_dof.IsFixed() == false)
639  {
640  int index_i = (current_dof).EquationId();
641  GlobalPointersVector< Node >& neighb_nodes = in->GetValue(NEIGHBOUR_NODES);
642 
643  std::vector<int>& indices = index_list[index_i];
644  indices.reserve(neighb_nodes.size()+1);
645 
646  //filling the first neighbours list
647  indices.push_back(index_i);
648  for( GlobalPointersVector< Node >::iterator i = neighb_nodes.begin();
649  i != neighb_nodes.end(); i++)
650  {
651 
652  const Node::DofType& neighb_dof = i->GetDof(rVar,pos);
653  if(neighb_dof.IsFixed() == false )
654  {
655  int index_j = (neighb_dof).EquationId();
656  indices.push_back(index_j);
657  }
658  }
659 
660  //sorting the indices and eliminating the duplicates
661  std::sort(indices.begin(),indices.end());
662  typename std::vector<int>::iterator new_end = std::unique(indices.begin(),indices.end());
663  indices.erase(new_end,indices.end());
664 
665  local_sizes[k] += indices.size();
666  }
667  }
668  }
669 
670  //calculate the total size of the system
671  int total_size = 0.0;
672  for(int i=0; i<number_of_threads; i++)
673  total_size += local_sizes[i];
674 
675  A.reserve(total_size,false);
676 
677  //setting to zero the matrix (and the diagonal matrix)
678  for(unsigned int i=0; i<BaseType::mEquationSystemSize; i++)
679  {
680  std::vector<int>& indices = index_list[i];
681  for(unsigned int j=0; j<indices.size(); j++)
682  {
683  A.push_back(i,indices[j] , 0.00);
684  }
685  }
686 #ifndef __SUNPRO_CC
687  KRATOS_CATCH("")
688 #endif
689  }
690 #endif
691 
692 
693 
717 private:
725  TVariableType const & rVar;
726  GlobalPointersVector<Node > mActiveNodes;
727 
731  //******************************************************************************************
732  //******************************************************************************************
733  inline void CreatePartition(unsigned int number_of_threads,const int number_of_rows, DenseVector<unsigned int>& partitions)
734  {
735  partitions.resize(number_of_threads+1);
736  int partition_size = number_of_rows / number_of_threads;
737  partitions[0] = 0;
738  partitions[number_of_threads] = number_of_rows;
739  for(unsigned int i = 1; i<number_of_threads; i++)
740  partitions[i] = partitions[i-1] + partition_size ;
741  }
742 
743 
744 
745 
746 
773 }; /* Class ResidualBasedEliminationBuilderAndSolverComponentwise */
774 
783 } /* namespace Kratos.*/
784 
785 #endif /* KRATOS_RESIDUAL_BASED_ELIMINATION_BUILDER_AND_SOLVERCOMPONENTWISE defined */
Current class provides an implementation for the base builder and solving operations.
Definition: builder_and_solver.h:64
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
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
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
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
Definition: builtin_timer.h:26
std::vector< std::size_t > EquationIdVectorType
Definition: condition.h:98
Dof represents a degree of freedom (DoF).
Definition: dof.h:86
bool IsFixed() const
Definition: dof.h:376
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
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: global_pointers_vector.h:79
iterator begin()
Definition: global_pointers_vector.h:221
void reserve(int dim)
Definition: global_pointers_vector.h:375
size_type size() const
Definition: global_pointers_vector.h:307
iterator end()
Definition: global_pointers_vector.h:229
Definition: amatrix_interface.h:41
static const TComponentType & Get(const std::string &rName)
Retrieves a component with the specified name.
Definition: kratos_components.h:114
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
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
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
static int GetNumThreads()
Returns the current number of threads.
Definition: parallel_utilities.cpp:34
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
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
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
void clear()
Clear the set, removing all elements.
Definition: pointer_vector_set.h:663
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: pointer_vector_set.h:95
ptr_iterator ptr_begin()
Returns an iterator pointing to the beginning of the underlying data container.
Definition: pointer_vector_set.h:386
size_type size() const
Returns the number of elements in the container.
Definition: pointer_vector_set.h:502
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
typename TContainerType::iterator ptr_iterator
Definition: pointer_vector_set.h:104
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Definition: residualbased_elimination_builder_and_solver_componentwise.h:95
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: residualbased_elimination_builder_and_solver_componentwise.h:115
BaseType::TSchemeType TSchemeType
Definition: residualbased_elimination_builder_and_solver_componentwise.h:105
void Build(typename TSchemeType::Pointer pScheme, ModelPart &r_model_part, TSystemMatrixType &A, TSystemVectorType &b) override
Function to perform the build of the RHS. The vector could be sized as the total number of dofs or as...
Definition: residualbased_elimination_builder_and_solver_componentwise.h:181
BaseType::TDataType TDataType
Definition: residualbased_elimination_builder_and_solver_componentwise.h:107
std::string Info() const override
Turn back information as a string.
Definition: residualbased_elimination_builder_and_solver_componentwise.h:502
void SetUpDofSet(typename TSchemeType::Pointer pScheme, ModelPart &r_model_part) override
Builds the list of the DofSets involved in the problem by "asking" to each element and condition its ...
Definition: residualbased_elimination_builder_and_solver_componentwise.h:321
BaseType::TSystemVectorPointerType TSystemVectorPointerType
Definition: residualbased_elimination_builder_and_solver_componentwise.h:120
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: residualbased_elimination_builder_and_solver_componentwise.h:514
BaseType::TSystemMatrixType TSystemMatrixType
Definition: residualbased_elimination_builder_and_solver_componentwise.h:111
BaseType::NodesArrayType NodesArrayType
Definition: residualbased_elimination_builder_and_solver_componentwise.h:123
ResidualBasedEliminationBuilderAndSolver< TSparseSpace, TDenseSpace, TLinearSolver > ResidualBasedEliminationBuilderAndSolverType
Definition: residualbased_elimination_builder_and_solver_componentwise.h:103
BaseType::DofsArrayType DofsArrayType
Definition: residualbased_elimination_builder_and_solver_componentwise.h:109
ResidualBasedEliminationBuilderAndSolverComponentwise(typename TLinearSolver::Pointer pNewLinearSystemSolver, Parameters ThisParameters)
Default constructor. (with parameters)
Definition: residualbased_elimination_builder_and_solver_componentwise.h:136
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: residualbased_elimination_builder_and_solver_componentwise.h:117
void ResizeAndInitializeVectors(typename TSchemeType::Pointer pScheme, TSystemMatrixPointerType &pA, TSystemVectorPointerType &pDx, TSystemVectorPointerType &pb, ModelPart &rModelPart) override
This method resize and initializes the system of euqations.
Definition: residualbased_elimination_builder_and_solver_componentwise.h:380
KRATOS_CLASS_POINTER_DEFINITION(ResidualBasedEliminationBuilderAndSolverComponentwise)
ResidualBasedEliminationBuilderAndSolverComponentwise(typename TLinearSolver::Pointer pNewLinearSystemSolver, TVariableType const &Var)
Default constructor. Constructor.
Definition: residualbased_elimination_builder_and_solver_componentwise.h:156
BaseType::ElementsContainerType ElementsContainerType
Definition: residualbased_elimination_builder_and_solver_componentwise.h:127
BaseType::ElementsArrayType ElementsArrayType
Definition: residualbased_elimination_builder_and_solver_componentwise.h:124
BaseType::TSystemVectorType TSystemVectorType
Definition: residualbased_elimination_builder_and_solver_componentwise.h:113
BuilderAndSolver< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Definition: residualbased_elimination_builder_and_solver_componentwise.h:102
BaseType::ConditionsArrayType ConditionsArrayType
Definition: residualbased_elimination_builder_and_solver_componentwise.h:125
void ConstructGraph(TSystemMatrixType &A)
Definition: residualbased_elimination_builder_and_solver_componentwise.h:543
~ResidualBasedEliminationBuilderAndSolverComponentwise() override
Definition: residualbased_elimination_builder_and_solver_componentwise.h:169
void Clear() override
This function is intended to be called at the end of the solution step to clean up memory storage not...
Definition: residualbased_elimination_builder_and_solver_componentwise.h:468
BaseType::TSystemMatrixPointerType TSystemMatrixPointerType
Definition: residualbased_elimination_builder_and_solver_componentwise.h:119
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: residualbased_elimination_builder_and_solver_componentwise.h:508
Current class provides an implementation for standard elimination builder and solving operations.
Definition: residualbased_elimination_builder_and_solver.h:76
void Assemble(TSystemMatrixType &rA, TSystemVectorType &rb, const LocalSystemMatrixType &rLHSContribution, const LocalSystemVectorType &rRHSContribution, const Element::EquationIdVectorType &rEquationId)
This method assembles the system.
Definition: residualbased_elimination_builder_and_solver.h:1037
This class provides the implementation of the basic tasks that are needed by the solution strategy.
Definition: scheme.h:56
#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
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
A
Definition: sensitivityMatrix.py:70
integer i
Definition: TensorModule.f:17
Definition: timer.py:1