Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
de20ea9d
There was an error fetching the commit references. Please try again later.
Commit
de20ea9d
authored
5 years ago
by
Jakub Klinkovský
Browse files
Options
Downloads
Patches
Plain Diff
Cosmetic changes in LinearSolverTypeResolver and TimeDependentPDESolver
parent
9a348c8b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/TNL/Solvers/LinearSolverTypeResolver.h
+2
-2
2 additions, 2 deletions
src/TNL/Solvers/LinearSolverTypeResolver.h
src/TNL/Solvers/PDE/TimeDependentPDESolver_impl.h
+11
-13
11 additions, 13 deletions
src/TNL/Solvers/PDE/TimeDependentPDESolver_impl.h
with
13 additions
and
15 deletions
src/TNL/Solvers/LinearSolverTypeResolver.h
+
2
−
2
View file @
de20ea9d
...
@@ -32,7 +32,7 @@ template< typename MatrixType >
...
@@ -32,7 +32,7 @@ template< typename MatrixType >
std
::
shared_ptr
<
Linear
::
LinearSolver
<
MatrixType
>
>
std
::
shared_ptr
<
Linear
::
LinearSolver
<
MatrixType
>
>
getLinearSolver
(
const
Config
::
ParameterContainer
&
parameters
)
getLinearSolver
(
const
Config
::
ParameterContainer
&
parameters
)
{
{
const
String
&
discreteSolver
=
parameters
.
getParameter
<
String
>
(
"discrete-solver"
);
const
String
&
discreteSolver
=
parameters
.
getParameter
<
String
>
(
"discrete-solver"
);
if
(
discreteSolver
==
"sor"
)
if
(
discreteSolver
==
"sor"
)
return
std
::
make_shared
<
Linear
::
SOR
<
MatrixType
>
>
();
return
std
::
make_shared
<
Linear
::
SOR
<
MatrixType
>
>
();
...
@@ -64,7 +64,7 @@ template< typename MatrixType >
...
@@ -64,7 +64,7 @@ template< typename MatrixType >
std
::
shared_ptr
<
Linear
::
Preconditioners
::
Preconditioner
<
MatrixType
>
>
std
::
shared_ptr
<
Linear
::
Preconditioners
::
Preconditioner
<
MatrixType
>
>
getPreconditioner
(
const
Config
::
ParameterContainer
&
parameters
)
getPreconditioner
(
const
Config
::
ParameterContainer
&
parameters
)
{
{
const
String
&
preconditioner
=
parameters
.
getParameter
<
String
>
(
"preconditioner"
);
const
String
&
preconditioner
=
parameters
.
getParameter
<
String
>
(
"preconditioner"
);
if
(
preconditioner
==
"none"
)
if
(
preconditioner
==
"none"
)
return
nullptr
;
return
nullptr
;
...
...
This diff is collapsed.
Click to expand it.
src/TNL/Solvers/PDE/TimeDependentPDESolver_impl.h
+
11
−
13
View file @
de20ea9d
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
namespace
TNL
{
namespace
TNL
{
namespace
Solvers
{
namespace
Solvers
{
namespace
PDE
{
namespace
PDE
{
template
<
typename
Problem
,
template
<
typename
Problem
,
typename
TimeStepper
>
typename
TimeStepper
>
...
@@ -53,9 +53,8 @@ TimeDependentPDESolver< Problem, TimeStepper >::
...
@@ -53,9 +53,8 @@ TimeDependentPDESolver< Problem, TimeStepper >::
setup
(
const
Config
::
ParameterContainer
&
parameters
,
setup
(
const
Config
::
ParameterContainer
&
parameters
,
const
String
&
prefix
)
const
String
&
prefix
)
{
{
BaseType
::
setup
(
parameters
,
prefix
);
BaseType
::
setup
(
parameters
,
prefix
);
/////
/////
// Load the mesh from the mesh file
// Load the mesh from the mesh file
//
//
...
@@ -65,7 +64,7 @@ setup( const Config::ParameterContainer& parameters,
...
@@ -65,7 +64,7 @@ setup( const Config::ParameterContainer& parameters,
return
false
;
return
false
;
if
(
!
Meshes
::
decomposeMesh
<
Problem
>
(
parameters
,
prefix
,
*
this
->
meshPointer
,
distributedMesh
,
*
problem
)
)
if
(
!
Meshes
::
decomposeMesh
<
Problem
>
(
parameters
,
prefix
,
*
this
->
meshPointer
,
distributedMesh
,
*
problem
)
)
return
false
;
return
false
;
problem
->
setMesh
(
this
->
meshPointer
);
problem
->
setMesh
(
this
->
meshPointer
);
/****
/****
...
@@ -77,7 +76,7 @@ setup( const Config::ParameterContainer& parameters,
...
@@ -77,7 +76,7 @@ setup( const Config::ParameterContainer& parameters,
return
false
;
return
false
;
}
}
problem
->
setCommonData
(
this
->
commonDataPointer
);
problem
->
setCommonData
(
this
->
commonDataPointer
);
/****
/****
* Setup the problem
* Setup the problem
*/
*/
...
@@ -94,11 +93,10 @@ setup( const Config::ParameterContainer& parameters,
...
@@ -94,11 +93,10 @@ setup( const Config::ParameterContainer& parameters,
this
->
dofsPointer
->
setSize
(
problem
->
getDofs
()
);
this
->
dofsPointer
->
setSize
(
problem
->
getDofs
()
);
this
->
dofsPointer
->
setValue
(
0.0
);
this
->
dofsPointer
->
setValue
(
0.0
);
this
->
problem
->
bindDofs
(
this
->
dofsPointer
);
this
->
problem
->
bindDofs
(
this
->
dofsPointer
);
/***
/***
* Set-up the initial condition
* Set-up the initial condition
*/
*/
typedef
typename
Problem
::
DofVectorType
DofVectorType
;
if
(
!
this
->
problem
->
setInitialCondition
(
parameters
,
this
->
dofsPointer
)
)
{
if
(
!
this
->
problem
->
setInitialCondition
(
parameters
,
this
->
dofsPointer
)
)
{
std
::
cerr
<<
"Failed to set up the initial condition."
<<
std
::
endl
;
std
::
cerr
<<
"Failed to set up the initial condition."
<<
std
::
endl
;
return
false
;
return
false
;
...
@@ -121,7 +119,7 @@ setup( const Config::ParameterContainer& parameters,
...
@@ -121,7 +119,7 @@ setup( const Config::ParameterContainer& parameters,
*/
*/
if
(
!
this
->
timeStepper
.
setup
(
parameters
)
)
if
(
!
this
->
timeStepper
.
setup
(
parameters
)
)
return
false
;
return
false
;
this
->
timeStepper
.
setSolverMonitor
(
*
this
->
solverMonitorPointer
);
this
->
timeStepper
.
setSolverMonitor
(
*
this
->
solverMonitorPointer
);
return
true
;
return
true
;
}
}
...
@@ -131,7 +129,7 @@ bool
...
@@ -131,7 +129,7 @@ bool
TimeDependentPDESolver
<
Problem
,
TimeStepper
>::
TimeDependentPDESolver
<
Problem
,
TimeStepper
>::
writeProlog
(
Logger
&
logger
,
writeProlog
(
Logger
&
logger
,
const
Config
::
ParameterContainer
&
parameters
)
const
Config
::
ParameterContainer
&
parameters
)
{
{
logger
.
writeHeader
(
problem
->
getPrologHeader
()
);
logger
.
writeHeader
(
problem
->
getPrologHeader
()
);
problem
->
writeProlog
(
logger
,
parameters
);
problem
->
writeProlog
(
logger
,
parameters
);
logger
.
writeSeparator
();
logger
.
writeSeparator
();
...
@@ -251,7 +249,7 @@ setTimeStep( const RealType& timeStep )
...
@@ -251,7 +249,7 @@ setTimeStep( const RealType& timeStep )
this
->
timeStep
=
timeStep
;
this
->
timeStep
=
timeStep
;
return
true
;
return
true
;
}
}
template
<
typename
Problem
,
template
<
typename
Problem
,
typename
TimeStepper
>
typename
TimeStepper
>
const
typename
Problem
::
RealType
&
const
typename
Problem
::
RealType
&
...
@@ -280,7 +278,7 @@ solve()
...
@@ -280,7 +278,7 @@ solve()
this
->
ioTimer
->
reset
();
this
->
ioTimer
->
reset
();
this
->
computeTimer
->
reset
();
this
->
computeTimer
->
reset
();
this
->
ioTimer
->
start
();
this
->
ioTimer
->
start
();
if
(
!
this
->
problem
->
makeSnapshot
(
t
,
step
,
this
->
dofsPointer
)
)
if
(
!
this
->
problem
->
makeSnapshot
(
t
,
step
,
this
->
dofsPointer
)
)
{
{
...
@@ -316,9 +314,9 @@ solve()
...
@@ -316,9 +314,9 @@ solve()
this
->
computeTimer
->
start
();
this
->
computeTimer
->
start
();
}
}
this
->
computeTimer
->
stop
();
this
->
computeTimer
->
stop
();
this
->
solverMonitorPointer
->
stopMainLoop
();
this
->
solverMonitorPointer
->
stopMainLoop
();
return
true
;
return
true
;
}
}
...
...
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