Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
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
Package registry
Model registry
Operate
Environments
Terraform modules
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-common
Commits
a5aceeed
Commit
a5aceeed
authored
20 years ago
by
Robert Klöfkorn
Browse files
Options
Downloads
Patches
Plain Diff
gcc compatible.
[[Imported from SVN: r969]]
parent
85d93662
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fem/discreteoperatorimp.hh
+29
-31
29 additions, 31 deletions
fem/discreteoperatorimp.hh
with
29 additions
and
31 deletions
fem/discreteoperatorimp.hh
+
29
−
31
View file @
a5aceeed
...
...
@@ -19,7 +19,7 @@ namespace Dune {
A discrete operator of this type consists of a local operator and a grid
walkthrough. On each Entity then the local operator is called.
Before st
r
ating the walkthrough the prepareGlobal method of the local
Before sta
r
ting the walk
through the prepareGlobal method of the local
operator is called once. Then during the walkthrough on each entity the
methods prepareLocal, applyLocal, and finalizeLocal are called respectively.
After the walkthorugh the method finalizeGlobal of the local operator is
...
...
@@ -28,37 +28,30 @@ namespace Dune {
There are two ways to change a discrete operator, namely by adding
another discrete operator or by multiplying with a scalar.
The result of a sum has to be a mapping ( :-( ).
DiscreteOperators which differ only by there LocalOperatorImp
can be combinded via operator + and sclaed
via operator *. This means you can combine your schemes all working on the
same types of DiscreteFunctions but all doing different things on one
entity. An example how to use this operator class can be found in
duneapps/tester/operator.
@{
*/
/*!
DiscreteOperator manages the grid walk through of and numerical scheme.
Here the scheme is defined by the LocalOperatorImp which defines the
action of the algorithm one on grid entity. DiscreteOperators which differ
only by there LocalOperatorImp can be combinded via operator + and sclaed
via operator *. This means you can combine your schemes all working on the
same types of DiscreteFunctions but all doing different things on one
entity. An example how to use this operator class can be found in
duneapps/tester/operator.
action of the algorithm one on grid entity.
*/
template
<
class
LocalOperatorImp
,
class
DFDomainType
,
class
DFRangeType
=
DFDomainType
>
class
DiscreteOperator
:
public
DiscreteOperatorDefault
<
LocalOperatorImp
,
DFDomainType
,
DFRangeType
,
DiscreteOperator
>
{
typedef
DFDomainType
DiscreteFunction
Type
;
typedef
typename
DFDomainType
::
FunctionSpaceType
::
RangeField
RangeField
Type
;
typedef
typename
DiscreteFunctionType
::
FunctionSpaceType
::
RangeField
RangeFieldType
;
typedef
ScaledLocalOperator
<
LocalOperatorImp
,
typename
DiscreteFunctionType
::
RangeFieldType
>
ScalOperatorType
;
typedef
DiscreteOperator
<
ScalOperatorType
,
DFDomainType
,
DFRangeType
>
ScalDiscrType
;
typedef
typename
DiscreteOperatorDefaultType
::
DomainType
DomainType
;
typedef
typename
DiscreteOperatorDefaultType
::
RangeType
RangeType
;
typedef
typename
DiscreteOperatorDefaultType
::
DomainFieldType
DFieldType
;
typedef
typename
DiscreteOperatorDefaultType
::
RangeFieldType
RFieldType
;
typedef
typename
DFDomainType
::
DomainType
DomainType
;
typedef
typename
DFDomainType
::
RangeType
RangeType
;
typedef
typename
DFDomainType
::
DomainFieldType
DFieldType
;
typedef
typename
DFDomainType
::
RangeFieldType
RFieldType
;
//! remember what type this class has
typedef
Mapping
<
DFieldType
,
RFieldType
,
DomainType
,
RangeType
>
MappingType
;
...
...
@@ -66,7 +59,7 @@ namespace Dune {
public:
//! create DiscreteOperator with a LocalOperator
DiscreteOperator
(
LocalOperatorImp
&
op
,
bool
leaf
=
false
,
bool
printMsg
=
false
)
:
DiscreteOperatorDefaultType
(
op
)
:
localOp_
(
op
)
,
leaf_
(
leaf
),
prepared_
(
false
)
,
printMsg_
(
printMsg
)
{
if
(
printMsg_
)
...
...
@@ -77,7 +70,7 @@ namespace Dune {
template
<
class
LocalOperatorType
>
DiscreteOperator
(
const
DiscreteOperator
<
LocalOperatorType
,
DFDomainType
,
DFRangeType
>
&
copy
,
LocalOperatorImp
&
op
)
:
DiscreteOperatorDefaultType
(
op
)
:
localOp_
(
op
)
,
leaf_
(
copy
.
leaf_
),
prepared_
(
copy
.
prepared_
)
,
printMsg_
(
copy
.
printMsg_
)
{
if
(
printMsg_
)
...
...
@@ -95,7 +88,7 @@ namespace Dune {
//********************************************************************
//! apply operator which means make a grid walktrough on spezified level
//! and call the local operator on each entity
void
apply
(
const
DomainType
&
Arg
,
RangeType
&
Dest
)
const
void
apply
(
const
DF
DomainType
&
Arg
,
DF
RangeType
&
Dest
)
const
{
if
(
printMsg_
)
std
::
cout
<<
"DiscrOP::apply
\n
"
;
...
...
@@ -111,7 +104,7 @@ namespace Dune {
}
// useful typedefs
typedef
typename
D
iscreteFunctio
nType
::
FunctionSpace
FunctionSpaceType
;
typedef
typename
D
FDomai
nType
::
FunctionSpace
FunctionSpaceType
;
typedef
typename
FunctionSpaceType
::
GridType
GridType
;
// the corresponding grid
FunctionSpaceType
&
functionSpace_
=
dest
.
getFunctionSpace
();
...
...
@@ -158,14 +151,14 @@ namespace Dune {
private
:
//! remember time step size
template
<
class
ArgParamType
,
class
DestParamType
>
void
prepare
(
const
ArgParamType
&
arg
,
DestParamType
&
dest
)
void
prepare
(
const
ArgParamType
&
arg
,
DestParamType
&
dest
)
const
{
localOp_
.
prepareGlobal
(
arg
,
dest
);
prepared_
=
true
;
}
//! remember time step size
void
prepare
(
const
DomainType
&
Arg
,
RangeType
&
Dest
)
const
void
prepare
(
const
DF
DomainType
&
Arg
,
DF
RangeType
&
Dest
)
const
{
//localOp_.setArguments(Arg,Dest)
;
localOp_
.
prepareGlobal
(
Arg
,
Dest
);
...
...
@@ -173,7 +166,7 @@ namespace Dune {
}
//! finalize the operation
void
finalize
(
const
DomainType
&
Arg
,
RangeType
&
Dest
)
const
void
finalize
(
const
DF
DomainType
&
Arg
,
DF
RangeType
&
Dest
)
const
{
prepared_
=
false
;
localOp_
.
finalizeGlobal
();
...
...
@@ -181,7 +174,7 @@ namespace Dune {
template
<
class
GridIteratorType
>
void
applyOnGrid
(
GridIteratorType
&
it
,
GridIteratorType
&
endit
,
const
DomainType
&
Arg
,
RangeType
&
Dest
)
const
const
DF
DomainType
&
Arg
,
DF
RangeType
&
Dest
)
const
{
// erase destination function
Dest
.
clearLevel
(
this
->
level_
);
...
...
@@ -206,11 +199,16 @@ namespace Dune {
localOp_
.
finalizeLocal
(
*
it
);
}
}
public
:
//! return reference to local operator, is called from operator + and
//! operator *
LocalOperatorImp
&
getLocalOp
()
{
return
localOp_
;
}
// return printMsg variable for DiscreteOperatorDefault
bool
printInfo
()
{
return
printMsg_
;
}
bool
printInfo
()
const
{
return
printMsg_
;
}
//! Local operator which represents the numerical scheme
mutable
LocalOperatorImp
&
localOp_
;
//! if true use LeafIterator else LevelIterator
mutable
bool
leaf_
;
...
...
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