Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Praetorius, Simon
dune-amdis
Commits
339ba6ed
Commit
339ba6ed
authored
Apr 27, 2016
by
Praetorius, Simon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
YaspGrid now works, Operators with factor argument
parent
5b2dce34
Pipeline
#124
skipped
Changes
37
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
1759 additions
and
1078 deletions
+1759
-1078
dune/CMakeLists.txt
dune/CMakeLists.txt
+1
-0
dune/amdis/AdaptBase.hpp
dune/amdis/AdaptBase.hpp
+4
-4
dune/amdis/Basic.hpp
dune/amdis/Basic.hpp
+146
-146
dune/amdis/ClonablePtr.hpp
dune/amdis/ClonablePtr.hpp
+97
-98
dune/amdis/DirichletBC.inc.hpp
dune/amdis/DirichletBC.inc.hpp
+2
-2
dune/amdis/FileWriter.hpp
dune/amdis/FileWriter.hpp
+87
-62
dune/amdis/IndexSeq.hpp
dune/amdis/IndexSeq.hpp
+6
-5
dune/amdis/Literals.hpp
dune/amdis/Literals.hpp
+2
-0
dune/amdis/Log.hpp
dune/amdis/Log.hpp
+3
-1
dune/amdis/Loops.hpp
dune/amdis/Loops.hpp
+8
-1
dune/amdis/Math.hpp
dune/amdis/Math.hpp
+42
-45
dune/amdis/Operator.hpp
dune/amdis/Operator.hpp
+52
-42
dune/amdis/Operator.inc.hpp
dune/amdis/Operator.inc.hpp
+192
-155
dune/amdis/OperatorTerm.hpp
dune/amdis/OperatorTerm.hpp
+198
-183
dune/amdis/OperatorTermBase.hpp
dune/amdis/OperatorTermBase.hpp
+63
-63
dune/amdis/ProblemInstat.hpp
dune/amdis/ProblemInstat.hpp
+1
-1
dune/amdis/ProblemStat.hpp
dune/amdis/ProblemStat.hpp
+97
-63
dune/amdis/ProblemStat.inc.hpp
dune/amdis/ProblemStat.inc.hpp
+82
-54
dune/amdis/Traits.hpp
dune/amdis/Traits.hpp
+46
-46
dune/amdis/linear_algebra/LinearSolverInterface.hpp
dune/amdis/linear_algebra/LinearSolverInterface.hpp
+1
-2
dune/amdis/linear_algebra/mtl/BlockMTLMatrix.hpp
dune/amdis/linear_algebra/mtl/BlockMTLMatrix.hpp
+4
-3
dune/amdis/linear_algebra/mtl/BlockMTLVector.hpp
dune/amdis/linear_algebra/mtl/BlockMTLVector.hpp
+6
-5
dune/amdis/linear_algebra/mtl/DOFVector.hpp
dune/amdis/linear_algebra/mtl/DOFVector.hpp
+14
-5
dune/amdis/linear_algebra/mtl/KrylovRunner.hpp
dune/amdis/linear_algebra/mtl/KrylovRunner.hpp
+0
-2
dune/amdis/linear_algebra/mtl/SystemVector.hpp
dune/amdis/linear_algebra/mtl/SystemVector.hpp
+26
-5
dune/amdis/test/CMakeLists.txt
dune/amdis/test/CMakeLists.txt
+18
-0
dune/amdis/test/kdtree.hpp
dune/amdis/test/kdtree.hpp
+245
-0
dune/amdis/test/macro.stand.2d
dune/amdis/test/macro.stand.2d
+30
-0
dune/amdis/test/test.json.2d
dune/amdis/test/test.json.2d
+29
-0
dune/amdis/test/test1.cc
dune/amdis/test/test1.cc
+150
-0
init/heat.json.2d
init/heat.json.2d
+2
-2
init/test.json.2d
init/test.json.2d
+29
-0
src/CMakeLists.txt
src/CMakeLists.txt
+1
-1
src/heat.cc
src/heat.cc
+57
-55
src/navier_stokes.cc
src/navier_stokes.cc
+4
-2
src/pfc.cc
src/pfc.cc
+12
-23
src/stokes.cc
src/stokes.cc
+2
-2
No files found.
dune/CMakeLists.txt
View file @
339ba6ed
add_subdirectory
(
amdis
)
add_subdirectory
(
amdis/test
)
\ No newline at end of file
dune/amdis/AdaptBase.hpp
View file @
339ba6ed
...
...
@@ -42,7 +42,7 @@ namespace AMDiS
return
name
;
}
/// Returns \ref problemIteration
_
/// Returns \ref problemIteration
ProblemIterationInterface
*
getProblemIteration
()
const
{
return
problemIteration
;
...
...
@@ -60,7 +60,7 @@ namespace AMDiS
return
adaptInfo
;
}
/// Returns \ref problemTime
_
/// Returns \ref problemTime
ProblemTimeInterface
*
getProblemTime
()
const
{
return
problemTime
;
...
...
@@ -72,7 +72,7 @@ namespace AMDiS
problemTime
=
pti
;
}
/// Returns \ref initialAdaptInfo
_
/// Returns \ref initialAdaptInfo
AdaptInfo
&
getInitialAdaptInfo
()
const
{
return
*
initialAdaptInfo
;
...
...
@@ -93,7 +93,7 @@ namespace AMDiS
/** \brief
* Adapt info for initial adapt. Will be given to
* problemTime
_
->solveInitialProblem().
* problemTime->solveInitialProblem().
*/
AdaptInfo
*
initialAdaptInfo
;
...
...
dune/amdis/Basic.hpp
View file @
339ba6ed
...
...
@@ -12,169 +12,169 @@
namespace
AMDiS
{
template
<
int
I
>
using
int_
=
std
::
integral_constant
<
int
,
I
>
;
template
<
int
I
>
using
int_
=
std
::
integral_constant
<
int
,
I
>
;
template
<
bool
B
>
using
bool_
=
std
::
integral_constant
<
bool
,
B
>
;
template
<
bool
B
>
using
bool_
=
std
::
integral_constant
<
bool
,
B
>
;
template
<
size_t
I
>
using
index_
=
std
::
integral_constant
<
size_t
,
I
>
;
template
<
class
T
>
using
IdxPairList
=
std
::
map
<
std
::
pair
<
int
,
int
>
,
std
::
list
<
std
::
shared_ptr
<
T
>
>
>
;
template
<
class
T
>
using
IdxList
=
std
::
map
<
int
,
std
::
list
<
std
::
shared_ptr
<
T
>
>
>
;
template
<
size_t
I
>
using
index_
=
std
::
integral_constant
<
size_t
,
I
>
;
template
<
size_t
I
,
class
T
,
class
A
>
T
const
&
get
(
std
::
vector
<
T
,
A
>
const
&
vec
)
{
return
vec
[
I
];
}
template
<
class
T
>
using
IdxPairList
=
std
::
map
<
std
::
pair
<
int
,
int
>
,
std
::
list
<
std
::
shared_ptr
<
T
>
>
>
;
namespace
Impl
{
template
<
class
Tuple
,
size_t
N
>
struct
ConstructTuple
{
// add arg to repeated constructor argument list
template
<
class
Arg
,
class
...
Args
>
static
Tuple
make
(
Arg
&&
arg
,
Args
&&
...
args
)
{
return
ConstructTuple
<
Tuple
,
N
-
1
>::
make
(
std
::
forward
<
Arg
>
(
arg
),
std
::
forward
<
Arg
>
(
arg
),
std
::
forward
<
Args
>
(
args
)...);
}
};
template
<
class
Tuple
>
struct
ConstructTuple
<
Tuple
,
1
>
{
template
<
class
...
Args
>
static
Tuple
make
(
Args
&&
...
args
)
{
static_assert
(
std
::
tuple_size
<
Tuple
>::
value
==
sizeof
...(
args
),
"Nr. of argument != tuple-size"
);
return
Tuple
{
std
::
forward
<
Args
>
(
args
)...};
}
};
template
<
class
Tuple
>
struct
ConstructTuple
<
Tuple
,
0
>
{
template
<
class
...
Args
>
static
Tuple
make
(
Args
&&
...
args
)
{
static_assert
(
std
::
tuple_size
<
Tuple
>::
value
==
0
,
"Construction of empty tuples with empty argument list only!"
);
return
{};
}
};
template
<
class
Tuple
>
struct
FoldTuples
{
// add arg to repeated constructor argument list
template
<
size_t
...
Is
,
class
...
Tuples
>
static
Tuple
make
(
Seq
<
Is
...
>
,
Tuples
&&
...
tuples
)
{
return
Tuple
{
make_element
(
index_
<
Is
>
(),
std
::
forward
<
Tuples
>
(
tuples
)...)...};
}
template
<
size_t
I
,
class
...
Tuples
>
static
std
::
tuple_element_t
<
I
,
Tuple
>
make_element
(
index_
<
I
>
,
Tuples
&&
...
tuples
)
{
using
AMDiS
::
get
;
return
std
::
tuple_element_t
<
I
,
Tuple
>
{
get
<
I
>
(
std
::
forward
<
Tuples
>
(
tuples
))...};
}
};
}
// end namespace Impl
// construct a tuple with each element constructed by the same argument arg.
template
<
class
Tuple
,
class
Arg
>
Tuple
construct_tuple
(
Arg
&&
arg
)
{
return
Impl
::
ConstructTuple
<
Tuple
,
std
::
tuple_size
<
Tuple
>::
value
>::
make
(
std
::
forward
<
Arg
>
(
arg
));
}
template
<
class
Tuple
,
class
...
Args
>
Tuple
fold_tuples
(
Args
&&
...
args
)
{
return
Impl
::
FoldTuples
<
Tuple
>::
make
(
MakeSeq_t
<
std
::
tuple_size
<
Tuple
>::
value
>
(),
std
::
forward
<
Args
>
(
args
)...);
}
// -----------
template
<
template
<
class
>
class
Base
,
class
Tuple
,
class
Indices
>
struct
MakeTuple
;
template
<
template
<
class
>
class
Base
,
class
Tuple
,
size_t
...
I
>
struct
MakeTuple
<
Base
,
Tuple
,
Seq
<
I
...
>>
template
<
class
T
>
using
IdxList
=
std
::
map
<
int
,
std
::
list
<
std
::
shared_ptr
<
T
>
>
>
;
template
<
size_t
I
,
class
T
,
class
A
>
T
const
&
get
(
std
::
vector
<
T
,
A
>
const
&
vec
)
{
return
vec
[
I
];
}
namespace
Impl
{
template
<
class
Tuple
,
size_t
N
>
struct
ConstructTuple
{
using
type
=
std
::
tuple
<
Base
<
std
::
tuple_element_t
<
I
,
Tuple
>>
...
>
;
// add arg to repeated constructor argument list
template
<
class
Arg
,
class
...
Args
>
static
Tuple
make
(
Arg
&&
arg
,
Args
&&
...
args
)
{
return
ConstructTuple
<
Tuple
,
N
-
1
>::
make
(
std
::
forward
<
Arg
>
(
arg
),
std
::
forward
<
Arg
>
(
arg
),
std
::
forward
<
Args
>
(
args
)...);
}
};
template
<
template
<
class
>
class
Base
,
class
Tuple
>
using
MakeTuple_t
=
typename
MakeTuple
<
Base
,
Tuple
,
MakeSeq_t
<
std
::
tuple_size
<
Tuple
>::
value
>>::
type
;
// -----------
template
<
template
<
class
,
class
>
class
Base
,
class
Tuple1
,
class
Tuple2
,
class
Indices
>
struct
MakeTuple2
;
template
<
template
<
class
,
class
>
class
Base
,
class
Tuple1
,
class
Tuple2
,
size_t
...
I
>
struct
MakeTuple2
<
Base
,
Tuple1
,
Tuple2
,
Seq
<
I
...
>>
template
<
class
Tuple
>
struct
ConstructTuple
<
Tuple
,
1
>
{
using
type
=
std
::
tuple
<
Base
<
std
::
tuple_element_t
<
I
,
Tuple1
>
,
std
::
tuple_element_t
<
I
,
Tuple2
>>
...
>
;
template
<
class
...
Args
>
static
Tuple
make
(
Args
&&
...
args
)
{
static_assert
(
std
::
tuple_size
<
Tuple
>::
value
==
sizeof
...(
args
),
"Nr. of argument != tuple-size"
);
return
Tuple
{
std
::
forward
<
Args
>
(
args
)...};
}
};
template
<
template
<
class
,
class
>
class
Base
,
class
Tuple1
,
class
Tuple2
>
using
MakeTuple2_t
=
typename
MakeTuple2
<
Base
,
Tuple1
,
Tuple2
,
MakeSeq_t
<
std
::
tuple_size
<
Tuple1
>::
value
>>::
type
;
// -----------
template
<
template
<
class
...
>
class
Base
,
class
Tuple
,
class
Indices
>
struct
ExpandTuple
;
template
<
template
<
class
...
>
class
Base
,
class
Tuple
,
size_t
...
I
>
struct
ExpandTuple
<
Base
,
Tuple
,
Seq
<
I
...
>>
template
<
class
Tuple
>
struct
ConstructTuple
<
Tuple
,
0
>
{
using
type
=
Base
<
std
::
tuple_element_t
<
I
,
Tuple
>
...
>
;
template
<
class
...
Args
>
static
Tuple
make
(
Args
&&
...
args
)
{
static_assert
(
std
::
tuple_size
<
Tuple
>::
value
==
0
,
"Construction of empty tuples with empty argument list only!"
);
return
{};
}
};
template
<
template
<
class
...
>
class
Base
,
class
Tuple
>
using
ExpandTuple_t
=
typename
ExpandTuple
<
Base
,
Tuple
,
MakeSeq_t
<
std
::
tuple_size
<
Tuple
>::
value
>>::
type
;
// -----------
template
<
class
T
,
class
Indices
>
struct
RepeatedTuple
;
template
<
class
T
,
size_t
...
I
>
struct
RepeatedTuple
<
T
,
Seq
<
I
...
>>
template
<
class
Tuple
>
struct
FoldTuples
{
template
<
size_t
,
class
U
>
using
Id
=
U
;
using
type
=
std
::
tuple
<
Id
<
I
,
T
>
...
>
;
// add arg to repeated constructor argument list
template
<
size_t
...
Is
,
class
...
Tuples
>
static
Tuple
make
(
Seq
<
Is
...
>
,
Tuples
&&
...
tuples
)
{
return
Tuple
{
make_element
(
index_
<
Is
>
(),
std
::
forward
<
Tuples
>
(
tuples
)...)...};
}
template
<
size_t
I
,
class
...
Tuples
>
static
std
::
tuple_element_t
<
I
,
Tuple
>
make_element
(
index_
<
I
>
,
Tuples
&&
...
tuples
)
{
using
AMDiS
::
get
;
return
std
::
tuple_element_t
<
I
,
Tuple
>
{
get
<
I
>
(
std
::
forward
<
Tuples
>
(
tuples
))...};
}
};
template
<
size_t
N
,
class
T
>
using
Repeat_t
=
typename
RepeatedTuple
<
T
,
MakeSeq_t
<
N
>>::
type
;
}
// end namespace Impl
// -----------
template
<
class
T
>
using
owner
=
T
;
// construct a tuple with each element constructed by the same argument arg.
template
<
class
Tuple
,
class
Arg
>
Tuple
construct_tuple
(
Arg
&&
arg
)
{
return
Impl
::
ConstructTuple
<
Tuple
,
std
::
tuple_size
<
Tuple
>::
value
>::
make
(
std
::
forward
<
Arg
>
(
arg
));
}
template
<
class
Tuple
,
class
...
Args
>
Tuple
fold_tuples
(
Args
&&
...
args
)
{
return
Impl
::
FoldTuples
<
Tuple
>::
make
(
MakeSeq_t
<
std
::
tuple_size
<
Tuple
>::
value
>
(),
std
::
forward
<
Args
>
(
args
)...);
}
// -----------
template
<
template
<
class
>
class
Base
,
class
Tuple
,
class
Indices
>
struct
MakeTuple
;
template
<
template
<
class
>
class
Base
,
class
Tuple
,
size_t
...
I
>
struct
MakeTuple
<
Base
,
Tuple
,
Seq
<
I
...
>>
{
using
type
=
std
::
tuple
<
Base
<
std
::
tuple_element_t
<
I
,
Tuple
>>
...
>
;
};
template
<
template
<
class
>
class
Base
,
class
Tuple
>
using
MakeTuple_t
=
typename
MakeTuple
<
Base
,
Tuple
,
MakeSeq_t
<
std
::
tuple_size
<
Tuple
>::
value
>>::
type
;
// -----------
template
<
template
<
class
,
class
>
class
Base
,
class
Tuple1
,
class
Tuple2
,
class
Indices
>
struct
MakeTuple2
;
template
<
template
<
class
,
class
>
class
Base
,
class
Tuple1
,
class
Tuple2
,
size_t
...
I
>
struct
MakeTuple2
<
Base
,
Tuple1
,
Tuple2
,
Seq
<
I
...
>>
{
using
type
=
std
::
tuple
<
Base
<
std
::
tuple_element_t
<
I
,
Tuple1
>
,
std
::
tuple_element_t
<
I
,
Tuple2
>>
...
>
;
};
template
<
template
<
class
,
class
>
class
Base
,
class
Tuple1
,
class
Tuple2
>
using
MakeTuple2_t
=
typename
MakeTuple2
<
Base
,
Tuple1
,
Tuple2
,
MakeSeq_t
<
std
::
tuple_size
<
Tuple1
>::
value
>>::
type
;
// -----------
template
<
template
<
class
...
>
class
Base
,
class
Tuple
,
class
Indices
>
struct
ExpandTuple
;
template
<
template
<
class
...
>
class
Base
,
class
Tuple
,
size_t
...
I
>
struct
ExpandTuple
<
Base
,
Tuple
,
Seq
<
I
...
>>
{
using
type
=
Base
<
std
::
tuple_element_t
<
I
,
Tuple
>
...
>
;
};
template
<
template
<
class
...
>
class
Base
,
class
Tuple
>
using
ExpandTuple_t
=
typename
ExpandTuple
<
Base
,
Tuple
,
MakeSeq_t
<
std
::
tuple_size
<
Tuple
>::
value
>>::
type
;
// -----------
template
<
class
T
,
class
Indices
>
struct
RepeatedTuple
;
template
<
class
T
,
size_t
...
I
>
struct
RepeatedTuple
<
T
,
Seq
<
I
...
>>
{
template
<
size_t
,
class
U
>
using
Id
=
U
;
using
type
=
std
::
tuple
<
Id
<
I
,
T
>
...
>
;
};
template
<
size_t
N
,
class
T
>
using
Repeat_t
=
typename
RepeatedTuple
<
T
,
MakeSeq_t
<
N
>>::
type
;
// -----------
template
<
class
T
>
using
owner
=
T
;
}
// end namespace AMDiS
dune/amdis/ClonablePtr.hpp
View file @
339ba6ed
...
...
@@ -4,108 +4,107 @@
namespace
AMDiS
{
// A pointer class that deletes only when owning the pointer
template
<
class
T
>
class
ClonablePtr
{
private:
struct
alloc_tag
{};
///< hidden helper struct, used by \ref make
public:
using
Self
=
ClonablePtr
;
using
element_type
=
T
;
// A pointer class that deletes only when owning the pointer
template
<
class
T
>
class
ClonablePtr
{
private:
struct
alloc_tag
{};
///< hidden helper struct, used by \ref make
public:
using
Self
=
ClonablePtr
;
using
element_type
=
T
;
/// Constructor from pointer. Can only be used via make method,
/// Transfers ownership.
ClonablePtr
(
owner
<
T
>*
p
,
alloc_tag
)
noexcept
:
p
(
p
)
,
is_owner
(
true
)
{}
/// Constructor from reference
ClonablePtr
(
T
&
ref
)
noexcept
:
p
(
&
ref
)
,
is_owner
(
false
)
{}
/// Destructor, deletes in case of owner only
~
ClonablePtr
()
noexcept
{
if
(
is_owner
)
delete
p
;
}
/// Copy constructor, creates a clone of the pointed to object
ClonablePtr
(
Self
const
&
that
)
noexcept
(
std
::
is_nothrow_copy_constructible
<
T
>::
value
)
:
p
(
new
T
(
*
that
.
p
))
,
is_owner
(
true
)
{}
/// Move constructor, copies the pointer only.
ClonablePtr
(
Self
&&
that
)
noexcept
:
p
(
that
.
p
)
,
is_owner
(
that
.
is_owner
)
{
that
.
p
=
NULL
;
that
.
is_owner
=
false
;
}
/// Copy and move assignment operator, using the copy-and-swap idiom
Self
&
operator
=
(
Self
that
)
noexcept
{
swap
(
that
);
return
*
this
;
}
/// Factory method. creates a new Object of type T and stores the pointer.
template
<
class
...
Args
>
static
Self
make
(
Args
&&
...
args
)
noexcept
(
std
::
is_nothrow_constructible
<
T
,
std
::
decay_t
<
Args
>
...
>::
value
)
{
return
{
new
T
(
std
::
forward
<
Args
>
(
args
)...),
Self
::
alloc_tag
()};
}
/// Constructor from pointer. Can only be used via make method,
/// Transfers ownership.
ClonablePtr
(
owner
<
T
>*
p
,
alloc_tag
)
noexcept
:
p
(
p
)
,
is_owner
(
true
)
{}
/// Constructor from reference
ClonablePtr
(
T
&
ref
)
noexcept
:
p
(
&
ref
)
,
is_owner
(
false
)
{}
/// Destructor, deletes in case of owner only
~
ClonablePtr
()
noexcept
{
if
(
is_owner
)
delete
p
;
}
/// Copy constructor, creates a clone of the pointed to object
ClonablePtr
(
Self
const
&
that
)
noexcept
(
std
::
is_nothrow_copy_constructible
<
T
>::
value
)
:
p
(
new
T
(
*
that
.
p
))
,
is_owner
(
true
)
{}
/// Move constructor, copies the pointer only.
ClonablePtr
(
Self
&&
that
)
noexcept
:
p
(
that
.
p
)
,
is_owner
(
that
.
is_owner
)
{
that
.
p
=
NULL
;
that
.
is_owner
=
false
;
}
/// Copy and move assignment operator, using the copy-and-swap idiom
Self
&
operator
=
(
Self
that
)
noexcept
{
swap
(
that
);
return
*
this
;
}
/// Factory method. creates a new Object of type T and stores the pointer.
template
<
class
...
Args
>
static
Self
make
(
Args
&&
...
args
)
noexcept
(
std
::
is_nothrow_constructible
<
T
,
std
::
decay_t
<
Args
>
...
>::
value
)
{
return
{
new
T
(
std
::
forward
<
Args
>
(
args
)...),
Self
::
alloc_tag
()};
}
/// Access-method by dereferencing
T
&
operator
*
()
const
noexcept
{
return
*
p
;
}
/// Access-method by pointer access
T
*
operator
->
()
const
noexcept
{
return
p
;
}
/// retrieve the underlying pointer
T
*
get
()
const
noexcept
{
return
p
;
}
/// Test whether pointer is NULL
operator
bool
()
const
noexcept
{
return
!
(
p
==
NULL
);
}
void
swap
(
Self
&
that
)
noexcept
{
using
std
::
swap
;
swap
(
p
,
that
.
p
);
swap
(
is_owner
,
that
.
is_owner
);
}
private:
T
*
p
;
///< managed pointer
bool
is_owner
;
///< true, if class is owner of pointer, false otherwise
};
/// Access-method by dereferencing
T
&
operator
*
()
const
noexcept
{
return
*
p
;
}
/// Access-method by pointer access
T
*
operator
->
()
const
noexcept
{
return
p
;
}
/// retrieve the underlying pointer
T
*
get
()
const
noexcept
{
return
p
;
}
/// Test whether pointer is NULL
operator
bool
()
const
noexcept
{
return
!
(
p
==
NULL
);
}
template
<
class
T
>
void
swap
(
ClonablePtr
<
T
>&
a
,
ClonablePtr
<
T
>&
b
)
noexcept
void
swap
(
Self
&
that
)
noexcept
{
a
.
swap
(
b
);
using
std
::
swap
;
swap
(
p
,
that
.
p
);
swap
(
is_owner
,
that
.
is_owner
);
}
private:
T
*
p
;
///< managed pointer
bool
is_owner
;
///< true, if class is owner of pointer, false otherwise
};
template
<
class
T
>
void
swap
(
ClonablePtr
<
T
>&
a
,
ClonablePtr
<
T
>&
b
)
noexcept
{
a
.
swap
(
b
);
}
}
// end namespace AMDiS
dune/amdis/DirichletBC.inc.hpp
View file @
339ba6ed
...
...
@@ -33,8 +33,8 @@ namespace AMDiS
matrix
.
clearDirichletRows
(
dirichletNodes
,
apply
);
if
(
apply
)
{
interpolate
(
matrix
.
getRowFeSpace
(),
rhs
.
getVector
(),
values
,
dirichletNodes
);
interpolate
(
matrix
.
getColFeSpace
(),
solution
.
getVector
(),
values
,
dirichletNodes
);
interpolate
(
matrix
.
getRowFeSpace
(),
rhs
.
getVector
(),
values
,
dirichletNodes
);
interpolate
(
matrix
.
getColFeSpace
(),
solution
.
getVector
(),
values
,
dirichletNodes
);
}
}
...
...
dune/amdis/FileWriter.hpp
View file @
339ba6ed
...
...
@@ -15,9 +15,11 @@
namespace
AMDiS
{
template
<
class
Traits
>
class
FileWriter
{
template
<
class
Traits
>
class
FileWriter
{
private:
// typedefs and static constants
using
Mesh
=
typename
Traits
::
Mesh
;
using
MeshView
=
typename
Mesh
::
LeafGridView
;
...
...
@@ -29,85 +31,108 @@ class FileWriter
/// Number of problem components
static
constexpr
int
nComponents
=
Traits
::
nComponents
;
public:
public:
/// Constructor.
FileWriter
(
std
::
string
base
,
MeshView
const
&
meshView
,
std
::
vector
<
std
::
string
>
const
&
names_
)
:
meshView
(
meshView
)
,
names
(
names_
)
:
meshView
(
meshView
)