|
dune-fem 2.12-git
|
Loading...
Searching...
No Matches
operator/linear/hierarchical.hh
Go to the documentation of this file.
47 struct HierarchicalMatrixChooser< Dof, Hybrid::IndexRange< int, cols >, Hybrid::IndexRange< int, rows > >
53 struct HierarchicalMatrixChooser< Dof, Hybrid::CompositeIndexRange< SD... >, Hybrid::CompositeIndexRange< SR... > >
79 typedef std::common_type_t< typename DomainFunction::DofType, typename RangeFunction::DofType > DofType;
93 typedef typename Impl::HierarchicalMatrixChooser< DofType, typename DomainSpaceType::LocalBlockIndices, typename RangeSpaceType::LocalBlockIndices >::Type MatrixType;
102 Hybrid::forEach( typename RangeSpaceType::LocalBlockIndices(), [ functor, local, global ] ( auto &&i ) {
103 Hybrid::forEach( typename DomainSpaceType::LocalBlockIndices(), [ functor, local, global, i ] ( auto &&j ) {
106 functor( std::make_pair( local.first + i, local.second + j ), std::make_pair( iGlobal, jGlobal ) );
116 HierarchicalLinearOperator ( const std::string &, const DomainSpaceType &domainSpace, const RangeSpaceType &rangeSpace )
135 void addLocalMatrix ( const DomainEntityType &domainEntity, const RangeEntityType &rangeEntity, const LocalMatrix &localMatrix )
138 ThisType::entry( matrix_, global.first, global.second ) += localMatrix[ local.first ][ local.second ];
140 rangeSpace().blockMapper().mapEach( rangeEntity, makePairFunctor( domainSpace().blockMapper(), domainEntity, std::move( f ) ) );
144 void addScaledLocalMatrix ( const DomainEntityType &domainEntity, const RangeEntityType &rangeEntity, const LocalMatrix &localMatrix, const Scalar &scalar )
147 ThisType::entry( matrix_, global.first, global.second ) += scalar * localMatrix[ local.first ][ local.second ];
149 rangeSpace().blockMapper().mapEach( rangeEntity, makePairFunctor( domainSpace().blockMapper(), domainEntity, std::move( f ) ) );
153 void getLocalMatrix ( const DomainEntityType &domainEntity, const RangeEntityType &rangeEntity, LocalMatrix &localMatrix ) const
156 localMatrix[ local.first ][ local.second ] = ThisType::entry( matrix_, global.first, global.second );
158 rangeSpace().blockMapper().mapEach( rangeEntity, makePairFunctor( domainSpace().blockMapper(), domainEntity, std::move( f ) ) );
162 void setLocalMatrix ( const DomainEntityType &domainEntity, const RangeEntityType &rangeEntity, const LocalMatrix &localMatrix )
165 ThisType::entry( matrix_, global.first, global.second ) = localMatrix[ local.first ][ local.second ];
167 rangeSpace().blockMapper().mapEach( rangeEntity, makePairFunctor( domainSpace().blockMapper(), domainEntity, std::move( f ) ) );
186 static std::enable_if_t< sizeof...( C ) == sizeof...( B ) > umv ( const MultiTypeBlockVector< C... > &row, const MultiTypeBlockVector< B... > &u, RangeVector &w )
194 static std::enable_if_t< sizeof...( R ) == sizeof...( B ) > umv ( const MultiTypeBlockMatrix< R... > &matrix, const DomainVector &u, MultiTypeBlockVector< B... > &w )
202 static void umv ( const BCRSMatrix< FieldMatrix< K, m, n >, AM > &matrix, const BlockVector< FieldVector< K, n >, AU > &u, BlockVector< FieldVector< K, m >, AW > &w )
231 static decltype( auto ) entry ( const MultiTypeBlockVector< C... > &row, I i, std::pair< std::size_t, Hybrid::CompositeIndex< component, J, offset, SJ > > j )
233 return entry( row[ std::integral_constant< std::size_t, component >() ], i, std::make_pair( j.first, j.second.subIndex() ) );
237 static decltype( auto ) entry ( MultiTypeBlockVector< C... > &row, I i, std::pair< std::size_t, Hybrid::CompositeIndex< component, J, offset, SJ > > j )
239 return entry( row[ std::integral_constant< std::size_t, component >() ], i, std::make_pair( j.first, j.second.subIndex() ) );
243 static decltype( auto ) entry ( const MultiTypeBlockMatrix< R... > &matrix, std::pair< std::size_t, Hybrid::CompositeIndex< component, I, offset, SI > > i, J j )
245 return entry( matrix[ std::integral_constant< std::size_t, component >() ], std::make_pair( i.first, i.second.subIndex() ), j );
249 static decltype( auto ) entry ( MultiTypeBlockMatrix< R... > &matrix, std::pair< std::size_t, Hybrid::CompositeIndex< component, I, offset, SI > > i, J j )
251 return entry( matrix[ std::integral_constant< std::size_t, component >() ], std::make_pair( i.first, i.second.subIndex() ), j );
255 static const K &entry ( const BCRSMatrix< FieldMatrix< K, m, n >, A > &matrix, std::pair< std::size_t, int > i, std::pair< std::size_t, int > j )
261 static K &entry ( BCRSMatrix< FieldMatrix< K, m, n >, A > &matrix, std::pair< std::size_t, int > i, std::pair< std::size_t, int > j )
iterator end()
iterator begin()
constexpr auto size(const T &t)
constexpr void forEach(Range &&range, F &&f)
void umv(const X &x, Y &y) const
virtual void operator()()=0
#define DUNE_THROW(E,...)
const GlobalIndex & global() const
LocalIndex & local()
typename Overloads::ScalarType< std::decay_t< V > >::type Scalar
STL namespace.
PairFunctor< Mapper, Entity, Functor > makePairFunctor(const Mapper &mapper, const Entity &entity, Functor functor)
Definition operator/matrix/functor.hh:65
DomainFunction DomainFunctionType
type of discrete function in the operator's domain
Definition operator.hh:36
RangeFunction RangeFunctionType
type of discrete function in the operator's range
Definition operator.hh:38
Definition operator/linear/hierarchical.hh:74
const RangeSpaceType & rangeSpace() const
Definition operator/linear/hierarchical.hh:130
void reserve(const Stencil &stencil)
Definition operator/linear/hierarchical.hh:178
MatrixType & exportMatrix() const
Definition operator/linear/hierarchical.hh:132
RangeFunctionType::DiscreteFunctionSpaceType RangeSpaceType
Definition operator/linear/hierarchical.hh:85
void addLocalMatrix(const DomainEntityType &domainEntity, const RangeEntityType &rangeEntity, const LocalMatrix &localMatrix)
Definition operator/linear/hierarchical.hh:135
void unitRow(const I localRow, const double diag=1.0)
Definition operator/linear/hierarchical.hh:172
RangeSpaceType::EntityType RangeEntityType
Definition operator/linear/hierarchical.hh:88
void setLocalMatrix(const DomainEntityType &domainEntity, const RangeEntityType &rangeEntity, const LocalMatrix &localMatrix)
Definition operator/linear/hierarchical.hh:162
Impl::HierarchicalMatrixChooser< DofType, typenameDomainSpaceType::LocalBlockIndices, typenameRangeSpaceType::LocalBlockIndices >::Type MatrixType
Definition operator/linear/hierarchical.hh:93
DomainSpaceType::EntityType DomainEntityType
Definition operator/linear/hierarchical.hh:87
void getLocalMatrix(const DomainEntityType &domainEntity, const RangeEntityType &rangeEntity, LocalMatrix &localMatrix) const
Definition operator/linear/hierarchical.hh:153
BaseType::RangeFunctionType RangeFunctionType
Definition operator/linear/hierarchical.hh:82
DomainFunctionType::DiscreteFunctionSpaceType DomainSpaceType
Definition operator/linear/hierarchical.hh:84
virtual void clear()
Definition operator/linear/hierarchical.hh:170
HierarchicalLinearOperator(const std::string &, const DomainSpaceType &domainSpace, const RangeSpaceType &rangeSpace)
Definition operator/linear/hierarchical.hh:116
void addScaledLocalMatrix(const DomainEntityType &domainEntity, const RangeEntityType &rangeEntity, const LocalMatrix &localMatrix, const Scalar &scalar)
Definition operator/linear/hierarchical.hh:144
MatrixType & matrix()
Definition operator/linear/hierarchical.hh:113
const DomainSpaceType & domainSpace() const
Definition operator/linear/hierarchical.hh:129
std::common_type_t< typename DomainFunction::DofType, typename RangeFunction::DofType > DofType
Definition operator/linear/hierarchical.hh:79
void communicate()
Definition operator/linear/hierarchical.hh:127
BaseType::DomainFunctionType DomainFunctionType
Definition operator/linear/hierarchical.hh:81
T fill(T... args)
T make_pair(T... args)
Legal Statements / Impressum | Hosted by TU Dresden & Uni Heidelberg | Generated by
1.9.8