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
1681e00a
Commit
1681e00a
authored
Jan 28, 2018
by
Praetorius, Simon
Browse files
renamed path dune/amdis to amdis
parent
91f95d14
Changes
213
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
1681e00a
cmake_minimum_required
(
VERSION 3.1
)
project
(
dune-amdis CXX
)
if
(
NOT
(
dune-common_DIR OR dune-common_ROOT OR
"
${
CMAKE_PREFIX_PATH
}
"
MATCHES
".*dune-common.*"
))
string
(
REPLACE
${
CMAKE_PROJECT_NAME
}
dune-common dune-common_DIR
${
PROJECT_BINARY_DIR
}
)
endif
()
project
(
amdis CXX
)
#find dune-common and set the module path
find_package
(
dune-common REQUIRED
)
...
...
@@ -17,33 +11,30 @@ include(DuneMacros)
# start a dune project with information from dune.module
dune_project
()
dune_enable_all_packages
(
MODULE_LIBRARIES amdis
)
include
(
AmdisMacros
)
add_subdirectory
(
"src"
)
add_subdirectory
(
"test"
)
add_subdirectory
(
"
dune
"
)
add_subdirectory
(
"
examples
"
)
add_subdirectory
(
"doc"
)
add_subdirectory
(
"cmake/modules"
)
# some additional packages and flags
add_dune_alberta_flags
(
"amdis"
OBJECT USE_GENERIC
)
target_compile_definitions
(
"amdis"
PUBLIC AMDIS_BACKEND_MTL=1
)
target_compile_options
(
"amdis"
PUBLIC -ftemplate-backtrace-limit=0 -Wall -pedantic -Wno-unused-parameter
)
find_package
(
MTL REQUIRED
PATHS /usr/local/lib/mtl4 /opt/sources/mtl4 /opt/development/mtl4
)
if
(
MTL_FOUND
)
target_include_directories
(
"
amdis
"
PUBLIC
${
MTL_INCLUDE_DIRS
}
)
target_include_directories
(
amdis PUBLIC
${
MTL_INCLUDE_DIRS
}
)
set
(
CXX_ELEVEN_FEATURE_LIST
"MOVE"
"AUTO"
"RANGEDFOR"
"INITLIST"
"STATICASSERT"
"DEFAULTIMPL"
)
foreach
(
feature
${
CXX_ELEVEN_FEATURE_LIST
}
)
target_compile_definitions
(
"
amdis
"
PUBLIC MTL_WITH_
${
feature
}
)
target_compile_definitions
(
amdis PUBLIC MTL_WITH_
${
feature
}
)
endforeach
()
if
(
HAVE_UMFPACK OR ENABLE_SUITESPARSE OR SuiteSparse_FOUND
)
target_compile_definitions
(
"
amdis
"
PUBLIC MTL_HAS_UMFPACK
)
target_compile_definitions
(
amdis PUBLIC MTL_HAS_UMFPACK
)
endif
()
endif
(
MTL_FOUND
)
...
...
cmake/modules/AmdisMacros.cmake
View file @
1681e00a
# File for module specific CMake tests.
include
(
AMDiSCXXFeatures
)
\ No newline at end of file
include
(
AMDiSCXXFeatures
)
#find_package(SuiteSparse)
#find_package(Alberta)
\ No newline at end of file
doc/Mainpage.md
View file @
1681e00a
...
...
@@ -13,10 +13,10 @@ and \f$ g(x) \equiv 0 \f$, the domain \f$ \Omega \f$ a square domain \f$ [0,1]^2
and
\f
$
\G
amma
\f
$ the lower and left edge of the boundary.
~~~~~~~~~~~~~~~
{.cpp}
#include <
dune/
amdis/AMDiS.hpp>
#include <
dune/
amdis/AdaptInfo.hpp>
#include <
dune/
amdis/AdaptStationary.hpp>
#include <
dune/
amdis/ProblemStat.hpp>
#include <amdis/AMDiS.hpp>
#include <amdis/AdaptInfo.hpp>
#include <amdis/AdaptStationary.hpp>
#include <amdis/ProblemStat.hpp>
// The namespace all AMDiS classes and functions are defined in
using namespace AMDiS;
...
...
dune.module
View file @
1681e00a
...
...
@@ -3,7 +3,7 @@
################################
#Name of the module
Module
:
dune
-
amdis
Module
:
amdis
Version
:
0.1
Maintainer
:
simon
.
praetorius
@
tu
-
dresden
.
de
#depending on
...
...
dune/CMakeLists.txt
deleted
100644 → 0
View file @
91f95d14
add_subdirectory
(
amdis
)
# add_subdirectory(amdis/test)
\ No newline at end of file
dune/amdis/LinearAlgebra.hpp
deleted
100644 → 0
View file @
91f95d14
#pragma once
#include
<dune/amdis/linear_algebra/LinearSolverInterface.hpp>
#include
<dune/amdis/linear_algebra/SolverInfo.hpp>
#if defined(AMDIS_BACKEND_ISTL)
#include
<dune/amdis/linear_algebra/istl/SystemVector.hpp>
#include
<dune/amdis/linear_algebra/istl/SystemMatrix.hpp>
#include
<dune/amdis/linear_algebra/istl/LinearSolver.hpp>
#elif defined(AMDIS_BACKEND_MTL)
#include
<dune/amdis/linear_algebra/mtl/SystemVector.hpp>
#include
<dune/amdis/linear_algebra/mtl/SystemMatrix.hpp>
#include
<dune/amdis/linear_algebra/mtl/LinearSolver.hpp>
#include
<dune/amdis/linear_algebra/mtl/ITL_Solver.hpp>
#include
<dune/amdis/linear_algebra/mtl/BITL_Solver.hpp>
#elif defined(AMDIS_BACKEND_PETSC)
#include
<dune/amdis/linear_algebra/petsc/SystemVector.hpp>
#include
<dune/amdis/linear_algebra/petsc/SystemMatrix.hpp>
#include
<dune/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
examples/CMakeLists.txt
0 → 100644
View file @
1681e00a
set
(
projects2d
"ellipt"
"heat"
"vecellipt"
"stokes0"
"stokes1"
"stokes3"
"navier_stokes"
)
foreach
(
project
${
projects2d
}
)
add_executable
(
${
project
}
.2d
${
project
}
.cc
)
add_dune_alberta_flags
(
GRIDDIM 2 WORLDDIM 2
${
project
}
.2d
)
target_link_dune_default_libraries
(
${
project
}
.2d
)
target_link_libraries
(
${
project
}
.2d
"amdis"
)
target_compile_definitions
(
${
project
}
.2d PRIVATE AMDIS_DIM=2 AMDIS_DOW=2
)
endforeach
()
set
(
projects3d
"ellipt"
"heat"
)
foreach
(
project
${
projects3d
}
)
add_executable
(
${
project
}
.3d
${
project
}
.cc
)
add_dune_alberta_flags
(
GRIDDIM 3 WORLDDIM 3
${
project
}
.3d
)
target_link_dune_default_libraries
(
${
project
}
.3d
)
target_link_libraries
(
${
project
}
.3d
"amdis"
)
target_compile_definitions
(
${
project
}
.3d PRIVATE AMDIS_DIM=3 AMDIS_DOW=3
)
endforeach
()
\ No newline at end of file
src
/ellipt.cc
→
examples
/ellipt.cc
View file @
1681e00a
...
...
@@ -3,10 +3,10 @@
#include
<iostream>
#include
<
dune/
amdis/AMDiS.hpp>
#include
<
dune/
amdis/ProblemStat.hpp>
#include
<
dune/
amdis/Operators.hpp>
#include
<
dune/
amdis/common/Literals.hpp>
#include
<amdis/AMDiS.hpp>
#include
<amdis/ProblemStat.hpp>
#include
<amdis/Operators.hpp>
#include
<amdis/common/Literals.hpp>
using
namespace
AMDiS
;
...
...
src
/heat.cc
→
examples
/heat.cc
View file @
1681e00a
...
...
@@ -3,13 +3,13 @@
#include
<iostream>
#include
<
dune/
amdis/AMDiS.hpp>
#include
<
dune/
amdis/AdaptInstationary.hpp>
#include
<
dune/
amdis/ProblemInstat.hpp>
#include
<
dune/
amdis/ProblemStat.hpp>
#include
<
dune/
amdis/Operators.hpp>
#include
<
dune/
amdis/GridFunctions.hpp>
#include
<
dune/
amdis/common/Literals.hpp>
#include
<amdis/AMDiS.hpp>
#include
<amdis/AdaptInstationary.hpp>
#include
<amdis/ProblemInstat.hpp>
#include
<amdis/ProblemStat.hpp>
#include
<amdis/Operators.hpp>
#include
<amdis/GridFunctions.hpp>
#include
<amdis/common/Literals.hpp>
using
namespace
AMDiS
;
...
...
src
/navier_stokes.cc
→
examples
/navier_stokes.cc
View file @
1681e00a
...
...
@@ -2,27 +2,18 @@
#include
<ctime>
#include
<cmath>
#include
<dune/amdis/AMDiS.hpp>
#include
<dune/amdis/AdaptInstationary.hpp>
#include
<dune/amdis/ProblemStat.hpp>
#include
<dune/amdis/ProblemInstat.hpp>
#include
<dune/amdis/Operators.hpp>
#include
<dune/amdis/assembler/StokesOperator.hpp>
#ifdef DOW
#undef DOW
#endif
#define DOW AMDIS_DOW
#ifndef STRATEGY
#define STRATEGY 1
#endif
#include
<amdis/AMDiS.hpp>
#include
<amdis/AdaptInstationary.hpp>
#include
<amdis/ProblemStat.hpp>
#include
<amdis/ProblemInstat.hpp>
#include
<amdis/Operators.hpp>
#include
<amdis/assembler/StokesOperator.hpp>
using
namespace
AMDiS
;
struct
NavierStokesBasis
{
using
Grid
=
Dune
::
Alberta
Grid
<
AMDIS_DIM
,
AMDIS_DOW
>
;
using
Grid
=
Dune
::
Yasp
Grid
<
AMDIS_DIM
>
;
using
GlobalBasis
=
typename
TaylorHoodBasis
<
Grid
::
LeafGridView
>::
GlobalBasis
;
};
...
...
@@ -69,7 +60,7 @@ int main(int argc, char** argv)
auto
opNonlin1
=
makeOperator
(
tag
::
testvec_trialvec
{},
density
*
trans
(
gradientAtQP
(
prob
.
getSolution
(
_v
))));
prob
.
addMatrixOperator
(
opNonlin1
,
_v
,
_v
);
for
(
std
::
size_t
i
=
0
;
i
<
DOW
;
++
i
)
{
for
(
std
::
size_t
i
=
0
;
i
<
AMDIS_
DOW
;
++
i
)
{
// <(u^old * nabla)u_i, v_i>
auto
opNonlin2
=
makeOperator
(
tag
::
test_gradtrial
{},
density
*
prob
.
getSolution
(
_v
));
prob
.
addMatrixOperator
(
opNonlin2
,
treepath
(
_v
,
i
),
treepath
(
_v
,
i
));
...
...
src
/BlockPreconditioner.hpp
→
examples/old
/BlockPreconditioner.hpp
View file @
1681e00a
#pragma once
#include
<
dune/
amdis/AMDiS.hpp>
#include
<
dune/
amdis/LinearAlgebra.hpp>
#include
<amdis/AMDiS.hpp>
#include
<amdis/LinearAlgebra.hpp>
namespace
AMDiS
{
...
...
src
/MTLPfcPrecon.hpp
→
examples/old
/MTLPfcPrecon.hpp
View file @
1681e00a
#pragma once
#include
"BlockPreconditioner.hpp"
#include
<
dune/
amdis/common/Literals.hpp>
#include
<amdis/common/Literals.hpp>
namespace
AMDiS
{
...
...
src
/MTLPfcPrecon.inc.hpp
→
examples/old
/MTLPfcPrecon.inc.hpp
View file @
1681e00a
File moved
src
/PfcPrecon.hpp
→
examples/old
/PfcPrecon.hpp
View file @
1681e00a
...
...
@@ -9,7 +9,7 @@
#include
<dune/istl/multitypeblockvector.hh>
#include
<dune/istl/preconditioner.hh>
#include
<
dune/
amdis/common/Mpl.hpp>
#include
<amdis/common/Mpl.hpp>
namespace
AMDiS
{
...
...
src
/pfc.cc
→
examples/old
/pfc.cc
View file @
1681e00a
...
...
@@ -5,11 +5,11 @@
#include
<ctime>
#include
<cmath>
#include
<
dune/
amdis/AMDiS.hpp>
#include
<
dune/
amdis/AdaptInstationary.hpp>
#include
<
dune/
amdis/ProblemStat.hpp>
#include
<
dune/
amdis/ProblemInstat.hpp>
#include
<
dune/
amdis/Terms.hpp>
#include
<amdis/AMDiS.hpp>
#include
<amdis/AdaptInstationary.hpp>
#include
<amdis/ProblemStat.hpp>
#include
<amdis/ProblemInstat.hpp>
#include
<amdis/Terms.hpp>
#include
"MTLPfcPrecon.hpp"
...
...
src
/stokes0.cc
→
examples
/stokes0.cc
View file @
1681e00a
...
...
@@ -2,9 +2,9 @@
#include
<ctime>
#include
<cmath>
#include
<
dune/
amdis/AMDiS.hpp>
#include
<
dune/
amdis/ProblemStat.hpp>
#include
<
dune/
amdis/Operators.hpp>
#include
<amdis/AMDiS.hpp>
#include
<amdis/ProblemStat.hpp>
#include
<amdis/Operators.hpp>
#ifdef DOW
#undef DOW
...
...
@@ -47,6 +47,8 @@ int main(int argc, char** argv)
prob
.
addMatrixOperator
(
opDiv
,
_p
,
treepath
(
_v
,
i
));
}
auto
opZero
=
makeOperator
(
tag
::
test_trial
{},
0.0
);
prob
.
addMatrixOperator
(
opZero
,
_p
,
_p
);
// define boundary regions
auto
left
=
[](
auto
const
&
x
)
{
return
x
[
0
]
<
1.e-8
;
};
...
...
@@ -74,6 +76,11 @@ int main(int argc, char** argv)
// assemble and solve system
prob
.
buildAfterCoarsen
(
adaptInfo
,
Flag
(
0
));
// write matrix to file
mtl
::
io
::
matrix_market_ostream
out
(
"matrix_stokes0.mtx"
);
out
<<
prob
.
getSystemMatrix
()
->
getMatrix
();
std
::
cout
<<
prob
.
getSystemMatrix
()
->
getMatrix
()
<<
'\n'
;
prob
.
solve
(
adaptInfo
);
// output solution
...
...
src
/stokes1.cc
→
examples
/stokes1.cc
View file @
1681e00a
...
...
@@ -2,9 +2,9 @@
#include
<ctime>
#include
<cmath>
#include
<
dune/
amdis/AMDiS.hpp>
#include
<
dune/
amdis/ProblemStat.hpp>
#include
<
dune/
amdis/Operators.hpp>
#include
<amdis/AMDiS.hpp>
#include
<amdis/ProblemStat.hpp>
#include
<amdis/Operators.hpp>
#ifdef DOW
#undef DOW
...
...
@@ -78,14 +78,9 @@ int main(int argc, char** argv)
prob
.
buildAfterCoarsen
(
adaptInfo
,
Flag
(
0
));
// write matrix to file
if
(
Parameters
::
get
<
int
>
(
"stokesMesh->global refinements"
).
value_or
(
0
)
<
2
)
{
mtl
::
io
::
matrix_market_ostream
out
(
"stokes_matrix.mtx"
);
out
<<
prob
.
getSystemMatrix
()
->
getMatrix
();
std
::
cout
<<
"A =
\n
"
<<
prob
.
getSystemMatrix
()
->
getMatrix
()
<<
'\n'
;
std
::
cout
<<
"x =
\n
"
<<
prob
.
getSolution
()
->
getVector
()
<<
'\n'
;
std
::
cout
<<
"b =
\n
"
<<
prob
.
getRhs
()
->
getVector
()
<<
'\n'
;
}
mtl
::
io
::
matrix_market_ostream
out
(
"matrix_stokes1.mtx"
);
out
<<
prob
.
getSystemMatrix
()
->
getMatrix
();
std
::
cout
<<
prob
.
getSystemMatrix
()
->
getMatrix
()
<<
'\n'
;
prob
.
solve
(
adaptInfo
);
...
...
src
/stokes3.cc
→
examples
/stokes3.cc
View file @
1681e00a
...
...
@@ -2,10 +2,10 @@
#include
<ctime>
#include
<cmath>
#include
<
dune/
amdis/AMDiS.hpp>
#include
<
dune/
amdis/ProblemStat.hpp>
#include
<
dune/
amdis/Operators.hpp>
#include
<
dune/
amdis/assembler/StokesOperator.hpp>
#include
<amdis/AMDiS.hpp>
#include
<amdis/ProblemStat.hpp>
#include
<amdis/Operators.hpp>
#include
<amdis/assembler/StokesOperator.hpp>
using
namespace
AMDiS
;
...
...
@@ -30,6 +30,9 @@ int main(int argc, char** argv)
auto
opStokes
=
makeOperator
(
tag
::
stokes
{},
viscosity
);
prob
.
addMatrixOperator
(
opStokes
,
treepath
(),
treepath
());
auto
opZero
=
makeOperator
(
tag
::
test_trial
{},
0.0
);
prob
.
addMatrixOperator
(
opZero
,
_p
,
_p
);
// define boundary regions
auto
left
=
[](
auto
const
&
x
)
{
return
x
[
0
]
<
1.e-8
;
};
auto
not_left
=
[](
auto
const
&
x
)
{
return
x
[
0
]
>
1.0
-
1.e-8
||
x
[
1
]
<
1.e-8
||
x
[
1
]
>
1.0
-
1.e-8
;
};
...
...
src
/vecellipt.cc
→
examples
/vecellipt.cc
View file @
1681e00a
#include
<iostream>
#include
<
dune/
amdis/AMDiS.hpp>
#include
<
dune/
amdis/ProblemStat.hpp>
#include
<
dune/
amdis/Operators.hpp>
#include
<amdis/AMDiS.hpp>
#include
<amdis/ProblemStat.hpp>
#include
<amdis/Operators.hpp>
using
namespace
AMDiS
;
...
...
src/CMakeLists.txt
View file @
1681e00a
set
(
projects2d
"ellipt"
"heat"
"vecellipt"
"expressions"
"stokes0"
"stokes1"
"stokes3"
)
foreach
(
project
${
projects2d
}
)
add_executable
(
${
project
}
.2d
${
project
}
.cc
)
add_dune_alberta_flags
(
GRIDDIM 2 WORLDDIM 2
${
project
}
.2d
)
target_link_dune_default_libraries
(
${
project
}
.2d
)
target_link_libraries
(
${
project
}
.2d
"amdis"
)
target_compile_definitions
(
${
project
}
.2d PRIVATE AMDIS_DIM=2 AMDIS_DOW=2
)
endforeach
()
set
(
projects3d
"ellipt"
"heat"
)
foreach
(
project
${
projects3d
}
)
add_executable
(
${
project
}
.3d
${
project
}
.cc
)
add_dune_alberta_flags
(
GRIDDIM 3 WORLDDIM 3
${
project
}
.3d
)
target_link_dune_default_libraries
(
${
project
}
.3d
)
target_link_libraries
(
${
project
}
.3d
"amdis"
)
target_compile_definitions
(
${
project
}
.3d PRIVATE AMDIS_DIM=3 AMDIS_DOW=3
)
endforeach
()
\ No newline at end of file
add_subdirectory
(
amdis
)
\ No newline at end of file
Prev
1
2
3
4
5
…
11
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