Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
podlesny
dune-tectonic
Commits
82b6ab50
Commit
82b6ab50
authored
11 years ago
by
Elias Pipping
Browse files
Options
Downloads
Patches
Plain Diff
[Cleanup] Improve handling of ignored DOFs
parent
3df2a133
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
dune/tectonic/ellipticenergy.hh
+6
-4
6 additions, 4 deletions
dune/tectonic/ellipticenergy.hh
dune/tectonic/myblockproblem.hh
+1
-17
1 addition, 17 deletions
dune/tectonic/myblockproblem.hh
with
7 additions
and
21 deletions
dune/tectonic/ellipticenergy.hh
+
6
−
4
View file @
82b6ab50
...
...
@@ -19,7 +19,8 @@ template <size_t dim> class EllipticEnergy {
using
Nonlinearity
=
LocalFriction
<
dim
>
;
EllipticEnergy
(
SmallMatrix
const
&
A
,
SmallVector
const
&
b
,
shared_ptr
<
Nonlinearity
const
>
phi
,
size_t
ignore
=
dim
)
shared_ptr
<
Nonlinearity
const
>
phi
,
typename
Dune
::
BitSetVector
<
dim
>::
const_reference
ignore
)
:
A
(
A
),
b
(
b
),
phi
(
phi
),
ignore
(
ignore
)
{}
double
operator
()(
SmallVector
const
&
v
)
const
{
...
...
@@ -31,15 +32,16 @@ template <size_t dim> class EllipticEnergy {
shared_ptr
<
Nonlinearity
const
>
const
phi
;
/* Dimension that should be ignored; goes from 0 to dim-1; the
special value dim means that no dimension should be ignored */
size_t
const
ignore
;
typename
Dune
::
BitSetVector
<
dim
>::
const_reference
const
ignore
;
void
gradient
(
SmallVector
const
&
x
,
SmallVector
&
y
)
const
{
A
.
mv
(
x
,
y
);
y
-=
b
;
phi
->
addGradient
(
x
,
y
);
if
(
ignore
!=
dim
)
y
[
ignore
]
=
0
;
for
(
size_t
i
=
0
;
i
<
dim
;
++
i
)
if
(
ignore
[
i
])
y
[
i
]
=
0
;
}
};
}
...
...
This diff is collapsed.
Click to expand it.
dune/tectonic/myblockproblem.hh
+
1
−
17
View file @
82b6ab50
...
...
@@ -239,22 +239,6 @@ class MyBlockProblem<ConvexProblem>::IterateObject {
LocalVector
&
ui
,
size_t
m
,
typename
Dune
::
BitSetVector
<
block_size
>::
const_reference
ignore
)
{
{
size_t
ic
=
block_size
;
// Special value that indicates nothing should be ignored
switch
(
ignore
.
count
())
{
case
0
:
// Full problem
break
;
case
1
:
for
(
ic
=
0
;
ic
<
block_size
;
++
ic
)
if
(
ignore
[
ic
])
break
;
break
;
case
block_size
:
// Ignore the whole node
return
;
default:
assert
(
false
);
}
LocalMatrix
const
*
localA
=
nullptr
;
LocalVector
localb
(
problem
.
f
[
m
]);
...
...
@@ -269,7 +253,7 @@ class MyBlockProblem<ConvexProblem>::IterateObject {
assert
(
localA
!=
nullptr
);
auto
const
phi
=
problem
.
phi
.
restriction
(
m
);
Dune
::
EllipticEnergy
<
block_size
>
localJ
(
*
localA
,
localb
,
phi
,
i
c
);
Dune
::
EllipticEnergy
<
block_size
>
localJ
(
*
localA
,
localb
,
phi
,
i
gnore
);
Dune
::
minimise
(
localJ
,
ui
,
localsteps
,
bisection
);
}
}
...
...
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