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
64898518
Commit
64898518
authored
13 years ago
by
Jonathan Lambrechts
Browse files
Options
Downloads
Patches
Plain Diff
petsc : add assemblyBegin/End on vector
parent
d52f3c8d
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
+2
-0
2 additions, 0 deletions
Solver/linearSystemPETSc.cpp
Solver/linearSystemPETSc.hpp
+4
-2
4 additions, 2 deletions
Solver/linearSystemPETSc.hpp
with
6 additions
and
2 deletions
Solver/linearSystemPETSc.cpp
+
2
−
0
View file @
64898518
...
@@ -240,6 +240,8 @@ linearSystemPETScBlockDouble::linearSystemPETScBlockDouble()
...
@@ -240,6 +240,8 @@ linearSystemPETScBlockDouble::linearSystemPETScBlockDouble()
double
linearSystemPETScBlockDouble
::
normInfRightHandSide
()
const
double
linearSystemPETScBlockDouble
::
normInfRightHandSide
()
const
{
{
PetscReal
nor
;
PetscReal
nor
;
VecAssemblyBegin
(
_b
);
VecAssemblyEnd
(
_b
);
VecNorm
(
_b
,
NORM_INFINITY
,
&
nor
);
VecNorm
(
_b
,
NORM_INFINITY
,
&
nor
);
return
nor
;
return
nor
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Solver/linearSystemPETSc.hpp
+
4
−
2
View file @
64898518
...
@@ -173,7 +173,7 @@ void linearSystemPETSc<scalar>::getFromRightHandSide(int row, scalar &val) const
...
@@ -173,7 +173,7 @@ void linearSystemPETSc<scalar>::getFromRightHandSide(int row, scalar &val) const
// FIXME specialize this routine
// FIXME specialize this routine
val
=
s
.
real
();
val
=
s
.
real
();
#else
#else
VecGetValues
(
_b
,
1
,
&
row
,
&
val
);
_try
(
VecGetValues
(
_b
,
1
,
&
row
,
&
val
)
)
;
#endif
#endif
}
}
...
@@ -181,6 +181,8 @@ template <class scalar>
...
@@ -181,6 +181,8 @@ template <class scalar>
double
linearSystemPETSc
<
scalar
>::
normInfRightHandSide
()
const
double
linearSystemPETSc
<
scalar
>::
normInfRightHandSide
()
const
{
{
PetscReal
nor
;
PetscReal
nor
;
VecAssemblyBegin
(
_b
);
VecAssemblyEnd
(
_b
);
_try
(
VecNorm
(
_b
,
NORM_INFINITY
,
&
nor
));
_try
(
VecNorm
(
_b
,
NORM_INFINITY
,
&
nor
));
return
nor
;
return
nor
;
}
}
...
@@ -205,7 +207,7 @@ void linearSystemPETSc<scalar>::getFromSolution(int row, scalar &val) const
...
@@ -205,7 +207,7 @@ void linearSystemPETSc<scalar>::getFromSolution(int row, scalar &val) const
_try
(
VecRestoreArray
(
_x
,
&
tmp
));
_try
(
VecRestoreArray
(
_x
,
&
tmp
));
val
=
s
.
real
();
val
=
s
.
real
();
#else
#else
VecGetValues
(
_x
,
1
,
&
row
,
&
val
);
_try
(
VecGetValues
(
_x
,
1
,
&
row
,
&
val
)
)
;
#endif
#endif
}
}
...
...
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