33 #ifndef __H__LIB_ALGEBRA__OPERATOR__INTERFACE__CONSTRAINED_LINEAR_ITERATOR__
34 #define __H__LIB_ALGEBRA__OPERATOR__INTERFACE__CONSTRAINED_LINEAR_ITERATOR__
42 #include <boost/core/enable_if.hpp>
43 #include <boost/type_traits/is_base_of.hpp>
63 template <
typename TDomain,
typename TAlgebra,
typename TLinIt,
typename =
void>
95 virtual const char*
name()
const
113 if (!base_type::apply(c, d))
return false;
117 UG_THROW(
"Domain discretization passed to ConstrainedLinearIterator is not valid.\n"
118 "Cannot apply any constraints.")
126 for (
size_t i = 0; i < nConstr; i++)
131 for (
size_t i = 0; i < nConstr; i++)
136 for (
size_t i = 0; i < nConstr; i++)
141 for (
size_t i = 0; i < nConstr; i++)
145 else UG_THROW(
"Vector is not a grid function. This is not supported.")
157 template <
typename S,
typename =
void>
178 if (!
cli.base_type::apply_update_defect(c, d))
return false;
182 UG_THROW(
"Domain discretization passed to ConstrainedLinearIterator is not valid.\n"
183 "Cannot apply any constraints.")
192 for (
size_t i = 0; i < nConstr; i++)
197 for (
size_t i = 0; i < nConstr; i++)
202 for (
size_t i = 0; i < nConstr; i++)
207 for (
size_t i = 0; i < nConstr; i++)
213 for (
size_t i = 0; i < nConstr; i++)
218 for (
size_t i = 0; i < nConstr; i++)
223 for (
size_t i = 0; i < nConstr; i++)
228 else UG_THROW(
"Vector is not a grid function. This is not supported.")
236 template <
typename S>
250 cli.m_spDefectOperator->apply_sub(d, c);
256 friend struct apply_update_defect_impl<TLinIt>;
263 return base_type::supports_parallel();
location name
Definition: checkpoint_util.lua:128
Definition: smart_pointer.h:108
Definition: constrained_linear_iterator.h:65
virtual bool init(SmartPtr< ILinearOperator< vector_type, vector_type > > J, const vector_type &u)
Definition: constrained_linear_iterator.h:100
ConstrainedLinearIterator(const ConstrainedLinearIterator< TDomain, TAlgebra, TLinIt > &parent)
clone constructor
Definition: constrained_linear_iterator.h:80
virtual const char * name() const
returns the name of iterator
Definition: constrained_linear_iterator.h:95
GridFunction< TDomain, TAlgebra > gf_type
Definition: constrained_linear_iterator.h:67
virtual bool supports_parallel() const
returns if parallel solving is supported
Definition: constrained_linear_iterator.h:261
virtual bool init(SmartPtr< ILinearOperator< vector_type, vector_type > > L)
Definition: constrained_linear_iterator.h:105
SmartPtr< ILinearIterator< vector_type > > m_spLinIt
Definition: constrained_linear_iterator.h:270
TLinIt base_type
Definition: constrained_linear_iterator.h:69
virtual bool apply(vector_type &c, const vector_type &d)
Definition: constrained_linear_iterator.h:110
virtual ~ConstrainedLinearIterator()
destructor
Definition: constrained_linear_iterator.h:91
TAlgebra::vector_type vector_type
Definition: constrained_linear_iterator.h:68
number m_time
Definition: constrained_linear_iterator.h:275
SmartPtr< IDomainDiscretization< TAlgebra > > m_spDomDisc
Definition: constrained_linear_iterator.h:274
virtual bool apply_update_defect(vector_type &c, vector_type &d)
Definition: constrained_linear_iterator.h:150
void set_time(number time)
setter for time
Definition: constrained_linear_iterator.h:267
ConstrainedLinearIterator(SmartPtr< IDomainDiscretization< TAlgebra > > domDisc)
constructor
Definition: constrained_linear_iterator.h:75
virtual SmartPtr< ILinearIterator< vector_type > > clone()
clone
Definition: constrained_linear_iterator.h:85
represents numerical solutions on a grid using an algebraic vector
Definition: grid_function.h:121
SmartPtr< DoFDistribution > dof_distribution()
Definition: grid_function.h:236
Interface for domain discretization.
Definition: domain_disc_interface.h:136
describes a linear mapping X->Y
Definition: linear_operator.h:80
#define UG_THROW(msg)
Definition: error.h:57
double number
Definition: types.h:124
Definition: boost_serialization_routines.h:49
@ CT_DIRICHLET
Definition: ass_tuner.h:59
@ CT_HANGING
Definition: ass_tuner.h:57
@ CT_CONSTRAINTS
Definition: ass_tuner.h:58
SmartPtr< T, FreePolicy > make_sp(T *inst)
returns a SmartPtr for the passed raw pointer
Definition: smart_pointer.h:836
apply_update_defect_impl(ConstrainedLinearIterator &_cli)
Definition: constrained_linear_iterator.h:241
ConstrainedLinearIterator & cli
Definition: constrained_linear_iterator.h:239
bool operator()(vector_type &c, vector_type &d)
Definition: constrained_linear_iterator.h:244
Definition: constrained_linear_iterator.h:159
ConstrainedLinearIterator & cli
Definition: constrained_linear_iterator.h:160
apply_update_defect_impl(ConstrainedLinearIterator &_cli)
Definition: constrained_linear_iterator.h:162
bool operator()(vector_type &c, vector_type &d)
Definition: constrained_linear_iterator.h:165