Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Özgür Ozan Sen
ogs
Commits
f4580799
Commit
f4580799
authored
3 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[MaL/LA/PETSc] Rm. unnecessary constructor.
parent
1ecef7c8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MathLib/LinAlg/PETSc/PETScLinearSolver.cpp
+0
-53
0 additions, 53 deletions
MathLib/LinAlg/PETSc/PETScLinearSolver.cpp
MathLib/LinAlg/PETSc/PETScLinearSolver.h
+1
-14
1 addition, 14 deletions
MathLib/LinAlg/PETSc/PETScLinearSolver.h
with
1 addition
and
67 deletions
MathLib/LinAlg/PETSc/PETScLinearSolver.cpp
+
0
−
53
View file @
f4580799
...
...
@@ -17,62 +17,9 @@
#include
"PETScLinearSolver.h"
#include
"BaseLib/RunTime.h"
#include
"MathLib/LinAlg/LinearSolverOptions.h"
namespace
MathLib
{
PETScLinearSolver
::
PETScLinearSolver
(
const
std
::
string
/*prefix*/
,
BaseLib
::
ConfigTree
const
*
const
option
)
{
// Insert options into petsc database. Default options are given in the
// string below.
std
::
string
petsc_options
=
"-ksp_type cg -pc_type bjacobi -ksp_rtol 1e-16 -ksp_max_it 10000"
;
std
::
string
prefix
;
if
(
option
)
{
ignoreOtherLinearSolvers
(
*
option
,
"petsc"
);
//! \ogs_file_param{prj__linear_solvers__linear_solver__petsc}
if
(
auto
const
subtree
=
option
->
getConfigSubtreeOptional
(
"petsc"
))
{
if
(
auto
const
parameters
=
//! \ogs_file_param{prj__linear_solvers__linear_solver__petsc__parameters}
subtree
->
getConfigParameterOptional
<
std
::
string
>
(
"parameters"
))
{
petsc_options
=
*
parameters
;
}
if
(
auto
const
pre
=
//! \ogs_file_param{prj__linear_solvers__linear_solver__petsc__prefix}
subtree
->
getConfigParameterOptional
<
std
::
string
>
(
"prefix"
))
{
if
(
!
pre
->
empty
())
prefix
=
*
pre
+
"_"
;
}
}
}
#if PETSC_VERSION_LT(3, 7, 0)
PetscOptionsInsertString
(
petsc_options
.
c_str
());
#else
PetscOptionsInsertString
(
nullptr
,
petsc_options
.
c_str
());
#endif
KSPCreate
(
PETSC_COMM_WORLD
,
&
solver_
);
KSPGetPC
(
solver_
,
&
pc_
);
if
(
!
prefix
.
empty
())
{
KSPSetOptionsPrefix
(
solver_
,
prefix
.
c_str
());
}
KSPSetInitialGuessNonzero
(
solver_
,
PETSC_TRUE
);
KSPSetFromOptions
(
solver_
);
// set run-time options
}
PETScLinearSolver
::
PETScLinearSolver
(
std
::
string
const
&
prefix
,
std
::
string
const
&
petsc_options
)
{
...
...
This diff is collapsed.
Click to expand it.
MathLib/LinAlg/PETSc/PETScLinearSolver.h
+
1
−
14
View file @
f4580799
...
...
@@ -16,12 +16,9 @@
#pragma once
#include
<string>
#include
<petscksp.h>
#include
"BaseLib/ConfigTree.h"
#include
<string>
#include
"PETScMatrix.h"
#include
"PETScVector.h"
...
...
@@ -38,16 +35,6 @@ namespace MathLib
class
PETScLinearSolver
{
public:
/*!
Constructor
\param prefix Name used to distinguish the options in the command
line for this solver. It can be the name of the PDE
that owns an instance of this class.
\param option Petsc options, which will be inserted into the global
petsc options database.
*/
PETScLinearSolver
(
const
std
::
string
prefix
,
BaseLib
::
ConfigTree
const
*
const
option
);
/*!
Constructor
\param prefix Name used to distinguish the options in the command
...
...
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