Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
9f77dce3
Commit
9f77dce3
authored
11 years ago
by
Jonathan Lambrechts
Browse files
Options
Downloads
Patches
Plain Diff
linearSystemPETSc::printMatlab
parent
8525868c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Solver/linearSystemPETSc.cpp
+16
-0
16 additions, 0 deletions
Solver/linearSystemPETSc.cpp
Solver/linearSystemPETSc.h
+1
-0
1 addition, 0 deletions
Solver/linearSystemPETSc.h
with
17 additions
and
0 deletions
Solver/linearSystemPETSc.cpp
+
16
−
0
View file @
9f77dce3
...
...
@@ -341,4 +341,20 @@ double linearSystemPETScBlockDouble::normInfRightHandSide() const
return
nor
;
}
void
linearSystemPETScBlockDouble
::
printMatlab
(
const
char
*
filename
)
const
{
_try
(
MatAssemblyBegin
(
_a
,
MAT_FINAL_ASSEMBLY
));
_try
(
MatAssemblyEnd
(
_a
,
MAT_FINAL_ASSEMBLY
));
_try
(
VecAssemblyBegin
(
_b
));
_try
(
VecAssemblyEnd
(
_b
));
PetscViewer
viewer
;
PetscViewerASCIIOpen
(
PETSC_COMM_WORLD
,
filename
,
&
viewer
);
PetscViewerSetFormat
(
viewer
,
PETSC_VIEWER_ASCII_MATLAB
);
printf
(
"export mat to %s
\n
"
,
filename
);
MatView
(
_a
,
viewer
);
PetscViewerDestroy
(
&
viewer
);
return
;
}
#endif // HAVE_PETSC
This diff is collapsed.
Click to expand it.
Solver/linearSystemPETSc.h
+
1
−
0
View file @
9f77dce3
...
...
@@ -105,6 +105,7 @@ class linearSystemPETScBlockDouble : public linearSystem<fullMatrix<double> > {
public:
void
_kspCreate
();
void
print
();
void
printMatlab
(
const
char
*
filename
)
const
;
virtual
void
addToMatrix
(
int
row
,
int
col
,
const
fullMatrix
<
double
>
&
val
);
virtual
void
addToRightHandSide
(
int
row
,
const
fullMatrix
<
double
>
&
val
);
virtual
void
addToSolution
(
int
row
,
const
fullMatrix
<
double
>
&
val
);
...
...
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