Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-istl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Patrick Jaap
dune-istl
Commits
68949b01
Commit
68949b01
authored
4 years ago
by
Jean Benezech
Browse files
Options
Downloads
Patches
Plain Diff
make storeMatrixMarket able to choose the decimal precision
parent
ea9f0c4c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/istl/matrixmarket.hh
+10
-2
10 additions, 2 deletions
dune/istl/matrixmarket.hh
with
10 additions
and
2 deletions
dune/istl/matrixmarket.hh
+
10
−
2
View file @
68949b01
...
...
@@ -1115,13 +1115,17 @@ namespace Dune
* @param matrix The matrix/vector to store.
* @param filename the name of the filename (without suffix and rank!)
* rank i will write the file filename_i.mm
* @param prec Set the decimal precision to be used
*/
template
<
typename
M
>
void
storeMatrixMarket
(
const
M
&
matrix
,
std
::
string
filename
)
std
::
string
filename
,
int
prec
=
0
)
{
std
::
ofstream
file
(
filename
.
c_str
());
file
.
setf
(
std
::
ios
::
scientific
,
std
::
ios
::
floatfield
);
if
(
prec
>
0
)
file
.
precision
(
prec
);
writeMatrixMarket
(
matrix
,
file
);
file
.
close
();
}
...
...
@@ -1139,12 +1143,14 @@ namespace Dune
* @param comm The information about the data distribution.
* @param storeIndices Whether to store the parallel index information.
* If true rank i writes the index information to file filename_i.idx.
* @param prec Set the decimal precision to be used
*/
template
<
typename
M
,
typename
G
,
typename
L
>
void
storeMatrixMarket
(
const
M
&
matrix
,
std
::
string
filename
,
const
OwnerOverlapCopyCommunication
<
G
,
L
>&
comm
,
bool
storeIndices
=
true
)
bool
storeIndices
=
true
,
int
prec
=
0
)
{
// Get our rank
int
rank
=
comm
.
communicator
().
rank
();
...
...
@@ -1154,6 +1160,8 @@ namespace Dune
dverb
<<
rfilename
.
str
()
<<
std
::
endl
;
std
::
ofstream
file
(
rfilename
.
str
().
c_str
());
file
.
setf
(
std
::
ios
::
scientific
,
std
::
ios
::
floatfield
);
if
(
prec
>
0
)
file
.
precision
(
prec
);
writeMatrixMarket
(
matrix
,
file
);
file
.
close
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment