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
03ba48aa
Commit
03ba48aa
authored
14 years ago
by
Emilie Marchandise
Browse files
Options
Downloads
Patches
Plain Diff
Temporal stokes ok
parent
ccce2e33
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
Numeric/fullMatrix.h
+8
-0
8 additions, 0 deletions
Numeric/fullMatrix.h
Solver/linearSystemPETSc.cpp
+2
-0
2 additions, 0 deletions
Solver/linearSystemPETSc.cpp
Solver/linearSystemPETSc.h
+1
-1
1 addition, 1 deletion
Solver/linearSystemPETSc.h
with
11 additions
and
1 deletion
Numeric/fullMatrix.h
+
8
−
0
View file @
03ba48aa
...
@@ -123,6 +123,14 @@ class fullMatrix
...
@@ -123,6 +123,14 @@ class fullMatrix
#endif
#endif
(
*
this
)(
r
,
c
)
=
v
;
(
*
this
)(
r
,
c
)
=
v
;
}
}
inline
scalar
norm
()
{
scalar
n
=
0.
;
for
(
int
i
=
0
;
i
<
_r
;
++
i
)
for
(
int
j
=
0
;
j
<
_c
;
++
j
)
n
+=
(
*
this
)(
i
,
j
)
*
(
*
this
)(
i
,
j
);
return
sqrt
(
n
);
}
fullMatrix
(
scalar
*
original
,
int
r
,
int
c
)
fullMatrix
(
scalar
*
original
,
int
r
,
int
c
)
{
{
_r
=
r
;
_r
=
r
;
...
...
This diff is collapsed.
Click to expand it.
Solver/linearSystemPETSc.cpp
+
2
−
0
View file @
03ba48aa
...
@@ -82,6 +82,8 @@ void linearSystemPETSc<fullMatrix<PetscScalar> >::allocate(int nbRows)
...
@@ -82,6 +82,8 @@ void linearSystemPETSc<fullMatrix<PetscScalar> >::allocate(int nbRows)
if
(
_blockSize
==
0
)
if
(
_blockSize
==
0
)
Msg
::
Error
(
"'blockSize' parameters must be set for linearSystemPETScBlock"
);
Msg
::
Error
(
"'blockSize' parameters must be set for linearSystemPETScBlock"
);
clear
();
clear
();
//printf("allocate linear system petsc \n");
//_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
,
PETSC_DECIDE
,
PETSC_DECIDE
,
nbRows
*
_blockSize
,
nbRows
*
_blockSize
));
_try
(
MatSetSizes
(
_a
,
PETSC_DECIDE
,
PETSC_DECIDE
,
nbRows
*
_blockSize
,
nbRows
*
_blockSize
));
_try
(
MatSetType
(
_a
,
MATSEQBAIJ
));
_try
(
MatSetType
(
_a
,
MATSEQBAIJ
));
...
...
This diff is collapsed.
Click to expand it.
Solver/linearSystemPETSc.h
+
1
−
1
View file @
03ba48aa
...
@@ -55,7 +55,7 @@ class linearSystemPETSc : public linearSystem<scalar> {
...
@@ -55,7 +55,7 @@ class linearSystemPETSc : public linearSystem<scalar> {
PC
pc
;
PC
pc
;
_try
(
KSPGetPC
(
_ksp
,
&
pc
));
_try
(
KSPGetPC
(
_ksp
,
&
pc
));
// set some default options
// set some default options
_try
(
PCSetType
(
pc
,
PC
I
LU
));
_try
(
PCSetType
(
pc
,
PCLU
));
//LU for direct solver and PCILU for indirect solver
_try
(
PCFactorSetMatOrderingType
(
pc
,
MATORDERING_RCM
));
_try
(
PCFactorSetMatOrderingType
(
pc
,
MATORDERING_RCM
));
_try
(
PCFactorSetLevels
(
pc
,
1
));
_try
(
PCFactorSetLevels
(
pc
,
1
));
_try
(
KSPSetTolerances
(
_ksp
,
1.e-8
,
PETSC_DEFAULT
,
PETSC_DEFAULT
,
PETSC_DEFAULT
));
_try
(
KSPSetTolerances
(
_ksp
,
1.e-8
,
PETSC_DEFAULT
,
PETSC_DEFAULT
,
PETSC_DEFAULT
));
...
...
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