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
84fb5d3c
Commit
84fb5d3c
authored
May 23, 2018
by
Praetorius, Simon
Browse files
several bugs in current branch resolved
parent
b23d88cd
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/amdis/Assembler.inc.hpp
View file @
84fb5d3c
...
...
@@ -38,7 +38,7 @@ void Assembler<Traits>::assemble(
auto
geometry
=
element
.
geometry
();
// traverse type-tree of global-basis
forEachNode
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
rowNode
,
auto
rowTreePath
)
AMDiS
::
forEachNode
_
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
rowNode
,
auto
rowTreePath
)
{
auto
rowBasis
=
Dune
::
Functions
::
subspaceBasis
(
globalBasis_
,
rowTreePath
);
auto
rowLocalView
=
rowBasis
.
localView
();
...
...
@@ -56,7 +56,7 @@ void Assembler<Traits>::assemble(
this
->
assembleElementOperators
(
element
,
rhsOp
,
vecAssembler
);
}
forEachNode
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
colNode
,
auto
colTreePath
)
AMDiS
::
forEachNode
_
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
colNode
,
auto
colTreePath
)
{
auto
&
matOp
=
matrixOperators_
[
rowNode
][
colNode
];
if
(
matOp
.
assemble
(
asmMatrix
)
&&
!
matOp
.
empty
())
{
...
...
@@ -98,9 +98,9 @@ void Assembler<Traits>::assemble(
}
// unbind all operators
forEachNode
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
rowNode
,
auto
&&
)
{
AMDiS
::
forEachNode
_
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
rowNode
,
auto
&&
)
{
rhsOperators_
[
rowNode
].
unbind
();
forEachNode
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
colNode
,
auto
&&
)
{
AMDiS
::
forEachNode
_
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
colNode
,
auto
&&
)
{
matrixOperators_
[
rowNode
][
colNode
].
unbind
();
});
});
...
...
@@ -155,7 +155,7 @@ void Assembler<Traits>::initMatrixVector(
rhs
=
0
;
auto
localView
=
globalBasis_
.
localView
();
forEachNode
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
rowNode
,
auto
rowTreePath
)
AMDiS
::
forEachNode
_
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
rowNode
,
auto
rowTreePath
)
{
#ifdef HAVE_EXTENDED_DUNE_FUNCTIONS
if
(
rowNode
.
isLeaf
)
...
...
@@ -164,7 +164,7 @@ void Assembler<Traits>::initMatrixVector(
auto
rowBasis
=
Dune
::
Functions
::
subspaceBasis
(
globalBasis_
,
rowTreePath
);
forEachNode
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
colNode
,
auto
colTreePath
)
AMDiS
::
forEachNode
_
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
colNode
,
auto
colTreePath
)
{
auto
colBasis
=
Dune
::
Functions
::
subspaceBasis
(
globalBasis_
,
colTreePath
);
...
...
@@ -187,14 +187,14 @@ std::size_t Assembler<Traits>::finishMatrixVector(
matrix
.
finish
();
auto
localView
=
globalBasis_
.
localView
();
forEachNode
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
rowNode
,
auto
rowTreePath
)
AMDiS
::
forEachNode
_
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
rowNode
,
auto
rowTreePath
)
{
auto
rowBasis
=
Dune
::
Functions
::
subspaceBasis
(
globalBasis_
,
rowTreePath
);
auto
&
rhsOp
=
rhsOperators_
[
rowNode
];
if
(
rhsOp
.
assemble
(
asmVector
))
rhsOp
.
assembled
=
true
;
forEachNode
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
colNode
,
auto
colTreePath
)
AMDiS
::
forEachNode
_
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
colNode
,
auto
colTreePath
)
{
auto
colBasis
=
Dune
::
Functions
::
subspaceBasis
(
globalBasis_
,
colTreePath
);
auto
&
matOp
=
matrixOperators_
[
rowNode
][
colNode
];
...
...
src/amdis/Mesh.hpp
View file @
84fb5d3c
...
...
@@ -68,11 +68,12 @@ namespace AMDiS
/// A creator class for meshes. Each mesh needs different way of initialization
template
<
class
Grid
>
class
MeshCreator
struct
MeshCreator
{
static
std
::
unique_ptr
<
Grid
>
create
(
std
::
string
meshName
)
{
error_exit
(
"Creator not yet implemented for this mesh type."
);
return
{};
}
};
...
...
src/amdis/ProblemStat.hpp
View file @
84fb5d3c
...
...
@@ -80,7 +80,7 @@ namespace AMDiS
ProblemStat
(
std
::
string
name
,
Grid
&
grid
)
:
ProblemStat
(
name
)
{
gridName
=
""
;
this
->
grid
=
Dune
::
stackobject_to_shared_ptr
(
grid
)
;
Parameters
::
get
(
name
+
"->mesh"
,
gridName
);
}
...
...
@@ -277,7 +277,12 @@ namespace AMDiS
void
createGlobalBasis
()
{
globalBasis
=
std
::
make_shared
<
GlobalBasis
>
(
makeGlobalBasis
<
GlobalBasis
>
(
grid
->
leafGridView
()));
globalTree
=
std
::
make_shared
<
typename
GlobalBasis
::
LocalView
::
Tree
>
(
globalBasis
->
localView
().
tree
());
initGlobalBasis
(
*
globalBasis
);
}
void
initGlobalBasis
(
GlobalBasis
const
&
globalBasis
)
{
globalTree
=
std
::
make_shared
<
typename
GlobalBasis
::
LocalView
::
Tree
>
(
globalBasis
.
localView
().
tree
());
matrixOperators
.
init
(
*
globalTree
);
rhsOperators
.
init
(
*
globalTree
);
constraints
.
init
(
*
globalTree
);
...
...
src/amdis/ProblemStat.inc.hpp
View file @
84fb5d3c
...
...
@@ -113,7 +113,7 @@ template <class Traits>
void
ProblemStat
<
Traits
>::
createFileWriter
()
{
auto
localView
=
globalBasis
->
localView
();
forEachNode
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
node
,
auto
treePath
)
AMDiS
::
forEachNode
_
(
localView
.
tree
(),
[
&
,
this
](
auto
const
&
node
,
auto
treePath
)
{
std
::
string
componentName
=
name
+
"->output["
+
to_string
(
treePath
)
+
"]"
;
...
...
src/amdis/utility/TreeData.hpp
View file @
84fb5d3c
...
...
@@ -207,10 +207,10 @@ namespace AMDiS
}
template
<
class
Func
>
void
applyImpl
(
Func
&&
func
,
std
::
true_type
)
{
forEachLeafNode
(
*
tree_
,
func
);
}
void
applyImpl
(
Func
&&
func
,
std
::
true_type
)
{
AMDiS
::
forEachLeafNode
_
(
*
tree_
,
func
);
}
template
<
class
Func
>
void
applyImpl
(
Func
&&
func
,
std
::
false_type
)
{
forEachNode
(
*
tree_
,
func
);
}
void
applyImpl
(
Func
&&
func
,
std
::
false_type
)
{
AMDiS
::
forEachNode
_
(
*
tree_
,
func
);
}
protected:
const
Tree
*
tree_
=
nullptr
;
...
...
@@ -251,7 +251,7 @@ namespace AMDiS
void
init
(
Tree
const
&
tree
,
tag
::
store
)
{
Super
::
init
(
tree
,
tag
::
store
{});
forEachNode
(
tree
,
[
&
,
this
](
auto
const
&
node
,
auto
&&
)
AMDiS
::
forEachNode
_
(
tree
,
[
&
,
this
](
auto
const
&
node
,
auto
&&
)
{
(
*
this
)[
node
].
init
(
tree
,
tag
::
store
{});
});
...
...
src/amdis/utility/Visitor.hpp
View file @
84fb5d3c
...
...
@@ -65,7 +65,7 @@ namespace AMDiS
* \param postFunc This function is called for each inner node after visiting its children
*/
template
<
class
Tree
,
class
PreFunc
,
class
LeafFunc
,
class
PostFunc
>
void
forEachNode
(
Tree
&&
tree
,
PreFunc
&&
preFunc
,
LeafFunc
&&
leafFunc
,
PostFunc
&&
postFunc
)
void
forEachNode
_
(
Tree
&&
tree
,
PreFunc
&&
preFunc
,
LeafFunc
&&
leafFunc
,
PostFunc
&&
postFunc
)
{
traverseTree
(
tree
,
Impl
::
callbackVisitor
(
preFunc
,
leafFunc
,
postFunc
));
}
...
...
@@ -81,10 +81,10 @@ namespace AMDiS
* \param leafFunc This function is called for each leaf node
*/
template
<
class
Tree
,
class
InnerFunc
,
class
LeafFunc
>
void
forEachNode
(
Tree
&&
tree
,
InnerFunc
&&
innerFunc
,
LeafFunc
&&
leafFunc
)
void
forEachNode
_
(
Tree
&&
tree
,
InnerFunc
&&
innerFunc
,
LeafFunc
&&
leafFunc
)
{
auto
nop
=
[](
auto
&&
...
args
)
{};
forEachNode
(
tree
,
innerFunc
,
leafFunc
,
nop
);
forEachNode
_
(
tree
,
innerFunc
,
leafFunc
,
nop
);
}
/**
...
...
@@ -97,9 +97,9 @@ namespace AMDiS
* \param nodeFunc This function is called for each node
*/
template
<
class
Tree
,
class
NodeFunc
>
void
forEachNode
(
Tree
&&
tree
,
NodeFunc
&&
nodeFunc
)
void
forEachNode
_
(
Tree
&&
tree
,
NodeFunc
&&
nodeFunc
)
{
forEachNode
(
tree
,
nodeFunc
,
nodeFunc
);
forEachNode
_
(
tree
,
nodeFunc
,
nodeFunc
);
}
/**
...
...
@@ -112,10 +112,10 @@ namespace AMDiS
* \param leafFunc This function is called for each leaf node
*/
template
<
class
Tree
,
class
LeafFunc
>
void
forEachLeafNode
(
Tree
&&
tree
,
LeafFunc
&&
leafFunc
)
void
forEachLeafNode
_
(
Tree
&&
tree
,
LeafFunc
&&
leafFunc
)
{
auto
nop
=
[](
auto
&&
...
args
)
{};
forEachNode
(
tree
,
nop
,
leafFunc
,
nop
);
forEachNode
_
(
tree
,
nop
,
leafFunc
,
nop
);
}
}
// end namespace AMDiS
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