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
92726b9c
Commit
92726b9c
authored
5 years ago
by
Dennis Gläser
Committed by
Timo Koch
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[projector] allow setting projection parameters
parent
365903eb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1636
Feature/l2 norm
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/discretization/projection/projector.hh
+20
-3
20 additions, 3 deletions
dumux/discretization/projection/projector.hh
with
20 additions
and
3 deletions
dumux/discretization/projection/projector.hh
+
20
−
3
View file @
92726b9c
...
@@ -55,15 +55,24 @@ namespace Dumux {
...
@@ -55,15 +55,24 @@ namespace Dumux {
* into another. The convenience functions makeProjectorPair
* into another. The convenience functions makeProjectorPair
* or makeProjector can be used to create such a projection.
* or makeProjector can be used to create such a projection.
*/
*/
template
<
class
Scalar
>
template
<
class
Scalar
Type
>
class
Projector
class
Projector
{
{
using
BlockType
=
Dune
::
FieldMatrix
<
Scalar
,
1
,
1
>
;
using
BlockType
=
Dune
::
FieldMatrix
<
Scalar
Type
,
1
,
1
>
;
public:
public:
//! Export the scalar type
using
Scalar
=
ScalarType
;
//! Export the type of the projection matrices
//! Export the type of the projection matrices
using
Matrix
=
Dune
::
BCRSMatrix
<
BlockType
>
;
using
Matrix
=
Dune
::
BCRSMatrix
<
BlockType
>
;
//! Parameters that can be passed to project()
struct
Params
{
std
::
size_t
maxIterations
{
100
};
Scalar
residualReduction
{
1e-13
};
};
//! delete default constructor
//! delete default constructor
Projector
()
=
delete
;
Projector
()
=
delete
;
...
@@ -83,7 +92,7 @@ public:
...
@@ -83,7 +92,7 @@ public:
* \param up The projection of u into the target space
* \param up The projection of u into the target space
*/
*/
template
<
class
DomainSolution
,
class
TargetSolution
>
template
<
class
DomainSolution
,
class
TargetSolution
>
void
project
(
const
DomainSolution
&
u
,
TargetSolution
&
up
)
const
void
project
(
const
DomainSolution
&
u
,
TargetSolution
&
up
,
const
Params
&
params
=
Params
{}
)
const
{
{
// be picky about size of u
// be picky about size of u
if
(
u
.
size
()
!=
projMat_
.
M
())
if
(
u
.
size
()
!=
projMat_
.
M
())
...
@@ -95,9 +104,17 @@ public:
...
@@ -95,9 +104,17 @@ public:
projMat_
.
mv
(
u
,
rhs
);
projMat_
.
mv
(
u
,
rhs
);
SSORCGBackend
solver
;
SSORCGBackend
solver
;
solver
.
setResidualReduction
(
params
.
residualReduction
);
solver
.
setMaxIter
(
params
.
maxIterations
);
solver
.
solve
(
massMat_
,
up
,
rhs
);
solver
.
solve
(
massMat_
,
up
,
rhs
);
}
}
/*!
* \brief Returns the default parameters.
*/
static
Params
defaultParams
()
{
return
{};
}
private
:
private
:
Matrix
massMat_
;
Matrix
massMat_
;
Matrix
projMat_
;
Matrix
projMat_
;
...
...
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