10 #if !defined(KRATOS_REDUCTION_BUILDER_AND_SOLVER_H_INCLUDED)
11 #define KRATOS_REDUCTION_BUILDER_AND_SOLVER_H_INCLUDED
21 #ifdef USE_GOOGLE_HASH
22 #include "sparsehash/dense_hash_set"
24 #include <unordered_set>
50 template<
class TSparseSpace,
155 for (
typename ElementsContainerType::ptr_iterator it = rElements.ptr_begin(); it != rElements.ptr_end(); ++it)
158 pScheme->Calculate_LHS_Contribution(*it, LHS_Contribution, EquationId, rCurrentProcessInfo);
167 LHS_Contribution.resize(0, 0,
false);
170 for (
typename ConditionsContainerType::ptr_iterator it = rConditions.ptr_begin(); it != rConditions.ptr_end(); ++it)
173 pScheme->Condition_Calculate_LHS_Contribution(*it, LHS_Contribution, EquationId, rCurrentProcessInfo);
195 if(this->
mOptions.
Is(LocalFlagType::COMPUTE_REACTIONS))
201 ElementsContainerType& rElements = rModelPart.
Elements();
216 #pragma omp parallel firstprivate( RHS_Contribution, EquationId)
218 const int nelements =
static_cast<int>(rElements.size());
219 #pragma omp for schedule(guided, 512) nowait
220 for (
int i = 0;
i<nelements;
i++)
222 typename ElementsContainerType::iterator it = rElements.begin() +
i;
225 bool element_is_active =
true;
226 if ((it)->IsDefined(ACTIVE))
227 element_is_active = (it)->Is(ACTIVE);
229 if (element_is_active)
232 pScheme->Calculate_RHS_Contribution(*(it.base()), RHS_Contribution, EquationId, rCurrentProcessInfo);
240 const int nconditions =
static_cast<int>(rConditions.size());
241 #pragma omp for schedule(guided, 512)
242 for (
int i = 0;
i<nconditions;
i++)
244 auto it = rConditions.begin() +
i;
247 bool condition_is_active =
true;
248 if ((it)->IsDefined(ACTIVE))
249 condition_is_active = (it)->Is(ACTIVE);
251 if (condition_is_active)
254 pScheme->Condition_Calculate_RHS_Contribution(*(it.base()), RHS_Contribution, EquationId, rCurrentProcessInfo);
281 const int nelements =
static_cast<int>(rModelPart.
Elements().size());
284 const int nconditions =
static_cast<int>(rModelPart.
Conditions().size());
287 ModelPart::ElementsContainerType::iterator el_begin = rModelPart.
ElementsBegin();
288 ModelPart::ConditionsContainerType::iterator cond_begin = rModelPart.
ConditionsBegin();
301 #pragma omp parallel firstprivate(nelements, nconditions, LHS_Contribution, RHS_Contribution, EquationId )
303 #pragma omp for schedule(guided, 512) nowait
304 for (
int k = 0;
k < nelements;
k++)
306 ModelPart::ElementsContainerType::iterator it = el_begin +
k;
310 bool element_is_active =
true;
312 element_is_active = (it)->
Is(ACTIVE);
314 if (element_is_active)
317 pScheme->CalculateSystemContributions(*(it.base()), LHS_Contribution, RHS_Contribution, EquationId, rCurrentProcessInfo);
321 Assemble(rA, rb, LHS_Contribution, RHS_Contribution, EquationId, mlock_array);
323 Assemble(rA, rb, LHS_Contribution, RHS_Contribution, EquationId);
326 pScheme->Clear(*(it.base()));
332 #pragma omp for schedule(guided, 512)
333 for (
int k = 0;
k < nconditions;
k++)
335 ModelPart::ConditionsContainerType::iterator it = cond_begin +
k;
339 bool condition_is_active =
true;
341 condition_is_active = (it)->
Is(ACTIVE);
343 if (condition_is_active)
346 pScheme->Condition_CalculateSystemContributions(*(it.base()), LHS_Contribution, RHS_Contribution, EquationId, rCurrentProcessInfo);
349 Assemble(rA, rb, LHS_Contribution, RHS_Contribution, EquationId, mlock_array);
351 Assemble(rA, rb, LHS_Contribution, RHS_Contribution, EquationId);
355 pScheme->Clear(*(it.base()));
365 KRATOS_INFO(
"parallel_build") <<
"finished" << std::endl;
393 TSparseSpace::SetToZero(rDx);
418 Build(pScheme, rModelPart, rA, rb);
428 KRATOS_INFO(
"LHS before solve") <<
"Matrix = " << rA << std::endl;
429 KRATOS_INFO(
"Dx before solve") <<
"Solution = " << rDx << std::endl;
430 KRATOS_INFO(
"RHS before solve") <<
"Vector = " << rb << std::endl;
443 KRATOS_INFO(
"LHS after solve") <<
"Matrix = " << rA << std::endl;
444 KRATOS_INFO(
"Dx after solve") <<
"Solution = " << rDx << std::endl;
445 KRATOS_INFO(
"RHS after solve") <<
"Vector = " << rb << std::endl;
496 KRATOS_INFO(
"setting_dofs") <<
"SetUpDofSet starts" << std::endl;
501 const int nelements =
static_cast<int>(rElements.size());
509 #ifdef USE_GOOGLE_HASH
510 typedef google::dense_hash_set < Node::DofType::Pointer, dof_iterator_hash> set_type;
512 typedef std::unordered_set < Node::DofType::Pointer, dof_iterator_hash> set_type;
515 std::vector<set_type> dofs_aux_list(nthreads);
519 KRATOS_INFO(
"setting_dofs") <<
"Number of threads:" << nthreads << std::endl;
522 for (
int i = 0; i < static_cast<int>(nthreads);
i++)
524 #ifdef USE_GOOGLE_HASH
527 dofs_aux_list[
i].reserve(nelements);
533 KRATOS_INFO(
"setting_dofs") <<
"initialize_elements" << std::endl;
536 #pragma omp parallel for firstprivate(nelements, ElementalDofList)
537 for (
int i = 0; i < static_cast<int>(nelements);
i++)
539 typename ElementsContainerType::iterator it = rElements.begin() +
i;
543 pScheme->GetElementalDofList(*(it.base()), ElementalDofList, rCurrentProcessInfo);
545 dofs_aux_list[this_thread_id].insert(ElementalDofList.begin(), ElementalDofList.end());
550 KRATOS_INFO(
"setting_dofs") <<
"initialize_conditions" << std::endl;
554 const int nconditions =
static_cast<int>(rConditions.size());
555 #pragma omp parallel for firstprivate(nconditions, ElementalDofList)
556 for (
int i = 0;
i < nconditions;
i++)
558 typename ConditionsContainerType::iterator it = rConditions.begin() +
i;
562 pScheme->GetConditionDofList(*(it.base()), ElementalDofList, rCurrentProcessInfo);
563 dofs_aux_list[this_thread_id].insert(ElementalDofList.begin(), ElementalDofList.end());
569 KRATOS_INFO(
"setting_dofs") <<
"initialize tree reduction" << std::endl;
573 unsigned int old_max = nthreads;
574 unsigned int new_max = ceil(0.5*
static_cast<double>(old_max));
575 while (new_max >= 1 && new_max != old_max)
580 KRATOS_INFO(
"setting_dofs") <<
"old_max" << old_max <<
" new_max:" << new_max << std::endl;
581 for (
int i = 0; i < static_cast<int>(new_max);
i++)
583 if (
i + new_max < old_max)
585 KRATOS_INFO(
"setting_dofs") <<
i <<
" - " <<
i+new_max << std::endl;
590 #pragma omp parallel for
591 for (
int i = 0; i < static_cast<int>(new_max);
i++)
593 if (
i + new_max < old_max)
595 dofs_aux_list[
i].insert(dofs_aux_list[
i + new_max].begin(), dofs_aux_list[
i + new_max].end());
596 dofs_aux_list[
i + new_max].clear();
601 new_max = ceil(0.5*
static_cast<double>(old_max));
607 KRATOS_INFO(
"setting_dofs") <<
"initializing ordered array filling" << std::endl;
613 Doftemp.
reserve(dofs_aux_list[0].size());
614 for (
auto it = dofs_aux_list[0].begin(); it != dofs_aux_list[0].end(); it++)
634 KRATOS_INFO(
"setting_dofs") <<
"Finished setting up the dofs" << std::endl;
639 KRATOS_INFO(
"setting_dofs") <<
"Initializing lock array" << std::endl;
643 if (mlock_array.size() != 0)
645 for (
int i = 0; i < static_cast<int>(mlock_array.size());
i++)
646 omp_destroy_lock(&mlock_array[
i]);
651 for (
int i = 0; i < static_cast<int>(mlock_array.size());
i++)
652 omp_init_lock(&mlock_array[
i]);
657 KRATOS_INFO(
"setting_dofs") <<
"End of setupdofset" << std::endl;
660 this->
Set(LocalFlagType::DOFS_INITIALIZED,
true);
681 if (dof_iterator->IsFixed())
682 dof_iterator->SetEquationId(--fix_id);
684 dof_iterator->SetEquationId(free_id++);
718 SystemVectorPointerType pNewReactionsVector = Kratos::make_shared<SystemVectorType>(0);
727 if (rA.size1() == 0 || this->mOptions.Is(LocalFlagType::REFORM_DOFS))
734 if (rA.size1() != this->mEquationSystemSize || rA.size2() != this->mEquationSystemSize)
736 KRATOS_WARNING(
"reduction builder resize") <<
"it should not come here -> this is SLOW" << std::endl;
741 if (rDx.size() != this->mEquationSystemSize)
743 if (rb.size() != this->mEquationSystemSize)
747 if(this->
mOptions.
Is(LocalFlagType::COMPUTE_REACTIONS))
749 unsigned int ReactionsVectorSize = this->
mDofSet.
size();
828 for (it2 = this->
mDofSet.
ptr_begin(); it2 != this->mDofSet.ptr_end(); ++it2)
830 i = (*it2)->EquationId();
832 (*it2)->GetSolutionStepReactionValue() = -ReactionsVector[
i];
847 for (
int i = 0; i < static_cast<int>(mlock_array.size());
i++)
848 omp_destroy_lock(&mlock_array[
i]);
849 mlock_array.resize(0);
893 std::vector< omp_lock_t > mlock_array;
930 TSparseSpace::SetToZero(rDx);
931 KRATOS_WARNING(
"RHS") <<
"ATTENTION! setting the RHS to zero!" << std::endl;
955 #ifdef USE_GOOGLE_HASH
956 std::vector<google::dense_hash_set<std::size_t> > indices(equation_size);
957 const std::size_t empty_key = 2 * equation_size + 10;
959 std::vector<std::unordered_set<std::size_t> > indices(equation_size);
962 #pragma omp parallel for firstprivate(equation_size)
963 for (
int iii = 0; iii < static_cast<int>(equation_size); iii++)
965 #ifdef USE_GOOGLE_HASH
966 indices[iii].set_empty_key(empty_key);
968 indices[iii].reserve(40);
974 const int nelements =
static_cast<int>(rElements.size());
975 #pragma omp parallel for firstprivate(nelements, ids)
976 for (
int iii = 0; iii<nelements; iii++)
978 typename ElementsContainerType::iterator i_element = rElements.begin() + iii;
979 pScheme->EquationId( *(i_element.base()), ids, rCurrentProcessInfo);
981 for (std::size_t
i = 0;
i < ids.size();
i++)
986 omp_set_lock(&mlock_array[ids[
i]]);
988 auto& row_indices = indices[ids[
i]];
989 for (
auto it = ids.begin(); it != ids.end(); it++)
992 row_indices.insert(*it);
995 omp_unset_lock(&mlock_array[ids[
i]]);
1002 const int nconditions =
static_cast<int>(rConditions.size());
1003 #pragma omp parallel for firstprivate(nconditions, ids)
1004 for (
int iii = 0; iii<nconditions; iii++)
1006 typename ConditionsContainerType::iterator i_condition = rConditions.begin() + iii;
1007 pScheme->Condition_EquationId( *(i_condition.base()) , ids, rCurrentProcessInfo);
1008 for (std::size_t
i = 0;
i < ids.size();
i++)
1013 omp_set_lock(&mlock_array[ids[
i]]);
1015 auto& row_indices = indices[ids[
i]];
1016 for (
auto it = ids.begin(); it != ids.end(); it++)
1019 row_indices.insert(*it);
1022 omp_unset_lock(&mlock_array[ids[
i]]);
1029 unsigned int nnz = 0;
1030 for (
unsigned int i = 0;
i < indices.size();
i++)
1031 nnz += indices[
i].size();
1033 rA = boost::numeric::ublas::compressed_matrix<double>(indices.size(), indices.size(), nnz);
1035 double* Avalues = rA.value_data().begin();
1036 std::size_t* Arow_indices = rA.index1_data().begin();
1037 std::size_t* Acol_indices = rA.index2_data().begin();
1040 Arow_indices[0] = 0;
1041 for (
int i = 0; i < static_cast<int>(rA.size1());
i++)
1042 Arow_indices[
i + 1] = Arow_indices[
i] + indices[
i].size();
1045 #pragma omp parallel for
1046 for (
int i = 0; i < static_cast<int>(rA.size1());
i++)
1048 const unsigned int row_begin = Arow_indices[
i];
1049 const unsigned int row_end = Arow_indices[
i + 1];
1050 unsigned int k = row_begin;
1051 for (
auto it = indices[
i].begin(); it != indices[
i].end(); it++)
1053 Acol_indices[
k] = *it;
1060 std::sort(&Acol_indices[row_begin], &Acol_indices[row_end]);
1064 rA.set_filled(indices.size() + 1, nnz);
1076 unsigned int local_size = rLHS_Contribution.size1();
1078 for (
unsigned int i_local = 0; i_local <
local_size; i_local++)
1080 unsigned int i_global = rEquationId[i_local];
1083 for (
unsigned int j_local = 0; j_local <
local_size; j_local++)
1085 unsigned int j_global = rEquationId[j_local];
1087 rA(i_global, j_global) += rLHS_Contribution(i_local, j_local);
1098 unsigned int local_size = rRHS_Contribution.size();
1102 for (
unsigned int i_local = 0; i_local <
local_size; i_local++)
1104 const unsigned int i_global = rEquationId[i_local];
1109 double& b_value = rb[i_global];
1110 const double& rhs_value = rRHS_Contribution[i_local];
1113 b_value += rhs_value;
1120 for (
unsigned int i_local = 0; i_local <
local_size; i_local++)
1122 const unsigned int i_global = rEquationId[i_local];
1127 double& b_value = rb[i_global];
1128 const double& rhs_value = rRHS_Contribution[i_local];
1131 b_value += rhs_value;
1136 const double& rhs_value = rRHS_Contribution[i_local];
1139 b_value += rhs_value;
1151 ,std::vector< omp_lock_t >& lock_array
1155 unsigned int local_size = rLHS_Contribution.size1();
1157 for (
unsigned int i_local = 0; i_local <
local_size; i_local++)
1159 unsigned int i_global = rEquationId[i_local];
1164 omp_set_lock(&lock_array[i_global]);
1166 rb[i_global] += rRHS_Contribution(i_local);
1167 for (
unsigned int j_local = 0; j_local <
local_size; j_local++)
1169 unsigned int j_global = rEquationId[j_local];
1172 rA(i_global, j_global) += rLHS_Contribution(i_local, j_local);
1176 omp_unset_lock(&lock_array[i_global]);
1215 inline void AddUnique(std::vector<std::size_t>&
v,
const std::size_t& candidate)
1217 std::vector<std::size_t>::iterator
i =
v.begin();
1218 std::vector<std::size_t>::iterator endit =
v.end();
1219 while (
i != endit && (*
i) != candidate)
1225 v.push_back(candidate);
virtual int MyPID() const
Definition: communicator.cpp:91
Dof represents a degree of freedom (DoF).
Definition: dof.h:86
const VariableData & GetVariable() const
Definition: dof.h:303
IndexType Id() const
Definition: dof.h:292
std::vector< DofType::Pointer > DofsVectorType
Definition: element.h:100
std::vector< std::size_t > EquationIdVectorType
Definition: element.h:98
void Set(const Flags ThisFlag)
Definition: flags.cpp:33
bool IsDefined(Flags const &rOther) const
Definition: flags.h:279
bool Is(Flags const &rOther) const
Definition: flags.h:274
bool IsNot(Flags const &rOther) const
Definition: flags.h:291
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
ElementIterator ElementsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1169
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
ConditionIterator ConditionsBegin(IndexType ThisIndex=0)
Definition: model_part.h:1361
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
Communicator & GetCommunicator()
Definition: model_part.h:1821
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
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
static int ThisThread()
Wrapper for omp_get_thread_num().
Definition: openmp_utils.h:108
static int GetNumThreads()
Returns the current number of threads.
Definition: parallel_utilities.cpp:34
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: pointer_vector_set.h:95
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 Sort()
Sort the elements in the set.
Definition: pointer_vector_set.h:753
void push_back(TPointerType x)
Adds a pointer to the end of the set.
Definition: pointer_vector_set.h:544
iterator begin()
Returns an iterator pointing to the beginning of the container.
Definition: pointer_vector_set.h:278
void reserve(int reservedsize)
Reserves memory for a specified number of elements.
Definition: pointer_vector_set.h:733
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: reduction_builder_and_solver.hpp:55
void SetUpSystemMatrices(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixPointerType &pA, SystemVectorPointerType &pDx, SystemVectorPointerType &pb) override
Resizes and Initializes the system vectors and matrices after SetUpDofSet and SetUpSytem has been cal...
Definition: reduction_builder_and_solver.hpp:693
void BuildRHS(SchemePointerType pScheme, ModelPart &rModelPart, SystemVectorType &rb) override
Function to perform the build of the RHS.
Definition: reduction_builder_and_solver.hpp:187
BaseType::Pointer BasePointerType
Definition: reduction_builder_and_solver.hpp:64
void BuildRHSAndSolve(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixType &rA, SystemVectorType &rDx, SystemVectorType &rb) override
Function to perform the building of the RHS and solving phase at the same time.
Definition: reduction_builder_and_solver.hpp:455
ModelPart::ElementsContainerType ElementsContainerType
Definition: reduction_builder_and_solver.hpp:77
int Check(ModelPart &rModelPart) override
Definition: reduction_builder_and_solver.hpp:861
void BuildAndSolve(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixType &rA, SystemVectorType &rDx, SystemVectorType &rb) override
Function to perform the building and solving phase at the same time.
Definition: reduction_builder_and_solver.hpp:409
KRATOS_CLASS_POINTER_DEFINITION(ReductionBuilderAndSolver)
Pointer definition of ReductionBuilderAndSolver.
ModelPart::ConditionsContainerType ConditionsContainerType
Definition: reduction_builder_and_solver.hpp:78
void ApplyDirichletConditions(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixType &rA, SystemVectorType &rDx, SystemVectorType &rb) override
applies the dirichlet conditions.
Definition: reduction_builder_and_solver.hpp:477
void Clear() override
This function is intended to be called at the end of the solution step to clean up memory storage not...
Definition: reduction_builder_and_solver.hpp:841
~ReductionBuilderAndSolver() override
Destructor.
Definition: reduction_builder_and_solver.hpp:113
BaseType::SystemVectorType SystemVectorType
Definition: reduction_builder_and_solver.hpp:70
void SystemSolve(SystemMatrixType &rA, SystemVectorType &rDx, SystemVectorType &rb) override
This is a call to the linear system solver.
Definition: reduction_builder_and_solver.hpp:375
void Assemble(SystemMatrixType &rA, SystemVectorType &rb, const LocalSystemMatrixType &rLHS_Contribution, const LocalSystemVectorType &rRHS_Contribution, const Element::EquationIdVectorType &rEquationId)
Definition: reduction_builder_and_solver.hpp:1145
void SystemSolveWithPhysics(SystemMatrixType &rA, SystemVectorType &rDx, SystemVectorType &rb, ModelPart &rModelPart)
Definition: reduction_builder_and_solver.hpp:906
BaseType::LocalFlagType LocalFlagType
Definition: reduction_builder_and_solver.hpp:66
void BuildLHS(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixType &rA) override
Function to perform the building of the LHS,.
Definition: reduction_builder_and_solver.hpp:130
ModelPart::NodesContainerType NodesContainerType
Definition: reduction_builder_and_solver.hpp:76
BaseType::LinearSolverPointerType LinearSolverPointerType
Definition: reduction_builder_and_solver.hpp:81
BaseType::SchemePointerType SchemePointerType
Definition: reduction_builder_and_solver.hpp:80
void AssembleLHS(SystemMatrixType &rA, LocalSystemMatrixType &rLHS_Contribution, Element::EquationIdVectorType &rEquationId)
Definition: reduction_builder_and_solver.hpp:1072
BaseType::SystemMatrixType SystemMatrixType
Definition: reduction_builder_and_solver.hpp:69
BaseType::SystemVectorPointerType SystemVectorPointerType
Definition: reduction_builder_and_solver.hpp:72
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: reduction_builder_and_solver.hpp:73
ReductionBuilderAndSolver(LinearSolverPointerType pLinearSystemSolver)
Default Constructor.
Definition: reduction_builder_and_solver.hpp:107
void CalculateReactions(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixType &rA, SystemVectorType &rDx, SystemVectorType &rb) override
Calculates system reactions.
Definition: reduction_builder_and_solver.hpp:812
void SetUpDofSet(SchemePointerType pScheme, ModelPart &rModelPart) override
Builds the list of the DofSets involved in the problem by "asking" to each element and condition its ...
Definition: reduction_builder_and_solver.hpp:489
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: reduction_builder_and_solver.hpp:74
void SetUpSystem() override
organises the dofset in order to speed up the building phase
Definition: reduction_builder_and_solver.hpp:668
void Build(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixType &rA, SystemVectorType &rb) override
Function to perform the build of the RHS.
Definition: reduction_builder_and_solver.hpp:270
void AssembleRHS(SystemVectorType &rb, const LocalSystemVectorType &rRHS_Contribution, const Element::EquationIdVectorType &rEquationId)
Definition: reduction_builder_and_solver.hpp:1094
virtual void ConstructMatrixStructure(SchemePointerType pScheme, SystemMatrixType &rA, ElementsContainerType &rElements, ConditionsContainerType &rConditions, ProcessInfo &rCurrentProcessInfo)
Definition: reduction_builder_and_solver.hpp:944
void FinalizeSolutionStep(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixPointerType &pA, SystemVectorPointerType &pDx, SystemVectorPointerType &pb) override
Performs all the required operations that should be done (for each step) after solving the solution s...
Definition: reduction_builder_and_solver.hpp:794
void InitializeSolutionStep(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixPointerType &pA, SystemVectorPointerType &pDx, SystemVectorPointerType &pb) override
Performs all the required operations that should be done (for each step) before solving the solution ...
Definition: reduction_builder_and_solver.hpp:762
BaseType::SystemMatrixPointerType SystemMatrixPointerType
Definition: reduction_builder_and_solver.hpp:71
BaseType::DofsArrayType DofsArrayType
Definition: reduction_builder_and_solver.hpp:67
SolutionBuilderAndSolver< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Definition: reduction_builder_and_solver.hpp:63
Solution Buider and Solver base class.
Definition: solution_builder_and_solver.hpp:63
unsigned int mEquationSystemSize
Definition: solution_builder_and_solver.hpp:479
virtual void Clear()
This function is intended to be called at the end of the solution step to clean up memory storage not...
Definition: solution_builder_and_solver.hpp:305
TSparseSpace::MatrixPointerType SystemMatrixPointerType
Definition: solution_builder_and_solver.hpp:78
SystemVectorPointerType mpReactionsVector
Definition: solution_builder_and_solver.hpp:485
TSparseSpace::VectorType SystemVectorType
Definition: solution_builder_and_solver.hpp:76
TDenseSpace::VectorType LocalSystemVectorType
Definition: solution_builder_and_solver.hpp:82
TSparseSpace::MatrixType SystemMatrixType
Definition: solution_builder_and_solver.hpp:75
Flags mOptions
Definition: solution_builder_and_solver.hpp:476
virtual void FinalizeSolutionStep(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixPointerType &pA, SystemVectorPointerType &pDx, SystemVectorPointerType &pb)
Performs all the required operations that should be done (for each step) after solving the solution s...
Definition: solution_builder_and_solver.hpp:281
virtual void InitializeSolutionStep(SchemePointerType pScheme, ModelPart &rModelPart, SystemMatrixPointerType &pA, SystemVectorPointerType &pDx, SystemVectorPointerType &pb)
Performs all the required operations that should be done (for each step) before solving the solution ...
Definition: solution_builder_and_solver.hpp:269
DofsArrayType mDofSet
Definition: solution_builder_and_solver.hpp:473
TDenseSpace::MatrixType LocalSystemMatrixType
Definition: solution_builder_and_solver.hpp:81
TLinearSolver::Pointer LinearSolverPointerType
Definition: solution_builder_and_solver.hpp:87
virtual int GetEchoLevel()
Definition: solution_builder_and_solver.hpp:395
TSparseSpace::VectorPointerType SystemVectorPointerType
Definition: solution_builder_and_solver.hpp:79
LinearSolverPointerType mpLinearSystemSolver
Definition: solution_builder_and_solver.hpp:470
int mEchoLevel
Definition: solution_builder_and_solver.hpp:482
SchemeType::Pointer SchemePointerType
Definition: solution_builder_and_solver.hpp:85
Solver local flags class definition.
Definition: solution_local_flags.hpp:48
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR
Definition: exception.h:161
void HashCombine(HashType &Seed, const TClassType &Value)
This method creates an "unique" hash for the input value.
Definition: key_hash.h:56
#define KRATOS_INFO(label)
Definition: logger.h:250
#define KRATOS_WARNING(label)
Definition: logger.h:265
int seed
Definition: GenerateWind.py:138
double TwoNorm(SparseSpaceType &dummy, SparseSpaceType::VectorType &x)
Definition: add_strategies_to_python.cpp:164
TSpaceType::IndexType Size(TSpaceType &dummy, typename TSpaceType::VectorType const &rV)
Definition: add_strategies_to_python.cpp:111
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
v
Definition: generate_convection_diffusion_explicit_element.py:114
int local_size
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:17
int k
Definition: quadrature.py:595
integer i
Definition: TensorModule.f:17
Definition: reduction_builder_and_solver.hpp:95
size_t operator()(const Node::DofType::Pointer &it1, const Node::DofType::Pointer &it2) const
Definition: reduction_builder_and_solver.hpp:96
Definition: reduction_builder_and_solver.hpp:84
size_t operator()(const Node::DofType::Pointer &it) const
Definition: reduction_builder_and_solver.hpp:85