Skip to content
GitLab
Menu
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
e0018206
Commit
e0018206
authored
Mar 06, 2021
by
Timo Koch
Browse files
Merge branch 'feature/numeqvector' into 'master'
Feature/numeqvector See merge request
!2510
parents
af447f70
3837760f
Changes
5
Hide whitespace changes
Inline
Side-by-side
dumux/common/CMakeLists.txt
View file @
e0018206
...
@@ -28,6 +28,7 @@ intersectionmapper.hh
...
@@ -28,6 +28,7 @@ intersectionmapper.hh
loggingparametertree.hh
loggingparametertree.hh
math.hh
math.hh
monotonecubicspline.hh
monotonecubicspline.hh
numeqvector.hh
numericdifferentiation.hh
numericdifferentiation.hh
optionalscalar.hh
optionalscalar.hh
parameters.hh
parameters.hh
...
...
dumux/common/numeqvector.hh
0 → 100644
View file @
e0018206
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
* \ingroup Common
* \brief A helper to deduce a vector with the same size as numbers of equations
*/
#ifndef DUMUX_COMMON_NUMEQVECTOR_HH
#define DUMUX_COMMON_NUMEQVECTOR_HH
namespace
Dumux
{
template
<
class
PrimaryVariables
>
struct
NumEqVectorTraits
{
static
constexpr
std
::
size_t
numEq
=
PrimaryVariables
::
size
();
using
type
=
PrimaryVariables
;
};
/*!
* \ingroup Common
* \brief A vector with the same size as numbers of equations
* This is the default implementation and has to be specialized for
* all custom primary variable vector types
* \note This is based on the primary variables concept
*/
template
<
class
PrimaryVariables
>
using
NumEqVector
=
typename
NumEqVectorTraits
<
PrimaryVariables
>::
type
;
}
// namespace Dumux
#endif
dumux/porousmediumflow/compositional/switchableprimaryvariables.hh
View file @
e0018206
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#define DUMUX_SWITCHABLE_PRIMARY_VARIABLES_HH
#define DUMUX_SWITCHABLE_PRIMARY_VARIABLES_HH
#include <dune/common/exceptions.hh>
#include <dune/common/exceptions.hh>
#include <dumux/common/numeqvector.hh>
namespace
Dumux
{
namespace
Dumux
{
...
@@ -73,6 +74,17 @@ private:
...
@@ -73,6 +74,17 @@ private:
bool
stateIsSet_
{
false
};
bool
stateIsSet_
{
false
};
};
};
/*!
* \ingroup PorousmediumflowModels
* \brief The corresponding NumEqVectorTraits for the primary variables with switchable state
*/
template
<
class
PrimaryVariables
,
class
StateType
>
struct
NumEqVectorTraits
<
SwitchablePrimaryVariables
<
PrimaryVariables
,
StateType
>>
{
static
constexpr
std
::
size_t
numEq
=
PrimaryVariables
::
size
();
using
type
=
PrimaryVariables
;
};
}
// end namespace Dumux
}
// end namespace Dumux
#endif
#endif
test/porousmediumflow/1p/network1d3d/problem.hh
View file @
e0018206
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include <dumux/common/properties.hh>
#include <dumux/common/properties.hh>
#include <dumux/common/parameters.hh>
#include <dumux/common/parameters.hh>
#include <dumux/common/boundarytypes.hh>
#include <dumux/common/boundarytypes.hh>
#include <dumux/common/numeqvector.hh>
#include <dumux/discretization/elementsolution.hh>
#include <dumux/discretization/elementsolution.hh>
#include <dumux/porousmediumflow/problem.hh>
#include <dumux/porousmediumflow/problem.hh>
...
@@ -64,7 +65,7 @@ class TubesTestProblem : public PorousMediumFlowProblem<TypeTag>
...
@@ -64,7 +65,7 @@ class TubesTestProblem : public PorousMediumFlowProblem<TypeTag>
using
PrimaryVariables
=
GetPropType
<
TypeTag
,
Properties
::
PrimaryVariables
>
;
using
PrimaryVariables
=
GetPropType
<
TypeTag
,
Properties
::
PrimaryVariables
>
;
using
BoundaryTypes
=
Dumux
::
BoundaryTypes
<
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>::
numEq
()
>
;
using
BoundaryTypes
=
Dumux
::
BoundaryTypes
<
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>::
numEq
()
>
;
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
using
NumEqVector
=
Dumux
::
NumEqVector
<
PrimaryVariables
>
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
GridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
GridGeometry
=
GetPropType
<
TypeTag
,
Properties
::
GridGeometry
>
;
using
SolutionVector
=
GetPropType
<
TypeTag
,
Properties
::
SolutionVector
>
;
using
SolutionVector
=
GetPropType
<
TypeTag
,
Properties
::
SolutionVector
>
;
...
...
test/porousmediumflow/2p2c/injection/problem.hh
View file @
e0018206
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include <dune/grid/yaspgrid.hh>
#include <dune/grid/yaspgrid.hh>
#include <dumux/common/boundarytypes.hh>
#include <dumux/common/boundarytypes.hh>
#include <dumux/common/numeqvector.hh>
#include <dumux/discretization/cellcentered/mpfa/omethod/staticinteractionvolume.hh>
#include <dumux/discretization/cellcentered/mpfa/omethod/staticinteractionvolume.hh>
#include <dumux/discretization/ccmpfa.hh>
#include <dumux/discretization/ccmpfa.hh>
...
@@ -178,7 +179,7 @@ class InjectionProblem : public PorousMediumFlowProblem<TypeTag>
...
@@ -178,7 +179,7 @@ class InjectionProblem : public PorousMediumFlowProblem<TypeTag>
};
};
using
PrimaryVariables
=
GetPropType
<
TypeTag
,
Properties
::
PrimaryVariables
>
;
using
PrimaryVariables
=
GetPropType
<
TypeTag
,
Properties
::
PrimaryVariables
>
;
using
NumEqVector
=
GetPropType
<
TypeTag
,
Properties
::
NumEqVector
>
;
using
NumEqVector
=
Dumux
::
NumEqVector
<
PrimaryVariables
>
;
using
GridVariables
=
GetPropType
<
TypeTag
,
Properties
::
GridVariables
>
;
using
GridVariables
=
GetPropType
<
TypeTag
,
Properties
::
GridVariables
>
;
using
ElementVolumeVariables
=
typename
GridVariables
::
GridVolumeVariables
::
LocalView
;
using
ElementVolumeVariables
=
typename
GridVariables
::
GridVolumeVariables
::
LocalView
;
using
ElementFluxVariablesCache
=
typename
GridVariables
::
GridFluxVariablesCache
::
LocalView
;
using
ElementFluxVariablesCache
=
typename
GridVariables
::
GridFluxVariablesCache
::
LocalView
;
...
...
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