5#ifndef DUNE_ISTL_MATRIXMARKET_HH
6#define DUNE_ISTL_MATRIXMARKET_HH
24#include <dune/common/exceptions.hh>
25#include <dune/common/fmatrix.hh>
26#include <dune/common/fvector.hh>
27#include <dune/common/hybridutilities.hh>
28#include <dune/common/stdstreams.hh>
29#include <dune/common/simd/simd.hh>
64 namespace MatrixMarketImpl
95 static std::string
str()
176 template<
typename T,
typename A>
181 os<<
"%%MatrixMarket matrix coordinate ";
182 os<<mm_numeric_type<Simd::Scalar<typename Imp::BlockTraits<T>::field_type>>::str()<<
" general"<<std::endl;
186 template<
typename B,
typename A>
191 os<<
"%%MatrixMarket matrix array ";
192 os<<mm_numeric_type<Simd::Scalar<typename Imp::BlockTraits<B>::field_type>>::str()<<
" general"<<std::endl;
196 template<
typename T,
int j>
201 os<<
"%%MatrixMarket matrix array ";
202 os<<mm_numeric_type<T>::str()<<
" general"<<std::endl;
206 template<
typename T,
int i,
int j>
211 os<<
"%%MatrixMarket matrix array ";
212 os<<mm_numeric_type<T>::str()<<
" general"<<std::endl;
227 template<
typename T,
typename A>
231 static_assert(IsNumber<T>::value,
"Only scalar entries are expected here!");
233 static void print(std::ostream& os,
const M&)
235 os<<
"% ISTL_STRUCT blocked ";
236 os<<
"1 1"<<std::endl;
240 template<
typename T,
typename A,
int i>
245 static void print(std::ostream& os,
const M&)
247 os<<
"% ISTL_STRUCT blocked ";
248 os<<i<<
" "<<1<<std::endl;
252 template<
typename T,
typename A>
256 static_assert(IsNumber<T>::value,
"Only scalar entries are expected here!");
258 static void print(std::ostream& os,
const M&)
260 os<<
"% ISTL_STRUCT blocked ";
261 os<<
"1 1"<<std::endl;
265 template<
typename T,
typename A,
int i,
int j>
270 static void print(std::ostream& os,
const M&)
272 os<<
"% ISTL_STRUCT blocked ";
273 os<<i<<
" "<<j<<std::endl;
278 template<
typename T,
int i,
int j>
283 static void print(std::ostream& os,
const M& m)
287 template<
typename T,
int i>
290 typedef FieldVector<T,i>
M;
292 static void print(std::ostream& os,
const M& m)
347 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
362 dverb<<buffer<<std::endl;
364 if(buffer!=
"%%MatrixMarket") {
366 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
377 if(buffer !=
"matrix")
380 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
394 std::transform(buffer.begin(), buffer.end(), buffer.begin(),
401 if(buffer !=
"array")
403 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
410 if(buffer !=
"coordinate")
412 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
418 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
432 std::transform(buffer.begin(), buffer.end(), buffer.begin(),
438 if(buffer !=
"integer")
440 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
449 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
456 if(buffer !=
"complex")
458 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
465 if(buffer !=
"pattern")
467 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
473 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
482 std::transform(buffer.begin(), buffer.end(), buffer.begin(),
488 if(buffer !=
"general")
490 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
497 if(buffer !=
"hermitian")
499 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
505 if(buffer.size()==1) {
506 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
514 if(buffer !=
"symmetric")
516 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
523 if(buffer !=
"skew-symmetric")
525 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
531 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
536 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
539 file.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
545 template<std::
size_t brows, std::
size_t bcols>
546 std::tuple<std::size_t, std::size_t, std::size_t>
549 std::size_t blockrows=rows/brows;
550 std::size_t blockcols=cols/bcols;
551 std::size_t blocksize=brows*bcols;
552 std::size_t blockentries=0;
557 blockentries = entries/blocksize;
break;
559 blockentries = 2*entries/blocksize;
break;
561 blockentries = (2*entries-rows)/blocksize;
break;
563 blockentries = (2*entries-rows)/blocksize;
break;
565 throw Dune::NotImplemented();
567 return std::make_tuple(blockrows, blockcols, blockentries);
646 return is>>data.number;
675 template<
typename D,
int brows,
int bcols>
687 static_assert(IsNumber<T>::value && brows==1 && bcols==1,
"Only scalar entries are expected here!");
688 for (
auto iter=matrix.
begin(); iter!= matrix.
end(); ++iter)
690 auto brow=iter.index();
691 for (
auto siter=rows[brow].begin(); siter != rows[brow].end(); ++siter)
692 (*iter)[siter->index] = siter->number;
705 for (
auto iter=matrix.begin(); iter!= matrix.end(); ++iter)
707 for (
auto brow=iter.index()*brows,
708 browend=iter.index()*brows+brows;
709 brow<browend; ++brow)
711 for (
auto siter=rows[brow].begin(), send=rows[brow].end();
712 siter != send; ++siter)
713 (*iter)[siter->index/bcols][brow%brows][siter->index%bcols]=siter->number;
719 template<
int brows,
int bcols>
733 std::enable_if_t<!is_complex<T>::value, T>
conj(
const T& r){
738 std::enable_if_t<is_complex<T>::value, T>
conj(
const T& r){
746 template<
typename B,
typename A>
755 template<
typename B,
int i,
int j,
typename A>
764 template<
typename T,
typename A,
typename D>
766 std::istream& file, std::size_t entries,
778 std::vector<std::set<IndexData<D> > > rows(matrix.
N()*brows);
780 auto readloop = [&] (
auto symmetryFixup) {
781 for(std::size_t i = 0; i < entries; ++i) {
787 assert(row/bcols<matrix.
N());
789 assert(data.
index/bcols<matrix.
M());
790 rows[row].insert(data);
792 symmetryFixup(row, data);
799 readloop([](
auto...){});
802 readloop([&](
auto row,
auto data) {
804 data_sym.
index = row;
805 rows[data.index].insert(data_sym);
809 readloop([&](
auto row,
auto data) {
811 data_sym.number = -data.number;
812 data_sym.
index = row;
813 rows[data.index].insert(data_sym);
817 readloop([&](
auto row,
auto data) {
819 data_sym.number =
conj(data.number);
820 data_sym.
index = row;
821 rows[data.index].insert(data_sym);
825 DUNE_THROW(Dune::NotImplemented,
826 "Only general, symmetric, skew-symmetric and hermitian is supported right now!");
831 for(
typename Matrix::CreateIterator iter=matrix.
createbegin();
834 for(std::size_t brow=iter.index()*brows, browend=iter.index()*brows+brows;
835 brow<browend; ++brow)
837 typedef typename std::set<IndexData<D> >::const_iterator Siter;
838 for(Siter siter=rows[brow].begin(), send=rows[brow].end();
839 siter != send; ++siter, ++nnz)
840 iter.insert(siter->index/bcols);
849 Setter(rows, matrix);
852 inline std::tuple<std::string, std::string>
splitFilename(
const std::string& filename) {
853 std::size_t lastdot = filename.find_last_of(
".");
854 if(lastdot == std::string::npos)
855 return std::make_tuple(filename,
"");
857 std::string potentialFileExtension = filename.substr(lastdot);
858 if (potentialFileExtension ==
".mm" || potentialFileExtension ==
".mtx")
859 return std::make_tuple(filename.substr(0, lastdot), potentialFileExtension);
861 return std::make_tuple(filename,
"");
875 using namespace MatrixMarketImpl;
877 if(!readMatrixMarketBanner(istr, header)) {
878 std::cerr <<
"First line was not a correct Matrix Market banner. Using default:\n"
879 <<
"%%MatrixMarket matrix coordinate real general"<<std::endl;
882 istr.seekg(0, std::ios::beg);
884 header.
type=array_type;
899 template<
typename T,
typename A>
905 for (
int i=0; size>0; ++i, --size)
906 istr>>Simd::lane(lane,vector[i]);
909 template<
typename T,
typename A,
int entries>
915 for(
int i=0; size>0; ++i, --size) {
918 Simd::lane(lane, vector[i/entries][i%entries])=val;
929 template<
typename T,
typename A>
934 using namespace MatrixMarketImpl;
937 std::size_t rows, cols;
939 if(cols!=Simd::lanes<field_type>()) {
940 if(Simd::lanes<field_type>() == 1)
946 if(header.type!=array_type)
950 if constexpr (Dune::IsNumber<T>())
955 auto blocksize = dummy.size();
956 std::size_t size=rows/blocksize;
957 if(size*blocksize!=rows)
963 istr.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
964 for(
size_t l=0;l<Simd::lanes<field_type>();++l){
975 template<
typename T,
typename A>
979 using namespace MatrixMarketImpl;
983 if(!readMatrixMarketBanner(istr, header)) {
984 std::cerr <<
"First line was not a correct Matrix Market banner. Using default:\n"
985 <<
"%%MatrixMarket matrix coordinate real general"<<std::endl;
988 istr.seekg(0, std::ios::beg);
992 std::size_t rows, cols, entries;
1008 std::size_t nnz, blockrows, blockcols;
1011 constexpr int brows = mm_multipliers<Matrix>::rows;
1012 constexpr int bcols = mm_multipliers<Matrix>::cols;
1014 std::tie(blockrows, blockcols, nnz) = calculateNNZ<brows, bcols>(rows, cols, entries, header);
1016 istr.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
1019 matrix.
setSize(blockrows, blockcols, nnz);
1022 if(header.type==array_type)
1023 DUNE_THROW(Dune::NotImplemented,
"Array format currently not supported for matrices!");
1025 readSparseEntries(matrix, istr, entries, header, NumericWrapper<typename Matrix::field_type>());
1029 template<
typename B>
1035 if constexpr (IsNumber<B>())
1036 ostr << rowidx <<
" " << colidx <<
" " << entry << std::endl;
1039 for (
auto row=entry.begin(); row != entry.end(); ++row, ++rowidx) {
1041 for (
auto col = row->begin();
col != row->end(); ++
col, ++coli)
1042 ostr<< rowidx<<
" "<<coli<<
" "<<*
col<<std::endl;
1048 template<
typename V>
1050 const std::integral_constant<int,1>&,
1053 ostr<<Simd::lane(lane,entry)<<std::endl;
1057 template<
typename V>
1059 const std::integral_constant<int,0>&,
1062 using namespace MatrixMarketImpl;
1065 const int isnumeric = mm_numeric_type<Simd::Scalar<typename V::block_type>>::is_numeric;
1066 typedef typename V::const_iterator VIter;
1068 for(VIter i=vector.begin(); i != vector.end(); ++i)
1071 std::integral_constant<int,isnumeric>(),
1075 template<
typename T,
typename A>
1078 return vector.size();
1081 template<
typename T,
typename A,
int i>
1084 return vector.size()*i;
1088 template<
typename V>
1090 const std::integral_constant<int,0>&)
1092 using namespace MatrixMarketImpl;
1093 typedef typename V::field_type field_type;
1095 ostr<<
countEntries(vector)<<
" "<<Simd::lanes<field_type>()<<std::endl;
1096 const int isnumeric = mm_numeric_type<Simd::Scalar<V>>::is_numeric;
1097 for(
size_t l=0;l<Simd::lanes<field_type>(); ++l){
1103 template<
typename M>
1106 const std::integral_constant<int,1>&)
1112 typedef typename M::const_iterator riterator;
1113 typedef typename M::ConstColIterator citerator;
1114 for(riterator row=matrix.begin(); row != matrix.end(); ++row)
1115 for(citerator
col = row->begin();
col != row->end(); ++
col)
1125 template<
typename M>
1129 using namespace MatrixMarketImpl;
1132 mm_header_printer<M>::print(ostr);
1133 mm_block_structure_header<M>::print(ostr,matrix);
1150 template<
typename M>
1152 std::string filename,
1156 std::string rfilename;
1158 if (extension !=
"") {
1159 rfilename = pureFilename + extension;
1160 file.open(rfilename.c_str());
1162 DUNE_THROW(IOError,
"Could not open file for storage: " << rfilename.c_str());
1166 rfilename = pureFilename +
".mm";
1167 file.open(rfilename.c_str());
1169 DUNE_THROW(IOError,
"Could not open file for storage: " << rfilename.c_str());
1172 file.setf(std::ios::scientific,std::ios::floatfield);
1174 file.precision(prec);
1194 template<
typename M,
typename G,
typename L>
1196 std::string filename,
1198 bool storeIndices=
true,
1205 std::string rfilename;
1207 if (extension !=
"") {
1208 rfilename = pureFilename +
"_" + std::to_string(rank) + extension;
1209 file.open(rfilename.c_str());
1210 dverb<< rfilename <<std::endl;
1212 DUNE_THROW(IOError,
"Could not open file for storage: " << rfilename.c_str());
1216 rfilename = pureFilename +
"_" + std::to_string(rank) +
".mm";
1217 file.open(rfilename.c_str());
1218 dverb<< rfilename <<std::endl;
1220 DUNE_THROW(IOError,
"Could not open file for storage: " << rfilename.c_str());
1222 file.setf(std::ios::scientific,std::ios::floatfield);
1224 file.precision(prec);
1232 rfilename = pureFilename +
"_" + std::to_string(rank) +
".idx";
1233 file.open(rfilename.c_str());
1235 DUNE_THROW(IOError,
"Could not open file for storage: " << rfilename.c_str());
1236 file.setf(std::ios::scientific,std::ios::floatfield);
1238 typedef typename IndexSet::const_iterator Iterator;
1239 for(Iterator iter = comm.
indexSet().begin();
1240 iter != comm.
indexSet().end(); ++iter) {
1241 file << iter->global()<<
" "<<(std::size_t)iter->local()<<
" "
1242 <<(int)iter->local().attribute()<<
" "<<(int)iter->local().isPublic()<<std::endl;
1245 file<<
"neighbours:";
1246 const std::set<int>& neighbours=comm.
remoteIndices().getNeighbours();
1247 typedef std::set<int>::const_iterator SIter;
1248 for(SIter neighbour=neighbours.begin(); neighbour != neighbours.end(); ++neighbour) {
1249 file<<
" "<< *neighbour;
1268 template<
typename M,
typename G,
typename L>
1270 const std::string& filename,
1272 bool readIndices=
true)
1274 using namespace MatrixMarketImpl;
1277 typedef typename LocalIndexT::Attribute Attribute;
1282 std::string rfilename;
1284 if (extension !=
"") {
1285 rfilename = pureFilename +
"_" + std::to_string(rank) + extension;
1286 file.open(rfilename.c_str(), std::ios::in);
1287 dverb<< rfilename <<std::endl;
1289 DUNE_THROW(IOError,
"Could not open file: " << rfilename.c_str());
1293 rfilename = pureFilename +
"_" + std::to_string(rank) +
".mm";
1294 file.open(rfilename.c_str(), std::ios::in);
1296 rfilename = pureFilename +
"_" + std::to_string(rank) +
".mtx";
1297 file.open(rfilename.c_str(), std::ios::in);
1298 dverb<< rfilename <<std::endl;
1300 DUNE_THROW(IOError,
"Could not open file: " << rfilename.c_str());
1311 IndexSet& pis=comm.pis;
1312 rfilename = pureFilename +
"_" + std::to_string(rank) +
".idx";
1313 file.open(rfilename.c_str());
1315 DUNE_THROW(IOError,
"Could not open file: " << rfilename.c_str());
1317 DUNE_THROW(InvalidIndexSetState,
"Index set is not empty!");
1320 while(!file.eof() && file.peek()!=
'n') {
1329 pis.add(g,LocalIndexT(l,Attribute(c),b));
1337 if(s!=
"neighbours:")
1340 while(!file.eof()) {
1346 comm.ri.setNeighbours(nb);
1348 comm.ri.template rebuild<false>();
1363 template<
typename M>
1365 const std::string& filename)
1368 std::string rfilename;
1370 if (extension !=
"") {
1371 rfilename = pureFilename + extension;
1372 file.open(rfilename.c_str());
1374 DUNE_THROW(IOError,
"Could not open file: " << rfilename.c_str());
1378 rfilename = pureFilename +
".mm";
1379 file.open(rfilename.c_str(), std::ios::in);
1381 rfilename = pureFilename +
".mtx";
1382 file.open(rfilename.c_str(), std::ios::in);
1384 DUNE_THROW(IOError,
"Could not open file: " << rfilename.c_str());
This file implements a vector space as a tensor product of a given vector space. The number of compon...
Classes providing communication interfaces for overlapping Schwarz methods.
Some handy generic functions for ISTL matrices.
Implementation of the BCRSMatrix class.
Col col
Definition matrixmatrix.hh:351
auto countNonZeros(const M &, typename std::enable_if_t< Dune::IsNumber< M >::value > *sfinae=nullptr)
Get the number of nonzero fields in the matrix.
Definition matrixutils.hh:119
void readMatrixMarket(Dune::BlockVector< T, A > &vector, std::istream &istr)
Reads a BlockVector from a matrix market file.
Definition matrixmarket.hh:930
void storeMatrixMarket(const M &matrix, std::string filename, int prec=default_precision)
Stores a parallel matrix/vector in matrix market format in a file.
Definition matrixmarket.hh:1151
void loadMatrixMarket(M &matrix, const std::string &filename, OwnerOverlapCopyCommunication< G, L > &comm, bool readIndices=true)
Load a parallel matrix/vector stored in matrix market format.
Definition matrixmarket.hh:1269
std::size_t countEntries(const BlockVector< T, A > &vector)
Definition matrixmarket.hh:1076
void writeMatrixMarket(const V &vector, std::ostream &ostr, const std::integral_constant< int, 0 > &)
Definition matrixmarket.hh:1089
void mm_print_vector_entry(const V &entry, std::ostream &ostr, const std::integral_constant< int, 1 > &, size_t lane)
Definition matrixmarket.hh:1049
static const int default_precision
Definition matrixmarket.hh:1138
void mm_read_vector_entries(Dune::BlockVector< T, A > &vector, std::size_t size, std::istream &istr, size_t lane)
Definition matrixmarket.hh:900
void mm_read_header(std::size_t &rows, std::size_t &cols, MatrixMarketImpl::MMHeader &header, std::istream &istr, bool isVector)
Definition matrixmarket.hh:871
void mm_print_entry(const B &entry, std::size_t rowidx, std::size_t colidx, std::ostream &ostr)
Definition matrixmarket.hh:1030
Definition allocator.hh:11
std::tuple< std::size_t, std::size_t, std::size_t > calculateNNZ(std::size_t rows, std::size_t cols, std::size_t entries, const MMHeader &header)
Definition matrixmarket.hh:547
bool operator<(const IndexData< T > &i1, const IndexData< T > &i2)
LessThan operator.
Definition matrixmarket.hh:630
LineType
Definition matrixmarket.hh:296
@ DATA
Definition matrixmarket.hh:296
@ MM_HEADER
Definition matrixmarket.hh:296
@ MM_ISTLSTRUCT
Definition matrixmarket.hh:296
bool readMatrixMarketBanner(std::istream &file, MMHeader &mmHeader)
Definition matrixmarket.hh:353
void readSparseEntries(Dune::BCRSMatrix< T, A > &matrix, std::istream &file, std::size_t entries, const MMHeader &mmHeader, const D &)
Definition matrixmarket.hh:765
MM_TYPE
Definition matrixmarket.hh:299
@ array_type
Definition matrixmarket.hh:299
@ coordinate_type
Definition matrixmarket.hh:299
@ unknown_type
Definition matrixmarket.hh:299
std::istream & operator>>(std::istream &is, NumericWrapper< T > &num)
Definition matrixmarket.hh:614
void skipComments(std::istream &file)
Definition matrixmarket.hh:339
bool lineFeed(std::istream &file)
Definition matrixmarket.hh:315
@ MM_MAX_LINE_LENGTH
Definition matrixmarket.hh:297
MM_STRUCTURE
Definition matrixmarket.hh:303
@ skew_symmetric
Definition matrixmarket.hh:303
@ general
Definition matrixmarket.hh:303
@ hermitian
Definition matrixmarket.hh:303
@ unknown_structure
Definition matrixmarket.hh:303
@ symmetric
Definition matrixmarket.hh:303
MM_CTYPE
Definition matrixmarket.hh:301
@ unknown_ctype
Definition matrixmarket.hh:301
@ pattern
Definition matrixmarket.hh:301
@ complex_type
Definition matrixmarket.hh:301
@ double_type
Definition matrixmarket.hh:301
@ integer_type
Definition matrixmarket.hh:301
std::enable_if_t<!is_complex< T >::value, T > conj(const T &r)
Definition matrixmarket.hh:733
std::tuple< std::string, std::string > splitFilename(const std::string &filename)
Definition matrixmarket.hh:852
A sparse block matrix with compressed row storage.
Definition bcrsmatrix.hh:466
Iterator begin()
Get iterator to first row.
Definition bcrsmatrix.hh:671
Iterator end()
Get iterator to one beyond last row.
Definition bcrsmatrix.hh:677
CreateIterator createend()
get create iterator pointing to one after the last block
Definition bcrsmatrix.hh:1100
size_type M() const
number of columns (counted in blocks)
Definition bcrsmatrix.hh:2007
CreateIterator createbegin()
get initial create iterator
Definition bcrsmatrix.hh:1094
size_type N() const
number of rows (counted in blocks)
Definition bcrsmatrix.hh:2001
void setBuildMode(BuildMode bm)
Sets the build mode of the matrix.
Definition bcrsmatrix.hh:830
void setSize(size_type rows, size_type columns, size_type nnz=0)
Set the size of the matrix.
Definition bcrsmatrix.hh:858
A vector of blocks with memory management.
Definition bvector.hh:392
void resize(size_type size)
Resize the vector.
Definition bvector.hh:496
typename Imp::BlockTraits< B >::field_type field_type
export the type representing the field
Definition bvector.hh:398
A generic dynamic dense matrix.
Definition matrix.hh:561
Helper metaprogram to get the matrix market string representation of the numeric type.
Definition matrixmarket.hh:76
@ is_numeric
Whether T is a supported numeric type.
Definition matrixmarket.hh:81
static std::string str()
Definition matrixmarket.hh:95
static std::string str()
Definition matrixmarket.hh:111
static std::string str()
Definition matrixmarket.hh:127
static std::string str()
Definition matrixmarket.hh:143
static std::string str()
Definition matrixmarket.hh:159
Meta program to write the correct Matrix Market header.
Definition matrixmarket.hh:174
static void print(std::ostream &os)
Definition matrixmarket.hh:179
static void print(std::ostream &os)
Definition matrixmarket.hh:189
static void print(std::ostream &os)
Definition matrixmarket.hh:199
static void print(std::ostream &os)
Definition matrixmarket.hh:209
Metaprogram for writing the ISTL block structure header.
Definition matrixmarket.hh:225
static void print(std::ostream &os, const M &)
Definition matrixmarket.hh:233
BlockVector< T, A > M
Definition matrixmarket.hh:230
BlockVector< FieldVector< T, i >, A > M
Definition matrixmarket.hh:243
static void print(std::ostream &os, const M &)
Definition matrixmarket.hh:245
BCRSMatrix< T, A > M
Definition matrixmarket.hh:255
static void print(std::ostream &os, const M &)
Definition matrixmarket.hh:258
BCRSMatrix< FieldMatrix< T, i, j >, A > M
Definition matrixmarket.hh:268
static void print(std::ostream &os, const M &)
Definition matrixmarket.hh:270
static void print(std::ostream &os, const M &m)
Definition matrixmarket.hh:283
FieldMatrix< T, i, j > M
Definition matrixmarket.hh:281
static void print(std::ostream &os, const M &m)
Definition matrixmarket.hh:292
FieldVector< T, i > M
Definition matrixmarket.hh:290
Definition matrixmarket.hh:306
MM_STRUCTURE structure
Definition matrixmarket.hh:312
MM_TYPE type
Definition matrixmarket.hh:310
MMHeader()
Definition matrixmarket.hh:307
MM_CTYPE ctype
Definition matrixmarket.hh:311
Definition matrixmarket.hh:578
std::size_t index
Definition matrixmarket.hh:579
a wrapper class of numeric values.
Definition matrixmarket.hh:595
T number
Definition matrixmarket.hh:596
Utility class for marking the pattern type of the MatrixMarket matrices.
Definition matrixmarket.hh:607
Functor to the data values of the matrix.
Definition matrixmarket.hh:677
void operator()(const std::vector< std::set< IndexData< D > > > &rows, BCRSMatrix< T > &matrix)
Sets the matrix values.
Definition matrixmarket.hh:684
void operator()(const std::vector< std::set< IndexData< D > > > &rows, BCRSMatrix< FieldMatrix< T, brows, bcols > > &matrix)
Sets the matrix values.
Definition matrixmarket.hh:702
void operator()(const std::vector< std::set< IndexData< PatternDummy > > > &rows, M &matrix)
Definition matrixmarket.hh:723
Definition matrixmarket.hh:728
Definition matrixmarket.hh:744
Definition matrixmarket.hh:868
Definition matrixutils.hh:27
Test whether a type is an ISTL Matrix.
Definition matrixutils.hh:504
A class setting up standard communication for a two-valued attribute set with owner/overlap/copy sema...
Definition owneroverlapcopy.hh:174
const ParallelIndexSet & indexSet() const
Get the underlying parallel index set.
Definition owneroverlapcopy.hh:462
const Communication< MPI_Comm > & communicator() const
Definition owneroverlapcopy.hh:299
const RemoteIndices & remoteIndices() const
Get the underlying remote indices.
Definition owneroverlapcopy.hh:471
Dune::ParallelIndexSet< GlobalIdType, LI, 512 > ParallelIndexSet
The type of the parallel index set.
Definition owneroverlapcopy.hh:449