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
b424a0f2
Commit
b424a0f2
authored
9 years ago
by
Sebastien Blaise
Browse files
Options
Downloads
Patches
Plain Diff
Solver: added matMult function
parent
0b5628f4
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Solver/linearSystem.h
+3
-0
3 additions, 0 deletions
Solver/linearSystem.h
Solver/linearSystemPETSc.h
+2
-0
2 additions, 0 deletions
Solver/linearSystemPETSc.h
Solver/linearSystemPETSc.hpp
+12
-0
12 additions, 0 deletions
Solver/linearSystemPETSc.hpp
with
17 additions
and
0 deletions
Solver/linearSystem.h
+
3
−
0
View file @
b424a0f2
...
...
@@ -24,6 +24,9 @@ class linearSystemBase {
virtual
void
zeroRightHandSide
()
=
0
;
virtual
void
zeroSolution
()
=
0
;
virtual
int
systemSolve
()
=
0
;
// x = A*b
virtual
int
matMult
()
{
return
0
;
}
void
setParameter
(
std
::
string
key
,
std
::
string
value
);
std
::
string
getParameter
(
std
::
string
key
)
const
;
virtual
void
insertInSparsityPattern
(
int
_row
,
int
_col
){};
...
...
This diff is collapsed.
Click to expand it.
Solver/linearSystemPETSc.h
+
2
−
0
View file @
b424a0f2
...
...
@@ -115,6 +115,7 @@ class linearSystemPETSc : public linearSystem<scalar> {
void
printMatlab
(
const
char
*
filename
)
const
;
virtual
int
systemSolve
();
Mat
getMatrix
(){
return
_a
;
}
virtual
int
matMult
();
//std::vector<scalar> getData();
//std::vector<int> getRowPointers();
//std::vector<int> getColumnsIndices();
...
...
@@ -149,6 +150,7 @@ class linearSystemPETSc : public linearSystem<scalar> {
void
printMatlab
(
const
char
*
filename
)
const
{};
virtual
int
systemSolve
()
{
return
0
;
}
double
normInfRightHandSide
()
const
{
return
0
;}
virtual
int
matMult
()
{
return
0
;
}
};
#endif
#endif
This diff is collapsed.
Click to expand it.
Solver/linearSystemPETSc.hpp
+
12
−
0
View file @
b424a0f2
...
...
@@ -393,6 +393,18 @@ int linearSystemPETSc<scalar>::systemSolve()
return
1
;
}
template
<
class
scalar
>
int
linearSystemPETSc
<
scalar
>::
matMult
()
{
_try
(
MatAssemblyBegin
(
_a
,
MAT_FINAL_ASSEMBLY
));
_try
(
MatAssemblyEnd
(
_a
,
MAT_FINAL_ASSEMBLY
));
_try
(
VecAssemblyBegin
(
_b
));
_try
(
VecAssemblyEnd
(
_b
));
_try
(
MatMult
(
_a
,
_b
,
_x
));
return
1
;
}
template
<
class
scalar
>
void
linearSystemPETSc
<
scalar
>::
printMatlab
(
const
char
*
filename
)
const
{
...
...
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