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
3a085360
Commit
3a085360
authored
11 years ago
by
Jonathan Lambrechts
Browse files
Options
Downloads
Patches
Plain Diff
PETSc : remove function imcompatible with recent PETSc and add the
destructor of the block solver
parent
33179040
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/linearSystemPETSc.cpp
+12
-0
12 additions, 0 deletions
Solver/linearSystemPETSc.cpp
Solver/linearSystemPETSc.h
+2
-1
2 additions, 1 deletion
Solver/linearSystemPETSc.h
Solver/linearSystemPETSc.hpp
+6
-6
6 additions, 6 deletions
Solver/linearSystemPETSc.hpp
with
20 additions
and
7 deletions
Solver/linearSystemPETSc.cpp
+
12
−
0
View file @
3a085360
...
...
@@ -27,6 +27,18 @@ void linearSystemPETScBlockDouble::_kspCreate()
_kspAllocated
=
true
;
}
linearSystemPETScBlockDouble
::~
linearSystemPETScBlockDouble
()
{
if
(
_isAllocated
)
{
MatDestroy
(
&
_a
);
VecDestroy
(
&
_b
);
VecDestroy
(
&
_x
);
}
if
(
_kspAllocated
)
{
KSPDestroy
(
&
_ksp
);
}
}
void
linearSystemPETScBlockDouble
::
addToMatrix
(
int
row
,
int
col
,
const
fullMatrix
<
double
>
&
val
)
{
...
...
This diff is collapsed.
Click to expand it.
Solver/linearSystemPETSc.h
+
2
−
1
View file @
3a085360
...
...
@@ -84,7 +84,7 @@ class linearSystemPETSc : public linearSystem<scalar> {
virtual
void
zeroSolution
();
virtual
int
systemSolve
();
Mat
&
getMatrix
(){
return
_a
;
}
std
::
vector
<
scalar
>
getData
();
//
std::vector<scalar> getData();
std
::
vector
<
int
>
getRowPointers
();
std
::
vector
<
int
>
getColumnsIndices
();
#ifndef SWIG
...
...
@@ -122,6 +122,7 @@ class linearSystemPETScBlockDouble : public linearSystem<fullMatrix<double> > {
double
normInfRightHandSide
()
const
;
void
insertInSparsityPattern
(
int
i
,
int
j
);
linearSystemPETScBlockDouble
(
bool
sequential
=
false
);
~
linearSystemPETScBlockDouble
();
};
#else
...
...
This diff is collapsed.
Click to expand it.
Solver/linearSystemPETSc.hpp
+
6
−
6
View file @
3a085360
...
...
@@ -349,7 +349,7 @@ int linearSystemPETSc<scalar>::systemSolve()
return
1
;
}
template
<
class
scalar
>
/*
template <class scalar>
std::vector<scalar> linearSystemPETSc<scalar>::getData()
{
_try(MatAssemblyBegin(_a, MAT_FINAL_ASSEMBLY));
...
...
@@ -369,15 +369,15 @@ std::vector<scalar> linearSystemPETSc<scalar>::getData()
#endif
_try(MatRestoreArray(_a,&v));
return data;
}
}
*/
template
<
class
scalar
>
std
::
vector
<
int
>
linearSystemPETSc
<
scalar
>::
getRowPointers
()
{
_try
(
MatAssemblyBegin
(
_a
,
MAT_FINAL_ASSEMBLY
));
_try
(
MatAssemblyEnd
(
_a
,
MAT_FINAL_ASSEMBLY
));
PetscInt
*
rows
;
PetscInt
*
columns
;
const
PetscInt
*
rows
;
const
PetscInt
*
columns
;
PetscInt
n
;
PetscTruth
done
;
_try
(
MatGetRowIJ
(
_a
,
0
,
PETSC_FALSE
,
PETSC_FALSE
,
&
n
,
&
rows
,
&
columns
,
&
done
));
//case done == PETSC_FALSE should be handled
...
...
@@ -393,8 +393,8 @@ std::vector<int> linearSystemPETSc<scalar>::getColumnsIndices()
{
_try
(
MatAssemblyBegin
(
_a
,
MAT_FINAL_ASSEMBLY
));
_try
(
MatAssemblyEnd
(
_a
,
MAT_FINAL_ASSEMBLY
));
PetscInt
*
rows
;
PetscInt
*
columns
;
const
PetscInt
*
rows
;
const
PetscInt
*
columns
;
PetscInt
n
;
PetscTruth
done
;
_try
(
MatGetRowIJ
(
_a
,
0
,
PETSC_FALSE
,
PETSC_FALSE
,
&
n
,
&
rows
,
&
columns
,
&
done
));
//case done == PETSC_FALSE should be handled
...
...
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