Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Praetorius, Simon
dune-amdis
Commits
4bf4338f
Commit
4bf4338f
authored
Feb 28, 2019
by
Praetorius, Simon
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue/virtual_override_final' into 'develop'
use exactly one of virtual, override, or final. See merge request
!86
parents
c908be0b
6eb2e6bc
Pipeline
#1760
canceled with stage
Changes
22
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
90 additions
and
90 deletions
+90
-90
src/amdis/AdaptInstationary.hpp
src/amdis/AdaptInstationary.hpp
+1
-1
src/amdis/AdaptStationary.hpp
src/amdis/AdaptStationary.hpp
+1
-1
src/amdis/CreatorInterface.hpp
src/amdis/CreatorInterface.hpp
+1
-1
src/amdis/FileWriter.hpp
src/amdis/FileWriter.hpp
+1
-1
src/amdis/GridTransfer.hpp
src/amdis/GridTransfer.hpp
+5
-5
src/amdis/Marker.hpp
src/amdis/Marker.hpp
+8
-8
src/amdis/ProblemInstat.hpp
src/amdis/ProblemInstat.hpp
+4
-4
src/amdis/ProblemInstatBase.hpp
src/amdis/ProblemInstatBase.hpp
+3
-3
src/amdis/ProblemStat.hpp
src/amdis/ProblemStat.hpp
+14
-14
src/amdis/StandardProblemIteration.hpp
src/amdis/StandardProblemIteration.hpp
+7
-7
src/amdis/linearalgebra/DOFVectorBase.hpp
src/amdis/linearalgebra/DOFVectorBase.hpp
+4
-4
src/amdis/linearalgebra/LinearSolver.hpp
src/amdis/linearalgebra/LinearSolver.hpp
+3
-3
src/amdis/linearalgebra/eigen/DirectRunner.hpp
src/amdis/linearalgebra/eigen/DirectRunner.hpp
+4
-4
src/amdis/linearalgebra/eigen/IterativeRunner.hpp
src/amdis/linearalgebra/eigen/IterativeRunner.hpp
+4
-4
src/amdis/linearalgebra/eigen/SolverCreator.hpp
src/amdis/linearalgebra/eigen/SolverCreator.hpp
+1
-1
src/amdis/linearalgebra/istl/DirectRunner.hpp
src/amdis/linearalgebra/istl/DirectRunner.hpp
+3
-3
src/amdis/linearalgebra/istl/ISTLRunner.hpp
src/amdis/linearalgebra/istl/ISTLRunner.hpp
+4
-4
src/amdis/linearalgebra/istl/ISTL_Preconditioner.hpp
src/amdis/linearalgebra/istl/ISTL_Preconditioner.hpp
+2
-2
src/amdis/linearalgebra/mtl/KrylovRunner.hpp
src/amdis/linearalgebra/mtl/KrylovRunner.hpp
+6
-6
src/amdis/linearalgebra/mtl/Preconditioner.hpp
src/amdis/linearalgebra/mtl/Preconditioner.hpp
+5
-5
src/amdis/linearalgebra/mtl/UmfpackRunner.hpp
src/amdis/linearalgebra/mtl/UmfpackRunner.hpp
+4
-4
src/amdis/utility/QuadratureFactory.hpp
src/amdis/utility/QuadratureFactory.hpp
+5
-5
No files found.
src/amdis/AdaptInstationary.hpp
View file @
4bf4338f
...
...
@@ -44,7 +44,7 @@ namespace AMDiS
}
/// Implementation of AdaptBase::adapt()
virtual
int
adapt
()
override
;
int
adapt
()
override
;
protected:
/** \brief
...
...
src/amdis/AdaptStationary.hpp
View file @
4bf4338f
...
...
@@ -35,7 +35,7 @@ namespace AMDiS
AdaptInfo
&
adaptInfo
);
/// Implementation of AdaptBase::adapt()
virtual
int
adapt
()
override
;
int
adapt
()
override
;
};
}
// end namespace AMDiS
src/amdis/CreatorInterface.hpp
View file @
4bf4338f
...
...
@@ -44,7 +44,7 @@ namespace AMDiS
{
public:
virtual
std
::
unique_ptr
<
BaseClass
>
create
()
final
std
::
unique_ptr
<
BaseClass
>
create
()
final
{
error_exit
(
"Should not be called. Call create(string) instead!"
);
return
{};
...
...
src/amdis/FileWriter.hpp
View file @
4bf4338f
...
...
@@ -94,7 +94,7 @@ namespace AMDiS
void
init
(
std
::
string
const
&
,
tag
::
unknown
)
{}
/// Implements \ref FileWriterInterface::writeFiles
virtual
void
writeFiles
(
AdaptInfo
&
adaptInfo
,
bool
force
)
override
void
writeFiles
(
AdaptInfo
&
adaptInfo
,
bool
force
)
override
{
test_exit
(
filesystem
::
exists
(
dir_
),
"Output directory '{}' does not exist!"
,
dir_
);
...
...
src/amdis/GridTransfer.hpp
View file @
4bf4338f
...
...
@@ -39,12 +39,12 @@ namespace AMDiS
}
/// Attach a data container to the grid transfer, that gets interpolated during grid change
virtual
void
attach
(
DOFVectorInterface
*
vec
)
override
void
attach
(
DOFVectorInterface
*
vec
)
override
{
data_
.
push_back
(
vec
);
}
virtual
void
detach
(
DOFVectorInterface
*
vec
)
override
void
detach
(
DOFVectorInterface
*
vec
)
override
{
auto
it
=
std
::
find
(
data_
.
begin
(),
data_
.
end
(),
vec
);
if
(
it
!=
data_
.
end
())
...
...
@@ -54,7 +54,7 @@ namespace AMDiS
}
/// Prepare the grid and the data for the adaption
virtual
bool
preAdapt
()
override
bool
preAdapt
()
override
{
assert
(
grid_
!=
nullptr
);
mightCoarsen_
=
grid_
->
preAdapt
();
// any element might be coarsened in adapt()
...
...
@@ -64,7 +64,7 @@ namespace AMDiS
}
/// do the grid adaption
virtual
bool
adapt
()
override
bool
adapt
()
override
{
assert
(
grid_
!=
nullptr
);
refined_
=
grid_
->
adapt
();
// returns true if a least one entity was refined
...
...
@@ -72,7 +72,7 @@ namespace AMDiS
}
// Perform data adaption to the new grid
virtual
void
postAdapt
()
override
void
postAdapt
()
override
{
assert
(
grid_
!=
nullptr
);
if
(
mightCoarsen_
||
refined_
)
{
...
...
src/amdis/Marker.hpp
View file @
4bf4338f
...
...
@@ -164,10 +164,10 @@ namespace AMDiS
}
/// Can be used by sub classes. Called before traversal.
virtual
void
initMarking
(
AdaptInfo
&
adaptInfo
)
override
;
void
initMarking
(
AdaptInfo
&
adaptInfo
)
override
;
/// Marks one element.
virtual
void
markElement
(
AdaptInfo
&
adaptInfo
,
Element
const
&
elem
)
override
;
void
markElement
(
AdaptInfo
&
adaptInfo
,
Element
const
&
elem
)
override
;
/// Creates a scalar marker depending on the strategy set in parameters.
static
std
::
unique_ptr
<
EstimatorMarker
<
Grid
>
>
createMarker
(
std
::
string
const
&
name
,
...
...
@@ -220,7 +220,7 @@ namespace AMDiS
:
Super
{
name
,
component
,
est
,
grid
}
{}
virtual
void
markElement
(
AdaptInfo
&
adaptInfo
,
Element
const
&
elem
)
override
void
markElement
(
AdaptInfo
&
adaptInfo
,
Element
const
&
elem
)
override
{
if
(
this
->
refineAllowed_
)
this
->
mark
(
elem
,
1
);
...
...
@@ -252,7 +252,7 @@ namespace AMDiS
Parameters
::
get
(
name
+
"->MSGammaC"
,
msGammaC_
);
}
virtual
void
initMarking
(
AdaptInfo
&
adaptInfo
)
override
;
void
initMarking
(
AdaptInfo
&
adaptInfo
)
override
;
protected:
/// Marking parameter.
...
...
@@ -287,7 +287,7 @@ namespace AMDiS
Parameters
::
get
(
name
+
"->ESThetaC"
,
esThetaC_
);
}
virtual
void
initMarking
(
AdaptInfo
&
adaptInfo
)
override
;
void
initMarking
(
AdaptInfo
&
adaptInfo
)
override
;
protected:
/// Marking parameter.
...
...
@@ -324,7 +324,7 @@ namespace AMDiS
Parameters
::
get
(
name
+
"->GERSThetaC"
,
gersThetaC_
);
}
virtual
Flag
markGrid
(
AdaptInfo
&
adaptInfo
)
override
;
Flag
markGrid
(
AdaptInfo
&
adaptInfo
)
override
;
protected:
/// Refinement marking function.
...
...
@@ -387,12 +387,12 @@ namespace AMDiS
/// \brief Implementation of \ref Marker::markElement. Does nothing since marking is
/// done in \ref markGrid().
virtual
void
markElement
(
AdaptInfo
&
adaptInfo
,
Element
const
&
elem
)
final
{}
void
markElement
(
AdaptInfo
&
adaptInfo
,
Element
const
&
elem
)
final
{}
/// Mark element for refinement, if grid-function \ref gridFct_ evaluates to
/// a value larger than the current level and is marked for coarsening of
/// the result is less than the current value.
virtual
Flag
markGrid
(
AdaptInfo
&
adaptInfo
)
override
;
Flag
markGrid
(
AdaptInfo
&
adaptInfo
)
override
;
private:
/// Indicator function for adaptation
...
...
src/amdis/ProblemInstat.hpp
View file @
4bf4338f
...
...
@@ -41,13 +41,13 @@ namespace AMDiS
{}
/// Initialisation of the problem.
virtual
void
initialize
(
Flag
initFlag
=
INIT_NOTHING
);
void
initialize
(
Flag
initFlag
=
INIT_NOTHING
);
/// Implementation of \ref ProblemTimeInterface::initTimestep().
virtual
void
initTimestep
(
AdaptInfo
&
adaptInfo
)
override
;
void
initTimestep
(
AdaptInfo
&
adaptInfo
)
override
;
/// Implementation of \ref ProblemTimeInterface::closeTimestep().
virtual
void
closeTimestep
(
AdaptInfo
&
adaptInfo
)
override
;
void
closeTimestep
(
AdaptInfo
&
adaptInfo
)
override
;
/// Returns \ref problemStat.
ProblemType
&
problemStat
()
{
return
*
problemStat_
;
}
...
...
@@ -78,7 +78,7 @@ namespace AMDiS
}
/// Implementation of \ref ProblemTimeInterface::transferInitialSolution().
virtual
void
transferInitialSolution
(
AdaptInfo
&
adaptInfo
)
override
;
void
transferInitialSolution
(
AdaptInfo
&
adaptInfo
)
override
;
protected:
/// Used in \ref initialize() to create the \ref oldSolution_.
...
...
src/amdis/ProblemInstatBase.hpp
View file @
4bf4338f
...
...
@@ -33,13 +33,13 @@ namespace AMDiS
{}
/// Destructor.
virtual
~
ProblemInstatBase
()
=
default
;
~
ProblemInstatBase
()
override
=
default
;
/// Implementation of \ref ProblemTimeInterface::setTime().
virtual
void
setTime
(
AdaptInfo
&
adaptInfo
)
override
;
void
setTime
(
AdaptInfo
&
adaptInfo
)
override
;
/// Implementation of \ref ProblemTimeInterface::solveInitialProblem().
virtual
void
solveInitialProblem
(
AdaptInfo
&
adaptInfo
)
override
;
void
solveInitialProblem
(
AdaptInfo
&
adaptInfo
)
override
;
/// Return the name of the instationary problem \ref name_
virtual
std
::
string
const
&
name
()
const
...
...
src/amdis/ProblemStat.hpp
View file @
4bf4338f
...
...
@@ -254,15 +254,15 @@ namespace AMDiS
public:
/// Implementation of \ref ProblemStatBase::solve
virtual
void
solve
(
AdaptInfo
&
adaptInfo
,
bool
createMatrixData
=
true
,
bool
storeMatrixData
=
false
)
override
;
void
solve
(
AdaptInfo
&
adaptInfo
,
bool
createMatrixData
=
true
,
bool
storeMatrixData
=
false
)
override
;
/// Implementation of \ref ProblemStatBase::buildAfterCoarse
virtual
void
buildAfterAdapt
(
AdaptInfo
&
adaptInfo
,
Flag
flag
,
bool
asmMatrix
=
true
,
bool
asmVector
=
true
)
override
;
void
buildAfterAdapt
(
AdaptInfo
&
adaptInfo
,
Flag
flag
,
bool
asmMatrix
=
true
,
bool
asmVector
=
true
)
override
;
/// \brief Assemble the linear system by calling \ref buildAfterAdapt with
/// `asmMatrix` and `asmVector` set to true.
...
...
@@ -278,7 +278,7 @@ namespace AMDiS
public:
// get-methods
/// Implementation of \ref ProblemStatBase::name
virtual
std
::
string
const
&
name
()
const
override
{
return
name_
;
}
std
::
string
const
&
name
()
const
override
{
return
name_
;
}
/// Return a reference to the grid, \ref grid
...
...
@@ -416,25 +416,25 @@ namespace AMDiS
public:
// implementation of iteration interface methods
/// Implementation of \ref StandardProblemIteration::oneIteration.
virtual
Flag
oneIteration
(
AdaptInfo
&
adaptInfo
,
Flag
toDo
=
FULL_ITERATION
)
override
Flag
oneIteration
(
AdaptInfo
&
adaptInfo
,
Flag
toDo
=
FULL_ITERATION
)
override
{
return
StandardProblemIteration
::
oneIteration
(
adaptInfo
,
toDo
);
}
/// Implementation of \ref ProblemStatBase::estimate.
virtual
void
estimate
(
AdaptInfo
&
adaptInfo
)
override
{
/* do nothing. */
}
void
estimate
(
AdaptInfo
&
adaptInfo
)
override
{
/* do nothing. */
}
/// Implementation of \ref ProblemStatBase::refineMesh.
virtual
Flag
adaptGrid
(
AdaptInfo
&
adaptInfo
)
override
;
Flag
adaptGrid
(
AdaptInfo
&
adaptInfo
)
override
;
/// Implementation of \ref ProblemStatBase::markElements.
virtual
Flag
markElements
(
AdaptInfo
&
adaptInfo
)
override
;
Flag
markElements
(
AdaptInfo
&
adaptInfo
)
override
;
/// Uniform global grid coarsening by up to n level
virtual
Flag
globalCoarsen
(
int
n
)
override
;
Flag
globalCoarsen
(
int
n
)
override
;
/// Uniform global refinement by n level
virtual
Flag
globalRefine
(
int
n
)
override
;
Flag
globalRefine
(
int
n
)
override
;
private:
/// Name of this problem.
...
...
src/amdis/StandardProblemIteration.hpp
View file @
4bf4338f
...
...
@@ -22,27 +22,27 @@ namespace AMDiS
{}
/// Implementation of \ref ProblemIterationIterface::beginIteration()
virtual
void
beginIteration
(
AdaptInfo
&
adaptInfo
)
override
;
void
beginIteration
(
AdaptInfo
&
adaptInfo
)
override
;
/// Implementation of \ref ProblemIterationInterface::oneIteration()
virtual
Flag
oneIteration
(
AdaptInfo
&
adaptInfo
,
Flag
toDo
)
override
;
Flag
oneIteration
(
AdaptInfo
&
adaptInfo
,
Flag
toDo
)
override
;
/// Implementation of \ref ProblemIterationInterface::endIteration()
virtual
void
endIteration
(
AdaptInfo
&
adaptInfo
)
override
;
void
endIteration
(
AdaptInfo
&
adaptInfo
)
override
;
/// Returns the name of the problem.
virtual
std
::
string
const
&
name
()
const
override
;
std
::
string
const
&
name
()
const
override
;
virtual
int
numProblems
()
const
override
int
numProblems
()
const
override
{
return
1
;
}
/// Return the managed ProblemStat \ref problem, by number
virtual
ProblemStatBase
&
problem
(
int
number
=
0
)
override
;
ProblemStatBase
&
problem
(
int
number
=
0
)
override
;
/// Return the managed ProblemStat \ref problem, by name
virtual
ProblemStatBase
&
problem
(
std
::
string
const
&
name
)
override
;
ProblemStatBase
&
problem
(
std
::
string
const
&
name
)
override
;
protected:
/// Nested assemblage and mesh adaption.
...
...
src/amdis/linearalgebra/DOFVectorBase.hpp
View file @
4bf4338f
...
...
@@ -81,7 +81,7 @@ namespace AMDiS
}
/// Destructor
virtual
~
DOFVectorBase
()
override
~
DOFVectorBase
()
override
{
GridTransferManager
::
detach
(
*
this
);
}
...
...
@@ -140,7 +140,7 @@ namespace AMDiS
}
/// Resize the \ref vector to the size of the \ref basis and set to zero
virtual
void
compress
()
override
void
compress
()
override
{
if
(
size_type
(
backend_
.
size
())
!=
size
())
{
backend_
.
resize
(
size
());
...
...
@@ -206,13 +206,13 @@ namespace AMDiS
}
/// Implementation of \ref DOFVectorInterface::preAdapt
virtual
void
preAdapt
(
bool
mightCoarsen
)
override
void
preAdapt
(
bool
mightCoarsen
)
override
{
dataTransfer_
->
preAdapt
(
*
this
,
mightCoarsen
);
}
/// Implementation of \ref DOFVectorInterface::postAdapt
virtual
void
postAdapt
(
bool
refined
)
override
void
postAdapt
(
bool
refined
)
override
{
dataTransfer_
->
postAdapt
(
*
this
,
refined
);
}
...
...
src/amdis/linearalgebra/LinearSolver.hpp
View file @
4bf4338f
...
...
@@ -32,7 +32,7 @@ namespace AMDiS
/// A creator to be used instead of the constructor.
struct
Creator
:
CreatorInterfaceName
<
Super
>
{
virtual
std
::
unique_ptr
<
Super
>
createWithString
(
std
::
string
prefix
)
override
std
::
unique_ptr
<
Super
>
createWithString
(
std
::
string
prefix
)
override
{
return
std
::
make_unique
<
Self
>
(
prefix
);
}
...
...
@@ -52,8 +52,8 @@ namespace AMDiS
private:
/// Implements \ref LinearSolverInterface::solveSystemImpl()
virtual
void
solveImpl
(
Matrix
const
&
A
,
VectorX
&
x
,
VectorB
const
&
b
,
SolverInfo
&
solverInfo
)
override
void
solveImpl
(
Matrix
const
&
A
,
VectorX
&
x
,
VectorB
const
&
b
,
SolverInfo
&
solverInfo
)
override
{
Dune
::
Timer
t
;
if
(
solverInfo
.
doCreateMatrixData
())
{
...
...
src/amdis/linearalgebra/eigen/DirectRunner.hpp
View file @
4bf4338f
...
...
@@ -31,7 +31,7 @@ namespace AMDiS
}
/// Implementes \ref RunnerInterface::init()
virtual
void
init
(
Matrix
const
&
A
)
override
void
init
(
Matrix
const
&
A
)
override
{
if
(
!
reusePattern_
||
!
initialized_
)
{
solver_
.
analyzePattern
(
A
);
...
...
@@ -45,11 +45,11 @@ namespace AMDiS
/// Implementes \ref RunnerInterface::exit()
virtual
void
exit
()
override
{}
void
exit
()
override
{}
/// Implementes \ref RunnerInterface::solve()
virtual
int
solve
(
Matrix
const
&
A
,
VectorX
&
x
,
VectorB
const
&
b
,
SolverInfo
&
solverInfo
)
override
int
solve
(
Matrix
const
&
A
,
VectorX
&
x
,
VectorB
const
&
b
,
SolverInfo
&
solverInfo
)
override
{
x
=
solver_
.
solve
(
b
);
...
...
src/amdis/linearalgebra/eigen/IterativeRunner.hpp
View file @
4bf4338f
...
...
@@ -27,7 +27,7 @@ namespace AMDiS
/// Implementes \ref RunnerInterface::init()
virtual
void
init
(
Matrix
const
&
A
)
override
void
init
(
Matrix
const
&
A
)
override
{
if
(
!
reusePattern_
||
!
initialized_
)
{
solver_
.
analyzePattern
(
A
);
...
...
@@ -40,11 +40,11 @@ namespace AMDiS
}
/// Implementes \ref RunnerInterface::exit()
virtual
void
exit
()
override
{}
void
exit
()
override
{}
/// Implementes \ref RunnerInterface::solve()
virtual
int
solve
(
Matrix
const
&
A
,
VectorX
&
x
,
VectorB
const
&
b
,
SolverInfo
&
solverInfo
)
override
int
solve
(
Matrix
const
&
A
,
VectorX
&
x
,
VectorB
const
&
b
,
SolverInfo
&
solverInfo
)
override
{
solver_
.
setTolerance
(
solverInfo
.
relTolerance
());
x
=
solver_
.
solveWithGuess
(
b
,
x
);
...
...
src/amdis/linearalgebra/eigen/SolverCreator.hpp
View file @
4bf4338f
...
...
@@ -30,7 +30,7 @@ namespace AMDiS
using
SolverBase
=
LinearSolverInterface
<
Matrix
,
VectorX
,
VectorB
>
;
using
Scalar
=
typename
Matrix
::
Scalar
;
virtual
std
::
unique_ptr
<
SolverBase
>
createWithString
(
std
::
string
const
&
prefix
)
override
std
::
unique_ptr
<
SolverBase
>
createWithString
(
std
::
string
const
&
prefix
)
override
{
// get creator string for preconditioner
std
::
string
precon
=
"no"
;
...
...
src/amdis/linearalgebra/istl/DirectRunner.hpp
View file @
4bf4338f
...
...
@@ -29,19 +29,19 @@ namespace AMDiS
{}
/// Implementes \ref RunnerInterface::init()
virtual
void
init
(
Matrix
const
&
A
)
override
void
init
(
Matrix
const
&
A
)
override
{
solver_
=
solverCreator_
.
create
(
A
);
}
/// Implementes \ref RunnerInterface::exit()
virtual
void
exit
()
override
void
exit
()
override
{
solver_
.
reset
();
}
/// Implementes \ref RunnerInterface::solve()
virtual
int
solve
(
Matrix
const
&
A
,
VectorX
&
x
,
VectorB
const
&
b
,
int
solve
(
Matrix
const
&
A
,
VectorX
&
x
,
VectorB
const
&
b
,
SolverInfo
&
solverInfo
)
override
{
// storing some statistics
...
...
src/amdis/linearalgebra/istl/ISTLRunner.hpp
View file @
4bf4338f
...
...
@@ -27,7 +27,7 @@ namespace AMDiS
/// Implementes \ref RunnerInterface::init()
virtual
void
init
(
Matrix
const
&
A
)
override
void
init
(
Matrix
const
&
A
)
override
{
precon_
=
preconCreator_
->
create
(
A
);
linOperator_
=
std
::
make_shared
<
LinOperator
>
(
A
);
...
...
@@ -35,7 +35,7 @@ namespace AMDiS
}
/// Implementes \ref RunnerInterface::exit()
virtual
void
exit
()
override
void
exit
()
override
{
solver_
.
reset
();
linOperator_
.
reset
();
...
...
@@ -43,8 +43,8 @@ namespace AMDiS
}
/// Implementes \ref RunnerInterface::solve()
virtual
int
solve
(
Matrix
const
&
A
,
VectorX
&
x
,
VectorB
const
&
b
,
SolverInfo
&
solverInfo
)
override
int
solve
(
Matrix
const
&
A
,
VectorX
&
x
,
VectorB
const
&
b
,
SolverInfo
&
solverInfo
)
override
{
// storing some statistics
Dune
::
InverseOperatorResult
statistics
;
...
...
src/amdis/linearalgebra/istl/ISTL_Preconditioner.hpp
View file @
4bf4338f
...
...
@@ -30,7 +30,7 @@ namespace AMDiS
struct
Creator
:
CreatorInterfaceName
<
Super
>
{
virtual
std
::
unique_ptr
<
Super
>
createWithString
(
std
::
string
prefix
)
override
std
::
unique_ptr
<
Super
>
createWithString
(
std
::
string
prefix
)
override
{
return
std
::
make_unique
<
Self
>
(
prefix
);
}
...
...
@@ -43,7 +43,7 @@ namespace AMDiS
}
using
PreconBase
=
Dune
::
Preconditioner
<
VectorX
,
VectorB
>
;
virtual
std
::
unique_ptr
<
PreconBase
>
create
(
Matrix
const
&
A
)
const
override
std
::
unique_ptr
<
PreconBase
>
create
(
Matrix
const
&
A
)
const
override
{
return
createImpl
(
A
,
Type
<
Precon
>
{});
}
...
...
src/amdis/linearalgebra/mtl/KrylovRunner.hpp
View file @
4bf4338f
...
...
@@ -40,13 +40,13 @@ namespace AMDiS
}
/// Implements \ref RunnerInterface::lLeftPrecon(), Returns \ref L_
virtual
std
::
shared_ptr
<
PreconBase
>
leftPrecon
()
override
std
::
shared_ptr
<
PreconBase
>
leftPrecon
()
override
{
return
L_
;
}
/// Implements \ref RunnerInterface::rightPrecon(), Returns \ref R_
virtual
std
::
shared_ptr
<
PreconBase
>
rightPrecon
()
override
std
::
shared_ptr
<
PreconBase
>
rightPrecon
()
override
{
return
R_
;
}
...
...
@@ -64,22 +64,22 @@ namespace AMDiS
}
/// Implementation of \ref RunnerInterface::init()
virtual
void
init
(
Matrix
const
&
A
)
override
void
init
(
Matrix
const
&
A
)
override
{
L_
->
init
(
A
);
R_
->
init
(
A
);
}
/// Implementation of \ref RunnerInterface::exit()
virtual
void
exit
()
override
void
exit
()
override
{
L_
->
exit
();
R_
->
exit
();
}
/// Implementation of \ref RunnerInterface::solve()
virtual
int
solve
(
Matrix
const
&
A
,
Vector
&
x
,
Vector
const
&
b
,
SolverInfo
&
solverInfo
)
override
int
solve
(
Matrix
const
&
A
,
Vector
&
x
,
Vector
const
&
b
,
SolverInfo
&
solverInfo
)
override
{
test_exit
(
bool
(
L_
),
"There is no left preconditioner"
);
test_exit
(
bool
(
R_
),
"There is no right preconditioner"
);
...
...
src/amdis/linearalgebra/mtl/Preconditioner.hpp
View file @
4bf4338f
...
...
@@ -20,7 +20,7 @@ namespace AMDiS
/// A creator to be used instead of the constructor.
struct
Creator
:
CreatorInterface
<
Super
>
{
virtual
std
::
unique_ptr
<
Super
>
create
()
override
std
::
unique_ptr
<
Super
>
create
()
override
{
return
std
::
make_unique
<
Self
>
();
}
...
...
@@ -28,26 +28,26 @@ namespace AMDiS
public:
/// Implementation of \ref PreconditionerBase::init()
virtual
void
init
(
Matrix
const
&
fullMatrix
)
override
void
init
(
Matrix
const
&
fullMatrix
)
override
{
precon_
.
reset
(
new
PreconRunner
(
fullMatrix
));
}
/// Implementation of \ref PreconditionerInterface::exit()
virtual
void
exit
()
override
void
exit
()
override
{
precon_
.
reset
();
}
/// Implementation of \ref PreconditionerBase::solve()
virtual
void
solve
(
Vector
const
&
vin
,
Vector
&
vout
)
const
override
void
solve
(
Vector
const
&
vin
,
Vector
&
vout
)
const
override
{
test_exit_dbg
(
bool
(
precon_
),
"No preconditioner initialized!"
);
precon_
->
solve
(
vin
,
vout
);
}
/// Implementation of \ref PreconditionerBase::adjoint_solve()
virtual
void
adjoint_solve
(
Vector
const
&
vin
,
Vector
&
vout
)
const
override
void
adjoint_solve
(
Vector
const
&
vin
,
Vector
&
vout
)
const
override
{
test_exit_dbg
(
bool
(
precon_
),
"No preconditioner initialized!"
);
precon_
->
adjoint_solve
(
vin
,
vout
);
...
...
src/amdis/linearalgebra/mtl/UmfpackRunner.hpp
View file @
4bf4338f
...
...
@@ -47,8 +47,8 @@ namespace AMDiS
}
/// Implementation of \ref RunnerBase::solve()
virtual
int
solve
(
Matrix
const
&
A
,
Vector
&
x
,
Vector
const
&
b
,
SolverInfo
&
solverInfo
)
override
int
solve
(
Matrix
const
&
A
,
Vector
&
x
,
Vector
const
&
b
,
SolverInfo
&
solverInfo
)
override
{
AMDIS_FUNCNAME
(
"Umfpack_Runner::solve()"
);
test_exit
(
bool
(
solver_
),
"The umfpack solver was not initialized
\n
"
);
...
...
@@ -71,7 +71,7 @@ namespace AMDiS
}
/// Implementation of \ref RunnerInterface::exit()
virtual
void
exit
()
override
{}
void
exit
()
override
{}
protected:
std
::
shared_ptr
<
SolverType
>
solver_
;
...
...
@@ -98,7 +98,7 @@ namespace AMDiS
{}
/// Implementation of \ref RunnerInterface::init()
virtual
void
init
(
FullMatrix
const
&
fullMatrix
)
override
void
init
(
FullMatrix
const
&
fullMatrix
)
override
{
try
{
Super
::
solver_
.
reset
(
new
SolverType
(
fullMatrix
,
Super
::
symmetricStrategy_
,
Super
::
allocInit_
));
...
...
src/amdis/utility/QuadratureFactory.hpp
View file @
4bf4338f
...
...
@@ -54,14 +54,14 @@ namespace AMDiS
"Polynomial order of GridFunction can not be extracted. Provide an explicit order parameter instead."
);
public:
virtual
void
bind
(
LocalFunction
const
&
localFct
)
final
void
bind
(
LocalFunction
const
&
localFct
)
final
{
order_
=
Dune
::
Hybrid
::
ifElse
(
Concept
{},
[
&
](
auto
id
)
{
return
AMDiS
::
order
(
id
(
localFct
));
},
[]
(
auto
)
{
return
-
1
;
});
}
virtual
int
order
()
const
final
{
return
order_
;
}
int
order
()
const
final
{
return
order_
;
}
private:
int
order_
=
-
1
;
...
...
@@ -106,9 +106,9 @@ namespace AMDiS
,
qt_
(
qt
)
{}
virtual
int
order
()
const
final
{
return
order_
;
}
int
order
()
const
final
{
return
order_
;
}