33#ifndef __H__UG__LIB_ALGEBRA__OPERATOR__PRECONDITIONER__PROJECTED_GAUSS_SEIDEL__SCALAR_OBSTACLE_IMPL__
34#define __H__UG__LIB_ALGEBRA__OPERATOR__PRECONDITIONER__PROJECTED_GAUSS_SEIDEL__SCALAR_OBSTACLE_IMPL__
44template <
typename TDomain,
typename TAlgebra>
50 const size_t comp = dof[1];
56 const number obsVal = m_mObstacleValues[dof];
59 if (!(tmpSol > obsVal))
62 m_vActiveDofs.push_back(dof);
71template <
typename TDomain,
typename TAlgebra>
76 for (std::vector<
MultiIndex<2> >::iterator itActiveInd = m_vActiveDofs.begin();
77 itActiveInd < m_vActiveDofs.end(); ++itActiveInd)
83 BlockRef(d[(*itActiveInd)[0]], (*itActiveInd)[1]) = 0.0;
87template <
typename TDomain,
typename TAlgebra>
97template <
typename TDomain,
typename TAlgebra>
103 const size_t comp = dof[1];
109 const number obsVal = m_mObstacleValues[dof];
112 if (!(tmpSol < obsVal))
115 m_vActiveDofs.push_back(dof);
125template <
typename TDomain,
typename TAlgebra>
130 for (std::vector<
MultiIndex<2> >::iterator itActiveInd = m_vActiveDofs.begin();
131 itActiveInd < m_vActiveDofs.end(); ++itActiveInd)
136 number defect =
BlockRef(d[(*itActiveInd)[0]], (*itActiveInd)[1]);
140 BlockRef(d[(*itActiveInd)[0]], (*itActiveInd)[1]) = 0.0;
145template <
typename TDomain,
typename TAlgebra>
Definition multi_index.h:50
vector_type::value_type value_type
Value type.
Definition scalar_obstacle.h:77
algebra_type::vector_type vector_type
Vector type.
Definition scalar_obstacle.h:74
void restrict_obs_values()
restricts the obstacle values to a coarser grid in a multigrid hierarchy
Definition scalar_obstacle_impl.h:90
void adjust_defect_to_constraint(vector_type &d)
the defect needs to be adjusted for the active indices (those indices, which are in contact)
Definition scalar_obstacle_impl.h:74
void adjust_sol_and_cor(value_type &sol_i, value_type &c_i, bool &dofIsActive, const DoFIndex &dof)
projects the i-th index of the solution onto the admissible set and adjusts the correction
Definition scalar_obstacle_impl.h:47
vector_type::value_type value_type
Value type.
Definition scalar_obstacle.h:128
algebra_type::vector_type vector_type
Vector type.
Definition scalar_obstacle.h:125
void adjust_defect_to_constraint(vector_type &d)
the defect needs to be adjusted for the active indices (those indices, which are in contact)
Definition scalar_obstacle_impl.h:128
void restrict_obs_values()
restricts the obstacle values to a coarser grid in a multigrid hierarchy
Definition scalar_obstacle_impl.h:148
void adjust_sol_and_cor(value_type &sol_i, value_type &c_i, bool &dofIsActive, const DoFIndex &dof)
projects the i-th index of the solution onto the admissible set and adjusts the correction
Definition scalar_obstacle_impl.h:100
double number
Definition types.h:124
double & BlockRef(T &vec, size_t i)
Definition blocks.h:66