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
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
Nils-Arne Dreier
dune-common
Commits
b916289e
Commit
b916289e
authored
20 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
assignment on a given level
[[Imported from SVN: r778]]
parent
234f1718
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fem/common/discretefunction.cc
+19
-8
19 additions, 8 deletions
fem/common/discretefunction.cc
fem/common/discretefunction.hh
+7
-1
7 additions, 1 deletion
fem/common/discretefunction.hh
with
26 additions
and
9 deletions
fem/common/discretefunction.cc
+
19
−
8
View file @
b916289e
...
...
@@ -61,34 +61,45 @@ namespace Dune
}
// assign
// assign
on maxlevel
template
<
class
DiscreteFunctionSpaceType
,
class
DofIteratorImp
,
template
<
class
,
class
>
class
LocalFunctionIteratorImp
,
class
DiscreteFunctionImp
>
inline
Vector
<
typename
DiscreteFunctionSpaceType
::
RangeField
>
&
DiscreteFunctionDefault
<
DiscreteFunctionSpaceType
,
DofIteratorImp
,
LocalFunctionIteratorImp
,
DiscreteFunctionImp
>::
assign
(
const
Vector
<
typename
DiscreteFunctionSpaceType
::
RangeField
>
&
g
)
{
int
level
=
this
->
getFunctionSpace
().
getGrid
().
maxlevel
();
assign
(
g
,
level
);
return
*
this
;
}
// assign on a given level
template
<
class
DiscreteFunctionSpaceType
,
class
DofIteratorImp
,
template
<
class
,
class
>
class
LocalFunctionIteratorImp
,
class
DiscreteFunctionImp
>
inline
Vector
<
typename
DiscreteFunctionSpaceType
::
RangeField
>
&
DiscreteFunctionDefault
<
DiscreteFunctionSpaceType
,
DofIteratorImp
,
LocalFunctionIteratorImp
,
DiscreteFunctionImp
>::
assign
(
const
Vector
<
typename
DiscreteFunctionSpaceType
::
RangeField
>
&
g
,
int
level
)
{
typedef
DiscreteFunctionDefault
<
DiscreteFunctionSpaceType
,
DofIteratorImp
,
LocalFunctionIteratorImp
,
DiscreteFunctionImp
>
DiscreteFunctionDefaultType
;
DiscreteFunctionDefaultType
&
gc
=
const_cast
<
DiscreteFunctionDefaultType
&>
(
static_cast
<
const
DiscreteFunctionDefaultType
&>
(
g
));
// we would need const_iterators.....
int
level
=
this
->
getFunctionSpace
().
getGrid
().
maxlevel
();
/** \todo we would need const_iterators..... */
DofIteratorImp
it
=
this
->
dbegin
(
level
);
DofIteratorImp
endit
=
this
->
dend
(
level
);
DofIteratorImp
git
=
gc
.
dbegin
(
level
);
for
(
DofIteratorImp
it
=
this
->
dbegin
(
level
);
it
!=
endit
;
++
it
)
{
for
(;
it
!=
endit
;
++
it
,
++
git
)
*
it
=
*
git
;
++
git
;
}
return
*
this
;
}
// operator =
template
<
class
DiscreteFunctionSpaceType
,
class
DofIteratorImp
,
template
<
class
,
class
>
class
LocalFunctionIteratorImp
,
class
DiscreteFunctionImp
>
...
...
This diff is collapsed.
Click to expand it.
fem/common/discretefunction.hh
+
7
−
1
View file @
b916289e
...
...
@@ -23,6 +23,8 @@ namespace Dune {
typedef
std
::
basic_string
<
char
>
StringType
;
/** \brief ???
* \todo Please doc me! */
template
<
typename
T
>
StringType
typeIdentifier
()
{
...
...
@@ -204,10 +206,14 @@ namespace Dune {
RangeFieldType
scalarProductDofs
(
const
DiscreteFunctionDefault
&
g
,
int
level
)
const
;
//! Assignment
//! Assignment
on maxlevel
Vector
<
RangeFieldType
>
&
assign
(
const
Vector
<
RangeFieldType
>
&
g
);
//! Assignment on a given level
Vector
<
RangeFieldType
>
&
assign
(
const
Vector
<
RangeFieldType
>
&
g
,
int
level
);
//! Assignment operator
Vector
<
RangeFieldType
>
&
operator
=
(
const
Vector
<
RangeFieldType
>
&
g
);
...
...
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