Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
362a9cf8
Commit
362a9cf8
authored
2 years ago
by
Bernd Flemisch
Committed by
Timo Koch
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[linear] Add linear algebra traits
parent
beeb467b
No related branches found
No related tags found
1 merge request
!3386
New istl linear solvers
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/linear/linearalgebratraits.hh
+82
-0
82 additions, 0 deletions
dumux/linear/linearalgebratraits.hh
with
82 additions
and
0 deletions
dumux/linear/linearalgebratraits.hh
0 → 100644
+
82
−
0
View file @
362a9cf8
// -*- 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 Linear
* \brief Define traits for linear algebra backends
*/
#ifndef DUMUX_LINEAR_ALGEBRA_TRAITS_HH
#define DUMUX_LINEAR_ALGEBRA_TRAITS_HH
#include
<utility>
#include
<type_traits>
#include
<dumux/common/typetraits/vector.hh>
#include
<dumux/linear/matrixconverter.hh>
namespace
Dumux
::
Detail
::
LATraits
{
template
<
class
Assembler
,
bool
isMultiType
=
false
>
struct
LATraitsFromAssemblerImpl
{
using
Vector
=
typename
Assembler
::
ResidualType
;
using
Matrix
=
typename
Assembler
::
JacobianMatrix
;
using
SingleTypeVector
=
Vector
;
using
SingleTypeMatrix
=
Matrix
;
};
template
<
class
Assembler
>
struct
LATraitsFromAssemblerImpl
<
Assembler
,
true
>
{
using
Vector
=
typename
Assembler
::
ResidualType
;
using
Matrix
=
typename
Assembler
::
JacobianMatrix
;
using
SingleTypeVector
=
decltype
(
VectorConverter
<
Vector
>::
multiTypeToBlockVector
(
std
::
declval
<
Vector
>
()));
using
SingleTypeMatrix
=
decltype
(
MatrixConverter
<
Matrix
>::
multiTypeToBCRSMatrix
(
std
::
declval
<
Matrix
>
()));
};
}
// end namespace Dumux::Detail::LATraits
namespace
Dumux
{
/*
* \ingroup Linear
* \brief Traits providing linear algebra types (vector, matrix)
*/
template
<
class
M
,
class
V
,
class
STM
=
M
,
class
STV
=
V
>
struct
LinearAlgebraTraits
{
using
Matrix
=
M
;
using
Vector
=
V
;
using
SingleTypeMatrix
=
STM
;
using
SingleTypeVector
=
STV
;
};
/*
* \ingroup Linear
* \brief Helper to extract linear algebra types from an assembler
*/
template
<
class
Assembler
>
using
LinearAlgebraTraitsFromAssembler
=
Detail
::
LATraits
::
LATraitsFromAssemblerImpl
<
Assembler
,
isMultiTypeBlockVector
<
typename
Assembler
::
ResidualType
>::
value
>
;
}
// end namespace Dumux
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment