14 #ifndef KRATOS_RESIDUALBASED_BLOCK_BUILDER_AND_SOLVER_PERIODIC_H
15 #define KRATOS_RESIDUALBASED_BLOCK_BUILDER_AND_SOLVER_PERIODIC_H
25 #include "boost/smart_ptr.hpp"
63 template<
class TSparseSpace,
112 mPeriodicIdVar(PeriodicVariable)
135 unsigned int EqId = 0;
139 auto& r_geometry = itCond->GetGeometry();
140 if (itCond->Is(PERIODIC) && (r_geometry.PointsNumber() == 4 || r_geometry.PointsNumber() == 8)) {
141 r_geometry[0].GetSolutionStepValue(mPeriodicIdVar) = 0;
147 if ( itDof->GetSolutionStepValue(mPeriodicIdVar) <
static_cast<int>(itDof->Id()) )
148 itDof->SetEquationId(EqId++);
153 auto& r_geometry = itCond->GetGeometry();
154 if (itCond->Is(PERIODIC) && (r_geometry.PointsNumber() == 4 || r_geometry.PointsNumber() == 8)) {
155 r_geometry[0].GetSolutionStepValue(mPeriodicIdVar) = r_geometry[1].GetSolutionStepValue(mPeriodicIdVar);
164 if (itCond->Is(PERIODIC)) {
166 int Node0 = rGeom[0].
Id();
167 int Node0Pair = rGeom[0].FastGetSolutionStepValue(mPeriodicIdVar);
169 int Node1 = rGeom[1].
Id();
170 int Node1Pair = rGeom[1].FastGetSolutionStepValue(mPeriodicIdVar);
173 if ( ( Node0 == Node1Pair ) && ( Node1 == Node0Pair ) ) {
174 if ( Node0 < Node0Pair )
175 CopyEquationId(rGeom[1],rGeom[0]);
177 CopyEquationId(rGeom[0],rGeom[1]);
182 CopyEquationId(rGeom[0],rGeom[
i]);
197 double* Avalues =
A.value_data().begin();
198 std::size_t* Arow_indices =
A.index1_data().begin();
199 std::size_t* Acol_indices =
A.index2_data().begin();
203 if (itDof->IsFixed())
205 std::size_t RowId = itDof->EquationId();
206 std::size_t RowBegin = Arow_indices[RowId];
207 std::size_t RowEnd = Arow_indices[RowId+1];
209 for (std::size_t
k = RowBegin;
k != RowEnd;
k++)
211 if ( Acol_indices[
k] == RowId )
301 for (
auto itDof = rOrigin.
GetDofs().begin(); itDof != rOrigin.
GetDofs().end(); itDof++)
TSparseSpace::VectorType TSystemVectorType
Definition of the vector size.
Definition: builder_and_solver.h:85
ModelPart::NodesContainerType NodesArrayType
The containers of the entities.
Definition: builder_and_solver.h:109
TSparseSpace::MatrixType TSystemMatrixType
Definition of the sparse matrix.
Definition: builder_and_solver.h:82
ModelPart::ConditionsContainerType ConditionsArrayType
Definition: builder_and_solver.h:111
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
unsigned int mEquationSystemSize
Flag taking in account if it is needed or not to calculate the reactions.
Definition: builder_and_solver.h:747
ModelPart::ElementsContainerType ElementsArrayType
Definition: builder_and_solver.h:110
void SetEquationId(EquationIdType NewEquationId)
Definition: dof.h:331
Geometry base class.
Definition: geometry.h:71
SizeType PointsNumber() const
Definition: geometry.h:528
IndexType const & Id() const
Id of this Geometry.
Definition: geometry.h:964
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
MeshType::ConditionIterator ConditionIterator
Definition: model_part.h:189
ConditionIterator ConditionsEnd(IndexType ThisIndex=0)
Definition: model_part.h:1371
This class defines the node.
Definition: node.h:65
DofsContainerType & GetDofs()
Definition: node.h:694
DofType::Pointer pGetDof(TVariableType const &rDofVariable) const
Get DoF counted pointer for a given variable.
Definition: node.h:711
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
iterator end()
Returns an iterator pointing to the end of the container.
Definition: pointer_vector_set.h:314
Current class provides an implementation for standard builder and solving operations.
Definition: residualbased_block_builder_and_solver.h:82
Definition: residualbased_block_builder_and_solver_periodic.h:69
BaseType::ConditionsArrayType ConditionsArrayType
Definition: residualbased_block_builder_and_solver_periodic.h:98
BaseType::ElementsArrayType ElementsArrayType
Definition: residualbased_block_builder_and_solver_periodic.h:97
BaseType::TSystemVectorPointerType TSystemVectorPointerType
Definition: residualbased_block_builder_and_solver_periodic.h:94
ResidualBasedBlockBuilderAndSolverPeriodic(typename TLinearSolver::Pointer pNewLinearSystemSolver, const Variable< int > &PeriodicVariable)
Definition: residualbased_block_builder_and_solver_periodic.h:109
BaseType::TSystemMatrixType TSystemMatrixType
Definition: residualbased_block_builder_and_solver_periodic.h:85
KRATOS_CLASS_POINTER_DEFINITION(ResidualBasedBlockBuilderAndSolverPeriodic)
BaseType::TSystemMatrixPointerType TSystemMatrixPointerType
Definition: residualbased_block_builder_and_solver_periodic.h:93
BaseType::DofsArrayType DofsArrayType
Definition: residualbased_block_builder_and_solver_periodic.h:83
BaseType::TDataType TDataType
Definition: residualbased_block_builder_and_solver_periodic.h:81
~ResidualBasedBlockBuilderAndSolverPeriodic() override
Definition: residualbased_block_builder_and_solver_periodic.h:117
BaseType::LocalSystemVectorType LocalSystemVectorType
Definition: residualbased_block_builder_and_solver_periodic.h:89
void SetUpSystem(ModelPart &r_model_part) override
Organises the dofset in order to speed up the building phase.
Definition: residualbased_block_builder_and_solver_periodic.h:132
BaseType::LocalSystemMatrixType LocalSystemMatrixType
Definition: residualbased_block_builder_and_solver_periodic.h:91
BaseType::TSystemVectorType TSystemVectorType
Definition: residualbased_block_builder_and_solver_periodic.h:87
BaseType::TSchemeType TSchemeType
Definition: residualbased_block_builder_and_solver_periodic.h:79
BaseType::ElementsContainerType ElementsContainerType
Definition: residualbased_block_builder_and_solver_periodic.h:100
ResidualBasedBlockBuilderAndSolver< TSparseSpace, TDenseSpace, TLinearSolver > BaseType
Definition: residualbased_block_builder_and_solver_periodic.h:77
void ApplyDirichletConditions(typename TSchemeType::Pointer pScheme, ModelPart &r_model_part, TSystemMatrixType &A, TSystemVectorType &Dx, TSystemVectorType &b) override
Applies the dirichlet conditions. This operation may be very heavy or completely unexpensive dependin...
Definition: residualbased_block_builder_and_solver_periodic.h:191
BaseType::NodesArrayType NodesArrayType
Definition: residualbased_block_builder_and_solver_periodic.h:96
This class provides the implementation of the basic tasks that are needed by the solution strategy.
Definition: scheme.h:56
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
A
Definition: sensitivityMatrix.py:70
integer i
Definition: TensorModule.f:17