Skip to content
GitLab
Menu
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
ac9e1f4c
Commit
ac9e1f4c
authored
Dec 26, 2020
by
Praetorius, Simon
Browse files
Merge branch 'issue/fix_merge_errors' into 'master'
fix problems after merge See merge request
!259
parents
4e161587
5522fcd3
Changes
9
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
ac9e1f4c
...
@@ -16,7 +16,7 @@ dune-2.7:
...
@@ -16,7 +16,7 @@ dune-2.7:
-
dunecontrol --current make -j2 examples
-
dunecontrol --current make -j2 examples
dune-git-clang
:
dune-git-clang
:
image
:
registry.dune-project.org/docker/ci/dune:git-
ubuntu-18.04-clang-6
-17
image
:
registry.dune-project.org/docker/ci/dune:git-
debian-10-clang-7-libcpp
-17
script
:
script
:
-
duneci-standard-test
-
duneci-standard-test
-
dunecontrol --current make -j2 examples
-
dunecontrol --current make -j2 examples
...
...
CHANGELOG.md
0 → 100644
View file @
ac9e1f4c
## Master (will become release v0.4)
-
Restructuring of local operators. Introduce (global)
`Operator`
class and use type-erasure
for the storage of
`LocalOperator`
s in the operator list. In the
`GridFunctionLocalOperator`
the local-function is passed to the
`assemble()`
method directly.
-
Move recursive algorithms to subdirectoy
`amdis/algorithm/`
-
Rename
`Recursive::Apply`
into
`Recursive::Map`
## Release v0.3
See release notes on https://gitlab.mn.tu-dresden.de/amdis/amdis-core/-/releases/v0.3
\ No newline at end of file
amdis/BiLinearForm.inc.hpp
View file @
ac9e1f4c
...
@@ -42,7 +42,7 @@ assemble(RowLocalView const& rowLocalView, ColLocalView const& colLocalView,
...
@@ -42,7 +42,7 @@ assemble(RowLocalView const& rowLocalView, ColLocalView const& colLocalView,
elementMatrix_
=
0
;
elementMatrix_
=
0
;
auto
const
&
gv
=
this
->
rowBasis
().
gridView
();
auto
const
&
gv
=
this
->
rowBasis
().
gridView
();
GlobalContext
context
{
gv
,
rowLocalView
.
element
(),
rowLocalView
.
element
().
geometry
()};
GlobalContext
<
TYPEOF
(
gv
)
>
context
{
gv
,
rowLocalView
.
element
(),
rowLocalView
.
element
().
geometry
()};
Traversal
::
forEachNode
(
rowLocalView
.
treeCache
(),
[
&
](
auto
const
&
rowNode
,
auto
rowTp
)
{
Traversal
::
forEachNode
(
rowLocalView
.
treeCache
(),
[
&
](
auto
const
&
rowNode
,
auto
rowTp
)
{
Traversal
::
forEachNode
(
colLocalView
.
treeCache
(),
[
&
](
auto
const
&
colNode
,
auto
colTp
)
{
Traversal
::
forEachNode
(
colLocalView
.
treeCache
(),
[
&
](
auto
const
&
colNode
,
auto
colTp
)
{
...
...
amdis/ContextGeometry.hpp
View file @
ac9e1f4c
...
@@ -58,7 +58,7 @@ namespace AMDiS
...
@@ -58,7 +58,7 @@ namespace AMDiS
};
};
/// Constructor. Stores pointer to localContext, element, and geometry.
/// Constructor. Stores pointer to localContext, element, and geometry.
ContextGeometry
(
L
ocalContext
const
&
localContext
,
Element
const
&
element
,
Geometry
const
&
geometry
)
ContextGeometry
(
L
C
const
&
localContext
,
Element
const
&
element
,
Geometry
const
&
geometry
)
:
localContext_
(
&
localContext
)
:
localContext_
(
&
localContext
)
,
element_
(
&
element
)
,
element_
(
&
element
)
,
geometry_
(
&
geometry
)
,
geometry_
(
&
geometry
)
...
@@ -175,7 +175,7 @@ namespace AMDiS
...
@@ -175,7 +175,7 @@ namespace AMDiS
};
};
/// Constructor. Stores a copy of gridView and a pointer to element and geometry.
/// Constructor. Stores a copy of gridView and a pointer to element and geometry.
GlobalContext
(
G
ridView
const
&
gridView
,
Element
const
&
element
,
GlobalContext
(
G
V
const
&
gridView
,
Element
const
&
element
,
Geometry
const
&
geometry
)
Geometry
const
&
geometry
)
:
gridView_
(
gridView
)
:
gridView_
(
gridView
)
,
element_
(
&
element
)
,
element_
(
&
element
)
...
...
amdis/LinearForm.inc.hpp
View file @
ac9e1f4c
...
@@ -36,7 +36,7 @@ assemble(LocalView const& localView, LocalOperators& localOperators)
...
@@ -36,7 +36,7 @@ assemble(LocalView const& localView, LocalOperators& localOperators)
elementVector_
=
0
;
elementVector_
=
0
;
auto
const
&
gv
=
this
->
basis
().
gridView
();
auto
const
&
gv
=
this
->
basis
().
gridView
();
GlobalContext
context
{
gv
,
localView
.
element
(),
localView
.
element
().
geometry
()};
GlobalContext
<
TYPEOF
(
gv
)
>
context
{
gv
,
localView
.
element
(),
localView
.
element
().
geometry
()};
Traversal
::
forEachNode
(
localView
.
treeCache
(),
[
&
](
auto
const
&
node
,
auto
tp
)
{
Traversal
::
forEachNode
(
localView
.
treeCache
(),
[
&
](
auto
const
&
node
,
auto
tp
)
{
auto
&
rhsOp
=
localOperators
[
tp
];
auto
&
rhsOp
=
localOperators
[
tp
];
...
...
amdis/linearalgebra/mtl/VectorBackend.hpp
View file @
ac9e1f4c
...
@@ -93,13 +93,13 @@ namespace AMDiS
...
@@ -93,13 +93,13 @@ namespace AMDiS
namespace
Recursive
namespace
Recursive
{
{
template
<
class
T
>
template
<
class
T
>
struct
ForEach
<
ISTLBlock
Vector
<
T
>>
:
ForEach
<
VectorBase
<
ISTLBlock
Vector
<
T
>>>
{};
struct
ForEach
<
MTL
Vector
<
T
>>
:
ForEach
<
VectorBase
<
MTL
Vector
<
T
>>>
{};
template
<
class
T
>
template
<
class
T
>
struct
Transform
<
ISTLBlock
Vector
<
T
>>
:
Transform
<
VectorBase
<
ISTLBlock
Vector
<
T
>>>
{};
struct
Transform
<
MTL
Vector
<
T
>>
:
Transform
<
VectorBase
<
MTL
Vector
<
T
>>>
{};
template
<
class
T
>
template
<
class
T
>
struct
InnerProduct
<
ISTLBlock
Vector
<
T
>>
:
InnerProduct
<
VectorBase
<
ISTLBlock
Vector
<
T
>>>
{};
struct
InnerProduct
<
MTL
Vector
<
T
>>
:
InnerProduct
<
VectorBase
<
MTL
Vector
<
T
>>>
{};
}
// end namespace Recursive
}
// end namespace Recursive
}
// end namespace AMDiS
}
// end namespace AMDiS
amdis/linearalgebra/petsc/VectorBackend.hpp
View file @
ac9e1f4c
...
@@ -224,7 +224,7 @@ namespace AMDiS
...
@@ -224,7 +224,7 @@ namespace AMDiS
assert
(
localGhostedVec
!=
nullptr
);
assert
(
localGhostedVec
!=
nullptr
);
// A pointer to a contiguous array that contains this processor's portion of the vector data.
// A pointer to a contiguous array that contains this processor's portion of the vector data.
PetscScalar
*
ptr
;
PetscScalar
*
ptr
;
VecGetArray
(
localGhostedVec
,
&
ptr
);
VecGetArray
(
localGhostedVec
,
&
ptr
);
for
(
auto
const
&
dof
:
localInd
)
for
(
auto
const
&
dof
:
localInd
)
...
@@ -250,7 +250,7 @@ namespace AMDiS
...
@@ -250,7 +250,7 @@ namespace AMDiS
void
forEachLocal
(
Func
&&
f
)
const
void
forEachLocal
(
Func
&&
f
)
const
{
{
// A pointer to a contiguous array that contains this processor's portion of the vector data.
// A pointer to a contiguous array that contains this processor's portion of the vector data.
PetscScalar
*
ptr
;
PetscScalar
const
*
ptr
;
VecGetArrayRead
(
vector_
,
&
ptr
);
VecGetArrayRead
(
vector_
,
&
ptr
);
for
(
size_type
i
=
0
;
i
<
localSize
();
++
i
)
for
(
size_type
i
=
0
;
i
<
localSize
();
++
i
)
...
@@ -281,7 +281,7 @@ namespace AMDiS
...
@@ -281,7 +281,7 @@ namespace AMDiS
static
void
transformLocal
(
PetscVector
&
vecOut
,
Operation
op
,
VecIns
const
&
...
vecIn
)
static
void
transformLocal
(
PetscVector
&
vecOut
,
Operation
op
,
VecIns
const
&
...
vecIn
)
{
{
PetscScalar
*
ptrOut
;
PetscScalar
*
ptrOut
;
std
::
array
<
PetscScalar
*
,
sizeof
...(
VecIns
)
>
ptrsIn
{};
std
::
array
<
PetscScalar
const
*
,
sizeof
...(
VecIns
)
>
ptrsIn
{};
// Obtain ptrs to internal local arrays
// Obtain ptrs to internal local arrays
VecGetArray
(
vecOut
.
vector_
,
&
ptrOut
);
VecGetArray
(
vecOut
.
vector_
,
&
ptrOut
);
...
@@ -289,7 +289,7 @@ namespace AMDiS
...
@@ -289,7 +289,7 @@ namespace AMDiS
VecGetArrayRead
(
std
::
get
<
ii
>
(
std
::
tie
(
vecIn
...)).
vector_
,
&
ptrsIn
[
ii
]);
VecGetArrayRead
(
std
::
get
<
ii
>
(
std
::
tie
(
vecIn
...)).
vector_
,
&
ptrsIn
[
ii
]);
});
});
for
(
size_type
i
=
0
;
i
<
localSize
();
++
i
)
{
for
(
size_type
i
=
0
;
i
<
vecOut
.
localSize
();
++
i
)
{
auto
idx
=
vecOut
.
dofMap_
.
dofToLocal
(
i
);
auto
idx
=
vecOut
.
dofMap_
.
dofToLocal
(
i
);
Ranges
::
applyIndices
<
sizeof
...(
VecIns
)
>
([
&
](
auto
...
ii
)
{
Ranges
::
applyIndices
<
sizeof
...(
VecIns
)
>
([
&
](
auto
...
ii
)
{
ptrOut
[
idx
]
=
op
(
ptrsIn
[
ii
][
idx
]...);
ptrOut
[
idx
]
=
op
(
ptrsIn
[
ii
][
idx
]...);
...
@@ -306,15 +306,16 @@ namespace AMDiS
...
@@ -306,15 +306,16 @@ namespace AMDiS
/// Perform the `op1(init, op2(value1, value2))` on the local elements of [in1] and [in2]
/// Perform the `op1(init, op2(value1, value2))` on the local elements of [in1] and [in2]
// [[not collective]]
// [[not collective]]
template
<
class
T
,
class
BinOp1
,
class
BinOp2
>
template
<
class
T
,
class
BinOp1
,
class
BinOp2
>
static
T
innerProductLocal
(
PetscVector
const
&
in1
,
PetscVector
const
&
in2
,
T
init
,
BinOp1
op1
,
BinOp2
op2
)
static
T
innerProductLocal
(
PetscVector
const
&
in1
,
PetscVector
const
&
in2
,
T
init
,
BinOp1
op1
,
BinOp2
op2
)
{
{
PetscScalar
*
ptr1
,
*
ptr2
;
PetscScalar
const
*
ptr1
;
PetscScalar
const
*
ptr2
;
// Obtain ptrs to internal local arrays
// Obtain ptrs to internal local arrays
VecGetArrayRead
(
in1
.
vector_
,
&
ptr1
);
VecGetArrayRead
(
in1
.
vector_
,
&
ptr1
);
VecGetArrayRead
(
in2
.
vector_
,
&
ptr2
);
VecGetArrayRead
(
in2
.
vector_
,
&
ptr2
);
for
(
size_type
i
=
0
;
i
<
localSize
();
++
i
)
{
for
(
size_type
i
=
0
;
i
<
in1
.
localSize
();
++
i
)
{
auto
idx
=
in1
.
dofMap_
.
dofToLocal
(
i
);
auto
idx
=
in1
.
dofMap_
.
dofToLocal
(
i
);
init
=
op1
(
std
::
move
(
init
),
op2
(
ptr1
[
idx
],
ptr2
[
idx
]));
init
=
op1
(
std
::
move
(
init
),
op2
(
ptr1
[
idx
],
ptr2
[
idx
]));
}
}
...
@@ -322,6 +323,8 @@ namespace AMDiS
...
@@ -322,6 +323,8 @@ namespace AMDiS
// Restore array obtained with VecGetArrayRead()
// Restore array obtained with VecGetArrayRead()
VecRestoreArrayRead
(
in1
.
vector_
,
&
ptr1
);
VecRestoreArrayRead
(
in1
.
vector_
,
&
ptr1
);
VecRestoreArrayRead
(
in2
.
vector_
,
&
ptr2
);
VecRestoreArrayRead
(
in2
.
vector_
,
&
ptr2
);
return
init
;
}
}
/// Set all entries to \p value, including the ghost entries
/// Set all entries to \p value, including the ghost entries
...
@@ -419,7 +422,7 @@ namespace AMDiS
...
@@ -419,7 +422,7 @@ namespace AMDiS
struct
InnerProduct
<
PetscVector
<
DofMap
>>
struct
InnerProduct
<
PetscVector
<
DofMap
>>
{
{
template
<
class
T
,
class
BinOp1
,
class
BinOp2
>
template
<
class
T
,
class
BinOp1
,
class
BinOp2
>
static
T
impl
(
PetscVector
<
DofMap
>
const
&
in1
,
PetscVector
<
DofMap
>
const
&
in2
,
T
init
,
BinOp1
op1
,
BinOp2
op2
)
static
T
impl
(
PetscVector
<
DofMap
>
const
&
in1
,
PetscVector
<
DofMap
>
const
&
in2
,
T
init
,
BinOp1
op1
,
BinOp2
op2
)
{
{
return
PetscVector
<
DofMap
>::
innerProductLocal
(
in1
,
in2
,
std
::
move
(
init
),
op1
,
op2
);
return
PetscVector
<
DofMap
>::
innerProductLocal
(
in1
,
in2
,
std
::
move
(
init
),
op1
,
op2
);
}
}
...
...
test/CMakeLists.txt
View file @
ac9e1f4c
# set(DUNE_MAX_TEST_CORES 4)
# set(DUNE_MAX_TEST_CORES 4)
# additional compiler option for CMAKE_BUILD_TYPE=RelWithDebInfo only for gcc
set
(
NoVarTrackingAssignments $<$<AND:$<CONFIG:RelWithDebInfo>,$<CXX_COMPILER_ID:GNU>>:-fno-var-tracking-assignments>
)
dune_add_test
(
SOURCES AdaptInfoTest.cpp
dune_add_test
(
SOURCES AdaptInfoTest.cpp
LINK_LIBRARIES amdis
)
LINK_LIBRARIES amdis
)
...
@@ -10,10 +13,11 @@ foreach(_GRID RANGE 7)
...
@@ -10,10 +13,11 @@ foreach(_GRID RANGE 7)
dune_add_test
(
NAME
"BackupRestoreTest_
${
_GRID
}
"
dune_add_test
(
NAME
"BackupRestoreTest_
${
_GRID
}
"
SOURCES BackupRestoreTest.cpp
SOURCES BackupRestoreTest.cpp
COMPILE_DEFINITIONS
"GRID_ID=
${
_GRID
}
"
COMPILE_DEFINITIONS
"GRID_ID=
${
_GRID
}
"
COMPILE_FLAGS
"-fno-var-tracking-assignments"
LABELS
"BackupRestore"
LABELS
"BackupRestore"
LINK_LIBRARIES amdis
)
LINK_LIBRARIES amdis
)
add_dune_alberta_flags
(
GRIDDIM 2 WORLDDIM 2
"BackupRestoreTest_
${
_GRID
}
"
)
add_dune_alberta_flags
(
GRIDDIM 2 WORLDDIM 2
"BackupRestoreTest_
${
_GRID
}
"
)
target_compile_options
(
BackupRestoreTest_
${
_GRID
}
PRIVATE
${
NoVarTrackingAssignments
}
)
endforeach
()
endforeach
()
unset
(
_GRID
)
unset
(
_GRID
)
...
@@ -105,12 +109,13 @@ foreach(_GRID RANGE 6)
...
@@ -105,12 +109,13 @@ foreach(_GRID RANGE 6)
dune_add_test
(
NAME
"ParallelIndexSetTest_
${
_GRID
}
"
dune_add_test
(
NAME
"ParallelIndexSetTest_
${
_GRID
}
"
SOURCES ParallelIndexSetTest.cpp
SOURCES ParallelIndexSetTest.cpp
COMPILE_DEFINITIONS
"GRID_ID=
${
_GRID
}
"
COMPILE_DEFINITIONS
"GRID_ID=
${
_GRID
}
"
COMPILE_FLAGS
"-fno-var-tracking-assignments"
LABELS
"ParallelIndexSetTest"
LABELS
"ParallelIndexSetTest"
LINK_LIBRARIES amdis
LINK_LIBRARIES amdis
MPI_RANKS 2 3 4
MPI_RANKS 2 3 4
TIMEOUT 300
TIMEOUT 300
CMAKE_GUARD MPI_FOUND
)
CMAKE_GUARD MPI_FOUND
)
target_compile_options
(
ParallelIndexSetTest_
${
_GRID
}
PRIVATE
${
NoVarTrackingAssignments
}
)
endforeach
()
endforeach
()
unset
(
_GRID
)
unset
(
_GRID
)
endif
()
endif
()
...
...
test/OperatorsTest.cpp
View file @
ac9e1f4c
...
@@ -24,9 +24,9 @@ void test_local_operator(LOp&& lop, LocalView const& localView, MatVec& matVec,
...
@@ -24,9 +24,9 @@ void test_local_operator(LOp&& lop, LocalView const& localView, MatVec& matVec,
[[
maybe_unused
]]
auto
context
=
[
&
]{
[[
maybe_unused
]]
auto
context
=
[
&
]{
if
constexpr
(
Dune
::
Std
::
is_detected_v
<
IsOperatorList
,
LOp
>
)
if
constexpr
(
Dune
::
Std
::
is_detected_v
<
IsOperatorList
,
LOp
>
)
return
GlobalContext
{
gridView
,
element
,
geometry
};
return
GlobalContext
<
TYPEOF
(
gridView
)
>
{
gridView
,
element
,
geometry
};
else
else
return
ContextGeometry
{
element
,
element
,
geometry
};
return
ContextGeometry
<
TYPEOF
(
element
)
>
{
element
,
element
,
geometry
};
}();
}();
lop
.
bind
(
element
);
lop
.
bind
(
element
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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