42 template <
class Index>
45 template <
class Scalar,
class Index>
46 std::vector<NumaBCRSMatrix<Dune::FieldMatrix<Scalar,1,1>,Index>>
48 std::vector<std::vector<Index>>
const& subIndices,
49 Scalar tolerance,
int maxIter);
62 template <
class Scalar,
int m,
class Index>
63 std::tuple< std::vector<NumaBCRSMatrix<Dune::FieldMatrix<Scalar,m,m>,Index>>,
64 std::vector<Dune::BlockVector<Dune::FieldVector<Scalar,m>>>,
65 std::vector<std::vector<Index>>,
66 std::vector<std::vector<LocalDof>> >
69 Scalar tolerance=1000*std::numeric_limits<Scalar>::epsilon(),
77 auto& timer = tsec.
timer();
78 timer.
start(
"partitioning");
80 assert(A.N() == A.M());
82 timer.stop(
"partitioning");
84 timer.start(
"rhs decomposition");
85 std::vector<std::vector<LocalDof>> localDofs(A.N());
86 for (
int k=0; k<n; ++k)
87 for (
int iloc=0; iloc<subIndices[k].size(); ++iloc)
89 Index iglob = subIndices[k][iloc];
90 localDofs[iglob].push_back({k,iloc});
92 timer.stop(
"rhs decomposition");
94 std::vector<Matrix> As;
98 assert(
"needs to be implemented"==0);
100 std::vector<Vector> Fs(n);
101 for (
int k=0; k<n; ++k)
103 Fs[k].resize(subIndices[k].size());
104 for (Index i=0; i<subIndices[k].size(); ++i)
106 Index iglob = subIndices[k][i];
107 int nsub = localDofs[iglob].size();
108 Fs[k][i] = f[iglob] / nsub;
114 localDofs.erase(std::remove_if(begin(localDofs),end(localDofs),
115 [](
auto const& lds) {
return lds.size() <= 1; }),
118 return std::tuple(As,Fs,subIndices,localDofs);
Basic components for (potentially distributed) Balanced Domain Decomposition with Constraints precond...
A NUMA-aware compressed row storage matrix adhering mostly to the Dune ISTL interface (to complete....
A NUMA-aware compressed row storage sparsity pattern.
A scope guard object that automatically closes a timing section on destruction.
Timings & timer()
Returns the used timer.
struct Times const * start(std::string const &name)
Starts or continues the timing of given section.
std::tuple< std::vector< NumaBCRSMatrix< Dune::FieldMatrix< Scalar, m, m >, Index > >, std::vector< Dune::BlockVector< Dune::FieldVector< Scalar, m > > >, std::vector< std::vector< Index > >, std::vector< std::vector< LocalDof > > > matrixDomainDecommposition(NumaBCRSMatrix< Dune::FieldMatrix< Scalar, m, m >, Index > const &A, Dune::BlockVector< Dune::FieldVector< Scalar, m > > const &f, int n, Scalar tolerance=1000 *std::numeric_limits< Scalar >::epsilon(), int maxIter=100)
std::vector< std::vector< Index > > algebraicDomainDecomposition(NumaCRSPattern< Index > const &A, int n)
Creates a decomposition of indices into overlapping subsets that can be used for constructing nonover...
std::vector< NumaBCRSMatrix< Dune::FieldMatrix< Scalar, 1, 1 >, Index > > algebraicMatrixDecomposition(NumaBCRSMatrix< Dune::FieldMatrix< Scalar, 1, 1 >, Index > const &A, std::vector< std::vector< Index > > const &subIndices, Scalar tolerance, int maxIter)
Dune::FieldVector< Scalar, dim > Vector