Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-istl
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
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Core Modules
dune-istl
Commits
b1861c39
Commit
b1861c39
authored
19 years ago
by
Peter Bastian
Browse files
Options
Downloads
Patches
Plain Diff
two new files ...
[[Imported from SVN: r261]]
parent
41313f14
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
istl/scalarproducts.hh
+100
-0
100 additions, 0 deletions
istl/scalarproducts.hh
istl/solvercategory.hh
+24
-0
24 additions, 0 deletions
istl/solvercategory.hh
with
124 additions
and
0 deletions
istl/scalarproducts.hh
0 → 100644
+
100
−
0
View file @
b1861c39
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef __DUNE_SCALARPRODUCTS_HH__
#define __DUNE_SCALARPRODUCTS_HH__
#include
<math.h>
#include
<complex>
#include
<iostream>
#include
<iomanip>
#include
<string>
#include
"solvercategory.hh"
/** \file
\brief Define base class for scalar product and norm.
These classes have to be implemented differently for different
data partitioning strategies. Default implementations for the
sequential case are provided.
*/
namespace
Dune
{
/** @addtogroup ISTL
@{
*/
/*! \brief Base class for scalar product and norm computation
Krylov space methods need to compute scalar products and norms
(for convergence test only). These methods have to know about the
underlying data decomposition. For the sequantial case adefault implementation
is provided.
*/
template
<
class
X
>
class
ScalarProduct
{
public:
//! export types, they come from the derived class
typedef
X
domain_type
;
typedef
typename
X
::
field_type
field_type
;
/*! \brief Dot product of two vectors.
It is assumed that the vectors are consistent on the interior+border
partition.
*/
virtual
field_type
dot
(
const
X
&
x
,
const
X
&
y
)
=
0
;
/*! \brief Norm of a right-hand side vector.
The vector must be consistent on the interior+border partition
*/
virtual
double
norm
(
const
X
&
x
)
=
0
;
//! every abstract base class has a virtual destructor
virtual
~
ScalarProduct
()
{}
};
//=====================================================================
// Implementation for ISTL-matrix based operator
//=====================================================================
//! Adapts a matrix to the assembled linear operator interface
template
<
class
X
>
class
SeqScalarProduct
:
public
ScalarProduct
<
X
>
{
public:
//! export types
typedef
X
domain_type
;
typedef
typename
X
::
field_type
field_type
;
//! define the category
enum
{
category
=
SolverCategory
::
sequential
};
/*! \brief Dot product of two vectors.
It is assumed that the vectors are consistent on the interior+border
partition.
*/
virtual
field_type
dot
(
const
X
&
x
,
const
X
&
y
)
{
return
x
*
y
;
}
/*! \brief Norm of a right-hand side vector.
The vector must be consistent on the interior+border partition
*/
virtual
double
norm
(
const
X
&
x
)
{
return
x
.
two_norm
();
}
};
/** @} end documentation */
}
// end namespace
#endif
This diff is collapsed.
Click to expand it.
istl/solvercategory.hh
0 → 100644
+
24
−
0
View file @
b1861c39
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
// $Id$
#ifndef DUNE_SOLVERCATEGORY_HH
#define DUNE_SOLVERCATEGORY_HH
namespace
Dune
{
/**
@addtogroup ISTL
@{
*/
struct
SolverCategory
{
enum
{
sequential
,
nonoverlapping
,
overlapping
};
};
/** @} end documentation */
}
// end namespace
#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