dune-pdelab 2.7-git
Loading...
Searching...
No Matches
pattern.hh
Go to the documentation of this file.
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=8 sw=2 sts=2:
3#ifndef DUNE_PDELAB_LOCALOPERATOR_PATTERN_HH
4#define DUNE_PDELAB_LOCALOPERATOR_PATTERN_HH
5
6#include<dune/common/exceptions.hh>
7#include <dune/common/fvector.hh>
8
9namespace Dune {
10 namespace PDELab {
11
14 {
15 public:
16
17 // define sparsity pattern of operator representation
18 template<typename LFSU, typename LFSV, typename LocalPattern>
19 void pattern_volume (const LFSU& lfsu, const LFSV& lfsv,
20 LocalPattern& pattern) const
21 {
22 for (size_t i=0; i<lfsv.size(); ++i)
23 for (size_t j=0; j<lfsu.size(); ++j)
24 pattern.addLink(lfsv,i,lfsu,j);
25 }
26 };
27
30 {
31 public:
32
33 // define sparsity pattern connecting self and neighbor dofs
34 template<typename LFSU, typename LFSV, typename LocalPattern>
35 void pattern_skeleton (const LFSU& lfsu_s, const LFSV& lfsv_s, const LFSU& lfsu_n, const LFSV& lfsv_n,
36 LocalPattern& pattern_sn,
37 LocalPattern& pattern_ns) const
38 {
39 for (unsigned int i=0; i<lfsv_s.size(); ++i)
40 for (unsigned int j=0; j<lfsu_n.size(); ++j)
41 pattern_sn.addLink(lfsv_s,i,lfsu_n,j);
42
43 for (unsigned int i=0; i<lfsv_n.size(); ++i)
44 for (unsigned int j=0; j<lfsu_s.size(); ++j)
45 pattern_ns.addLink(lfsv_n,i,lfsu_s,j);
46 }
47 };
48
51 {
52 public:
53
54 // define sparsity pattern connecting dofs on boundary elements
55 template<typename LFSU, typename LFSV, typename LocalPattern>
56 void pattern_boundary(const LFSU& lfsu_s, const LFSV& lfsv_s,
57 LocalPattern& pattern_ss) const
58 {
59 for (unsigned int i=0; i<lfsv_s.size(); ++i)
60 for (unsigned int j=0; j<lfsu_s.size(); ++j)
61 pattern_ss.addLink(lfsv_s,i,lfsu_s,j);
62 }
63 };
64
66 } // namespace PDELab
67} // namespace Dune
68
69#endif // DUNE_PDELAB_LOCALOPERATOR_PATTERN_HH
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
sparsity pattern generator
Definition: pattern.hh:14
void pattern_volume(const LFSU &lfsu, const LFSV &lfsv, LocalPattern &pattern) const
Definition: pattern.hh:19
sparsity pattern generator
Definition: pattern.hh:30
void pattern_skeleton(const LFSU &lfsu_s, const LFSV &lfsv_s, const LFSU &lfsu_n, const LFSV &lfsv_n, LocalPattern &pattern_sn, LocalPattern &pattern_ns) const
Definition: pattern.hh:35
sparsity pattern generator
Definition: pattern.hh:51
void pattern_boundary(const LFSU &lfsu_s, const LFSV &lfsv_s, LocalPattern &pattern_ss) const
Definition: pattern.hh:56