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
f80012cd
Commit
f80012cd
authored
14 years ago
by
Tuomas Karna
Browse files
Options
Downloads
Patches
Plain Diff
linearSystemPETSc sequential fix
parent
59dc36d3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Solver/linearSystemPETSc.cpp
+9
-5
9 additions, 5 deletions
Solver/linearSystemPETSc.cpp
with
9 additions
and
5 deletions
Solver/linearSystemPETSc.cpp
+
9
−
5
View file @
f80012cd
...
@@ -91,13 +91,17 @@ void linearSystemPETSc<fullMatrix<PetscScalar> >::allocate(int nbRows)
...
@@ -91,13 +91,17 @@ void linearSystemPETSc<fullMatrix<PetscScalar> >::allocate(int nbRows)
//_try(PetscOptionsInsertString("-ksp_monitor_true_residual -ksp_rtol 1e-10"));
//_try(PetscOptionsInsertString("-ksp_monitor_true_residual -ksp_rtol 1e-10"));
_try
(
MatCreate
(
PETSC_COMM_WORLD
,
&
_a
));
_try
(
MatCreate
(
PETSC_COMM_WORLD
,
&
_a
));
_try
(
MatSetSizes
(
_a
,
nbRows
*
_blockSize
,
nbRows
*
_blockSize
,
PETSC_DETERMINE
,
PETSC_DETERMINE
));
_try
(
MatSetSizes
(
_a
,
nbRows
*
_blockSize
,
nbRows
*
_blockSize
,
PETSC_DETERMINE
,
PETSC_DETERMINE
));
//_try(MatSetType(_a, MATSEQBAIJ));
if
(
Msg
::
GetCommSize
()
>
1
)
{
_try
(
MatSetType
(
_a
,
MATMPIBAIJ
));
_try
(
MatSetType
(
_a
,
MATMPIBAIJ
));
_try
(
MatSetFromOptions
(
_a
));
_try
(
MatMPIBAIJSetPreallocation
(
_a
,
_blockSize
,
5
,
NULL
,
0
,
NULL
));
}
else
{
_try
(
MatSetType
(
_a
,
MATSEQBAIJ
));
_try
(
MatSetFromOptions
(
_a
));
_try
(
MatSeqBAIJSetPreallocation
(
_a
,
_blockSize
,
5
,
NULL
));
//todo preAllocate off-diagonal part
}
// override the default options with the ones from the option
// override the default options with the ones from the option
// database (if any)
// database (if any)
_try
(
MatSetFromOptions
(
_a
));
_try
(
MatMPIBAIJSetPreallocation
(
_a
,
_blockSize
,
5
,
NULL
,
0
,
NULL
));
//_try(MatMPIBAIJSetPreallocation(_a, _blockSize, 4, NULL, 0, NULL)); //todo preAllocate off-diagonal part
_try
(
VecCreate
(
PETSC_COMM_WORLD
,
&
_x
));
_try
(
VecCreate
(
PETSC_COMM_WORLD
,
&
_x
));
_try
(
VecSetSizes
(
_x
,
nbRows
*
_blockSize
,
PETSC_DETERMINE
));
_try
(
VecSetSizes
(
_x
,
nbRows
*
_blockSize
,
PETSC_DETERMINE
));
// override the default options with the ones from the option
// override the default options with the ones from the option
...
...
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