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
2fb89998
Commit
2fb89998
authored
May 17, 2016
by
Praetorius, Simon
Browse files
demos use neumann-boundary
parent
a4faf367
Changes
6
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
2fb89998
cmake_minimum_required
(
VERSION 3.0
)
project
(
dune-amdis CXX
)
set
(
ALBERTA_ROOT /opt/software/alberta
)
set
(
ALBERTA_INCLUDE_DIR /opt/software/alberta/include
)
#
set(ALBERTA_ROOT /opt/software/alberta)
#
set(ALBERTA_INCLUDE_DIR /opt/software/alberta/include)
# set(CMAKE_PREFIX_PATH /opt/software/dune/lib/cmake)
# set(UG_DIR /opt/software/dune/lib/cmake/ug)
# set(Vc_DIR /opt/software/dune/lib/cmake/Vc)
set
(
MTL_DIR
${
CMAKE_SOURCE_DIR
}
/install/MTL/share/mtl
)
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
...
...
dune/amdis/CMakeLists.txt
View file @
2fb89998
...
...
@@ -39,7 +39,9 @@ if (Boost_FOUND)
endif
(
Boost_FOUND
)
find_package
(
MTL REQUIRED
)
find_package
(
MTL REQUIRED
PATHS
${
CMAKE_SOURCE_DIR
}
/install/MTL/share/mtl
/iwr/modules/mtl4/share/mtl
)
if
(
MTL_FOUND
)
target_include_directories
(
"duneamdis"
PUBLIC
${
MTL_INCLUDE_DIRS
}
)
# target_link_libraries("duneamdis" PUBLIC ${MTL_LIBRARIES})
...
...
@@ -49,14 +51,14 @@ if (MTL_FOUND)
foreach
(
feature
${
CXX_ELEVEN_FEATURE_LIST
}
)
target_compile_definitions
(
"duneamdis"
PUBLIC MTL_WITH_
${
feature
}
)
endforeach
()
if
(
HAVE_UMFPACK OR ENABLE_SUITESPARSE OR SuiteSparse_FOUND
)
target_compile_definitions
(
"duneamdis"
PUBLIC MTL_HAS_UMFPACK
)
endif
()
endif
(
MTL_FOUND
)
install
(
FILES
install
(
FILES
AdaptBase.hpp
AdaptInfo.hpp
AdaptInstationary.hpp
...
...
init/ellipt.json.2d
View file @
2fb89998
...
...
@@ -19,7 +19,7 @@
},
"output": {
"filename": "
output/
ellipt.2d",
"filename": "ellipt.2d",
"output directory": "output"
}
}
...
...
src/CMakeLists.txt
View file @
2fb89998
set
(
projects2d
"heat"
"pfc"
"stokes"
"navier_stokes"
)
set
(
projects2d
"ellipt"
"heat"
"pfc"
"stokes"
"navier_stokes"
)
foreach
(
project
${
projects2d
}
)
add_executable
(
${
project
}
2d
${
project
}
.cc
)
...
...
src/ellipt.cc
View file @
2fb89998
...
...
@@ -9,11 +9,12 @@
#include
<dune/amdis/ProblemStat.hpp>
#include
<dune/amdis/Terms.hpp>
#include
<dune/amdis/common/Literals.hpp>
#include
<dune/amdis/BoundaryElementIterator.hpp>
using
namespace
AMDiS
;
// 1 component with polynomial degree 1
using
ElliptParam
=
ProblemStatTraits
<
AMDIS_DIM
,
AMDIS_DOW
,
1
>
;
using
ElliptParam
=
DefaultTraitsMesh
<
Dune
::
AlbertaGrid
<
AMDIS_DIM
,
AMDIS_DOW
>
,
AMDIS_DIM
,
AMDIS_DOW
,
1
>
;
using
ElliptProblem
=
ProblemStat
<
ElliptParam
>
;
using
ElliptProblemInstat
=
ProblemInstat
<
ElliptParam
>
;
...
...
@@ -57,6 +58,19 @@ int main(int argc, char** argv)
prob
.
solve
(
adaptInfo
);
prob
.
writeFiles
(
adaptInfo
,
true
);
AMDIS_MSG
(
"----------------------------"
);
for
(
auto
const
&
b
:
boundary_elements
(
*
prob
.
getMeshView
()))
AMDIS_MSG
(
"b = "
<<
b
.
geometry
().
center
());
AMDIS_MSG
(
"----------------------------"
);
size_t
i
=
0
;
for
(
auto
const
&
f
:
boundary_facets
(
*
prob
.
getMeshView
()))
{
AMDIS_MSG
(
"f = "
<<
f
.
geometry
().
center
()
/* << ", id = " << f.boundaryId()*/
);
if
(
i
++
>=
10
)
break
;
}
AMDiS
::
finalize
();
return
0
;
}
\ No newline at end of file
src/heat.cc
View file @
2fb89998
...
...
@@ -13,27 +13,27 @@
using
namespace
AMDiS
;
class
HeatParam
{
template
<
class
...
Bs
>
using
FeSpaceTuple
=
std
::
tuple
<
Bs
...
>
;
template
<
class
Mesh
,
int
deg
>
using
Lagrange
=
Dune
::
Functions
::
PQkNodalBasis
<
typename
Mesh
::
LeafGridView
,
deg
>
;
public:
static
constexpr
int
dim
=
AMDIS_DIM
;
static
constexpr
int
dimworld
=
AMDIS_DOW
;
static
constexpr
int
nComponents
=
1
;
// default values
using
Mesh
=
Dune
::
UGGrid
<
dim
>
;
using
FeSpaces
=
FeSpaceTuple
<
Lagrange
<
Mesh
,
2
>>
;
};
//
class HeatParam
//
{
//
template <class... Bs>
//
using FeSpaceTuple = std::tuple<Bs...>;
//
//
template <class Mesh, int deg>
//
using Lagrange = Dune::Functions::PQkNodalBasis<typename Mesh::LeafGridView, deg>;
//
//
public:
//
static constexpr int dim = AMDIS_DIM;
//
static constexpr int dimworld = AMDIS_DOW;
//
static constexpr int nComponents = 1;
//
//
// default values
//
using Mesh = Dune::UGGrid<dim>;
//
using FeSpaces = FeSpaceTuple<Lagrange<Mesh, 2>>;
//
};
// 1 component with polynomial degree 1
//
using HeatParam =
ProblemStatTraits
<AMDIS_DIM, AMDIS_DOW,
1
>;
using
HeatParam
=
DefaultTraitsMesh
<
Dune
::
AlbertaGrid
<
AMDIS_DIM
,
AMDIS_DOW
>
,
AMDIS_DIM
,
AMDIS_DOW
,
2
>
;
using
HeatProblem
=
ProblemStat
<
HeatParam
>
;
using
HeatProblemInstat
=
ProblemInstat
<
HeatParam
>
;
...
...
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