Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
67ca3baa
Commit
67ca3baa
authored
Feb 12, 2019
by
Kilian Weishaupt
Browse files
[md][couplingmanager] Store prevSol in base coupling manager and check for assembly
parent
fd2985e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
dumux/multidomain/couplingmanager.hh
View file @
67ca3baa
...
...
@@ -41,7 +41,7 @@ namespace Dumux {
* \ingroup MultiDomain
* \brief The interface of the coupling manager for multi domain problems
*/
template
<
class
Traits
>
template
<
class
Traits
,
bool
implicitAssembly
=
true
>
class
CouplingManager
{
template
<
std
::
size_t
id
>
using
SubDomainTypeTag
=
typename
Traits
::
template
SubDomain
<
id
>
::
TypeTag
;
...
...
@@ -60,6 +60,12 @@ public:
//! the type of the solution vector
using
SolutionVector
=
typename
Traits
::
SolutionVector
;
/*!
* \brief Returns true if the coupling manager considers implicit assembly.
*/
static
constexpr
bool
useImplicitAssembly
()
{
return
implicitAssembly
;
}
/*!
* \name member functions concerning the coupling stencils
*/
...
...
@@ -186,6 +192,12 @@ public:
void
updateSolution
(
const
SolutionVector
&
curSol
)
{
curSol_
=
curSol
;
}
/*!
* \brief Sets a pointer to the previous solution vector
*/
void
setPrevSol
(
const
SolutionVector
&
prevSol
)
{
prevSol_
=
&
prevSol
;
}
// \}
/*!
...
...
@@ -285,6 +297,17 @@ protected:
const
SolutionVector
&
curSol
()
const
{
return
curSol_
;
}
/*!
* \brief the previous solution vector of the coupled problem
*/
const
SolutionVector
&
prevSol
()
const
{
if
(
prevSol_
)
return
*
prevSol_
;
else
DUNE_THROW
(
Dune
::
InvalidStateException
,
"The prevSol pointer was not set. Use setPrevSol() before calling this function"
);
}
private:
/*!
* \brief the solution vector of the coupled problem
...
...
@@ -292,6 +315,11 @@ private:
*/
SolutionVector
curSol_
;
/*!
* \brief a pointer to the solution vector of the previous time step of the coupled problem
*/
const
SolutionVector
*
prevSol_
;
/*!
* \brief A tuple of std::weak_ptrs to the sub problems
* \note these are weak pointers and not shared pointers to break the cyclic dependency between coupling manager and problems
...
...
dumux/multidomain/fvassembler.hh
View file @
67ca3baa
...
...
@@ -129,6 +129,8 @@ private:
template
<
std
::
size_t
id
>
using
SubDomainAssembler
=
typename
SubDomainAssemblerType
<
FVGridGeometry
<
id
>::
discMethod
,
id
>::
type
;
static_assert
(
isImplicit
()
==
CouplingManager
::
useImplicitAssembly
(),
"The FVAssembler and the CouplingManager need to be set for the same type of assembly (implicit/explicit)"
);
public:
...
...
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