Loading...
Searching...
No Matches
ITHACAstream.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ██╗████████╗██╗ ██╗ █████╗ ██████╗ █████╗ ███████╗██╗ ██╗
3 ██║╚══██╔══╝██║ ██║██╔══██╗██╔════╝██╔══██╗ ██╔════╝██║ ██║
4 ██║ ██║ ███████║███████║██║ ███████║█████╗█████╗ ██║ ██║
5 ██║ ██║ ██╔══██║██╔══██║██║ ██╔══██║╚════╝██╔══╝ ╚██╗ ██╔╝
6 ██║ ██║ ██║ ██║██║ ██║╚██████╗██║ ██║ ██║ ╚████╔╝
7 ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═══╝
8
9 * In real Time Highly Advanced Computational Applications for Finite Volumes
10 * Copyright (C) 2017 by the ITHACA-FV authors
11-------------------------------------------------------------------------------
12License
13 This file is part of ITHACA-FV
14 ITHACA-FV is free software: you can redistribute it and/or modify
15 it under the terms of the GNU Lesser General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18 ITHACA-FV is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22 You should have received a copy of the GNU Lesser General Public License
23 along with ITHACA-FV. If not, see <http://www.gnu.org/licenses/>.
24Class
25 ITHACAstream
26Description
27 Methods for input and outputs from and to files
28SourceFiles
29 ITHACAstream.C
30 ITHACAstreamTemplates.C
31\*---------------------------------------------------------------------------*/
32
38
39#ifndef ITHACAstream_H
40#define ITHACAstream_H
41
42#include "fvCFD.H"
43#include "IOmanip.H"
44#include <stdio.h>
45#include <sys/types.h>
46#include <dirent.h>
47#include <algorithm>
48#include <fstream>
49#include <string>
50#include <stdexcept>
51#include <sstream>
52#include <vector>
53#include <cstdio>
54#include <typeinfo>
55#include <iostream>
56#include <cassert>
57#include <zlib.h>
58#include <map>
59#include "ITHACAassert.H"
60#include "ITHACAparameters.H"
61#include "ITHACAutilities.H"
62#pragma GCC diagnostic push
63#pragma GCC diagnostic ignored "-Wold-style-cast"
64#pragma GCC diagnostic ignored "-Wignored-attributes"
65#include <Eigen/Eigen>
66#include "EigenFunctions.H"
67
68#include <unsupported/Eigen/CXX11/Tensor>
69#pragma GCC diagnostic pop
70
71#define MAXBUFSIZE (static_cast<int> (1e6))
72#define PBSTR "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"
73#define PBWIDTH 60
74
75// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76
77
78/*---------------------------------------------------------------------------*\
79 Namespace ITHACAstream Declaration
80\*---------------------------------------------------------------------------*/
81
82#pragma GCC diagnostic push
83#pragma GCC diagnostic ignored "-Wold-style-cast"
84#include "cnpy.H"
85#pragma GCC diagnostic pop
86
88namespace ITHACAstream
89{
90
91//--------------------------------------------------------------------------
100template<typename Type>
101void exportFvMatrix(fvMatrix<Type>& Matrix, word folder,
102 word MatrixName);
103
104//--------------------------------------------------------------------------
115template<typename T, int dim>
116void exportMatrix(Eigen::Matrix < T, -1, dim > & matrix, word Name,
117 word type = "python", word folder = "./Matrices");
118
119//--------------------------------------------------------------------------
130void exportMatrix(List <Eigen::MatrixXd>& matrix, word Name,
131 word type = "python", word folder = "./Matrices");
132
133//--------------------------------------------------------------------------
144template<typename T>
145void exportTensor(Eigen::Tensor<T, 3 > tensor, word Name,
146 word type = "python", word folder = "./Matrices");
147
148
149//----------------------------------------------------------------------
165template<class Type, template<class> class PatchField, class GeoMesh>
166void read_fields(PtrList<GeometricField<Type, PatchField, GeoMesh>>&
167 Lfield, word Name,
168 fileName casename, int first_snap = 0, int n_snap = 0);
169
170
171
172//----------------------------------------------------------------------
188template<class Type, template<class> class PatchField, class GeoMesh>
189void read_fields(PtrList<GeometricField<Type, PatchField, GeoMesh>>&
190 Lfield,
191 GeometricField<Type, PatchField, GeoMesh>& field,
192 fileName casename, int first_snap = 0, int n_snap = 0);
193
194//----------------------------------------------------------------------
207template<class Type, template<class> class PatchField, class GeoMesh>
208void readMiddleFields(PtrList<GeometricField<Type, PatchField, GeoMesh>>&
209 Lfield,
210 GeometricField<Type, PatchField, GeoMesh>& field,
211 fileName casename);
212
213//----------------------------------------------------------------------
226template<class Type, template<class> class PatchField, class GeoMesh>
228 PtrList<GeometricField<Type, PatchField, GeoMesh>>& Lfield,
229 GeometricField<Type, PatchField, GeoMesh>& field,
230 fileName casename);
231
232//----------------------------------------------------------------------
240
245template<class Type, template<class> class PatchField, class GeoMesh>
246void read_last_fields(PtrList<GeometricField<Type, PatchField, GeoMesh>>&
247 Lfield,
248 const GeometricField<Type, PatchField, GeoMesh>& field,
249 const fileName casename);
250
251//----------------------------------------------------------------------
264template<class Type, template<class> class PatchField, class GeoMesh>
265void readLastFields(PtrList<GeometricField<Type, PatchField, GeoMesh>>&
266 Lfield,
267 const GeometricField<Type, PatchField, GeoMesh>& field,
268 const fileName casename);
269
270//--------------------------------------------------------------------------
281template<class Type, template<class> class PatchField, class GeoMesh>
282void exportFields(PtrList<GeometricField<Type, PatchField, GeoMesh>>&
283 field,
284 word folder, word fieldname);
285
286//--------------------------------------------------------------------------
288/* One has to provide the complete filename with the absolute or relative path */
294Eigen::MatrixXd readMatrix(word filename);
295
296//--------------------------------------------------------------------------
298/* One has to provide the folder containing the matrix files and the filename of the
299 the matrix. Since it is stored as a List of matrices each matrix must be stored in a
300 different file with the following format:
301 matFileName(i)_mat.txt */
308List <Eigen::MatrixXd> readMatrix(word folder, word mat_name);
309
310//--------------------------------------------------------------------------
322template<class Type, template<class> class PatchField, class GeoMesh>
323void exportSolution(GeometricField<Type, PatchField, GeoMesh>& s,
324 fileName subfolder, fileName folder,
325 word fieldName);
326
327//--------------------------------------------------------------------------
338template<class Type, template<class> class PatchField, class GeoMesh>
339void exportSolution(GeometricField<Type, PatchField, GeoMesh>& s,
340 fileName subfolder, fileName folder);
341
342//--------------------------------------------------------------------------
351template<typename T>
352void exportList(T& list, word folder, word filename);
353
354
355//--------------------------------------------------------------------------
366template <typename T, int Nrows, typename IND>
367void SaveSparseMatrix(Eigen::SparseMatrix<T, Nrows, IND>& m,
368 word folder, word MatrixName);
369
370//--------------------------------------------------------------------------
381template <typename T, int Nrows, typename IND>
382void ReadSparseMatrix(Eigen::SparseMatrix<T, Nrows, IND>& m,
383 word folder, word MatrixName);
384
385//--------------------------------------------------------------------------
394template <typename MatrixType>
395void SaveDenseMatrix(MatrixType& Matrix, word folder, word MatrixName);
396
397//--------------------------------------------------------------------------
406template <typename MatrixType>
407void ReadDenseMatrix(MatrixType& Matrix, word folder, word MatrixName);
408
409
410//----------------------------------------------------------------------
419template <typename TensorType>
420void SaveDenseTensor(TensorType& Tensor, word folder, word MatrixName);
421
422
423//----------------------------------------------------------------------
432template <typename TensorType>
433void ReadDenseTensor(TensorType& Tensor, word folder, word MatrixName);
434
435//--------------------------------------------------------------------------
444template <typename MatrixType>
445void SaveSparseMatrixList(List<MatrixType>& MatrixList, word folder,
446 word MatrixName);
447
448//--------------------------------------------------------------------------
459template <typename T, int Nrows, typename IND>
460void ReadSparseMatrixList(List<Eigen::SparseMatrix<T, Nrows, IND>>& m,
461 word folder, word MatrixName);
462
463//--------------------------------------------------------------------------
472template <typename MatrixType>
473void SaveDenseMatrixList(List<MatrixType>& MatrixList, word folder,
474 word MatrixName);
475
476
477//--------------------------------------------------------------------------
486template <typename MatrixType>
487void ReadDenseMatrixList(List<MatrixType>& m, word folder,
488 word MatrixName);
489
490//--------------------------------------------------------------------------
498int numberOfFiles(word folder, word MatrixName, word ext = "");
499
500//--------------------------------------------------------------------------
507void writePoints(pointField points, fileName folder, fileName subfolder);
508
509//--------------------------------------------------------------------------
514void printProgress(double percentage);
515
516template<typename T>
517void save(const List<Eigen::SparseMatrix<T>>& MatrixList, word folder,
518 word MatrixName);
519
520template<typename T>
521void load(List<Eigen::SparseMatrix<T>>& MatrixList, word folder,
522 word MatrixName);
523
524};
525
526namespace Foam
527{
528template<typename T>
529Ostream& operator<< (Ostream& os, const Eigen::Matrix < T, -1, -1 > & mat)
530{
531 os << mat.rows() << mat.cols() << UList<T>(const_cast<Eigen::MatrixXd&>
532 (mat).data(), mat.size());
533 return os;
534}
535
536template<typename T>
537Istream& operator>> (Istream& is, Eigen::Matrix < T, -1, -1 > & mat)
538{
539 int nrow, ncol;
540 is >> nrow >> ncol;
541 mat.resize(nrow, ncol);
542 UList<T> list(mat.data(), nrow * ncol);
543 is >> list;
544 return is;
545}
546
547template<typename T>
548Ostream& operator<< (Ostream& os, const Eigen::Matrix < T, -1, 1 > & mat)
549{
550 os << mat.rows() << mat.cols() << UList<T>(const_cast<Eigen::VectorXd&>
551 (mat).data(), mat.size());
552 return os;
553}
554
555template<typename T>
556Istream& operator>> (Istream& is, Eigen::Matrix < T, -1, 1 > & mat)
557{
558 int nrow, ncol;
559 is >> nrow >> ncol;
560 mat.resize(nrow, ncol);
561 UList<T> list(mat.data(), nrow * ncol);
562 is >> list;
563 return is;
564}
565
566template<typename T>
567Ostream& operator<< (Ostream& os, const Eigen::Tensor<T, 3>& tens)
568{
569 os << tens.dimension(0) << tens.dimension(1) << tens.dimension(
570 2) << UList<T>(const_cast<Eigen::Tensor<T, 3>&>(tens).data(),
571 tens.size());
572 return os;
573}
574
575template<typename T>
576Istream& operator>> (Istream& is, Eigen::Tensor<T, 3>& tens)
577{
578 int d1, d2, d3;
579 is >> d1 >> d2 >> d3;
580 tens.resize(d1, d2, d3);
581 UList<T> list(tens.data(), d1 * d2 * d3);
582 is >> list;
583 return is;
584}
585
586}
587
588template <typename T, int whatever, typename IND>
589void ITHACAstream::SaveSparseMatrix(Eigen::SparseMatrix<T, whatever, IND>& m,
590 word folder, word MatrixName)
591{
592 typedef Eigen::Triplet<int> Trip;
593 std::vector<Trip> res;
594 m.makeCompressed();
595 mkDir(folder);
596 std::fstream writeFile;
597 writeFile.open(folder + MatrixName, std::ios::binary | std::ios::out);
598
599 if (writeFile.is_open())
600 {
601 IND rows, cols, nnzs, outS, innS;
602 rows = m.rows() ;
603 cols = m.cols() ;
604 nnzs = m.nonZeros() ;
605 outS = m.outerSize();
606 innS = m.innerSize();
607 writeFile.write(reinterpret_cast<const char*> (&rows), sizeof(IND));
608 writeFile.write(reinterpret_cast<const char*> (&cols), sizeof(IND));
609 writeFile.write(reinterpret_cast<const char*> (&nnzs), sizeof(IND));
610 writeFile.write(reinterpret_cast<const char*> (&outS), sizeof(IND));
611 writeFile.write(reinterpret_cast<const char*> (&innS), sizeof(IND));
612 writeFile.write(reinterpret_cast<const char*>(m.valuePtr()),
613 sizeof(T ) * m.nonZeros());
614 writeFile.write(reinterpret_cast<const char*>(m.outerIndexPtr()),
615 sizeof(IND) * m.outerSize());
616 writeFile.write(reinterpret_cast<const char*>(m.innerIndexPtr()),
617 sizeof(IND) * m.nonZeros());
618 writeFile.close();
619 }
620}
621
622template <typename T, int whatever, typename IND>
623void ITHACAstream::ReadSparseMatrix(Eigen::SparseMatrix<T, whatever, IND>& m,
624 word folder, word MatrixName)
625{
626 std::fstream readFile;
627 readFile.open(folder + MatrixName, std::ios::binary | std::ios::in);
628
629 if (!readFile.good())
630 {
631 std::cout << folder + MatrixName <<
632 " file does not exist, try to rerun the Offline Stage!" << std::endl;
633 exit(EXIT_FAILURE);
634 }
635 else if (readFile.is_open())
636 {
637 IND rows, cols, nnz, inSz, outSz;
638 readFile.read(reinterpret_cast<char*>(&rows ), sizeof(IND));
639 readFile.read(reinterpret_cast<char*>(&cols ), sizeof(IND));
640 readFile.read(reinterpret_cast<char*>(&nnz ), sizeof(IND));
641 readFile.read(reinterpret_cast<char*>(&inSz ), sizeof(IND));
642 readFile.read(reinterpret_cast<char*>(&outSz), sizeof(IND));
643 m.resize(rows, cols);
644 m.makeCompressed();
645 m.resizeNonZeros(nnz);
646 readFile.read(reinterpret_cast<char*>(m.valuePtr()), sizeof(T ) * nnz );
647 readFile.read(reinterpret_cast<char*>(m.outerIndexPtr()), sizeof(IND) * outSz);
648 readFile.read(reinterpret_cast<char*>(m.innerIndexPtr()), sizeof(IND) * nnz );
649 m.finalize();
650 readFile.close();
651 }
652}
653
654template <typename MatrixType>
655void ITHACAstream::SaveDenseMatrix(MatrixType& Matrix, word folder,
656 word MatrixName)
657{
658 mkDir(folder);
659 std::ofstream out(folder + MatrixName,
660 std::ios::out | std::ios::binary | std::ios::trunc);
661 typename MatrixType::Index rows = Matrix.rows(), cols = Matrix.cols();
662 out.write(reinterpret_cast<char*> (&rows), sizeof(typename MatrixType::Index));
663 out.write(reinterpret_cast<char*> (&cols), sizeof(typename MatrixType::Index));
664 out.write(reinterpret_cast<char*> (Matrix.data()),
665 rows * cols * sizeof(typename MatrixType::Scalar) );
666 out.close();
667}
668
669template <typename MatrixType>
670void ITHACAstream::ReadDenseMatrix(MatrixType& Matrix, word folder,
671 word MatrixName)
672{
673 std::ifstream in;
674 in.open(folder + MatrixName, std::ios::in | std::ios::binary);
675
676 if (!in.good())
677 {
678 std::cout << folder + MatrixName <<
679 " file does not exist, try to rerun the Offline Stage!" << std::endl;
680 exit(EXIT_FAILURE);
681 }
682 else if (in.is_open())
683 {
684 typename MatrixType::Index rows = 0, cols = 0;
685 in.read(reinterpret_cast<char*> (&rows), sizeof(typename MatrixType::Index));
686 in.read(reinterpret_cast<char*> (&cols), sizeof(typename MatrixType::Index));
687 Matrix.resize(rows, cols);
688 in.read( reinterpret_cast<char*>(Matrix.data()),
689 rows * cols * sizeof(typename MatrixType::Scalar) );
690 in.close();
691 }
692}
693
694
695template <typename TensorType>
696void ITHACAstream::SaveDenseTensor(TensorType& Tensor, word folder,
697 word MatrixName)
698{
699 std::ofstream out(folder + MatrixName,
700 std::ios::out | std::ios::binary | std::ios::trunc);
701 typename TensorType::Dimensions dim = Tensor.dimensions();
702 int tot = 1;
703
704 for (int k = 0; k < dim.size(); k++)
705 {
706 tot *= dim[k];
707 }
708
709 out.write(reinterpret_cast<char*> (&dim),
710 sizeof(typename TensorType::Dimensions));
711 out.write(reinterpret_cast<char*> (Tensor.data()),
712 tot * sizeof(typename TensorType::Scalar) );
713 out.close();
714}
715
716template <typename TensorType>
717void ITHACAstream::ReadDenseTensor(TensorType& Tensor, word folder,
718 word MatrixName)
719{
720 std::ifstream in;
721 in.open(folder + MatrixName, std::ios::in | std::ios::binary);
722 typename TensorType::Dimensions dim;
723 in.read(reinterpret_cast<char*> (&dim),
724 sizeof(typename TensorType::Dimensions));
725 auto dims = Tensor.dimensions();
726 M_Assert(dims.size() == dim.size(),
727 "The rank of the tensor you want to fill does not coincide with the rank of the tensor you are reading");
728 int tot = 1;
729
730 for (int k = 0; k < dim.size(); k++)
731 {
732 tot *= dim[k];
733 }
734
735 Tensor.resize(dim);
736 in.read( reinterpret_cast<char*>(Tensor.data()),
737 tot * sizeof(typename TensorType::Scalar) );
738 in.close();
739}
740
741template <typename MatrixType>
742void ITHACAstream::SaveSparseMatrixList(List<MatrixType>& MatrixList,
743 word folder, word MatrixName)
744{
745 for (int i = 0; i < MatrixList.size(); i++)
746 {
747 SaveSparseMatrix(MatrixList[i], folder, MatrixName + name(i));
748 }
749}
750
751template <typename MatrixType>
752void ITHACAstream::SaveDenseMatrixList(List<MatrixType>& MatrixList,
753 word folder, word MatrixName)
754{
755 for (int i = 0; i < MatrixList.size(); i++)
756 {
757 SaveDenseMatrix(MatrixList[i], folder, MatrixName + name(i));
758 }
759}
760
761template <typename T, int whatever, typename IND>
763 List<Eigen::SparseMatrix<T, whatever, IND>>& m, word folder, word MatrixName)
764{
765 int number_of_files = numberOfFiles(folder, MatrixName);
766 std::cout << "Reading the Matrix " + folder + MatrixName << std::endl;
767 M_Assert(number_of_files != 0,
768 "Check if the file you are trying to read exists" );
769 Eigen::SparseMatrix<T, whatever, IND> A;
770
771 for (int i = 0; i < number_of_files; i++)
772 {
773 ReadSparseMatrix(A, folder, MatrixName + name(i));
774 m.append(A);
775 }
776}
777
778
779template <typename MatrixType>
780void ITHACAstream::ReadDenseMatrixList(List<MatrixType>& m, word folder,
781 word MatrixName)
782{
783 int number_of_files = numberOfFiles(folder, MatrixName);
784 std::cout << "Reading the Matrix " + folder + MatrixName << std::endl;
785 M_Assert(number_of_files != 0,
786 "Check if the file you are trying to read exists" );
787 MatrixType A;
788
789 for (int i = 0; i < number_of_files; i++)
790 {
791 ReadDenseMatrix(A, folder, MatrixName + name(i));
792 m.append(A);
793 }
794}
795
796
797
798
799
800// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
801
802
803
804#endif
805
806
807
808
809
810
Header file of the EigenFunctions class.
Implementation of the assert function for ITHACA-FV.
#define M_Assert(Expr, Msg)
Header file of the ITHACAutilities namespace.
volScalarField & T
Definition createT.H:46
volScalarField & A
Ostream & operator<<(Ostream &os, const Eigen::Matrix< T, -1, -1 > &mat)
Istream & operator>>(Istream &is, Eigen::Matrix< T, -1, -1 > &mat)
Namespace for input-output manipulation.
void writePoints(pointField points, fileName folder, fileName subfolder)
Write points of a mesh to a file.
void ReadDenseMatrixList(List< MatrixType > &m, word folder, word MatrixName)
Read a sparse matrix list to bynary files.
void SaveSparseMatrix(Eigen::SparseMatrix< T, Nrows, IND > &m, word folder, word MatrixName)
Export an Eigen sparse matrix into bynary format file.
void ReadDenseMatrix(MatrixType &Matrix, word folder, word MatrixName)
Read a dense matrix from a binary format file.
int numberOfFiles(word folder, word MatrixName, word ext)
Count the number of files with a certain name prefix, used by reading functions of list of matrices.
void readConvergedFields(PtrList< GeometricField< Type, PatchField, GeoMesh > > &Lfield, GeometricField< Type, PatchField, GeoMesh > &field, fileName casename)
Function to read a list of volVectorField from name of the field including only converged snapshots.
void save(const List< Eigen::SparseMatrix< T > > &MatrixList, word folder, word MatrixName)
void exportFields(PtrList< GeometricField< Type, PatchField, GeoMesh > > &field, word folder, word fieldname)
Function to export a scalar of vector field.
void load(List< Eigen::SparseMatrix< T > > &MatrixList, word folder, word MatrixName)
void exportSolution(GeometricField< Type, PatchField, GeoMesh > &s, fileName subfolder, fileName folder, word fieldName)
Export a field to file in a certain folder and subfolder.
void read_last_fields(PtrList< GeometricField< Type, PatchField, GeoMesh > > &Lfield, const GeometricField< Type, PatchField, GeoMesh > &field, const fileName casename)
Function to read a list of fields from the name of the field including only the last snapshot.
void readMiddleFields(PtrList< GeometricField< Type, PatchField, GeoMesh > > &Lfield, GeometricField< Type, PatchField, GeoMesh > &field, fileName casename)
Funtion to read a list of volVectorField from name of the field including all the intermediate snapsh...
void exportMatrix(Eigen::Matrix< T, -1, dim > &matrix, word Name, word type, word folder)
Export the reduced matrices in numpy (type=python), matlab (type=matlab) and txt (type=eigen) format ...
void exportList(T &list, word folder, word filename)
Export a list to file.
void ReadSparseMatrixList(List< Eigen::SparseMatrix< T, Nrows, IND > > &m, word folder, word MatrixName)
Read a sparse matrix list to bynary files.
void SaveDenseMatrix(MatrixType &Matrix, word folder, word MatrixName)
Save a dense matrix to a binary format file.
void ReadDenseTensor(TensorType &Tensor, word folder, word MatrixName)
Read a dense tensor from file.
void exportFvMatrix(fvMatrix< Type > &Matrix, word folder, word MatrixName)
Export an Fv Matrix to folder together with its source term.
void SaveDenseMatrixList(List< MatrixType > &MatrixList, word folder, word MatrixName)
Save a dense matrix list to bynary files.
List< Eigen::MatrixXd > readMatrix(word folder, word mat_name)
Read a three dimensional matrix from a txt file in Eigen format.
void SaveSparseMatrixList(List< MatrixType > &MatrixList, word folder, word MatrixName)
Save a sparse matrix list to bynary files.
void read_fields(PtrList< GeometricField< Type, PatchField, GeoMesh > > &Lfield, word Name, fileName casename, int first_snap, int n_snap)
Function to read a list of fields from the name of the field and casename.
void readLastFields(PtrList< GeometricField< Type, PatchField, GeoMesh > > &Lfield, const GeometricField< Type, PatchField, GeoMesh > &field, const fileName casename)
Funtion to read a list of volVectorField from name of the field including only the last snapshots.
void exportTensor(Eigen::Tensor< T, 3 > tensor, word Name, word type, word folder)
Export the reduced tensor in numpy (tipo=python), matlab (tipo=matlab) and txt (tipo=eigen) format.
void ReadSparseMatrix(Eigen::SparseMatrix< T, Nrows, IND > &m, word folder, word MatrixName)
Read an Eigen sparse matrix from a bynary format file.
void SaveDenseTensor(TensorType &Tensor, word folder, word MatrixName)
Save a dense tensor to file.
void printProgress(double percentage)
Print progress bar given the percentage.
label i
Definition pEqn.H:46