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
ccef57f3
Commit
ccef57f3
authored
Mar 05, 2021
by
Timo Koch
Browse files
[common] Add Dumux::NumEqVector
parent
2d39b435
Changes
2
Hide whitespace changes
Inline
Side-by-side
dumux/common/CMakeLists.txt
View file @
ccef57f3
...
...
@@ -28,6 +28,7 @@ intersectionmapper.hh
loggingparametertree.hh
math.hh
monotonecubicspline.hh
numeqvector.hh
numericdifferentiation.hh
optionalscalar.hh
parameters.hh
...
...
dumux/common/numeqvector.hh
0 → 100644
View file @
ccef57f3
// -*- 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
Write
Preview
Markdown
is supported
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