Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
amdis
amdis-core
Commits
f6447413
Commit
f6447413
authored
Sep 17, 2018
by
Praetorius, Simon
Browse files
removed a lot obsolete code
parent
9e2dadcb
Changes
46
Hide whitespace changes
Inline
Side-by-side
examples/convection_diffusion.cc
View file @
f6447413
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifdef HAVE_CONFIG_H
#include
"config.h"
#endif
#include
<iostream>
#include
<amdis/AMDiS.hpp>
...
...
@@ -26,13 +26,13 @@ int main(int argc, char** argv)
// -div(A*grad(u)) + div(b*u) + c*u = f
auto
opCD
=
convectionDiffusion
(
/*A=*/
1.0
,
/*b=*/
0.0
,
/*c=*/
1.0
,
/*f=*/
1.0
);
prob
.
addMatrixOperator
(
opCD
,
_
0
,
_
0
);
prob
.
addVectorOperator
(
opCD
,
_
0
);
prob
.
addMatrixOperator
(
opCD
,
0
,
0
);
prob
.
addVectorOperator
(
opCD
,
0
);
// set boundary condition
auto
predicate
=
[](
auto
const
&
x
){
return
x
[
0
]
<
1.e-8
||
x
[
1
]
<
1.e-8
;
};
// define boundary
auto
dbcValues
=
[](
auto
const
&
x
){
return
0.0
;
};
// set value
prob
.
addDirichletBC
(
predicate
,
_
0
,
_
0
,
dbcValues
);
prob
.
addDirichletBC
(
predicate
,
0
,
0
,
dbcValues
);
AdaptInfo
adaptInfo
(
"adapt"
);
prob
.
buildAfterCoarsen
(
adaptInfo
,
Flag
(
0
));
...
...
examples/ellipt.cc
View file @
f6447413
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifdef HAVE_CONFIG_H
#include
"config.h"
#endif
#include
<iostream>
#include
<fmt/core.h>
...
...
examples/heat.cc
View file @
f6447413
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifdef HAVE_CONFIG_H
#include
"config.h"
#endif
#include
<iostream>
#include
<amdis/AMDiS.hpp>
...
...
examples/navier_stokes.cc
View file @
f6447413
#ifdef HAVE_CONFIG_H
#include
"config.h"
#endif
#include
<iostream>
#include
<ctime>
#include
<cmath>
...
...
@@ -41,8 +45,8 @@ int main(int argc, char** argv)
AdaptInfo
adaptInfo
(
"adapt"
);
// tree-paths for components
auto
_v
=
0
_c
;
auto
_p
=
1
_c
;
auto
_v
=
Dune
::
Indices
::
_0
;
auto
_p
=
Dune
::
Indices
::
_1
;
// <1/tau * u, v>
auto
opTime
=
makeOperator
(
tag
::
testvec_trialvec
{},
density
);
...
...
examples/stokes0.cc
View file @
f6447413
#ifdef HAVE_CONFIG_H
#include
"config.h"
#endif
#include
<iostream>
#include
<ctime>
#include
<cmath>
...
...
@@ -30,8 +34,8 @@ int main(int argc, char** argv)
Parameters
::
get
(
"stokes->viscosity"
,
viscosity
);
// tree-paths for components
auto
_v
=
0
_c
;
auto
_p
=
1
_c
;
auto
_v
=
Dune
::
Indices
::
_0
;
auto
_p
=
Dune
::
Indices
::
_1
;
// <viscosity*grad(u_i), grad(v_i)>
for
(
std
::
size_t
i
=
0
;
i
<
DOW
;
++
i
)
{
...
...
examples/stokes1.cc
View file @
f6447413
#ifdef HAVE_CONFIG_H
#include
"config.h"
#endif
#include
<iostream>
#include
<ctime>
#include
<cmath>
...
...
@@ -30,8 +34,8 @@ int main(int argc, char** argv)
Parameters
::
get
(
"stokes->viscosity"
,
viscosity
);
// tree-paths for components
auto
_v
=
0
_c
;
auto
_p
=
1
_c
;
auto
_v
=
Dune
::
Indices
::
_0
;
auto
_p
=
Dune
::
Indices
::
_1
;
// <viscosity*grad(u_i), grad(v_i)>
for
(
std
::
size_t
i
=
0
;
i
<
DOW
;
++
i
)
{
...
...
examples/stokes3.cc
View file @
f6447413
#ifdef HAVE_CONFIG_H
#include
"config.h"
#endif
#include
<iostream>
#include
<ctime>
#include
<cmath>
...
...
@@ -24,8 +28,8 @@ int main(int argc, char** argv)
Parameters
::
get
(
"stokes->viscosity"
,
viscosity
);
// tree-paths for components
auto
_v
=
0
_c
;
auto
_p
=
1
_c
;
auto
_v
=
Dune
::
Indices
::
_0
;
auto
_p
=
Dune
::
Indices
::
_1
;
auto
opStokes
=
makeOperator
(
tag
::
stokes
{},
viscosity
);
prob
.
addMatrixOperator
(
opStokes
,
treepath
(),
treepath
());
...
...
examples/vecellipt.cc
View file @
f6447413
#ifdef HAVE_CONFIG_H
#include
"config.h"
#endif
#include
<iostream>
#include
<amdis/AMDiS.hpp>
...
...
src/amdis/Assembler.hpp
View file @
f6447413
...
...
@@ -10,7 +10,6 @@
#include
<amdis/LinearAlgebra.hpp>
#include
<amdis/LocalAssemblerList.hpp>
#include
<amdis/common/Mpl.hpp>
#include
<amdis/common/TypeDefs.hpp>
namespace
AMDiS
{
...
...
src/amdis/Assembler.inc.hpp
View file @
f6447413
...
...
@@ -24,8 +24,8 @@ void Assembler<Traits>::assemble(
// 2. create a local matrix and vector
std
::
size_t
localSize
=
localView
.
maxSize
();
Impl
::
ElementMatrix
elementMatrix
(
localSize
,
localSize
);
Impl
::
ElementVector
elementVector
(
localSize
);
mtl
::
mat
::
dense2D
<
typename
SystemMatrixType
::
value_type
>
elementMatrix
(
localSize
,
localSize
);
mtl
::
vec
::
dense_vector
<
typename
SystemVectorType
::
value_type
>
elementVector
(
localSize
);
// 3. traverse grid and assemble operators on the elements
for
(
auto
const
&
element
:
elements
(
globalBasis_
.
gridView
()))
...
...
src/amdis/DirichletBC.hpp
View file @
f6447413
...
...
@@ -11,12 +11,14 @@
#include
<amdis/Output.hpp>
#include
<amdis/common/Concepts.hpp>
#include
<amdis/common/ValueCategory.hpp>
#include
<amdis/linear_algebra/
mtl/MTLDenseVecto
r.hpp>
#include
<amdis/linear_algebra/
HierarchicWrappe
r.hpp>
#include
<amdis/utility/RangeType.hpp>
#include
<amdis/utility/TreeData.hpp>
namespace
AMDiS
{
struct
BoundaryType
{
int
b
;
};
/// Implements a boundary condition of Dirichlet-type.
/**
* By calling the methods \ref init() and \ref finish before and after
...
...
@@ -82,13 +84,13 @@ namespace AMDiS
using
Dune
::
Functions
::
interpolate
;
Dune
::
Hybrid
::
ifElse
(
std
::
is_same
<
RangeType_t
<
typename
RowBasis
::
LocalView
::
Tree
>
,
Range
>
{},
[
&
](
auto
id
)
{
auto
rhsWrapper
=
w
rapper
(
rhs
.
vector
());
auto
rhsWrapper
=
hierarchicVectorW
rapper
(
rhs
.
vector
());
interpolate
(
id
(
rowBasis
),
rhsWrapper
,
values_
,
dirichletNodes_
);
});
Dune
::
Hybrid
::
ifElse
(
std
::
is_same
<
RangeType_t
<
typename
ColBasis
::
LocalView
::
Tree
>
,
Range
>
{},
[
&
](
auto
id
)
{
auto
solutionWrapper
=
w
rapper
(
solution
.
vector
());
auto
solutionWrapper
=
hierarchicVectorW
rapper
(
solution
.
vector
());
interpolate
(
id
(
colBasis
),
solutionWrapper
,
values_
,
dirichletNodes_
);
});
...
...
src/amdis/DirichletBC.inc.hpp
View file @
f6447413
...
...
@@ -3,9 +3,6 @@
#include
<dune/functions/functionspacebases/boundarydofs.hh>
#include
<dune/functions/functionspacebases/interpolate.hh>
#include
<dune/functions/functionspacebases/subspacebasis.hh>
#include
<amdis/LinearAlgebra.hpp>
#include
<amdis/linear_algebra/HierarchicWrapper.hpp>
#include
<amdis/linear_algebra/mtl/MTLDenseVector.hpp>
namespace
AMDiS
{
...
...
src/amdis/LinearAlgebra.hpp
View file @
f6447413
...
...
@@ -2,30 +2,7 @@
#include
<amdis/linear_algebra/LinearSolverInterface.hpp>
#include
<amdis/linear_algebra/SolverInfo.hpp>
#if defined(AMDIS_BACKEND_ISTL)
#include
<amdis/linear_algebra/istl/SystemVector.hpp>
#include
<amdis/linear_algebra/istl/SystemMatrix.hpp>
#include
<amdis/linear_algebra/istl/LinearSolver.hpp>
#elif defined(AMDIS_BACKEND_MTL)
#include
<amdis/linear_algebra/mtl/SystemVector.hpp>
#include
<amdis/linear_algebra/mtl/SystemMatrix.hpp>
#include
<amdis/linear_algebra/mtl/DOFVector.hpp>
#include
<amdis/linear_algebra/mtl/DOFMatrix.hpp>
#include
<amdis/linear_algebra/mtl/LinearSolver.hpp>
#include
<amdis/linear_algebra/mtl/ITL_Solver.hpp>
#include
<amdis/linear_algebra/mtl/BITL_Solver.hpp>
#elif defined(AMDIS_BACKEND_PETSC)
#include
<amdis/linear_algebra/petsc/SystemVector.hpp>
#include
<amdis/linear_algebra/petsc/SystemMatrix.hpp>
#include
<amdis/linear_algebra/petsc/LinearSolver.hpp>
#else
#error "Unknown linear algebra backend!. Set corresponding variable \
AMDIS_BACKEND_ISTL, AMDIS_BACKEND_MTL or AMDIS_BACKEND_PETSC."
#endif
\ No newline at end of file
src/amdis/LocalAssemblerBase.hpp
View file @
f6447413
...
...
@@ -2,9 +2,9 @@
#include
<type_traits>
#include
<boost/numeric/mtl/mtl.hpp>
#include
<amdis/ContextGeometry.hpp>
// #include <amdis/common/ConceptsBase.hpp>
#include
<amdis/common/TypeDefs.hpp>
namespace
AMDiS
{
...
...
@@ -22,10 +22,13 @@ namespace AMDiS
static_assert
(
numNodes
==
1
||
numNodes
==
2
,
"VectorAssembler gets 1 Node, MatrixAssembler gets 2 Nodes!"
);
using
ElementMatrix
=
mtl
::
mat
::
dense2D
<
double
>
;
// TODO: choose correct value_type
using
ElementVector
=
mtl
::
vec
::
dense_vector
<
double
>
;
/// Either an ElementVector or an ElementMatrix (depending on the number of nodes)
using
ElementMatrixVector
=
std
::
conditional_t
<
(
sizeof
...(
Nodes
)
==
1
),
Impl
::
ElementVector
,
std
::
conditional_t
<
(
sizeof
...(
Nodes
)
==
2
),
Impl
::
ElementMatrix
,
void
>>
;
(
sizeof
...(
Nodes
)
==
1
),
ElementVector
,
std
::
conditional_t
<
(
sizeof
...(
Nodes
)
==
2
),
ElementMatrix
,
void
>>
;
public:
/// Virtual destructor
...
...
src/amdis/ProblemStat.hpp
View file @
f6447413
...
...
@@ -27,7 +27,6 @@
#include
<amdis/StandardProblemIteration.hpp>
#include
<amdis/common/TupleUtility.hpp>
#include
<amdis/common/TypeDefs.hpp>
#include
<amdis/common/Utility.hpp>
#include
<amdis/GridFunctions.hpp>
...
...
src/amdis/common/CMakeLists.txt
View file @
f6447413
...
...
@@ -19,7 +19,6 @@ install(FILES
Size.hpp
Tags.hpp
TupleUtility.hpp
TypeDefs.hpp
Utility.hpp
ValueCategory.hpp
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/amdis/common
)
src/amdis/common/TypeDefs.hpp
deleted
100644 → 0
View file @
9e2dadcb
#pragma once
#include
<type_traits>
#include
<amdis/linear_algebra/Mtl.hpp>
namespace
AMDiS
{
namespace
Impl
{
using
ElementVector
=
mtl
::
dense_vector
<
double
>
;
using
ElementMatrix
=
mtl
::
dense2D
<
double
>
;
using
SystemVector
=
mtl
::
dense_vector
<
double
>
;
using
SystemMatrix
=
mtl
::
compressed2D
<
double
>
;
}
// end namespace Impl
struct
BoundaryType
{
int
b
;
};
}
// end namespace AMDiS
src/amdis/linear_algebra/CMakeLists.txt
View file @
f6447413
...
...
@@ -2,9 +2,7 @@
install
(
FILES
HierarchicWrapper.hpp
LinearAlgebraBase.hpp
LinearSolverInterface.hpp
Mtl.hpp
PreconditionerInterface.hpp
RunnerInterface.hpp
SolverInfo.hpp
...
...
src/amdis/linear_algebra/DOFVector
Bas
e.hpp
→
src/amdis/linear_algebra/DOFVector
Interfac
e.hpp
View file @
f6447413
...
...
@@ -2,11 +2,11 @@
namespace
AMDiS
{
class
DOFVector
Bas
e
class
DOFVector
Interfac
e
{
public:
/// Virtual destructor
~
DOFVector
Bas
e
()
=
default
;
~
DOFVector
Interfac
e
()
=
default
;
/// Change dimension of DOFVector to dimension of basis
virtual
void
compress
()
=
0
;
...
...
src/amdis/linear_algebra/HierarchicWrapper.hpp
View file @
f6447413
#pragma once
#include
<boost/numeric/mtl/mtl_fwd.hpp>
#include
<dune/functions/functionspacebases/sizeinfo.hh>
#include
<amdis/utility/MultiIndex.hpp>
...
...
@@ -86,7 +87,7 @@ namespace AMDiS
}
template
<
class
...
Params
>
std
::
size_t
sizeImpl
(
mtl
::
dense_vector
<
Params
...
>
const
&
v
)
const
std
::
size_t
sizeImpl
(
mtl
::
vec
::
dense_vector
<
Params
...
>
const
&
v
)
const
{
return
mtl
::
size
(
v
);
}
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment